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

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

Issue 2406343002: [promises] Move PromiseReactionJob to c++ (Closed)
Patch Set: remove ; Created 4 years, 2 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
« src/objects.h ('K') | « src/runtime/runtime.h ('k') | no next file » | 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 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 isolate->counters()->runtime_call_stats()->Print(stats_stream); 564 isolate->counters()->runtime_call_stats()->Print(stats_stream);
565 isolate->counters()->runtime_call_stats()->Reset(); 565 isolate->counters()->runtime_call_stats()->Reset();
566 if (args[0]->IsString()) 566 if (args[0]->IsString())
567 std::fclose(f); 567 std::fclose(f);
568 else 568 else
569 std::fflush(f); 569 std::fflush(f);
570 return isolate->heap()->undefined_value(); 570 return isolate->heap()->undefined_value();
571 } 571 }
572 } 572 }
573 573
574 RUNTIME_FUNCTION(Runtime_EnqueuePromiseReactionJob) {
575 HandleScope scope(isolate);
576 DCHECK(args.length() == 6);
577 CONVERT_ARG_HANDLE_CHECKED(Object, value, 0);
578 CONVERT_ARG_HANDLE_CHECKED(Object, tasks, 1);
579 CONVERT_ARG_HANDLE_CHECKED(Object, deferreds, 2);
580 CONVERT_ARG_HANDLE_CHECKED(Object, before_debug_event, 3);
581 CONVERT_ARG_HANDLE_CHECKED(Object, after_debug_event, 4);
582 CONVERT_ARG_HANDLE_CHECKED(JSFunction, reaction_context, 5);
583 Handle<PromiseHandleInfo> promise_handle_info =
584 isolate->factory()->NewPromiseHandleInfo(
585 value, tasks, deferreds, before_debug_event, after_debug_event,
586 reaction_context);
adamk 2016/10/11 17:56:41 Rather than creating a function, I think you shoul
587 isolate->EnqueueMicrotask(promise_handle_info);
588 return isolate->heap()->undefined_value();
589 }
590
574 RUNTIME_FUNCTION(Runtime_EnqueuePromiseResolveThenableJob) { 591 RUNTIME_FUNCTION(Runtime_EnqueuePromiseResolveThenableJob) {
575 HandleScope scope(isolate); 592 HandleScope scope(isolate);
576 DCHECK(args.length() == 6); 593 DCHECK(args.length() == 6);
577 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, resolution, 0); 594 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, resolution, 0);
578 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, then, 1); 595 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, then, 1);
579 CONVERT_ARG_HANDLE_CHECKED(JSFunction, resolve, 2); 596 CONVERT_ARG_HANDLE_CHECKED(JSFunction, resolve, 2);
580 CONVERT_ARG_HANDLE_CHECKED(JSFunction, reject, 3); 597 CONVERT_ARG_HANDLE_CHECKED(JSFunction, reject, 3);
581 CONVERT_ARG_HANDLE_CHECKED(Object, before_debug_event, 4); 598 CONVERT_ARG_HANDLE_CHECKED(Object, before_debug_event, 4);
582 CONVERT_ARG_HANDLE_CHECKED(Object, after_debug_event, 5); 599 CONVERT_ARG_HANDLE_CHECKED(Object, after_debug_event, 5);
583 Handle<PromiseContainer> container = isolate->factory()->NewPromiseContainer( 600 Handle<PromiseContainer> container = isolate->factory()->NewPromiseContainer(
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 638
622 RUNTIME_FUNCTION(Runtime_Typeof) { 639 RUNTIME_FUNCTION(Runtime_Typeof) {
623 HandleScope scope(isolate); 640 HandleScope scope(isolate);
624 DCHECK_EQ(1, args.length()); 641 DCHECK_EQ(1, args.length());
625 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); 642 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0);
626 return *Object::TypeOf(isolate, object); 643 return *Object::TypeOf(isolate, object);
627 } 644 }
628 645
629 } // namespace internal 646 } // namespace internal
630 } // namespace v8 647 } // namespace v8
OLDNEW
« src/objects.h ('K') | « src/runtime/runtime.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698