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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
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 __ sll(offset_scratch, offset, 1); | 45 __ Lsa(offset_scratch, offset, offset, 1); |
46 __ Addu(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 __ sll(at, offset_scratch, kPointerSizeLog2); | 49 __ Lsa(base_addr, base_addr, offset_scratch, kPointerSizeLog2); |
51 __ Addu(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 __ lw(at, MemOperand(base_addr, 0)); | 52 __ lw(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 __ lw(at, MemOperand(base_addr, map_off_addr - key_off_addr)); | 56 __ lw(at, MemOperand(base_addr, map_off_addr - key_off_addr)); |
59 __ lw(scratch2, FieldMemOperand(receiver, HeapObject::kMapOffset)); | 57 __ lw(scratch2, FieldMemOperand(receiver, HeapObject::kMapOffset)); |
60 __ Branch(&miss, ne, at, Operand(scratch2)); | 58 __ Branch(&miss, ne, at, Operand(scratch2)); |
61 | 59 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 __ IncrementCounter(counters->megamorphic_stub_cache_misses(), 1, extra2, | 165 __ IncrementCounter(counters->megamorphic_stub_cache_misses(), 1, extra2, |
168 extra3); | 166 extra3); |
169 } | 167 } |
170 | 168 |
171 | 169 |
172 #undef __ | 170 #undef __ |
173 } // namespace internal | 171 } // namespace internal |
174 } // namespace v8 | 172 } // namespace v8 |
175 | 173 |
176 #endif // V8_TARGET_ARCH_MIPS | 174 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |