| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/code-factory.h" | 5 #include "src/code-factory.h" |
| 6 #include "src/compiler/access-builder.h" | 6 #include "src/compiler/access-builder.h" |
| 7 #include "src/compiler/js-graph.h" | 7 #include "src/compiler/js-graph.h" |
| 8 #include "src/compiler/js-typed-lowering.h" | 8 #include "src/compiler/js-typed-lowering.h" |
| 9 #include "src/compiler/linkage.h" | 9 #include "src/compiler/linkage.h" |
| 10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 // Primitive store into a field. | 54 // Primitive store into a field. |
| 55 void Store(const FieldAccess& access, Node* value) { | 55 void Store(const FieldAccess& access, Node* value) { |
| 56 effect_ = graph()->NewNode(simplified()->StoreField(access), allocation_, | 56 effect_ = graph()->NewNode(simplified()->StoreField(access), allocation_, |
| 57 value, effect_, control_); | 57 value, effect_, control_); |
| 58 } | 58 } |
| 59 | 59 |
| 60 // Compound allocation of a FixedArray. | 60 // Compound allocation of a FixedArray. |
| 61 void AllocateArray(int length, Handle<Map> map) { | 61 void AllocateArray(int length, Handle<Map> map) { |
| 62 Allocate(FixedArray::SizeFor(length)); | 62 Allocate(FixedArray::SizeFor(length)); |
| 63 Store(AccessBuilder::ForMap(), map); | 63 Store(AccessBuilder::ForMap(), map); |
| 64 Store(AccessBuilder::ForFixedArrayLength(), jsgraph()->Constant(length)); | 64 Store(AccessBuilder::ForFixedArrayLength(graph()->zone()), |
| 65 jsgraph()->Constant(length)); |
| 65 } | 66 } |
| 66 | 67 |
| 67 // Compound store of a constant into a field. | 68 // Compound store of a constant into a field. |
| 68 void Store(const FieldAccess& access, Handle<Object> value) { | 69 void Store(const FieldAccess& access, Handle<Object> value) { |
| 69 Store(access, jsgraph()->Constant(value)); | 70 Store(access, jsgraph()->Constant(value)); |
| 70 } | 71 } |
| 71 | 72 |
| 72 Node* allocation() const { return allocation_; } | 73 Node* allocation() const { return allocation_; } |
| 73 Node* effect() const { return effect_; } | 74 Node* effect() const { return effect_; } |
| 74 | 75 |
| (...skipping 1327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1402 cache_type_false0 = graph()->NewNode( | 1403 cache_type_false0 = graph()->NewNode( |
| 1403 common()->Select(kMachAnyTagged, BranchHint::kFalse), | 1404 common()->Select(kMachAnyTagged, BranchHint::kFalse), |
| 1404 graph()->NewNode(machine()->Uint32LessThanOrEqual(), | 1405 graph()->NewNode(machine()->Uint32LessThanOrEqual(), |
| 1405 receiver_instance_type, | 1406 receiver_instance_type, |
| 1406 jsgraph()->Uint32Constant(LAST_JS_PROXY_TYPE)), | 1407 jsgraph()->Uint32Constant(LAST_JS_PROXY_TYPE)), |
| 1407 jsgraph()->ZeroConstant(), // Zero indicagtes proxy. | 1408 jsgraph()->ZeroConstant(), // Zero indicagtes proxy. |
| 1408 jsgraph()->OneConstant()); // One means slow check. | 1409 jsgraph()->OneConstant()); // One means slow check. |
| 1409 | 1410 |
| 1410 cache_array_false0 = cache_type; | 1411 cache_array_false0 = cache_type; |
| 1411 cache_length_false0 = efalse0 = graph()->NewNode( | 1412 cache_length_false0 = efalse0 = graph()->NewNode( |
| 1412 simplified()->LoadField(AccessBuilder::ForFixedArrayLength()), | 1413 simplified()->LoadField( |
| 1414 AccessBuilder::ForFixedArrayLength(graph()->zone())), |
| 1413 cache_array_false0, efalse0, if_false0); | 1415 cache_array_false0, efalse0, if_false0); |
| 1414 } | 1416 } |
| 1415 | 1417 |
| 1416 control = graph()->NewNode(common()->Merge(2), if_true0, if_false0); | 1418 control = graph()->NewNode(common()->Merge(2), if_true0, if_false0); |
| 1417 effect = graph()->NewNode(common()->EffectPhi(2), etrue0, efalse0, control); | 1419 effect = graph()->NewNode(common()->EffectPhi(2), etrue0, efalse0, control); |
| 1418 Node* cache_array = | 1420 Node* cache_array = |
| 1419 graph()->NewNode(common()->Phi(kMachAnyTagged, 2), cache_array_true0, | 1421 graph()->NewNode(common()->Phi(kMachAnyTagged, 2), cache_array_true0, |
| 1420 cache_array_false0, control); | 1422 cache_array_false0, control); |
| 1421 Node* cache_length = | 1423 Node* cache_length = |
| 1422 graph()->NewNode(common()->Phi(kMachAnyTagged, 2), cache_length_true0, | 1424 graph()->NewNode(common()->Phi(kMachAnyTagged, 2), cache_length_true0, |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1706 } | 1708 } |
| 1707 | 1709 |
| 1708 | 1710 |
| 1709 MachineOperatorBuilder* JSTypedLowering::machine() const { | 1711 MachineOperatorBuilder* JSTypedLowering::machine() const { |
| 1710 return jsgraph()->machine(); | 1712 return jsgraph()->machine(); |
| 1711 } | 1713 } |
| 1712 | 1714 |
| 1713 } // namespace compiler | 1715 } // namespace compiler |
| 1714 } // namespace internal | 1716 } // namespace internal |
| 1715 } // namespace v8 | 1717 } // namespace v8 |
| OLD | NEW |