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 3535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3546 | 3546 |
3547 | 3547 |
3548 BUILTIN(HandleApiCallConstruct) { | 3548 BUILTIN(HandleApiCallConstruct) { |
3549 HandleScope scope(isolate); | 3549 HandleScope scope(isolate); |
3550 Handle<Object> result; | 3550 Handle<Object> result; |
3551 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, | 3551 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, |
3552 HandleApiCallHelper<true>(isolate, args)); | 3552 HandleApiCallHelper<true>(isolate, args)); |
3553 return *result; | 3553 return *result; |
3554 } | 3554 } |
3555 | 3555 |
3556 | 3556 Handle<Code> Builtins::CallFunction(ConvertReceiverMode mode, |
3557 Handle<Code> Builtins::CallFunction(ConvertReceiverMode mode) { | 3557 TailCallMode tail_call_mode) { |
3558 switch (mode) { | 3558 switch (tail_call_mode) { |
3559 case ConvertReceiverMode::kNullOrUndefined: | 3559 case TailCallMode::kDisallow: |
3560 return CallFunction_ReceiverIsNullOrUndefined(); | 3560 switch (mode) { |
3561 case ConvertReceiverMode::kNotNullOrUndefined: | 3561 case ConvertReceiverMode::kNullOrUndefined: |
3562 return CallFunction_ReceiverIsNotNullOrUndefined(); | 3562 return CallFunction_ReceiverIsNullOrUndefined(); |
3563 case ConvertReceiverMode::kAny: | 3563 case ConvertReceiverMode::kNotNullOrUndefined: |
3564 return CallFunction_ReceiverIsAny(); | 3564 return CallFunction_ReceiverIsNotNullOrUndefined(); |
| 3565 case ConvertReceiverMode::kAny: |
| 3566 return CallFunction_ReceiverIsAny(); |
| 3567 } |
| 3568 break; |
| 3569 case TailCallMode::kAllow: |
| 3570 switch (mode) { |
| 3571 case ConvertReceiverMode::kNullOrUndefined: |
| 3572 return TailCallFunction_ReceiverIsNullOrUndefined(); |
| 3573 case ConvertReceiverMode::kNotNullOrUndefined: |
| 3574 return TailCallFunction_ReceiverIsNotNullOrUndefined(); |
| 3575 case ConvertReceiverMode::kAny: |
| 3576 return TailCallFunction_ReceiverIsAny(); |
| 3577 } |
| 3578 break; |
3565 } | 3579 } |
3566 UNREACHABLE(); | 3580 UNREACHABLE(); |
3567 return Handle<Code>::null(); | 3581 return Handle<Code>::null(); |
3568 } | 3582 } |
3569 | 3583 |
3570 | 3584 Handle<Code> Builtins::Call(ConvertReceiverMode mode, |
3571 Handle<Code> Builtins::Call(ConvertReceiverMode mode) { | 3585 TailCallMode tail_call_mode) { |
3572 switch (mode) { | 3586 switch (tail_call_mode) { |
3573 case ConvertReceiverMode::kNullOrUndefined: | 3587 case TailCallMode::kDisallow: |
3574 return Call_ReceiverIsNullOrUndefined(); | 3588 switch (mode) { |
3575 case ConvertReceiverMode::kNotNullOrUndefined: | 3589 case ConvertReceiverMode::kNullOrUndefined: |
3576 return Call_ReceiverIsNotNullOrUndefined(); | 3590 return Call_ReceiverIsNullOrUndefined(); |
3577 case ConvertReceiverMode::kAny: | 3591 case ConvertReceiverMode::kNotNullOrUndefined: |
3578 return Call_ReceiverIsAny(); | 3592 return Call_ReceiverIsNotNullOrUndefined(); |
| 3593 case ConvertReceiverMode::kAny: |
| 3594 return Call_ReceiverIsAny(); |
| 3595 } |
| 3596 break; |
| 3597 case TailCallMode::kAllow: |
| 3598 switch (mode) { |
| 3599 case ConvertReceiverMode::kNullOrUndefined: |
| 3600 return TailCall_ReceiverIsNullOrUndefined(); |
| 3601 case ConvertReceiverMode::kNotNullOrUndefined: |
| 3602 return TailCall_ReceiverIsNotNullOrUndefined(); |
| 3603 case ConvertReceiverMode::kAny: |
| 3604 return TailCall_ReceiverIsAny(); |
| 3605 } |
| 3606 break; |
3579 } | 3607 } |
3580 UNREACHABLE(); | 3608 UNREACHABLE(); |
3581 return Handle<Code>::null(); | 3609 return Handle<Code>::null(); |
| 3610 } |
| 3611 |
| 3612 Handle<Code> Builtins::CallBoundFunction(TailCallMode tail_call_mode) { |
| 3613 switch (tail_call_mode) { |
| 3614 case TailCallMode::kDisallow: |
| 3615 return CallBoundFunction(); |
| 3616 case TailCallMode::kAllow: |
| 3617 return TailCallBoundFunction(); |
| 3618 } |
| 3619 UNREACHABLE(); |
| 3620 return Handle<Code>::null(); |
3582 } | 3621 } |
3583 | 3622 |
3584 | 3623 |
3585 namespace { | 3624 namespace { |
3586 | 3625 |
3587 class RelocatableArguments | 3626 class RelocatableArguments |
3588 : public BuiltinArguments<BuiltinExtraArguments::kTarget>, | 3627 : public BuiltinArguments<BuiltinExtraArguments::kTarget>, |
3589 public Relocatable { | 3628 public Relocatable { |
3590 public: | 3629 public: |
3591 RelocatableArguments(Isolate* isolate, int length, Object** arguments) | 3630 RelocatableArguments(Isolate* isolate, int length, Object** arguments) |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4054 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 4093 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
4055 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 4094 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
4056 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) | 4095 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) |
4057 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 4096 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
4058 #undef DEFINE_BUILTIN_ACCESSOR_C | 4097 #undef DEFINE_BUILTIN_ACCESSOR_C |
4059 #undef DEFINE_BUILTIN_ACCESSOR_A | 4098 #undef DEFINE_BUILTIN_ACCESSOR_A |
4060 | 4099 |
4061 | 4100 |
4062 } // namespace internal | 4101 } // namespace internal |
4063 } // namespace v8 | 4102 } // namespace v8 |
OLD | NEW |