| 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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 __ Push(receiver, name, slot, vector); | 307 __ Push(receiver, name, slot, vector); |
| 308 } | 308 } |
| 309 | 309 |
| 310 | 310 |
| 311 void LoadIC::GenerateMiss(MacroAssembler* masm) { | 311 void LoadIC::GenerateMiss(MacroAssembler* masm) { |
| 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()->ic_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 __ TailCallRuntime(Runtime::kLoadIC_Miss); | 322 __ TailCallRuntime(Runtime::kLoadIC_Miss); |
| 323 } | 323 } |
| 324 | 324 |
| 325 | 325 |
| 326 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, | 326 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, |
| 327 LanguageMode language_mode) { | 327 LanguageMode language_mode) { |
| 328 // The return address is in lr. | 328 // The return address is in lr. |
| 329 | 329 |
| 330 __ mr(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister()); | 330 __ mr(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister()); |
| 331 __ Push(LoadIC_TempRegister(), LoadDescriptor::NameRegister()); | 331 __ Push(LoadIC_TempRegister(), LoadDescriptor::NameRegister()); |
| 332 | 332 |
| 333 // Do tail-call to runtime routine. | 333 // Do tail-call to runtime routine. |
| 334 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong | 334 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong |
| 335 : Runtime::kGetProperty); | 335 : Runtime::kGetProperty); |
| 336 } | 336 } |
| 337 | 337 |
| 338 | 338 |
| 339 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { | 339 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { |
| 340 // The return address is in lr. | 340 // The return address is in lr. |
| 341 Isolate* isolate = masm->isolate(); | 341 Isolate* isolate = masm->isolate(); |
| 342 | 342 |
| 343 DCHECK(!AreAliased(r7, r8, LoadWithVectorDescriptor::SlotRegister(), | 343 DCHECK(!AreAliased(r7, r8, LoadWithVectorDescriptor::SlotRegister(), |
| 344 LoadWithVectorDescriptor::VectorRegister())); | 344 LoadWithVectorDescriptor::VectorRegister())); |
| 345 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, r7, r8); | 345 __ IncrementCounter(isolate->counters()->ic_keyed_load_miss(), 1, r7, r8); |
| 346 | 346 |
| 347 LoadIC_PushArgs(masm); | 347 LoadIC_PushArgs(masm); |
| 348 | 348 |
| 349 // Perform tail call to the entry. | 349 // Perform tail call to the entry. |
| 350 __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss); | 350 __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss); |
| 351 } | 351 } |
| 352 | 352 |
| 353 | 353 |
| 354 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, | 354 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, |
| 355 LanguageMode language_mode) { | 355 LanguageMode language_mode) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 383 // where a numeric string is converted to a smi. | 383 // where a numeric string is converted to a smi. |
| 384 | 384 |
| 385 GenerateKeyedLoadReceiverCheck(masm, receiver, r3, r6, | 385 GenerateKeyedLoadReceiverCheck(masm, receiver, r3, r6, |
| 386 Map::kHasIndexedInterceptor, &slow); | 386 Map::kHasIndexedInterceptor, &slow); |
| 387 | 387 |
| 388 // Check the receiver's map to see if it has fast elements. | 388 // Check the receiver's map to see if it has fast elements. |
| 389 __ CheckFastElements(r3, r6, &check_number_dictionary); | 389 __ CheckFastElements(r3, r6, &check_number_dictionary); |
| 390 | 390 |
| 391 GenerateFastArrayLoad(masm, receiver, key, r3, r6, r7, r3, &slow, | 391 GenerateFastArrayLoad(masm, receiver, key, r3, r6, r7, r3, &slow, |
| 392 language_mode); | 392 language_mode); |
| 393 __ IncrementCounter(isolate->counters()->keyed_load_generic_smi(), 1, r7, r6); | 393 __ IncrementCounter(isolate->counters()->ic_keyed_load_generic_smi(), 1, r7, |
| 394 r6); |
| 394 __ Ret(); | 395 __ Ret(); |
| 395 | 396 |
| 396 __ bind(&check_number_dictionary); | 397 __ bind(&check_number_dictionary); |
| 397 __ LoadP(r7, FieldMemOperand(receiver, JSObject::kElementsOffset)); | 398 __ LoadP(r7, FieldMemOperand(receiver, JSObject::kElementsOffset)); |
| 398 __ LoadP(r6, FieldMemOperand(r7, JSObject::kMapOffset)); | 399 __ LoadP(r6, FieldMemOperand(r7, JSObject::kMapOffset)); |
| 399 | 400 |
| 400 // Check whether the elements is a number dictionary. | 401 // Check whether the elements is a number dictionary. |
| 401 // r6: elements map | 402 // r6: elements map |
| 402 // r7: elements | 403 // r7: elements |
| 403 __ LoadRoot(ip, Heap::kHashTableMapRootIndex); | 404 __ LoadRoot(ip, Heap::kHashTableMapRootIndex); |
| 404 __ cmp(r6, ip); | 405 __ cmp(r6, ip); |
| 405 __ bne(&slow); | 406 __ bne(&slow); |
| 406 __ SmiUntag(r3, key); | 407 __ SmiUntag(r3, key); |
| 407 __ LoadFromNumberDictionary(&slow, r7, key, r3, r3, r6, r8); | 408 __ LoadFromNumberDictionary(&slow, r7, key, r3, r3, r6, r8); |
| 408 __ Ret(); | 409 __ Ret(); |
| 409 | 410 |
| 410 // Slow case, key and receiver still in r3 and r4. | 411 // Slow case, key and receiver still in r3 and r4. |
| 411 __ bind(&slow); | 412 __ bind(&slow); |
| 412 __ IncrementCounter(isolate->counters()->keyed_load_generic_slow(), 1, r7, | 413 __ IncrementCounter(isolate->counters()->ic_keyed_load_generic_slow(), 1, r7, |
| 413 r6); | 414 r6); |
| 414 GenerateRuntimeGetProperty(masm, language_mode); | 415 GenerateRuntimeGetProperty(masm, language_mode); |
| 415 | 416 |
| 416 __ bind(&check_name); | 417 __ bind(&check_name); |
| 417 GenerateKeyNameCheck(masm, key, r3, r6, &index_name, &slow); | 418 GenerateKeyNameCheck(masm, key, r3, r6, &index_name, &slow); |
| 418 | 419 |
| 419 GenerateKeyedLoadReceiverCheck(masm, receiver, r3, r6, | 420 GenerateKeyedLoadReceiverCheck(masm, receiver, r3, r6, |
| 420 Map::kHasNamedInterceptor, &slow); | 421 Map::kHasNamedInterceptor, &slow); |
| 421 | 422 |
| 422 // If the receiver is a fast-case object, check the stub cache. Otherwise | 423 // If the receiver is a fast-case object, check the stub cache. Otherwise |
| (...skipping 26 matching lines...) Expand all Loading... |
| 449 | 450 |
| 450 // Do a quick inline probe of the receiver's dictionary, if it | 451 // Do a quick inline probe of the receiver's dictionary, if it |
| 451 // exists. | 452 // exists. |
| 452 __ bind(&probe_dictionary); | 453 __ bind(&probe_dictionary); |
| 453 // r6: elements | 454 // r6: elements |
| 454 __ LoadP(r3, FieldMemOperand(receiver, HeapObject::kMapOffset)); | 455 __ LoadP(r3, FieldMemOperand(receiver, HeapObject::kMapOffset)); |
| 455 __ lbz(r3, FieldMemOperand(r3, Map::kInstanceTypeOffset)); | 456 __ lbz(r3, FieldMemOperand(r3, Map::kInstanceTypeOffset)); |
| 456 GenerateGlobalInstanceTypeCheck(masm, r3, &slow); | 457 GenerateGlobalInstanceTypeCheck(masm, r3, &slow); |
| 457 // Load the property to r3. | 458 // Load the property to r3. |
| 458 GenerateDictionaryLoad(masm, &slow, r6, key, r3, r8, r7); | 459 GenerateDictionaryLoad(masm, &slow, r6, key, r3, r8, r7); |
| 459 __ IncrementCounter(isolate->counters()->keyed_load_generic_symbol(), 1, r7, | 460 __ IncrementCounter(isolate->counters()->ic_keyed_load_generic_symbol(), 1, |
| 460 r6); | 461 r7, r6); |
| 461 __ Ret(); | 462 __ Ret(); |
| 462 | 463 |
| 463 __ bind(&index_name); | 464 __ bind(&index_name); |
| 464 __ IndexFromHash(r6, key); | 465 __ IndexFromHash(r6, key); |
| 465 // Now jump to the place where smi keys are handled. | 466 // Now jump to the place where smi keys are handled. |
| 466 __ b(&index_smi); | 467 __ b(&index_smi); |
| 467 } | 468 } |
| 468 | 469 |
| 469 | 470 |
| 470 static void StoreIC_PushArgs(MacroAssembler* masm) { | 471 static void StoreIC_PushArgs(MacroAssembler* masm) { |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 DCHECK(receiver.is(r4)); | 791 DCHECK(receiver.is(r4)); |
| 791 DCHECK(name.is(r5)); | 792 DCHECK(name.is(r5)); |
| 792 DCHECK(value.is(r3)); | 793 DCHECK(value.is(r3)); |
| 793 DCHECK(VectorStoreICDescriptor::VectorRegister().is(r6)); | 794 DCHECK(VectorStoreICDescriptor::VectorRegister().is(r6)); |
| 794 DCHECK(VectorStoreICDescriptor::SlotRegister().is(r7)); | 795 DCHECK(VectorStoreICDescriptor::SlotRegister().is(r7)); |
| 795 | 796 |
| 796 __ LoadP(dictionary, FieldMemOperand(receiver, JSObject::kPropertiesOffset)); | 797 __ LoadP(dictionary, FieldMemOperand(receiver, JSObject::kPropertiesOffset)); |
| 797 | 798 |
| 798 GenerateDictionaryStore(masm, &miss, dictionary, name, value, r9, r10); | 799 GenerateDictionaryStore(masm, &miss, dictionary, name, value, r9, r10); |
| 799 Counters* counters = masm->isolate()->counters(); | 800 Counters* counters = masm->isolate()->counters(); |
| 800 __ IncrementCounter(counters->store_normal_hit(), 1, r9, r10); | 801 __ IncrementCounter(counters->ic_store_normal_hit(), 1, r9, r10); |
| 801 __ Ret(); | 802 __ Ret(); |
| 802 | 803 |
| 803 __ bind(&miss); | 804 __ bind(&miss); |
| 804 __ IncrementCounter(counters->store_normal_miss(), 1, r9, r10); | 805 __ IncrementCounter(counters->ic_store_normal_miss(), 1, r9, r10); |
| 805 GenerateMiss(masm); | 806 GenerateMiss(masm); |
| 806 } | 807 } |
| 807 | 808 |
| 808 | 809 |
| 809 #undef __ | 810 #undef __ |
| 810 | 811 |
| 811 | 812 |
| 812 Condition CompareIC::ComputeCondition(Token::Value op) { | 813 Condition CompareIC::ComputeCondition(Token::Value op) { |
| 813 switch (op) { | 814 switch (op) { |
| 814 case Token::EQ_STRICT: | 815 case Token::EQ_STRICT: |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 902 patcher.EmitCondition(ne); | 903 patcher.EmitCondition(ne); |
| 903 } else { | 904 } else { |
| 904 DCHECK(Assembler::GetCondition(branch_instr) == ne); | 905 DCHECK(Assembler::GetCondition(branch_instr) == ne); |
| 905 patcher.EmitCondition(eq); | 906 patcher.EmitCondition(eq); |
| 906 } | 907 } |
| 907 } | 908 } |
| 908 } // namespace internal | 909 } // namespace internal |
| 909 } // namespace v8 | 910 } // namespace v8 |
| 910 | 911 |
| 911 #endif // V8_TARGET_ARCH_PPC | 912 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |