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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 if (i > 0) { | 133 if (i > 0) { |
134 __ add(Operand(r0), Immediate(StringDictionary::GetProbeOffset(i))); | 134 __ add(Operand(r0), Immediate(StringDictionary::GetProbeOffset(i))); |
135 } | 135 } |
136 __ and_(r0, Operand(r1)); | 136 __ and_(r0, Operand(r1)); |
137 | 137 |
138 // Scale the index by multiplying by the entry size. | 138 // Scale the index by multiplying by the entry size. |
139 ASSERT(StringDictionary::kEntrySize == 3); | 139 ASSERT(StringDictionary::kEntrySize == 3); |
140 __ lea(r0, Operand(r0, r0, times_2, 0)); // r0 = r0 * 3 | 140 __ lea(r0, Operand(r0, r0, times_2, 0)); // r0 = r0 * 3 |
141 | 141 |
142 // Check if the key is identical to the name. | 142 // Check if the key is identical to the name. |
143 __ cmp(name, Operand(elements, r0, times_4, | 143 __ cmp(name, Operand(elements, |
| 144 r0, |
| 145 times_4, |
144 kElementsStartOffset - kHeapObjectTag)); | 146 kElementsStartOffset - kHeapObjectTag)); |
145 if (i != kProbes - 1) { | 147 __ j(equal, done, taken); |
146 __ j(equal, done, taken); | |
147 } else { | |
148 __ j(not_equal, miss, not_taken); | |
149 } | |
150 } | 148 } |
| 149 |
| 150 StringDictionaryLookupStub stub(elements, |
| 151 r1, |
| 152 r0, |
| 153 StringDictionaryLookupStub::POSITIVE_LOOKUP); |
| 154 __ push(name); |
| 155 __ mov(r0, FieldOperand(name, String::kHashFieldOffset)); |
| 156 __ shr(r0, String::kHashShift); |
| 157 __ push(r0); |
| 158 __ CallStub(&stub); |
| 159 |
| 160 __ test(r1, Operand(r1)); |
| 161 __ j(zero, miss); |
| 162 __ jmp(done); |
151 } | 163 } |
152 | 164 |
153 | 165 |
154 | 166 |
155 // Helper function used to load a property from a dictionary backing | 167 // Helper function used to load a property from a dictionary backing |
156 // storage. This function may fail to load a property even though it is | 168 // storage. This function may fail to load a property even though it is |
157 // in the dictionary, so code at miss_label must always call a backup | 169 // in the dictionary, so code at miss_label must always call a backup |
158 // property load that is complete. This function is safe to call if | 170 // property load that is complete. This function is safe to call if |
159 // name is not a symbol, and will jump to the miss_label in that | 171 // name is not a symbol, and will jump to the miss_label in that |
160 // case. The generated code assumes that the receiver has slow | 172 // case. The generated code assumes that the receiver has slow |
(...skipping 1431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1592 Condition cc = *jmp_address == Assembler::kJncShortOpcode | 1604 Condition cc = *jmp_address == Assembler::kJncShortOpcode |
1593 ? not_zero | 1605 ? not_zero |
1594 : zero; | 1606 : zero; |
1595 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 1607 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
1596 } | 1608 } |
1597 | 1609 |
1598 | 1610 |
1599 } } // namespace v8::internal | 1611 } } // namespace v8::internal |
1600 | 1612 |
1601 #endif // V8_TARGET_ARCH_IA32 | 1613 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |