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/compiler/js-create-lowering.h" | 5 #include "src/compiler/js-create-lowering.h" |
6 | 6 |
7 #include "src/allocation-site-scopes.h" | 7 #include "src/allocation-site-scopes.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/compilation-dependencies.h" | 9 #include "src/compilation-dependencies.h" |
10 #include "src/compiler/access-builder.h" | 10 #include "src/compiler/access-builder.h" |
(...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1006 PretenureFlag pretenure) { | 1006 PretenureFlag pretenure) { |
1007 DCHECK_LE(1, capacity); | 1007 DCHECK_LE(1, capacity); |
1008 DCHECK_LE(capacity, JSArray::kInitialMaxFastElementArray); | 1008 DCHECK_LE(capacity, JSArray::kInitialMaxFastElementArray); |
1009 | 1009 |
1010 Handle<Map> elements_map = IsFastDoubleElementsKind(elements_kind) | 1010 Handle<Map> elements_map = IsFastDoubleElementsKind(elements_kind) |
1011 ? factory()->fixed_double_array_map() | 1011 ? factory()->fixed_double_array_map() |
1012 : factory()->fixed_array_map(); | 1012 : factory()->fixed_array_map(); |
1013 ElementAccess access = IsFastDoubleElementsKind(elements_kind) | 1013 ElementAccess access = IsFastDoubleElementsKind(elements_kind) |
1014 ? AccessBuilder::ForFixedDoubleArrayElement() | 1014 ? AccessBuilder::ForFixedDoubleArrayElement() |
1015 : AccessBuilder::ForFixedArrayElement(); | 1015 : AccessBuilder::ForFixedArrayElement(); |
1016 Node* value = | 1016 Node* value = IsFastDoubleElementsKind(elements_kind) |
1017 IsFastDoubleElementsKind(elements_kind) | 1017 ? jsgraph()->Float64Constant(kHoleNanDouble) |
1018 ? jsgraph()->Float64Constant(bit_cast<double>(kHoleNanInt64)) | 1018 : jsgraph()->TheHoleConstant(); |
1019 : jsgraph()->TheHoleConstant(); | |
1020 | 1019 |
1021 // Actually allocate the backing store. | 1020 // Actually allocate the backing store. |
1022 AllocationBuilder a(jsgraph(), effect, control); | 1021 AllocationBuilder a(jsgraph(), effect, control); |
1023 a.AllocateArray(capacity, elements_map, pretenure); | 1022 a.AllocateArray(capacity, elements_map, pretenure); |
1024 for (int i = 0; i < capacity; ++i) { | 1023 for (int i = 0; i < capacity; ++i) { |
1025 Node* index = jsgraph()->Constant(i); | 1024 Node* index = jsgraph()->Constant(i); |
1026 a.Store(access, index, value); | 1025 a.Store(access, index, value); |
1027 } | 1026 } |
1028 return a.Finish(); | 1027 return a.Finish(); |
1029 } | 1028 } |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1262 return jsgraph()->simplified(); | 1261 return jsgraph()->simplified(); |
1263 } | 1262 } |
1264 | 1263 |
1265 MachineOperatorBuilder* JSCreateLowering::machine() const { | 1264 MachineOperatorBuilder* JSCreateLowering::machine() const { |
1266 return jsgraph()->machine(); | 1265 return jsgraph()->machine(); |
1267 } | 1266 } |
1268 | 1267 |
1269 } // namespace compiler | 1268 } // namespace compiler |
1270 } // namespace internal | 1269 } // namespace internal |
1271 } // namespace v8 | 1270 } // namespace v8 |
OLD | NEW |