aboutsummaryrefslogtreecommitdiff
path: root/src/ic/ia32/ic-compiler-ia32.cc
blob: a52f04689aa52821adfa229d067b3b903f3ea768 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#if V8_TARGET_ARCH_IA32

#include "src/ic/ic.h"
#include "src/ic/ic-compiler.h"

namespace v8 {
namespace internal {

#define __ ACCESS_MASM(masm)


void PropertyICCompiler::GenerateRuntimeSetProperty(
    MacroAssembler* masm, LanguageMode language_mode) {
  typedef StoreWithVectorDescriptor Descriptor;
  STATIC_ASSERT(Descriptor::kStackArgumentsCount == 3);
  // ----------- S t a t e -------------
  //  -- esp[12] : value
  //  -- esp[8]  : slot
  //  -- esp[4]  : vector
  //  -- esp[0]  : return address
  // -----------------------------------
  __ LoadParameterFromStack<Descriptor>(Descriptor::ValueRegister(),
                                        Descriptor::kValue);

  __ mov(Operand(esp, 12), Descriptor::ReceiverRegister());
  __ mov(Operand(esp, 8), Descriptor::NameRegister());
  __ mov(Operand(esp, 4), Descriptor::ValueRegister());
  __ pop(ebx);
  __ push(Immediate(Smi::FromInt(language_mode)));
  __ push(ebx);  // return address

  // Do tail-call to runtime routine.
  __ TailCallRuntime(Runtime::kSetProperty);
}


#undef __
}  // namespace internal
}  // namespace v8

#endif  // V8_TARGET_ARCH_IA32