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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
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" |
11 | 11 |
12 namespace v8 { | 12 namespace v8 { |
13 namespace internal { | 13 namespace internal { |
14 | 14 |
15 // ---------------------------------------------------------------------------- | |
16 // Static IC stub generators. | |
17 // | |
18 | |
19 #define __ ACCESS_MASM(masm) | |
20 | |
21 static void StoreIC_PushArgs(MacroAssembler* masm) { | |
22 Register receiver = StoreWithVectorDescriptor::ReceiverRegister(); | |
23 Register name = StoreWithVectorDescriptor::NameRegister(); | |
24 | |
25 STATIC_ASSERT(StoreWithVectorDescriptor::kStackArgumentsCount == 3); | |
26 // Current stack layout: | |
27 // - esp[12] -- value | |
28 // - esp[8] -- slot | |
29 // - esp[4] -- vector | |
30 // - esp[0] -- return address | |
31 | |
32 Register return_address = StoreWithVectorDescriptor::SlotRegister(); | |
33 __ pop(return_address); | |
34 __ push(receiver); | |
35 __ push(name); | |
36 __ push(return_address); | |
37 } | |
38 | |
39 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { | |
40 // Return address is on the stack. | |
41 StoreIC_PushArgs(masm); | |
42 | |
43 // Do tail-call to runtime routine. | |
44 __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss); | |
45 } | |
46 | |
47 void KeyedStoreIC::GenerateSlow(MacroAssembler* masm) { | |
48 // Return address is on the stack. | |
49 StoreIC_PushArgs(masm); | |
50 | |
51 // Do tail-call to runtime routine. | |
52 __ TailCallRuntime(Runtime::kKeyedStoreIC_Slow); | |
53 } | |
54 | |
55 #undef __ | |
56 | |
57 | 15 |
58 Condition CompareIC::ComputeCondition(Token::Value op) { | 16 Condition CompareIC::ComputeCondition(Token::Value op) { |
59 switch (op) { | 17 switch (op) { |
60 case Token::EQ_STRICT: | 18 case Token::EQ_STRICT: |
61 case Token::EQ: | 19 case Token::EQ: |
62 return equal; | 20 return equal; |
63 case Token::LT: | 21 case Token::LT: |
64 return less; | 22 return less; |
65 case Token::GT: | 23 case Token::GT: |
66 return greater; | 24 return greater; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 Condition cc = | 79 Condition cc = |
122 (check == ENABLE_INLINED_SMI_CHECK) | 80 (check == ENABLE_INLINED_SMI_CHECK) |
123 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 81 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
124 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 82 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
125 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 83 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
126 } | 84 } |
127 } // namespace internal | 85 } // namespace internal |
128 } // namespace v8 | 86 } // namespace v8 |
129 | 87 |
130 #endif // V8_TARGET_ARCH_IA32 | 88 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |