Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1224)

Side by Side Diff: src/runtime/runtime-internal.cc

Issue 2314903004: [promises] Move PromiseResolveThenableJob to c++ (Closed)
Patch Set: rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/runtime/runtime.h ('k') | test/mjsunit/es6/promise-thenable-proxy.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 isolate->counters()->runtime_call_stats()->Print(stats_stream); 547 isolate->counters()->runtime_call_stats()->Print(stats_stream);
548 isolate->counters()->runtime_call_stats()->Reset(); 548 isolate->counters()->runtime_call_stats()->Reset();
549 if (args[0]->IsString()) 549 if (args[0]->IsString())
550 std::fclose(f); 550 std::fclose(f);
551 else 551 else
552 std::fflush(f); 552 std::fflush(f);
553 return isolate->heap()->undefined_value(); 553 return isolate->heap()->undefined_value();
554 } 554 }
555 } 555 }
556 556
557 RUNTIME_FUNCTION(Runtime_EnqueuePromiseResolveThenableJob) {
558 HandleScope scope(isolate);
559 DCHECK(args.length() == 6);
560 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, resolution, 0);
561 CONVERT_ARG_HANDLE_CHECKED(JSFunction, then, 1);
562 CONVERT_ARG_HANDLE_CHECKED(JSFunction, resolve, 2);
563 CONVERT_ARG_HANDLE_CHECKED(JSFunction, reject, 3);
564 CONVERT_ARG_HANDLE_CHECKED(Object, before_debug_event, 4);
565 CONVERT_ARG_HANDLE_CHECKED(Object, after_debug_event, 5);
566 Handle<PromiseContainer> container = isolate->factory()->NewPromiseContainer(
567 resolution, then, resolve, reject, before_debug_event, after_debug_event);
568 isolate->EnqueueMicrotask(container);
569 return isolate->heap()->undefined_value();
570 }
571
557 RUNTIME_FUNCTION(Runtime_EnqueueMicrotask) { 572 RUNTIME_FUNCTION(Runtime_EnqueueMicrotask) {
558 HandleScope scope(isolate); 573 HandleScope scope(isolate);
559 DCHECK(args.length() == 1); 574 DCHECK(args.length() == 1);
560 CONVERT_ARG_HANDLE_CHECKED(JSFunction, microtask, 0); 575 CONVERT_ARG_HANDLE_CHECKED(JSFunction, microtask, 0);
561 isolate->EnqueueMicrotask(microtask); 576 isolate->EnqueueMicrotask(microtask);
562 return isolate->heap()->undefined_value(); 577 return isolate->heap()->undefined_value();
563 } 578 }
564 579
565 RUNTIME_FUNCTION(Runtime_RunMicrotasks) { 580 RUNTIME_FUNCTION(Runtime_RunMicrotasks) {
566 HandleScope scope(isolate); 581 HandleScope scope(isolate);
(...skipping 22 matching lines...) Expand all
589 604
590 RUNTIME_FUNCTION(Runtime_Typeof) { 605 RUNTIME_FUNCTION(Runtime_Typeof) {
591 HandleScope scope(isolate); 606 HandleScope scope(isolate);
592 DCHECK_EQ(1, args.length()); 607 DCHECK_EQ(1, args.length());
593 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); 608 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0);
594 return *Object::TypeOf(isolate, object); 609 return *Object::TypeOf(isolate, object);
595 } 610 }
596 611
597 } // namespace internal 612 } // namespace internal
598 } // namespace v8 613 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | test/mjsunit/es6/promise-thenable-proxy.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698