OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 #ifndef V8_BUILTINS_BUILTINS_H_ | 5 #ifndef V8_BUILTINS_BUILTINS_H_ |
6 #define V8_BUILTINS_BUILTINS_H_ | 6 #define V8_BUILTINS_BUILTINS_H_ |
7 | 7 |
8 #include "src/base/flags.h" | 8 #include "src/base/flags.h" |
9 #include "src/handles.h" | 9 #include "src/handles.h" |
10 | 10 |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 Handle<Code> Call(ConvertReceiverMode = ConvertReceiverMode::kAny, | 608 Handle<Code> Call(ConvertReceiverMode = ConvertReceiverMode::kAny, |
609 TailCallMode tail_call_mode = TailCallMode::kDisallow); | 609 TailCallMode tail_call_mode = TailCallMode::kDisallow); |
610 Handle<Code> CallBoundFunction(TailCallMode tail_call_mode); | 610 Handle<Code> CallBoundFunction(TailCallMode tail_call_mode); |
611 Handle<Code> NonPrimitiveToPrimitive( | 611 Handle<Code> NonPrimitiveToPrimitive( |
612 ToPrimitiveHint hint = ToPrimitiveHint::kDefault); | 612 ToPrimitiveHint hint = ToPrimitiveHint::kDefault); |
613 Handle<Code> OrdinaryToPrimitive(OrdinaryToPrimitiveHint hint); | 613 Handle<Code> OrdinaryToPrimitive(OrdinaryToPrimitiveHint hint); |
614 Handle<Code> InterpreterPushArgsAndCall( | 614 Handle<Code> InterpreterPushArgsAndCall( |
615 TailCallMode tail_call_mode, | 615 TailCallMode tail_call_mode, |
616 CallableType function_type = CallableType::kAny); | 616 CallableType function_type = CallableType::kAny); |
617 | 617 |
| 618 bool IsCppBuiltin(Name name) const { |
| 619 DCHECK(name < BUILTIN_COUNT); |
| 620 return (builtins_[name].kind == CPP || builtins_[name].kind == API); |
| 621 } |
| 622 |
| 623 const Descriptor* DescriptorFor(Name name) const { |
| 624 DCHECK(name < BUILTIN_COUNT); |
| 625 return &builtins_[name]; |
| 626 } |
| 627 |
618 Code* builtin(Name name) { | 628 Code* builtin(Name name) { |
619 // Code::cast cannot be used here since we access builtins | 629 // Code::cast cannot be used here since we access builtins |
620 // during the marking phase of mark sweep. See IC::Clear. | 630 // during the marking phase of mark sweep. See IC::Clear. |
621 return reinterpret_cast<Code*>(builtins_[name].code); | 631 return reinterpret_cast<Code*>(builtins_[name].code); |
622 } | 632 } |
623 | 633 |
624 Address builtin_address(Name name) { | 634 Address builtin_address(Name name) { |
625 return reinterpret_cast<Address>(&builtins_[name].code); | 635 return reinterpret_cast<Address>(&builtins_[name].code); |
626 } | 636 } |
627 | 637 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 | 691 |
682 friend class Isolate; | 692 friend class Isolate; |
683 | 693 |
684 DISALLOW_COPY_AND_ASSIGN(Builtins); | 694 DISALLOW_COPY_AND_ASSIGN(Builtins); |
685 }; | 695 }; |
686 | 696 |
687 } // namespace internal | 697 } // namespace internal |
688 } // namespace v8 | 698 } // namespace v8 |
689 | 699 |
690 #endif // V8_BUILTINS_BUILTINS_H_ | 700 #endif // V8_BUILTINS_BUILTINS_H_ |
OLD | NEW |