| 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 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 return isolate->heap()->undefined_value(); | 570 return isolate->heap()->undefined_value(); |
| 571 } | 571 } |
| 572 } | 572 } |
| 573 | 573 |
| 574 RUNTIME_FUNCTION(Runtime_EnqueuePromiseReactionJob) { | 574 RUNTIME_FUNCTION(Runtime_EnqueuePromiseReactionJob) { |
| 575 HandleScope scope(isolate); | 575 HandleScope scope(isolate); |
| 576 DCHECK(args.length() == 5); | 576 DCHECK(args.length() == 5); |
| 577 CONVERT_ARG_HANDLE_CHECKED(Object, value, 0); | 577 CONVERT_ARG_HANDLE_CHECKED(Object, value, 0); |
| 578 CONVERT_ARG_HANDLE_CHECKED(Object, tasks, 1); | 578 CONVERT_ARG_HANDLE_CHECKED(Object, tasks, 1); |
| 579 CONVERT_ARG_HANDLE_CHECKED(Object, deferred, 2); | 579 CONVERT_ARG_HANDLE_CHECKED(Object, deferred, 2); |
| 580 CONVERT_ARG_HANDLE_CHECKED(Object, before_debug_event, 3); | 580 CONVERT_ARG_HANDLE_CHECKED(Object, debug_id, 3); |
| 581 CONVERT_ARG_HANDLE_CHECKED(Object, after_debug_event, 4); | 581 CONVERT_ARG_HANDLE_CHECKED(Object, debug_name, 4); |
| 582 Handle<PromiseReactionJobInfo> info = | 582 Handle<PromiseReactionJobInfo> info = |
| 583 isolate->factory()->NewPromiseReactionJobInfo( | 583 isolate->factory()->NewPromiseReactionJobInfo(value, tasks, deferred, |
| 584 value, tasks, deferred, before_debug_event, after_debug_event, | 584 debug_id, debug_name, |
| 585 isolate->native_context()); | 585 isolate->native_context()); |
| 586 isolate->EnqueueMicrotask(info); | 586 isolate->EnqueueMicrotask(info); |
| 587 return isolate->heap()->undefined_value(); | 587 return isolate->heap()->undefined_value(); |
| 588 } | 588 } |
| 589 | 589 |
| 590 RUNTIME_FUNCTION(Runtime_EnqueuePromiseResolveThenableJob) { | 590 RUNTIME_FUNCTION(Runtime_EnqueuePromiseResolveThenableJob) { |
| 591 HandleScope scope(isolate); | 591 HandleScope scope(isolate); |
| 592 DCHECK(args.length() == 6); | 592 DCHECK(args.length() == 6); |
| 593 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, resolution, 0); | 593 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, resolution, 0); |
| 594 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, then, 1); | 594 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, then, 1); |
| 595 CONVERT_ARG_HANDLE_CHECKED(JSFunction, resolve, 2); | 595 CONVERT_ARG_HANDLE_CHECKED(JSFunction, resolve, 2); |
| 596 CONVERT_ARG_HANDLE_CHECKED(JSFunction, reject, 3); | 596 CONVERT_ARG_HANDLE_CHECKED(JSFunction, reject, 3); |
| 597 CONVERT_ARG_HANDLE_CHECKED(Object, before_debug_event, 4); | 597 CONVERT_ARG_HANDLE_CHECKED(Object, debug_id, 4); |
| 598 CONVERT_ARG_HANDLE_CHECKED(Object, after_debug_event, 5); | 598 CONVERT_ARG_HANDLE_CHECKED(Object, debug_name, 5); |
| 599 Handle<PromiseResolveThenableJobInfo> info = | 599 Handle<PromiseResolveThenableJobInfo> info = |
| 600 isolate->factory()->NewPromiseResolveThenableJobInfo( | 600 isolate->factory()->NewPromiseResolveThenableJobInfo( |
| 601 resolution, then, resolve, reject, before_debug_event, | 601 resolution, then, resolve, reject, debug_id, debug_name); |
| 602 after_debug_event); | |
| 603 isolate->EnqueueMicrotask(info); | 602 isolate->EnqueueMicrotask(info); |
| 604 return isolate->heap()->undefined_value(); | 603 return isolate->heap()->undefined_value(); |
| 605 } | 604 } |
| 606 | 605 |
| 607 RUNTIME_FUNCTION(Runtime_EnqueueMicrotask) { | 606 RUNTIME_FUNCTION(Runtime_EnqueueMicrotask) { |
| 608 HandleScope scope(isolate); | 607 HandleScope scope(isolate); |
| 609 DCHECK(args.length() == 1); | 608 DCHECK(args.length() == 1); |
| 610 CONVERT_ARG_HANDLE_CHECKED(JSFunction, microtask, 0); | 609 CONVERT_ARG_HANDLE_CHECKED(JSFunction, microtask, 0); |
| 611 isolate->EnqueueMicrotask(microtask); | 610 isolate->EnqueueMicrotask(microtask); |
| 612 return isolate->heap()->undefined_value(); | 611 return isolate->heap()->undefined_value(); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 639 | 638 |
| 640 RUNTIME_FUNCTION(Runtime_Typeof) { | 639 RUNTIME_FUNCTION(Runtime_Typeof) { |
| 641 HandleScope scope(isolate); | 640 HandleScope scope(isolate); |
| 642 DCHECK_EQ(1, args.length()); | 641 DCHECK_EQ(1, args.length()); |
| 643 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); | 642 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); |
| 644 return *Object::TypeOf(isolate, object); | 643 return *Object::TypeOf(isolate, object); |
| 645 } | 644 } |
| 646 | 645 |
| 647 } // namespace internal | 646 } // namespace internal |
| 648 } // namespace v8 | 647 } // namespace v8 |
| OLD | NEW |