Ignore:
Timestamp:
May 28, 2010, 11:33:05 PM (15 years ago)
Author:
[email protected]
Message:

JavaScriptCore: Simplified the host calling convention.

Reviewed by Sam Weinig, Gavin Barraclough, Oliver Hunt.

22.5% speedup on 32-bit host function calls. 9.5% speedup on 64-bit host
function calls.

No change on SunSpider.

All JS calls (but not constructs, yet) now go through the normal JS
calling convention via the RegisterFile. As a result, the host calling
convention, which used to be this

JSValue (JSC_HOST_CALL *NativeFunction)(ExecState*, JSObject*, JSValue thisValue, const ArgList&)


is now this

JSValue (JSC_HOST_CALL *NativeFunction)(ExecState*)


Callee, 'this', and argument access all hapen relative to the ExecState*,
which is a pointer into the RegisterFile.

This patch comes in two parts.

PART ONE: Functional code changes.

  • wtf/Platform.h: Disabled optimized calls on platforms I didn't test.

We can re-enable once we verify that host calls on these platforms are
correct.

  • debugger/DebuggerCallFrame.cpp:

(JSC::DebuggerCallFrame::functionName):
(JSC::DebuggerCallFrame::calculatedFunctionName): Updated for change to
ExecState::callee().

(JSC::DebuggerCallFrame::thisObject): Updated for removal of ExecState::thisValue().

  • interpreter/CallFrame.cpp:
  • interpreter/CallFrame.h:

(JSC::ExecState::callee):
(JSC::ExecState::scopeChain):
(JSC::ExecState::init): Changed callee() to be JSObject* instead of
JSFunction* -- now, it might be some other callable host object.

(JSC::ExecState::hostThisRegister):
(JSC::ExecState::hostThisValue):
(JSC::ExecState::argumentCount):
(JSC::ExecState::argumentCountIncludingThis):
(JSC::ExecState::argument):
(JSC::ExecState::setArgumentCountIncludingThis):
(JSC::ExecState::setCallee): Added convenient accessors for arguments
from within a host function. Removed thisValue() because it was too
tempting to use incorrectly, and it only had one or two clients, anyway.

  • interpreter/Interpreter.cpp:

(JSC::Interpreter::callEval): Updated for removal of ExecState::thisValue().

(JSC::Interpreter::throwException): Be sure to shrink the register file
before invoking the exception handler, to reduce the chances that the
handler will re-throw in the case of stack overflow. (Re-throwing is now
more likely than it used to be, since standardizing the calling convention
implicitly added stack overflow checks to some places where they used to be missing.)

(JSC::Interpreter::execute): Clarified the scope of DynamicGlobalObjectScope.
Updated for CallFrame::init API change.

(JSC::Interpreter::executeCall): Clarified scope of DynamicGlobalObjectScope.
Updated for CallFrame::init API change. Added support for calling a host
function.

(JSC::Interpreter::executeConstruct): Clarified scope of DynamicGlobalObjectScope.
Updated for CallFrame::init API change.

(JSC::Interpreter::prepareForRepeatCall): Updated for CallFrame::init API change.

(JSC::Interpreter::privateExecute): Updated for CallFrame::init API change.
Added some explicit JSValue(JSObject*) initialization, since relaxing
the JSFunction* restriction on callee has made register types more ambiguous.
Removed toThisObject() conversion, since all callees do it themselves now.
Updated host function call for new host function signature. Updated for
change to ExecState::argumentCount() API.

  • interpreter/Register.h:

(JSC::Register::):
(JSC::Register::operator=):
(JSC::Register::function): Changed callee() to be JSObject* instead of
JSFunction* -- now, it might be some other callable host object.

  • jit/JITOpcodes.cpp:

(JSC::JIT::privateCompileCTINativeCall):

  • jit/JITOpcodes32_64.cpp:

(JSC::JIT::privateCompileCTINativeCall): Deleted a bunch of code that
set up the arguments to host functions -- all but one of the arguments
are gone now. This is the actual optimization.

  • jit/JITStubs.cpp:

(JSC::DEFINE_STUB_FUNCTION): Updated for ExecState and Register API
changes noted above. Removed toThisObject() conversion, since all callees
do it themselves now.

  • runtime/ArgList.h:

(JSC::ArgList::ArgList): ArgList is getting close to unused. Added a
temporary shim for converting from ExecState* to ArgList where it's still
necessary.

  • runtime/Arguments.h:

(JSC::Arguments::getArgumentsData):
(JSC::Arguments::Arguments): Updated for ExecState and Register API
changes noted above.

  • runtime/CallData.cpp:

(JSC::call): Changed call always to call Interpreter::executeCall, even
for host functions. This ensures that the normal calling convention is
set up in the RegsiterFile when calling from C++ to host function.

  • runtime/CallData.h: Changed host function signature as described above.
  • runtime/ConstructData.cpp:

(JSC::construct): Moved JSFunction::construct code here so I could nix
JSFunction::call and JSFunction::call. We want a JSFunction-agnostic
way to call and construct, so that everything works naturally for non-
JSFunction objects.

  • runtime/JSFunction.cpp:

(JSC::callHostFunctionAsConstructor):

  • runtime/JSFunction.h: Updated for ExecState and Register API changes

noted above. Nixed JSFunction::call and JSFunction::construct, noted above.

  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::init): Ditto.

PART TWO: Global search and replace.

In the areas below, I used global search-and-replace to change

(ExecState*, JSObject*, JSValue, const ArgList&) => (ExecState*)
args.size() => exec->argumentCount()
args.at(i) => exec->argument(i)

  • API/JSCallbackFunction.cpp:

(JSC::JSCallbackFunction::call):

  • API/JSCallbackFunction.h:
  • API/JSCallbackObject.h:
  • API/JSCallbackObjectFunctions.h:

(JSC::::call):

(functionPrint):
(functionDebug):
(functionGC):
(functionVersion):
(functionRun):
(functionLoad):
(functionCheckSyntax):
(functionSetSamplingFlags):
(functionClearSamplingFlags):
(functionReadline):
(functionQuit):

  • runtime/ArrayConstructor.cpp:

(JSC::callArrayConstructor):
(JSC::arrayConstructorIsArray):

  • runtime/ArrayPrototype.cpp:

(JSC::arrayProtoFuncToString):
(JSC::arrayProtoFuncToLocaleString):
(JSC::arrayProtoFuncJoin):
(JSC::arrayProtoFuncConcat):
(JSC::arrayProtoFuncPop):
(JSC::arrayProtoFuncPush):
(JSC::arrayProtoFuncReverse):
(JSC::arrayProtoFuncShift):
(JSC::arrayProtoFuncSlice):
(JSC::arrayProtoFuncSort):
(JSC::arrayProtoFuncSplice):
(JSC::arrayProtoFuncUnShift):
(JSC::arrayProtoFuncFilter):
(JSC::arrayProtoFuncMap):
(JSC::arrayProtoFuncEvery):
(JSC::arrayProtoFuncForEach):
(JSC::arrayProtoFuncSome):
(JSC::arrayProtoFuncReduce):
(JSC::arrayProtoFuncReduceRight):
(JSC::arrayProtoFuncIndexOf):
(JSC::arrayProtoFuncLastIndexOf):

  • runtime/BooleanConstructor.cpp:

(JSC::callBooleanConstructor):

  • runtime/BooleanPrototype.cpp:

(JSC::booleanProtoFuncToString):
(JSC::booleanProtoFuncValueOf):

  • runtime/DateConstructor.cpp:

(JSC::callDate):
(JSC::dateParse):
(JSC::dateNow):
(JSC::dateUTC):

  • runtime/DatePrototype.cpp:

(JSC::formatLocaleDate):
(JSC::fillStructuresUsingTimeArgs):
(JSC::fillStructuresUsingDateArgs):
(JSC::dateProtoFuncToString):
(JSC::dateProtoFuncToUTCString):
(JSC::dateProtoFuncToISOString):
(JSC::dateProtoFuncToDateString):
(JSC::dateProtoFuncToTimeString):
(JSC::dateProtoFuncToLocaleString):
(JSC::dateProtoFuncToLocaleDateString):
(JSC::dateProtoFuncToLocaleTimeString):
(JSC::dateProtoFuncGetTime):
(JSC::dateProtoFuncGetFullYear):
(JSC::dateProtoFuncGetUTCFullYear):
(JSC::dateProtoFuncToGMTString):
(JSC::dateProtoFuncGetMonth):
(JSC::dateProtoFuncGetUTCMonth):
(JSC::dateProtoFuncGetDate):
(JSC::dateProtoFuncGetUTCDate):
(JSC::dateProtoFuncGetDay):
(JSC::dateProtoFuncGetUTCDay):
(JSC::dateProtoFuncGetHours):
(JSC::dateProtoFuncGetUTCHours):
(JSC::dateProtoFuncGetMinutes):
(JSC::dateProtoFuncGetUTCMinutes):
(JSC::dateProtoFuncGetSeconds):
(JSC::dateProtoFuncGetUTCSeconds):
(JSC::dateProtoFuncGetMilliSeconds):
(JSC::dateProtoFuncGetUTCMilliseconds):
(JSC::dateProtoFuncGetTimezoneOffset):
(JSC::dateProtoFuncSetTime):
(JSC::setNewValueFromTimeArgs):
(JSC::setNewValueFromDateArgs):
(JSC::dateProtoFuncSetMilliSeconds):
(JSC::dateProtoFuncSetUTCMilliseconds):
(JSC::dateProtoFuncSetSeconds):
(JSC::dateProtoFuncSetUTCSeconds):
(JSC::dateProtoFuncSetMinutes):
(JSC::dateProtoFuncSetUTCMinutes):
(JSC::dateProtoFuncSetHours):
(JSC::dateProtoFuncSetUTCHours):
(JSC::dateProtoFuncSetDate):
(JSC::dateProtoFuncSetUTCDate):
(JSC::dateProtoFuncSetMonth):
(JSC::dateProtoFuncSetUTCMonth):
(JSC::dateProtoFuncSetFullYear):
(JSC::dateProtoFuncSetUTCFullYear):
(JSC::dateProtoFuncSetYear):
(JSC::dateProtoFuncGetYear):
(JSC::dateProtoFuncToJSON):

  • runtime/ErrorConstructor.cpp:

(JSC::callErrorConstructor):

  • runtime/ErrorPrototype.cpp:

(JSC::errorProtoFuncToString):

  • runtime/FunctionConstructor.cpp:

(JSC::callFunctionConstructor):

  • runtime/FunctionPrototype.cpp:

(JSC::callFunctionPrototype):
(JSC::functionProtoFuncToString):
(JSC::functionProtoFuncApply):
(JSC::functionProtoFuncCall):

  • runtime/JSGlobalObjectFunctions.cpp:

(JSC::encode):
(JSC::decode):
(JSC::globalFuncEval):
(JSC::globalFuncParseInt):
(JSC::globalFuncParseFloat):
(JSC::globalFuncIsNaN):
(JSC::globalFuncIsFinite):
(JSC::globalFuncDecodeURI):
(JSC::globalFuncDecodeURIComponent):
(JSC::globalFuncEncodeURI):
(JSC::globalFuncEncodeURIComponent):
(JSC::globalFuncEscape):
(JSC::globalFuncUnescape):
(JSC::globalFuncJSCPrint):

  • runtime/JSGlobalObjectFunctions.h:
  • runtime/JSONObject.cpp:

(JSC::JSONProtoFuncParse):
(JSC::JSONProtoFuncStringify):

  • runtime/JSString.h:
  • runtime/MathObject.cpp:

(JSC::mathProtoFuncAbs):
(JSC::mathProtoFuncACos):
(JSC::mathProtoFuncASin):
(JSC::mathProtoFuncATan):
(JSC::mathProtoFuncATan2):
(JSC::mathProtoFuncCeil):
(JSC::mathProtoFuncCos):
(JSC::mathProtoFuncExp):
(JSC::mathProtoFuncFloor):
(JSC::mathProtoFuncLog):
(JSC::mathProtoFuncMax):
(JSC::mathProtoFuncMin):
(JSC::mathProtoFuncPow):
(JSC::mathProtoFuncRandom):
(JSC::mathProtoFuncRound):
(JSC::mathProtoFuncSin):
(JSC::mathProtoFuncSqrt):
(JSC::mathProtoFuncTan):

  • runtime/NativeErrorConstructor.cpp:

(JSC::callNativeErrorConstructor):

  • runtime/NumberConstructor.cpp:

(JSC::callNumberConstructor):

  • runtime/NumberPrototype.cpp:

(JSC::numberProtoFuncToString):
(JSC::numberProtoFuncToLocaleString):
(JSC::numberProtoFuncValueOf):
(JSC::numberProtoFuncToFixed):
(JSC::numberProtoFuncToExponential):
(JSC::numberProtoFuncToPrecision):

  • runtime/ObjectConstructor.cpp:

(JSC::callObjectConstructor):
(JSC::objectConstructorGetPrototypeOf):
(JSC::objectConstructorGetOwnPropertyDescriptor):
(JSC::objectConstructorGetOwnPropertyNames):
(JSC::objectConstructorKeys):
(JSC::objectConstructorDefineProperty):
(JSC::objectConstructorDefineProperties):
(JSC::objectConstructorCreate):

  • runtime/ObjectPrototype.cpp:

(JSC::objectProtoFuncValueOf):
(JSC::objectProtoFuncHasOwnProperty):
(JSC::objectProtoFuncIsPrototypeOf):
(JSC::objectProtoFuncDefineGetter):
(JSC::objectProtoFuncDefineSetter):
(JSC::objectProtoFuncLookupGetter):
(JSC::objectProtoFuncLookupSetter):
(JSC::objectProtoFuncPropertyIsEnumerable):
(JSC::objectProtoFuncToLocaleString):
(JSC::objectProtoFuncToString):

  • runtime/ObjectPrototype.h:
  • runtime/Operations.h:

(JSC::jsString):

  • runtime/RegExpConstructor.cpp:

(JSC::callRegExpConstructor):

  • runtime/RegExpObject.cpp:

(JSC::RegExpObject::test):
(JSC::RegExpObject::exec):
(JSC::callRegExpObject):
(JSC::RegExpObject::match):

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

(JSC::regExpProtoFuncTest):
(JSC::regExpProtoFuncExec):
(JSC::regExpProtoFuncCompile):
(JSC::regExpProtoFuncToString):

  • runtime/StringConstructor.cpp:

(JSC::stringFromCharCodeSlowCase):
(JSC::stringFromCharCode):
(JSC::callStringConstructor):

  • runtime/StringPrototype.cpp:

(JSC::stringProtoFuncReplace):
(JSC::stringProtoFuncToString):
(JSC::stringProtoFuncCharAt):
(JSC::stringProtoFuncCharCodeAt):
(JSC::stringProtoFuncConcat):
(JSC::stringProtoFuncIndexOf):
(JSC::stringProtoFuncLastIndexOf):
(JSC::stringProtoFuncMatch):
(JSC::stringProtoFuncSearch):
(JSC::stringProtoFuncSlice):
(JSC::stringProtoFuncSplit):
(JSC::stringProtoFuncSubstr):
(JSC::stringProtoFuncSubstring):
(JSC::stringProtoFuncToLowerCase):
(JSC::stringProtoFuncToUpperCase):
(JSC::stringProtoFuncLocaleCompare):
(JSC::stringProtoFuncBig):
(JSC::stringProtoFuncSmall):
(JSC::stringProtoFuncBlink):
(JSC::stringProtoFuncBold):
(JSC::stringProtoFuncFixed):
(JSC::stringProtoFuncItalics):
(JSC::stringProtoFuncStrike):
(JSC::stringProtoFuncSub):
(JSC::stringProtoFuncSup):
(JSC::stringProtoFuncFontcolor):
(JSC::stringProtoFuncFontsize):
(JSC::stringProtoFuncAnchor):
(JSC::stringProtoFuncLink):
(JSC::stringProtoFuncTrim):
(JSC::stringProtoFuncTrimLeft):
(JSC::stringProtoFuncTrimRight):

JavaScriptGlue: Simplified the host calling convention.

Reviewed by Sam Weinig, Gavin Barraclough, Oliver Hunt.

PART ONE: Functional code changes.

[ None in JavaScriptGlue ]

PART TWO: Global search and replace.

In the areas below, I used global search-and-replace to change

(ExecState*, JSObject*, JSValue, const ArgList&) => (ExecState*)
args.size() => exec->argumentCount()
args.at(i) => exec->argument(i)

  • JSObject.cpp:

(nativeCallFunction):

  • UserObjectImp.cpp:

(UserObjectImp::callAsFunction):

  • UserObjectImp.h:

WebCore: Simplified the host calling convention.

Reviewed by Sam Weinig, Gavin Barraclough, Oliver Hunt.

PART ONE: Functional code changes.

[ None in WebCore ]

PART TWO: Global search and replace.

In the areas below, I used global search-and-replace to change

(ExecState*, JSObject*, JSValue, const ArgList&) => (ExecState*)
args.size() => exec->argumentCount()
args.at(i) => exec->argument(i)

  • bindings/js/JSArrayBufferViewCustom.cpp:

(WebCore::JSArrayBufferView::slice):

  • bindings/js/JSArrayBufferViewHelper.h:

(WebCore::setWebGLArrayHelper):

  • bindings/js/JSCanvasRenderingContext2DCustom.cpp:

(WebCore::JSCanvasRenderingContext2D::setFillColor):
(WebCore::JSCanvasRenderingContext2D::setStrokeColor):
(WebCore::JSCanvasRenderingContext2D::strokeRect):
(WebCore::JSCanvasRenderingContext2D::drawImage):
(WebCore::JSCanvasRenderingContext2D::drawImageFromRect):
(WebCore::JSCanvasRenderingContext2D::setShadow):
(WebCore::JSCanvasRenderingContext2D::createPattern):
(WebCore::JSCanvasRenderingContext2D::createImageData):
(WebCore::JSCanvasRenderingContext2D::putImageData):
(WebCore::JSCanvasRenderingContext2D::fillText):
(WebCore::JSCanvasRenderingContext2D::strokeText):

  • bindings/js/JSClipboardCustom.cpp:

(WebCore::JSClipboard::clearData):
(WebCore::JSClipboard::getData):
(WebCore::JSClipboard::setDragImage):

  • bindings/js/JSDOMApplicationCacheCustom.cpp:

(WebCore::JSDOMApplicationCache::hasItem):
(WebCore::JSDOMApplicationCache::add):
(WebCore::JSDOMApplicationCache::remove):

  • bindings/js/JSDOMFormDataCustom.cpp:

(WebCore::JSDOMFormData::append):

  • bindings/js/JSDOMWindowCustom.cpp:

(WebCore::JSDOMWindow::open):
(WebCore::JSDOMWindow::showModalDialog):
(WebCore::JSDOMWindow::postMessage):
(WebCore::JSDOMWindow::setTimeout):
(WebCore::JSDOMWindow::setInterval):
(WebCore::JSDOMWindow::addEventListener):
(WebCore::JSDOMWindow::removeEventListener):
(WebCore::JSDOMWindow::openDatabase):

  • bindings/js/JSDatabaseCustom.cpp:

(WebCore::JSDatabase::changeVersion):
(WebCore::createTransaction):
(WebCore::JSDatabase::transaction):
(WebCore::JSDatabase::readTransaction):

  • bindings/js/JSDatabaseSyncCustom.cpp:

(WebCore::JSDatabaseSync::changeVersion):
(WebCore::createTransaction):
(WebCore::JSDatabaseSync::transaction):
(WebCore::JSDatabaseSync::readTransaction):

  • bindings/js/JSDedicatedWorkerContextCustom.cpp:

(WebCore::JSDedicatedWorkerContext::postMessage):

  • bindings/js/JSDesktopNotificationsCustom.cpp:

(WebCore::JSNotificationCenter::requestPermission):

  • bindings/js/JSFloatArrayCustom.cpp:

(WebCore::JSFloatArray::set):

  • bindings/js/JSGeolocationCustom.cpp:

(WebCore::JSGeolocation::getCurrentPosition):
(WebCore::JSGeolocation::watchPosition):

  • bindings/js/JSHTMLAllCollectionCustom.cpp:

(WebCore::callHTMLAllCollection):
(WebCore::JSHTMLAllCollection::item):
(WebCore::JSHTMLAllCollection::namedItem):

  • bindings/js/JSHTMLCanvasElementCustom.cpp:

(WebCore::JSHTMLCanvasElement::getContext):

  • bindings/js/JSHTMLCollectionCustom.cpp:

(WebCore::callHTMLCollection):
(WebCore::JSHTMLCollection::item):
(WebCore::JSHTMLCollection::namedItem):

  • bindings/js/JSHTMLDocumentCustom.cpp:

(WebCore::JSHTMLDocument::open):
(WebCore::documentWrite):
(WebCore::JSHTMLDocument::write):
(WebCore::JSHTMLDocument::writeln):

  • bindings/js/JSHTMLInputElementCustom.cpp:

(WebCore::JSHTMLInputElement::setSelectionRange):

  • bindings/js/JSHTMLOptionsCollectionCustom.cpp:

(WebCore::JSHTMLOptionsCollection::add):
(WebCore::JSHTMLOptionsCollection::remove):

  • bindings/js/JSHTMLSelectElementCustom.cpp:

(WebCore::JSHTMLSelectElement::remove):

  • bindings/js/JSHistoryCustom.cpp:

(WebCore::JSHistory::pushState):
(WebCore::JSHistory::replaceState):

  • bindings/js/JSInjectedScriptHostCustom.cpp:

(WebCore::JSInjectedScriptHost::databaseForId):
(WebCore::JSInjectedScriptHost::currentCallFrame):
(WebCore::JSInjectedScriptHost::nodeForId):
(WebCore::JSInjectedScriptHost::pushNodePathToFrontend):
(WebCore::JSInjectedScriptHost::selectDatabase):
(WebCore::JSInjectedScriptHost::selectDOMStorage):
(WebCore::JSInjectedScriptHost::reportDidDispatchOnInjectedScript):

  • bindings/js/JSInspectorFrontendHostCustom.cpp:

(WebCore::JSInspectorFrontendHost::platform):
(WebCore::JSInspectorFrontendHost::port):
(WebCore::JSInspectorFrontendHost::showContextMenu):

  • bindings/js/JSInt16ArrayCustom.cpp:

(WebCore::JSInt16Array::set):

  • bindings/js/JSInt32ArrayCustom.cpp:

(WebCore::JSInt32Array::set):

  • bindings/js/JSInt8ArrayCustom.cpp:

(WebCore::JSInt8Array::set):

  • bindings/js/JSJavaScriptCallFrameCustom.cpp:

(WebCore::JSJavaScriptCallFrame::evaluate):
(WebCore::JSJavaScriptCallFrame::scopeType):

  • bindings/js/JSLocationCustom.cpp:

(WebCore::JSLocation::replace):
(WebCore::JSLocation::reload):
(WebCore::JSLocation::assign):
(WebCore::JSLocation::toString):

  • bindings/js/JSMessageEventCustom.cpp:

(WebCore::JSMessageEvent::initMessageEvent):

  • bindings/js/JSMessagePortCustom.cpp:

(WebCore::JSMessagePort::postMessage):

  • bindings/js/JSMessagePortCustom.h:

(WebCore::handlePostMessage):

  • bindings/js/JSNodeCustom.cpp:

(WebCore::JSNode::insertBefore):
(WebCore::JSNode::replaceChild):
(WebCore::JSNode::removeChild):
(WebCore::JSNode::appendChild):

  • bindings/js/JSNodeListCustom.cpp:

(WebCore::callNodeList):

  • bindings/js/JSPluginElementFunctions.cpp:

(WebCore::callPlugin):

  • bindings/js/JSSQLResultSetRowListCustom.cpp:

(WebCore::JSSQLResultSetRowList::item):

  • bindings/js/JSSQLTransactionCustom.cpp:

(WebCore::JSSQLTransaction::executeSql):

  • bindings/js/JSSQLTransactionSyncCustom.cpp:

(WebCore::JSSQLTransactionSync::executeSql):

  • bindings/js/JSSVGLengthCustom.cpp:

(WebCore::JSSVGLength::convertToSpecifiedUnits):

  • bindings/js/JSSVGMatrixCustom.cpp:

(WebCore::JSSVGMatrix::multiply):
(WebCore::JSSVGMatrix::inverse):
(WebCore::JSSVGMatrix::rotateFromVector):

  • bindings/js/JSSVGPODListCustom.h:

(WebCore::JSSVGPODListCustom::clear):
(WebCore::JSSVGPODListCustom::initialize):
(WebCore::JSSVGPODListCustom::getItem):
(WebCore::JSSVGPODListCustom::insertItemBefore):
(WebCore::JSSVGPODListCustom::replaceItem):
(WebCore::JSSVGPODListCustom::removeItem):
(WebCore::JSSVGPODListCustom::appendItem):

  • bindings/js/JSSVGPathSegListCustom.cpp:

(WebCore::JSSVGPathSegList::clear):
(WebCore::JSSVGPathSegList::initialize):
(WebCore::JSSVGPathSegList::getItem):
(WebCore::JSSVGPathSegList::insertItemBefore):
(WebCore::JSSVGPathSegList::replaceItem):
(WebCore::JSSVGPathSegList::removeItem):
(WebCore::JSSVGPathSegList::appendItem):

  • bindings/js/JSUint16ArrayCustom.cpp:

(WebCore::JSUint16Array::set):

  • bindings/js/JSUint32ArrayCustom.cpp:

(WebCore::JSUint32Array::set):

  • bindings/js/JSUint8ArrayCustom.cpp:

(WebCore::JSUint8Array::set):

  • bindings/js/JSWebGLRenderingContextCustom.cpp:

(WebCore::JSWebGLRenderingContext::bufferData):
(WebCore::JSWebGLRenderingContext::bufferSubData):
(WebCore::getObjectParameter):
(WebCore::JSWebGLRenderingContext::getBufferParameter):
(WebCore::JSWebGLRenderingContext::getFramebufferAttachmentParameter):
(WebCore::JSWebGLRenderingContext::getParameter):
(WebCore::JSWebGLRenderingContext::getProgramParameter):
(WebCore::JSWebGLRenderingContext::getRenderbufferParameter):
(WebCore::JSWebGLRenderingContext::getShaderParameter):
(WebCore::JSWebGLRenderingContext::getTexParameter):
(WebCore::JSWebGLRenderingContext::getUniform):
(WebCore::JSWebGLRenderingContext::getVertexAttrib):
(WebCore::JSWebGLRenderingContext::texImage2D):
(WebCore::JSWebGLRenderingContext::texSubImage2D):
(WebCore::dataFunctionf):
(WebCore::dataFunctioni):
(WebCore::dataFunctionMatrix):
(WebCore::JSWebGLRenderingContext::uniform1fv):
(WebCore::JSWebGLRenderingContext::uniform1iv):
(WebCore::JSWebGLRenderingContext::uniform2fv):
(WebCore::JSWebGLRenderingContext::uniform2iv):
(WebCore::JSWebGLRenderingContext::uniform3fv):
(WebCore::JSWebGLRenderingContext::uniform3iv):
(WebCore::JSWebGLRenderingContext::uniform4fv):
(WebCore::JSWebGLRenderingContext::uniform4iv):
(WebCore::JSWebGLRenderingContext::uniformMatrix2fv):
(WebCore::JSWebGLRenderingContext::uniformMatrix3fv):
(WebCore::JSWebGLRenderingContext::uniformMatrix4fv):
(WebCore::JSWebGLRenderingContext::vertexAttrib1fv):
(WebCore::JSWebGLRenderingContext::vertexAttrib2fv):
(WebCore::JSWebGLRenderingContext::vertexAttrib3fv):
(WebCore::JSWebGLRenderingContext::vertexAttrib4fv):

  • bindings/js/JSWebSocketCustom.cpp:

(WebCore::JSWebSocket::send):

  • bindings/js/JSWorkerContextCustom.cpp:

(WebCore::JSWorkerContext::importScripts):
(WebCore::JSWorkerContext::setTimeout):
(WebCore::JSWorkerContext::setInterval):
(WebCore::JSWorkerContext::openDatabase):
(WebCore::JSWorkerContext::openDatabaseSync):

  • bindings/js/JSWorkerCustom.cpp:

(WebCore::JSWorker::postMessage):

  • bindings/js/JSXMLHttpRequestCustom.cpp:

(WebCore::JSXMLHttpRequest::open):
(WebCore::JSXMLHttpRequest::send):

  • bindings/js/JSXSLTProcessorCustom.cpp:

(WebCore::JSXSLTProcessor::importStylesheet):
(WebCore::JSXSLTProcessor::transformToFragment):
(WebCore::JSXSLTProcessor::transformToDocument):
(WebCore::JSXSLTProcessor::setParameter):
(WebCore::JSXSLTProcessor::getParameter):
(WebCore::JSXSLTProcessor::removeParameter):

  • bindings/js/ScheduledAction.cpp:

(WebCore::ScheduledAction::create):
(WebCore::ScheduledAction::ScheduledAction):

  • bindings/js/ScheduledAction.h:
  • bindings/js/ScriptCallFrame.cpp:

(WebCore::ScriptCallFrame::ScriptCallFrame):

  • bindings/js/ScriptCallFrame.h:
  • bindings/js/ScriptCallStack.cpp:

(WebCore::ScriptCallStack::ScriptCallStack):
(WebCore::ScriptCallStack::initialize):

  • bindings/js/ScriptCallStack.h:
  • bindings/scripts/CodeGeneratorJS.pm:
  • bridge/c/c_instance.cpp:

(JSC::Bindings::CInstance::invokeMethod):
(JSC::Bindings::CInstance::invokeDefaultMethod):

  • bridge/c/c_instance.h:
  • bridge/jni/jsc/JavaInstanceJSC.cpp:

(JavaInstance::invokeMethod):

  • bridge/jni/jsc/JavaInstanceJSC.h:
  • bridge/jsc/BridgeJSC.h:

(JSC::Bindings::Instance::invokeDefaultMethod):

  • bridge/objc/objc_instance.h:
  • bridge/objc/objc_instance.mm:

(ObjcInstance::invokeMethod):
(ObjcInstance::invokeObjcMethod):
(ObjcInstance::invokeDefaultMethod):

  • bridge/objc/objc_runtime.mm:

(JSC::Bindings::callObjCFallbackObject):

  • bridge/runtime_method.cpp:

(JSC::callRuntimeMethod):

  • bridge/runtime_object.cpp:

(JSC::Bindings::callRuntimeObject):

WebKit/mac: Simplified the host calling convention.

Reviewed by Sam Weinig, Gavin Barraclough, Oliver Hunt.

PART ONE: Functional code changes.

[ None in WebKit ]

PART TWO: Global search and replace.

In the areas below, I used global search-and-replace to change

(ExecState*, JSObject*, JSValue, const ArgList&) => (ExecState*)
args.size() => exec->argumentCount()
args.at(i) => exec->argument(i)

  • Plugins/Hosted/ProxyInstance.h:
  • Plugins/Hosted/ProxyInstance.mm:

(WebKit::ProxyInstance::invoke):
(WebKit::ProxyInstance::invokeMethod):
(WebKit::ProxyInstance::invokeDefaultMethod):

LayoutTests: Simplified the host calling convention.

Reviewed by Sam Weinig, Gavin Barraclough, Oliver Hunt.

Changed these results to expect to fail to stringify their exception
objects in the case of stack overflow. (Standardizing the calling
convention has implicitly added stack overflow checks to some places
where they used to be missing.)

In a future patch, I plan to implement a more reliable way to stringify
exceptions without invoking a JS function. For now, though, it seems best
to match other test results, instead of silently overflowing the stack.

  • fast/js/global-recursion-on-full-stack-expected.txt:
  • fast/xmlhttprequest/xmlhttprequest-recursive-sync-event-expected.txt:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/interpreter/Interpreter.cpp

    r60117 r60392  
    376376    JSValue result = jsUndefined();
    377377    if (eval)
    378         result = callFrame->globalData().interpreter->execute(eval.get(), callFrame, callFrame->thisValue().toThisObject(callFrame), callFrame->registers() - registerFile->start() + registerOffset, scopeChain, &exceptionValue);
     378        result = callFrame->globalData().interpreter->execute(eval.get(), callFrame, callFrame->r(codeBlock->thisRegister()).jsValue().toThisObject(callFrame), callFrame->registers() - registerFile->start() + registerOffset, scopeChain, &exceptionValue);
    379379
    380380    return result;
     
    629629    }
    630630
    631     // Now unwind the scope chain within the exception handler's call frame.
    632 
     631    // Shrink the JS stack, in case stack overflow made it huge.
     632    m_registerFile.shrink(callFrame->registers() + callFrame->codeBlock()->m_numCalleeRegisters);
     633
     634    // Unwind the scope chain within the exception handler's call frame.
    633635    ScopeChainNode* scopeChain = callFrame->scopeChain();
    634636    ScopeChain sc(scopeChain);
     
    662664    }
    663665
    664     DynamicGlobalObjectScope globalObjectScope(callFrame, scopeChain->globalObject);
    665 
    666666    JSGlobalObject* lastGlobalObject = m_registerFile.globalObject();
    667667    JSGlobalObject* globalObject = callFrame->dynamicGlobalObject();
     
    669669
    670670    CallFrame* newCallFrame = CallFrame::create(oldEnd + codeBlock->m_numParameters + RegisterFile::CallFrameHeaderSize);
    671     newCallFrame->r(codeBlock->thisRegister()) = JSValue(thisObj);
    672     newCallFrame->init(codeBlock, 0, scopeChain, CallFrame::noCaller(), 0, 0, 0);
     671    ASSERT(codeBlock->m_numParameters == 1); // 1 parameter for 'this'.
     672    newCallFrame->init(codeBlock, 0, scopeChain, CallFrame::noCaller(), codeBlock->m_numParameters, 0);
     673    newCallFrame->r(newCallFrame->hostThisRegister()) = JSValue(thisObj);
    673674
    674675    if (codeBlock->needsFullScopeChain())
    675676        scopeChain->ref();
     677
     678    DynamicGlobalObjectScope globalObjectScope(callFrame, scopeChain->globalObject);
    676679
    677680    Profiler** profiler = Profiler::enabledProfilerReference();
     
    703706}
    704707
    705 JSValue Interpreter::executeCall(FunctionExecutable* functionExecutable, CallFrame* callFrame, JSFunction* function, JSObject* thisObj, const ArgList& args, ScopeChainNode* scopeChain, JSValue* exception)
     708JSValue Interpreter::executeCall(CallFrame* callFrame, JSObject* function, CallType callType, const CallData& callData, JSValue thisValue, const ArgList& args, JSValue* exception)
    706709{
    707     ASSERT(!scopeChain->globalData->exception);
     710    ASSERT(!callFrame->hadException());
    708711
    709712    if (m_reentryDepth >= MaxSmallThreadReentryDepth) {
     
    715718
    716719    Register* oldEnd = m_registerFile.end();
     720    int argCount = 1 + args.size(); // implicit "this" parameter
     721    size_t registerOffset = argCount + RegisterFile::CallFrameHeaderSize;
     722
     723    if (!m_registerFile.grow(oldEnd + registerOffset)) {
     724        *exception = createStackOverflowError(callFrame);
     725        return jsNull();
     726    }
     727
     728    CallFrame* newCallFrame = CallFrame::create(oldEnd);
     729    size_t dst = 0;
     730    newCallFrame->r(0) = thisValue;
     731    ArgList::const_iterator end = args.end();
     732    for (ArgList::const_iterator it = args.begin(); it != end; ++it)
     733        newCallFrame->r(++dst) = *it;
     734
     735    if (callType == CallTypeJS) {
     736        ScopeChainNode* callDataScopeChain = callData.js.scopeChain;
     737        CodeBlock* newCodeBlock = &callData.js.functionExecutable->bytecodeForCall(callFrame, callDataScopeChain);
     738
     739        newCallFrame = slideRegisterWindowForCall(newCodeBlock, &m_registerFile, newCallFrame, registerOffset, argCount);
     740        if (UNLIKELY(!newCallFrame)) {
     741            *exception = createStackOverflowError(callFrame);
     742            m_registerFile.shrink(oldEnd);
     743            return jsNull();
     744        }
     745
     746        newCallFrame->init(newCodeBlock, 0, callDataScopeChain, callFrame->addHostCallFrameFlag(), argCount, function);
     747
     748        DynamicGlobalObjectScope globalObjectScope(newCallFrame, callDataScopeChain->globalObject);
     749
     750        Profiler** profiler = Profiler::enabledProfilerReference();
     751        if (*profiler)
     752            (*profiler)->willExecute(newCallFrame, function);
     753
     754        JSValue result;
     755        {
     756            SamplingTool::CallRecord callRecord(m_sampler.get());
     757
     758            m_reentryDepth++;
     759    #if ENABLE(JIT)
     760            result = callData.js.functionExecutable->jitCodeForCall(newCallFrame, callDataScopeChain).execute(&m_registerFile, newCallFrame, callDataScopeChain->globalData, exception);
     761    #else
     762            result = privateExecute(Normal, &m_registerFile, newCallFrame, exception);
     763    #endif
     764            m_reentryDepth--;
     765        }
     766
     767        if (*profiler)
     768            (*profiler)->didExecute(newCallFrame, function);
     769
     770        m_registerFile.shrink(oldEnd);
     771        return result;
     772    }
     773
     774    ASSERT(callType == CallTypeHost);
     775    ScopeChainNode* scopeChain = callFrame->scopeChain();
     776    newCallFrame = CallFrame::create(newCallFrame->registers() + registerOffset);
     777    newCallFrame->init(0, 0, scopeChain, callFrame->addHostCallFrameFlag(), argCount, function);
     778
     779    DynamicGlobalObjectScope globalObjectScope(newCallFrame, scopeChain->globalObject);
     780
     781    Profiler** profiler = Profiler::enabledProfilerReference();
     782    if (*profiler)
     783        (*profiler)->willExecute(newCallFrame, function);
     784
     785    JSValue result;
     786    {
     787        SamplingTool::HostCallRecord callRecord(m_sampler.get());
     788        result = callData.native.function(newCallFrame);
     789    }
     790
     791    if (*profiler)
     792        (*profiler)->didExecute(newCallFrame, function);
     793
     794    m_registerFile.shrink(oldEnd);
     795    return result;
     796}
     797
     798JSValue Interpreter::executeConstruct(FunctionExecutable* functionExecutable, CallFrame* callFrame, JSFunction* function, JSObject* thisObj, const ArgList& args, ScopeChainNode* scopeChain, JSValue* exception)
     799{
     800    ASSERT(!scopeChain->globalData->exception);
     801
     802    if (m_reentryDepth >= MaxSmallThreadReentryDepth) {
     803        if (m_reentryDepth >= callFrame->globalData().maxReentryDepth) {
     804            *exception = createStackOverflowError(callFrame);
     805            return jsNull();
     806        }
     807    }
     808
     809    Register* oldEnd = m_registerFile.end();
    717810    int argc = 1 + args.size(); // implicit "this" parameter
    718811
     
    721814        return jsNull();
    722815    }
    723 
    724     DynamicGlobalObjectScope globalObjectScope(callFrame, scopeChain->globalObject);
    725816
    726817    CallFrame* newCallFrame = CallFrame::create(oldEnd);
     
    731822        newCallFrame->r(++dst) = *it;
    732823
    733     CodeBlock* codeBlock = &functionExecutable->bytecodeForCall(callFrame, scopeChain);
    734     newCallFrame = slideRegisterWindowForCall(codeBlock, &m_registerFile, newCallFrame, argc + RegisterFile::CallFrameHeaderSize, argc);
    735     if (UNLIKELY(!newCallFrame)) {
    736         *exception = createStackOverflowError(callFrame);
    737         m_registerFile.shrink(oldEnd);
    738         return jsNull();
    739     }
    740     // a 0 codeBlock indicates a built-in caller
    741     newCallFrame->init(codeBlock, 0, scopeChain, callFrame->addHostCallFrameFlag(), 0, argc, function);
    742 
    743     Profiler** profiler = Profiler::enabledProfilerReference();
    744     if (*profiler)
    745         (*profiler)->willExecute(callFrame, function);
    746 
    747     JSValue result;
    748     {
    749         SamplingTool::CallRecord callRecord(m_sampler.get());
    750 
    751         m_reentryDepth++;
    752 #if ENABLE(JIT)
    753         result = functionExecutable->jitCodeForCall(newCallFrame, scopeChain).execute(&m_registerFile, newCallFrame, scopeChain->globalData, exception);
    754 #else
    755         result = privateExecute(Normal, &m_registerFile, newCallFrame, exception);
    756 #endif
    757         m_reentryDepth--;
    758     }
    759 
    760     if (*profiler)
    761         (*profiler)->didExecute(callFrame, function);
    762 
    763     m_registerFile.shrink(oldEnd);
    764     return result;
    765 }
    766 
    767 JSValue Interpreter::executeConstruct(FunctionExecutable* functionExecutable, CallFrame* callFrame, JSFunction* function, JSObject* thisObj, const ArgList& args, ScopeChainNode* scopeChain, JSValue* exception)
    768 {
    769     ASSERT(!scopeChain->globalData->exception);
    770 
    771     if (m_reentryDepth >= MaxSmallThreadReentryDepth) {
    772         if (m_reentryDepth >= callFrame->globalData().maxReentryDepth) {
    773             *exception = createStackOverflowError(callFrame);
    774             return jsNull();
    775         }
    776     }
    777 
    778     Register* oldEnd = m_registerFile.end();
    779     int argc = 1 + args.size(); // implicit "this" parameter
    780 
    781     if (!m_registerFile.grow(oldEnd + argc)) {
    782         *exception = createStackOverflowError(callFrame);
    783         return jsNull();
    784     }
    785 
    786     DynamicGlobalObjectScope globalObjectScope(callFrame, scopeChain->globalObject);
    787 
    788     CallFrame* newCallFrame = CallFrame::create(oldEnd);
    789     size_t dst = 0;
    790     newCallFrame->r(0) = JSValue(thisObj);
    791     ArgList::const_iterator end = args.end();
    792     for (ArgList::const_iterator it = args.begin(); it != end; ++it)
    793         newCallFrame->r(++dst) = *it;
    794 
    795824    CodeBlock* codeBlock = &functionExecutable->bytecodeForConstruct(callFrame, scopeChain);
    796825    newCallFrame = slideRegisterWindowForCall(codeBlock, &m_registerFile, newCallFrame, argc + RegisterFile::CallFrameHeaderSize, argc);
     
    801830    }
    802831    // a 0 codeBlock indicates a built-in caller
    803     newCallFrame->init(codeBlock, 0, scopeChain, callFrame->addHostCallFrameFlag(), 0, argc, function);
     832    newCallFrame->init(codeBlock, 0, scopeChain, callFrame->addHostCallFrameFlag(), argc, function);
     833
     834    DynamicGlobalObjectScope globalObjectScope(callFrame, scopeChain->globalObject);
    804835
    805836    Profiler** profiler = Profiler::enabledProfilerReference();
     
    859890    }
    860891    // a 0 codeBlock indicates a built-in caller
    861     newCallFrame->init(codeBlock, 0, scopeChain, callFrame->addHostCallFrameFlag(), 0, argc, function);
     892    newCallFrame->init(codeBlock, 0, scopeChain, callFrame->addHostCallFrameFlag(), argc, function);
    862893#if ENABLE(JIT)
    863894    FunctionExecutable->jitCodeForCall(newCallFrame, scopeChain);
     
    958989
    959990    // a 0 codeBlock indicates a built-in caller
    960     newCallFrame->r(codeBlock->thisRegister()) = JSValue(thisObj);
    961     newCallFrame->init(codeBlock, 0, scopeChain, callFrame->addHostCallFrameFlag(), 0, 0, 0);
     991    ASSERT(codeBlock->m_numParameters == 1); // 1 parameter for 'this'.
     992    newCallFrame->init(codeBlock, 0, scopeChain, callFrame->addHostCallFrameFlag(), codeBlock->m_numParameters, 0);
     993    newCallFrame->r(newCallFrame->hostThisRegister()) = JSValue(thisObj);
    962994
    963995    if (codeBlock->needsFullScopeChain())
     
    29392971        int offset = 0;
    29402972        if (subscript == expectedSubscript && baseValue.isCell() && (baseValue.asCell()->structure() == it->cachedStructure()) && it->getOffset(index, offset)) {
    2941             callFrame->r(dst) = asObject(baseValue)->getDirectOffset(offset);
     2973            callFrame->r(dst) = JSValue(asObject(baseValue)->getDirectOffset(offset));
    29422974            vPC += OPCODE_LENGTH(op_get_by_pname);
    29432975            NEXT_INSTRUCTION();
     
    35783610            }
    35793611
    3580             callFrame->init(newCodeBlock, vPC + OPCODE_LENGTH(op_call), callDataScopeChain, previousCallFrame, 0, argCount, asFunction(v));
     3612            callFrame->init(newCodeBlock, vPC + OPCODE_LENGTH(op_call), callDataScopeChain, previousCallFrame, argCount, asFunction(v));
    35813613            codeBlock = newCodeBlock;
    35823614            ASSERT(codeBlock == callFrame->codeBlock());
     
    35933625            ScopeChainNode* scopeChain = callFrame->scopeChain();
    35943626            CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + registerOffset);
    3595             newCallFrame->init(0, vPC + OPCODE_LENGTH(op_call), scopeChain, callFrame, 0, argCount, 0);
     3627            newCallFrame->init(0, vPC + OPCODE_LENGTH(op_call), scopeChain, callFrame, argCount, asObject(v));
    35963628
    35973629            Register* thisRegister = newCallFrame->registers() - RegisterFile::CallFrameHeaderSize - argCount;
    35983630            ArgList args(thisRegister + 1, argCount - 1);
    3599 
    3600             // FIXME: All host methods should be calling toThisObject, but this is not presently the case.
    3601             JSValue thisValue = thisRegister->jsValue();
    3602             if (thisValue == jsNull())
    3603                 thisValue = callFrame->globalThisValue();
    36043631
    36053632            JSValue returnValue;
    36063633            {
    36073634                SamplingTool::HostCallRecord callRecord(m_sampler.get());
    3608                 returnValue = callData.native.function(newCallFrame, asObject(v), thisValue, args);
     3635                returnValue = callData.native.function(newCallFrame);
    36093636            }
    36103637            CHECK_FOR_EXCEPTION();
     
    36283655        int32_t argCount = 0;
    36293656        if (!arguments) {
    3630             argCount = (uint32_t)(callFrame->argumentCount()) - 1;
     3657            argCount = (uint32_t)(callFrame->argumentCount());
    36313658            int32_t sizeDelta = argsOffset + argCount + RegisterFile::CallFrameHeaderSize;
    36323659            Register* newEnd = callFrame->registers() + sizeDelta;
     
    36353662                goto vm_throw;
    36363663            }
    3637             ASSERT(!callFrame->callee()->isHostFunction());
    3638             int32_t expectedParams = callFrame->callee()->jsExecutable()->parameterCount();
     3664            ASSERT(!asFunction(callFrame->callee())->isHostFunction());
     3665            int32_t expectedParams = asFunction(callFrame->callee())->jsExecutable()->parameterCount();
    36393666            int32_t inplaceArgs = min(argCount, expectedParams);
    36403667            int32_t i = 0;
     
    37333760            }
    37343761           
    3735             callFrame->init(newCodeBlock, vPC + OPCODE_LENGTH(op_call_varargs), callDataScopeChain, previousCallFrame, 0, argCount, asFunction(v));
     3762            callFrame->init(newCodeBlock, vPC + OPCODE_LENGTH(op_call_varargs), callDataScopeChain, previousCallFrame, argCount, asFunction(v));
    37363763            codeBlock = newCodeBlock;
    37373764            ASSERT(codeBlock == callFrame->codeBlock());
     
    37483775            ScopeChainNode* scopeChain = callFrame->scopeChain();
    37493776            CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + registerOffset);
    3750             newCallFrame->init(0, vPC + OPCODE_LENGTH(op_call_varargs), scopeChain, callFrame, 0, argCount, 0);
     3777            newCallFrame->init(0, vPC + OPCODE_LENGTH(op_call_varargs), scopeChain, callFrame, argCount, asObject(v));
    37513778           
    37523779            Register* thisRegister = newCallFrame->registers() - RegisterFile::CallFrameHeaderSize - argCount;
    37533780            ArgList args(thisRegister + 1, argCount - 1);
    37543781           
    3755             // FIXME: All host methods should be calling toThisObject, but this is not presently the case.
    3756             JSValue thisValue = thisRegister->jsValue();
    3757             if (thisValue == jsNull())
    3758                 thisValue = callFrame->globalThisValue();
    3759            
    37603782            JSValue returnValue;
    37613783            {
    37623784                SamplingTool::HostCallRecord callRecord(m_sampler.get());
    3763                 returnValue = callData.native.function(newCallFrame, asObject(v), thisValue, args);
     3785                returnValue = callData.native.function(newCallFrame);
    37643786            }
    37653787            CHECK_FOR_EXCEPTION();
     
    39663988        else
    39673989            structure = constructor->scope().node()->globalObject->emptyObjectStructure();
    3968         callFrame->r(thisRegister) = new (&callFrame->globalData()) JSObject(structure);
     3990        callFrame->r(thisRegister) = JSValue(new (&callFrame->globalData()) JSObject(structure));
    39693991
    39703992        vPC += OPCODE_LENGTH(op_create_this);
     
    40604082            }
    40614083
    4062             callFrame->init(newCodeBlock, vPC + OPCODE_LENGTH(op_construct), callDataScopeChain, previousCallFrame, 0, argCount, asFunction(v));
     4084            callFrame->init(newCodeBlock, vPC + OPCODE_LENGTH(op_construct), callDataScopeChain, previousCallFrame, argCount, asFunction(v));
    40634085            codeBlock = newCodeBlock;
    40644086            vPC = newCodeBlock->instructions().begin();
     
    40744096            ScopeChainNode* scopeChain = callFrame->scopeChain();
    40754097            CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + registerOffset);
    4076             newCallFrame->init(0, vPC + OPCODE_LENGTH(op_construct), scopeChain, callFrame, 0, argCount, 0);
     4098            newCallFrame->init(0, vPC + OPCODE_LENGTH(op_construct), scopeChain, callFrame, argCount, 0);
    40774099
    40784100            Register* thisRegister = newCallFrame->registers() - RegisterFile::CallFrameHeaderSize - argCount;
Note: See TracChangeset for help on using the changeset viewer.