OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
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 24 matching lines...) Expand all Loading... |
35 DCHECK((value_off_addr - key_off_addr) < (256 * 4)); | 35 DCHECK((value_off_addr - key_off_addr) < (256 * 4)); |
36 DCHECK(map_off_addr > key_off_addr); | 36 DCHECK(map_off_addr > key_off_addr); |
37 DCHECK((map_off_addr - key_off_addr) % 4 == 0); | 37 DCHECK((map_off_addr - key_off_addr) % 4 == 0); |
38 DCHECK((map_off_addr - key_off_addr) < (256 * 4)); | 38 DCHECK((map_off_addr - key_off_addr) < (256 * 4)); |
39 | 39 |
40 Label miss; | 40 Label miss; |
41 Register base_addr = scratch; | 41 Register base_addr = scratch; |
42 scratch = no_reg; | 42 scratch = no_reg; |
43 | 43 |
44 // Multiply by 3 because there are 3 fields per entry (name, code, map). | 44 // Multiply by 3 because there are 3 fields per entry (name, code, map). |
45 __ dsll(offset_scratch, offset, 1); | 45 __ Dlsa(offset_scratch, offset, offset, 1); |
46 __ Daddu(offset_scratch, offset_scratch, offset); | |
47 | 46 |
48 // Calculate the base address of the entry. | 47 // Calculate the base address of the entry. |
49 __ li(base_addr, Operand(key_offset)); | 48 __ li(base_addr, Operand(key_offset)); |
50 __ dsll(at, offset_scratch, kPointerSizeLog2); | 49 __ Dlsa(base_addr, base_addr, offset_scratch, kPointerSizeLog2); |
51 __ Daddu(base_addr, base_addr, at); | |
52 | 50 |
53 // Check that the key in the entry matches the name. | 51 // Check that the key in the entry matches the name. |
54 __ ld(at, MemOperand(base_addr, 0)); | 52 __ ld(at, MemOperand(base_addr, 0)); |
55 __ Branch(&miss, ne, name, Operand(at)); | 53 __ Branch(&miss, ne, name, Operand(at)); |
56 | 54 |
57 // Check the map matches. | 55 // Check the map matches. |
58 __ ld(at, MemOperand(base_addr, | 56 __ ld(at, MemOperand(base_addr, |
59 static_cast<int32_t>(map_off_addr - key_off_addr))); | 57 static_cast<int32_t>(map_off_addr - key_off_addr))); |
60 __ ld(scratch2, FieldMemOperand(receiver, HeapObject::kMapOffset)); | 58 __ ld(scratch2, FieldMemOperand(receiver, HeapObject::kMapOffset)); |
61 __ Branch(&miss, ne, at, Operand(scratch2)); | 59 __ Branch(&miss, ne, at, Operand(scratch2)); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 __ IncrementCounter(counters->megamorphic_stub_cache_misses(), 1, extra2, | 168 __ IncrementCounter(counters->megamorphic_stub_cache_misses(), 1, extra2, |
171 extra3); | 169 extra3); |
172 } | 170 } |
173 | 171 |
174 | 172 |
175 #undef __ | 173 #undef __ |
176 } // namespace internal | 174 } // namespace internal |
177 } // namespace v8 | 175 } // namespace v8 |
178 | 176 |
179 #endif // V8_TARGET_ARCH_MIPS64 | 177 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |