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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 switch (name) { | 118 switch (name) { |
119 #define CASE(Name, ...) \ | 119 #define CASE(Name, ...) \ |
120 case k##Name: { \ | 120 case k##Name: { \ |
121 Handle<Code> code = isolate->builtins()->Name(); \ | 121 Handle<Code> code = isolate->builtins()->Name(); \ |
122 auto descriptor = Builtin_##Name##_InterfaceDescriptor(isolate); \ | 122 auto descriptor = Builtin_##Name##_InterfaceDescriptor(isolate); \ |
123 return Callable(code, descriptor); \ | 123 return Callable(code, descriptor); \ |
124 } | 124 } |
125 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, CASE, CASE, | 125 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, CASE, CASE, |
126 CASE, IGNORE_BUILTIN, IGNORE_BUILTIN) | 126 CASE, IGNORE_BUILTIN, IGNORE_BUILTIN) |
127 #undef CASE | 127 #undef CASE |
| 128 #define CASE(Name, ...) \ |
| 129 case k##Name: { \ |
| 130 Handle<Code> code = isolate->builtins()->Name(); \ |
| 131 return Callable(code, BuiltinDescriptor(isolate)); \ |
| 132 } |
| 133 BUILTIN_LIST(CASE, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, |
| 134 IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN) |
| 135 #undef CASE |
128 default: | 136 default: |
129 UNREACHABLE(); | 137 UNREACHABLE(); |
130 return Callable(Handle<Code>::null(), VoidDescriptor(isolate)); | 138 return Callable(Handle<Code>::null(), VoidDescriptor(isolate)); |
131 } | 139 } |
132 } | 140 } |
133 | 141 |
134 // static | 142 // static |
135 const char* Builtins::name(int index) { | 143 const char* Builtins::name(int index) { |
136 switch (index) { | 144 switch (index) { |
137 #define CASE(Name, ...) \ | 145 #define CASE(Name, ...) \ |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 // TODO(jochen): Remove this. | 241 // TODO(jochen): Remove this. |
234 if (responsible_context.is_null()) { | 242 if (responsible_context.is_null()) { |
235 return true; | 243 return true; |
236 } | 244 } |
237 if (*responsible_context == target->context()) return true; | 245 if (*responsible_context == target->context()) return true; |
238 return isolate->MayAccess(responsible_context, target_global_proxy); | 246 return isolate->MayAccess(responsible_context, target_global_proxy); |
239 } | 247 } |
240 | 248 |
241 } // namespace internal | 249 } // namespace internal |
242 } // namespace v8 | 250 } // namespace v8 |
OLD | NEW |