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

Side by Side Diff: src/runtime/runtime-test.cc

Issue 1928203002: [es8] More spec compliant syntactic tail calls implementation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Some STC tests ported for PTC Created 4 years, 7 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/runtime/runtime.h ('k') | test/message/syntactic-tail-call-in-binop-lhs.js » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/deoptimizer.h" 8 #include "src/deoptimizer.h"
9 #include "src/frames-inl.h" 9 #include "src/frames-inl.h"
10 #include "src/full-codegen/full-codegen.h" 10 #include "src/full-codegen/full-codegen.h"
11 #include "src/isolate-inl.h"
11 #include "src/snapshot/natives.h" 12 #include "src/snapshot/natives.h"
12 13
13 namespace v8 { 14 namespace v8 {
14 namespace internal { 15 namespace internal {
15 16
16 RUNTIME_FUNCTION(Runtime_DeoptimizeFunction) { 17 RUNTIME_FUNCTION(Runtime_DeoptimizeFunction) {
17 HandleScope scope(isolate); 18 HandleScope scope(isolate);
18 DCHECK(args.length() == 1); 19 DCHECK(args.length() == 1);
19 20
20 // This function is used by fuzzers to get coverage in compiler. 21 // This function is used by fuzzers to get coverage in compiler.
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 } 475 }
475 476
476 RUNTIME_FUNCTION(Runtime_TraceTailCall) { 477 RUNTIME_FUNCTION(Runtime_TraceTailCall) {
477 SealHandleScope shs(isolate); 478 SealHandleScope shs(isolate);
478 DCHECK_EQ(0, args.length()); 479 DCHECK_EQ(0, args.length());
479 PrintIndentation(isolate); 480 PrintIndentation(isolate);
480 PrintF("} -> tail call ->\n"); 481 PrintF("} -> tail call ->\n");
481 return isolate->heap()->undefined_value(); 482 return isolate->heap()->undefined_value();
482 } 483 }
483 484
485 RUNTIME_FUNCTION(Runtime_GetExceptionDetails) {
486 HandleScope shs(isolate);
487 DCHECK(args.length() == 1);
488 CONVERT_ARG_HANDLE_CHECKED(JSObject, exception_obj, 0);
489
490 Factory* factory = isolate->factory();
491 Handle<JSMessageObject> message_obj =
492 isolate->CreateMessage(exception_obj, nullptr);
493
494 Handle<JSObject> message = factory->NewJSObject(isolate->object_function());
495
496 Handle<String> key;
497 Handle<Object> value;
498
499 key = factory->NewStringFromAsciiChecked("start_pos");
500 value = handle(Smi::FromInt(message_obj->start_position()), isolate);
501 JSObject::SetProperty(message, key, value, STRICT).Assert();
502
503 key = factory->NewStringFromAsciiChecked("end_pos");
504 value = handle(Smi::FromInt(message_obj->end_position()), isolate);
505 JSObject::SetProperty(message, key, value, STRICT).Assert();
506
507 return *message;
508 }
509
484 RUNTIME_FUNCTION(Runtime_HaveSameMap) { 510 RUNTIME_FUNCTION(Runtime_HaveSameMap) {
485 SealHandleScope shs(isolate); 511 SealHandleScope shs(isolate);
486 DCHECK(args.length() == 2); 512 DCHECK(args.length() == 2);
487 CONVERT_ARG_CHECKED(JSObject, obj1, 0); 513 CONVERT_ARG_CHECKED(JSObject, obj1, 0);
488 CONVERT_ARG_CHECKED(JSObject, obj2, 1); 514 CONVERT_ARG_CHECKED(JSObject, obj2, 1);
489 return isolate->heap()->ToBoolean(obj1->map() == obj2->map()); 515 return isolate->heap()->ToBoolean(obj1->map() == obj2->map());
490 } 516 }
491 517
492 518
493 RUNTIME_FUNCTION(Runtime_InNewSpace) { 519 RUNTIME_FUNCTION(Runtime_InNewSpace) {
(...skipping 28 matching lines...) Expand all
522 RUNTIME_FUNCTION(Runtime_HasFixed##Type##Elements) { \ 548 RUNTIME_FUNCTION(Runtime_HasFixed##Type##Elements) { \
523 CONVERT_ARG_CHECKED(JSObject, obj, 0); \ 549 CONVERT_ARG_CHECKED(JSObject, obj, 0); \
524 return isolate->heap()->ToBoolean(obj->HasFixed##Type##Elements()); \ 550 return isolate->heap()->ToBoolean(obj->HasFixed##Type##Elements()); \
525 } 551 }
526 552
527 TYPED_ARRAYS(FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION) 553 TYPED_ARRAYS(FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION)
528 554
529 #undef FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION 555 #undef FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION
530 } // namespace internal 556 } // namespace internal
531 } // namespace v8 557 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | test/message/syntactic-tail-call-in-binop-lhs.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698