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

Side by Side Diff: src/arm64/code-stubs-arm64.cc

Issue 1128143002: [es6] Fix symbol comparison on some architectures (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 | « src/arm/code-stubs-arm.cc ('k') | src/mips/code-stubs-mips.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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_ARM64 7 #if V8_TARGET_ARCH_ARM64
8 8
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 Label not_identical, return_equal, heap_number; 214 Label not_identical, return_equal, heap_number;
215 Register result = x0; 215 Register result = x0;
216 216
217 __ Cmp(right, left); 217 __ Cmp(right, left);
218 __ B(ne, &not_identical); 218 __ B(ne, &not_identical);
219 219
220 // Test for NaN. Sadly, we can't just compare to factory::nan_value(), 220 // Test for NaN. Sadly, we can't just compare to factory::nan_value(),
221 // so we do the second best thing - test it ourselves. 221 // so we do the second best thing - test it ourselves.
222 // They are both equal and they are not both Smis so both of them are not 222 // They are both equal and they are not both Smis so both of them are not
223 // Smis. If it's not a heap number, then return equal. 223 // Smis. If it's not a heap number, then return equal.
224 Register right_type = scratch;
224 if ((cond == lt) || (cond == gt)) { 225 if ((cond == lt) || (cond == gt)) {
225 __ JumpIfObjectType(right, scratch, scratch, FIRST_SPEC_OBJECT_TYPE, slow, 226 __ JumpIfObjectType(right, right_type, right_type, FIRST_SPEC_OBJECT_TYPE,
226 ge); 227 slow, ge);
227 __ JumpIfObjectType(right, scratch, scratch, SYMBOL_TYPE, slow, eq); 228 __ Cmp(right_type, SYMBOL_TYPE);
229 __ B(eq, slow);
228 } else if (cond == eq) { 230 } else if (cond == eq) {
229 __ JumpIfHeapNumber(right, &heap_number); 231 __ JumpIfHeapNumber(right, &heap_number);
230 } else { 232 } else {
231 Register right_type = scratch;
232 __ JumpIfObjectType(right, right_type, right_type, HEAP_NUMBER_TYPE, 233 __ JumpIfObjectType(right, right_type, right_type, HEAP_NUMBER_TYPE,
233 &heap_number); 234 &heap_number);
234 // Comparing JS objects with <=, >= is complicated. 235 // Comparing JS objects with <=, >= is complicated.
235 __ Cmp(right_type, FIRST_SPEC_OBJECT_TYPE); 236 __ Cmp(right_type, FIRST_SPEC_OBJECT_TYPE);
236 __ B(ge, slow); 237 __ B(ge, slow);
238 __ Cmp(right_type, SYMBOL_TYPE);
239 __ B(eq, slow);
237 // Normally here we fall through to return_equal, but undefined is 240 // Normally here we fall through to return_equal, but undefined is
238 // special: (undefined == undefined) == true, but 241 // special: (undefined == undefined) == true, but
239 // (undefined <= undefined) == false! See ECMAScript 11.8.5. 242 // (undefined <= undefined) == false! See ECMAScript 11.8.5.
240 if ((cond == le) || (cond == ge)) { 243 if ((cond == le) || (cond == ge)) {
241 __ Cmp(right_type, ODDBALL_TYPE); 244 __ Cmp(right_type, ODDBALL_TYPE);
242 __ B(ne, &return_equal); 245 __ B(ne, &return_equal);
243 __ JumpIfNotRoot(right, Heap::kUndefinedValueRootIndex, &return_equal); 246 __ JumpIfNotRoot(right, Heap::kUndefinedValueRootIndex, &return_equal);
244 if (cond == le) { 247 if (cond == le) {
245 // undefined <= undefined should fail. 248 // undefined <= undefined should fail.
246 __ Mov(result, GREATER); 249 __ Mov(result, GREATER);
(...skipping 5510 matching lines...) Expand 10 before | Expand all | Expand 10 after
5757 kStackUnwindSpace, NULL, spill_offset, 5760 kStackUnwindSpace, NULL, spill_offset,
5758 MemOperand(fp, 6 * kPointerSize), NULL); 5761 MemOperand(fp, 6 * kPointerSize), NULL);
5759 } 5762 }
5760 5763
5761 5764
5762 #undef __ 5765 #undef __
5763 5766
5764 } } // namespace v8::internal 5767 } } // namespace v8::internal
5765 5768
5766 #endif // V8_TARGET_ARCH_ARM64 5769 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698