Changeset 79904 in webkit for trunk/Source/JavaScriptCore/jit
- Timestamp:
- Feb 28, 2011, 1:05:22 PM (14 years ago)
- Location:
- trunk/Source/JavaScriptCore/jit
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/jit/JITCall.cpp
r70111 r79904 50 50 { 51 51 store32(regT1, Address(callFrameRegister, RegisterFile::ArgumentCount * static_cast<int>(sizeof(Register)))); 52 loadPtr(Address(regT0, OBJECT_OFFSETOF(JSFunction, m_scopeChain) + OBJECT_OFFSETOF(ScopeChain, m_node)), regT3); // newScopeChain52 loadPtr(Address(regT0, OBJECT_OFFSETOF(JSFunction, m_scopeChain)), regT3); // newScopeChain 53 53 storePtr(regT0, Address(callFrameRegister, RegisterFile::Callee * static_cast<int>(sizeof(Register)))); 54 54 storePtr(regT3, Address(callFrameRegister, RegisterFile::ScopeChain * static_cast<int>(sizeof(Register)))); … … 199 199 // Note that this omits to set up RegisterFile::CodeBlock, which is set in the callee 200 200 201 loadPtr(Address(regT0, OBJECT_OFFSETOF(JSFunction, m_scopeChain) + OBJECT_OFFSETOF(ScopeChain, m_node)), regT1); // newScopeChain201 loadPtr(Address(regT0, OBJECT_OFFSETOF(JSFunction, m_scopeChain)), regT1); // newScopeChain 202 202 203 203 store32(Imm32(argCount), Address(callFrameRegister, (registerOffset + RegisterFile::ArgumentCount) * static_cast<int>(sizeof(Register)))); -
trunk/Source/JavaScriptCore/jit/JITCall32_64.cpp
r79247 r79904 51 51 // regT0 holds callee, regT1 holds argCount 52 52 store32(regT1, Address(callFrameRegister, RegisterFile::ArgumentCount * static_cast<int>(sizeof(Register)))); 53 loadPtr(Address(regT0, OBJECT_OFFSETOF(JSFunction, m_scopeChain) + OBJECT_OFFSETOF(ScopeChain, m_node)), regT3); // scopeChain53 loadPtr(Address(regT0, OBJECT_OFFSETOF(JSFunction, m_scopeChain)), regT3); // scopeChain 54 54 storePtr(regT0, Address(callFrameRegister, RegisterFile::Callee * static_cast<int>(sizeof(Register)))); // callee 55 55 storePtr(regT3, Address(callFrameRegister, RegisterFile::ScopeChain * static_cast<int>(sizeof(Register)))); // scopeChain … … 108 108 unsigned dst = currentInstruction[1].u.operand; 109 109 110 // We could JIT generate the deref, only calling out to C when the refcount hits zero.111 if (m_codeBlock->needsFullScopeChain()) {112 Jump activationNotCreated = branch32(Equal, tagFor(m_codeBlock->activationRegister()), Imm32(JSValue::EmptyValueTag));113 JITStubCall(this, cti_op_ret_scopeChain).call();114 activationNotCreated.link(this);115 }116 110 emitLoad(dst, regT1, regT0); 117 111 emitGetFromCallFrameHeaderPtr(RegisterFile::ReturnPC, regT2); … … 126 120 unsigned result = currentInstruction[1].u.operand; 127 121 unsigned thisReg = currentInstruction[2].u.operand; 128 129 // We could JIT generate the deref, only calling out to C when the refcount hits zero.130 if (m_codeBlock->needsFullScopeChain()) {131 Jump activationNotCreated = branch32(Equal, tagFor(m_codeBlock->activationRegister()), Imm32(JSValue::EmptyValueTag));132 JITStubCall(this, cti_op_ret_scopeChain).call();133 activationNotCreated.link(this);134 }135 122 136 123 emitLoad(result, regT1, regT0); … … 292 279 // Fast version of stack frame initialization, directly relative to edi. 293 280 // Note that this omits to set up RegisterFile::CodeBlock, which is set in the callee 294 loadPtr(Address(regT0, OBJECT_OFFSETOF(JSFunction, m_scopeChain) + OBJECT_OFFSETOF(ScopeChain, m_node)), regT2);281 loadPtr(Address(regT0, OBJECT_OFFSETOF(JSFunction, m_scopeChain)), regT2); 295 282 296 283 store32(Imm32(argCount), Address(callFrameRegister, (registerOffset + RegisterFile::ArgumentCount) * static_cast<int>(sizeof(Register)))); -
trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp
r78732 r79904 331 331 void JIT::emit_op_end(Instruction* currentInstruction) 332 332 { 333 if (m_codeBlock->needsFullScopeChain())334 JITStubCall(this, cti_op_end).call();335 336 333 ASSERT(returnValueRegister != callFrameRegister); 337 334 emitGetVirtualRegister(currentInstruction[1].u.operand, returnValueRegister); … … 544 541 void JIT::emit_op_ret(Instruction* currentInstruction) 545 542 { 546 // We could JIT generate the deref, only calling out to C when the refcount hits zero.547 if (m_codeBlock->needsFullScopeChain()) {548 Jump activationNotCreated = branchTestPtr(Zero, addressFor(m_codeBlock->activationRegister()));549 JITStubCall(this, cti_op_ret_scopeChain).call();550 activationNotCreated.link(this);551 }552 543 ASSERT(callFrameRegister != regT1); 553 544 ASSERT(regT1 != returnValueRegister); … … 570 561 void JIT::emit_op_ret_object_or_this(Instruction* currentInstruction) 571 562 { 572 // We could JIT generate the deref, only calling out to C when the refcount hits zero.573 if (m_codeBlock->needsFullScopeChain()) {574 Jump activationNotCreated = branchTestPtr(Zero, addressFor(m_codeBlock->activationRegister()));575 JITStubCall(this, cti_op_ret_scopeChain).call();576 activationNotCreated.link(this);577 }578 579 563 ASSERT(callFrameRegister != regT1); 580 564 ASSERT(regT1 != returnValueRegister); -
trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
r78732 r79904 449 449 void JIT::emit_op_end(Instruction* currentInstruction) 450 450 { 451 if (m_codeBlock->needsFullScopeChain())452 JITStubCall(this, cti_op_end).call();453 451 ASSERT(returnValueRegister != callFrameRegister); 454 452 emitLoad(currentInstruction[1].u.operand, regT1, regT0); -
trunk/Source/JavaScriptCore/jit/JITStubs.cpp
r79551 r79904 1175 1175 structure = asObject(proto)->inheritorID(); 1176 1176 else 1177 structure = constructor->scope() .node()->globalObject->emptyObjectStructure();1177 structure = constructor->scope()->globalObject->emptyObjectStructure(); 1178 1178 JSValue result = constructEmptyObject(callFrame, structure); 1179 1179 … … 1203 1203 CHECK_FOR_EXCEPTION_AT_END(); 1204 1204 return JSValue::encode(result); 1205 }1206 1207 DEFINE_STUB_FUNCTION(void, op_end)1208 {1209 STUB_INIT_STACK_FRAME(stackFrame);1210 1211 ScopeChainNode* scopeChain = stackFrame.callFrame->scopeChain();1212 ASSERT(scopeChain->refCount > 1);1213 scopeChain->deref();1214 1205 } 1215 1206 … … 1848 1839 ASSERT(!function->isHostFunction()); 1849 1840 FunctionExecutable* executable = function->jsExecutable(); 1850 ScopeChainNode* callDataScopeChain = function->scope() .node();1841 ScopeChainNode* callDataScopeChain = function->scope(); 1851 1842 JSObject* error = executable->compileForCall(stackFrame.callFrame, callDataScopeChain); 1852 1843 if (error) { … … 1869 1860 ASSERT(!function->isHostFunction()); 1870 1861 FunctionExecutable* executable = function->jsExecutable(); 1871 ScopeChainNode* callDataScopeChain = function->scope() .node();1862 ScopeChainNode* callDataScopeChain = function->scope(); 1872 1863 JSObject* error = executable->compileForConstruct(stackFrame.callFrame, callDataScopeChain); 1873 1864 if (error) { … … 1930 1921 callFrame->setArgumentCountIncludingThis(argCount); 1931 1922 callFrame->setCallee(callee); 1932 callFrame->setScopeChain(callee->scope() .node());1923 callFrame->setScopeChain(callee->scope()); 1933 1924 callFrame->setReturnPC(pc.value()); 1934 1925 … … 1989 1980 callFrame->setArgumentCountIncludingThis(argCount); 1990 1981 callFrame->setCallee(callee); 1991 callFrame->setScopeChain(callee->scope() .node());1982 callFrame->setScopeChain(callee->scope()); 1992 1983 callFrame->setReturnPC(pc.value()); 1993 1984 … … 2010 2001 else { 2011 2002 FunctionExecutable* functionExecutable = static_cast<FunctionExecutable*>(executable); 2012 JSObject* error = functionExecutable->compileForCall(callFrame, callee->scope() .node());2003 JSObject* error = functionExecutable->compileForCall(callFrame, callee->scope()); 2013 2004 if (error) { 2014 2005 callFrame->globalData().exception = createStackOverflowError(callFrame); … … 2044 2035 else { 2045 2036 FunctionExecutable* functionExecutable = static_cast<FunctionExecutable*>(executable); 2046 JSObject* error = functionExecutable->compileForConstruct(callFrame, callee->scope() .node());2037 JSObject* error = functionExecutable->compileForConstruct(callFrame, callee->scope()); 2047 2038 if (error) { 2048 2039 throwStackOverflowError(callFrame, stackFrame.globalData, ReturnAddressPtr(callFrame->returnPC()), STUB_RETURN_ADDRESS); … … 2071 2062 2072 2063 JSActivation* activation = new (stackFrame.globalData) JSActivation(stackFrame.callFrame, static_cast<FunctionExecutable*>(stackFrame.callFrame->codeBlock()->ownerExecutable())); 2073 stackFrame.callFrame->setScopeChain(stackFrame.callFrame->scopeChain()-> copy()->push(activation));2064 stackFrame.callFrame->setScopeChain(stackFrame.callFrame->scopeChain()->push(activation)); 2074 2065 return activation; 2075 2066 } … … 2173 2164 ASSERT(*stackFrame.enabledProfilerReference); 2174 2165 (*stackFrame.enabledProfilerReference)->didExecute(stackFrame.callFrame, stackFrame.args[0].jsValue()); 2175 }2176 2177 DEFINE_STUB_FUNCTION(void, op_ret_scopeChain)2178 {2179 STUB_INIT_STACK_FRAME(stackFrame);2180 2181 ASSERT(stackFrame.callFrame->codeBlock()->needsFullScopeChain());2182 stackFrame.callFrame->scopeChain()->deref();2183 2166 } 2184 2167 … … 3009 2992 if (!function->name().isNull()) { 3010 2993 JSStaticScopeObject* functionScopeObject = new (callFrame) JSStaticScopeObject(callFrame, function->name(), func, ReadOnly | DontDelete); 3011 func->s cope().push(functionScopeObject);2994 func->setScope(callFrame->globalData(), func->scope()->push(functionScopeObject)); 3012 2995 } 3013 2996 … … 3119 3102 Register* argv = newCallFrame - RegisterFile::CallFrameHeaderSize - argCount; 3120 3103 JSValue baseValue = argv[0].jsValue(); 3121 JSGlobalObject* globalObject = callFrame->scopeChain()->globalObject ;3104 JSGlobalObject* globalObject = callFrame->scopeChain()->globalObject.get(); 3122 3105 3123 3106 if (baseValue == globalObject && funcVal == globalObject->evalFunction()) { -
trunk/Source/JavaScriptCore/jit/JITStubs.h
r75408 r79904 391 391 void JIT_STUB cti_op_put_getter(STUB_ARGS_DECLARATION); 392 392 void JIT_STUB cti_op_put_setter(STUB_ARGS_DECLARATION); 393 void JIT_STUB cti_op_ret_scopeChain(STUB_ARGS_DECLARATION);394 393 void JIT_STUB cti_op_tear_off_activation(STUB_ARGS_DECLARATION); 395 394 void JIT_STUB cti_op_tear_off_arguments(STUB_ARGS_DECLARATION);
Note:
See TracChangeset
for help on using the changeset viewer.