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