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

Side by Side Diff: src/ic/arm/stub-cache-arm.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/arm/ic-arm.cc ('k') | src/ic/arm64/ic-arm64.cc » ('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_ARM 5 #if V8_TARGET_ARCH_ARM
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,
20 StubCache::Table table, Register receiver, Register name, 19 Register receiver, Register name,
21 // Number of the cache entry, not scaled. 20 // Number of the cache entry, not scaled.
22 Register offset, Register scratch, Register scratch2, 21 Register offset, Register scratch, Register scratch2,
23 Register offset_scratch) { 22 Register offset_scratch) {
24 ExternalReference key_offset(isolate->stub_cache()->key_reference(table)); 23 ExternalReference key_offset(isolate->stub_cache()->key_reference(table));
25 ExternalReference value_offset(isolate->stub_cache()->value_reference(table)); 24 ExternalReference value_offset(isolate->stub_cache()->value_reference(table));
26 ExternalReference map_offset(isolate->stub_cache()->map_reference(table)); 25 ExternalReference map_offset(isolate->stub_cache()->map_reference(table));
27 26
28 uint32_t key_off_addr = reinterpret_cast<uint32_t>(key_offset.address()); 27 uint32_t key_off_addr = reinterpret_cast<uint32_t>(key_offset.address());
29 uint32_t value_off_addr = reinterpret_cast<uint32_t>(value_offset.address()); 28 uint32_t value_off_addr = reinterpret_cast<uint32_t>(value_offset.address());
30 uint32_t map_off_addr = reinterpret_cast<uint32_t>(map_offset.address()); 29 uint32_t map_off_addr = reinterpret_cast<uint32_t>(map_offset.address());
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 // We shift out the last two bits because they are not part of the hash and 143 // We shift out the last two bits because they are not part of the hash and
145 // they are always 01 for maps. 144 // they are always 01 for maps.
146 __ mov(scratch, Operand(scratch, LSR, kCacheIndexShift)); 145 __ mov(scratch, Operand(scratch, LSR, kCacheIndexShift));
147 // Mask down the eor argument to the minimum to keep the immediate 146 // Mask down the eor argument to the minimum to keep the immediate
148 // ARM-encodable. 147 // ARM-encodable.
149 __ eor(scratch, scratch, Operand((flags >> kCacheIndexShift) & mask)); 148 __ eor(scratch, scratch, Operand((flags >> kCacheIndexShift) & mask));
150 // Prefer and_ to ubfx here because ubfx takes 2 cycles. 149 // Prefer and_ to ubfx here because ubfx takes 2 cycles.
151 __ and_(scratch, scratch, Operand(mask)); 150 __ and_(scratch, scratch, Operand(mask));
152 151
153 // Probe the primary table. 152 // Probe the primary table.
154 ProbeTable(isolate, masm, ic_kind, flags, kPrimary, receiver, name, scratch, 153 ProbeTable(isolate, masm, flags, kPrimary, receiver, name, scratch, extra,
155 extra, extra2, extra3); 154 extra2, extra3);
156 155
157 // Primary miss: Compute hash for secondary probe. 156 // Primary miss: Compute hash for secondary probe.
158 __ sub(scratch, scratch, Operand(name, LSR, kCacheIndexShift)); 157 __ sub(scratch, scratch, Operand(name, LSR, kCacheIndexShift));
159 uint32_t mask2 = kSecondaryTableSize - 1; 158 uint32_t mask2 = kSecondaryTableSize - 1;
160 __ add(scratch, scratch, Operand((flags >> kCacheIndexShift) & mask2)); 159 __ add(scratch, scratch, Operand((flags >> kCacheIndexShift) & mask2));
161 __ and_(scratch, scratch, Operand(mask2)); 160 __ and_(scratch, scratch, Operand(mask2));
162 161
163 // Probe the secondary table. 162 // Probe the secondary table.
164 ProbeTable(isolate, masm, ic_kind, flags, kSecondary, receiver, name, scratch, 163 ProbeTable(isolate, masm, flags, kSecondary, receiver, name, scratch, extra,
165 extra, extra2, extra3); 164 extra2, extra3);
166 165
167 // Cache miss: Fall-through and let caller handle the miss by 166 // Cache miss: Fall-through and let caller handle the miss by
168 // entering the runtime system. 167 // entering the runtime system.
169 __ bind(&miss); 168 __ bind(&miss);
170 __ IncrementCounter(counters->megamorphic_stub_cache_misses(), 1, extra2, 169 __ IncrementCounter(counters->megamorphic_stub_cache_misses(), 1, extra2,
171 extra3); 170 extra3);
172 } 171 }
173 172
174 173
175 #undef __ 174 #undef __
176 } // namespace internal 175 } // namespace internal
177 } // namespace v8 176 } // namespace v8
178 177
179 #endif // V8_TARGET_ARCH_ARM 178 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/ic/arm/ic-arm.cc ('k') | src/ic/arm64/ic-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698