OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_S390 | 5 #if V8_TARGET_ARCH_S390 |
6 | 6 |
7 #include "src/ic/ic.h" | 7 #include "src/ic/ic.h" |
8 #include "src/codegen.h" | 8 #include "src/codegen.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" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 __ Ret(); | 131 __ Ret(); |
132 | 132 |
133 // Dictionary load failed, go slow (but don't miss). | 133 // Dictionary load failed, go slow (but don't miss). |
134 __ bind(&slow); | 134 __ bind(&slow); |
135 GenerateRuntimeGetProperty(masm); | 135 GenerateRuntimeGetProperty(masm); |
136 } | 136 } |
137 | 137 |
138 // A register that isn't one of the parameters to the load ic. | 138 // A register that isn't one of the parameters to the load ic. |
139 static const Register LoadIC_TempRegister() { return r5; } | 139 static const Register LoadIC_TempRegister() { return r5; } |
140 | 140 |
141 static void LoadIC_PushArgs(MacroAssembler* masm) { | |
142 Register receiver = LoadDescriptor::ReceiverRegister(); | |
143 Register name = LoadDescriptor::NameRegister(); | |
144 Register slot = LoadDescriptor::SlotRegister(); | |
145 Register vector = LoadWithVectorDescriptor::VectorRegister(); | |
146 | |
147 __ Push(receiver, name, slot, vector); | |
148 } | |
149 | |
150 void LoadIC::GenerateMiss(MacroAssembler* masm) { | |
151 // The return address is in lr. | |
152 Isolate* isolate = masm->isolate(); | |
153 | |
154 DCHECK(!AreAliased(r6, r7, LoadWithVectorDescriptor::SlotRegister(), | |
155 LoadWithVectorDescriptor::VectorRegister())); | |
156 __ IncrementCounter(isolate->counters()->ic_load_miss(), 1, r6, r7); | |
157 | |
158 LoadIC_PushArgs(masm); | |
159 | |
160 // Perform tail call to the entry. | |
161 __ TailCallRuntime(Runtime::kLoadIC_Miss); | |
162 } | |
163 | |
164 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { | 141 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
165 // The return address is in lr. | 142 // The return address is in lr. |
166 | 143 |
167 __ LoadRR(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister()); | 144 __ LoadRR(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister()); |
168 __ Push(LoadIC_TempRegister(), LoadDescriptor::NameRegister()); | 145 __ Push(LoadIC_TempRegister(), LoadDescriptor::NameRegister()); |
169 | 146 |
170 // Do tail-call to runtime routine. | 147 // Do tail-call to runtime routine. |
171 __ TailCallRuntime(Runtime::kGetProperty); | 148 __ TailCallRuntime(Runtime::kGetProperty); |
172 } | 149 } |
173 | 150 |
174 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { | |
175 // The return address is in lr. | |
176 Isolate* isolate = masm->isolate(); | |
177 | |
178 DCHECK(!AreAliased(r6, r7, LoadWithVectorDescriptor::SlotRegister(), | |
179 LoadWithVectorDescriptor::VectorRegister())); | |
180 __ IncrementCounter(isolate->counters()->ic_keyed_load_miss(), 1, r6, r7); | |
181 | |
182 LoadIC_PushArgs(masm); | |
183 | |
184 // Perform tail call to the entry. | |
185 __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss); | |
186 } | |
187 | |
188 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { | |
189 // The return address is in lr. | |
190 | |
191 __ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister()); | |
192 | |
193 // Do tail-call to runtime routine. | |
194 __ TailCallRuntime(Runtime::kKeyedGetProperty); | |
195 } | |
196 | |
197 static void StoreIC_PushArgs(MacroAssembler* masm) { | 151 static void StoreIC_PushArgs(MacroAssembler* masm) { |
198 __ Push(StoreWithVectorDescriptor::ValueRegister(), | 152 __ Push(StoreWithVectorDescriptor::ValueRegister(), |
199 StoreWithVectorDescriptor::SlotRegister(), | 153 StoreWithVectorDescriptor::SlotRegister(), |
200 StoreWithVectorDescriptor::VectorRegister(), | 154 StoreWithVectorDescriptor::VectorRegister(), |
201 StoreWithVectorDescriptor::ReceiverRegister(), | 155 StoreWithVectorDescriptor::ReceiverRegister(), |
202 StoreWithVectorDescriptor::NameRegister()); | 156 StoreWithVectorDescriptor::NameRegister()); |
203 } | 157 } |
204 | 158 |
205 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { | 159 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { |
206 StoreIC_PushArgs(masm); | 160 StoreIC_PushArgs(masm); |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 patcher.masm()->brcl(cc, Operand(branch_instr & 0xffffffff)); | 321 patcher.masm()->brcl(cc, Operand(branch_instr & 0xffffffff)); |
368 } else { | 322 } else { |
369 DCHECK(false); | 323 DCHECK(false); |
370 } | 324 } |
371 } | 325 } |
372 | 326 |
373 } // namespace internal | 327 } // namespace internal |
374 } // namespace v8 | 328 } // namespace v8 |
375 | 329 |
376 #endif // V8_TARGET_ARCH_S390 | 330 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |