Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(704)

Side by Side Diff: src/code-stub-assembler.cc

Issue 1997223002: [stubs] Enforce correct index representation on 64-bit. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698