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

Side by Side Diff: src/factory.cc

Issue 2314903004: [promises] Move PromiseResolveThenableJob to c++ (Closed)
Patch Set: rebase Created 4 years, 3 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/isolate.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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 HeapObject); 85 HeapObject);
86 } 86 }
87 87
88 88
89 Handle<Box> Factory::NewBox(Handle<Object> value) { 89 Handle<Box> Factory::NewBox(Handle<Object> value) {
90 Handle<Box> result = Handle<Box>::cast(NewStruct(BOX_TYPE)); 90 Handle<Box> result = Handle<Box>::cast(NewStruct(BOX_TYPE));
91 result->set_value(*value); 91 result->set_value(*value);
92 return result; 92 return result;
93 } 93 }
94 94
95
96 Handle<PrototypeInfo> Factory::NewPrototypeInfo() { 95 Handle<PrototypeInfo> Factory::NewPrototypeInfo() {
97 Handle<PrototypeInfo> result = 96 Handle<PrototypeInfo> result =
98 Handle<PrototypeInfo>::cast(NewStruct(PROTOTYPE_INFO_TYPE)); 97 Handle<PrototypeInfo>::cast(NewStruct(PROTOTYPE_INFO_TYPE));
99 result->set_prototype_users(WeakFixedArray::Empty()); 98 result->set_prototype_users(WeakFixedArray::Empty());
100 result->set_registry_slot(PrototypeInfo::UNREGISTERED); 99 result->set_registry_slot(PrototypeInfo::UNREGISTERED);
101 result->set_validity_cell(Smi::FromInt(0)); 100 result->set_validity_cell(Smi::FromInt(0));
102 result->set_bit_field(0); 101 result->set_bit_field(0);
103 return result; 102 return result;
104 } 103 }
105 104
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 } 891 }
893 892
894 893
895 Handle<Struct> Factory::NewStruct(InstanceType type) { 894 Handle<Struct> Factory::NewStruct(InstanceType type) {
896 CALL_HEAP_FUNCTION( 895 CALL_HEAP_FUNCTION(
897 isolate(), 896 isolate(),
898 isolate()->heap()->AllocateStruct(type), 897 isolate()->heap()->AllocateStruct(type),
899 Struct); 898 Struct);
900 } 899 }
901 900
901 Handle<PromiseContainer> Factory::NewPromiseContainer(
902 Handle<JSReceiver> thenable, Handle<JSFunction> then,
903 Handle<JSFunction> resolve, Handle<JSFunction> reject,
904 Handle<Object> before_debug_event, Handle<Object> after_debug_event) {
905 Handle<PromiseContainer> result =
906 Handle<PromiseContainer>::cast(NewStruct(PROMISE_CONTAINER_TYPE));
907 result->set_thenable(*thenable);
908 result->set_then(*then);
909 result->set_resolve(*resolve);
910 result->set_reject(*reject);
911 result->set_before_debug_event(*before_debug_event);
912 result->set_after_debug_event(*after_debug_event);
913 return result;
914 }
902 915
903 Handle<AliasedArgumentsEntry> Factory::NewAliasedArgumentsEntry( 916 Handle<AliasedArgumentsEntry> Factory::NewAliasedArgumentsEntry(
904 int aliased_context_slot) { 917 int aliased_context_slot) {
905 Handle<AliasedArgumentsEntry> entry = Handle<AliasedArgumentsEntry>::cast( 918 Handle<AliasedArgumentsEntry> entry = Handle<AliasedArgumentsEntry>::cast(
906 NewStruct(ALIASED_ARGUMENTS_ENTRY_TYPE)); 919 NewStruct(ALIASED_ARGUMENTS_ENTRY_TYPE));
907 entry->set_aliased_context_slot(aliased_context_slot); 920 entry->set_aliased_context_slot(aliased_context_slot);
908 return entry; 921 return entry;
909 } 922 }
910 923
911 924
(...skipping 1639 matching lines...) Expand 10 before | Expand all | Expand 10 after
2551 Handle<AccessorInfo> prototype = 2564 Handle<AccessorInfo> prototype =
2552 Accessors::FunctionPrototypeInfo(isolate(), attribs); 2565 Accessors::FunctionPrototypeInfo(isolate(), attribs);
2553 AccessorConstantDescriptor d(Handle<Name>(Name::cast(prototype->name())), 2566 AccessorConstantDescriptor d(Handle<Name>(Name::cast(prototype->name())),
2554 prototype, attribs); 2567 prototype, attribs);
2555 map->AppendDescriptor(&d); 2568 map->AppendDescriptor(&d);
2556 } 2569 }
2557 } 2570 }
2558 2571
2559 } // namespace internal 2572 } // namespace internal
2560 } // namespace v8 2573 } // namespace v8
OLDNEW
« no previous file with comments | « src/factory.h ('k') | src/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698