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/handler-compiler.h" | 7 #include "src/ic/handler-compiler.h" |
8 | 8 |
9 #include "src/api-arguments.h" | 9 #include "src/api-arguments.h" |
10 #include "src/field-type.h" | 10 #include "src/field-type.h" |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 | 309 |
310 static void CompileCallLoadPropertyWithInterceptor( | 310 static void CompileCallLoadPropertyWithInterceptor( |
311 MacroAssembler* masm, Register receiver, Register holder, Register name, | 311 MacroAssembler* masm, Register receiver, Register holder, Register name, |
312 Handle<JSObject> holder_obj, Runtime::FunctionId id) { | 312 Handle<JSObject> holder_obj, Runtime::FunctionId id) { |
313 DCHECK(NamedLoadHandlerCompiler::kInterceptorArgsLength == | 313 DCHECK(NamedLoadHandlerCompiler::kInterceptorArgsLength == |
314 Runtime::FunctionForId(id)->nargs); | 314 Runtime::FunctionForId(id)->nargs); |
315 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); | 315 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); |
316 __ CallRuntime(id); | 316 __ CallRuntime(id); |
317 } | 317 } |
318 | 318 |
319 | |
320 static void StoreIC_PushArgs(MacroAssembler* masm) { | |
321 Register receiver = StoreDescriptor::ReceiverRegister(); | |
322 Register name = StoreDescriptor::NameRegister(); | |
323 Register value = StoreDescriptor::ValueRegister(); | |
324 Register slot = StoreWithVectorDescriptor::SlotRegister(); | |
325 Register vector = StoreWithVectorDescriptor::VectorRegister(); | |
326 | |
327 __ xchg(receiver, Operand(esp, 0)); | |
328 __ push(name); | |
329 __ push(value); | |
330 __ push(slot); | |
331 __ push(vector); | |
332 __ push(receiver); // which contains the return address. | |
333 } | |
334 | |
335 | |
336 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) { | |
337 // Return address is on the stack. | |
338 StoreIC_PushArgs(masm); | |
339 | |
340 // Do tail-call to runtime routine. | |
341 __ TailCallRuntime(Runtime::kKeyedStoreIC_Slow); | |
342 } | |
343 | |
344 | |
345 #undef __ | 319 #undef __ |
346 #define __ ACCESS_MASM(masm()) | 320 #define __ ACCESS_MASM(masm()) |
347 | 321 |
348 | 322 |
349 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label, | 323 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label, |
350 Handle<Name> name) { | 324 Handle<Name> name) { |
351 if (!label->is_unused()) { | 325 if (!label->is_unused()) { |
352 __ bind(label); | 326 __ bind(label); |
353 __ mov(this->name(), Immediate(name)); | 327 __ mov(this->name(), Immediate(name)); |
354 } | 328 } |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
711 // Return the generated code. | 685 // Return the generated code. |
712 return GetCode(kind(), name); | 686 return GetCode(kind(), name); |
713 } | 687 } |
714 | 688 |
715 | 689 |
716 #undef __ | 690 #undef __ |
717 } // namespace internal | 691 } // namespace internal |
718 } // namespace v8 | 692 } // namespace v8 |
719 | 693 |
720 #endif // V8_TARGET_ARCH_X87 | 694 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |