Changeset 34372 in webkit for trunk/JavaScriptCore/VM/Machine.h
- Timestamp:
- Jun 4, 2008, 10:36:55 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/VM/Machine.h
r34351 r34372 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 28 29 29 #ifndef Machine_h 30 30 #define Machine_h … … 32 32 #include "Opcode.h" 33 33 #include "RegisterFileStack.h" 34 #include <kjs/list.h> 34 35 #include <wtf/HashMap.h> 35 #include <kjs/list.h>36 36 37 37 namespace KJS { … … 46 46 class RegisterFileStack; 47 47 class ScopeChainNode; 48 48 49 49 enum DebugHookID { 50 50 WillExecuteProgram, … … 60 60 class Machine { 61 61 public: 62 enum { CallerCodeBlock = 0, 63 ReturnVPC, 64 CallerScopeChain, 65 CallerRegisterOffset, 66 ReturnValueRegister, 67 ArgumentStartRegister, 68 ArgumentCount, 69 CalledAsConstructor, 70 Callee, 71 OptionalCalleeActivation, 72 CallFrameHeaderSize}; 73 62 enum { 63 CallerCodeBlock = 0, 64 ReturnVPC, 65 CallerScopeChain, 66 CallerRegisterOffset, 67 ReturnValueRegister, 68 ArgumentStartRegister, 69 ArgumentCount, 70 CalledAsConstructor, 71 Callee, 72 OptionalCalleeActivation, 73 CallFrameHeaderSize 74 }; 75 74 76 enum { ProgramCodeThisRegister = -1 }; 75 77 76 78 Machine(); 77 78 Opcode getOpcode(OpcodeID id) { 79 80 Opcode getOpcode(OpcodeID id) 81 { 79 82 #if HAVE(COMPUTED_GOTO) 80 return m_opcodeTable[id]; 83 return m_opcodeTable[id]; 81 84 #else 82 85 return id; … … 84 87 } 85 88 86 OpcodeID getOpcodeID(Opcode opcode) { 89 OpcodeID getOpcodeID(Opcode opcode) 90 { 87 91 #if HAVE(COMPUTED_GOTO) 88 92 ASSERT(isOpcode(opcode)); … … 94 98 95 99 bool isOpcode(Opcode opcode); 96 100 97 101 JSValue* execute(ProgramNode*, ExecState*, ScopeChainNode*, JSObject* thisObj, RegisterFileStack*, JSValue** exception); 98 102 JSValue* execute(FunctionBodyNode*, ExecState*, FunctionImp*, JSObject* thisObj, const List& args, RegisterFileStack*, ScopeChainNode*, JSValue** exception); 99 103 JSValue* execute(EvalNode*, ExecState*, JSObject* thisObj, RegisterFile*, int registerOffset, ScopeChainNode*, JSValue** exception); 100 104 JSValue* execute(EvalNode*, ExecState*, JSObject* thisObj, RegisterFileStack*, ScopeChainNode*, JSValue** exception); 101 105 102 106 JSValue* retrieveArguments(ExecState*, FunctionImp*) const; 103 107 JSValue* retrieveCaller(ExecState*, FunctionImp*) const; 104 108 105 109 void getFunctionAndArguments(Register** registerBase, Register* callFrame, FunctionImp*&, Register*& argv, int& argc); 106 110 107 111 private: 108 typedef enum { Normal, InitializeAndReturn } ExecutionFlag;112 enum ExecutionFlag { Normal, InitializeAndReturn }; 109 113 110 114 ALWAYS_INLINE void setScopeChain(ExecState* exec, ScopeChainNode*&, ScopeChainNode*); … … 113 117 NEVER_INLINE bool unwindCallFrame(ExecState*, JSValue*, Register**, const Instruction*&, CodeBlock*&, JSValue**&, ScopeChainNode*&, Register*&); 114 118 NEVER_INLINE Instruction* throwException(ExecState*, JSValue*, Register**, const Instruction*, CodeBlock*&, JSValue**&, ScopeChainNode*&, Register*&); 115 119 116 120 bool getCallFrame(ExecState*, FunctionImp*, Register**& registerBase, int& callFrameOffset) const; 117 121 … … 120 124 void dumpCallFrame(const CodeBlock*, ScopeChainNode*, RegisterFile*, const Register*); 121 125 void dumpRegisters(const CodeBlock*, RegisterFile*, const Register*); 122 126 123 127 bool isGlobalCallFrame(Register** registerBase, const Register* r) const { return (*registerBase) == r; } 124 128 125 129 int m_reentryDepth; 126 #if HAVE(COMPUTED_GOTO) 130 #if HAVE(COMPUTED_GOTO) 127 131 Opcode m_opcodeTable[numOpcodeIDs]; // Maps OpcodeID => Opcode for compiling 128 132 HashMap<Opcode, OpcodeID> m_opcodeIDTable; // Maps Opcode => OpcodeID for decompiling 129 133 #endif 130 134 }; 131 135 132 136 Machine& machine(); 133 137
Note:
See TracChangeset
for help on using the changeset viewer.