OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_PPC | 5 #if V8_TARGET_ARCH_PPC |
6 | 6 |
7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/ic/ic.h" | 8 #include "src/ic/ic.h" |
9 #include "src/ic/stub-cache.h" | 9 #include "src/ic/stub-cache.h" |
10 #include "src/interface-descriptors.h" | 10 #include "src/interface-descriptors.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 __ IncrementCounter(counters->megamorphic_stub_cache_probes(), 1, extra2, | 135 __ IncrementCounter(counters->megamorphic_stub_cache_probes(), 1, extra2, |
136 extra3); | 136 extra3); |
137 | 137 |
138 // Check that the receiver isn't a smi. | 138 // Check that the receiver isn't a smi. |
139 __ JumpIfSmi(receiver, &miss); | 139 __ JumpIfSmi(receiver, &miss); |
140 | 140 |
141 // Get the map of the receiver and compute the hash. | 141 // Get the map of the receiver and compute the hash. |
142 __ lwz(scratch, FieldMemOperand(name, Name::kHashFieldOffset)); | 142 __ lwz(scratch, FieldMemOperand(name, Name::kHashFieldOffset)); |
143 __ LoadP(ip, FieldMemOperand(receiver, HeapObject::kMapOffset)); | 143 __ LoadP(ip, FieldMemOperand(receiver, HeapObject::kMapOffset)); |
144 __ add(scratch, scratch, ip); | 144 __ add(scratch, scratch, ip); |
145 __ xori(scratch, scratch, Operand(kPrimaryMagic)); | 145 __ Xor(scratch, scratch, Operand(kPrimaryMagic)); |
146 // The mask omits the last two bits because they are not part of the hash. | 146 // The mask omits the last two bits because they are not part of the hash. |
147 __ andi(scratch, scratch, | 147 __ andi(scratch, scratch, |
148 Operand((kPrimaryTableSize - 1) << kCacheIndexShift)); | 148 Operand((kPrimaryTableSize - 1) << kCacheIndexShift)); |
149 | 149 |
150 // Probe the primary table. | 150 // Probe the primary table. |
151 ProbeTable(this, masm, kPrimary, receiver, name, scratch, extra, extra2, | 151 ProbeTable(this, masm, kPrimary, receiver, name, scratch, extra, extra2, |
152 extra3); | 152 extra3); |
153 | 153 |
154 // Primary miss: Compute hash for secondary probe. | 154 // Primary miss: Compute hash for secondary probe. |
155 __ sub(scratch, scratch, name); | 155 __ sub(scratch, scratch, name); |
156 __ addi(scratch, scratch, Operand(kSecondaryMagic)); | 156 __ Add(scratch, scratch, kSecondaryMagic, r0); |
157 __ andi(scratch, scratch, | 157 __ andi(scratch, scratch, |
158 Operand((kSecondaryTableSize - 1) << kCacheIndexShift)); | 158 Operand((kSecondaryTableSize - 1) << kCacheIndexShift)); |
159 | 159 |
160 // Probe the secondary table. | 160 // Probe the secondary table. |
161 ProbeTable(this, masm, kSecondary, receiver, name, scratch, extra, extra2, | 161 ProbeTable(this, masm, kSecondary, receiver, name, scratch, extra, extra2, |
162 extra3); | 162 extra3); |
163 | 163 |
164 // Cache miss: Fall-through and let caller handle the miss by | 164 // Cache miss: Fall-through and let caller handle the miss by |
165 // entering the runtime system. | 165 // entering the runtime system. |
166 __ bind(&miss); | 166 __ bind(&miss); |
167 __ IncrementCounter(counters->megamorphic_stub_cache_misses(), 1, extra2, | 167 __ IncrementCounter(counters->megamorphic_stub_cache_misses(), 1, extra2, |
168 extra3); | 168 extra3); |
169 } | 169 } |
170 | 170 |
171 | 171 |
172 #undef __ | 172 #undef __ |
173 } // namespace internal | 173 } // namespace internal |
174 } // namespace v8 | 174 } // namespace v8 |
175 | 175 |
176 #endif // V8_TARGET_ARCH_PPC | 176 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |