| 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 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1209 } | 1209 } |
| 1210 | 1210 |
| 1211 // Setup the elements backing store. | 1211 // Setup the elements backing store. |
| 1212 Node* elements = AllocateFastLiteralElements(effect, control, boilerplate, | 1212 Node* elements = AllocateFastLiteralElements(effect, control, boilerplate, |
| 1213 pretenure, site_context); | 1213 pretenure, site_context); |
| 1214 if (elements->op()->EffectOutputCount() > 0) effect = elements; | 1214 if (elements->op()->EffectOutputCount() > 0) effect = elements; |
| 1215 | 1215 |
| 1216 // Actually allocate and initialize the object. | 1216 // Actually allocate and initialize the object. |
| 1217 AllocationBuilder builder(jsgraph(), effect, control); | 1217 AllocationBuilder builder(jsgraph(), effect, control); |
| 1218 builder.Allocate(boilerplate_map->instance_size(), pretenure, | 1218 builder.Allocate(boilerplate_map->instance_size(), pretenure, |
| 1219 Type::OtherObject()); | 1219 Type::For(boilerplate_map)); |
| 1220 builder.Store(AccessBuilder::ForMap(), boilerplate_map); | 1220 builder.Store(AccessBuilder::ForMap(), boilerplate_map); |
| 1221 builder.Store(AccessBuilder::ForJSObjectProperties(), properties); | 1221 builder.Store(AccessBuilder::ForJSObjectProperties(), properties); |
| 1222 builder.Store(AccessBuilder::ForJSObjectElements(), elements); | 1222 builder.Store(AccessBuilder::ForJSObjectElements(), elements); |
| 1223 if (boilerplate_map->IsJSArrayMap()) { | 1223 if (boilerplate_map->IsJSArrayMap()) { |
| 1224 Handle<JSArray> boilerplate_array = Handle<JSArray>::cast(boilerplate); | 1224 Handle<JSArray> boilerplate_array = Handle<JSArray>::cast(boilerplate); |
| 1225 builder.Store( | 1225 builder.Store( |
| 1226 AccessBuilder::ForJSArrayLength(boilerplate_array->GetElementsKind()), | 1226 AccessBuilder::ForJSArrayLength(boilerplate_array->GetElementsKind()), |
| 1227 handle(boilerplate_array->length(), isolate())); | 1227 handle(boilerplate_array->length(), isolate())); |
| 1228 } | 1228 } |
| 1229 for (auto const& inobject_field : inobject_fields) { | 1229 for (auto const& inobject_field : inobject_fields) { |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1345 return jsgraph()->simplified(); | 1345 return jsgraph()->simplified(); |
| 1346 } | 1346 } |
| 1347 | 1347 |
| 1348 MachineOperatorBuilder* JSCreateLowering::machine() const { | 1348 MachineOperatorBuilder* JSCreateLowering::machine() const { |
| 1349 return jsgraph()->machine(); | 1349 return jsgraph()->machine(); |
| 1350 } | 1350 } |
| 1351 | 1351 |
| 1352 } // namespace compiler | 1352 } // namespace compiler |
| 1353 } // namespace internal | 1353 } // namespace internal |
| 1354 } // namespace v8 | 1354 } // namespace v8 |
| OLD | NEW |