1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #if V8_TARGET_ARCH_IA32
6 
7 #include "src/ic/ic.h"
8 #include "src/ic/ic-compiler.h"
9 
10 namespace v8 {
11 namespace internal {
12 
13 #define __ ACCESS_MASM(masm)
14 
15 
GenerateRuntimeSetProperty(MacroAssembler * masm,LanguageMode language_mode)16 void PropertyICCompiler::GenerateRuntimeSetProperty(
17     MacroAssembler* masm, LanguageMode language_mode) {
18   typedef StoreWithVectorDescriptor Descriptor;
19   STATIC_ASSERT(Descriptor::kStackArgumentsCount == 3);
20   // ----------- S t a t e -------------
21   //  -- esp[12] : value
22   //  -- esp[8]  : slot
23   //  -- esp[4]  : vector
24   //  -- esp[0]  : return address
25   // -----------------------------------
26   __ LoadParameterFromStack<Descriptor>(Descriptor::ValueRegister(),
27                                         Descriptor::kValue);
28 
29   __ mov(Operand(esp, 12), Descriptor::ReceiverRegister());
30   __ mov(Operand(esp, 8), Descriptor::NameRegister());
31   __ mov(Operand(esp, 4), Descriptor::ValueRegister());
32   __ pop(ebx);
33   __ push(Immediate(Smi::FromInt(language_mode)));
34   __ push(ebx);  // return address
35 
36   // Do tail-call to runtime routine.
37   __ TailCallRuntime(Runtime::kSetProperty);
38 }
39 
40 
41 #undef __
42 }  // namespace internal
43 }  // namespace v8
44 
45 #endif  // V8_TARGET_ARCH_IA32
46