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

Side by Side Diff: src/factory.cc

Issue 2415023002: [promises] Move async debug event creation to c++ (Closed)
Patch Set: use consts 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
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/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after
918 918
919 Handle<Struct> Factory::NewStruct(InstanceType type) { 919 Handle<Struct> Factory::NewStruct(InstanceType type) {
920 CALL_HEAP_FUNCTION( 920 CALL_HEAP_FUNCTION(
921 isolate(), 921 isolate(),
922 isolate()->heap()->AllocateStruct(type), 922 isolate()->heap()->AllocateStruct(type),
923 Struct); 923 Struct);
924 } 924 }
925 925
926 Handle<PromiseResolveThenableJobInfo> Factory::NewPromiseResolveThenableJobInfo( 926 Handle<PromiseResolveThenableJobInfo> Factory::NewPromiseResolveThenableJobInfo(
927 Handle<JSReceiver> thenable, Handle<JSReceiver> then, 927 Handle<JSReceiver> thenable, Handle<JSReceiver> then,
928 Handle<JSFunction> resolve, Handle<JSFunction> reject, 928 Handle<JSFunction> resolve, Handle<JSFunction> reject, Handle<Object> id,
929 Handle<Object> before_debug_event, Handle<Object> after_debug_event) { 929 Handle<Object> name) {
930 Handle<PromiseResolveThenableJobInfo> result = 930 Handle<PromiseResolveThenableJobInfo> result =
931 Handle<PromiseResolveThenableJobInfo>::cast( 931 Handle<PromiseResolveThenableJobInfo>::cast(
932 NewStruct(PROMISE_RESOLVE_THENABLE_JOB_INFO_TYPE)); 932 NewStruct(PROMISE_RESOLVE_THENABLE_JOB_INFO_TYPE));
933 result->set_thenable(*thenable); 933 result->set_thenable(*thenable);
934 result->set_then(*then); 934 result->set_then(*then);
935 result->set_resolve(*resolve); 935 result->set_resolve(*resolve);
936 result->set_reject(*reject); 936 result->set_reject(*reject);
937 result->set_before_debug_event(*before_debug_event); 937 result->set_id(*id);
938 result->set_after_debug_event(*after_debug_event); 938 result->set_name(*name);
939 return result; 939 return result;
940 } 940 }
941 941
942 Handle<PromiseReactionJobInfo> Factory::NewPromiseReactionJobInfo( 942 Handle<PromiseReactionJobInfo> Factory::NewPromiseReactionJobInfo(
943 Handle<Object> value, Handle<Object> tasks, Handle<Object> deferred, 943 Handle<Object> value, Handle<Object> tasks, Handle<Object> deferred,
944 Handle<Object> before_debug_event, Handle<Object> after_debug_event, 944 Handle<Object> id, Handle<Object> name, Handle<Context> context) {
945 Handle<Context> context) {
946 Handle<PromiseReactionJobInfo> result = Handle<PromiseReactionJobInfo>::cast( 945 Handle<PromiseReactionJobInfo> result = Handle<PromiseReactionJobInfo>::cast(
947 NewStruct(PROMISE_REACTION_JOB_INFO_TYPE)); 946 NewStruct(PROMISE_REACTION_JOB_INFO_TYPE));
948 result->set_value(*value); 947 result->set_value(*value);
949 result->set_tasks(*tasks); 948 result->set_tasks(*tasks);
950 result->set_deferred(*deferred); 949 result->set_deferred(*deferred);
951 result->set_before_debug_event(*before_debug_event); 950 result->set_id(*id);
952 result->set_after_debug_event(*after_debug_event); 951 result->set_name(*name);
953 result->set_context(*context); 952 result->set_context(*context);
954 return result; 953 return result;
955 } 954 }
956 955
957 Handle<AliasedArgumentsEntry> Factory::NewAliasedArgumentsEntry( 956 Handle<AliasedArgumentsEntry> Factory::NewAliasedArgumentsEntry(
958 int aliased_context_slot) { 957 int aliased_context_slot) {
959 Handle<AliasedArgumentsEntry> entry = Handle<AliasedArgumentsEntry>::cast( 958 Handle<AliasedArgumentsEntry> entry = Handle<AliasedArgumentsEntry>::cast(
960 NewStruct(ALIASED_ARGUMENTS_ENTRY_TYPE)); 959 NewStruct(ALIASED_ARGUMENTS_ENTRY_TYPE));
961 entry->set_aliased_context_slot(aliased_context_slot); 960 entry->set_aliased_context_slot(aliased_context_slot);
962 return entry; 961 return entry;
(...skipping 1657 matching lines...) Expand 10 before | Expand all | Expand 10 after
2620 Handle<AccessorInfo> prototype = 2619 Handle<AccessorInfo> prototype =
2621 Accessors::FunctionPrototypeInfo(isolate(), attribs); 2620 Accessors::FunctionPrototypeInfo(isolate(), attribs);
2622 AccessorConstantDescriptor d(Handle<Name>(Name::cast(prototype->name())), 2621 AccessorConstantDescriptor d(Handle<Name>(Name::cast(prototype->name())),
2623 prototype, attribs); 2622 prototype, attribs);
2624 map->AppendDescriptor(&d); 2623 map->AppendDescriptor(&d);
2625 } 2624 }
2626 } 2625 }
2627 2626
2628 } // namespace internal 2627 } // namespace internal
2629 } // namespace v8 2628 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698