Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: src/builtins/builtins.cc

Issue 2752213002: [csa] Add CSA::CallBuiltin and Builtins::CallableFor (Closed)
Patch Set: Remove unused variable again Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/builtins/builtins.h ('k') | src/builtins/builtins-regexp-gen.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/callable.h"
8 #include "src/code-events.h" 9 #include "src/code-events.h"
9 #include "src/compiler/code-assembler.h" 10 #include "src/compiler/code-assembler.h"
10 #include "src/ic/ic-state.h" 11 #include "src/ic/ic-state.h"
11 #include "src/interface-descriptors.h" 12 #include "src/interface-descriptors.h"
12 #include "src/isolate.h" 13 #include "src/isolate.h"
13 #include "src/macro-assembler.h" 14 #include "src/macro-assembler.h"
14 #include "src/objects-inl.h" 15 #include "src/objects-inl.h"
15 16
16 namespace v8 { 17 namespace v8 {
17 namespace internal { 18 namespace internal {
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 case OrdinaryToPrimitiveHint::kNumber: 269 case OrdinaryToPrimitiveHint::kNumber:
269 return OrdinaryToPrimitive_Number(); 270 return OrdinaryToPrimitive_Number();
270 case OrdinaryToPrimitiveHint::kString: 271 case OrdinaryToPrimitiveHint::kString:
271 return OrdinaryToPrimitive_String(); 272 return OrdinaryToPrimitive_String();
272 } 273 }
273 UNREACHABLE(); 274 UNREACHABLE();
274 return Handle<Code>::null(); 275 return Handle<Code>::null();
275 } 276 }
276 277
277 // static 278 // static
279 Callable Builtins::CallableFor(Isolate* isolate, Name name) {
280 switch (name) {
281 #define CASE(Name, _, __, InterfaceDescriptor, ...) \
282 case k##Name: { \
283 Handle<Code> code(Code::cast(isolate->builtins()->builtins_[name])); \
caitp 2017/03/16 13:30:06 Is there any way we could push args in excess of 4
284 auto descriptor = InterfaceDescriptor##Descriptor(isolate); \
285 return Callable(code, descriptor); \
286 }
287 BUILTIN_LIST_TFS(CASE)
288 #undef CASE
289 default:
290 UNREACHABLE();
291 return Callable(Handle<Code>::null(), VoidDescriptor(isolate));
292 }
293 }
294
295 // static
278 const char* Builtins::name(int index) { 296 const char* Builtins::name(int index) {
279 switch (index) { 297 switch (index) {
280 #define CASE(Name, ...) \ 298 #define CASE(Name, ...) \
281 case k##Name: \ 299 case k##Name: \
282 return #Name; 300 return #Name;
283 BUILTIN_LIST_ALL(CASE) 301 BUILTIN_LIST_ALL(CASE)
284 #undef CASE 302 #undef CASE
285 default: 303 default:
286 UNREACHABLE(); 304 UNREACHABLE();
287 break; 305 break;
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 // TODO(jochen): Remove this. 394 // TODO(jochen): Remove this.
377 if (responsible_context.is_null()) { 395 if (responsible_context.is_null()) {
378 return true; 396 return true;
379 } 397 }
380 if (*responsible_context == target->context()) return true; 398 if (*responsible_context == target->context()) return true;
381 return isolate->MayAccess(responsible_context, target_global_proxy); 399 return isolate->MayAccess(responsible_context, target_global_proxy);
382 } 400 }
383 401
384 } // namespace internal 402 } // namespace internal
385 } // namespace v8 403 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins/builtins.h ('k') | src/builtins/builtins-regexp-gen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698