OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 const int kElementsStartOffset = | 87 const int kElementsStartOffset = |
88 Array::kHeaderSize + Dictionary::kElementsStartIndex * kPointerSize; | 88 Array::kHeaderSize + Dictionary::kElementsStartIndex * kPointerSize; |
89 | 89 |
90 // Generate an unrolled loop that performs a few probes before | 90 // Generate an unrolled loop that performs a few probes before |
91 // giving up. Measurements done on Gmail indicate that 2 probes | 91 // giving up. Measurements done on Gmail indicate that 2 probes |
92 // cover ~93% of loads from dictionaries. | 92 // cover ~93% of loads from dictionaries. |
93 static const int kProbes = 4; | 93 static const int kProbes = 4; |
94 for (int i = 0; i < kProbes; i++) { | 94 for (int i = 0; i < kProbes; i++) { |
95 // Compute the masked index: (hash + i + i * i) & mask. | 95 // Compute the masked index: (hash + i + i * i) & mask. |
96 __ ldr(t1, FieldMemOperand(r2, String::kLengthOffset)); | 96 __ ldr(t1, FieldMemOperand(r2, String::kLengthOffset)); |
| 97 __ mov(t1, Operand(t1, LSR, String::kHashShift)); |
97 if (i > 0) __ add(t1, t1, Operand(Dictionary::GetProbeOffset(i))); | 98 if (i > 0) __ add(t1, t1, Operand(Dictionary::GetProbeOffset(i))); |
98 __ and_(t1, t1, Operand(r3)); | 99 __ and_(t1, t1, Operand(r3)); |
99 | 100 |
100 // Scale the index by multiplying by the element size. | 101 // Scale the index by multiplying by the element size. |
101 ASSERT(Dictionary::kElementSize == 3); | 102 ASSERT(Dictionary::kElementSize == 3); |
102 __ add(t1, t1, Operand(t1, LSL, 1)); // t1 = t1 * 3 | 103 __ add(t1, t1, Operand(t1, LSL, 1)); // t1 = t1 * 3 |
103 | 104 |
104 // Check if the key is identical to the name. | 105 // Check if the key is identical to the name. |
105 __ add(t1, t0, Operand(t1, LSL, 2)); | 106 __ add(t1, t0, Operand(t1, LSL, 2)); |
106 __ ldr(ip, FieldMemOperand(t1, kElementsStartOffset)); | 107 __ ldr(ip, FieldMemOperand(t1, kElementsStartOffset)); |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 | 587 |
587 // Perform tail call to the entry. | 588 // Perform tail call to the entry. |
588 __ TailCallRuntime(f, 3); | 589 __ TailCallRuntime(f, 3); |
589 } | 590 } |
590 | 591 |
591 | 592 |
592 #undef __ | 593 #undef __ |
593 | 594 |
594 | 595 |
595 } } // namespace v8::internal | 596 } } // namespace v8::internal |
OLD | NEW |