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