Changeset 42538 in webkit
- Timestamp:
- Apr 15, 2009, 12:31:48 AM (16 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 6 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r42537 r42538 1 2009-04-15 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by NOBODY (Build fix). 4 5 Move CallFrameClosure from inside the Interpreter class to its own file. 6 7 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 8 * JavaScriptCore.xcodeproj/project.pbxproj: 9 * interpreter/CachedCall.h: 10 * interpreter/CallFrameClosure.h: Copied from JavaScriptCore/yarr/RegexJIT.h. 11 (JSC::CallFrameClosure::setArgument): 12 (JSC::CallFrameClosure::resetCallFrame): 13 * interpreter/Interpreter.cpp: 14 (JSC::Interpreter::prepareForRepeatCall): 15 * interpreter/Interpreter.h: 16 1 17 2009-04-14 Oliver Hunt <oliver@apple.com> 2 18 -
trunk/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
r42537 r42538 281 281 <File 282 282 RelativePath="..\..\interpreter\CallFrame.h" 283 > 284 </File> 285 <File 286 RelativePath="..\..\interpreter\CallFrameClosure.h" 283 287 > 284 288 </File> -
trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r42537 r42538 706 706 A7E42C190E3938830065A544 /* JSStaticScopeObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSStaticScopeObject.cpp; sourceTree = "<group>"; }; 707 707 A7F8690E0F9584A100558697 /* CachedCall.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedCall.h; sourceTree = "<group>"; }; 708 A7F869EC0F95C2EC00558697 /* CallFrameClosure.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallFrameClosure.h; sourceTree = "<group>"; }; 708 709 A8E894310CD0602400367179 /* JSCallbackObjectFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCallbackObjectFunctions.h; sourceTree = "<group>"; }; 709 710 A8E894330CD0603F00367179 /* JSGlobalObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSGlobalObject.h; sourceTree = "<group>"; }; … … 992 993 1429D8DB0ED2205B00B89619 /* CallFrame.cpp */, 993 994 1429D8DC0ED2205B00B89619 /* CallFrame.h */, 995 A7F869EC0F95C2EC00558697 /* CallFrameClosure.h */, 994 996 1429D7D30ED2128200B89619 /* Interpreter.cpp */, 995 997 1429D77B0ED20D7300B89619 /* Interpreter.h */, -
trunk/JavaScriptCore/interpreter/CachedCall.h
r42537 r42538 27 27 #define CachedCall_h 28 28 29 #include "CallFrameClosure.h" 29 30 #include "Interpreter.h" 30 31 … … 60 61 JSValuePtr* m_exception; 61 62 DynamicGlobalObjectScope m_globalObjectScope; 62 Interpreter::CallFrameClosure m_closure;63 CallFrameClosure m_closure; 63 64 }; 64 65 } -
trunk/JavaScriptCore/interpreter/CallFrameClosure.h
r42537 r42538 24 24 */ 25 25 26 #ifndef CachedCall_h 27 #define CachedCall_h 28 29 #include "Interpreter.h" 26 #ifndef CallFrameClosure_h 27 #define CallFrameClosure_h 30 28 31 29 namespace JSC { 32 class CachedCall : Noncopyable { 33 public: 34 CachedCall(CallFrame* callFrame, JSFunction* function, int argCount, JSValuePtr* exception) 35 : m_valid(false) 36 , m_interpreter(callFrame->interpreter()) 37 , m_exception(exception) 38 , m_globalObjectScope(callFrame, callFrame->globalData().dynamicGlobalObject ? callFrame->globalData().dynamicGlobalObject : function->scope().node()->globalObject()) 39 { 40 m_closure = m_interpreter->prepareForRepeatCall(function->body(), callFrame, function, argCount, function->scope().node(), exception); 41 m_valid = !exception; 42 } 43 44 JSValuePtr call() 45 { 46 return m_interpreter->execute(m_closure, m_exception); 47 } 48 void setThis(JSValuePtr v) { m_closure.setArgument(0, v); } 49 void setArgument(int n, JSValuePtr v) { m_closure.setArgument(n + 1, v); } 50 51 ~CachedCall() 52 { 53 if (m_valid) 54 m_interpreter->endRepeatCall(m_closure); 55 } 56 57 private: 58 bool m_valid; 59 Interpreter* m_interpreter; 60 JSValuePtr* m_exception; 61 DynamicGlobalObjectScope m_globalObjectScope; 62 Interpreter::CallFrameClosure m_closure; 63 }; 30 31 struct CallFrameClosure { 32 CallFrame* oldCallFrame; 33 CallFrame* newCallFrame; 34 JSFunction* function; 35 CodeBlock* codeBlock; 36 JSGlobalData* globalData; 37 Register* oldEnd; 38 ScopeChainNode* scopeChain; 39 int expectedParams; 40 int providedParams; 41 42 void setArgument(int arg, JSValuePtr value) 43 { 44 if (arg < expectedParams) 45 newCallFrame[arg - RegisterFile::CallFrameHeaderSize - expectedParams] = value; 46 else 47 newCallFrame[arg - RegisterFile::CallFrameHeaderSize - expectedParams - providedParams] = value; 48 } 49 void resetCallFrame() 50 { 51 newCallFrame->setScopeChain(scopeChain); 52 newCallFrame->setCalleeArguments(0); 53 for (int i = providedParams; i < expectedParams; ++i) 54 newCallFrame[i - RegisterFile::CallFrameHeaderSize - expectedParams] = jsUndefined(); 55 } 56 }; 57 64 58 } 65 59 -
trunk/JavaScriptCore/interpreter/Interpreter.cpp
r42537 r42538 33 33 #include "Arguments.h" 34 34 #include "BatchedTransitionOptimizer.h" 35 #include "CallFrameClosure.h" 35 36 #include "CodeBlock.h" 36 37 #include "DebuggerCallFrame.h" … … 701 702 } 702 703 703 Interpreter::CallFrameClosure Interpreter::prepareForRepeatCall(FunctionBodyNode* functionBodyNode, CallFrame* callFrame, JSFunction* function, int argCount, ScopeChainNode* scopeChain, JSValuePtr* exception)704 CallFrameClosure Interpreter::prepareForRepeatCall(FunctionBodyNode* functionBodyNode, CallFrame* callFrame, JSFunction* function, int argCount, ScopeChainNode* scopeChain, JSValuePtr* exception) 704 705 { 705 706 ASSERT(!scopeChain->globalData->exception); -
trunk/JavaScriptCore/interpreter/Interpreter.h
r42537 r42538 52 52 class ScopeChainNode; 53 53 class SamplingTool; 54 struct CallFrameClosure; 54 55 struct HandlerInfo; 55 56 … … 110 111 private: 111 112 enum ExecutionFlag { Normal, InitializeAndReturn }; 112 113 struct CallFrameClosure {114 CallFrame* oldCallFrame;115 CallFrame* newCallFrame;116 JSFunction* function;117 CodeBlock* codeBlock;118 JSGlobalData* globalData;119 Register* oldEnd;120 ScopeChainNode* scopeChain;121 int expectedParams;122 int providedParams;123 113 124 void setArgument(int arg, JSValuePtr value)125 {126 if (arg < expectedParams)127 newCallFrame[arg - RegisterFile::CallFrameHeaderSize - expectedParams] = value;128 else129 newCallFrame[arg - RegisterFile::CallFrameHeaderSize - expectedParams - providedParams] = value;130 }131 void resetCallFrame()132 {133 newCallFrame->setScopeChain(scopeChain);134 newCallFrame->setCalleeArguments(0);135 for (int i = providedParams; i < expectedParams; ++i)136 newCallFrame[i - RegisterFile::CallFrameHeaderSize - expectedParams] = jsUndefined();137 }138 };139 114 CallFrameClosure prepareForRepeatCall(FunctionBodyNode*, CallFrame*, JSFunction*, int argCount, ScopeChainNode*, JSValuePtr* exception); 140 115 void endRepeatCall(CallFrameClosure&);
Note:
See TracChangeset
for help on using the changeset viewer.