| 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 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1047 jsgraph()->HeapConstant(elements), | 1047 jsgraph()->HeapConstant(elements), |
| 1048 jsgraph()->Constant(i), effect, control); | 1048 jsgraph()->Constant(i), effect, control); |
| 1049 } else { | 1049 } else { |
| 1050 elements_values[i] = jsgraph()->Constant(elements->get_scalar(i)); | 1050 elements_values[i] = jsgraph()->Constant(elements->get_scalar(i)); |
| 1051 } | 1051 } |
| 1052 } | 1052 } |
| 1053 } else { | 1053 } else { |
| 1054 Handle<FixedArray> elements = | 1054 Handle<FixedArray> elements = |
| 1055 Handle<FixedArray>::cast(boilerplate_elements); | 1055 Handle<FixedArray>::cast(boilerplate_elements); |
| 1056 for (int i = 0; i < elements_length; ++i) { | 1056 for (int i = 0; i < elements_length; ++i) { |
| 1057 if (elements->is_the_hole(i)) { | 1057 if (elements->is_the_hole(isolate(), i)) { |
| 1058 elements_values[i] = jsgraph()->TheHoleConstant(); | 1058 elements_values[i] = jsgraph()->TheHoleConstant(); |
| 1059 } else { | 1059 } else { |
| 1060 Handle<Object> element_value(elements->get(i), isolate()); | 1060 Handle<Object> element_value(elements->get(i), isolate()); |
| 1061 if (element_value->IsJSObject()) { | 1061 if (element_value->IsJSObject()) { |
| 1062 Handle<JSObject> boilerplate_object = | 1062 Handle<JSObject> boilerplate_object = |
| 1063 Handle<JSObject>::cast(element_value); | 1063 Handle<JSObject>::cast(element_value); |
| 1064 Handle<AllocationSite> current_site = site_context->EnterNewScope(); | 1064 Handle<AllocationSite> current_site = site_context->EnterNewScope(); |
| 1065 elements_values[i] = effect = AllocateFastLiteral( | 1065 elements_values[i] = effect = AllocateFastLiteral( |
| 1066 effect, control, boilerplate_object, site_context); | 1066 effect, control, boilerplate_object, site_context); |
| 1067 site_context->ExitScope(current_site, boilerplate_object); | 1067 site_context->ExitScope(current_site, boilerplate_object); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1127 return jsgraph()->simplified(); | 1127 return jsgraph()->simplified(); |
| 1128 } | 1128 } |
| 1129 | 1129 |
| 1130 MachineOperatorBuilder* JSCreateLowering::machine() const { | 1130 MachineOperatorBuilder* JSCreateLowering::machine() const { |
| 1131 return jsgraph()->machine(); | 1131 return jsgraph()->machine(); |
| 1132 } | 1132 } |
| 1133 | 1133 |
| 1134 } // namespace compiler | 1134 } // namespace compiler |
| 1135 } // namespace internal | 1135 } // namespace internal |
| 1136 } // namespace v8 | 1136 } // namespace v8 |
| OLD | NEW |