Changeset 190220 in webkit for trunk/Source/JavaScriptCore/bytecode/InlineCallFrame.h
- Timestamp:
- Sep 24, 2015, 2:42:59 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/bytecode/InlineCallFrame.h
r189518 r190220 50 50 Call, 51 51 Construct, 52 TailCall, 52 53 CallVarargs, 53 54 ConstructVarargs, 55 TailCallVarargs, 54 56 55 57 // For these, the stackOffset incorporates the argument count plus the true return PC … … 58 60 SetterCall 59 61 }; 60 61 static Kind kindFor(CodeSpecializationKind kind) 62 { 63 switch (kind) { 64 case CodeForCall: 65 return Call; 66 case CodeForConstruct: 67 return Construct; 68 } 69 RELEASE_ASSERT_NOT_REACHED(); 70 return Call; 71 } 72 73 static Kind varargsKindFor(CodeSpecializationKind kind) 74 { 75 switch (kind) { 76 case CodeForCall: 77 return CallVarargs; 78 case CodeForConstruct: 79 return ConstructVarargs; 80 } 81 RELEASE_ASSERT_NOT_REACHED(); 82 return Call; 83 } 84 85 static CodeSpecializationKind specializationKindFor(Kind kind) 62 63 static CallMode callModeFor(Kind kind) 86 64 { 87 65 switch (kind) { 88 66 case Call: 89 67 case CallVarargs: 68 case GetterCall: 69 case SetterCall: 70 return CallMode::Regular; 71 case TailCall: 72 case TailCallVarargs: 73 return CallMode::Tail; 74 case Construct: 75 case ConstructVarargs: 76 return CallMode::Construct; 77 } 78 RELEASE_ASSERT_NOT_REACHED(); 79 } 80 81 static Kind kindFor(CallMode callMode) 82 { 83 switch (callMode) { 84 case CallMode::Regular: 85 return Call; 86 case CallMode::Construct: 87 return Construct; 88 case CallMode::Tail: 89 return TailCall; 90 } 91 RELEASE_ASSERT_NOT_REACHED(); 92 } 93 94 static Kind varargsKindFor(CallMode callMode) 95 { 96 switch (callMode) { 97 case CallMode::Regular: 98 return CallVarargs; 99 case CallMode::Construct: 100 return ConstructVarargs; 101 case CallMode::Tail: 102 return TailCallVarargs; 103 } 104 RELEASE_ASSERT_NOT_REACHED(); 105 } 106 107 static CodeSpecializationKind specializationKindFor(Kind kind) 108 { 109 switch (kind) { 110 case Call: 111 case CallVarargs: 112 case TailCall: 113 case TailCallVarargs: 90 114 case GetterCall: 91 115 case SetterCall: … … 96 120 } 97 121 RELEASE_ASSERT_NOT_REACHED(); 98 return CodeForCall;99 122 } 100 123 … … 103 126 switch (kind) { 104 127 case CallVarargs: 128 case TailCallVarargs: 105 129 case ConstructVarargs: 106 130 return true; … … 109 133 } 110 134 } 135 136 static bool isTail(Kind kind) 137 { 138 switch (kind) { 139 case TailCall: 140 case TailCallVarargs: 141 return true; 142 default: 143 return false; 144 } 145 } 146 bool isTail() const 147 { 148 return isTail(static_cast<Kind>(kind)); 149 } 150 151 static CodeOrigin* computeCallerSkippingDeadFrames(InlineCallFrame* inlineCallFrame) 152 { 153 CodeOrigin* codeOrigin; 154 bool tailCallee; 155 do { 156 tailCallee = inlineCallFrame->isTail(); 157 codeOrigin = &inlineCallFrame->directCaller; 158 inlineCallFrame = codeOrigin->inlineCallFrame; 159 } while (inlineCallFrame && tailCallee); 160 if (tailCallee) 161 return nullptr; 162 return codeOrigin; 163 } 164 165 CodeOrigin* getCallerSkippingDeadFrames() 166 { 167 return computeCallerSkippingDeadFrames(this); 168 } 169 170 InlineCallFrame* getCallerInlineFrameSkippingDeadFrames() 171 { 172 CodeOrigin* caller = getCallerSkippingDeadFrames(); 173 return caller ? caller->inlineCallFrame : nullptr; 174 } 111 175 112 176 Vector<ValueRecovery> arguments; // Includes 'this'. 113 177 WriteBarrier<ScriptExecutable> executable; 114 178 ValueRecovery calleeRecovery; 115 CodeOrigin caller;179 CodeOrigin directCaller; 116 180 117 181 signed stackOffset : 28;
Note:
See TracChangeset
for help on using the changeset viewer.