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

Side by Side Diff: src/factory.cc

Issue 2415023002: [promises] Move async debug event creation to c++ (Closed)
Patch Set: rebase 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/factory.h ('k') | src/heap-symbols.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/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after
928 Handle<Struct> Factory::NewStruct(InstanceType type) { 928 Handle<Struct> Factory::NewStruct(InstanceType type) {
929 CALL_HEAP_FUNCTION( 929 CALL_HEAP_FUNCTION(
930 isolate(), 930 isolate(),
931 isolate()->heap()->AllocateStruct(type), 931 isolate()->heap()->AllocateStruct(type),
932 Struct); 932 Struct);
933 } 933 }
934 934
935 Handle<PromiseResolveThenableJobInfo> Factory::NewPromiseResolveThenableJobInfo( 935 Handle<PromiseResolveThenableJobInfo> Factory::NewPromiseResolveThenableJobInfo(
936 Handle<JSReceiver> thenable, Handle<JSReceiver> then, 936 Handle<JSReceiver> thenable, Handle<JSReceiver> then,
937 Handle<JSFunction> resolve, Handle<JSFunction> reject, 937 Handle<JSFunction> resolve, Handle<JSFunction> reject,
938 Handle<Object> before_debug_event, Handle<Object> after_debug_event) { 938 Handle<Object> debug_id, Handle<Object> debug_name) {
939 Handle<PromiseResolveThenableJobInfo> result = 939 Handle<PromiseResolveThenableJobInfo> result =
940 Handle<PromiseResolveThenableJobInfo>::cast( 940 Handle<PromiseResolveThenableJobInfo>::cast(
941 NewStruct(PROMISE_RESOLVE_THENABLE_JOB_INFO_TYPE)); 941 NewStruct(PROMISE_RESOLVE_THENABLE_JOB_INFO_TYPE));
942 result->set_thenable(*thenable); 942 result->set_thenable(*thenable);
943 result->set_then(*then); 943 result->set_then(*then);
944 result->set_resolve(*resolve); 944 result->set_resolve(*resolve);
945 result->set_reject(*reject); 945 result->set_reject(*reject);
946 result->set_before_debug_event(*before_debug_event); 946 result->set_debug_id(*debug_id);
947 result->set_after_debug_event(*after_debug_event); 947 result->set_debug_name(*debug_name);
948 return result; 948 return result;
949 } 949 }
950 950
951 Handle<PromiseReactionJobInfo> Factory::NewPromiseReactionJobInfo( 951 Handle<PromiseReactionJobInfo> Factory::NewPromiseReactionJobInfo(
952 Handle<Object> value, Handle<Object> tasks, Handle<Object> deferred, 952 Handle<Object> value, Handle<Object> tasks, Handle<Object> deferred,
953 Handle<Object> before_debug_event, Handle<Object> after_debug_event, 953 Handle<Object> debug_id, Handle<Object> debug_name,
954 Handle<Context> context) { 954 Handle<Context> context) {
955 Handle<PromiseReactionJobInfo> result = Handle<PromiseReactionJobInfo>::cast( 955 Handle<PromiseReactionJobInfo> result = Handle<PromiseReactionJobInfo>::cast(
956 NewStruct(PROMISE_REACTION_JOB_INFO_TYPE)); 956 NewStruct(PROMISE_REACTION_JOB_INFO_TYPE));
957 result->set_value(*value); 957 result->set_value(*value);
958 result->set_tasks(*tasks); 958 result->set_tasks(*tasks);
959 result->set_deferred(*deferred); 959 result->set_deferred(*deferred);
960 result->set_before_debug_event(*before_debug_event); 960 result->set_debug_id(*debug_id);
961 result->set_after_debug_event(*after_debug_event); 961 result->set_debug_name(*debug_name);
962 result->set_context(*context); 962 result->set_context(*context);
963 return result; 963 return result;
964 } 964 }
965 965
966 Handle<AliasedArgumentsEntry> Factory::NewAliasedArgumentsEntry( 966 Handle<AliasedArgumentsEntry> Factory::NewAliasedArgumentsEntry(
967 int aliased_context_slot) { 967 int aliased_context_slot) {
968 Handle<AliasedArgumentsEntry> entry = Handle<AliasedArgumentsEntry>::cast( 968 Handle<AliasedArgumentsEntry> entry = Handle<AliasedArgumentsEntry>::cast(
969 NewStruct(ALIASED_ARGUMENTS_ENTRY_TYPE)); 969 NewStruct(ALIASED_ARGUMENTS_ENTRY_TYPE));
970 entry->set_aliased_context_slot(aliased_context_slot); 970 entry->set_aliased_context_slot(aliased_context_slot);
971 return entry; 971 return entry;
(...skipping 1697 matching lines...) Expand 10 before | Expand all | Expand 10 after
2669 Handle<JSFixedArrayIterator>::cast(NewJSObjectFromMap(map)); 2669 Handle<JSFixedArrayIterator>::cast(NewJSObjectFromMap(map));
2670 iterator->set_initial_next(*next); 2670 iterator->set_initial_next(*next);
2671 iterator->set_array(*array); 2671 iterator->set_array(*array);
2672 iterator->set_index(0); 2672 iterator->set_index(0);
2673 iterator->InObjectPropertyAtPut(JSFixedArrayIterator::kNextIndex, *next); 2673 iterator->InObjectPropertyAtPut(JSFixedArrayIterator::kNextIndex, *next);
2674 return iterator; 2674 return iterator;
2675 } 2675 }
2676 2676
2677 } // namespace internal 2677 } // namespace internal
2678 } // namespace v8 2678 } // namespace v8
OLDNEW
« no previous file with comments | « src/factory.h ('k') | src/heap-symbols.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698