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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM | 7 #if V8_TARGET_ARCH_ARM |
8 | 8 |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/ic/ic.h" | 10 #include "src/ic/ic.h" |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 // Dictionary load failed, go slow (but don't miss). | 258 // Dictionary load failed, go slow (but don't miss). |
259 __ bind(&slow); | 259 __ bind(&slow); |
260 GenerateRuntimeGetProperty(masm); | 260 GenerateRuntimeGetProperty(masm); |
261 } | 261 } |
262 | 262 |
263 | 263 |
264 // A register that isn't one of the parameters to the load ic. | 264 // A register that isn't one of the parameters to the load ic. |
265 static const Register LoadIC_TempRegister() { return r3; } | 265 static const Register LoadIC_TempRegister() { return r3; } |
266 | 266 |
267 | 267 |
| 268 static void LoadIC_PushArgs(MacroAssembler* masm) { |
| 269 Register receiver = LoadDescriptor::ReceiverRegister(); |
| 270 Register name = LoadDescriptor::NameRegister(); |
| 271 if (FLAG_vector_ics) { |
| 272 Register slot = VectorLoadICDescriptor::SlotRegister(); |
| 273 Register vector = VectorLoadICDescriptor::VectorRegister(); |
| 274 |
| 275 __ Push(receiver, name, slot, vector); |
| 276 } else { |
| 277 __ Push(receiver, name); |
| 278 } |
| 279 } |
| 280 |
| 281 |
268 void LoadIC::GenerateMiss(MacroAssembler* masm) { | 282 void LoadIC::GenerateMiss(MacroAssembler* masm) { |
269 // The return address is in lr. | 283 // The return address is in lr. |
270 Isolate* isolate = masm->isolate(); | 284 Isolate* isolate = masm->isolate(); |
271 | 285 |
272 __ IncrementCounter(isolate->counters()->load_miss(), 1, r3, r4); | 286 __ IncrementCounter(isolate->counters()->load_miss(), 1, r3, r4); |
273 | 287 |
274 __ mov(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister()); | 288 LoadIC_PushArgs(masm); |
275 __ Push(LoadIC_TempRegister(), LoadDescriptor::NameRegister()); | |
276 | 289 |
277 // Perform tail call to the entry. | 290 // Perform tail call to the entry. |
278 ExternalReference ref = ExternalReference(IC_Utility(kLoadIC_Miss), isolate); | 291 ExternalReference ref = ExternalReference(IC_Utility(kLoadIC_Miss), isolate); |
279 __ TailCallExternalReference(ref, 2, 1); | 292 int arg_count = FLAG_vector_ics ? 4 : 2; |
| 293 __ TailCallExternalReference(ref, arg_count, 1); |
280 } | 294 } |
281 | 295 |
282 | 296 |
283 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { | 297 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
284 // The return address is in lr. | 298 // The return address is in lr. |
285 | 299 |
286 __ mov(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister()); | 300 __ mov(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister()); |
287 __ Push(LoadIC_TempRegister(), LoadDescriptor::NameRegister()); | 301 __ Push(LoadIC_TempRegister(), LoadDescriptor::NameRegister()); |
288 | 302 |
289 __ TailCallRuntime(Runtime::kGetProperty, 2, 1); | 303 __ TailCallRuntime(Runtime::kGetProperty, 2, 1); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 GenerateMiss(masm); | 412 GenerateMiss(masm); |
399 } | 413 } |
400 | 414 |
401 | 415 |
402 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { | 416 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { |
403 // The return address is in lr. | 417 // The return address is in lr. |
404 Isolate* isolate = masm->isolate(); | 418 Isolate* isolate = masm->isolate(); |
405 | 419 |
406 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, r3, r4); | 420 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, r3, r4); |
407 | 421 |
408 __ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister()); | 422 LoadIC_PushArgs(masm); |
409 | 423 |
410 // Perform tail call to the entry. | 424 // Perform tail call to the entry. |
411 ExternalReference ref = | 425 ExternalReference ref = |
412 ExternalReference(IC_Utility(kKeyedLoadIC_Miss), isolate); | 426 ExternalReference(IC_Utility(kKeyedLoadIC_Miss), isolate); |
413 | 427 int arg_count = FLAG_vector_ics ? 4 : 2; |
414 __ TailCallExternalReference(ref, 2, 1); | 428 __ TailCallExternalReference(ref, arg_count, 1); |
415 } | 429 } |
416 | 430 |
417 | 431 |
418 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { | 432 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
419 // The return address is in lr. | 433 // The return address is in lr. |
420 | 434 |
421 __ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister()); | 435 __ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister()); |
422 | 436 |
423 __ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1); | 437 __ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1); |
424 } | 438 } |
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
999 patcher.EmitCondition(ne); | 1013 patcher.EmitCondition(ne); |
1000 } else { | 1014 } else { |
1001 DCHECK(Assembler::GetCondition(branch_instr) == ne); | 1015 DCHECK(Assembler::GetCondition(branch_instr) == ne); |
1002 patcher.EmitCondition(eq); | 1016 patcher.EmitCondition(eq); |
1003 } | 1017 } |
1004 } | 1018 } |
1005 } | 1019 } |
1006 } // namespace v8::internal | 1020 } // namespace v8::internal |
1007 | 1021 |
1008 #endif // V8_TARGET_ARCH_ARM | 1022 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |