Changeset 52343 in webkit for trunk/JavaScriptCore/interpreter
- Timestamp:
- Dec 18, 2009, 2:18:11 PM (15 years ago)
- Location:
- trunk/JavaScriptCore/interpreter
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/interpreter/CallFrame.h
r51672 r52343 111 111 Instruction* returnPC() const { return this[RegisterFile::ReturnPC].vPC(); } 112 112 113 void setCalleeArguments(JSValue arguments) { this[RegisterFile::OptionalCalleeArguments] = arguments; }114 void setCallerFrame(CallFrame* callerFrame) { this[RegisterFile::CallerFrame] = callerFrame; }115 void setScopeChain(ScopeChainNode* scopeChain) { this[RegisterFile::ScopeChain] = scopeChain; }113 void setCalleeArguments(JSValue arguments) { static_cast<Register*>(this)[RegisterFile::OptionalCalleeArguments] = arguments; } 114 void setCallerFrame(CallFrame* callerFrame) { static_cast<Register*>(this)[RegisterFile::CallerFrame] = callerFrame; } 115 void setScopeChain(ScopeChainNode* scopeChain) { static_cast<Register*>(this)[RegisterFile::ScopeChain] = scopeChain; } 116 116 117 117 ALWAYS_INLINE void init(CodeBlock* codeBlock, Instruction* vPC, ScopeChainNode* scopeChain, … … 123 123 setScopeChain(scopeChain); 124 124 setCallerFrame(callerFrame); 125 this[RegisterFile::ReturnPC] = vPC; // This is either an Instruction* or a pointer into JIT generated code stored as an Instruction*.126 this[RegisterFile::ReturnValueRegister] = Register::withInt(returnValueRegister);125 static_cast<Register*>(this)[RegisterFile::ReturnPC] = vPC; // This is either an Instruction* or a pointer into JIT generated code stored as an Instruction*. 126 static_cast<Register*>(this)[RegisterFile::ReturnValueRegister] = Register::withInt(returnValueRegister); 127 127 setArgumentCount(argc); // original argument count (for the sake of the "arguments" object) 128 128 setCallee(function); … … 141 141 142 142 private: 143 void setArgumentCount(int count) { this[RegisterFile::ArgumentCount] = Register::withInt(count); }144 void setCallee(JSFunction* callee) { this[RegisterFile::Callee] = callee; }145 void setCodeBlock(CodeBlock* codeBlock) { this[RegisterFile::CodeBlock] = codeBlock; }143 void setArgumentCount(int count) { static_cast<Register*>(this)[RegisterFile::ArgumentCount] = Register::withInt(count); } 144 void setCallee(JSFunction* callee) { static_cast<Register*>(this)[RegisterFile::Callee] = callee; } 145 void setCodeBlock(CodeBlock* codeBlock) { static_cast<Register*>(this)[RegisterFile::CodeBlock] = codeBlock; } 146 146 147 147 static const intptr_t HostCallFrameFlag = 1; -
trunk/JavaScriptCore/interpreter/Register.h
r51624 r52343 52 52 public: 53 53 Register(); 54 Register(JSValue); 55 54 55 Register(const JSValue&); 56 Register& operator=(const JSValue&); 56 57 JSValue jsValue() const; 57 58 58 Register (JSActivation*);59 Register (CallFrame*);60 Register (CodeBlock*);61 Register (JSFunction*);62 Register (JSPropertyNameIterator*);63 Register (ScopeChainNode*);64 Register (Instruction*);59 Register& operator=(JSActivation*); 60 Register& operator=(CallFrame*); 61 Register& operator=(CodeBlock*); 62 Register& operator=(JSFunction*); 63 Register& operator=(JSPropertyNameIterator*); 64 Register& operator=(ScopeChainNode*); 65 Register& operator=(Instruction*); 65 66 66 67 int32_t i() const; … … 76 77 static Register withInt(int32_t i) 77 78 { 78 return Register(i); 79 Register r; 80 r.u.i = i; 81 return r; 79 82 } 80 83 81 84 private: 82 Register(int32_t);83 84 85 union { 85 86 int32_t i; … … 99 100 { 100 101 #ifndef NDEBUG 101 u.value = JSValue::encode(JSValue());102 *this = JSValue(); 102 103 #endif 103 104 } 104 105 105 ALWAYS_INLINE Register::Register( JSValuev)106 ALWAYS_INLINE Register::Register(const JSValue& v) 106 107 { 107 108 #if ENABLE(JSC_ZOMBIES) … … 111 112 } 112 113 114 ALWAYS_INLINE Register& Register::operator=(const JSValue& v) 115 { 116 #if ENABLE(JSC_ZOMBIES) 117 ASSERT(!v.isZombie()); 118 #endif 119 u.value = JSValue::encode(v); 120 return *this; 121 } 122 113 123 ALWAYS_INLINE JSValue Register::jsValue() const 114 124 { … … 118 128 // Interpreter functions 119 129 120 ALWAYS_INLINE Register ::Register(JSActivation* activation)130 ALWAYS_INLINE Register& Register::operator=(JSActivation* activation) 121 131 { 122 132 u.activation = activation; 123 } 124 125 ALWAYS_INLINE Register::Register(CallFrame* callFrame) 133 return *this; 134 } 135 136 ALWAYS_INLINE Register& Register::operator=(CallFrame* callFrame) 126 137 { 127 138 u.callFrame = callFrame; 128 } 129 130 ALWAYS_INLINE Register::Register(CodeBlock* codeBlock) 139 return *this; 140 } 141 142 ALWAYS_INLINE Register& Register::operator=(CodeBlock* codeBlock) 131 143 { 132 144 u.codeBlock = codeBlock; 133 } 134 135 ALWAYS_INLINE Register::Register(JSFunction* function) 145 return *this; 146 } 147 148 ALWAYS_INLINE Register& Register::operator=(JSFunction* function) 136 149 { 137 150 u.function = function; 138 } 139 140 ALWAYS_INLINE Register::Register(Instruction* vPC) 151 return *this; 152 } 153 154 ALWAYS_INLINE Register& Register::operator=(Instruction* vPC) 141 155 { 142 156 u.vPC = vPC; 143 } 144 145 ALWAYS_INLINE Register::Register(ScopeChainNode* scopeChain) 157 return *this; 158 } 159 160 ALWAYS_INLINE Register& Register::operator=(ScopeChainNode* scopeChain) 146 161 { 147 162 u.scopeChain = scopeChain; 148 } 149 150 ALWAYS_INLINE Register::Register(JSPropertyNameIterator* propertyNameIterator) 163 return *this; 164 } 165 166 ALWAYS_INLINE Register& Register::operator=(JSPropertyNameIterator* propertyNameIterator) 151 167 { 152 168 u.propertyNameIterator = propertyNameIterator; 153 } 154 155 ALWAYS_INLINE Register::Register(int32_t i) 156 { 157 u.i = i; 169 return *this; 158 170 } 159 171
Note:
See TracChangeset
for help on using the changeset viewer.