Changeset 153211 in webkit for trunk/Source/JavaScriptCore/interpreter/CallFrame.h
- Timestamp:
- Jul 24, 2013, 9:02:07 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/interpreter/CallFrame.h
r153209 r153211 115 115 AbstractPC abstractReturnPC(VM& vm) { return AbstractPC(vm, this); } 116 116 117 class Location { 118 public: 119 enum Type { 120 BytecodeOffset = 0, 121 CodeOriginIndex = (1 << 0), 122 IsInlinedCode = (1 << 1), 123 }; 124 125 static inline uint32_t encode(Type, uint32_t bits); 126 static inline uint32_t decode(uint32_t bits); 127 static inline bool isBytecodeOffset(uint32_t bits); 128 static inline bool isCodeOriginIndex(uint32_t bits); 129 static inline bool isInlinedCode(uint32_t bits); 130 131 private: 132 static const uint32_t s_mask = 0x3; 133 #if USE(JSVALUE64) 134 static const uint32_t s_shift = 30; 135 static const uint32_t s_shiftedMask = s_mask << s_shift; 136 #else 137 static const uint32_t s_shift = 2; 138 #endif 139 }; 140 141 bool isInlinedFrame() const; 142 void setIsInlinedFrame(); 143 117 144 bool hasLocationAsBytecodeOffset() const; 118 145 bool hasLocationAsCodeOriginIndex() const; … … 124 151 void setLocationAsRawBits(unsigned); 125 152 void setLocationAsBytecodeOffset(unsigned); 153 154 unsigned bytecodeOffsetFromCodeOriginIndex(); 126 155 127 156 Register* frameExtent() … … 138 167 #else 139 168 // This will never be called if !ENABLE(DFG_JIT) since all calls should be guarded by 140 // isInline CallFrame(). But to make it easier to write code without having a bunch of169 // isInlinedFrame(). But to make it easier to write code without having a bunch of 141 170 // #if's, we make a dummy implementation available anyway. 142 171 InlineCallFrame* inlineCallFrame() const … … 232 261 233 262 #if ENABLE(DFG_JIT) 234 bool isInlineCallFrame();235 236 263 void setInlineCallFrame(InlineCallFrame* inlineCallFrame) { static_cast<Register*>(this)[JSStack::ReturnPC] = inlineCallFrame; } 237 264 238 265 // Call this to get the semantically correct JS CallFrame* for the 239 266 // currently executing function. 240 CallFrame* trueCallFrame( AbstractPC);241 267 CallFrame* trueCallFrame(); 268 242 269 // Call this to get the semantically correct JS CallFrame* corresponding 243 270 // to the caller. This resolves issues surrounding inlining and the 244 271 // HostCallFrameFlag stuff. 245 272 CallFrame* trueCallerFrame(); 246 247 CodeBlock* someCodeBlockForPossiblyInlinedCode();248 273 #else 249 bool isInlineCallFrame() { return false; }250 251 274 CallFrame* trueCallFrame(AbstractPC) { return this; } 252 275 CallFrame* trueCallerFrame() { return callerFrame()->removeHostCallFrameFlag(); } 253 254 CodeBlock* someCodeBlockForPossiblyInlinedCode() { return codeBlock(); }255 276 #endif 256 277 CallFrame* callerFrameNoFlags() { return callerFrame()->removeHostCallFrameFlag(); } 257 258 // Call this to get the true call frame (accounted for inlining and any259 // other optimizations), when you have entered into VM code through one260 // of the "blessed" entrypoints (JITStubs or DFGOperations). This means261 // that if you're pretty much anywhere in the VM you can safely call this;262 // though if you were to magically get an ExecState* by, say, interrupting263 // a thread that is running JS code and brutishly scraped the call frame264 // register, calling this method would probably lead to horrible things265 // happening.266 CallFrame* trueCallFrameFromVMCode() { return trueCallFrame(AbstractPC()); }267 278 268 279 private: … … 273 284 #ifndef NDEBUG 274 285 JSStack* stack(); 275 #endif276 #if ENABLE(DFG_JIT)277 bool isInlineCallFrameSlow();278 286 #endif 279 287 ExecState();
Note:
See TracChangeset
for help on using the changeset viewer.