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/globals.h" | 9 #include "src/globals.h" |
10 | 10 |
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
939 class ObjectVisitor; | 939 class ObjectVisitor; |
940 enum class InterpreterPushArgsMode : unsigned; | 940 enum class InterpreterPushArgsMode : unsigned; |
941 namespace compiler { | 941 namespace compiler { |
942 class CodeAssemblerState; | 942 class CodeAssemblerState; |
943 } | 943 } |
944 | 944 |
945 class Builtins { | 945 class Builtins { |
946 public: | 946 public: |
947 ~Builtins(); | 947 ~Builtins(); |
948 | 948 |
949 // Generate all builtin code objects. Should be called once during | |
950 // isolate initialization. | |
951 void SetUp(Isolate* isolate, bool create_heap_objects); | |
952 void TearDown(); | 949 void TearDown(); |
953 | 950 |
954 // Garbage collection support. | 951 // Garbage collection support. |
955 void IterateBuiltins(ObjectVisitor* v); | 952 void IterateBuiltins(ObjectVisitor* v); |
956 | 953 |
957 // Disassembler support. | 954 // Disassembler support. |
958 const char* Lookup(byte* pc); | 955 const char* Lookup(byte* pc); |
959 | 956 |
960 enum Name : int32_t { | 957 enum Name : int32_t { |
961 #define DEF_ENUM(Name, ...) k##Name, | 958 #define DEF_ENUM(Name, ...) k##Name, |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1018 enum ExitFrameType { EXIT, BUILTIN_EXIT }; | 1015 enum ExitFrameType { EXIT, BUILTIN_EXIT }; |
1019 | 1016 |
1020 static void Generate_Adaptor(MacroAssembler* masm, Address builtin_address, | 1017 static void Generate_Adaptor(MacroAssembler* masm, Address builtin_address, |
1021 ExitFrameType exit_frame_type); | 1018 ExitFrameType exit_frame_type); |
1022 | 1019 |
1023 static bool AllowDynamicFunction(Isolate* isolate, Handle<JSFunction> target, | 1020 static bool AllowDynamicFunction(Isolate* isolate, Handle<JSFunction> target, |
1024 Handle<JSObject> target_global_proxy); | 1021 Handle<JSObject> target_global_proxy); |
1025 | 1022 |
1026 private: | 1023 private: |
1027 Builtins(); | 1024 Builtins(); |
| 1025 // Used by SetupBuiltinsDelegate. |
| 1026 void MarkInitialized() { |
| 1027 DCHECK(!initialized_); |
| 1028 initialized_ = true; |
| 1029 } |
1028 | 1030 |
1029 static void Generate_CallFunction(MacroAssembler* masm, | 1031 static void Generate_CallFunction(MacroAssembler* masm, |
1030 ConvertReceiverMode mode, | 1032 ConvertReceiverMode mode, |
1031 TailCallMode tail_call_mode); | 1033 TailCallMode tail_call_mode); |
1032 | 1034 |
1033 static void Generate_CallBoundFunctionImpl(MacroAssembler* masm, | 1035 static void Generate_CallBoundFunctionImpl(MacroAssembler* masm, |
1034 TailCallMode tail_call_mode); | 1036 TailCallMode tail_call_mode); |
1035 | 1037 |
1036 static void Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode, | 1038 static void Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode, |
1037 TailCallMode tail_call_mode); | 1039 TailCallMode tail_call_mode); |
(...skipping 18 matching lines...) Expand all Loading... |
1056 #undef DECLARE_ASM | 1058 #undef DECLARE_ASM |
1057 #undef DECLARE_TF | 1059 #undef DECLARE_TF |
1058 | 1060 |
1059 // Note: These are always Code objects, but to conform with | 1061 // Note: These are always Code objects, but to conform with |
1060 // IterateBuiltins() above which assumes Object**'s for the callback | 1062 // IterateBuiltins() above which assumes Object**'s for the callback |
1061 // function f, we use an Object* array here. | 1063 // function f, we use an Object* array here. |
1062 Object* builtins_[builtin_count]; | 1064 Object* builtins_[builtin_count]; |
1063 bool initialized_; | 1065 bool initialized_; |
1064 | 1066 |
1065 friend class Isolate; | 1067 friend class Isolate; |
| 1068 friend class SetupBuiltinsDelegate; |
1066 | 1069 |
1067 DISALLOW_COPY_AND_ASSIGN(Builtins); | 1070 DISALLOW_COPY_AND_ASSIGN(Builtins); |
1068 }; | 1071 }; |
1069 | 1072 |
1070 } // namespace internal | 1073 } // namespace internal |
1071 } // namespace v8 | 1074 } // namespace v8 |
1072 | 1075 |
1073 #endif // V8_BUILTINS_BUILTINS_H_ | 1076 #endif // V8_BUILTINS_BUILTINS_H_ |
OLD | NEW |