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

Side by Side Diff: src/factory.cc

Issue 2459283004: [promises] Move CreateResolvingFunctions to c++ (Closed)
Patch Set: Remove header Created 4 years, 1 month 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 944 matching lines...) Expand 10 before | Expand all | Expand 10 after
955 Handle<FixedArray> array = NewFixedArray(scope_info->ContextLength()); 955 Handle<FixedArray> array = NewFixedArray(scope_info->ContextLength());
956 array->set_map_no_write_barrier(*block_context_map()); 956 array->set_map_no_write_barrier(*block_context_map());
957 Handle<Context> context = Handle<Context>::cast(array); 957 Handle<Context> context = Handle<Context>::cast(array);
958 context->set_closure(*function); 958 context->set_closure(*function);
959 context->set_previous(*previous); 959 context->set_previous(*previous);
960 context->set_extension(*scope_info); 960 context->set_extension(*scope_info);
961 context->set_native_context(previous->native_context()); 961 context->set_native_context(previous->native_context());
962 return context; 962 return context;
963 } 963 }
964 964
965 Handle<Context> Factory::NewPromiseResolvingFunctionContext() {
966 Handle<FixedArray> array = NewFixedArray(Context::MIN_CONTEXT_SLOTS + 3);
adamk 2016/11/09 00:06:23 Please pass in this 3; I think we should be able t
gsathya 2016/11/09 00:57:33 Done.
967 array->set_map_no_write_barrier(*function_context_map());
968 Handle<Context> context = Handle<Context>::cast(array);
969 context->set_extension(*the_hole_value());
970 return context;
971 }
965 972
966 Handle<Struct> Factory::NewStruct(InstanceType type) { 973 Handle<Struct> Factory::NewStruct(InstanceType type) {
967 CALL_HEAP_FUNCTION( 974 CALL_HEAP_FUNCTION(
968 isolate(), 975 isolate(),
969 isolate()->heap()->AllocateStruct(type), 976 isolate()->heap()->AllocateStruct(type),
970 Struct); 977 Struct);
971 } 978 }
972 979
973 Handle<PromiseResolveThenableJobInfo> Factory::NewPromiseResolveThenableJobInfo( 980 Handle<PromiseResolveThenableJobInfo> Factory::NewPromiseResolveThenableJobInfo(
974 Handle<JSReceiver> thenable, Handle<JSReceiver> then, 981 Handle<JSReceiver> thenable, Handle<JSReceiver> then,
(...skipping 1732 matching lines...) Expand 10 before | Expand all | Expand 10 after
2707 Handle<JSFixedArrayIterator>::cast(NewJSObjectFromMap(map)); 2714 Handle<JSFixedArrayIterator>::cast(NewJSObjectFromMap(map));
2708 iterator->set_initial_next(*next); 2715 iterator->set_initial_next(*next);
2709 iterator->set_array(*array); 2716 iterator->set_array(*array);
2710 iterator->set_index(0); 2717 iterator->set_index(0);
2711 iterator->InObjectPropertyAtPut(JSFixedArrayIterator::kNextIndex, *next); 2718 iterator->InObjectPropertyAtPut(JSFixedArrayIterator::kNextIndex, *next);
2712 return iterator; 2719 return iterator;
2713 } 2720 }
2714 2721
2715 } // namespace internal 2722 } // namespace internal
2716 } // namespace v8 2723 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698