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