| 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-operator.h" | 8 #include "src/compiler/js-operator.h" |
| 9 #include "src/compiler/js-typed-lowering.h" | 9 #include "src/compiler/js-typed-lowering.h" |
| 10 #include "src/compiler/machine-operator.h" | 10 #include "src/compiler/machine-operator.h" |
| (...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 Reduction r = Reduce(node); | 775 Reduction r = Reduce(node); |
| 776 | 776 |
| 777 Matcher<Node*> offset_matcher = | 777 Matcher<Node*> offset_matcher = |
| 778 element_size == 1 | 778 element_size == 1 |
| 779 ? key | 779 ? key |
| 780 : IsWord32Shl(key, IsInt32Constant(WhichPowerOf2(element_size))); | 780 : IsWord32Shl(key, IsInt32Constant(WhichPowerOf2(element_size))); |
| 781 | 781 |
| 782 Matcher<Node*> value_matcher = | 782 Matcher<Node*> value_matcher = |
| 783 IsToNumber(value, context, effect, control); | 783 IsToNumber(value, context, effect, control); |
| 784 Matcher<Node*> effect_matcher = value_matcher; | 784 Matcher<Node*> effect_matcher = value_matcher; |
| 785 if (AccessBuilder::ForTypedArrayElement(type, true) | |
| 786 .type->Is(Type::Signed32())) { | |
| 787 value_matcher = IsNumberToInt32(value_matcher); | |
| 788 } else if (AccessBuilder::ForTypedArrayElement(type, true) | |
| 789 .type->Is(Type::Unsigned32())) { | |
| 790 value_matcher = IsNumberToUint32(value_matcher); | |
| 791 } | |
| 792 | 785 |
| 793 ASSERT_TRUE(r.Changed()); | 786 ASSERT_TRUE(r.Changed()); |
| 794 EXPECT_THAT( | 787 EXPECT_THAT( |
| 795 r.replacement(), | 788 r.replacement(), |
| 796 IsStoreBuffer(BufferAccess(type), | 789 IsStoreBuffer(BufferAccess(type), |
| 797 IsIntPtrConstant(bit_cast<intptr_t>(&backing_store[0])), | 790 IsIntPtrConstant(bit_cast<intptr_t>(&backing_store[0])), |
| 798 offset_matcher, | 791 offset_matcher, |
| 799 IsNumberConstant(array->byte_length()->Number()), | 792 IsNumberConstant(array->byte_length()->Number()), |
| 800 value_matcher, effect_matcher, control)); | 793 value_matcher, effect_matcher, control)); |
| 801 } | 794 } |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1220 Node* dummy = graph()->NewNode(javascript()->ToObject(), instanceOf, context, | 1213 Node* dummy = graph()->NewNode(javascript()->ToObject(), instanceOf, context, |
| 1221 frame_state, effect, control); | 1214 frame_state, effect, control); |
| 1222 Reduction r = Reduce(instanceOf); | 1215 Reduction r = Reduce(instanceOf); |
| 1223 ASSERT_FALSE(r.Changed()); | 1216 ASSERT_FALSE(r.Changed()); |
| 1224 ASSERT_EQ(instanceOf, dummy->InputAt(0)); | 1217 ASSERT_EQ(instanceOf, dummy->InputAt(0)); |
| 1225 } | 1218 } |
| 1226 | 1219 |
| 1227 } // namespace compiler | 1220 } // namespace compiler |
| 1228 } // namespace internal | 1221 } // namespace internal |
| 1229 } // namespace v8 | 1222 } // namespace v8 |
| OLD | NEW |