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() == 5); | |
561 CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 0); | |
562 CONVERT_ARG_HANDLE_CHECKED(JSObject, resolution, 1); | |
adamk
2016/09/06 21:04:57
The struct says these are just Objects; which is i
gsathya
2016/09/07 04:45:30
Updated the struct to be more specific.
| |
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 Handle<PromiseContainer> container = isolate->factory()->NewPromiseContainer( | |
567 promise, resolution, then, resolve, reject); | |
568 isolate->EnqueueMicrotask(container); | |
569 return isolate->heap()->undefined_value(); | |
570 } | |
571 | |
558 RUNTIME_FUNCTION(Runtime_EnqueueMicrotask) { | 572 RUNTIME_FUNCTION(Runtime_EnqueueMicrotask) { |
559 HandleScope scope(isolate); | 573 HandleScope scope(isolate); |
560 DCHECK(args.length() == 1); | 574 DCHECK(args.length() == 1); |
561 CONVERT_ARG_HANDLE_CHECKED(JSFunction, microtask, 0); | 575 CONVERT_ARG_HANDLE_CHECKED(JSFunction, microtask, 0); |
562 isolate->EnqueueMicrotask(microtask); | 576 isolate->EnqueueMicrotask(microtask); |
563 return isolate->heap()->undefined_value(); | 577 return isolate->heap()->undefined_value(); |
564 } | 578 } |
565 | 579 |
566 RUNTIME_FUNCTION(Runtime_RunMicrotasks) { | 580 RUNTIME_FUNCTION(Runtime_RunMicrotasks) { |
567 HandleScope scope(isolate); | 581 HandleScope scope(isolate); |
(...skipping 22 matching lines...) Expand all Loading... | |
590 | 604 |
591 RUNTIME_FUNCTION(Runtime_Typeof) { | 605 RUNTIME_FUNCTION(Runtime_Typeof) { |
592 HandleScope scope(isolate); | 606 HandleScope scope(isolate); |
593 DCHECK_EQ(1, args.length()); | 607 DCHECK_EQ(1, args.length()); |
594 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); | 608 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); |
595 return *Object::TypeOf(isolate, object); | 609 return *Object::TypeOf(isolate, object); |
596 } | 610 } |
597 | 611 |
598 } // namespace internal | 612 } // namespace internal |
599 } // namespace v8 | 613 } // namespace v8 |
OLD | NEW |