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/builtins/builtins-definitions.h" | 9 #include "src/builtins/builtins-definitions.h" |
10 #include "src/globals.h" | 10 #include "src/globals.h" |
| 11 #include "src/utils.h" |
11 | 12 |
12 namespace v8 { | 13 namespace v8 { |
13 namespace internal { | 14 namespace internal { |
14 | 15 |
15 class Callable; | 16 class Callable; |
16 template <typename T> | 17 template <typename T> |
17 class Handle; | 18 class Handle; |
18 class Isolate; | 19 class Isolate; |
19 | 20 |
20 // Forward declarations. | 21 // Forward declarations. |
(...skipping 15 matching lines...) Expand all Loading... |
36 // Disassembler support. | 37 // Disassembler support. |
37 const char* Lookup(byte* pc); | 38 const char* Lookup(byte* pc); |
38 | 39 |
39 enum Name : int32_t { | 40 enum Name : int32_t { |
40 #define DEF_ENUM(Name, ...) k##Name, | 41 #define DEF_ENUM(Name, ...) k##Name, |
41 BUILTIN_LIST_ALL(DEF_ENUM) | 42 BUILTIN_LIST_ALL(DEF_ENUM) |
42 #undef DEF_ENUM | 43 #undef DEF_ENUM |
43 builtin_count | 44 builtin_count |
44 }; | 45 }; |
45 | 46 |
| 47 static BailoutId GetContinuationBailoutId(Name name); |
| 48 static Name GetBuiltinFromBailoutId(BailoutId); |
| 49 |
46 #define DECLARE_BUILTIN_ACCESSOR(Name, ...) \ | 50 #define DECLARE_BUILTIN_ACCESSOR(Name, ...) \ |
47 V8_EXPORT_PRIVATE Handle<Code> Name(); | 51 V8_EXPORT_PRIVATE Handle<Code> Name(); |
48 BUILTIN_LIST_ALL(DECLARE_BUILTIN_ACCESSOR) | 52 BUILTIN_LIST_ALL(DECLARE_BUILTIN_ACCESSOR) |
49 #undef DECLARE_BUILTIN_ACCESSOR | 53 #undef DECLARE_BUILTIN_ACCESSOR |
50 | 54 |
51 // Convenience wrappers. | 55 // Convenience wrappers. |
52 Handle<Code> CallFunction( | 56 Handle<Code> CallFunction( |
53 ConvertReceiverMode = ConvertReceiverMode::kAny, | 57 ConvertReceiverMode = ConvertReceiverMode::kAny, |
54 TailCallMode tail_call_mode = TailCallMode::kDisallow); | 58 TailCallMode tail_call_mode = TailCallMode::kDisallow); |
55 Handle<Code> Call(ConvertReceiverMode = ConvertReceiverMode::kAny, | 59 Handle<Code> Call(ConvertReceiverMode = ConvertReceiverMode::kAny, |
(...skipping 15 matching lines...) Expand all Loading... |
71 // during the marking phase of mark sweep. See IC::Clear. | 75 // during the marking phase of mark sweep. See IC::Clear. |
72 return reinterpret_cast<Code*>(builtins_[name]); | 76 return reinterpret_cast<Code*>(builtins_[name]); |
73 } | 77 } |
74 | 78 |
75 Address builtin_address(Name name) { | 79 Address builtin_address(Name name) { |
76 return reinterpret_cast<Address>(&builtins_[name]); | 80 return reinterpret_cast<Address>(&builtins_[name]); |
77 } | 81 } |
78 | 82 |
79 static Callable CallableFor(Isolate* isolate, Name name); | 83 static Callable CallableFor(Isolate* isolate, Name name); |
80 | 84 |
| 85 static int GetStackParameterCount(Isolate* isolate, Name name); |
| 86 |
81 static const char* name(int index); | 87 static const char* name(int index); |
82 | 88 |
83 // Returns the C++ entry point for builtins implemented in C++, and the null | 89 // Returns the C++ entry point for builtins implemented in C++, and the null |
84 // Address otherwise. | 90 // Address otherwise. |
85 static Address CppEntryOf(int index); | 91 static Address CppEntryOf(int index); |
86 | 92 |
87 static bool IsCpp(int index); | 93 static bool IsCpp(int index); |
88 static bool IsApi(int index); | 94 static bool IsApi(int index); |
89 static bool HasCppImplementation(int index); | 95 static bool HasCppImplementation(int index); |
90 | 96 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 friend class Isolate; | 157 friend class Isolate; |
152 friend class SetupIsolateDelegate; | 158 friend class SetupIsolateDelegate; |
153 | 159 |
154 DISALLOW_COPY_AND_ASSIGN(Builtins); | 160 DISALLOW_COPY_AND_ASSIGN(Builtins); |
155 }; | 161 }; |
156 | 162 |
157 } // namespace internal | 163 } // namespace internal |
158 } // namespace v8 | 164 } // namespace v8 |
159 | 165 |
160 #endif // V8_BUILTINS_BUILTINS_H_ | 166 #endif // V8_BUILTINS_BUILTINS_H_ |
OLD | NEW |