Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(419)

Side by Side Diff: src/ic/ia32/stub-cache-ia32.cc

Issue 1883533003: Don't use the keyed slow stub for named handlers. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ic/ia32/ic-ia32.cc ('k') | src/ic/ic.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_IA32 5 #if V8_TARGET_ARCH_IA32
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"
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
18 static void ProbeTable(Isolate* isolate, MacroAssembler* masm, 17 static void ProbeTable(Isolate* isolate, MacroAssembler* masm,
19 Code::Kind ic_kind, Code::Flags flags, 18 Code::Flags flags, StubCache::Table table, Register name,
20 StubCache::Table table, Register name, Register receiver, 19 Register receiver,
21 // Number of the cache entry pointer-size scaled. 20 // Number of the cache entry pointer-size scaled.
22 Register offset, Register extra) { 21 Register offset, Register extra) {
23 ExternalReference key_offset(isolate->stub_cache()->key_reference(table)); 22 ExternalReference key_offset(isolate->stub_cache()->key_reference(table));
24 ExternalReference value_offset(isolate->stub_cache()->value_reference(table)); 23 ExternalReference value_offset(isolate->stub_cache()->value_reference(table));
25 ExternalReference map_offset(isolate->stub_cache()->map_reference(table)); 24 ExternalReference map_offset(isolate->stub_cache()->map_reference(table));
26 ExternalReference virtual_register = 25 ExternalReference virtual_register =
27 ExternalReference::virtual_handler_register(masm->isolate()); 26 ExternalReference::virtual_handler_register(masm->isolate());
28 27
29 Label miss; 28 Label miss;
30 bool is_vector_store = 29 bool is_vector_store =
31 IC::ICUseVector(ic_kind) && 30 IC::ICUseVector(ic_kind) &&
Jakob Kummerow 2016/04/13 18:39:48 With |ic_kind| gone, this isn't going to compile,
32 (ic_kind == Code::STORE_IC || ic_kind == Code::KEYED_STORE_IC); 31 (ic_kind == Code::STORE_IC || ic_kind == Code::KEYED_STORE_IC);
33 32
34 // Multiply by 3 because there are 3 fields per entry (name, code, map). 33 // Multiply by 3 because there are 3 fields per entry (name, code, map).
35 __ lea(offset, Operand(offset, offset, times_2, 0)); 34 __ lea(offset, Operand(offset, offset, times_2, 0));
36 35
37 if (extra.is_valid()) { 36 if (extra.is_valid()) {
38 // Get the code entry from the cache. 37 // Get the code entry from the cache.
39 __ mov(extra, Operand::StaticArray(offset, times_1, value_offset)); 38 __ mov(extra, Operand::StaticArray(offset, times_1, value_offset));
40 39
41 // Check that the key in the entry matches the name. 40 // Check that the key in the entry matches the name.
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 __ add(offset, FieldOperand(receiver, HeapObject::kMapOffset)); 178 __ add(offset, FieldOperand(receiver, HeapObject::kMapOffset));
180 __ xor_(offset, flags); 179 __ xor_(offset, flags);
181 // We mask out the last two bits because they are not part of the hash and 180 // We mask out the last two bits because they are not part of the hash and
182 // they are always 01 for maps. Also in the two 'and' instructions below. 181 // they are always 01 for maps. Also in the two 'and' instructions below.
183 __ and_(offset, (kPrimaryTableSize - 1) << kCacheIndexShift); 182 __ and_(offset, (kPrimaryTableSize - 1) << kCacheIndexShift);
184 // ProbeTable expects the offset to be pointer scaled, which it is, because 183 // ProbeTable expects the offset to be pointer scaled, which it is, because
185 // the heap object tag size is 2 and the pointer size log 2 is also 2. 184 // the heap object tag size is 2 and the pointer size log 2 is also 2.
186 DCHECK(kCacheIndexShift == kPointerSizeLog2); 185 DCHECK(kCacheIndexShift == kPointerSizeLog2);
187 186
188 // Probe the primary table. 187 // Probe the primary table.
189 ProbeTable(isolate(), masm, ic_kind, flags, kPrimary, name, receiver, offset, 188 ProbeTable(isolate(), masm, flags, kPrimary, name, receiver, offset, extra);
190 extra);
191 189
192 // Primary miss: Compute hash for secondary probe. 190 // Primary miss: Compute hash for secondary probe.
193 __ mov(offset, FieldOperand(name, Name::kHashFieldOffset)); 191 __ mov(offset, FieldOperand(name, Name::kHashFieldOffset));
194 __ add(offset, FieldOperand(receiver, HeapObject::kMapOffset)); 192 __ add(offset, FieldOperand(receiver, HeapObject::kMapOffset));
195 __ xor_(offset, flags); 193 __ xor_(offset, flags);
196 __ and_(offset, (kPrimaryTableSize - 1) << kCacheIndexShift); 194 __ and_(offset, (kPrimaryTableSize - 1) << kCacheIndexShift);
197 __ sub(offset, name); 195 __ sub(offset, name);
198 __ add(offset, Immediate(flags)); 196 __ add(offset, Immediate(flags));
199 __ and_(offset, (kSecondaryTableSize - 1) << kCacheIndexShift); 197 __ and_(offset, (kSecondaryTableSize - 1) << kCacheIndexShift);
200 198
201 // Probe the secondary table. 199 // Probe the secondary table.
202 ProbeTable(isolate(), masm, ic_kind, flags, kSecondary, name, receiver, 200 ProbeTable(isolate(), masm, flags, kSecondary, name, receiver, offset, extra);
203 offset, extra);
204 201
205 // Cache miss: Fall-through and let caller handle the miss by 202 // Cache miss: Fall-through and let caller handle the miss by
206 // entering the runtime system. 203 // entering the runtime system.
207 __ bind(&miss); 204 __ bind(&miss);
208 __ IncrementCounter(counters->megamorphic_stub_cache_misses(), 1); 205 __ IncrementCounter(counters->megamorphic_stub_cache_misses(), 1);
209 } 206 }
210 207
211 208
212 #undef __ 209 #undef __
213 } // namespace internal 210 } // namespace internal
214 } // namespace v8 211 } // namespace v8
215 212
216 #endif // V8_TARGET_ARCH_IA32 213 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ic/ia32/ic-ia32.cc ('k') | src/ic/ic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698