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

Side by Side Diff: src/ic/arm64/ic-arm64.cc

Issue 2396353002: Revert "Add Smi::Zero and replace all Smi::FromInt(0) calls" (Closed)
Patch Set: Created 4 years, 2 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 | « src/ia32/macro-assembler-ia32.cc ('k') | src/ic/x64/ic-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 #if V8_TARGET_ARCH_ARM64 5 #if V8_TARGET_ARCH_ARM64
6 6
7 #include "src/codegen.h" 7 #include "src/codegen.h"
8 #include "src/ic/ic.h" 8 #include "src/ic/ic.h"
9 #include "src/ic/ic-compiler.h" 9 #include "src/ic/ic-compiler.h"
10 #include "src/ic/stub-cache.h" 10 #include "src/ic/stub-cache.h"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 __ Ldr(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); 174 __ Ldr(elements, FieldMemOperand(receiver, JSObject::kElementsOffset));
175 __ AssertFastElements(elements); 175 __ AssertFastElements(elements);
176 176
177 // Check that the key (index) is within bounds. 177 // Check that the key (index) is within bounds.
178 __ Ldr(scratch1, FieldMemOperand(elements, FixedArray::kLengthOffset)); 178 __ Ldr(scratch1, FieldMemOperand(elements, FixedArray::kLengthOffset));
179 __ Cmp(key, scratch1); 179 __ Cmp(key, scratch1);
180 __ B(lo, &in_bounds); 180 __ B(lo, &in_bounds);
181 181
182 // Out of bounds. Check the prototype chain to see if we can just return 182 // Out of bounds. Check the prototype chain to see if we can just return
183 // 'undefined'. 183 // 'undefined'.
184 __ Cmp(key, Operand(Smi::kZero)); 184 __ Cmp(key, Operand(Smi::FromInt(0)));
185 __ B(lt, slow); // Negative keys can't take the fast OOB path. 185 __ B(lt, slow); // Negative keys can't take the fast OOB path.
186 __ Bind(&check_prototypes); 186 __ Bind(&check_prototypes);
187 __ Ldr(scratch2, FieldMemOperand(receiver, HeapObject::kMapOffset)); 187 __ Ldr(scratch2, FieldMemOperand(receiver, HeapObject::kMapOffset));
188 __ Bind(&check_next_prototype); 188 __ Bind(&check_next_prototype);
189 __ Ldr(scratch2, FieldMemOperand(scratch2, Map::kPrototypeOffset)); 189 __ Ldr(scratch2, FieldMemOperand(scratch2, Map::kPrototypeOffset));
190 // scratch2: current prototype 190 // scratch2: current prototype
191 __ JumpIfRoot(scratch2, Heap::kNullValueRootIndex, &absent); 191 __ JumpIfRoot(scratch2, Heap::kNullValueRootIndex, &absent);
192 __ Ldr(elements, FieldMemOperand(scratch2, JSObject::kElementsOffset)); 192 __ Ldr(elements, FieldMemOperand(scratch2, JSObject::kElementsOffset));
193 __ Ldr(scratch2, FieldMemOperand(scratch2, HeapObject::kMapOffset)); 193 __ Ldr(scratch2, FieldMemOperand(scratch2, HeapObject::kMapOffset));
194 // elements: elements of current prototype 194 // elements: elements of current prototype
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
844 } else { 844 } else {
845 DCHECK(to_patch->Mask(TestBranchMask) == TBNZ); 845 DCHECK(to_patch->Mask(TestBranchMask) == TBNZ);
846 // This is JumpIfSmi(smi_reg, branch_imm). 846 // This is JumpIfSmi(smi_reg, branch_imm).
847 patcher.tbz(smi_reg, 0, branch_imm); 847 patcher.tbz(smi_reg, 0, branch_imm);
848 } 848 }
849 } 849 }
850 } // namespace internal 850 } // namespace internal
851 } // namespace v8 851 } // namespace v8
852 852
853 #endif // V8_TARGET_ARCH_ARM64 853 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/ic/x64/ic-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698