Changeset 98179 in webkit for trunk/Source/JavaScriptCore/bytecode/CodeOrigin.h
- Timestamp:
- Oct 21, 2011, 6:22:46 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/bytecode/CodeOrigin.h
r97675 r98179 27 27 #define CodeOrigin_h 28 28 29 #include "WriteBarrier.h" 29 30 #include <wtf/StdLibExtras.h> 31 #include <wtf/Vector.h> 30 32 31 33 namespace JSC { … … 57 59 58 60 bool isSet() const { return bytecodeIndex != std::numeric_limits<uint32_t>::max(); } 61 62 // The inline depth is the depth of the inline stack, so 1 = not inlined, 63 // 2 = inlined one deep, etc. 64 unsigned inlineDepth() const; 65 66 static unsigned inlineDepthForCallFrame(InlineCallFrame*); 67 68 bool operator==(const CodeOrigin& other) const; 69 70 #ifndef NDEBUG 71 // Get the inline stack. This is slow, and is intended for debugging only. 72 Vector<CodeOrigin> inlineStack() const; 73 #endif 59 74 }; 60 75 61 76 struct InlineCallFrame { 62 ExecutableBase*executable;77 WriteBarrier<ExecutableBase> executable; 63 78 unsigned stackOffset; 64 79 unsigned calleeVR; 65 80 CodeOrigin caller; 66 unsigned numArgumentsIncludingThis; 81 unsigned numArgumentsIncludingThis : 31; 82 bool isCall : 1; 67 83 }; 68 84 … … 71 87 unsigned callReturnOffset; 72 88 }; 89 90 inline unsigned CodeOrigin::inlineDepthForCallFrame(InlineCallFrame* inlineCallFrame) 91 { 92 unsigned result = 1; 93 for (InlineCallFrame* current = inlineCallFrame; current; current = current->caller.inlineCallFrame) 94 result++; 95 return result; 96 } 97 98 inline unsigned CodeOrigin::inlineDepth() const 99 { 100 return inlineDepthForCallFrame(inlineCallFrame); 101 } 102 103 inline bool CodeOrigin::operator==(const CodeOrigin& other) const 104 { 105 return bytecodeIndex == other.bytecodeIndex 106 && inlineCallFrame == other.inlineCallFrame; 107 } 108 109 #ifndef NDEBUG 110 // Get the inline stack. This is slow, and is intended for debugging only. 111 inline Vector<CodeOrigin> CodeOrigin::inlineStack() const 112 { 113 Vector<CodeOrigin> result(inlineDepth()); 114 result.last() = *this; 115 unsigned index = result.size() - 2; 116 for (InlineCallFrame* current = inlineCallFrame; current; current = current->caller.inlineCallFrame) 117 result[index--] = current->caller; 118 return result; 119 } 120 #endif 73 121 74 122 inline unsigned getCallReturnOffsetForCodeOrigin(CodeOriginAtCallReturnOffset* data)
Note:
See TracChangeset
for help on using the changeset viewer.