OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/builtins/builtins-constructor.h" | 5 #include "src/builtins/builtins-constructor.h" |
6 #include "src/ast/ast.h" | 6 #include "src/ast/ast.h" |
7 #include "src/builtins/builtins-utils.h" | 7 #include "src/builtins/builtins-utils.h" |
8 #include "src/builtins/builtins.h" | 8 #include "src/builtins/builtins.h" |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/code-stub-assembler.h" | 10 #include "src/code-stub-assembler.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 // Get the function map in the current native context and set that | 114 // Get the function map in the current native context and set that |
115 // as the map of the allocated object. | 115 // as the map of the allocated object. |
116 Node* native_context = LoadNativeContext(context); | 116 Node* native_context = LoadNativeContext(context); |
117 Node* map_slot_value = | 117 Node* map_slot_value = |
118 LoadFixedArrayElement(native_context, map_index.value()); | 118 LoadFixedArrayElement(native_context, map_index.value()); |
119 StoreMapNoWriteBarrier(result, map_slot_value); | 119 StoreMapNoWriteBarrier(result, map_slot_value); |
120 | 120 |
121 // Initialize the rest of the function. | 121 // Initialize the rest of the function. |
122 Node* empty_fixed_array = HeapConstant(factory->empty_fixed_array()); | 122 Node* empty_fixed_array = HeapConstant(factory->empty_fixed_array()); |
| 123 Node* empty_literals_array = HeapConstant(factory->empty_literals_array()); |
123 StoreObjectFieldNoWriteBarrier(result, JSObject::kPropertiesOffset, | 124 StoreObjectFieldNoWriteBarrier(result, JSObject::kPropertiesOffset, |
124 empty_fixed_array); | 125 empty_fixed_array); |
125 StoreObjectFieldNoWriteBarrier(result, JSObject::kElementsOffset, | 126 StoreObjectFieldNoWriteBarrier(result, JSObject::kElementsOffset, |
126 empty_fixed_array); | 127 empty_fixed_array); |
127 Node* literals_array = LoadFixedArrayElement( | |
128 feedback_vector, slot, 0, CodeStubAssembler::SMI_PARAMETERS); | |
129 StoreObjectFieldNoWriteBarrier(result, JSFunction::kLiteralsOffset, | 128 StoreObjectFieldNoWriteBarrier(result, JSFunction::kLiteralsOffset, |
130 literals_array); | 129 empty_literals_array); |
131 StoreObjectFieldNoWriteBarrier( | 130 StoreObjectFieldNoWriteBarrier( |
132 result, JSFunction::kPrototypeOrInitialMapOffset, TheHoleConstant()); | 131 result, JSFunction::kPrototypeOrInitialMapOffset, TheHoleConstant()); |
133 StoreObjectFieldNoWriteBarrier(result, JSFunction::kSharedFunctionInfoOffset, | 132 StoreObjectFieldNoWriteBarrier(result, JSFunction::kSharedFunctionInfoOffset, |
134 shared_info); | 133 shared_info); |
135 StoreObjectFieldNoWriteBarrier(result, JSFunction::kContextOffset, context); | 134 StoreObjectFieldNoWriteBarrier(result, JSFunction::kContextOffset, context); |
136 Handle<Code> lazy_builtin_handle( | 135 Handle<Code> lazy_builtin_handle( |
137 isolate->builtins()->builtin(Builtins::kCompileLazy)); | 136 isolate->builtins()->builtin(Builtins::kCompileLazy)); |
138 Node* lazy_builtin = HeapConstant(lazy_builtin_handle); | 137 Node* lazy_builtin = HeapConstant(lazy_builtin_handle); |
139 Node* lazy_builtin_entry = | 138 Node* lazy_builtin_entry = |
140 IntPtrAdd(BitcastTaggedToWord(lazy_builtin), | 139 IntPtrAdd(BitcastTaggedToWord(lazy_builtin), |
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 case 6: | 763 case 6: |
765 return FastCloneShallowObject6(); | 764 return FastCloneShallowObject6(); |
766 default: | 765 default: |
767 UNREACHABLE(); | 766 UNREACHABLE(); |
768 } | 767 } |
769 return Handle<Code>::null(); | 768 return Handle<Code>::null(); |
770 } | 769 } |
771 | 770 |
772 } // namespace internal | 771 } // namespace internal |
773 } // namespace v8 | 772 } // namespace v8 |
OLD | NEW |