Index: src/arm/code-stubs-arm.cc |
diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc |
index a6805e7b8029750f1dfdff376b3737517005651c..5368dd507a522b21c5f37128b0af44cfe8dac5fb 100644 |
--- a/src/arm/code-stubs-arm.cc |
+++ b/src/arm/code-stubs-arm.cc |
@@ -7099,6 +7099,57 @@ void ICCompareStub::GenerateInternalizedStrings(MacroAssembler* masm) { |
} |
+void ICCompareStub::GenerateUniqueNames(MacroAssembler* masm) { |
+ ASSERT(state_ == CompareIC::UNIQUE_NAME); |
+ ASSERT(GetCondition() == eq); |
+ Label miss; |
+ |
+ // Registers containing left and right operands respectively. |
+ Register left = r1; |
+ Register right = r0; |
+ Register tmp1 = r2; |
+ Register tmp2 = r3; |
+ |
+ // Check that both operands are heap objects. |
+ __ JumpIfEitherSmi(left, right, &miss); |
+ |
+ // Check that both operands are unique names. This leaves the instance |
+ // types loaded in tmp1 and tmp2. |
+ STATIC_ASSERT(kInternalizedTag != 0); |
+ __ ldr(tmp1, FieldMemOperand(left, HeapObject::kMapOffset)); |
+ __ ldr(tmp2, FieldMemOperand(right, HeapObject::kMapOffset)); |
+ __ ldrb(tmp1, FieldMemOperand(tmp1, Map::kInstanceTypeOffset)); |
+ __ ldrb(tmp2, FieldMemOperand(tmp2, Map::kInstanceTypeOffset)); |
+ |
+ Label succeed1; |
+ __ tst(tmp1, Operand(kIsInternalizedMask)); |
+ __ b(ne, &succeed1); |
+ __ cmp(tmp1, Operand(SYMBOL_TYPE)); |
+ __ b(ne, &miss); |
+ __ bind(&succeed1); |
+ |
+ Label succeed2; |
+ __ tst(tmp2, Operand(kIsInternalizedMask)); |
+ __ b(ne, &succeed2); |
+ __ cmp(tmp2, Operand(SYMBOL_TYPE)); |
+ __ b(ne, &miss); |
+ __ bind(&succeed2); |
+ |
+ // Unique names are compared by identity. |
+ __ cmp(left, right); |
+ // Make sure r0 is non-zero. At this point input operands are |
+ // guaranteed to be non-zero. |
+ ASSERT(right.is(r0)); |
+ STATIC_ASSERT(EQUAL == 0); |
+ STATIC_ASSERT(kSmiTag == 0); |
+ __ mov(r0, Operand(Smi::FromInt(EQUAL)), LeaveCC, eq); |
+ __ Ret(); |
+ |
+ __ bind(&miss); |
+ GenerateMiss(masm); |
+} |
+ |
+ |
void ICCompareStub::GenerateStrings(MacroAssembler* masm) { |
ASSERT(state_ == CompareIC::STRING); |
Label miss; |