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

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

Issue 1303053004: Revert of Vector ICs: platform support for vector-based stores. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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/mips/access-compiler-mips.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_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 17
18 static void ProbeTable(Isolate* isolate, MacroAssembler* masm, 18 static void ProbeTable(Isolate* isolate, MacroAssembler* masm,
19 Code::Kind ic_kind, Code::Flags flags, 19 Code::Kind ic_kind, Code::Flags flags,
20 StubCache::Table table, Register name, Register receiver, 20 StubCache::Table table, Register name, Register receiver,
21 // Number of the cache entry pointer-size scaled. 21 // Number of the cache entry pointer-size scaled.
22 Register offset, Register extra) { 22 Register offset, Register extra) {
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 Label miss; 27 Label miss;
28 bool is_vector_store =
29 IC::ICUseVector(ic_kind) &&
30 (ic_kind == Code::STORE_IC || ic_kind == Code::KEYED_STORE_IC);
31 28
32 // Multiply by 3 because there are 3 fields per entry (name, code, map). 29 // Multiply by 3 because there are 3 fields per entry (name, code, map).
33 __ lea(offset, Operand(offset, offset, times_2, 0)); 30 __ lea(offset, Operand(offset, offset, times_2, 0));
34 31
35 if (extra.is_valid()) { 32 if (extra.is_valid()) {
36 // Get the code entry from the cache. 33 // Get the code entry from the cache.
37 __ mov(extra, Operand::StaticArray(offset, times_1, value_offset)); 34 __ mov(extra, Operand::StaticArray(offset, times_1, value_offset));
38 35
39 // Check that the key in the entry matches the name. 36 // Check that the key in the entry matches the name.
40 __ cmp(name, Operand::StaticArray(offset, times_1, key_offset)); 37 __ cmp(name, Operand::StaticArray(offset, times_1, key_offset));
(...skipping 11 matching lines...) Expand all
52 __ j(not_equal, &miss); 49 __ j(not_equal, &miss);
53 50
54 #ifdef DEBUG 51 #ifdef DEBUG
55 if (FLAG_test_secondary_stub_cache && table == StubCache::kPrimary) { 52 if (FLAG_test_secondary_stub_cache && table == StubCache::kPrimary) {
56 __ jmp(&miss); 53 __ jmp(&miss);
57 } else if (FLAG_test_primary_stub_cache && table == StubCache::kSecondary) { 54 } else if (FLAG_test_primary_stub_cache && table == StubCache::kSecondary) {
58 __ jmp(&miss); 55 __ jmp(&miss);
59 } 56 }
60 #endif 57 #endif
61 58
62 // The vector and slot were pushed onto the stack before starting the 59 if (IC::ICUseVector(ic_kind)) {
63 // probe, and need to be dropped before calling the handler. 60 // The vector and slot were pushed onto the stack before starting the
64 if (is_vector_store) { 61 // probe, and need to be dropped before calling the handler.
65 // The overlap here is rather embarrassing. One does what one must.
66 Register vector = VectorStoreICDescriptor::VectorRegister();
67 DCHECK(extra.is(VectorStoreICDescriptor::SlotRegister()));
68 __ add(extra, Immediate(Code::kHeaderSize - kHeapObjectTag));
69 __ pop(vector);
70 __ xchg(extra, Operand(esp, 0));
71 // Jump to the first instruction in the code stub.
72 __ ret(0);
73 } else {
74 __ pop(LoadWithVectorDescriptor::VectorRegister()); 62 __ pop(LoadWithVectorDescriptor::VectorRegister());
75 __ pop(LoadDescriptor::SlotRegister()); 63 __ pop(LoadDescriptor::SlotRegister());
76 __ add(extra, Immediate(Code::kHeaderSize - kHeapObjectTag));
77 __ jmp(extra);
78 } 64 }
79 65
66 // Jump to the first instruction in the code stub.
67 __ add(extra, Immediate(Code::kHeaderSize - kHeapObjectTag));
68 __ jmp(extra);
69
80 __ bind(&miss); 70 __ bind(&miss);
81 } else { 71 } else {
82 DCHECK(ic_kind == Code::STORE_IC || ic_kind == Code::KEYED_STORE_IC);
83
84 // Save the offset on the stack. 72 // Save the offset on the stack.
85 __ push(offset); 73 __ push(offset);
86 74
87 // Check that the key in the entry matches the name. 75 // Check that the key in the entry matches the name.
88 __ cmp(name, Operand::StaticArray(offset, times_1, key_offset)); 76 __ cmp(name, Operand::StaticArray(offset, times_1, key_offset));
89 __ j(not_equal, &miss); 77 __ j(not_equal, &miss);
90 78
91 // Check the map matches. 79 // Check the map matches.
92 __ mov(offset, Operand::StaticArray(offset, times_1, map_offset)); 80 __ mov(offset, Operand::StaticArray(offset, times_1, map_offset));
93 __ cmp(offset, FieldOperand(receiver, HeapObject::kMapOffset)); 81 __ cmp(offset, FieldOperand(receiver, HeapObject::kMapOffset));
(...skipping 16 matching lines...) Expand all
110 __ jmp(&miss); 98 __ jmp(&miss);
111 } else if (FLAG_test_primary_stub_cache && table == StubCache::kSecondary) { 99 } else if (FLAG_test_primary_stub_cache && table == StubCache::kSecondary) {
112 __ jmp(&miss); 100 __ jmp(&miss);
113 } 101 }
114 #endif 102 #endif
115 103
116 // Restore offset and re-load code entry from cache. 104 // Restore offset and re-load code entry from cache.
117 __ pop(offset); 105 __ pop(offset);
118 __ mov(offset, Operand::StaticArray(offset, times_1, value_offset)); 106 __ mov(offset, Operand::StaticArray(offset, times_1, value_offset));
119 107
120 // Jump to the first instruction in the code stub. 108 if (IC::ICUseVector(ic_kind)) {
121 if (is_vector_store) {
122 // The vector and slot were pushed onto the stack before starting the 109 // The vector and slot were pushed onto the stack before starting the
123 // probe, and need to be dropped before calling the handler. 110 // probe, and need to be dropped before calling the handler.
124 Register vector = VectorStoreICDescriptor::VectorRegister(); 111 Register vector = LoadWithVectorDescriptor::VectorRegister();
125 DCHECK(offset.is(VectorStoreICDescriptor::SlotRegister())); 112 Register slot = LoadDescriptor::SlotRegister();
126 __ add(offset, Immediate(Code::kHeaderSize - kHeapObjectTag)); 113 DCHECK(!offset.is(vector) && !offset.is(slot));
114
127 __ pop(vector); 115 __ pop(vector);
128 __ xchg(offset, Operand(esp, 0)); 116 __ pop(slot);
129 __ ret(0);
130 } else {
131 __ add(offset, Immediate(Code::kHeaderSize - kHeapObjectTag));
132 __ jmp(offset);
133 } 117 }
134 118
119 // Jump to the first instruction in the code stub.
120 __ add(offset, Immediate(Code::kHeaderSize - kHeapObjectTag));
121 __ jmp(offset);
122
135 // Pop at miss. 123 // Pop at miss.
136 __ bind(&miss); 124 __ bind(&miss);
137 __ pop(offset); 125 __ pop(offset);
138 } 126 }
139 } 127 }
140 128
141 129
142 void StubCache::GenerateProbe(MacroAssembler* masm, Code::Kind ic_kind, 130 void StubCache::GenerateProbe(MacroAssembler* masm, Code::Kind ic_kind,
143 Code::Flags flags, Register receiver, 131 Code::Flags flags, Register receiver,
144 Register name, Register scratch, Register extra, 132 Register name, Register scratch, Register extra,
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 __ bind(&miss); 194 __ bind(&miss);
207 __ IncrementCounter(counters->megamorphic_stub_cache_misses(), 1); 195 __ IncrementCounter(counters->megamorphic_stub_cache_misses(), 1);
208 } 196 }
209 197
210 198
211 #undef __ 199 #undef __
212 } // namespace internal 200 } // namespace internal
213 } // namespace v8 201 } // namespace v8
214 202
215 #endif // V8_TARGET_ARCH_IA32 203 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ic/ia32/ic-ia32.cc ('k') | src/ic/mips/access-compiler-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698