Ignore:
Timestamp:
Sep 9, 2017, 9:21:45 AM (8 years ago)
Author:
[email protected]
Message:

Avoid duplicate computations of ExecState::vm().
https://bugs.webkit.org/show_bug.cgi?id=176647

Reviewed by Saam Barati.

Source/JavaScriptCore:

Because while computing ExecState::vm() is cheap, it is not free.

This patch also:

  1. gets rids of some convenience methods in CallFrame that implicitly does a ExecState::vm() computation. This minimizes the chance of us accidentally computing ExecState::vm() more than necessary.
  2. passes vm (when available) to methodTable().
  3. passes vm (when available) to JSLockHolder.
  • API/JSBase.cpp:

(JSCheckScriptSyntax):
(JSGarbageCollect):
(JSReportExtraMemoryCost):
(JSSynchronousGarbageCollectForDebugging):
(JSSynchronousEdenCollectForDebugging):

  • API/JSCallbackConstructor.h:

(JSC::JSCallbackConstructor::create):

  • API/JSCallbackObject.h:

(JSC::JSCallbackObject::create):

  • API/JSContext.mm:

(-[JSContext setException:]):

  • API/JSContextRef.cpp:

(JSContextGetGlobalObject):
(JSContextCreateBacktrace):

  • API/JSManagedValue.mm:

(-[JSManagedValue value]):

  • API/JSObjectRef.cpp:

(JSObjectMake):
(JSObjectMakeFunctionWithCallback):
(JSObjectMakeConstructor):
(JSObjectMakeFunction):
(JSObjectSetPrototype):
(JSObjectHasProperty):
(JSObjectGetProperty):
(JSObjectSetProperty):
(JSObjectSetPropertyAtIndex):
(JSObjectDeleteProperty):
(JSObjectGetPrivateProperty):
(JSObjectSetPrivateProperty):
(JSObjectDeletePrivateProperty):
(JSObjectIsFunction):
(JSObjectCallAsFunction):
(JSObjectCallAsConstructor):
(JSObjectCopyPropertyNames):
(JSPropertyNameAccumulatorAddName):

  • API/JSScriptRef.cpp:
  • API/JSTypedArray.cpp:

(JSValueGetTypedArrayType):
(JSObjectMakeTypedArrayWithArrayBuffer):
(JSObjectMakeTypedArrayWithArrayBufferAndOffset):
(JSObjectGetTypedArrayBytesPtr):
(JSObjectGetTypedArrayBuffer):
(JSObjectMakeArrayBufferWithBytesNoCopy):
(JSObjectGetArrayBufferBytesPtr):

  • API/JSWeakObjectMapRefPrivate.cpp:
  • API/JSWrapperMap.mm:

(constructorHasInstance):
(makeWrapper):

  • API/ObjCCallbackFunction.mm:

(objCCallbackFunctionForInvocation):

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::CodeBlock):
(JSC::CodeBlock::jettison):

  • bytecode/CodeBlock.h:

(JSC::CodeBlock::addConstant):
(JSC::CodeBlock::replaceConstant):

  • bytecode/PutByIdStatus.cpp:

(JSC::PutByIdStatus::computeFromLLInt):
(JSC::PutByIdStatus::computeFor):

  • dfg/DFGDesiredWatchpoints.cpp:

(JSC::DFG::ArrayBufferViewWatchpointAdaptor::add):

  • dfg/DFGGraph.h:

(JSC::DFG::Graph::globalThisObjectFor):

  • dfg/DFGOperations.cpp:
  • ftl/FTLOSRExitCompiler.cpp:

(JSC::FTL::compileFTLOSRExit):

  • ftl/FTLOperations.cpp:

(JSC::FTL::operationPopulateObjectInOSR):
(JSC::FTL::operationMaterializeObjectInOSR):

  • heap/GCAssertions.h:
  • inspector/InjectedScriptHost.cpp:

(Inspector::InjectedScriptHost::wrapper):

  • inspector/JSInjectedScriptHost.cpp:

(Inspector::JSInjectedScriptHost::subtype):
(Inspector::constructInternalProperty):
(Inspector::JSInjectedScriptHost::getInternalProperties):
(Inspector::JSInjectedScriptHost::weakMapEntries):
(Inspector::JSInjectedScriptHost::weakSetEntries):
(Inspector::JSInjectedScriptHost::iteratorEntries):

  • inspector/JSJavaScriptCallFrame.cpp:

(Inspector::valueForScopeLocation):
(Inspector::JSJavaScriptCallFrame::scopeDescriptions):
(Inspector::toJS):

  • inspector/ScriptCallStackFactory.cpp:

(Inspector::extractSourceInformationFromException):
(Inspector::createScriptArguments):

  • interpreter/CachedCall.h:

(JSC::CachedCall::CachedCall):

  • interpreter/CallFrame.h:

(JSC::ExecState::atomicStringTable const): Deleted.
(JSC::ExecState::propertyNames const): Deleted.
(JSC::ExecState::emptyList const): Deleted.
(JSC::ExecState::interpreter): Deleted.
(JSC::ExecState::heap): Deleted.

  • interpreter/Interpreter.cpp:

(JSC::Interpreter::executeProgram):
(JSC::Interpreter::execute):
(JSC::Interpreter::executeModuleProgram):

  • jit/JIT.cpp:

(JSC::JIT::privateCompileMainPass):

  • jit/JITOperations.cpp:
  • jit/JITWorklist.cpp:

(JSC::JITWorklist::compileNow):

  • jsc.cpp:

(WTF::RuntimeArray::create):
(WTF::RuntimeArray::getOwnPropertySlot):
(WTF::DOMJITGetter::DOMJITAttribute::slowCall):
(WTF::DOMJITFunctionObject::unsafeFunction):
(WTF::DOMJITCheckSubClassObject::unsafeFunction):
(GlobalObject::moduleLoaderFetch):
(functionDumpCallFrame):
(functionCreateRoot):
(functionGetElement):
(functionSetElementRoot):
(functionCreateSimpleObject):
(functionSetHiddenValue):
(functionCreateProxy):
(functionCreateImpureGetter):
(functionCreateCustomGetterObject):
(functionCreateDOMJITNodeObject):
(functionCreateDOMJITGetterObject):
(functionCreateDOMJITGetterComplexObject):
(functionCreateDOMJITFunctionObject):
(functionCreateDOMJITCheckSubClassObject):
(functionGCAndSweep):
(functionFullGC):
(functionEdenGC):
(functionHeapSize):
(functionShadowChickenFunctionsOnStack):
(functionSetGlobalConstRedeclarationShouldNotThrow):
(functionJSCOptions):
(functionFailNextNewCodeBlock):
(functionMakeMasquerader):
(functionDumpTypesForAllVariables):
(functionFindTypeForExpression):
(functionReturnTypeFor):
(functionDumpBasicBlockExecutionRanges):
(functionBasicBlockExecutionCount):
(functionDrainMicrotasks):
(functionGenerateHeapSnapshot):
(functionEnsureArrayStorage):
(functionStartSamplingProfiler):
(runInteractive):

  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::LLINT_SLOW_PATH_DECL):

  • parser/ModuleAnalyzer.cpp:

(JSC::ModuleAnalyzer::ModuleAnalyzer):

  • profiler/ProfilerBytecode.cpp:

(JSC::Profiler::Bytecode::toJS const):

  • profiler/ProfilerBytecodeSequence.cpp:

(JSC::Profiler::BytecodeSequence::addSequenceProperties const):

  • profiler/ProfilerBytecodes.cpp:

(JSC::Profiler::Bytecodes::toJS const):

  • profiler/ProfilerCompilation.cpp:

(JSC::Profiler::Compilation::toJS const):

  • profiler/ProfilerCompiledBytecode.cpp:

(JSC::Profiler::CompiledBytecode::toJS const):

  • profiler/ProfilerDatabase.cpp:

(JSC::Profiler::Database::toJS const):

  • profiler/ProfilerEvent.cpp:

(JSC::Profiler::Event::toJS const):

  • profiler/ProfilerOSRExit.cpp:

(JSC::Profiler::OSRExit::toJS const):

  • profiler/ProfilerOrigin.cpp:

(JSC::Profiler::Origin::toJS const):

  • profiler/ProfilerProfiledBytecodes.cpp:

(JSC::Profiler::ProfiledBytecodes::toJS const):

  • runtime/AbstractModuleRecord.cpp:

(JSC::identifierToJSValue):
(JSC::AbstractModuleRecord::resolveExportImpl):
(JSC::getExportedNames):

  • runtime/ArrayPrototype.cpp:

(JSC::arrayProtoFuncToString):
(JSC::arrayProtoFuncToLocaleString):

  • runtime/BooleanConstructor.cpp:

(JSC::constructBooleanFromImmediateBoolean):

  • runtime/CallData.cpp:

(JSC::call):

  • runtime/CommonSlowPaths.cpp:

(JSC::SLOW_PATH_DECL):

  • runtime/CommonSlowPaths.h:

(JSC::CommonSlowPaths::tryCachePutToScopeGlobal):
(JSC::CommonSlowPaths::tryCacheGetFromScopeGlobal):

  • runtime/Completion.cpp:

(JSC::checkSyntax):
(JSC::evaluate):
(JSC::loadAndEvaluateModule):
(JSC::loadModule):
(JSC::linkAndEvaluateModule):
(JSC::importModule):

  • runtime/ConstructData.cpp:

(JSC::construct):

  • runtime/DatePrototype.cpp:

(JSC::dateProtoFuncToJSON):

  • runtime/DirectArguments.h:

(JSC::DirectArguments::length const):

  • runtime/DirectEvalExecutable.cpp:

(JSC::DirectEvalExecutable::create):

  • runtime/ErrorPrototype.cpp:

(JSC::errorProtoFuncToString):

  • runtime/ExceptionHelpers.cpp:

(JSC::createUndefinedVariableError):
(JSC::errorDescriptionForValue):

  • runtime/FunctionConstructor.cpp:

(JSC::constructFunction):

  • runtime/GenericArgumentsInlines.h:

(JSC::GenericArguments<Type>::getOwnPropertyNames):

  • runtime/IdentifierInlines.h:

(JSC::Identifier::add):

  • runtime/IndirectEvalExecutable.cpp:

(JSC::IndirectEvalExecutable::create):

  • runtime/InternalFunction.cpp:

(JSC::InternalFunction::finishCreation):
(JSC::InternalFunction::createSubclassStructureSlow):

  • runtime/JSArray.cpp:

(JSC::JSArray::getOwnPropertySlot):
(JSC::JSArray::put):
(JSC::JSArray::deleteProperty):
(JSC::JSArray::getOwnNonIndexPropertyNames):
(JSC::JSArray::isIteratorProtocolFastAndNonObservable):

  • runtime/JSArray.h:

(JSC::JSArray::shiftCountForShift):

  • runtime/JSCJSValue.cpp:

(JSC::JSValue::dumpForBacktrace const):

  • runtime/JSDataView.cpp:

(JSC::JSDataView::getOwnPropertySlot):
(JSC::JSDataView::deleteProperty):
(JSC::JSDataView::getOwnNonIndexPropertyNames):

  • runtime/JSFunction.cpp:

(JSC::JSFunction::getOwnPropertySlot):
(JSC::JSFunction::deleteProperty):
(JSC::JSFunction::reifyName):

  • runtime/JSGlobalObjectFunctions.cpp:

(JSC::globalFuncEval):

  • runtime/JSInternalPromise.cpp:

(JSC::JSInternalPromise::then):

  • runtime/JSLexicalEnvironment.cpp:

(JSC::JSLexicalEnvironment::deleteProperty):

  • runtime/JSMap.cpp:

(JSC::JSMap::isIteratorProtocolFastAndNonObservable):

  • runtime/JSMapIterator.h:

(JSC::JSMapIterator::advanceIter):

  • runtime/JSModuleEnvironment.cpp:

(JSC::JSModuleEnvironment::getOwnNonIndexPropertyNames):

  • runtime/JSModuleLoader.cpp:

(JSC::printableModuleKey):
(JSC::JSModuleLoader::provide):
(JSC::JSModuleLoader::loadAndEvaluateModule):
(JSC::JSModuleLoader::loadModule):
(JSC::JSModuleLoader::linkAndEvaluateModule):
(JSC::JSModuleLoader::requestImportModule):

  • runtime/JSModuleNamespaceObject.h:
  • runtime/JSModuleRecord.cpp:

(JSC::JSModuleRecord::evaluate):

  • runtime/JSONObject.cpp:

(JSC::Stringifier::Stringifier):
(JSC::Stringifier::appendStringifiedValue):
(JSC::Stringifier::Holder::appendNextProperty):

  • runtime/JSObject.cpp:

(JSC::JSObject::calculatedClassName):
(JSC::JSObject::putByIndex):
(JSC::JSObject::ordinaryToPrimitive const):
(JSC::JSObject::toPrimitive const):
(JSC::JSObject::hasInstance):
(JSC::JSObject::getOwnPropertyNames):
(JSC::JSObject::putDirectIndexSlowOrBeyondVectorLength):
(JSC::getCustomGetterSetterFunctionForGetterSetter):
(JSC::JSObject::getOwnPropertyDescriptor):
(JSC::JSObject::getMethod):

  • runtime/JSObject.h:

(JSC::JSObject::createRawObject):
(JSC::JSFinalObject::create):

  • runtime/JSObjectInlines.h:

(JSC::JSObject::canPerformFastPutInline):
(JSC::JSObject::putInlineForJSObject):
(JSC::JSObject::hasOwnProperty const):

  • runtime/JSScope.cpp:

(JSC::isUnscopable):
(JSC::JSScope::resolveScopeForHoistingFuncDeclInEval):

  • runtime/JSSet.cpp:

(JSC::JSSet::isIteratorProtocolFastAndNonObservable):

  • runtime/JSSetIterator.h:

(JSC::JSSetIterator::advanceIter):

  • runtime/JSString.cpp:

(JSC::JSString::getStringPropertyDescriptor):

  • runtime/JSString.h:

(JSC::JSString::getStringPropertySlot):

  • runtime/MapConstructor.cpp:

(JSC::constructMap):

  • runtime/ModuleProgramExecutable.cpp:

(JSC::ModuleProgramExecutable::create):

  • runtime/ObjectPrototype.cpp:

(JSC::objectProtoFuncToLocaleString):

  • runtime/ProgramExecutable.h:
  • runtime/RegExpObject.cpp:

(JSC::RegExpObject::getOwnPropertySlot):
(JSC::RegExpObject::deleteProperty):
(JSC::RegExpObject::getOwnNonIndexPropertyNames):
(JSC::RegExpObject::getPropertyNames):
(JSC::RegExpObject::getGenericPropertyNames):
(JSC::RegExpObject::put):

  • runtime/ScopedArguments.h:

(JSC::ScopedArguments::length const):

  • runtime/StrictEvalActivation.h:

(JSC::StrictEvalActivation::create):

  • runtime/StringObject.cpp:

(JSC::isStringOwnProperty):
(JSC::StringObject::deleteProperty):
(JSC::StringObject::getOwnNonIndexPropertyNames):

  • tools/JSDollarVMPrototype.cpp:

(JSC::JSDollarVMPrototype::gc):
(JSC::JSDollarVMPrototype::edenGC):

  • wasm/js/WebAssemblyModuleRecord.cpp:

(JSC::WebAssemblyModuleRecord::evaluate):

Source/WebCore:

No new tests because this is only a refactoring patch. There is no
significant behavior change.

  • Modules/mediastream/SDPProcessor.cpp:

(WebCore::SDPProcessor::callScript const):

  • Modules/plugins/QuickTimePluginReplacement.mm:

(WebCore::QuickTimePluginReplacement::installReplacement):

  • bindings/js/JSCallbackData.cpp:

(WebCore::JSCallbackData::invokeCallback):

  • bindings/js/JSCustomElementInterface.cpp:

(WebCore::constructCustomElementSynchronously):
(WebCore::JSCustomElementInterface::upgradeElement):
(WebCore::JSCustomElementInterface::invokeCallback):

  • bindings/js/JSDOMConvertRecord.h:
  • bindings/js/JSDOMMapLike.h:

(WebCore::forwardSizeToMapLike):
(WebCore::forwardEntriesToMapLike):
(WebCore::forwardKeysToMapLike):
(WebCore::forwardValuesToMapLike):
(WebCore::forwardGetToMapLike):
(WebCore::forwardHasToMapLike):

  • bindings/js/JSDOMWindowCustom.cpp:

(WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
(WebCore::addCrossOriginWindowOwnPropertyNames):

  • bindings/js/JSDocumentCustom.cpp:

(WebCore::reportMemoryForDocumentIfFrameless):

  • bindings/js/JSErrorHandler.cpp:

(WebCore::JSErrorHandler::handleEvent):

  • bindings/js/JSImageDataCustom.cpp:

(WebCore::toJSNewlyCreated):

  • bindings/js/JSLocationCustom.cpp:

(WebCore::getOwnPropertySlotCommon):
(WebCore::putCommon):
(WebCore::addCrossOriginLocationPropertyNames):
(WebCore::addCrossOriginLocationOwnPropertyNames):
(WebCore::JSLocation::defineOwnProperty):
(WebCore::JSLocationPrototype::put):
(WebCore::JSLocationPrototype::defineOwnProperty):

  • bindings/js/SerializedScriptValue.cpp:

(WebCore::CloneSerializer::serialize):

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateImplementation):

  • bindings/scripts/test/JS/JSInterfaceName.cpp:

(WebCore::setJSInterfaceNameConstructor):

  • bindings/scripts/test/JS/JSMapLike.cpp:

(WebCore::setJSMapLikeConstructor):

  • bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:

(WebCore::setJSReadOnlyMapLikeConstructor):

  • bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:

(WebCore::setJSTestActiveDOMObjectConstructor):

  • bindings/scripts/test/JS/JSTestCEReactions.cpp:

(WebCore::setJSTestCEReactionsConstructor):

  • bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:

(WebCore::setJSTestCEReactionsStringifierConstructor):

  • bindings/scripts/test/JS/JSTestCallTracer.cpp:

(WebCore::setJSTestCallTracerConstructor):

  • bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:

(WebCore::setJSTestClassWithJSBuiltinConstructorConstructor):

  • bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:

(WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
(WebCore::setJSTestCustomConstructorWithNoInterfaceObjectConstructor):

  • bindings/scripts/test/JS/JSTestDOMJIT.cpp:

(WebCore::setJSTestDOMJITConstructor):

  • bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:

(WebCore::setJSTestEnabledBySettingConstructor):

  • bindings/scripts/test/JS/JSTestEventConstructor.cpp:

(WebCore::setJSTestEventConstructorConstructor):

  • bindings/scripts/test/JS/JSTestEventTarget.cpp:

(WebCore::setJSTestEventTargetConstructor):

  • bindings/scripts/test/JS/JSTestException.cpp:

(WebCore::setJSTestExceptionConstructor):

  • bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:

(WebCore::setJSTestGenerateIsReachableConstructor):

  • bindings/scripts/test/JS/JSTestGlobalObject.cpp:

(WebCore::setJSTestGlobalObjectConstructor):

  • bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:

(WebCore::setJSTestIndexedSetterNoIdentifierConstructor):

  • bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:

(WebCore::setJSTestIndexedSetterThrowingExceptionConstructor):

  • bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:

(WebCore::setJSTestIndexedSetterWithIdentifierConstructor):

  • bindings/scripts/test/JS/JSTestInterface.cpp:

(WebCore::setJSTestInterfaceConstructor):

  • bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:

(WebCore::setJSTestInterfaceLeadingUnderscoreConstructor):

  • bindings/scripts/test/JS/JSTestIterable.cpp:

(WebCore::setJSTestIterableConstructor):

  • bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:

(WebCore::setJSTestJSBuiltinConstructorConstructor):

  • bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:

(WebCore::setJSTestMediaQueryListListenerConstructor):

  • bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:

(WebCore::setJSTestNamedAndIndexedSetterNoIdentifierConstructor):

  • bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:

(WebCore::setJSTestNamedAndIndexedSetterThrowingExceptionConstructor):

  • bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:

(WebCore::setJSTestNamedAndIndexedSetterWithIdentifierConstructor):

  • bindings/scripts/test/JS/JSTestNamedConstructor.cpp:

(WebCore::setJSTestNamedConstructorConstructor):

  • bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:

(WebCore::setJSTestNamedDeleterNoIdentifierConstructor):

  • bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:

(WebCore::setJSTestNamedDeleterThrowingExceptionConstructor):

  • bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:

(WebCore::setJSTestNamedDeleterWithIdentifierConstructor):

  • bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:

(WebCore::setJSTestNamedDeleterWithIndexedGetterConstructor):

  • bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:

(WebCore::setJSTestNamedGetterCallWithConstructor):

  • bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:

(WebCore::setJSTestNamedGetterNoIdentifierConstructor):

  • bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:

(WebCore::setJSTestNamedGetterWithIdentifierConstructor):

  • bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:

(WebCore::setJSTestNamedSetterNoIdentifierConstructor):

  • bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:

(WebCore::setJSTestNamedSetterThrowingExceptionConstructor):

  • bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:

(WebCore::setJSTestNamedSetterWithIdentifierConstructor):

  • bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:

(WebCore::setJSTestNamedSetterWithIndexedGetterConstructor):

  • bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:

(WebCore::setJSTestNamedSetterWithIndexedGetterAndSetterConstructor):

  • bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:

(WebCore::setJSTestNamedSetterWithOverrideBuiltinsConstructor):

  • bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:

(WebCore::setJSTestNamedSetterWithUnforgablePropertiesConstructor):

  • bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:

(WebCore::setJSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor):

  • bindings/scripts/test/JS/JSTestNode.cpp:

(WebCore::setJSTestNodeConstructor):

  • bindings/scripts/test/JS/JSTestObj.cpp:

(WebCore::setJSTestObjConstructor):

  • bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:

(WebCore::setJSTestOverloadedConstructorsConstructor):

  • bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:

(WebCore::setJSTestOverloadedConstructorsWithSequenceConstructor):

  • bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:

(WebCore::setJSTestOverrideBuiltinsConstructor):

  • bindings/scripts/test/JS/JSTestPluginInterface.cpp:

(WebCore::setJSTestPluginInterfaceConstructor):

  • bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:

(WebCore::setJSTestPromiseRejectionEventConstructor):

  • bindings/scripts/test/JS/JSTestSerialization.cpp:

(WebCore::setJSTestSerializationConstructor):

  • bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:

(WebCore::setJSTestSerializationIndirectInheritanceConstructor):

  • bindings/scripts/test/JS/JSTestSerializationInherit.cpp:

(WebCore::setJSTestSerializationInheritConstructor):

  • bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:

(WebCore::setJSTestSerializationInheritFinalConstructor):

  • bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:

(WebCore::setJSTestSerializedScriptValueInterfaceConstructor):

  • bindings/scripts/test/JS/JSTestStringifier.cpp:

(WebCore::setJSTestStringifierConstructor):

  • bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:

(WebCore::setJSTestStringifierAnonymousOperationConstructor):

  • bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:

(WebCore::setJSTestStringifierNamedOperationConstructor):

  • bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:

(WebCore::setJSTestStringifierOperationImplementedAsConstructor):

  • bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:

(WebCore::setJSTestStringifierOperationNamedToStringConstructor):

  • bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:

(WebCore::setJSTestStringifierReadOnlyAttributeConstructor):

  • bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:

(WebCore::setJSTestStringifierReadWriteAttributeConstructor):

  • bindings/scripts/test/JS/JSTestTypedefs.cpp:

(WebCore::setJSTestTypedefsConstructor):

  • bridge/NP_jsobject.cpp:

(_NPN_SetProperty):
(_NPN_RemoveProperty):
(_NPN_Enumerate):

  • bridge/c/c_instance.cpp:

(JSC::Bindings::CRuntimeMethod::create):

  • bridge/objc/WebScriptObject.mm:

(-[WebScriptObject setValue:forKey:]):
(-[WebScriptObject removeWebScriptKey:]):
(-[WebScriptObject setWebScriptValueAtIndex:value:]):

  • bridge/objc/objc_instance.mm:

(ObjCRuntimeMethod::create):

  • bridge/objc/objc_runtime.h:

(JSC::Bindings::ObjcFallbackObjectImp::create):

  • bridge/runtime_array.cpp:

(JSC::RuntimeArray::getOwnPropertyNames):
(JSC::RuntimeArray::getOwnPropertySlot):
(JSC::RuntimeArray::put):

  • bridge/runtime_array.h:

(JSC::RuntimeArray::create):

  • bridge/runtime_method.cpp:

(JSC::RuntimeMethod::getOwnPropertySlot):

  • bridge/runtime_method.h:
  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::updateCaptionContainer):
(WebCore::HTMLMediaElement::setControllerJSProperty):
(WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
(WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):
(WebCore::HTMLMediaElement::getCurrentMediaControlsStatus):

  • html/HTMLPlugInImageElement.cpp:

(WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):

  • testing/Internals.cpp:

(WebCore::Internals::cloneArrayBuffer):

Source/WebKit:

  • WebProcess/Plugins/Netscape/JSNPMethod.h:

(WebKit::JSNPMethod::create):

  • WebProcess/Plugins/Netscape/NPJSObject.cpp:

(WebKit::NPJSObject::setProperty):
(WebKit::NPJSObject::removeProperty):
(WebKit::NPJSObject::enumerate):

Source/WebKitLegacy/mac:

  • Plugins/Hosted/NetscapePluginInstanceProxy.mm:

(WebKit::NetscapePluginInstanceProxy::invokeDefault):
(WebKit::NetscapePluginInstanceProxy::construct):
(WebKit::NetscapePluginInstanceProxy::setProperty):
(WebKit::NetscapePluginInstanceProxy::removeProperty):
(WebKit::NetscapePluginInstanceProxy::enumerate):

  • Plugins/Hosted/ProxyInstance.mm:

(WebKit::ProxyRuntimeMethod::create):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSObjectRef.cpp

    r221546 r221822  
    9090    }
    9191    ExecState* exec = toJS(ctx);
    92     JSLockHolder locker(exec);
     92    VM& vm = exec->vm();
     93    JSLockHolder locker(vm);
    9394
    9495    if (!jsClass)
     
    9798    JSCallbackObject<JSDestructibleObject>* object = JSCallbackObject<JSDestructibleObject>::create(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->callbackObjectStructure(), jsClass, data);
    9899    if (JSObject* prototype = jsClass->prototype(exec))
    99         object->setPrototypeDirect(exec->vm(), prototype);
     100        object->setPrototypeDirect(vm, prototype);
    100101
    101102    return toRef(object);
     
    109110    }
    110111    ExecState* exec = toJS(ctx);
    111     JSLockHolder locker(exec);
    112     return toRef(JSCallbackFunction::create(exec->vm(), exec->lexicalGlobalObject(), callAsFunction, name ? name->string() : ASCIILiteral("anonymous")));
     112    VM& vm = exec->vm();
     113    JSLockHolder locker(vm);
     114    return toRef(JSCallbackFunction::create(vm, exec->lexicalGlobalObject(), callAsFunction, name ? name->string() : ASCIILiteral("anonymous")));
    113115}
    114116
     
    120122    }
    121123    ExecState* exec = toJS(ctx);
    122     JSLockHolder locker(exec);
     124    VM& vm = exec->vm();
     125    JSLockHolder locker(vm);
    123126
    124127    JSValue jsPrototype = jsClass ? jsClass->prototype(exec) : 0;
     
    127130
    128131    JSCallbackConstructor* constructor = JSCallbackConstructor::create(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->callbackConstructorStructure(), jsClass, callAsConstructor);
    129     constructor->putDirect(exec->vm(), exec->propertyNames().prototype, jsPrototype, DontEnum | DontDelete | ReadOnly);
     132    constructor->putDirect(vm, vm.propertyNames->prototype, jsPrototype, DontEnum | DontDelete | ReadOnly);
    130133    return toRef(constructor);
    131134}
     
    138141    }
    139142    ExecState* exec = toJS(ctx);
    140     JSLockHolder locker(exec);
     143    VM& vm = exec->vm();
     144    JSLockHolder locker(vm);
    141145
    142146    startingLineNumber = std::max(1, startingLineNumber);
    143     Identifier nameID = name ? name->identifier(&exec->vm()) : Identifier::fromString(exec, "anonymous");
     147    Identifier nameID = name ? name->identifier(&vm) : Identifier::fromString(exec, "anonymous");
    144148   
    145149    MarkedArgumentBuffer args;
     
    260264    ExecState* exec = toJS(ctx);
    261265    VM& vm = exec->vm();
    262     JSLockHolder locker(exec);
     266    JSLockHolder locker(vm);
    263267
    264268    JSObject* jsObject = toJS(object);
     
    267271    if (JSProxy* proxy = jsDynamicCast<JSProxy*>(vm, jsObject)) {
    268272        if (JSGlobalObject* globalObject = jsDynamicCast<JSGlobalObject*>(vm, proxy->target())) {
    269             globalObject->resetPrototype(exec->vm(), jsValue.isObject() ? jsValue : jsNull());
     273            globalObject->resetPrototype(vm, jsValue.isObject() ? jsValue : jsNull());
    270274            return;
    271275        }
     
    273277        RELEASE_ASSERT_NOT_REACHED();
    274278    }
    275     jsObject->setPrototype(exec->vm(), exec, jsValue.isObject() ? jsValue : jsNull());
     279    jsObject->setPrototype(vm, exec, jsValue.isObject() ? jsValue : jsNull());
    276280}
    277281
     
    283287    }
    284288    ExecState* exec = toJS(ctx);
    285     JSLockHolder locker(exec);
    286 
    287     JSObject* jsObject = toJS(object);
    288    
    289     return jsObject->hasProperty(exec, propertyName->identifier(&exec->vm()));
     289    VM& vm = exec->vm();
     290    JSLockHolder locker(vm);
     291
     292    JSObject* jsObject = toJS(object);
     293   
     294    return jsObject->hasProperty(exec, propertyName->identifier(&vm));
    290295}
    291296
     
    297302    }
    298303    ExecState* exec = toJS(ctx);
    299     JSLockHolder locker(exec);
    300 
    301     JSObject* jsObject = toJS(object);
    302 
    303     JSValue jsValue = jsObject->get(exec, propertyName->identifier(&exec->vm()));
     304    VM& vm = exec->vm();
     305    JSLockHolder locker(vm);
     306
     307    JSObject* jsObject = toJS(object);
     308
     309    JSValue jsValue = jsObject->get(exec, propertyName->identifier(&vm));
    304310    handleExceptionIfNeeded(exec, exception);
    305311    return toRef(exec, jsValue);
     
    318324
    319325    JSObject* jsObject = toJS(object);
    320     Identifier name(propertyName->identifier(&exec->vm()));
     326    Identifier name(propertyName->identifier(&vm));
    321327    JSValue jsValue = toJS(exec, value);
    322328
     
    325331        if (doesNotHaveProperty) {
    326332            PropertyDescriptor desc(jsValue, attributes);
    327             jsObject->methodTable()->defineOwnProperty(jsObject, exec, name, desc, false);
     333            jsObject->methodTable(vm)->defineOwnProperty(jsObject, exec, name, desc, false);
    328334        } else {
    329335            PutPropertySlot slot(jsObject);
    330             jsObject->methodTable()->put(jsObject, exec, name, jsValue, slot);
     336            jsObject->methodTable(vm)->put(jsObject, exec, name, jsValue, slot);
    331337        }
    332338    }
     
    358364    }
    359365    ExecState* exec = toJS(ctx);
    360     JSLockHolder locker(exec);
     366    VM& vm = exec->vm();
     367    JSLockHolder locker(vm);
    361368
    362369    JSObject* jsObject = toJS(object);
    363370    JSValue jsValue = toJS(exec, value);
    364371   
    365     jsObject->methodTable()->putByIndex(jsObject, exec, propertyIndex, jsValue, false);
     372    jsObject->methodTable(vm)->putByIndex(jsObject, exec, propertyIndex, jsValue, false);
    366373    handleExceptionIfNeeded(exec, exception);
    367374}
     
    374381    }
    375382    ExecState* exec = toJS(ctx);
    376     JSLockHolder locker(exec);
    377 
    378     JSObject* jsObject = toJS(object);
    379 
    380     bool result = jsObject->methodTable()->deleteProperty(jsObject, exec, propertyName->identifier(&exec->vm()));
     383    VM& vm = exec->vm();
     384    JSLockHolder locker(vm);
     385
     386    JSObject* jsObject = toJS(object);
     387
     388    bool result = jsObject->methodTable(vm)->deleteProperty(jsObject, exec, propertyName->identifier(&vm));
    381389    handleExceptionIfNeeded(exec, exception);
    382390    return result;
     
    456464    ExecState* exec = toJS(ctx);
    457465    VM& vm = exec->vm();
    458     JSLockHolder locker(exec);
     466    JSLockHolder locker(vm);
    459467    JSObject* jsObject = toJS(object);
    460468    JSValue result;
    461     Identifier name(propertyName->identifier(&exec->vm()));
     469    Identifier name(propertyName->identifier(&vm));
    462470
    463471
     
    481489    ExecState* exec = toJS(ctx);
    482490    VM& vm = exec->vm();
    483     JSLockHolder locker(exec);
     491    JSLockHolder locker(vm);
    484492    JSObject* jsObject = toJS(object);
    485493    JSValue jsValue = value ? toJS(exec, value) : JSValue();
    486     Identifier name(propertyName->identifier(&exec->vm()));
     494    Identifier name(propertyName->identifier(&vm));
    487495
    488496    // Get wrapped object if proxied
     
    491499
    492500    if (jsObject->inherits(vm, JSCallbackObject<JSGlobalObject>::info())) {
    493         jsCast<JSCallbackObject<JSGlobalObject>*>(jsObject)->setPrivateProperty(exec->vm(), name, jsValue);
     501        jsCast<JSCallbackObject<JSGlobalObject>*>(jsObject)->setPrivateProperty(vm, name, jsValue);
    494502        return true;
    495503    }
    496504    if (jsObject->inherits(vm, JSCallbackObject<JSDestructibleObject>::info())) {
    497         jsCast<JSCallbackObject<JSDestructibleObject>*>(jsObject)->setPrivateProperty(exec->vm(), name, jsValue);
     505        jsCast<JSCallbackObject<JSDestructibleObject>*>(jsObject)->setPrivateProperty(vm, name, jsValue);
    498506        return true;
    499507    }
    500508#if JSC_OBJC_API_ENABLED
    501509    if (jsObject->inherits(vm, JSCallbackObject<JSAPIWrapperObject>::info())) {
    502         jsCast<JSCallbackObject<JSAPIWrapperObject>*>(jsObject)->setPrivateProperty(exec->vm(), name, jsValue);
     510        jsCast<JSCallbackObject<JSAPIWrapperObject>*>(jsObject)->setPrivateProperty(vm, name, jsValue);
    503511        return true;
    504512    }
     
    511519    ExecState* exec = toJS(ctx);
    512520    VM& vm = exec->vm();
    513     JSLockHolder locker(exec);
    514     JSObject* jsObject = toJS(object);
    515     Identifier name(propertyName->identifier(&exec->vm()));
     521    JSLockHolder locker(vm);
     522    JSObject* jsObject = toJS(object);
     523    Identifier name(propertyName->identifier(&vm));
    516524
    517525    // Get wrapped object if proxied
     
    540548    if (!object)
    541549        return false;
    542     JSLockHolder locker(toJS(ctx));
     550    ExecState* exec = toJS(ctx);
     551    VM& vm = exec->vm();
     552    JSLockHolder locker(vm);
    543553    CallData callData;
    544554    JSCell* cell = toJS(object);
    545     return cell->methodTable()->getCallData(cell, callData) != CallType::None;
     555    return cell->methodTable(vm)->getCallData(cell, callData) != CallType::None;
    546556}
    547557
     
    549559{
    550560    ExecState* exec = toJS(ctx);
    551     JSLockHolder locker(exec);
     561    VM& vm = exec->vm();
     562    JSLockHolder locker(vm);
    552563
    553564    if (!object)
     
    565576
    566577    CallData callData;
    567     CallType callType = jsObject->methodTable()->getCallData(jsObject, callData);
     578    CallType callType = jsObject->methodTable(vm)->getCallData(jsObject, callData);
    568579    if (callType == CallType::None)
    569580        return 0;
     
    587598{
    588599    ExecState* exec = toJS(ctx);
    589     JSLockHolder locker(exec);
     600    VM& vm = exec->vm();
     601    JSLockHolder locker(vm);
    590602
    591603    if (!object)
     
    595607
    596608    ConstructData constructData;
    597     ConstructType constructType = jsObject->methodTable()->getConstructData(jsObject, constructData);
     609    ConstructType constructType = jsObject->methodTable(vm)->getConstructData(jsObject, constructData);
    598610    if (constructType == ConstructType::None)
    599611        return 0;
     
    637649    JSPropertyNameArrayRef propertyNames = new OpaqueJSPropertyNameArray(vm);
    638650    PropertyNameArray array(vm, PropertyNameMode::Strings);
    639     jsObject->methodTable()->getPropertyNames(jsObject, exec, array, EnumerationMode());
     651    jsObject->methodTable(*vm)->getPropertyNames(jsObject, exec, array, EnumerationMode());
    640652
    641653    size_t size = array.size();
     
    674686{
    675687    PropertyNameArray* propertyNames = toJS(array);
    676     JSLockHolder locker(propertyNames->vm());
    677     propertyNames->add(propertyName->identifier(propertyNames->vm()));
     688    VM* vm = propertyNames->vm();
     689    JSLockHolder locker(vm);
     690    propertyNames->add(propertyName->identifier(vm));
    678691}
    679692
Note: See TracChangeset for help on using the changeset viewer.