OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_S390 | 5 #if V8_TARGET_ARCH_S390 |
6 | 6 |
7 #include "src/ic/stub-cache.h" | 7 #include "src/ic/stub-cache.h" |
8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
9 #include "src/ic/ic.h" | 9 #include "src/ic/ic.h" |
10 #include "src/interface-descriptors.h" | 10 #include "src/interface-descriptors.h" |
11 | 11 |
12 namespace v8 { | 12 namespace v8 { |
13 namespace internal { | 13 namespace internal { |
14 | 14 |
15 #define __ ACCESS_MASM(masm) | 15 #define __ ACCESS_MASM(masm) |
16 | 16 |
17 static void ProbeTable(Isolate* isolate, MacroAssembler* masm, | 17 static void ProbeTable(Isolate* isolate, MacroAssembler* masm, |
18 Code::Kind ic_kind, Code::Flags flags, | 18 Code::Flags flags, StubCache::Table table, |
19 StubCache::Table table, Register receiver, Register name, | 19 Register receiver, Register name, |
20 // Number of the cache entry, not scaled. | 20 // Number of the cache entry, not scaled. |
21 Register offset, Register scratch, Register scratch2, | 21 Register offset, Register scratch, Register scratch2, |
22 Register offset_scratch) { | 22 Register offset_scratch) { |
23 ExternalReference key_offset(isolate->stub_cache()->key_reference(table)); | 23 ExternalReference key_offset(isolate->stub_cache()->key_reference(table)); |
24 ExternalReference value_offset(isolate->stub_cache()->value_reference(table)); | 24 ExternalReference value_offset(isolate->stub_cache()->value_reference(table)); |
25 ExternalReference map_offset(isolate->stub_cache()->map_reference(table)); | 25 ExternalReference map_offset(isolate->stub_cache()->map_reference(table)); |
26 | 26 |
27 uintptr_t key_off_addr = reinterpret_cast<uintptr_t>(key_offset.address()); | 27 uintptr_t key_off_addr = reinterpret_cast<uintptr_t>(key_offset.address()); |
28 uintptr_t value_off_addr = | 28 uintptr_t value_off_addr = |
29 reinterpret_cast<uintptr_t>(value_offset.address()); | 29 reinterpret_cast<uintptr_t>(value_offset.address()); |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 // Get the map of the receiver and compute the hash. | 150 // Get the map of the receiver and compute the hash. |
151 __ LoadlW(scratch, FieldMemOperand(name, Name::kHashFieldOffset)); | 151 __ LoadlW(scratch, FieldMemOperand(name, Name::kHashFieldOffset)); |
152 __ LoadP(ip, FieldMemOperand(receiver, HeapObject::kMapOffset)); | 152 __ LoadP(ip, FieldMemOperand(receiver, HeapObject::kMapOffset)); |
153 __ AddP(scratch, scratch, ip); | 153 __ AddP(scratch, scratch, ip); |
154 __ XorP(scratch, scratch, Operand(flags)); | 154 __ XorP(scratch, scratch, Operand(flags)); |
155 // The mask omits the last two bits because they are not part of the hash. | 155 // The mask omits the last two bits because they are not part of the hash. |
156 __ AndP(scratch, scratch, | 156 __ AndP(scratch, scratch, |
157 Operand((kPrimaryTableSize - 1) << kCacheIndexShift)); | 157 Operand((kPrimaryTableSize - 1) << kCacheIndexShift)); |
158 | 158 |
159 // Probe the primary table. | 159 // Probe the primary table. |
160 ProbeTable(isolate, masm, ic_kind, flags, kPrimary, receiver, name, scratch, | 160 ProbeTable(isolate, masm, flags, kPrimary, receiver, name, scratch, extra, |
161 extra, extra2, extra3); | 161 extra2, extra3); |
162 | 162 |
163 // Primary miss: Compute hash for secondary probe. | 163 // Primary miss: Compute hash for secondary probe. |
164 __ SubP(scratch, scratch, name); | 164 __ SubP(scratch, scratch, name); |
165 __ AddP(scratch, scratch, Operand(flags)); | 165 __ AddP(scratch, scratch, Operand(flags)); |
166 __ AndP(scratch, scratch, | 166 __ AndP(scratch, scratch, |
167 Operand((kSecondaryTableSize - 1) << kCacheIndexShift)); | 167 Operand((kSecondaryTableSize - 1) << kCacheIndexShift)); |
168 | 168 |
169 // Probe the secondary table. | 169 // Probe the secondary table. |
170 ProbeTable(isolate, masm, ic_kind, flags, kSecondary, receiver, name, scratch, | 170 ProbeTable(isolate, masm, flags, kSecondary, receiver, name, scratch, extra, |
171 extra, extra2, extra3); | 171 extra2, extra3); |
172 | 172 |
173 // Cache miss: Fall-through and let caller handle the miss by | 173 // Cache miss: Fall-through and let caller handle the miss by |
174 // entering the runtime system. | 174 // entering the runtime system. |
175 __ bind(&miss); | 175 __ bind(&miss); |
176 __ IncrementCounter(counters->megamorphic_stub_cache_misses(), 1, extra2, | 176 __ IncrementCounter(counters->megamorphic_stub_cache_misses(), 1, extra2, |
177 extra3); | 177 extra3); |
178 } | 178 } |
179 | 179 |
180 #undef __ | 180 #undef __ |
181 } // namespace internal | 181 } // namespace internal |
182 } // namespace v8 | 182 } // namespace v8 |
183 | 183 |
184 #endif // V8_TARGET_ARCH_S390 | 184 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |