Changeset 223746 in webkit
- Timestamp:
- Oct 20, 2017 12:50:08 AM (6 years ago)
- Location:
- trunk/Source
- Files:
-
- 34 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/JSObjectRef.cpp
r222617 r223746 262 262 263 263 JSObject* jsObject = toJS(object); 264 return toRef(exec, jsObject->getPrototypeDirect( ));264 return toRef(exec, jsObject->getPrototypeDirect(exec->vm())); 265 265 } 266 266 -
trunk/Source/JavaScriptCore/ChangeLog
r223745 r223746 1 2017-10-20 Saam Barati <sbarati@apple.com> 2 3 Optimize accesses to how we get the direct prototype 4 https://bugs.webkit.org/show_bug.cgi?id=178548 5 6 Reviewed by Yusuke Suzuki. 7 8 This patch makes JSObject::getPrototypeDirect take VM& as a parameter 9 so it can use the faster version of the structure accessor function. 10 The reason for making this change is that JSObjet::getPrototypeDirect 11 is called on the hot path in property lookup. 12 13 * API/JSObjectRef.cpp: 14 (JSObjectGetPrototype): 15 * jsc.cpp: 16 (WTF::DOMJITGetterBaseJSObject::DOMJITAttribute::slowCall): 17 (WTF::DOMJITGetterBaseJSObject::customGetter): 18 (functionCreateProxy): 19 * runtime/ArrayPrototype.cpp: 20 (JSC::speciesWatchpointIsValid): 21 * runtime/ErrorInstance.cpp: 22 (JSC::ErrorInstance::sanitizedToString): 23 * runtime/JSArray.cpp: 24 (JSC::JSArray::isIteratorProtocolFastAndNonObservable): 25 * runtime/JSGlobalObject.cpp: 26 (JSC::JSGlobalObject::init): 27 (JSC::lastInPrototypeChain): 28 (JSC::JSGlobalObject::resetPrototype): 29 (JSC::JSGlobalObject::finishCreation): 30 * runtime/JSGlobalObjectInlines.h: 31 (JSC::JSGlobalObject::objectPrototypeIsSane): 32 (JSC::JSGlobalObject::arrayPrototypeChainIsSane): 33 (JSC::JSGlobalObject::stringPrototypeChainIsSane): 34 * runtime/JSLexicalEnvironment.cpp: 35 (JSC::JSLexicalEnvironment::getOwnPropertySlot): 36 * runtime/JSMap.cpp: 37 (JSC::JSMap::isIteratorProtocolFastAndNonObservable): 38 * runtime/JSObject.cpp: 39 (JSC::JSObject::calculatedClassName): 40 (JSC::JSObject::setPrototypeWithCycleCheck): 41 (JSC::JSObject::getPrototype): 42 (JSC::JSObject::attemptToInterceptPutByIndexOnHoleForPrototype): 43 (JSC::JSObject::attemptToInterceptPutByIndexOnHole): 44 (JSC::JSObject::anyObjectInChainMayInterceptIndexedAccesses const): 45 (JSC::JSObject::prototypeChainMayInterceptStoreTo): 46 * runtime/JSObject.h: 47 (JSC::JSObject::finishCreation): 48 (JSC::JSObject::getPrototypeDirect const): 49 (JSC::JSObject::getPrototype): 50 * runtime/JSObjectInlines.h: 51 (JSC::JSObject::canPerformFastPutInline): 52 (JSC::JSObject::getPropertySlot): 53 (JSC::JSObject::getNonIndexPropertySlot): 54 * runtime/JSProxy.cpp: 55 (JSC::JSProxy::setTarget): 56 * runtime/JSSet.cpp: 57 (JSC::JSSet::isIteratorProtocolFastAndNonObservable): 58 * runtime/ProgramExecutable.cpp: 59 (JSC::ProgramExecutable::initializeGlobalProperties): 60 * runtime/StructureInlines.h: 61 (JSC::Structure::isValid const): 62 1 63 2017-10-20 Yusuke Suzuki <utatane.tea@gmail.com> 2 64 -
trunk/Source/JavaScriptCore/jsc.cpp
r223738 r223746 997 997 NativeCallFrameTracer tracer(&vm, exec); 998 998 JSObject* object = static_cast<JSObject*>(pointer); 999 return JSValue::encode(object->getPrototypeDirect( ));999 return JSValue::encode(object->getPrototypeDirect(vm)); 1000 1000 } 1001 1001 … … 1024 1024 JSObject* thisObject = jsDynamicCast<JSObject*>(vm, JSValue::decode(thisValue)); 1025 1025 RELEASE_ASSERT(thisObject); 1026 return JSValue::encode(thisObject->getPrototypeDirect( ));1026 return JSValue::encode(thisObject->getPrototypeDirect(vm)); 1027 1027 } 1028 1028 }; … … 2212 2212 return JSValue::encode(jsUndefined()); 2213 2213 JSObject* jsTarget = asObject(target.asCell()); 2214 Structure* structure = JSProxy::createStructure(vm, exec->lexicalGlobalObject(), jsTarget->getPrototypeDirect( ), ImpureProxyType);2214 Structure* structure = JSProxy::createStructure(vm, exec->lexicalGlobalObject(), jsTarget->getPrototypeDirect(vm), ImpureProxyType); 2215 2215 JSProxy* proxy = JSProxy::create(vm, structure, jsTarget); 2216 2216 return JSValue::encode(proxy); -
trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp
r223027 r223746 203 203 204 204 return !thisObject->hasCustomProperties() 205 && arrayPrototype == thisObject->getPrototypeDirect( )205 && arrayPrototype == thisObject->getPrototypeDirect(globalObject->vm()) 206 206 && globalObject->arraySpeciesWatchpoint().stateOnJSThread() == IsWatched; 207 207 } -
trunk/Source/JavaScriptCore/runtime/ErrorInstance.cpp
r222473 r223746 163 163 break; 164 164 } 165 currentObj = obj->getPrototypeDirect( );165 currentObj = obj->getPrototypeDirect(vm); 166 166 } 167 167 scope.assertNoException(); -
trunk/Source/JavaScriptCore/runtime/JSArray.cpp
r222827 r223746 1293 1293 return false; 1294 1294 1295 if (getPrototypeDirect() != globalObject->arrayPrototype())1296 return false;1297 1298 1295 VM& vm = globalObject->vm(); 1296 if (getPrototypeDirect(vm) != globalObject->arrayPrototype()) 1297 return false; 1298 1299 1299 if (getDirectOffset(vm, vm.propertyNames->iteratorSymbol) != invalidOffset) 1300 1300 return false; -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
r223594 r223746 1027 1027 } 1028 1028 1029 resetPrototype(vm, getPrototypeDirect( ));1029 resetPrototype(vm, getPrototypeDirect(vm)); 1030 1030 } 1031 1031 … … 1097 1097 } 1098 1098 1099 static inline JSObject* lastInPrototypeChain( JSObject* object)1099 static inline JSObject* lastInPrototypeChain(VM& vm, JSObject* object) 1100 1100 { 1101 1101 JSObject* o = object; 1102 while (o->getPrototypeDirect( ).isObject())1103 o = asObject(o->getPrototypeDirect( ));1102 while (o->getPrototypeDirect(vm).isObject()) 1103 o = asObject(o->getPrototypeDirect(vm)); 1104 1104 return o; 1105 1105 } … … 1151 1151 // a different global object that have prototypes from our global object. 1152 1152 bool foundGlobalObject = false; 1153 VM& vm = m_globalObject->vm(); 1153 1154 for (JSObject* current = object; ;) { 1154 1155 if (current->globalObject() == m_globalObject) { … … 1157 1158 } 1158 1159 1159 JSValue prototypeValue = current->getPrototypeDirect( );1160 JSValue prototypeValue = current->getPrototypeDirect(vm); 1160 1161 if (prototypeValue.isNull()) 1161 1162 break; … … 1228 1229 setPrototypeDirect(vm, prototype); 1229 1230 1230 JSObject* oldLastInPrototypeChain = lastInPrototypeChain( this);1231 JSObject* oldLastInPrototypeChain = lastInPrototypeChain(vm, this); 1231 1232 JSObject* objectPrototype = m_objectPrototype.get(); 1232 1233 if (oldLastInPrototypeChain != objectPrototype) … … 1527 1528 m_runtimeFlags = m_globalObjectMethodTable->javaScriptRuntimeFlags(this); 1528 1529 init(vm); 1529 setGlobalThis(vm, JSProxy::create(vm, JSProxy::createStructure(vm, this, getPrototypeDirect( ), PureForwardingProxyType), this));1530 setGlobalThis(vm, JSProxy::create(vm, JSProxy::createStructure(vm, this, getPrototypeDirect(vm), PureForwardingProxyType), this)); 1530 1531 } 1531 1532 -
trunk/Source/JavaScriptCore/runtime/JSGlobalObjectInlines.h
r218836 r223746 36 36 { 37 37 return !hasIndexedProperties(m_objectPrototype->indexingType()) 38 && m_objectPrototype->getPrototypeDirect( ).isNull();38 && m_objectPrototype->getPrototypeDirect(vm()).isNull(); 39 39 } 40 40 … … 42 42 { 43 43 return !hasIndexedProperties(m_arrayPrototype->indexingType()) 44 && m_arrayPrototype->getPrototypeDirect( ) == m_objectPrototype.get()44 && m_arrayPrototype->getPrototypeDirect(vm()) == m_objectPrototype.get() 45 45 && objectPrototypeIsSane(); 46 46 } … … 49 49 { 50 50 return !hasIndexedProperties(m_stringPrototype->indexingType()) 51 && m_stringPrototype->getPrototypeDirect( ) == m_objectPrototype.get()51 && m_stringPrototype->getPrototypeDirect(vm()) == m_objectPrototype.get() 52 52 && objectPrototypeIsSane(); 53 53 } -
trunk/Source/JavaScriptCore/runtime/JSLexicalEnvironment.cpp
r222473 r223746 106 106 // lexical environment object getter properties or a prototype. 107 107 ASSERT(!thisObject->hasGetterSetterProperties()); 108 ASSERT(thisObject->getPrototypeDirect( ).isNull());108 ASSERT(thisObject->getPrototypeDirect(exec->vm()).isNull()); 109 109 return false; 110 110 } -
trunk/Source/JavaScriptCore/runtime/JSMap.cpp
r222827 r223746 57 57 return true; 58 58 59 if (getPrototypeDirect() != globalObject->mapPrototype()) 59 VM& vm = globalObject->vm(); 60 if (getPrototypeDirect(vm) != globalObject->mapPrototype()) 60 61 return false; 61 62 62 VM& vm = globalObject->vm();63 63 if (getDirectOffset(vm, vm.propertyNames->iteratorSymbol) != invalidOffset) 64 64 return false; -
trunk/Source/JavaScriptCore/runtime/JSObject.cpp
r223715 r223746 532 532 533 533 ExecState* exec = globalObject->globalExec(); 534 PropertySlot slot(object->getPrototypeDirect( ), PropertySlot::InternalMethodType::VMInquiry);534 PropertySlot slot(object->getPrototypeDirect(vm), PropertySlot::InternalMethodType::VMInquiry); 535 535 PropertyName constructor(vm.propertyNames->constructor); 536 536 if (object->getPropertySlot(exec, constructor, slot)) { … … 1672 1672 ASSERT(methodTable(vm)->toThis(this, exec, NotStrictMode) == this); 1673 1673 1674 if (this->getPrototypeDirect( ) == prototype)1674 if (this->getPrototypeDirect(vm) == prototype) 1675 1675 return true; 1676 1676 … … 1691 1691 if (UNLIKELY(asObject(nextPrototype)->type() == ProxyObjectType)) 1692 1692 break; // We're done. Set the prototype. 1693 nextPrototype = asObject(nextPrototype)->getPrototypeDirect( );1693 nextPrototype = asObject(nextPrototype)->getPrototypeDirect(vm); 1694 1694 } 1695 1695 setPrototypeDirect(vm, prototype); … … 1702 1702 } 1703 1703 1704 JSValue JSObject::getPrototype(JSObject* object, ExecState* )1705 { 1706 return object->getPrototypeDirect( );1704 JSValue JSObject::getPrototype(JSObject* object, ExecState* exec) 1705 { 1706 return object->getPrototypeDirect(exec->vm()); 1707 1707 } 1708 1708 … … 2539 2539 bool JSObject::attemptToInterceptPutByIndexOnHoleForPrototype(ExecState* exec, JSValue thisValue, unsigned i, JSValue value, bool shouldThrow, bool& putResult) 2540 2540 { 2541 VM& vm = exec->vm(); 2541 2542 for (JSObject* current = this; ;) { 2542 2543 // This has the same behavior with respect to prototypes as JSObject::put(). It only … … 2560 2561 } 2561 2562 2562 JSValue prototypeValue = current->getPrototypeDirect( );2563 JSValue prototypeValue = current->getPrototypeDirect(vm); 2563 2564 if (prototypeValue.isNull()) 2564 2565 return false; … … 2570 2571 bool JSObject::attemptToInterceptPutByIndexOnHole(ExecState* exec, unsigned i, JSValue value, bool shouldThrow, bool& putResult) 2571 2572 { 2572 JSValue prototypeValue = getPrototypeDirect( );2573 JSValue prototypeValue = getPrototypeDirect(exec->vm()); 2573 2574 if (prototypeValue.isNull()) 2574 2575 return false; … … 3681 3682 return true; 3682 3683 3683 JSValue prototype = current->getPrototypeDirect( );3684 JSValue prototype = current->getPrototypeDirect(vm); 3684 3685 if (prototype.isNull()) 3685 3686 return false; … … 3695 3696 3696 3697 for (JSObject* current = this; ;) { 3697 JSValue prototype = current->getPrototypeDirect( );3698 JSValue prototype = current->getPrototypeDirect(vm); 3698 3699 if (prototype.isNull()) 3699 3700 return false; -
trunk/Source/JavaScriptCore/runtime/JSObject.h
r223715 r223746 133 133 // without consulting the method table. This is akin to getting the [[Prototype]] 134 134 // internal field directly as described in the specification. 135 JSValue getPrototypeDirect( ) const;135 JSValue getPrototypeDirect(VM&) const; 136 136 137 137 // This sets the prototype without checking for cycles and without … … 874 874 Base::finishCreation(vm); 875 875 ASSERT(inherits(vm, info())); 876 ASSERT(structure()->hasPolyProto() || getPrototypeDirect( ).isNull() || Heap::heap(this) == Heap::heap(getPrototypeDirect()));876 ASSERT(structure()->hasPolyProto() || getPrototypeDirect(vm).isNull() || Heap::heap(this) == Heap::heap(getPrototypeDirect(vm))); 877 877 ASSERT(structure()->isObject()); 878 878 ASSERT(classInfo(vm)); … … 1304 1304 } 1305 1305 1306 inline JSValue JSObject::getPrototypeDirect( ) const1307 { 1308 return structure( )->storedPrototype(this);1306 inline JSValue JSObject::getPrototypeDirect(VM& vm) const 1307 { 1308 return structure(vm)->storedPrototype(this); 1309 1309 } 1310 1310 … … 1314 1314 MethodTable::GetPrototypeFunctionPtr defaultGetPrototype = JSObject::getPrototype; 1315 1315 if (LIKELY(getPrototypeMethod == defaultGetPrototype)) 1316 return getPrototypeDirect( );1316 return getPrototypeDirect(vm); 1317 1317 return getPrototypeMethod(this, exec); 1318 1318 } -
trunk/Source/JavaScriptCore/runtime/JSObjectInlines.h
r222827 r223746 74 74 return false; 75 75 76 prototype = obj->getPrototypeDirect( );76 prototype = obj->getPrototypeDirect(vm); 77 77 if (prototype.isNull()) 78 78 return true; … … 117 117 JSValue prototype; 118 118 if (LIKELY(structure->classInfo()->methodTable.getPrototype == defaultGetPrototype || slot.internalMethodType() == PropertySlot::InternalMethodType::VMInquiry)) 119 prototype = object->getPrototypeDirect( );119 prototype = object->getPrototypeDirect(vm); 120 120 else { 121 121 prototype = object->getPrototype(vm, exec); … … 151 151 JSValue prototype; 152 152 if (LIKELY(structure->classInfo()->methodTable.getPrototype == defaultGetPrototype || slot.internalMethodType() == PropertySlot::InternalMethodType::VMInquiry)) 153 prototype = object->getPrototypeDirect( );153 prototype = object->getPrototypeDirect(vm); 154 154 else { 155 155 prototype = object->getPrototype(vm, exec); -
trunk/Source/JavaScriptCore/runtime/JSProxy.cpp
r223123 r223746 47 47 { 48 48 m_target.set(vm, this, globalObject); 49 setPrototypeDirect(vm, globalObject->getPrototypeDirect( ));49 setPrototypeDirect(vm, globalObject->getPrototypeDirect(vm)); 50 50 } 51 51 -
trunk/Source/JavaScriptCore/runtime/JSSet.cpp
r222827 r223746 57 57 return true; 58 58 59 if (getPrototypeDirect() != globalObject->jsSetPrototype()) 59 VM& vm = globalObject->vm(); 60 if (getPrototypeDirect(vm) != globalObject->jsSetPrototype()) 60 61 return false; 61 62 62 VM& vm = globalObject->vm();63 63 if (getDirectOffset(vm, vm.propertyNames->iteratorSymbol) != invalidOffset) 64 64 return false; -
trunk/Source/JavaScriptCore/runtime/ProgramExecutable.cpp
r222617 r223746 105 105 return error.toErrorObject(globalObject, source()); 106 106 107 JSValue nextPrototype = globalObject->getPrototypeDirect( );107 JSValue nextPrototype = globalObject->getPrototypeDirect(vm); 108 108 while (nextPrototype && nextPrototype.isObject()) { 109 109 if (UNLIKELY(asObject(nextPrototype)->type() == ProxyObjectType)) { … … 111 111 return createTypeError(exec, ASCIILiteral("Proxy is not allowed in the global prototype chain.")); 112 112 } 113 nextPrototype = asObject(nextPrototype)->getPrototypeDirect( );113 nextPrototype = asObject(nextPrototype)->getPrototypeDirect(vm); 114 114 } 115 115 -
trunk/Source/JavaScriptCore/runtime/StructureInlines.h
r223715 r223746 244 244 return false; 245 245 246 VM& vm = globalObject->vm(); 246 247 JSValue prototype = prototypeForLookup(globalObject, base); 247 248 WriteBarrier<Structure>* cachedStructure = cachedPrototypeChain->head(); 248 249 while (*cachedStructure && !prototype.isNull()) { 249 if (asObject(prototype)->structure( ) != cachedStructure->get())250 if (asObject(prototype)->structure(vm) != cachedStructure->get()) 250 251 return false; 251 252 ++cachedStructure; 252 prototype = asObject(prototype)->getPrototypeDirect( );253 prototype = asObject(prototype)->getPrototypeDirect(vm); 253 254 } 254 255 return prototype.isNull() && !*cachedStructure; -
trunk/Source/WebCore/ChangeLog
r223744 r223746 1 2017-10-20 Saam Barati <sbarati@apple.com> 2 3 Optimize accesses to how we get the direct prototype 4 https://bugs.webkit.org/show_bug.cgi?id=178548 5 6 Reviewed by Yusuke Suzuki. 7 8 No new tests: no functionality change. 9 10 * bindings/js/JSDOMAbstractOperations.h: 11 (WebCore::isVisibleNamedProperty): 12 (WebCore::accessVisibleNamedProperty): 13 * bindings/js/JSDOMWindowBase.cpp: 14 (WebCore::toJSDOMWindow): 15 * bindings/js/JSDOMWindowProperties.cpp: 16 (WebCore::JSDOMWindowProperties::getOwnPropertySlot): 17 * bindings/js/JSPluginElementFunctions.cpp: 18 (WebCore::pluginElementCustomGetOwnPropertySlot): 19 * bindings/js/WorkerScriptController.cpp: 20 (WebCore::WorkerScriptController::initScript): 21 * bindings/scripts/CodeGeneratorJS.pm: 22 (GeneratePut): 23 (GeneratePutByIndex): 24 (GenerateConstructorHelperMethods): 25 * bindings/scripts/test/JS/JSTestGlobalObject.cpp: 26 (WebCore::JSTestGlobalObjectConstructor::initializeProperties): 27 * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp: 28 (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::put): 29 (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::putByIndex): 30 * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp: 31 (WebCore::JSTestNamedAndIndexedSetterThrowingException::put): 32 (WebCore::JSTestNamedAndIndexedSetterThrowingException::putByIndex): 33 * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp: 34 (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::put): 35 (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::putByIndex): 36 * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp: 37 (WebCore::JSTestNamedSetterNoIdentifier::put): 38 (WebCore::JSTestNamedSetterNoIdentifier::putByIndex): 39 * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp: 40 (WebCore::JSTestNamedSetterThrowingException::put): 41 (WebCore::JSTestNamedSetterThrowingException::putByIndex): 42 * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp: 43 (WebCore::JSTestNamedSetterWithIdentifier::put): 44 (WebCore::JSTestNamedSetterWithIdentifier::putByIndex): 45 * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp: 46 (WebCore::JSTestNamedSetterWithIndexedGetter::put): 47 (WebCore::JSTestNamedSetterWithIndexedGetter::putByIndex): 48 * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp: 49 (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::put): 50 (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::putByIndex): 51 * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp: 52 (WebCore::JSTestNamedSetterWithUnforgableProperties::put): 53 (WebCore::JSTestNamedSetterWithUnforgableProperties::putByIndex): 54 1 55 2017-10-20 Yusuke Suzuki <utatane.tea@gmail.com> 2 56 -
trunk/Source/WebCore/bindings/js/JSDOMAbstractOperations.h
r218126 r223746 73 73 // FIXME: Implement checking for 'named properties object'. 74 74 // 2. Set prototype to be the value of the internal [[Prototype]] property of prototype. 75 auto prototype = thisObject.getPrototypeDirect( );75 auto prototype = thisObject.getPrototypeDirect(state.vm()); 76 76 if (prototype.isObject() && JSC::asObject(prototype)->getPropertySlot(&state, propertyName, slot)) 77 77 return false; … … 113 113 // FIXME: Implement checking for 'named properties object'. 114 114 // 2. Set prototype to be the value of the internal [[Prototype]] property of prototype. 115 auto prototype = thisObject.getPrototypeDirect( );115 auto prototype = thisObject.getPrototypeDirect(state.vm()); 116 116 if (prototype.isObject() && JSC::asObject(prototype)->getPropertySlot(&state, propertyName, slot)) 117 117 return std::nullopt; -
trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp
r223476 r223746 283 283 if (classInfo == JSDOMWindowProxy::info()) 284 284 return jsCast<JSDOMWindowProxy*>(object)->window(); 285 value = object->getPrototypeDirect( );285 value = object->getPrototypeDirect(vm); 286 286 } 287 287 return nullptr; -
trunk/Source/WebCore/bindings/js/JSDOMWindowProperties.cpp
r222473 r223746 86 86 if (Base::getOwnPropertySlot(thisObject, state, propertyName, slot)) 87 87 return true; 88 JSValue proto = thisObject->getPrototypeDirect( );88 JSValue proto = thisObject->getPrototypeDirect(state->vm()); 89 89 if (proto.isObject() && jsCast<JSObject*>(proto)->hasProperty(state, propertyName)) 90 90 return false; -
trunk/Source/WebCore/bindings/js/JSPluginElementFunctions.cpp
r223476 r223746 113 113 { 114 114 if (!element->globalObject()->world().isNormal()) { 115 JSC::JSValue proto = element->getPrototypeDirect( );115 JSC::JSValue proto = element->getPrototypeDirect(exec->vm()); 116 116 if (proto.isObject() && JSC::jsCast<JSC::JSObject*>(asObject(proto))->hasProperty(exec, propertyName)) 117 117 return false; -
trunk/Source/WebCore/bindings/js/WorkerScriptController.cpp
r223476 r223746 115 115 116 116 ASSERT(m_workerGlobalScopeWrapper->globalObject() == m_workerGlobalScopeWrapper); 117 ASSERT(asObject(m_workerGlobalScopeWrapper->getPrototypeDirect( ))->globalObject() == m_workerGlobalScopeWrapper);117 ASSERT(asObject(m_workerGlobalScopeWrapper->getPrototypeDirect(*m_vm))->globalObject() == m_workerGlobalScopeWrapper); 118 118 119 119 m_consoleClient = std::make_unique<WorkerConsoleClient>(*m_workerGlobalScope); -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r223725 r223746 955 955 if (!$overrideBuiltins) { 956 956 push(@$outputArray, " PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry };\n"); 957 push(@$outputArray, " JSValue prototype = thisObject->getPrototypeDirect( );\n");957 push(@$outputArray, " JSValue prototype = thisObject->getPrototypeDirect(state->vm());\n"); 958 958 push(@$outputArray, " if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) {\n"); 959 959 $additionalIndent .= " "; … … 1024 1024 if (!$overrideBuiltins) { 1025 1025 push(@$outputArray, " PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry };\n"); 1026 push(@$outputArray, " JSValue prototype = thisObject->getPrototypeDirect( );\n");1026 push(@$outputArray, " JSValue prototype = thisObject->getPrototypeDirect(state->vm());\n"); 1027 1027 push(@$outputArray, " if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) {\n"); 1028 1028 $additionalIndent .= " "; … … 7115 7115 # https://heycam.github.io/webidl/#interface-prototype-object 7116 7116 if (ShouldUseGlobalObjectPrototype($interface)) { 7117 push(@$outputArray, " putDirect(vm, vm.propertyNames->prototype, globalObject.getPrototypeDirect( ), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);\n");7117 push(@$outputArray, " putDirect(vm, vm.propertyNames->prototype, globalObject.getPrototypeDirect(vm), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);\n"); 7118 7118 } elsif ($interface->isCallback) { 7119 7119 push(@$outputArray, " UNUSED_PARAM(globalObject);\n"); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp
r223476 r223746 128 128 template<> void JSTestGlobalObjectConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) 129 129 { 130 putDirect(vm, vm.propertyNames->prototype, globalObject.getPrototypeDirect( ), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);130 putDirect(vm, vm.propertyNames->prototype, globalObject.getPrototypeDirect(vm), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); 131 131 putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String(ASCIILiteral("TestGlobalObject"))), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); 132 132 putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp
r223476 r223746 216 216 if (!propertyName.isSymbol()) { 217 217 PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry }; 218 JSValue prototype = thisObject->getPrototypeDirect( );218 JSValue prototype = thisObject->getPrototypeDirect(state->vm()); 219 219 if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) { 220 220 auto throwScope = DECLARE_THROW_SCOPE(state->vm()); … … 244 244 auto propertyName = Identifier::from(state, index); 245 245 PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry }; 246 JSValue prototype = thisObject->getPrototypeDirect( );246 JSValue prototype = thisObject->getPrototypeDirect(state->vm()); 247 247 if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) { 248 248 auto throwScope = DECLARE_THROW_SCOPE(state->vm()); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp
r223476 r223746 216 216 if (!propertyName.isSymbol()) { 217 217 PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry }; 218 JSValue prototype = thisObject->getPrototypeDirect( );218 JSValue prototype = thisObject->getPrototypeDirect(state->vm()); 219 219 if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) { 220 220 auto throwScope = DECLARE_THROW_SCOPE(state->vm()); … … 244 244 auto propertyName = Identifier::from(state, index); 245 245 PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry }; 246 JSValue prototype = thisObject->getPrototypeDirect( );246 JSValue prototype = thisObject->getPrototypeDirect(state->vm()); 247 247 if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) { 248 248 auto throwScope = DECLARE_THROW_SCOPE(state->vm()); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp
r223476 r223746 225 225 if (!propertyName.isSymbol()) { 226 226 PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry }; 227 JSValue prototype = thisObject->getPrototypeDirect( );227 JSValue prototype = thisObject->getPrototypeDirect(state->vm()); 228 228 if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) { 229 229 auto throwScope = DECLARE_THROW_SCOPE(state->vm()); … … 253 253 auto propertyName = Identifier::from(state, index); 254 254 PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry }; 255 JSValue prototype = thisObject->getPrototypeDirect( );255 JSValue prototype = thisObject->getPrototypeDirect(state->vm()); 256 256 if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) { 257 257 auto throwScope = DECLARE_THROW_SCOPE(state->vm()); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp
r223476 r223746 188 188 if (!propertyName.isSymbol()) { 189 189 PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry }; 190 JSValue prototype = thisObject->getPrototypeDirect( );190 JSValue prototype = thisObject->getPrototypeDirect(state->vm()); 191 191 if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) { 192 192 auto throwScope = DECLARE_THROW_SCOPE(state->vm()); … … 208 208 auto propertyName = Identifier::from(state, index); 209 209 PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry }; 210 JSValue prototype = thisObject->getPrototypeDirect( );210 JSValue prototype = thisObject->getPrototypeDirect(state->vm()); 211 211 if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) { 212 212 auto throwScope = DECLARE_THROW_SCOPE(state->vm()); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp
r223476 r223746 188 188 if (!propertyName.isSymbol()) { 189 189 PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry }; 190 JSValue prototype = thisObject->getPrototypeDirect( );190 JSValue prototype = thisObject->getPrototypeDirect(state->vm()); 191 191 if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) { 192 192 auto throwScope = DECLARE_THROW_SCOPE(state->vm()); … … 208 208 auto propertyName = Identifier::from(state, index); 209 209 PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry }; 210 JSValue prototype = thisObject->getPrototypeDirect( );210 JSValue prototype = thisObject->getPrototypeDirect(state->vm()); 211 211 if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) { 212 212 auto throwScope = DECLARE_THROW_SCOPE(state->vm()); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp
r223476 r223746 194 194 if (!propertyName.isSymbol()) { 195 195 PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry }; 196 JSValue prototype = thisObject->getPrototypeDirect( );196 JSValue prototype = thisObject->getPrototypeDirect(state->vm()); 197 197 if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) { 198 198 auto throwScope = DECLARE_THROW_SCOPE(state->vm()); … … 214 214 auto propertyName = Identifier::from(state, index); 215 215 PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry }; 216 JSValue prototype = thisObject->getPrototypeDirect( );216 JSValue prototype = thisObject->getPrototypeDirect(state->vm()); 217 217 if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) { 218 218 auto throwScope = DECLARE_THROW_SCOPE(state->vm()); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp
r223476 r223746 217 217 if (!propertyName.isSymbol()) { 218 218 PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry }; 219 JSValue prototype = thisObject->getPrototypeDirect( );219 JSValue prototype = thisObject->getPrototypeDirect(state->vm()); 220 220 if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) { 221 221 auto throwScope = DECLARE_THROW_SCOPE(state->vm()); … … 237 237 auto propertyName = Identifier::from(state, index); 238 238 PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry }; 239 JSValue prototype = thisObject->getPrototypeDirect( );239 JSValue prototype = thisObject->getPrototypeDirect(state->vm()); 240 240 if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) { 241 241 auto throwScope = DECLARE_THROW_SCOPE(state->vm()); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp
r223476 r223746 225 225 if (!propertyName.isSymbol()) { 226 226 PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry }; 227 JSValue prototype = thisObject->getPrototypeDirect( );227 JSValue prototype = thisObject->getPrototypeDirect(state->vm()); 228 228 if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) { 229 229 auto throwScope = DECLARE_THROW_SCOPE(state->vm()); … … 253 253 auto propertyName = Identifier::from(state, index); 254 254 PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry }; 255 JSValue prototype = thisObject->getPrototypeDirect( );255 JSValue prototype = thisObject->getPrototypeDirect(state->vm()); 256 256 if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) { 257 257 auto throwScope = DECLARE_THROW_SCOPE(state->vm()); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp
r223476 r223746 212 212 if (!propertyName.isSymbol()) { 213 213 PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry }; 214 JSValue prototype = thisObject->getPrototypeDirect( );214 JSValue prototype = thisObject->getPrototypeDirect(state->vm()); 215 215 if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) { 216 216 auto throwScope = DECLARE_THROW_SCOPE(state->vm()); … … 232 232 auto propertyName = Identifier::from(state, index); 233 233 PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry }; 234 JSValue prototype = thisObject->getPrototypeDirect( );234 JSValue prototype = thisObject->getPrototypeDirect(state->vm()); 235 235 if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) { 236 236 auto throwScope = DECLARE_THROW_SCOPE(state->vm());
Note: See TracChangeset
for help on using the changeset viewer.