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/code-stub-assembler.h" | 5 #include "src/code-stub-assembler.h" |
6 #include "src/code-factory.h" | 6 #include "src/code-factory.h" |
7 | 7 |
8 namespace v8 { | 8 namespace v8 { |
9 namespace internal { | 9 namespace internal { |
10 | 10 |
(...skipping 1547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1558 element_size_shift -= kSmiShiftBits; | 1558 element_size_shift -= kSmiShiftBits; |
1559 intptr_t temp = 0; | 1559 intptr_t temp = 0; |
1560 constant_index = ToIntPtrConstant(index_node, temp); | 1560 constant_index = ToIntPtrConstant(index_node, temp); |
1561 index = temp >> kSmiShiftBits; | 1561 index = temp >> kSmiShiftBits; |
1562 } else { | 1562 } else { |
1563 constant_index = ToInt32Constant(index_node, index); | 1563 constant_index = ToInt32Constant(index_node, index); |
1564 } | 1564 } |
1565 if (constant_index) { | 1565 if (constant_index) { |
1566 return IntPtrConstant(base_size + element_size * index); | 1566 return IntPtrConstant(base_size + element_size * index); |
1567 } | 1567 } |
| 1568 if (Is64() && mode == INTEGER_PARAMETERS) { |
| 1569 index_node = ChangeInt32ToInt64(index_node); |
| 1570 } |
1568 if (base_size == 0) { | 1571 if (base_size == 0) { |
1569 return (element_size_shift >= 0) | 1572 return (element_size_shift >= 0) |
1570 ? WordShl(index_node, IntPtrConstant(element_size_shift)) | 1573 ? WordShl(index_node, IntPtrConstant(element_size_shift)) |
1571 : WordShr(index_node, IntPtrConstant(-element_size_shift)); | 1574 : WordShr(index_node, IntPtrConstant(-element_size_shift)); |
1572 } | 1575 } |
1573 return IntPtrAdd( | 1576 return IntPtrAdd( |
1574 Int32Constant(base_size), | 1577 IntPtrConstant(base_size), |
1575 (element_size_shift >= 0) | 1578 (element_size_shift >= 0) |
1576 ? WordShl(index_node, IntPtrConstant(element_size_shift)) | 1579 ? WordShl(index_node, IntPtrConstant(element_size_shift)) |
1577 : WordShr(index_node, IntPtrConstant(-element_size_shift))); | 1580 : WordShr(index_node, IntPtrConstant(-element_size_shift))); |
1578 } | 1581 } |
1579 | 1582 |
1580 } // namespace internal | 1583 } // namespace internal |
1581 } // namespace v8 | 1584 } // namespace v8 |
OLD | NEW |