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

Side by Side Diff: src/factory.cc

Issue 2611083002: [promises] Add AllocatePromiseResolveThenableJobInfo to TF (Closed)
Patch Set: rebase Created 3 years, 11 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/factory.h ('k') | src/promise-utils.h » ('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/factory.h" 5 #include "src/factory.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/allocation-site-scopes.h" 8 #include "src/allocation-site-scopes.h"
9 #include "src/ast/ast.h" 9 #include "src/ast/ast.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after
1004 return context; 1004 return context;
1005 } 1005 }
1006 1006
1007 Handle<Struct> Factory::NewStruct(InstanceType type) { 1007 Handle<Struct> Factory::NewStruct(InstanceType type) {
1008 CALL_HEAP_FUNCTION( 1008 CALL_HEAP_FUNCTION(
1009 isolate(), 1009 isolate(),
1010 isolate()->heap()->AllocateStruct(type), 1010 isolate()->heap()->AllocateStruct(type),
1011 Struct); 1011 Struct);
1012 } 1012 }
1013 1013
1014 Handle<PromiseResolveThenableJobInfo> Factory::NewPromiseResolveThenableJobInfo(
1015 Handle<JSReceiver> thenable, Handle<JSReceiver> then,
1016 Handle<JSFunction> resolve, Handle<JSFunction> reject, int debug_id,
1017 int debug_name, Handle<Context> context) {
1018 Handle<PromiseResolveThenableJobInfo> result =
1019 Handle<PromiseResolveThenableJobInfo>::cast(
1020 NewStruct(PROMISE_RESOLVE_THENABLE_JOB_INFO_TYPE));
1021 result->set_thenable(*thenable);
1022 result->set_then(*then);
1023 result->set_resolve(*resolve);
1024 result->set_reject(*reject);
1025 result->set_debug_id(debug_id);
1026 result->set_debug_name(debug_name);
1027 result->set_context(*context);
1028 return result;
1029 }
1030
1031 Handle<PromiseReactionJobInfo> Factory::NewPromiseReactionJobInfo( 1014 Handle<PromiseReactionJobInfo> Factory::NewPromiseReactionJobInfo(
1032 Handle<JSPromise> promise, Handle<Object> value, Handle<Object> tasks, 1015 Handle<JSPromise> promise, Handle<Object> value, Handle<Object> tasks,
1033 Handle<Object> deferred_promise, Handle<Object> deferred_on_resolve, 1016 Handle<Object> deferred_promise, Handle<Object> deferred_on_resolve,
1034 Handle<Object> deferred_on_reject, Handle<Context> context) { 1017 Handle<Object> deferred_on_reject, Handle<Context> context) {
1035 Handle<PromiseReactionJobInfo> result = Handle<PromiseReactionJobInfo>::cast( 1018 Handle<PromiseReactionJobInfo> result = Handle<PromiseReactionJobInfo>::cast(
1036 NewStruct(PROMISE_REACTION_JOB_INFO_TYPE)); 1019 NewStruct(PROMISE_REACTION_JOB_INFO_TYPE));
1037 result->set_promise(*promise); 1020 result->set_promise(*promise);
1038 result->set_value(*value); 1021 result->set_value(*value);
1039 result->set_tasks(*tasks); 1022 result->set_tasks(*tasks);
1040 result->set_deferred_promise(*deferred_promise); 1023 result->set_deferred_promise(*deferred_promise);
(...skipping 1741 matching lines...) Expand 10 before | Expand all | Expand 10 after
2782 Handle<AccessorInfo> prototype = 2765 Handle<AccessorInfo> prototype =
2783 Accessors::FunctionPrototypeInfo(isolate(), rw_attribs); 2766 Accessors::FunctionPrototypeInfo(isolate(), rw_attribs);
2784 Descriptor d = Descriptor::AccessorConstant( 2767 Descriptor d = Descriptor::AccessorConstant(
2785 Handle<Name>(Name::cast(prototype->name())), prototype, rw_attribs); 2768 Handle<Name>(Name::cast(prototype->name())), prototype, rw_attribs);
2786 map->AppendDescriptor(&d); 2769 map->AppendDescriptor(&d);
2787 } 2770 }
2788 } 2771 }
2789 2772
2790 } // namespace internal 2773 } // namespace internal
2791 } // namespace v8 2774 } // namespace v8
OLDNEW
« no previous file with comments | « src/factory.h ('k') | src/promise-utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698