Changeset 33301
- Timestamp:
- 05/12/08 23:02:17 (6 months ago)
- Location:
- branches/squirrelfish/JavaScriptCore
- Files:
-
- 4 modified
-
ChangeLog (modified) (1 diff)
-
VM/Machine.cpp (modified) (4 diffs)
-
kjs/JSActivation.cpp (modified) (3 diffs)
-
kjs/JSActivation.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/squirrelfish/JavaScriptCore/ChangeLog
r33300 r33301 1 2008-04-28 Geoffrey Garen <ggaren@apple.com> 2 3 Reviewed by Maciej Stachowiak. 4 5 Simplified activation object a bit: No need to store the callee 6 in the activation object -- we can pull it out of the call frame 7 when needed, instead. 8 9 SunSpider reports no change. 10 1 11 2008-04-28 Geoffrey Garen <ggaren@apple.com> 2 12 -
branches/squirrelfish/JavaScriptCore/VM/Machine.cpp
r33299 r33301 427 427 } 428 428 429 ALWAYS_INLINE ScopeChainNode* scopeChainForCall( CodeBlock* newCodeBlock, ScopeChainNode* callDataScopeChain, FunctionImp* function, Register* callFrame, Register** registerBase, Register* r)429 ALWAYS_INLINE ScopeChainNode* scopeChainForCall(FunctionBodyNode* functionBodyNode, CodeBlock* newCodeBlock, ScopeChainNode* callDataScopeChain, Register* callFrame, Register** registerBase, Register* r) 430 430 { 431 431 if (newCodeBlock->needsFullScopeChain) { 432 JSActivation* activation = new JSActivation(function , registerBase, r - (*registerBase));432 JSActivation* activation = new JSActivation(functionBodyNode, registerBase, r - (*registerBase)); 433 433 callFrame[Machine::OptionalCalleeActivation].u.jsValue = activation; 434 434 … … 617 617 618 618 callFrame = (*registerBase) + callFrameOffset; // registerBase may have moved, recompute callFrame 619 scopeChain = scopeChainForCall( newCodeBlock, scopeChain, function, callFrame, registerBase, r);619 scopeChain = scopeChainForCall(functionBodyNode, newCodeBlock, scopeChain, callFrame, registerBase, r); 620 620 m_reentryDepth++; 621 621 JSValue* result = privateExecute(Normal, exec, registerFile, r, scopeChain, newCodeBlock, exception); … … 1470 1470 codeBlock = newCodeBlock; 1471 1471 callFrame = (*registerBase) + callFrameOffset; // registerBase may have moved, recompute callFrame 1472 scopeChain = scopeChainForCall( codeBlock, callDataScopeChain, static_cast<FunctionImp*>(v), callFrame, registerBase, r);1472 scopeChain = scopeChainForCall(functionBodyNode, codeBlock, callDataScopeChain, callFrame, registerBase, r); 1473 1473 k = codeBlock->jsValues.data(); 1474 1474 vPC = codeBlock->instructions.begin(); … … 1576 1576 codeBlock = newCodeBlock; 1577 1577 callFrame = (*registerBase) + callFrameOffset; // registerBase may have moved, recompute callFrame 1578 scopeChain = scopeChainForCall( codeBlock, callDataScopeChain, static_cast<FunctionImp*>(constructor), callFrame, registerBase, r);1578 scopeChain = scopeChainForCall(functionBodyNode, codeBlock, callDataScopeChain, callFrame, registerBase, r); 1579 1579 k = codeBlock->jsValues.data(); 1580 1580 vPC = codeBlock->instructions.begin(); -
branches/squirrelfish/JavaScriptCore/kjs/JSActivation.cpp
r33300 r33301 38 38 const ClassInfo JSActivation::info = { "JSActivation", 0, 0, 0 }; 39 39 40 JSActivation::JSActivation( FunctionImp* function, Register** registerBase, int registerOffset)41 : Base(new JSActivationData(function ->body, function, registerBase, registerOffset))40 JSActivation::JSActivation(PassRefPtr<FunctionBodyNode> functionBody, Register** registerBase, int registerOffset) 41 : Base(new JSActivationData(functionBody, registerBase, registerOffset)) 42 42 { 43 43 } … … 133 133 Base::mark(); 134 134 135 // We don't mark d()->function because it can only be accessed while it's136 // still live in the register file, and we don't want to keep it live137 // after that.138 139 135 if (d()->argumentsObject) 140 136 d()->argumentsObject->mark(); … … 182 178 JSObject* JSActivation::createArgumentsObject(ExecState* exec) 183 179 { 184 CodeBlock& codeBlock = d()->function ->body->generatedCode();180 CodeBlock& codeBlock = d()->functionBody->generatedCode(); 185 181 Register* callFrame = registers() - codeBlock.numVars - codeBlock.numParameters - Machine::CallFrameHeaderSize; 182 183 FunctionImp* function = static_cast<FunctionImp*>(callFrame[Machine::Callee].u.jsValue); 186 184 int argv = callFrame[Machine::ArgumentStartRegister].u.i; 187 185 int argc = callFrame[Machine::ArgumentCount].u.i; 186 188 187 List args(&(*registerBase() + argv + 1)->u.jsValue, argc - 1); 189 190 return new Arguments(exec, d()->function, args, this); 188 return new Arguments(exec, function, args, this); 191 189 } 192 190 -
branches/squirrelfish/JavaScriptCore/kjs/JSActivation.h
r33285 r33301 41 41 typedef JSVariableObject Base; 42 42 public: 43 JSActivation( FunctionImp*, Register**, int registerOffset);43 JSActivation(PassRefPtr<FunctionBodyNode>, Register**, int registerOffset); 44 44 virtual ~JSActivation(); 45 45 … … 64 64 private: 65 65 struct JSActivationData : public JSVariableObjectData { 66 JSActivationData(PassRefPtr<FunctionBodyNode> functionBody_, FunctionImp* function_,Register** registerBase, int registerOffset)66 JSActivationData(PassRefPtr<FunctionBodyNode> functionBody_, Register** registerBase, int registerOffset) 67 67 : JSVariableObjectData(&functionBody_->symbolTable(), registerBase, registerOffset) 68 68 , registerArray(0) 69 69 , functionBody(functionBody_) 70 , function(function_)71 70 , argumentsObject(0) 72 71 { … … 74 73 75 74 Register* registerArray; 76 RefPtr<FunctionBodyNode> functionBody; // Owns the symbol table 77 FunctionImp* function; 75 RefPtr<FunctionBodyNode> functionBody; // Owns the symbol table and code block 78 76 JSObject* argumentsObject; 79 77 };