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/ic/call-optimization.h" | 7 #include "src/ic/call-optimization.h" |
8 #include "src/ic/handler-compiler.h" | 8 #include "src/ic/handler-compiler.h" |
9 #include "src/ic/ic.h" | 9 #include "src/ic/ic.h" |
10 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 Handle<JSObject> holder_obj, Runtime::FunctionId id) { | 296 Handle<JSObject> holder_obj, Runtime::FunctionId id) { |
297 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); | 297 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); |
298 __ CallRuntime(id, NamedLoadHandlerCompiler::kInterceptorArgsLength); | 298 __ CallRuntime(id, NamedLoadHandlerCompiler::kInterceptorArgsLength); |
299 } | 299 } |
300 | 300 |
301 | 301 |
302 static void StoreIC_PushArgs(MacroAssembler* masm) { | 302 static void StoreIC_PushArgs(MacroAssembler* masm) { |
303 Register receiver = StoreDescriptor::ReceiverRegister(); | 303 Register receiver = StoreDescriptor::ReceiverRegister(); |
304 Register name = StoreDescriptor::NameRegister(); | 304 Register name = StoreDescriptor::NameRegister(); |
305 Register value = StoreDescriptor::ValueRegister(); | 305 Register value = StoreDescriptor::ValueRegister(); |
| 306 Register slot = VectorStoreICDescriptor::SlotRegister(); |
| 307 Register vector = VectorStoreICDescriptor::VectorRegister(); |
306 | 308 |
307 if (FLAG_vector_stores) { | 309 __ xchg(receiver, Operand(esp, 0)); |
308 Register slot = VectorStoreICDescriptor::SlotRegister(); | 310 __ push(name); |
309 Register vector = VectorStoreICDescriptor::VectorRegister(); | 311 __ push(value); |
310 | 312 __ push(slot); |
311 __ xchg(receiver, Operand(esp, 0)); | 313 __ push(vector); |
312 __ push(name); | 314 __ push(receiver); // which contains the return address. |
313 __ push(value); | |
314 __ push(slot); | |
315 __ push(vector); | |
316 __ push(receiver); // which contains the return address. | |
317 } else { | |
318 DCHECK(!ebx.is(receiver) && !ebx.is(name) && !ebx.is(value)); | |
319 __ pop(ebx); | |
320 __ push(receiver); | |
321 __ push(name); | |
322 __ push(value); | |
323 __ push(ebx); | |
324 } | |
325 } | 315 } |
326 | 316 |
327 | 317 |
328 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { | 318 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { |
329 // Return address is on the stack. | 319 // Return address is on the stack. |
330 StoreIC_PushArgs(masm); | 320 StoreIC_PushArgs(masm); |
331 | 321 |
332 // Do tail-call to runtime routine. | 322 // Do tail-call to runtime routine. |
333 __ TailCallRuntime(Runtime::kStoreIC_Slow, FLAG_vector_stores ? 5 : 3, 1); | 323 __ TailCallRuntime(Runtime::kStoreIC_Slow, 5, 1); |
334 } | 324 } |
335 | 325 |
336 | 326 |
337 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) { | 327 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) { |
338 // Return address is on the stack. | 328 // Return address is on the stack. |
339 StoreIC_PushArgs(masm); | 329 StoreIC_PushArgs(masm); |
340 | 330 |
341 // Do tail-call to runtime routine. | 331 // Do tail-call to runtime routine. |
342 __ TailCallRuntime(Runtime::kKeyedStoreIC_Slow, FLAG_vector_stores ? 5 : 3, | 332 __ TailCallRuntime(Runtime::kKeyedStoreIC_Slow, 5, 1); |
343 1); | |
344 } | 333 } |
345 | 334 |
346 | 335 |
347 #undef __ | 336 #undef __ |
348 #define __ ACCESS_MASM(masm()) | 337 #define __ ACCESS_MASM(masm()) |
349 | 338 |
350 | 339 |
351 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label, | 340 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label, |
352 Handle<Name> name) { | 341 Handle<Name> name) { |
353 if (!label->is_unused()) { | 342 if (!label->is_unused()) { |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
821 // Return the generated code. | 810 // Return the generated code. |
822 return GetCode(kind(), Code::NORMAL, name); | 811 return GetCode(kind(), Code::NORMAL, name); |
823 } | 812 } |
824 | 813 |
825 | 814 |
826 #undef __ | 815 #undef __ |
827 } // namespace internal | 816 } // namespace internal |
828 } // namespace v8 | 817 } // namespace v8 |
829 | 818 |
830 #endif // V8_TARGET_ARCH_X87 | 819 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |