OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 // The return address is in lr. | 312 // The return address is in lr. |
313 Isolate* isolate = masm->isolate(); | 313 Isolate* isolate = masm->isolate(); |
314 | 314 |
315 DCHECK(!AreAliased(r7, r8, LoadWithVectorDescriptor::SlotRegister(), | 315 DCHECK(!AreAliased(r7, r8, LoadWithVectorDescriptor::SlotRegister(), |
316 LoadWithVectorDescriptor::VectorRegister())); | 316 LoadWithVectorDescriptor::VectorRegister())); |
317 __ IncrementCounter(isolate->counters()->load_miss(), 1, r7, r8); | 317 __ IncrementCounter(isolate->counters()->load_miss(), 1, r7, r8); |
318 | 318 |
319 LoadIC_PushArgs(masm); | 319 LoadIC_PushArgs(masm); |
320 | 320 |
321 // Perform tail call to the entry. | 321 // Perform tail call to the entry. |
322 int arg_count = 4; | 322 __ TailCallRuntime(Runtime::kLoadIC_Miss); |
323 __ TailCallRuntime(Runtime::kLoadIC_Miss, arg_count); | |
324 } | 323 } |
325 | 324 |
326 | 325 |
327 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, | 326 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, |
328 LanguageMode language_mode) { | 327 LanguageMode language_mode) { |
329 // The return address is in lr. | 328 // The return address is in lr. |
330 | 329 |
331 __ mr(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister()); | 330 __ mr(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister()); |
332 __ Push(LoadIC_TempRegister(), LoadDescriptor::NameRegister()); | 331 __ Push(LoadIC_TempRegister(), LoadDescriptor::NameRegister()); |
333 | 332 |
334 // Do tail-call to runtime routine. | 333 // Do tail-call to runtime routine. |
335 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong | 334 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong |
336 : Runtime::kGetProperty, | 335 : Runtime::kGetProperty); |
337 2); | |
338 } | 336 } |
339 | 337 |
340 | 338 |
341 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { | 339 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { |
342 // The return address is in lr. | 340 // The return address is in lr. |
343 Isolate* isolate = masm->isolate(); | 341 Isolate* isolate = masm->isolate(); |
344 | 342 |
345 DCHECK(!AreAliased(r7, r8, LoadWithVectorDescriptor::SlotRegister(), | 343 DCHECK(!AreAliased(r7, r8, LoadWithVectorDescriptor::SlotRegister(), |
346 LoadWithVectorDescriptor::VectorRegister())); | 344 LoadWithVectorDescriptor::VectorRegister())); |
347 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, r7, r8); | 345 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, r7, r8); |
348 | 346 |
349 LoadIC_PushArgs(masm); | 347 LoadIC_PushArgs(masm); |
350 | 348 |
351 // Perform tail call to the entry. | 349 // Perform tail call to the entry. |
352 int arg_count = 4; | 350 __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss); |
353 __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss, arg_count); | |
354 } | 351 } |
355 | 352 |
356 | 353 |
357 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, | 354 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, |
358 LanguageMode language_mode) { | 355 LanguageMode language_mode) { |
359 // The return address is in lr. | 356 // The return address is in lr. |
360 | 357 |
361 __ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister()); | 358 __ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister()); |
362 | 359 |
363 // Do tail-call to runtime routine. | 360 // Do tail-call to runtime routine. |
364 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kKeyedGetPropertyStrong | 361 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kKeyedGetPropertyStrong |
365 : Runtime::kKeyedGetProperty, | 362 : Runtime::kKeyedGetProperty); |
366 2); | |
367 } | 363 } |
368 | 364 |
369 | 365 |
370 void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm, | 366 void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm, |
371 LanguageMode language_mode) { | 367 LanguageMode language_mode) { |
372 // The return address is in lr. | 368 // The return address is in lr. |
373 Label slow, check_name, index_smi, index_name, property_array_property; | 369 Label slow, check_name, index_smi, index_name, property_array_property; |
374 Label probe_dictionary, check_number_dictionary; | 370 Label probe_dictionary, check_number_dictionary; |
375 | 371 |
376 Register key = LoadDescriptor::NameRegister(); | 372 Register key = LoadDescriptor::NameRegister(); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), | 471 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), |
476 StoreDescriptor::ValueRegister(), | 472 StoreDescriptor::ValueRegister(), |
477 VectorStoreICDescriptor::SlotRegister(), | 473 VectorStoreICDescriptor::SlotRegister(), |
478 VectorStoreICDescriptor::VectorRegister()); | 474 VectorStoreICDescriptor::VectorRegister()); |
479 } | 475 } |
480 | 476 |
481 | 477 |
482 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { | 478 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { |
483 StoreIC_PushArgs(masm); | 479 StoreIC_PushArgs(masm); |
484 | 480 |
485 __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss, 5); | 481 __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss); |
486 } | 482 } |
487 | 483 |
488 | 484 |
489 static void KeyedStoreGenerateMegamorphicHelper( | 485 static void KeyedStoreGenerateMegamorphicHelper( |
490 MacroAssembler* masm, Label* fast_object, Label* fast_double, Label* slow, | 486 MacroAssembler* masm, Label* fast_object, Label* fast_double, Label* slow, |
491 KeyedStoreCheckMap check_map, KeyedStoreIncrementLength increment_length, | 487 KeyedStoreCheckMap check_map, KeyedStoreIncrementLength increment_length, |
492 Register value, Register key, Register receiver, Register receiver_map, | 488 Register value, Register key, Register receiver, Register receiver_map, |
493 Register elements_map, Register elements) { | 489 Register elements_map, Register elements) { |
494 Label transition_smi_elements; | 490 Label transition_smi_elements; |
495 Label finish_object_store, non_double_value, transition_double_elements; | 491 Label finish_object_store, non_double_value, transition_double_elements; |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
779 | 775 |
780 // Cache miss: Jump to runtime. | 776 // Cache miss: Jump to runtime. |
781 GenerateMiss(masm); | 777 GenerateMiss(masm); |
782 } | 778 } |
783 | 779 |
784 | 780 |
785 void StoreIC::GenerateMiss(MacroAssembler* masm) { | 781 void StoreIC::GenerateMiss(MacroAssembler* masm) { |
786 StoreIC_PushArgs(masm); | 782 StoreIC_PushArgs(masm); |
787 | 783 |
788 // Perform tail call to the entry. | 784 // Perform tail call to the entry. |
789 __ TailCallRuntime(Runtime::kStoreIC_Miss, 5); | 785 __ TailCallRuntime(Runtime::kStoreIC_Miss); |
790 } | 786 } |
791 | 787 |
792 | 788 |
793 void StoreIC::GenerateNormal(MacroAssembler* masm) { | 789 void StoreIC::GenerateNormal(MacroAssembler* masm) { |
794 Label miss; | 790 Label miss; |
795 Register receiver = StoreDescriptor::ReceiverRegister(); | 791 Register receiver = StoreDescriptor::ReceiverRegister(); |
796 Register name = StoreDescriptor::NameRegister(); | 792 Register name = StoreDescriptor::NameRegister(); |
797 Register value = StoreDescriptor::ValueRegister(); | 793 Register value = StoreDescriptor::ValueRegister(); |
798 Register dictionary = r8; | 794 Register dictionary = r8; |
799 DCHECK(receiver.is(r4)); | 795 DCHECK(receiver.is(r4)); |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
911 patcher.EmitCondition(ne); | 907 patcher.EmitCondition(ne); |
912 } else { | 908 } else { |
913 DCHECK(Assembler::GetCondition(branch_instr) == ne); | 909 DCHECK(Assembler::GetCondition(branch_instr) == ne); |
914 patcher.EmitCondition(eq); | 910 patcher.EmitCondition(eq); |
915 } | 911 } |
916 } | 912 } |
917 } // namespace internal | 913 } // namespace internal |
918 } // namespace v8 | 914 } // namespace v8 |
919 | 915 |
920 #endif // V8_TARGET_ARCH_PPC | 916 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |