Index: src/x64/code-stubs-x64.cc |
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc |
index 0b74ace6f8b50b264021c7718fa726402bbb6017..36bd567cb6772d463ec95227290a4b89cc21f091 100644 |
--- a/src/x64/code-stubs-x64.cc |
+++ b/src/x64/code-stubs-x64.cc |
@@ -3230,10 +3230,9 @@ static void BranchIfNotInternalizedString(MacroAssembler* masm, |
__ movq(scratch, FieldOperand(object, HeapObject::kMapOffset)); |
__ movzxbq(scratch, |
FieldOperand(scratch, Map::kInstanceTypeOffset)); |
- STATIC_ASSERT(kInternalizedTag != 0); |
- __ and_(scratch, Immediate(kIsNotStringMask | kIsInternalizedMask)); |
- __ cmpb(scratch, Immediate(kInternalizedTag | kStringTag)); |
- __ j(not_equal, label); |
+ STATIC_ASSERT(kInternalizedTag == 0 && kStringTag == 0); |
+ __ testb(scratch, Immediate(kIsNotStringMask | kIsNotInternalizedMask)); |
+ __ j(not_zero, label); |
} |
@@ -5652,14 +5651,10 @@ void ICCompareStub::GenerateInternalizedStrings(MacroAssembler* masm) { |
__ movq(tmp2, FieldOperand(right, HeapObject::kMapOffset)); |
__ movzxbq(tmp1, FieldOperand(tmp1, Map::kInstanceTypeOffset)); |
__ movzxbq(tmp2, FieldOperand(tmp2, Map::kInstanceTypeOffset)); |
- STATIC_ASSERT(kInternalizedTag != 0); |
- __ and_(tmp1, Immediate(kIsNotStringMask | kIsInternalizedMask)); |
- __ cmpb(tmp1, Immediate(kInternalizedTag | kStringTag)); |
- __ j(not_equal, &miss, Label::kNear); |
- |
- __ and_(tmp2, Immediate(kIsNotStringMask | kIsInternalizedMask)); |
- __ cmpb(tmp2, Immediate(kInternalizedTag | kStringTag)); |
- __ j(not_equal, &miss, Label::kNear); |
+ STATIC_ASSERT(kInternalizedTag == 0 && kStringTag == 0); |
+ __ or_(tmp1, tmp2); |
+ __ testb(tmp1, Immediate(kIsNotStringMask | kIsNotInternalizedMask)); |
+ __ j(not_zero, &miss, Label::kNear); |
// Internalized strings are compared by identity. |
Label done; |
@@ -5696,7 +5691,6 @@ void ICCompareStub::GenerateUniqueNames(MacroAssembler* masm) { |
// Check that both operands are unique names. This leaves the instance |
// types loaded in tmp1 and tmp2. |
- STATIC_ASSERT(kInternalizedTag != 0); |
__ movq(tmp1, FieldOperand(left, HeapObject::kMapOffset)); |
__ movq(tmp2, FieldOperand(right, HeapObject::kMapOffset)); |
__ movzxbq(tmp1, FieldOperand(tmp1, Map::kInstanceTypeOffset)); |
@@ -5769,10 +5763,10 @@ void ICCompareStub::GenerateStrings(MacroAssembler* masm) { |
// strings. |
if (equality) { |
Label do_compare; |
- STATIC_ASSERT(kInternalizedTag != 0); |
- __ and_(tmp1, tmp2); |
- __ testb(tmp1, Immediate(kIsInternalizedMask)); |
- __ j(zero, &do_compare, Label::kNear); |
+ STATIC_ASSERT(kInternalizedTag == 0); |
+ __ or_(tmp1, tmp2); |
+ __ testb(tmp1, Immediate(kIsNotInternalizedMask)); |
+ __ j(not_zero, &do_compare, Label::kNear); |
// Make sure rax is non-zero. At this point input operands are |
// guaranteed to be non-zero. |
ASSERT(right.is(rax)); |