OLD | NEW |
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 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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( | 1014 Handle<PromiseResolveThenableJobInfo> Factory::NewPromiseResolveThenableJobInfo( |
1015 Handle<JSReceiver> thenable, Handle<JSReceiver> then, | 1015 Handle<JSReceiver> thenable, Handle<JSReceiver> then, |
1016 Handle<JSFunction> resolve, Handle<JSFunction> reject, | 1016 Handle<JSFunction> resolve, Handle<JSFunction> reject, int debug_id, |
1017 Handle<Object> debug_id, Handle<Object> debug_name, | 1017 int debug_name, Handle<Context> context) { |
1018 Handle<Context> context) { | |
1019 Handle<PromiseResolveThenableJobInfo> result = | 1018 Handle<PromiseResolveThenableJobInfo> result = |
1020 Handle<PromiseResolveThenableJobInfo>::cast( | 1019 Handle<PromiseResolveThenableJobInfo>::cast( |
1021 NewStruct(PROMISE_RESOLVE_THENABLE_JOB_INFO_TYPE)); | 1020 NewStruct(PROMISE_RESOLVE_THENABLE_JOB_INFO_TYPE)); |
1022 result->set_thenable(*thenable); | 1021 result->set_thenable(*thenable); |
1023 result->set_then(*then); | 1022 result->set_then(*then); |
1024 result->set_resolve(*resolve); | 1023 result->set_resolve(*resolve); |
1025 result->set_reject(*reject); | 1024 result->set_reject(*reject); |
1026 result->set_debug_id(*debug_id); | 1025 result->set_debug_id(debug_id); |
1027 result->set_debug_name(*debug_name); | 1026 result->set_debug_name(debug_name); |
1028 result->set_context(*context); | 1027 result->set_context(*context); |
1029 return result; | 1028 return result; |
1030 } | 1029 } |
1031 | 1030 |
1032 Handle<PromiseReactionJobInfo> Factory::NewPromiseReactionJobInfo( | 1031 Handle<PromiseReactionJobInfo> Factory::NewPromiseReactionJobInfo( |
1033 Handle<JSPromise> promise, Handle<Object> value, Handle<Object> tasks, | 1032 Handle<JSPromise> promise, Handle<Object> value, Handle<Object> tasks, |
1034 Handle<Object> deferred_promise, Handle<Object> deferred_on_resolve, | 1033 Handle<Object> deferred_promise, Handle<Object> deferred_on_resolve, |
1035 Handle<Object> deferred_on_reject, Handle<Context> context) { | 1034 Handle<Object> deferred_on_reject, Handle<Context> context) { |
1036 Handle<PromiseReactionJobInfo> result = Handle<PromiseReactionJobInfo>::cast( | 1035 Handle<PromiseReactionJobInfo> result = Handle<PromiseReactionJobInfo>::cast( |
1037 NewStruct(PROMISE_REACTION_JOB_INFO_TYPE)); | 1036 NewStruct(PROMISE_REACTION_JOB_INFO_TYPE)); |
1038 result->set_promise(*promise); | 1037 result->set_promise(*promise); |
1039 result->set_value(*value); | 1038 result->set_value(*value); |
1040 result->set_tasks(*tasks); | 1039 result->set_tasks(*tasks); |
1041 result->set_deferred_promise(*deferred_promise); | 1040 result->set_deferred_promise(*deferred_promise); |
1042 result->set_deferred_on_resolve(*deferred_on_resolve); | 1041 result->set_deferred_on_resolve(*deferred_on_resolve); |
1043 result->set_deferred_on_reject(*deferred_on_reject); | 1042 result->set_deferred_on_reject(*deferred_on_reject); |
1044 result->set_debug_id(isolate()->heap()->undefined_value()); | 1043 result->set_debug_id(kDebugPromiseFirstID); |
1045 result->set_debug_name(isolate()->heap()->undefined_value()); | 1044 result->set_debug_name(kDebugNotActive); |
1046 result->set_context(*context); | 1045 result->set_context(*context); |
1047 return result; | 1046 return result; |
1048 } | 1047 } |
1049 | 1048 |
1050 Handle<AliasedArgumentsEntry> Factory::NewAliasedArgumentsEntry( | 1049 Handle<AliasedArgumentsEntry> Factory::NewAliasedArgumentsEntry( |
1051 int aliased_context_slot) { | 1050 int aliased_context_slot) { |
1052 Handle<AliasedArgumentsEntry> entry = Handle<AliasedArgumentsEntry>::cast( | 1051 Handle<AliasedArgumentsEntry> entry = Handle<AliasedArgumentsEntry>::cast( |
1053 NewStruct(ALIASED_ARGUMENTS_ENTRY_TYPE)); | 1052 NewStruct(ALIASED_ARGUMENTS_ENTRY_TYPE)); |
1054 entry->set_aliased_context_slot(aliased_context_slot); | 1053 entry->set_aliased_context_slot(aliased_context_slot); |
1055 return entry; | 1054 return entry; |
(...skipping 1727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2783 Handle<AccessorInfo> prototype = | 2782 Handle<AccessorInfo> prototype = |
2784 Accessors::FunctionPrototypeInfo(isolate(), rw_attribs); | 2783 Accessors::FunctionPrototypeInfo(isolate(), rw_attribs); |
2785 Descriptor d = Descriptor::AccessorConstant( | 2784 Descriptor d = Descriptor::AccessorConstant( |
2786 Handle<Name>(Name::cast(prototype->name())), prototype, rw_attribs); | 2785 Handle<Name>(Name::cast(prototype->name())), prototype, rw_attribs); |
2787 map->AppendDescriptor(&d); | 2786 map->AppendDescriptor(&d); |
2788 } | 2787 } |
2789 } | 2788 } |
2790 | 2789 |
2791 } // namespace internal | 2790 } // namespace internal |
2792 } // namespace v8 | 2791 } // namespace v8 |
OLD | NEW |