OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
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" |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 | 286 |
287 DCHECK(!AreAliased(x4, x5, LoadWithVectorDescriptor::SlotRegister(), | 287 DCHECK(!AreAliased(x4, x5, LoadWithVectorDescriptor::SlotRegister(), |
288 LoadWithVectorDescriptor::VectorRegister())); | 288 LoadWithVectorDescriptor::VectorRegister())); |
289 __ IncrementCounter(isolate->counters()->load_miss(), 1, x4, x5); | 289 __ IncrementCounter(isolate->counters()->load_miss(), 1, x4, x5); |
290 | 290 |
291 // Perform tail call to the entry. | 291 // Perform tail call to the entry. |
292 __ Push(LoadWithVectorDescriptor::ReceiverRegister(), | 292 __ Push(LoadWithVectorDescriptor::ReceiverRegister(), |
293 LoadWithVectorDescriptor::NameRegister(), | 293 LoadWithVectorDescriptor::NameRegister(), |
294 LoadWithVectorDescriptor::SlotRegister(), | 294 LoadWithVectorDescriptor::SlotRegister(), |
295 LoadWithVectorDescriptor::VectorRegister()); | 295 LoadWithVectorDescriptor::VectorRegister()); |
296 int arg_count = 4; | 296 __ TailCallRuntime(Runtime::kLoadIC_Miss); |
297 __ TailCallRuntime(Runtime::kLoadIC_Miss, arg_count); | |
298 } | 297 } |
299 | 298 |
300 | 299 |
301 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, | 300 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, |
302 LanguageMode language_mode) { | 301 LanguageMode language_mode) { |
303 // The return address is in lr. | 302 // The return address is in lr. |
304 __ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister()); | 303 __ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister()); |
305 | 304 |
306 // Do tail-call to runtime routine. | 305 // Do tail-call to runtime routine. |
307 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong | 306 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong |
308 : Runtime::kGetProperty, | 307 : Runtime::kGetProperty); |
309 2); | |
310 } | 308 } |
311 | 309 |
312 | 310 |
313 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { | 311 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { |
314 // The return address is in lr. | 312 // The return address is in lr. |
315 Isolate* isolate = masm->isolate(); | 313 Isolate* isolate = masm->isolate(); |
316 | 314 |
317 DCHECK(!AreAliased(x10, x11, LoadWithVectorDescriptor::SlotRegister(), | 315 DCHECK(!AreAliased(x10, x11, LoadWithVectorDescriptor::SlotRegister(), |
318 LoadWithVectorDescriptor::VectorRegister())); | 316 LoadWithVectorDescriptor::VectorRegister())); |
319 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, x10, x11); | 317 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, x10, x11); |
320 | 318 |
321 __ Push(LoadWithVectorDescriptor::ReceiverRegister(), | 319 __ Push(LoadWithVectorDescriptor::ReceiverRegister(), |
322 LoadWithVectorDescriptor::NameRegister(), | 320 LoadWithVectorDescriptor::NameRegister(), |
323 LoadWithVectorDescriptor::SlotRegister(), | 321 LoadWithVectorDescriptor::SlotRegister(), |
324 LoadWithVectorDescriptor::VectorRegister()); | 322 LoadWithVectorDescriptor::VectorRegister()); |
325 | 323 |
326 // Perform tail call to the entry. | 324 // Perform tail call to the entry. |
327 int arg_count = 4; | 325 __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss); |
328 __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss, arg_count); | |
329 } | 326 } |
330 | 327 |
331 | 328 |
332 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, | 329 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, |
333 LanguageMode language_mode) { | 330 LanguageMode language_mode) { |
334 // The return address is in lr. | 331 // The return address is in lr. |
335 __ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister()); | 332 __ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister()); |
336 | 333 |
337 // Do tail-call to runtime routine. | 334 // Do tail-call to runtime routine. |
338 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kKeyedGetPropertyStrong | 335 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kKeyedGetPropertyStrong |
339 : Runtime::kKeyedGetProperty, | 336 : Runtime::kKeyedGetProperty); |
340 2); | |
341 } | 337 } |
342 | 338 |
343 | 339 |
344 static void GenerateKeyedLoadWithSmiKey(MacroAssembler* masm, Register key, | 340 static void GenerateKeyedLoadWithSmiKey(MacroAssembler* masm, Register key, |
345 Register receiver, Register scratch1, | 341 Register receiver, Register scratch1, |
346 Register scratch2, Register scratch3, | 342 Register scratch2, Register scratch3, |
347 Register scratch4, Register scratch5, | 343 Register scratch4, Register scratch5, |
348 Label* slow, | 344 Label* slow, |
349 LanguageMode language_mode) { | 345 LanguageMode language_mode) { |
350 DCHECK(!AreAliased(key, receiver, scratch1, scratch2, scratch3, scratch4, | 346 DCHECK(!AreAliased(key, receiver, scratch1, scratch2, scratch3, scratch4, |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), | 469 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), |
474 StoreDescriptor::ValueRegister(), | 470 StoreDescriptor::ValueRegister(), |
475 VectorStoreICDescriptor::SlotRegister(), | 471 VectorStoreICDescriptor::SlotRegister(), |
476 VectorStoreICDescriptor::VectorRegister()); | 472 VectorStoreICDescriptor::VectorRegister()); |
477 } | 473 } |
478 | 474 |
479 | 475 |
480 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { | 476 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { |
481 ASM_LOCATION("KeyedStoreIC::GenerateMiss"); | 477 ASM_LOCATION("KeyedStoreIC::GenerateMiss"); |
482 StoreIC_PushArgs(masm); | 478 StoreIC_PushArgs(masm); |
483 __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss, 5); | 479 __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss); |
484 } | 480 } |
485 | 481 |
486 | 482 |
487 static void KeyedStoreGenerateMegamorphicHelper( | 483 static void KeyedStoreGenerateMegamorphicHelper( |
488 MacroAssembler* masm, Label* fast_object, Label* fast_double, Label* slow, | 484 MacroAssembler* masm, Label* fast_object, Label* fast_double, Label* slow, |
489 KeyedStoreCheckMap check_map, KeyedStoreIncrementLength increment_length, | 485 KeyedStoreCheckMap check_map, KeyedStoreIncrementLength increment_length, |
490 Register value, Register key, Register receiver, Register receiver_map, | 486 Register value, Register key, Register receiver, Register receiver_map, |
491 Register elements_map, Register elements) { | 487 Register elements_map, Register elements) { |
492 DCHECK(!AreAliased(value, key, receiver, receiver_map, elements_map, elements, | 488 DCHECK(!AreAliased(value, key, receiver, receiver_map, elements_map, elements, |
493 x10, x11)); | 489 x10, x11)); |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
762 | 758 |
763 // Cache miss: Jump to runtime. | 759 // Cache miss: Jump to runtime. |
764 GenerateMiss(masm); | 760 GenerateMiss(masm); |
765 } | 761 } |
766 | 762 |
767 | 763 |
768 void StoreIC::GenerateMiss(MacroAssembler* masm) { | 764 void StoreIC::GenerateMiss(MacroAssembler* masm) { |
769 StoreIC_PushArgs(masm); | 765 StoreIC_PushArgs(masm); |
770 | 766 |
771 // Tail call to the entry. | 767 // Tail call to the entry. |
772 __ TailCallRuntime(Runtime::kStoreIC_Miss, 5); | 768 __ TailCallRuntime(Runtime::kStoreIC_Miss); |
773 } | 769 } |
774 | 770 |
775 | 771 |
776 void StoreIC::GenerateNormal(MacroAssembler* masm) { | 772 void StoreIC::GenerateNormal(MacroAssembler* masm) { |
777 Label miss; | 773 Label miss; |
778 Register value = StoreDescriptor::ValueRegister(); | 774 Register value = StoreDescriptor::ValueRegister(); |
779 Register receiver = StoreDescriptor::ReceiverRegister(); | 775 Register receiver = StoreDescriptor::ReceiverRegister(); |
780 Register name = StoreDescriptor::NameRegister(); | 776 Register name = StoreDescriptor::NameRegister(); |
781 Register dictionary = x5; | 777 Register dictionary = x5; |
782 DCHECK(!AreAliased(value, receiver, name, | 778 DCHECK(!AreAliased(value, receiver, name, |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
880 } else { | 876 } else { |
881 DCHECK(to_patch->Mask(TestBranchMask) == TBNZ); | 877 DCHECK(to_patch->Mask(TestBranchMask) == TBNZ); |
882 // This is JumpIfSmi(smi_reg, branch_imm). | 878 // This is JumpIfSmi(smi_reg, branch_imm). |
883 patcher.tbz(smi_reg, 0, branch_imm); | 879 patcher.tbz(smi_reg, 0, branch_imm); |
884 } | 880 } |
885 } | 881 } |
886 } // namespace internal | 882 } // namespace internal |
887 } // namespace v8 | 883 } // namespace v8 |
888 | 884 |
889 #endif // V8_TARGET_ARCH_ARM64 | 885 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |