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/stub-cache.h" | 9 #include "src/ic/stub-cache.h" |
10 #include "src/interface-descriptors.h" | 10 #include "src/interface-descriptors.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 __ jmp(&miss); | 59 __ jmp(&miss); |
60 } else if (FLAG_test_primary_stub_cache && table == StubCache::kSecondary) { | 60 } else if (FLAG_test_primary_stub_cache && table == StubCache::kSecondary) { |
61 __ jmp(&miss); | 61 __ jmp(&miss); |
62 } | 62 } |
63 #endif | 63 #endif |
64 | 64 |
65 // The vector and slot were pushed onto the stack before starting the | 65 // The vector and slot were pushed onto the stack before starting the |
66 // probe, and need to be dropped before calling the handler. | 66 // probe, and need to be dropped before calling the handler. |
67 if (is_vector_store) { | 67 if (is_vector_store) { |
68 // The overlap here is rather embarrassing. One does what one must. | 68 // The overlap here is rather embarrassing. One does what one must. |
69 Register vector = VectorStoreICDescriptor::VectorRegister(); | 69 Register vector = StoreWithVectorDescriptor::VectorRegister(); |
70 DCHECK(extra.is(VectorStoreICDescriptor::SlotRegister())); | 70 DCHECK(extra.is(StoreWithVectorDescriptor::SlotRegister())); |
71 __ add(extra, Immediate(Code::kHeaderSize - kHeapObjectTag)); | 71 __ add(extra, Immediate(Code::kHeaderSize - kHeapObjectTag)); |
72 __ pop(vector); | 72 __ pop(vector); |
73 __ mov(Operand::StaticVariable(virtual_register), extra); | 73 __ mov(Operand::StaticVariable(virtual_register), extra); |
74 __ pop(extra); // Pop "slot". | 74 __ pop(extra); // Pop "slot". |
75 // Jump to the first instruction in the code stub. | 75 // Jump to the first instruction in the code stub. |
76 __ jmp(Operand::StaticVariable(virtual_register)); | 76 __ jmp(Operand::StaticVariable(virtual_register)); |
77 } else { | 77 } else { |
78 __ pop(LoadWithVectorDescriptor::VectorRegister()); | 78 __ pop(LoadWithVectorDescriptor::VectorRegister()); |
79 __ pop(LoadDescriptor::SlotRegister()); | 79 __ pop(LoadDescriptor::SlotRegister()); |
80 __ add(extra, Immediate(Code::kHeaderSize - kHeapObjectTag)); | 80 __ add(extra, Immediate(Code::kHeaderSize - kHeapObjectTag)); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 #endif | 120 #endif |
121 | 121 |
122 // Restore offset and re-load code entry from cache. | 122 // Restore offset and re-load code entry from cache. |
123 __ pop(offset); | 123 __ pop(offset); |
124 __ mov(offset, Operand::StaticArray(offset, times_1, value_offset)); | 124 __ mov(offset, Operand::StaticArray(offset, times_1, value_offset)); |
125 | 125 |
126 // Jump to the first instruction in the code stub. | 126 // Jump to the first instruction in the code stub. |
127 if (is_vector_store) { | 127 if (is_vector_store) { |
128 // The vector and slot were pushed onto the stack before starting the | 128 // The vector and slot were pushed onto the stack before starting the |
129 // probe, and need to be dropped before calling the handler. | 129 // probe, and need to be dropped before calling the handler. |
130 Register vector = VectorStoreICDescriptor::VectorRegister(); | 130 Register vector = StoreWithVectorDescriptor::VectorRegister(); |
131 DCHECK(offset.is(VectorStoreICDescriptor::SlotRegister())); | 131 DCHECK(offset.is(StoreWithVectorDescriptor::SlotRegister())); |
132 __ add(offset, Immediate(Code::kHeaderSize - kHeapObjectTag)); | 132 __ add(offset, Immediate(Code::kHeaderSize - kHeapObjectTag)); |
133 __ mov(Operand::StaticVariable(virtual_register), offset); | 133 __ mov(Operand::StaticVariable(virtual_register), offset); |
134 __ pop(vector); | 134 __ pop(vector); |
135 __ pop(offset); // Pop "slot". | 135 __ pop(offset); // Pop "slot". |
136 __ jmp(Operand::StaticVariable(virtual_register)); | 136 __ jmp(Operand::StaticVariable(virtual_register)); |
137 } else { | 137 } else { |
138 __ add(offset, Immediate(Code::kHeaderSize - kHeapObjectTag)); | 138 __ add(offset, Immediate(Code::kHeaderSize - kHeapObjectTag)); |
139 __ jmp(offset); | 139 __ jmp(offset); |
140 } | 140 } |
141 | 141 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 __ bind(&miss); | 203 __ bind(&miss); |
204 __ IncrementCounter(counters->megamorphic_stub_cache_misses(), 1); | 204 __ IncrementCounter(counters->megamorphic_stub_cache_misses(), 1); |
205 } | 205 } |
206 | 206 |
207 | 207 |
208 #undef __ | 208 #undef __ |
209 } // namespace internal | 209 } // namespace internal |
210 } // namespace v8 | 210 } // namespace v8 |
211 | 211 |
212 #endif // V8_TARGET_ARCH_IA32 | 212 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |