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_X87 | 5 #if V8_TARGET_ARCH_X87 |
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/ic-compiler.h" | 9 #include "src/ic/ic-compiler.h" |
10 #include "src/ic/stub-cache.h" | 10 #include "src/ic/stub-cache.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 JSObject::kPropertiesOffset)); | 131 JSObject::kPropertiesOffset)); |
132 GenerateDictionaryLoad(masm, &slow, dictionary, | 132 GenerateDictionaryLoad(masm, &slow, dictionary, |
133 LoadDescriptor::NameRegister(), edi, ebx, eax); | 133 LoadDescriptor::NameRegister(), edi, ebx, eax); |
134 __ ret(0); | 134 __ ret(0); |
135 | 135 |
136 // Dictionary load failed, go slow (but don't miss). | 136 // Dictionary load failed, go slow (but don't miss). |
137 __ bind(&slow); | 137 __ bind(&slow); |
138 GenerateRuntimeGetProperty(masm); | 138 GenerateRuntimeGetProperty(masm); |
139 } | 139 } |
140 | 140 |
141 | |
142 static void LoadIC_PushArgs(MacroAssembler* masm) { | |
143 Register receiver = LoadDescriptor::ReceiverRegister(); | |
144 Register name = LoadDescriptor::NameRegister(); | |
145 | |
146 Register slot = LoadDescriptor::SlotRegister(); | |
147 Register vector = LoadWithVectorDescriptor::VectorRegister(); | |
148 DCHECK(!edi.is(receiver) && !edi.is(name) && !edi.is(slot) && | |
149 !edi.is(vector)); | |
150 | |
151 __ pop(edi); | |
152 __ push(receiver); | |
153 __ push(name); | |
154 __ push(slot); | |
155 __ push(vector); | |
156 __ push(edi); | |
157 } | |
158 | |
159 | |
160 void LoadIC::GenerateMiss(MacroAssembler* masm) { | |
161 // Return address is on the stack. | |
162 __ IncrementCounter(masm->isolate()->counters()->ic_load_miss(), 1); | |
163 LoadIC_PushArgs(masm); | |
164 | |
165 // Perform tail call to the entry. | |
166 __ TailCallRuntime(Runtime::kLoadIC_Miss); | |
167 } | |
168 | |
169 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { | 141 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
170 // Return address is on the stack. | 142 // Return address is on the stack. |
171 Register receiver = LoadDescriptor::ReceiverRegister(); | 143 Register receiver = LoadDescriptor::ReceiverRegister(); |
172 Register name = LoadDescriptor::NameRegister(); | 144 Register name = LoadDescriptor::NameRegister(); |
173 DCHECK(!ebx.is(receiver) && !ebx.is(name)); | 145 DCHECK(!ebx.is(receiver) && !ebx.is(name)); |
174 | 146 |
175 __ pop(ebx); | 147 __ pop(ebx); |
176 __ push(receiver); | 148 __ push(receiver); |
177 __ push(name); | 149 __ push(name); |
178 __ push(ebx); | 150 __ push(ebx); |
179 | 151 |
180 // Do tail-call to runtime routine. | 152 // Do tail-call to runtime routine. |
181 __ TailCallRuntime(Runtime::kGetProperty); | 153 __ TailCallRuntime(Runtime::kGetProperty); |
182 } | 154 } |
183 | 155 |
184 | |
185 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { | |
186 // Return address is on the stack. | |
187 __ IncrementCounter(masm->isolate()->counters()->ic_keyed_load_miss(), 1); | |
188 | |
189 LoadIC_PushArgs(masm); | |
190 | |
191 // Perform tail call to the entry. | |
192 __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss); | |
193 } | |
194 | |
195 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { | |
196 // Return address is on the stack. | |
197 Register receiver = LoadDescriptor::ReceiverRegister(); | |
198 Register name = LoadDescriptor::NameRegister(); | |
199 DCHECK(!ebx.is(receiver) && !ebx.is(name)); | |
200 | |
201 __ pop(ebx); | |
202 __ push(receiver); | |
203 __ push(name); | |
204 __ push(ebx); | |
205 | |
206 // Do tail-call to runtime routine. | |
207 __ TailCallRuntime(Runtime::kKeyedGetProperty); | |
208 } | |
209 | |
210 static void StoreIC_PushArgs(MacroAssembler* masm) { | 156 static void StoreIC_PushArgs(MacroAssembler* masm) { |
211 Register receiver = StoreWithVectorDescriptor::ReceiverRegister(); | 157 Register receiver = StoreWithVectorDescriptor::ReceiverRegister(); |
212 Register name = StoreWithVectorDescriptor::NameRegister(); | 158 Register name = StoreWithVectorDescriptor::NameRegister(); |
213 | 159 |
214 STATIC_ASSERT(StoreWithVectorDescriptor::kStackArgumentsCount == 3); | 160 STATIC_ASSERT(StoreWithVectorDescriptor::kStackArgumentsCount == 3); |
215 // Current stack layout: | 161 // Current stack layout: |
216 // - esp[12] -- value | 162 // - esp[12] -- value |
217 // - esp[8] -- slot | 163 // - esp[8] -- slot |
218 // - esp[4] -- vector | 164 // - esp[4] -- vector |
219 // - esp[0] -- return address | 165 // - esp[0] -- return address |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 Condition cc = | 300 Condition cc = |
355 (check == ENABLE_INLINED_SMI_CHECK) | 301 (check == ENABLE_INLINED_SMI_CHECK) |
356 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 302 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
357 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 303 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
358 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 304 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
359 } | 305 } |
360 } // namespace internal | 306 } // namespace internal |
361 } // namespace v8 | 307 } // namespace v8 |
362 | 308 |
363 #endif // V8_TARGET_ARCH_X87 | 309 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |