Ignore:
Timestamp:
Aug 27, 2020, 1:11:57 PM (5 years ago)
Author:
[email protected]
Message:

structureOrNull should take VM instead of getting it from the marked block
https://bugs.webkit.org/show_bug.cgi?id=215899

Reviewed by Yusuke Suzuki.

It's slightly faster use an existing VM over recomputing the address. It probably doesn't
happen to matter here for performance but it's good hygiene.

  • API/tests/JSWrapperMapTests.mm:

(+[JSWrapperMapTests testStructureIdentity]):

  • jit/JITOperations.cpp:
  • runtime/JSCJSValue.h:
  • runtime/JSCJSValueInlines.h:

(JSC::JSValue::structureOrNull const):
(JSC::JSValue::structureOrUndefined const): Deleted.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSCJSValueInlines.h

    r266107 r266251  
    11061106}
    11071107
    1108 inline Structure* JSValue::structureOrNull() const
     1108inline Structure* JSValue::structureOrNull(VM& vm) const
    11091109{
    11101110    if (isCell())
    1111         return asCell()->structure();
     1111        return asCell()->structure(vm);
    11121112    return nullptr;
    1113 }
    1114 
    1115 inline JSValue JSValue::structureOrUndefined() const
    1116 {
    1117     if (isCell())
    1118         return JSValue(asCell()->structure());
    1119     return jsUndefined();
    11201113}
    11211114
Note: See TracChangeset for help on using the changeset viewer.