OLD | NEW |
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 <memory> | 7 #include <memory> |
8 | 8 |
9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
10 #include "src/ast/prettyprinter.h" | 10 #include "src/ast/prettyprinter.h" |
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 isolate->counters()->runtime_call_stats()->Print(stats_stream); | 547 isolate->counters()->runtime_call_stats()->Print(stats_stream); |
548 isolate->counters()->runtime_call_stats()->Reset(); | 548 isolate->counters()->runtime_call_stats()->Reset(); |
549 if (args[0]->IsString()) | 549 if (args[0]->IsString()) |
550 std::fclose(f); | 550 std::fclose(f); |
551 else | 551 else |
552 std::fflush(f); | 552 std::fflush(f); |
553 return isolate->heap()->undefined_value(); | 553 return isolate->heap()->undefined_value(); |
554 } | 554 } |
555 } | 555 } |
556 | 556 |
| 557 RUNTIME_FUNCTION(Runtime_EnqueuePromiseResolveThenableJob) { |
| 558 HandleScope scope(isolate); |
| 559 DCHECK(args.length() == 6); |
| 560 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, resolution, 0); |
| 561 CONVERT_ARG_HANDLE_CHECKED(JSFunction, then, 1); |
| 562 CONVERT_ARG_HANDLE_CHECKED(JSFunction, resolve, 2); |
| 563 CONVERT_ARG_HANDLE_CHECKED(JSFunction, reject, 3); |
| 564 CONVERT_ARG_HANDLE_CHECKED(Object, before_debug_event, 4); |
| 565 CONVERT_ARG_HANDLE_CHECKED(Object, after_debug_event, 5); |
| 566 Handle<PromiseContainer> container = isolate->factory()->NewPromiseContainer( |
| 567 resolution, then, resolve, reject, before_debug_event, after_debug_event); |
| 568 isolate->EnqueueMicrotask(container); |
| 569 return isolate->heap()->undefined_value(); |
| 570 } |
| 571 |
557 RUNTIME_FUNCTION(Runtime_EnqueueMicrotask) { | 572 RUNTIME_FUNCTION(Runtime_EnqueueMicrotask) { |
558 HandleScope scope(isolate); | 573 HandleScope scope(isolate); |
559 DCHECK(args.length() == 1); | 574 DCHECK(args.length() == 1); |
560 CONVERT_ARG_HANDLE_CHECKED(JSFunction, microtask, 0); | 575 CONVERT_ARG_HANDLE_CHECKED(JSFunction, microtask, 0); |
561 isolate->EnqueueMicrotask(microtask); | 576 isolate->EnqueueMicrotask(microtask); |
562 return isolate->heap()->undefined_value(); | 577 return isolate->heap()->undefined_value(); |
563 } | 578 } |
564 | 579 |
565 RUNTIME_FUNCTION(Runtime_RunMicrotasks) { | 580 RUNTIME_FUNCTION(Runtime_RunMicrotasks) { |
566 HandleScope scope(isolate); | 581 HandleScope scope(isolate); |
(...skipping 22 matching lines...) Expand all Loading... |
589 | 604 |
590 RUNTIME_FUNCTION(Runtime_Typeof) { | 605 RUNTIME_FUNCTION(Runtime_Typeof) { |
591 HandleScope scope(isolate); | 606 HandleScope scope(isolate); |
592 DCHECK_EQ(1, args.length()); | 607 DCHECK_EQ(1, args.length()); |
593 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); | 608 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); |
594 return *Object::TypeOf(isolate, object); | 609 return *Object::TypeOf(isolate, object); |
595 } | 610 } |
596 | 611 |
597 } // namespace internal | 612 } // namespace internal |
598 } // namespace v8 | 613 } // namespace v8 |
OLD | NEW |