diff options
Diffstat (limited to 'Source/JavaScriptCore/jit/JITStubs.cpp')
-rw-r--r-- | Source/JavaScriptCore/jit/JITStubs.cpp | 52 |
1 files changed, 17 insertions, 35 deletions
diff --git a/Source/JavaScriptCore/jit/JITStubs.cpp b/Source/JavaScriptCore/jit/JITStubs.cpp index 74f505f..95bf52c 100644 --- a/Source/JavaScriptCore/jit/JITStubs.cpp +++ b/Source/JavaScriptCore/jit/JITStubs.cpp @@ -40,7 +40,6 @@ #include "Debugger.h" #include "ExceptionHelpers.h" #include "GetterSetter.h" -#include "GlobalEvalFunction.h" #include "JIT.h" #include "JSActivation.h" #include "JSArray.h" @@ -717,7 +716,7 @@ JITThunks::JITThunks(JSGlobalData* globalData) ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, thunkReturnAddress) == THUNK_RETURN_ADDRESS_OFFSET); ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, registerFile) == REGISTER_FILE_OFFSET); ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, callFrame) == CALLFRAME_OFFSET); - ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, exception) == EXCEPTION_OFFSET); + ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, unused1) == EXCEPTION_OFFSET); ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, enabledProfilerReference) == ENABLE_PROFILER_REFERENCE_OFFSET); ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, globalData) == GLOBAL_DATA_OFFSET); @@ -1175,8 +1174,8 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_create_this) if (proto.isObject()) structure = asObject(proto)->inheritorID(); else - structure = constructor->scope().node()->globalObject->emptyObjectStructure(); - JSValue result = new (&callFrame->globalData()) JSObject(structure); + structure = constructor->scope()->globalObject->emptyObjectStructure(); + JSValue result = constructEmptyObject(callFrame, structure); return JSValue::encode(result); } @@ -1205,15 +1204,6 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_convert_this_strict) return JSValue::encode(result); } -DEFINE_STUB_FUNCTION(void, op_end) -{ - STUB_INIT_STACK_FRAME(stackFrame); - - ScopeChainNode* scopeChain = stackFrame.callFrame->scopeChain(); - ASSERT(scopeChain->refCount > 1); - scopeChain->deref(); -} - DEFINE_STUB_FUNCTION(EncodedJSValue, op_add) { STUB_INIT_STACK_FRAME(stackFrame); @@ -1848,7 +1838,7 @@ DEFINE_STUB_FUNCTION(void*, op_call_jitCompile) JSFunction* function = asFunction(stackFrame.callFrame->callee()); ASSERT(!function->isHostFunction()); FunctionExecutable* executable = function->jsExecutable(); - ScopeChainNode* callDataScopeChain = function->scope().node(); + ScopeChainNode* callDataScopeChain = function->scope(); JSObject* error = executable->compileForCall(stackFrame.callFrame, callDataScopeChain); if (error) { stackFrame.callFrame->globalData().exception = error; @@ -1869,7 +1859,7 @@ DEFINE_STUB_FUNCTION(void*, op_construct_jitCompile) JSFunction* function = asFunction(stackFrame.callFrame->callee()); ASSERT(!function->isHostFunction()); FunctionExecutable* executable = function->jsExecutable(); - ScopeChainNode* callDataScopeChain = function->scope().node(); + ScopeChainNode* callDataScopeChain = function->scope(); JSObject* error = executable->compileForConstruct(stackFrame.callFrame, callDataScopeChain); if (error) { stackFrame.callFrame->globalData().exception = error; @@ -1930,7 +1920,7 @@ DEFINE_STUB_FUNCTION(void*, op_call_arityCheck) callFrame->setCallerFrame(oldCallFrame); callFrame->setArgumentCountIncludingThis(argCount); callFrame->setCallee(callee); - callFrame->setScopeChain(callee->scope().node()); + callFrame->setScopeChain(callee->scope()); callFrame->setReturnPC(pc.value()); ASSERT((void*)callFrame <= stackFrame.registerFile->end()); @@ -1989,7 +1979,7 @@ DEFINE_STUB_FUNCTION(void*, op_construct_arityCheck) callFrame->setCallerFrame(oldCallFrame); callFrame->setArgumentCountIncludingThis(argCount); callFrame->setCallee(callee); - callFrame->setScopeChain(callee->scope().node()); + callFrame->setScopeChain(callee->scope()); callFrame->setReturnPC(pc.value()); ASSERT((void*)callFrame <= stackFrame.registerFile->end()); @@ -2010,7 +2000,7 @@ DEFINE_STUB_FUNCTION(void*, vm_lazyLinkCall) codePtr = executable->generatedJITCodeForCall().addressForCall(); else { FunctionExecutable* functionExecutable = static_cast<FunctionExecutable*>(executable); - JSObject* error = functionExecutable->compileForCall(callFrame, callee->scope().node()); + JSObject* error = functionExecutable->compileForCall(callFrame, callee->scope()); if (error) { callFrame->globalData().exception = createStackOverflowError(callFrame); return 0; @@ -2044,7 +2034,7 @@ DEFINE_STUB_FUNCTION(void*, vm_lazyLinkConstruct) codePtr = executable->generatedJITCodeForConstruct().addressForCall(); else { FunctionExecutable* functionExecutable = static_cast<FunctionExecutable*>(executable); - JSObject* error = functionExecutable->compileForConstruct(callFrame, callee->scope().node()); + JSObject* error = functionExecutable->compileForConstruct(callFrame, callee->scope()); if (error) { throwStackOverflowError(callFrame, stackFrame.globalData, ReturnAddressPtr(callFrame->returnPC()), STUB_RETURN_ADDRESS); return 0; @@ -2071,7 +2061,7 @@ DEFINE_STUB_FUNCTION(JSObject*, op_push_activation) STUB_INIT_STACK_FRAME(stackFrame); JSActivation* activation = new (stackFrame.globalData) JSActivation(stackFrame.callFrame, static_cast<FunctionExecutable*>(stackFrame.callFrame->codeBlock()->ownerExecutable())); - stackFrame.callFrame->setScopeChain(stackFrame.callFrame->scopeChain()->copy()->push(activation)); + stackFrame.callFrame->setScopeChain(stackFrame.callFrame->scopeChain()->push(activation)); return activation; } @@ -2139,12 +2129,12 @@ DEFINE_STUB_FUNCTION(void, op_tear_off_activation) if (!activationValue) { if (JSValue v = stackFrame.args[1].jsValue()) { if (!stackFrame.callFrame->codeBlock()->isStrictMode()) - asArguments(v)->copyRegisters(); + asArguments(v)->copyRegisters(*stackFrame.globalData); } return; } JSActivation* activation = asActivation(stackFrame.args[0].jsValue()); - activation->copyRegisters(); + activation->copyRegisters(*stackFrame.globalData); if (JSValue v = stackFrame.args[1].jsValue()) { if (!stackFrame.callFrame->codeBlock()->isStrictMode()) asArguments(v)->setActivation(*stackFrame.globalData, activation); @@ -2156,7 +2146,7 @@ DEFINE_STUB_FUNCTION(void, op_tear_off_arguments) STUB_INIT_STACK_FRAME(stackFrame); ASSERT(stackFrame.callFrame->codeBlock()->usesArguments() && !stackFrame.callFrame->codeBlock()->needsFullScopeChain()); - asArguments(stackFrame.args[0].jsValue())->copyRegisters(); + asArguments(stackFrame.args[0].jsValue())->copyRegisters(*stackFrame.globalData); } DEFINE_STUB_FUNCTION(void, op_profile_will_call) @@ -2175,14 +2165,6 @@ DEFINE_STUB_FUNCTION(void, op_profile_did_call) (*stackFrame.enabledProfilerReference)->didExecute(stackFrame.callFrame, stackFrame.args[0].jsValue()); } -DEFINE_STUB_FUNCTION(void, op_ret_scopeChain) -{ - STUB_INIT_STACK_FRAME(stackFrame); - - ASSERT(stackFrame.callFrame->codeBlock()->needsFullScopeChain()); - stackFrame.callFrame->scopeChain()->deref(); -} - DEFINE_STUB_FUNCTION(JSObject*, op_new_array) { STUB_INIT_STACK_FRAME(stackFrame); @@ -2525,7 +2507,7 @@ DEFINE_STUB_FUNCTION(int, op_load_varargs) stackFrame.globalData->exception = createInvalidParamError(callFrame, "Function.prototype.apply", arguments); VM_THROW_EXCEPTION(); } - if (asObject(arguments)->classInfo() == &Arguments::info) { + if (asObject(arguments)->classInfo() == &Arguments::s_info) { Arguments* argsObject = asArguments(arguments); argCount = argsObject->numProvidedArguments(callFrame); argCount = min(argCount, static_cast<uint32_t>(Arguments::MaxArguments)); @@ -2547,7 +2529,7 @@ DEFINE_STUB_FUNCTION(int, op_load_varargs) VM_THROW_EXCEPTION(); } array->copyToRegisters(callFrame, callFrame->registers() + argsOffset, argCount); - } else if (asObject(arguments)->inherits(&JSArray::info)) { + } else if (asObject(arguments)->inherits(&JSArray::s_info)) { JSObject* argObject = asObject(arguments); argCount = argObject->get(callFrame, callFrame->propertyNames().length).toUInt32(callFrame); argCount = min(argCount, static_cast<uint32_t>(Arguments::MaxArguments)); @@ -3009,7 +2991,7 @@ DEFINE_STUB_FUNCTION(JSObject*, op_new_func_exp) */ if (!function->name().isNull()) { JSStaticScopeObject* functionScopeObject = new (callFrame) JSStaticScopeObject(callFrame, function->name(), func, ReadOnly | DontDelete); - func->scope().push(functionScopeObject); + func->setScope(callFrame->globalData(), func->scope()->push(functionScopeObject)); } return func; @@ -3119,7 +3101,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_call_eval) Register* newCallFrame = callFrame->registers() + registerOffset; Register* argv = newCallFrame - RegisterFile::CallFrameHeaderSize - argCount; JSValue baseValue = argv[0].jsValue(); - JSGlobalObject* globalObject = callFrame->scopeChain()->globalObject; + JSGlobalObject* globalObject = callFrame->scopeChain()->globalObject.get(); if (baseValue == globalObject && funcVal == globalObject->evalFunction()) { JSValue result = interpreter->callEval(callFrame, registerFile, argv, argCount, registerOffset); |