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() == 7); |
| 561 CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 0); |
| 562 CONVERT_ARG_HANDLE_CHECKED(JSObject, resolution, 1); |
| 563 CONVERT_ARG_HANDLE_CHECKED(JSFunction, then, 2); |
| 564 CONVERT_ARG_HANDLE_CHECKED(JSFunction, resolve, 3); |
| 565 CONVERT_ARG_HANDLE_CHECKED(JSFunction, reject, 4); |
| 566 CONVERT_ARG_HANDLE_CHECKED(Object, before_debug_event, 5); |
| 567 CONVERT_ARG_HANDLE_CHECKED(Object, after_debug_event, 6); |
| 568 Handle<PromiseContainer> container = isolate->factory()->NewPromiseContainer( |
| 569 promise, resolution, then, resolve, reject, before_debug_event, |
| 570 after_debug_event); |
| 571 isolate->EnqueueMicrotask(container); |
| 572 return isolate->heap()->undefined_value(); |
| 573 } |
| 574 |
558 RUNTIME_FUNCTION(Runtime_EnqueueMicrotask) { | 575 RUNTIME_FUNCTION(Runtime_EnqueueMicrotask) { |
559 HandleScope scope(isolate); | 576 HandleScope scope(isolate); |
560 DCHECK(args.length() == 1); | 577 DCHECK(args.length() == 1); |
561 CONVERT_ARG_HANDLE_CHECKED(JSFunction, microtask, 0); | 578 CONVERT_ARG_HANDLE_CHECKED(JSFunction, microtask, 0); |
562 isolate->EnqueueMicrotask(microtask); | 579 isolate->EnqueueMicrotask(microtask); |
563 return isolate->heap()->undefined_value(); | 580 return isolate->heap()->undefined_value(); |
564 } | 581 } |
565 | 582 |
566 RUNTIME_FUNCTION(Runtime_RunMicrotasks) { | 583 RUNTIME_FUNCTION(Runtime_RunMicrotasks) { |
567 HandleScope scope(isolate); | 584 HandleScope scope(isolate); |
(...skipping 22 matching lines...) Expand all Loading... |
590 | 607 |
591 RUNTIME_FUNCTION(Runtime_Typeof) { | 608 RUNTIME_FUNCTION(Runtime_Typeof) { |
592 HandleScope scope(isolate); | 609 HandleScope scope(isolate); |
593 DCHECK_EQ(1, args.length()); | 610 DCHECK_EQ(1, args.length()); |
594 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); | 611 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); |
595 return *Object::TypeOf(isolate, object); | 612 return *Object::TypeOf(isolate, object); |
596 } | 613 } |
597 | 614 |
598 } // namespace internal | 615 } // namespace internal |
599 } // namespace v8 | 616 } // namespace v8 |
OLD | NEW |