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

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

Issue 2406343002: [promises] Move PromiseReactionJob to c++ (Closed)
Patch Set: fix promisedebugeventscope 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
« no previous file with comments | « 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() == 5);
577 CONVERT_ARG_HANDLE_CHECKED(Object, value, 0);
578 CONVERT_ARG_HANDLE_CHECKED(Object, tasks, 1);
579 CONVERT_ARG_HANDLE_CHECKED(Object, deferred, 2);
580 CONVERT_ARG_HANDLE_CHECKED(Object, before_debug_event, 3);
581 CONVERT_ARG_HANDLE_CHECKED(Object, after_debug_event, 4);
582 Handle<PromiseReactionJobInfo> info =
583 isolate->factory()->NewPromiseReactionJobInfo(
584 value, tasks, deferred, before_debug_event, after_debug_event,
585 isolate->native_context());
586 isolate->EnqueueMicrotask(info);
587 return isolate->heap()->undefined_value();
588 }
589
574 RUNTIME_FUNCTION(Runtime_EnqueuePromiseResolveThenableJob) { 590 RUNTIME_FUNCTION(Runtime_EnqueuePromiseResolveThenableJob) {
575 HandleScope scope(isolate); 591 HandleScope scope(isolate);
576 DCHECK(args.length() == 6); 592 DCHECK(args.length() == 6);
577 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, resolution, 0); 593 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, resolution, 0);
578 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, then, 1); 594 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, then, 1);
579 CONVERT_ARG_HANDLE_CHECKED(JSFunction, resolve, 2); 595 CONVERT_ARG_HANDLE_CHECKED(JSFunction, resolve, 2);
580 CONVERT_ARG_HANDLE_CHECKED(JSFunction, reject, 3); 596 CONVERT_ARG_HANDLE_CHECKED(JSFunction, reject, 3);
581 CONVERT_ARG_HANDLE_CHECKED(Object, before_debug_event, 4); 597 CONVERT_ARG_HANDLE_CHECKED(Object, before_debug_event, 4);
582 CONVERT_ARG_HANDLE_CHECKED(Object, after_debug_event, 5); 598 CONVERT_ARG_HANDLE_CHECKED(Object, after_debug_event, 5);
583 Handle<PromiseContainer> container = isolate->factory()->NewPromiseContainer( 599 Handle<PromiseContainer> container = isolate->factory()->NewPromiseContainer(
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 637
622 RUNTIME_FUNCTION(Runtime_Typeof) { 638 RUNTIME_FUNCTION(Runtime_Typeof) {
623 HandleScope scope(isolate); 639 HandleScope scope(isolate);
624 DCHECK_EQ(1, args.length()); 640 DCHECK_EQ(1, args.length());
625 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); 641 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0);
626 return *Object::TypeOf(isolate, object); 642 return *Object::TypeOf(isolate, object);
627 } 643 }
628 644
629 } // namespace internal 645 } // namespace internal
630 } // namespace v8 646 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698