OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 5943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5954 | 5954 |
5955 CompareStub stub(GetCondition(), strict(), NO_COMPARE_FLAGS, r1, r0); | 5955 CompareStub stub(GetCondition(), strict(), NO_COMPARE_FLAGS, r1, r0); |
5956 __ bind(&generic_stub); | 5956 __ bind(&generic_stub); |
5957 __ Jump(stub.GetCode(), RelocInfo::CODE_TARGET); | 5957 __ Jump(stub.GetCode(), RelocInfo::CODE_TARGET); |
5958 | 5958 |
5959 __ bind(&miss); | 5959 __ bind(&miss); |
5960 GenerateMiss(masm); | 5960 GenerateMiss(masm); |
5961 } | 5961 } |
5962 | 5962 |
5963 | 5963 |
| 5964 void ICCompareStub::GenerateSymbols(MacroAssembler* masm) { |
| 5965 ASSERT(state_ == CompareIC::SYMBOLS); |
| 5966 Label miss; |
| 5967 |
| 5968 // Registers containing left and right operands respectively. |
| 5969 Register left = r1; |
| 5970 Register right = r0; |
| 5971 Register tmp1 = r2; |
| 5972 Register tmp2 = r3; |
| 5973 |
| 5974 // Check that both operands are heap objects. |
| 5975 __ JumpIfEitherSmi(left, right, &miss); |
| 5976 |
| 5977 // Check that both operands are symbols. |
| 5978 __ ldr(tmp1, FieldMemOperand(left, HeapObject::kMapOffset)); |
| 5979 __ ldr(tmp2, FieldMemOperand(right, HeapObject::kMapOffset)); |
| 5980 __ ldrb(tmp1, FieldMemOperand(tmp1, Map::kInstanceTypeOffset)); |
| 5981 __ ldrb(tmp2, FieldMemOperand(tmp2, Map::kInstanceTypeOffset)); |
| 5982 STATIC_ASSERT(kSymbolTag != 0); |
| 5983 __ and_(tmp1, tmp1, Operand(tmp2)); |
| 5984 __ tst(tmp1, Operand(kIsSymbolMask)); |
| 5985 __ b(eq, &miss); |
| 5986 |
| 5987 // Symbols are compared by identity. |
| 5988 __ cmp(left, right); |
| 5989 // Make sure r0 is non-zero. At this point input operands are |
| 5990 // guaranteed to be non-zero. |
| 5991 ASSERT(right.is(r0)); |
| 5992 STATIC_ASSERT(EQUAL == 0); |
| 5993 STATIC_ASSERT(kSmiTag == 0); |
| 5994 __ mov(r0, Operand(Smi::FromInt(EQUAL)), LeaveCC, eq); |
| 5995 __ Ret(); |
| 5996 |
| 5997 __ bind(&miss); |
| 5998 GenerateMiss(masm); |
| 5999 } |
| 6000 |
| 6001 |
5964 void ICCompareStub::GenerateStrings(MacroAssembler* masm) { | 6002 void ICCompareStub::GenerateStrings(MacroAssembler* masm) { |
5965 ASSERT(state_ == CompareIC::STRINGS); | 6003 ASSERT(state_ == CompareIC::STRINGS); |
5966 Label miss; | 6004 Label miss; |
5967 | 6005 |
5968 // Registers containing left and right operands respectively. | 6006 // Registers containing left and right operands respectively. |
5969 Register left = r1; | 6007 Register left = r1; |
5970 Register right = r0; | 6008 Register right = r0; |
5971 Register tmp1 = r2; | 6009 Register tmp1 = r2; |
5972 Register tmp2 = r3; | 6010 Register tmp2 = r3; |
5973 Register tmp3 = r4; | 6011 Register tmp3 = r4; |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6324 __ mov(result, Operand(0)); | 6362 __ mov(result, Operand(0)); |
6325 __ Ret(); | 6363 __ Ret(); |
6326 } | 6364 } |
6327 | 6365 |
6328 | 6366 |
6329 #undef __ | 6367 #undef __ |
6330 | 6368 |
6331 } } // namespace v8::internal | 6369 } } // namespace v8::internal |
6332 | 6370 |
6333 #endif // V8_TARGET_ARCH_ARM | 6371 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |