OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/builtins.h" | 5 #include "src/builtins.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/api-natives.h" | 8 #include "src/api-natives.h" |
9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
(...skipping 3480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3491 | 3491 |
3492 BUILTIN(HandleApiCallConstruct) { | 3492 BUILTIN(HandleApiCallConstruct) { |
3493 HandleScope scope(isolate); | 3493 HandleScope scope(isolate); |
3494 Handle<Object> result; | 3494 Handle<Object> result; |
3495 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, | 3495 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, |
3496 HandleApiCallHelper<true>(isolate, args)); | 3496 HandleApiCallHelper<true>(isolate, args)); |
3497 return *result; | 3497 return *result; |
3498 } | 3498 } |
3499 | 3499 |
3500 | 3500 |
3501 Handle<Code> Builtins::CallFunction(ConvertReceiverMode mode) { | 3501 Handle<Code> Builtins::CallFunction(ConvertReceiverMode mode, |
3502 switch (mode) { | 3502 TailCallMode tail_call_mode) { |
3503 case ConvertReceiverMode::kNullOrUndefined: | 3503 switch (tail_call_mode) { |
3504 return CallFunction_ReceiverIsNullOrUndefined(); | 3504 case TailCallMode::kDisallow: |
3505 case ConvertReceiverMode::kNotNullOrUndefined: | 3505 switch (mode) { |
3506 return CallFunction_ReceiverIsNotNullOrUndefined(); | 3506 case ConvertReceiverMode::kNullOrUndefined: |
3507 case ConvertReceiverMode::kAny: | 3507 return CallFunction_ReceiverIsNullOrUndefined(); |
3508 return CallFunction_ReceiverIsAny(); | 3508 case ConvertReceiverMode::kNotNullOrUndefined: |
| 3509 return CallFunction_ReceiverIsNotNullOrUndefined(); |
| 3510 case ConvertReceiverMode::kAny: |
| 3511 return CallFunction_ReceiverIsAny(); |
| 3512 } |
| 3513 break; |
| 3514 case TailCallMode::kAllow: |
| 3515 switch (mode) { |
| 3516 case ConvertReceiverMode::kNullOrUndefined: |
| 3517 return TailCallFunction_ReceiverIsNullOrUndefined(); |
| 3518 case ConvertReceiverMode::kNotNullOrUndefined: |
| 3519 return TailCallFunction_ReceiverIsNotNullOrUndefined(); |
| 3520 case ConvertReceiverMode::kAny: |
| 3521 return TailCallFunction_ReceiverIsAny(); |
| 3522 } |
| 3523 break; |
3509 } | 3524 } |
3510 UNREACHABLE(); | 3525 UNREACHABLE(); |
3511 return Handle<Code>::null(); | 3526 return Handle<Code>::null(); |
3512 } | 3527 } |
3513 | 3528 |
3514 | 3529 |
3515 Handle<Code> Builtins::Call(ConvertReceiverMode mode) { | 3530 Handle<Code> Builtins::Call(ConvertReceiverMode mode, |
3516 switch (mode) { | 3531 TailCallMode tail_call_mode) { |
3517 case ConvertReceiverMode::kNullOrUndefined: | 3532 switch (tail_call_mode) { |
3518 return Call_ReceiverIsNullOrUndefined(); | 3533 case TailCallMode::kDisallow: |
3519 case ConvertReceiverMode::kNotNullOrUndefined: | 3534 switch (mode) { |
3520 return Call_ReceiverIsNotNullOrUndefined(); | 3535 case ConvertReceiverMode::kNullOrUndefined: |
3521 case ConvertReceiverMode::kAny: | 3536 return Call_ReceiverIsNullOrUndefined(); |
3522 return Call_ReceiverIsAny(); | 3537 case ConvertReceiverMode::kNotNullOrUndefined: |
| 3538 return Call_ReceiverIsNotNullOrUndefined(); |
| 3539 case ConvertReceiverMode::kAny: |
| 3540 return Call_ReceiverIsAny(); |
| 3541 } |
| 3542 break; |
| 3543 case TailCallMode::kAllow: |
| 3544 switch (mode) { |
| 3545 case ConvertReceiverMode::kNullOrUndefined: |
| 3546 return TailCall_ReceiverIsNullOrUndefined(); |
| 3547 case ConvertReceiverMode::kNotNullOrUndefined: |
| 3548 return TailCall_ReceiverIsNotNullOrUndefined(); |
| 3549 case ConvertReceiverMode::kAny: |
| 3550 return TailCall_ReceiverIsAny(); |
| 3551 } |
| 3552 break; |
3523 } | 3553 } |
3524 UNREACHABLE(); | 3554 UNREACHABLE(); |
3525 return Handle<Code>::null(); | 3555 return Handle<Code>::null(); |
| 3556 } |
| 3557 |
| 3558 |
| 3559 Handle<Code> Builtins::CallBoundFunction(TailCallMode tail_call_mode) { |
| 3560 switch (tail_call_mode) { |
| 3561 case TailCallMode::kDisallow: |
| 3562 return CallBoundFunction(); |
| 3563 case TailCallMode::kAllow: |
| 3564 return TailCallBoundFunction(); |
| 3565 } |
| 3566 UNREACHABLE(); |
| 3567 return Handle<Code>::null(); |
3526 } | 3568 } |
3527 | 3569 |
3528 | 3570 |
3529 namespace { | 3571 namespace { |
3530 | 3572 |
3531 class RelocatableArguments | 3573 class RelocatableArguments |
3532 : public BuiltinArguments<BuiltinExtraArguments::kTarget>, | 3574 : public BuiltinArguments<BuiltinExtraArguments::kTarget>, |
3533 public Relocatable { | 3575 public Relocatable { |
3534 public: | 3576 public: |
3535 RelocatableArguments(Isolate* isolate, int length, Object** arguments) | 3577 RelocatableArguments(Isolate* isolate, int length, Object** arguments) |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3998 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 4040 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
3999 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 4041 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
4000 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) | 4042 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) |
4001 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 4043 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
4002 #undef DEFINE_BUILTIN_ACCESSOR_C | 4044 #undef DEFINE_BUILTIN_ACCESSOR_C |
4003 #undef DEFINE_BUILTIN_ACCESSOR_A | 4045 #undef DEFINE_BUILTIN_ACCESSOR_A |
4004 | 4046 |
4005 | 4047 |
4006 } // namespace internal | 4048 } // namespace internal |
4007 } // namespace v8 | 4049 } // namespace v8 |
OLD | NEW |