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/builtins.h" | 5 #include "src/builtins/builtins.h" |
6 #include "src/api.h" | 6 #include "src/api.h" |
7 #include "src/assembler-inl.h" | 7 #include "src/assembler-inl.h" |
8 #include "src/builtins/builtins-descriptors.h" | 8 #include "src/builtins/builtins-descriptors.h" |
9 #include "src/callable.h" | 9 #include "src/callable.h" |
10 #include "src/isolate.h" | 10 #include "src/isolate.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 case OrdinaryToPrimitiveHint::kNumber: | 109 case OrdinaryToPrimitiveHint::kNumber: |
110 return OrdinaryToPrimitive_Number(); | 110 return OrdinaryToPrimitive_Number(); |
111 case OrdinaryToPrimitiveHint::kString: | 111 case OrdinaryToPrimitiveHint::kString: |
112 return OrdinaryToPrimitive_String(); | 112 return OrdinaryToPrimitive_String(); |
113 } | 113 } |
114 UNREACHABLE(); | 114 UNREACHABLE(); |
115 return Handle<Code>::null(); | 115 return Handle<Code>::null(); |
116 } | 116 } |
117 | 117 |
118 // static | 118 // static |
| 119 int Builtins::GetBuiltinParameterCount(Name name) { |
| 120 switch (name) { |
| 121 #define TFJ_CASE(Name, ParamCount, ...) \ |
| 122 case k##Name: { \ |
| 123 return ParamCount; \ |
| 124 } |
| 125 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, TFJ_CASE, IGNORE_BUILTIN, |
| 126 IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN) |
| 127 #undef CASE |
| 128 default: |
| 129 UNREACHABLE(); |
| 130 return 0; |
| 131 } |
| 132 } |
| 133 |
| 134 // static |
119 Callable Builtins::CallableFor(Isolate* isolate, Name name) { | 135 Callable Builtins::CallableFor(Isolate* isolate, Name name) { |
120 switch (name) { | 136 switch (name) { |
121 #define CASE(Name, ...) \ | 137 #define CASE(Name, ...) \ |
122 case k##Name: { \ | 138 case k##Name: { \ |
123 Handle<Code> code = isolate->builtins()->Name(); \ | 139 Handle<Code> code = isolate->builtins()->Name(); \ |
124 auto descriptor = Builtin_##Name##_InterfaceDescriptor(isolate); \ | 140 auto descriptor = Builtin_##Name##_InterfaceDescriptor(isolate); \ |
125 return Callable(code, descriptor); \ | 141 return Callable(code, descriptor); \ |
126 } | 142 } |
127 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, CASE, CASE, | 143 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, CASE, CASE, |
128 CASE, IGNORE_BUILTIN, IGNORE_BUILTIN) | 144 CASE, IGNORE_BUILTIN, IGNORE_BUILTIN) |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 // TODO(jochen): Remove this. | 255 // TODO(jochen): Remove this. |
240 if (responsible_context.is_null()) { | 256 if (responsible_context.is_null()) { |
241 return true; | 257 return true; |
242 } | 258 } |
243 if (*responsible_context == target->context()) return true; | 259 if (*responsible_context == target->context()) return true; |
244 return isolate->MayAccess(responsible_context, target_global_proxy); | 260 return isolate->MayAccess(responsible_context, target_global_proxy); |
245 } | 261 } |
246 | 262 |
247 } // namespace internal | 263 } // namespace internal |
248 } // namespace v8 | 264 } // namespace v8 |
OLD | NEW |