Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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-native-context-specialization.h" | 5 #include "src/compiler/js-native-context-specialization.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.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 1502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1513 value = effect = graph()->NewNode(simplified()->CheckNumber(), value, | 1513 value = effect = graph()->NewNode(simplified()->CheckNumber(), value, |
| 1514 effect, control); | 1514 effect, control); |
| 1515 if (!field_index.is_inobject() || field_index.is_hidden_field() || | 1515 if (!field_index.is_inobject() || field_index.is_hidden_field() || |
| 1516 !FLAG_unbox_double_fields) { | 1516 !FLAG_unbox_double_fields) { |
| 1517 if (access_info.HasTransitionMap()) { | 1517 if (access_info.HasTransitionMap()) { |
| 1518 // Allocate a MutableHeapNumber for the new property. | 1518 // Allocate a MutableHeapNumber for the new property. |
| 1519 effect = graph()->NewNode( | 1519 effect = graph()->NewNode( |
| 1520 common()->BeginRegion(RegionObservability::kNotObservable), | 1520 common()->BeginRegion(RegionObservability::kNotObservable), |
| 1521 effect); | 1521 effect); |
| 1522 Node* box = effect = graph()->NewNode( | 1522 Node* box = effect = graph()->NewNode( |
| 1523 simplified()->Allocate(NOT_TENURED), | 1523 simplified()->Allocate(Type::Number(), NOT_TENURED), |
|
Benedikt Meurer
2017/04/06 12:08:05
This should be Type::OtherInternal(). A MutableHea
Jarin
2017/04/06 15:11:29
Done. Good catch!
| |
| 1524 jsgraph()->Constant(HeapNumber::kSize), effect, control); | 1524 jsgraph()->Constant(HeapNumber::kSize), effect, control); |
| 1525 effect = graph()->NewNode( | 1525 effect = graph()->NewNode( |
| 1526 simplified()->StoreField(AccessBuilder::ForMap()), box, | 1526 simplified()->StoreField(AccessBuilder::ForMap()), box, |
| 1527 jsgraph()->HeapConstant(factory()->mutable_heap_number_map()), | 1527 jsgraph()->HeapConstant(factory()->mutable_heap_number_map()), |
| 1528 effect, control); | 1528 effect, control); |
| 1529 effect = graph()->NewNode( | 1529 effect = graph()->NewNode( |
| 1530 simplified()->StoreField(AccessBuilder::ForHeapNumberValue()), | 1530 simplified()->StoreField(AccessBuilder::ForHeapNumberValue()), |
| 1531 box, value, effect, control); | 1531 box, value, effect, control); |
| 1532 value = effect = | 1532 value = effect = |
| 1533 graph()->NewNode(common()->FinishRegion(), box, effect); | 1533 graph()->NewNode(common()->FinishRegion(), box, effect); |
| (...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2202 values.push_back(value); | 2202 values.push_back(value); |
| 2203 } | 2203 } |
| 2204 // Initialize the new fields to undefined. | 2204 // Initialize the new fields to undefined. |
| 2205 for (int i = 0; i < JSObject::kFieldsAdded; ++i) { | 2205 for (int i = 0; i < JSObject::kFieldsAdded; ++i) { |
| 2206 values.push_back(jsgraph()->UndefinedConstant()); | 2206 values.push_back(jsgraph()->UndefinedConstant()); |
| 2207 } | 2207 } |
| 2208 // Allocate and initialize the new properties. | 2208 // Allocate and initialize the new properties. |
| 2209 effect = graph()->NewNode( | 2209 effect = graph()->NewNode( |
| 2210 common()->BeginRegion(RegionObservability::kNotObservable), effect); | 2210 common()->BeginRegion(RegionObservability::kNotObservable), effect); |
| 2211 Node* new_properties = effect = graph()->NewNode( | 2211 Node* new_properties = effect = graph()->NewNode( |
| 2212 simplified()->Allocate(NOT_TENURED), | 2212 simplified()->Allocate(Type::Internal(), NOT_TENURED), |
|
Benedikt Meurer
2017/04/06 12:08:05
Nit: Type::OtherInternal()
Jarin
2017/04/06 15:11:29
Done.
| |
| 2213 jsgraph()->Constant(FixedArray::SizeFor(new_length)), effect, control); | 2213 jsgraph()->Constant(FixedArray::SizeFor(new_length)), effect, control); |
| 2214 effect = graph()->NewNode(simplified()->StoreField(AccessBuilder::ForMap()), | 2214 effect = graph()->NewNode(simplified()->StoreField(AccessBuilder::ForMap()), |
| 2215 new_properties, jsgraph()->FixedArrayMapConstant(), | 2215 new_properties, jsgraph()->FixedArrayMapConstant(), |
| 2216 effect, control); | 2216 effect, control); |
| 2217 effect = graph()->NewNode( | 2217 effect = graph()->NewNode( |
| 2218 simplified()->StoreField(AccessBuilder::ForFixedArrayLength()), | 2218 simplified()->StoreField(AccessBuilder::ForFixedArrayLength()), |
| 2219 new_properties, jsgraph()->Constant(new_length), effect, control); | 2219 new_properties, jsgraph()->Constant(new_length), effect, control); |
| 2220 for (int i = 0; i < new_length; ++i) { | 2220 for (int i = 0; i < new_length; ++i) { |
| 2221 effect = graph()->NewNode( | 2221 effect = graph()->NewNode( |
| 2222 simplified()->StoreField( | 2222 simplified()->StoreField( |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2378 return jsgraph()->javascript(); | 2378 return jsgraph()->javascript(); |
| 2379 } | 2379 } |
| 2380 | 2380 |
| 2381 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { | 2381 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { |
| 2382 return jsgraph()->simplified(); | 2382 return jsgraph()->simplified(); |
| 2383 } | 2383 } |
| 2384 | 2384 |
| 2385 } // namespace compiler | 2385 } // namespace compiler |
| 2386 } // namespace internal | 2386 } // namespace internal |
| 2387 } // namespace v8 | 2387 } // namespace v8 |
| OLD | NEW |