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 6821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6832 // |done| label if a property with the given name is found. Jump to | 6832 // |done| label if a property with the given name is found. Jump to |
6833 // the |miss| label otherwise. | 6833 // the |miss| label otherwise. |
6834 // If lookup was successful |scratch2| will be equal to elements + 4 * index. | 6834 // If lookup was successful |scratch2| will be equal to elements + 4 * index. |
6835 void StringDictionaryLookupStub::GeneratePositiveLookup(MacroAssembler* masm, | 6835 void StringDictionaryLookupStub::GeneratePositiveLookup(MacroAssembler* masm, |
6836 Label* miss, | 6836 Label* miss, |
6837 Label* done, | 6837 Label* done, |
6838 Register elements, | 6838 Register elements, |
6839 Register name, | 6839 Register name, |
6840 Register scratch1, | 6840 Register scratch1, |
6841 Register scratch2) { | 6841 Register scratch2) { |
| 6842 ASSERT(!elements.is(scratch1)); |
| 6843 ASSERT(!elements.is(scratch2)); |
| 6844 ASSERT(!name.is(scratch1)); |
| 6845 ASSERT(!name.is(scratch2)); |
| 6846 |
6842 // Assert that name contains a string. | 6847 // Assert that name contains a string. |
6843 if (FLAG_debug_code) __ AbortIfNotString(name); | 6848 if (FLAG_debug_code) __ AbortIfNotString(name); |
6844 | 6849 |
6845 // Compute the capacity mask. | 6850 // Compute the capacity mask. |
6846 __ ldr(scratch1, FieldMemOperand(elements, kCapacityOffset)); | 6851 __ ldr(scratch1, FieldMemOperand(elements, kCapacityOffset)); |
6847 __ mov(scratch1, Operand(scratch1, ASR, kSmiTagSize)); // convert smi to int | 6852 __ mov(scratch1, Operand(scratch1, ASR, kSmiTagSize)); // convert smi to int |
6848 __ sub(scratch1, scratch1, Operand(1)); | 6853 __ sub(scratch1, scratch1, Operand(1)); |
6849 | 6854 |
6850 // Generate an unrolled loop that performs a few probes before | 6855 // Generate an unrolled loop that performs a few probes before |
6851 // giving up. Measurements done on Gmail indicate that 2 probes | 6856 // giving up. Measurements done on Gmail indicate that 2 probes |
(...skipping 23 matching lines...) Expand all Loading... |
6875 __ cmp(name, Operand(ip)); | 6880 __ cmp(name, Operand(ip)); |
6876 __ b(eq, done); | 6881 __ b(eq, done); |
6877 } | 6882 } |
6878 | 6883 |
6879 const int spill_mask = | 6884 const int spill_mask = |
6880 (lr.bit() | r6.bit() | r5.bit() | r4.bit() | | 6885 (lr.bit() | r6.bit() | r5.bit() | r4.bit() | |
6881 r3.bit() | r2.bit() | r1.bit() | r0.bit()) & | 6886 r3.bit() | r2.bit() | r1.bit() | r0.bit()) & |
6882 ~(scratch1.bit() | scratch2.bit()); | 6887 ~(scratch1.bit() | scratch2.bit()); |
6883 | 6888 |
6884 __ stm(db_w, sp, spill_mask); | 6889 __ stm(db_w, sp, spill_mask); |
6885 __ Move(r0, elements); | 6890 if (name.is(r0)) { |
6886 __ Move(r1, name); | 6891 ASSERT(!elements.is(r1)); |
| 6892 __ Move(r1, name); |
| 6893 __ Move(r0, elements); |
| 6894 } else { |
| 6895 __ Move(r0, elements); |
| 6896 __ Move(r1, name); |
| 6897 } |
6887 StringDictionaryLookupStub stub(POSITIVE_LOOKUP); | 6898 StringDictionaryLookupStub stub(POSITIVE_LOOKUP); |
6888 __ CallStub(&stub); | 6899 __ CallStub(&stub); |
6889 __ tst(r0, Operand(r0)); | 6900 __ tst(r0, Operand(r0)); |
6890 __ mov(scratch2, Operand(r2)); | 6901 __ mov(scratch2, Operand(r2)); |
6891 __ ldm(ia_w, sp, spill_mask); | 6902 __ ldm(ia_w, sp, spill_mask); |
6892 | 6903 |
6893 __ b(ne, done); | 6904 __ b(ne, done); |
6894 __ b(eq, miss); | 6905 __ b(eq, miss); |
6895 } | 6906 } |
6896 | 6907 |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7252 __ bind(&need_incremental); | 7263 __ bind(&need_incremental); |
7253 | 7264 |
7254 // Fall through when we need to inform the incremental marker. | 7265 // Fall through when we need to inform the incremental marker. |
7255 } | 7266 } |
7256 | 7267 |
7257 #undef __ | 7268 #undef __ |
7258 | 7269 |
7259 } } // namespace v8::internal | 7270 } } // namespace v8::internal |
7260 | 7271 |
7261 #endif // V8_TARGET_ARCH_ARM | 7272 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |