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

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

Issue 1125783002: [es6] When comparing two symbols we may need to throw a TypeError (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/ppc/code-stubs-ppc.cc ('k') | src/x87/code-stubs-x87.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_X64 7 #if V8_TARGET_ARCH_X64
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 1560 matching lines...) Expand 10 before | Expand all | Expand 10 after
1571 // so we do the second best thing - test it ourselves. 1571 // so we do the second best thing - test it ourselves.
1572 Label heap_number; 1572 Label heap_number;
1573 // If it's not a heap number, then return equal for (in)equality operator. 1573 // If it's not a heap number, then return equal for (in)equality operator.
1574 __ Cmp(FieldOperand(rdx, HeapObject::kMapOffset), 1574 __ Cmp(FieldOperand(rdx, HeapObject::kMapOffset),
1575 factory->heap_number_map()); 1575 factory->heap_number_map());
1576 __ j(equal, &heap_number, Label::kNear); 1576 __ j(equal, &heap_number, Label::kNear);
1577 if (cc != equal) { 1577 if (cc != equal) {
1578 // Call runtime on identical objects. Otherwise return equal. 1578 // Call runtime on identical objects. Otherwise return equal.
1579 __ CmpObjectType(rax, FIRST_SPEC_OBJECT_TYPE, rcx); 1579 __ CmpObjectType(rax, FIRST_SPEC_OBJECT_TYPE, rcx);
1580 __ j(above_equal, &not_identical, Label::kNear); 1580 __ j(above_equal, &not_identical, Label::kNear);
1581 // Call runtime on identical symbols since we need to throw a TypeError.
1582 __ CmpObjectType(rax, SYMBOL_TYPE, rcx);
1583 __ j(equal, &not_identical, Label::kNear);
1581 } 1584 }
1582 __ Set(rax, EQUAL); 1585 __ Set(rax, EQUAL);
1583 __ ret(0); 1586 __ ret(0);
1584 1587
1585 __ bind(&heap_number); 1588 __ bind(&heap_number);
1586 // It is a heap number, so return equal if it's not NaN. 1589 // It is a heap number, so return equal if it's not NaN.
1587 // For NaN, return 1 for every condition except greater and 1590 // For NaN, return 1 for every condition except greater and
1588 // greater-equal. Return -1 for them, so the comparison yields 1591 // greater-equal. Return -1 for them, so the comparison yields
1589 // false for all conditions except not-equal. 1592 // false for all conditions except not-equal.
1590 __ Set(rax, EQUAL); 1593 __ Set(rax, EQUAL);
(...skipping 3759 matching lines...) Expand 10 before | Expand all | Expand 10 after
5350 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, getter_arg, 5353 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, getter_arg,
5351 kStackSpace, nullptr, return_value_operand, NULL); 5354 kStackSpace, nullptr, return_value_operand, NULL);
5352 } 5355 }
5353 5356
5354 5357
5355 #undef __ 5358 #undef __
5356 5359
5357 } } // namespace v8::internal 5360 } } // namespace v8::internal
5358 5361
5359 #endif // V8_TARGET_ARCH_X64 5362 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ppc/code-stubs-ppc.cc ('k') | src/x87/code-stubs-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698