OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/code-stubs.h" | 5 #include "src/code-stubs.h" |
6 #include "src/compiler.h" | 6 #include "src/compiler.h" |
7 #include "src/compiler/common-operator.h" | 7 #include "src/compiler/common-operator.h" |
8 #include "src/compiler/frame.h" | 8 #include "src/compiler/frame.h" |
9 #include "src/compiler/linkage.h" | 9 #include "src/compiler/linkage.h" |
10 #include "src/compiler/node.h" | 10 #include "src/compiler/node.h" |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 | 211 |
212 | 212 |
213 // static | 213 // static |
214 int Linkage::FrameStateInputCount(Runtime::FunctionId function) { | 214 int Linkage::FrameStateInputCount(Runtime::FunctionId function) { |
215 // Most runtime functions need a FrameState. A few chosen ones that we know | 215 // Most runtime functions need a FrameState. A few chosen ones that we know |
216 // not to call into arbitrary JavaScript, not to throw, and not to deoptimize | 216 // not to call into arbitrary JavaScript, not to throw, and not to deoptimize |
217 // are blacklisted here and can be called without a FrameState. | 217 // are blacklisted here and can be called without a FrameState. |
218 switch (function) { | 218 switch (function) { |
219 case Runtime::kAllocateInTargetSpace: | 219 case Runtime::kAllocateInTargetSpace: |
220 case Runtime::kDateField: | 220 case Runtime::kDateField: |
221 case Runtime::kFinalizeClassDefinition: // TODO(conradw): Is it safe? | |
222 case Runtime::kDefineClassMethod: // TODO(jarin): Is it safe? | 221 case Runtime::kDefineClassMethod: // TODO(jarin): Is it safe? |
223 case Runtime::kDefineGetterPropertyUnchecked: // TODO(jarin): Is it safe? | 222 case Runtime::kDefineGetterPropertyUnchecked: // TODO(jarin): Is it safe? |
224 case Runtime::kDefineSetterPropertyUnchecked: // TODO(jarin): Is it safe? | 223 case Runtime::kDefineSetterPropertyUnchecked: // TODO(jarin): Is it safe? |
| 224 case Runtime::kFinalizeClassDefinition: // TODO(conradw): Is it safe? |
225 case Runtime::kForInDone: | 225 case Runtime::kForInDone: |
226 case Runtime::kForInStep: | 226 case Runtime::kForInStep: |
227 case Runtime::kGetOriginalConstructor: | 227 case Runtime::kGetOriginalConstructor: |
228 case Runtime::kNewArguments: | 228 case Runtime::kNewArguments: |
229 case Runtime::kNewClosure: | 229 case Runtime::kNewClosure: |
230 case Runtime::kNewFunctionContext: | 230 case Runtime::kNewFunctionContext: |
231 case Runtime::kPushBlockContext: | 231 case Runtime::kPushBlockContext: |
232 case Runtime::kPushCatchContext: | 232 case Runtime::kPushCatchContext: |
233 case Runtime::kReThrow: | 233 case Runtime::kReThrow: |
234 case Runtime::kStringCompare: | 234 case Runtime::kStringCompare: |
235 case Runtime::kStringEquals: | 235 case Runtime::kStringEquals: |
236 case Runtime::kToFastProperties: // TODO(jarin): Is it safe? | 236 case Runtime::kToFastProperties: // TODO(jarin): Is it safe? |
237 case Runtime::kTraceEnter: | 237 case Runtime::kTraceEnter: |
238 case Runtime::kTraceExit: | 238 case Runtime::kTraceExit: |
239 return 0; | 239 return 0; |
240 case Runtime::kInlineArguments: | 240 case Runtime::kInlineArguments: |
241 case Runtime::kInlineCallFunction: | 241 case Runtime::kInlineCallFunction: |
242 case Runtime::kInlineDefaultConstructorCallSuper: | 242 case Runtime::kInlineDefaultConstructorCallSuper: |
243 case Runtime::kInlineGetCallerJSFunction: | 243 case Runtime::kInlineGetCallerJSFunction: |
244 case Runtime::kInlineGetPrototype: | 244 case Runtime::kInlineGetPrototype: |
245 case Runtime::kInlineRegExpExec: | 245 case Runtime::kInlineRegExpExec: |
| 246 case Runtime::kInlineSubString: |
| 247 case Runtime::kInlineToName: |
| 248 case Runtime::kInlineToNumber: |
246 case Runtime::kInlineToObject: | 249 case Runtime::kInlineToObject: |
247 case Runtime::kInlineToPrimitive: | |
248 case Runtime::kInlineToPrimitive_Number: | 250 case Runtime::kInlineToPrimitive_Number: |
249 case Runtime::kInlineToPrimitive_String: | 251 case Runtime::kInlineToPrimitive_String: |
250 case Runtime::kInlineToNumber: | 252 case Runtime::kInlineToPrimitive: |
251 case Runtime::kInlineToString: | 253 case Runtime::kInlineToString: |
252 case Runtime::kInlineToName: | |
253 return 1; | 254 return 1; |
254 case Runtime::kInlineDeoptimizeNow: | 255 case Runtime::kInlineDeoptimizeNow: |
255 case Runtime::kInlineThrowNotDateError: | 256 case Runtime::kInlineThrowNotDateError: |
256 return 2; | 257 return 2; |
257 default: | 258 default: |
258 break; | 259 break; |
259 } | 260 } |
260 | 261 |
261 // Most inlined runtime functions (except the ones listed above) can be called | 262 // Most inlined runtime functions (except the ones listed above) can be called |
262 // without a FrameState or will be lowered by JSIntrinsicLowering internally. | 263 // without a FrameState or will be lowered by JSIntrinsicLowering internally. |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 return LinkageLocation::ForCalleeFrameSlot(spill_index); | 520 return LinkageLocation::ForCalleeFrameSlot(spill_index); |
520 } else { | 521 } else { |
521 // Parameter. Use the assigned location from the incoming call descriptor. | 522 // Parameter. Use the assigned location from the incoming call descriptor. |
522 int parameter_index = 1 + index; // skip index 0, which is the target. | 523 int parameter_index = 1 + index; // skip index 0, which is the target. |
523 return incoming_->GetInputLocation(parameter_index); | 524 return incoming_->GetInputLocation(parameter_index); |
524 } | 525 } |
525 } | 526 } |
526 } // namespace compiler | 527 } // namespace compiler |
527 } // namespace internal | 528 } // namespace internal |
528 } // namespace v8 | 529 } // namespace v8 |
OLD | NEW |