| 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 #if V8_TARGET_ARCH_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
| 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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 __ Push(receiver, name, slot, vector); | 301 __ Push(receiver, name, slot, vector); |
| 302 } | 302 } |
| 303 | 303 |
| 304 | 304 |
| 305 void LoadIC::GenerateMiss(MacroAssembler* masm) { | 305 void LoadIC::GenerateMiss(MacroAssembler* masm) { |
| 306 // The return address is on the stack. | 306 // The return address is on the stack. |
| 307 Isolate* isolate = masm->isolate(); | 307 Isolate* isolate = masm->isolate(); |
| 308 | 308 |
| 309 DCHECK(!AreAliased(a4, a5, LoadWithVectorDescriptor::SlotRegister(), | 309 DCHECK(!AreAliased(a4, a5, LoadWithVectorDescriptor::SlotRegister(), |
| 310 LoadWithVectorDescriptor::VectorRegister())); | 310 LoadWithVectorDescriptor::VectorRegister())); |
| 311 __ IncrementCounter(isolate->counters()->load_miss(), 1, a4, a5); | 311 __ IncrementCounter(isolate->counters()->ic_load_miss(), 1, a4, a5); |
| 312 | 312 |
| 313 LoadIC_PushArgs(masm); | 313 LoadIC_PushArgs(masm); |
| 314 | 314 |
| 315 // Perform tail call to the entry. | 315 // Perform tail call to the entry. |
| 316 __ TailCallRuntime(Runtime::kLoadIC_Miss); | 316 __ TailCallRuntime(Runtime::kLoadIC_Miss); |
| 317 } | 317 } |
| 318 | 318 |
| 319 | 319 |
| 320 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, | 320 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, |
| 321 LanguageMode language_mode) { | 321 LanguageMode language_mode) { |
| 322 // The return address is in ra. | 322 // The return address is in ra. |
| 323 | 323 |
| 324 __ mov(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister()); | 324 __ mov(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister()); |
| 325 __ Push(LoadIC_TempRegister(), LoadDescriptor::NameRegister()); | 325 __ Push(LoadIC_TempRegister(), LoadDescriptor::NameRegister()); |
| 326 | 326 |
| 327 // Do tail-call to runtime routine. | 327 // Do tail-call to runtime routine. |
| 328 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong | 328 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong |
| 329 : Runtime::kGetProperty); | 329 : Runtime::kGetProperty); |
| 330 } | 330 } |
| 331 | 331 |
| 332 | 332 |
| 333 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { | 333 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { |
| 334 // The return address is in ra. | 334 // The return address is in ra. |
| 335 Isolate* isolate = masm->isolate(); | 335 Isolate* isolate = masm->isolate(); |
| 336 | 336 |
| 337 DCHECK(!AreAliased(a4, a5, LoadWithVectorDescriptor::SlotRegister(), | 337 DCHECK(!AreAliased(a4, a5, LoadWithVectorDescriptor::SlotRegister(), |
| 338 LoadWithVectorDescriptor::VectorRegister())); | 338 LoadWithVectorDescriptor::VectorRegister())); |
| 339 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, a4, a5); | 339 __ IncrementCounter(isolate->counters()->ic_keyed_load_miss(), 1, a4, a5); |
| 340 | 340 |
| 341 LoadIC_PushArgs(masm); | 341 LoadIC_PushArgs(masm); |
| 342 | 342 |
| 343 // Perform tail call to the entry. | 343 // Perform tail call to the entry. |
| 344 __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss); | 344 __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss); |
| 345 } | 345 } |
| 346 | 346 |
| 347 | 347 |
| 348 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, | 348 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, |
| 349 LanguageMode language_mode) { | 349 LanguageMode language_mode) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 377 // where a numeric string is converted to a smi. | 377 // where a numeric string is converted to a smi. |
| 378 | 378 |
| 379 GenerateKeyedLoadReceiverCheck(masm, receiver, a0, a3, | 379 GenerateKeyedLoadReceiverCheck(masm, receiver, a0, a3, |
| 380 Map::kHasIndexedInterceptor, &slow); | 380 Map::kHasIndexedInterceptor, &slow); |
| 381 | 381 |
| 382 // Check the receiver's map to see if it has fast elements. | 382 // Check the receiver's map to see if it has fast elements. |
| 383 __ CheckFastElements(a0, a3, &check_number_dictionary); | 383 __ CheckFastElements(a0, a3, &check_number_dictionary); |
| 384 | 384 |
| 385 GenerateFastArrayLoad(masm, receiver, key, a0, a3, a4, v0, &slow, | 385 GenerateFastArrayLoad(masm, receiver, key, a0, a3, a4, v0, &slow, |
| 386 language_mode); | 386 language_mode); |
| 387 __ IncrementCounter(isolate->counters()->keyed_load_generic_smi(), 1, a4, a3); | 387 __ IncrementCounter(isolate->counters()->ic_keyed_load_generic_smi(), 1, a4, |
| 388 a3); |
| 388 __ Ret(); | 389 __ Ret(); |
| 389 | 390 |
| 390 __ bind(&check_number_dictionary); | 391 __ bind(&check_number_dictionary); |
| 391 __ ld(a4, FieldMemOperand(receiver, JSObject::kElementsOffset)); | 392 __ ld(a4, FieldMemOperand(receiver, JSObject::kElementsOffset)); |
| 392 __ ld(a3, FieldMemOperand(a4, JSObject::kMapOffset)); | 393 __ ld(a3, FieldMemOperand(a4, JSObject::kMapOffset)); |
| 393 | 394 |
| 394 // Check whether the elements is a number dictionary. | 395 // Check whether the elements is a number dictionary. |
| 395 // a3: elements map | 396 // a3: elements map |
| 396 // a4: elements | 397 // a4: elements |
| 397 __ LoadRoot(at, Heap::kHashTableMapRootIndex); | 398 __ LoadRoot(at, Heap::kHashTableMapRootIndex); |
| 398 __ Branch(&slow, ne, a3, Operand(at)); | 399 __ Branch(&slow, ne, a3, Operand(at)); |
| 399 __ dsra32(a0, key, 0); | 400 __ dsra32(a0, key, 0); |
| 400 __ LoadFromNumberDictionary(&slow, a4, key, v0, a0, a3, a5); | 401 __ LoadFromNumberDictionary(&slow, a4, key, v0, a0, a3, a5); |
| 401 __ Ret(); | 402 __ Ret(); |
| 402 | 403 |
| 403 // Slow case, key and receiver still in a2 and a1. | 404 // Slow case, key and receiver still in a2 and a1. |
| 404 __ bind(&slow); | 405 __ bind(&slow); |
| 405 __ IncrementCounter(isolate->counters()->keyed_load_generic_slow(), 1, a4, | 406 __ IncrementCounter(isolate->counters()->ic_keyed_load_generic_slow(), 1, a4, |
| 406 a3); | 407 a3); |
| 407 GenerateRuntimeGetProperty(masm, language_mode); | 408 GenerateRuntimeGetProperty(masm, language_mode); |
| 408 | 409 |
| 409 __ bind(&check_name); | 410 __ bind(&check_name); |
| 410 GenerateKeyNameCheck(masm, key, a0, a3, &index_name, &slow); | 411 GenerateKeyNameCheck(masm, key, a0, a3, &index_name, &slow); |
| 411 | 412 |
| 412 GenerateKeyedLoadReceiverCheck(masm, receiver, a0, a3, | 413 GenerateKeyedLoadReceiverCheck(masm, receiver, a0, a3, |
| 413 Map::kHasNamedInterceptor, &slow); | 414 Map::kHasNamedInterceptor, &slow); |
| 414 | 415 |
| 415 | 416 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 441 | 442 |
| 442 // Do a quick inline probe of the receiver's dictionary, if it | 443 // Do a quick inline probe of the receiver's dictionary, if it |
| 443 // exists. | 444 // exists. |
| 444 __ bind(&probe_dictionary); | 445 __ bind(&probe_dictionary); |
| 445 // a3: elements | 446 // a3: elements |
| 446 __ ld(a0, FieldMemOperand(receiver, HeapObject::kMapOffset)); | 447 __ ld(a0, FieldMemOperand(receiver, HeapObject::kMapOffset)); |
| 447 __ lbu(a0, FieldMemOperand(a0, Map::kInstanceTypeOffset)); | 448 __ lbu(a0, FieldMemOperand(a0, Map::kInstanceTypeOffset)); |
| 448 GenerateGlobalInstanceTypeCheck(masm, a0, &slow); | 449 GenerateGlobalInstanceTypeCheck(masm, a0, &slow); |
| 449 // Load the property to v0. | 450 // Load the property to v0. |
| 450 GenerateDictionaryLoad(masm, &slow, a3, key, v0, a5, a4); | 451 GenerateDictionaryLoad(masm, &slow, a3, key, v0, a5, a4); |
| 451 __ IncrementCounter(isolate->counters()->keyed_load_generic_symbol(), 1, a4, | 452 __ IncrementCounter(isolate->counters()->ic_keyed_load_generic_symbol(), 1, |
| 452 a3); | 453 a4, a3); |
| 453 __ Ret(); | 454 __ Ret(); |
| 454 | 455 |
| 455 __ bind(&index_name); | 456 __ bind(&index_name); |
| 456 __ IndexFromHash(a3, key); | 457 __ IndexFromHash(a3, key); |
| 457 // Now jump to the place where smi keys are handled. | 458 // Now jump to the place where smi keys are handled. |
| 458 __ Branch(&index_smi); | 459 __ Branch(&index_smi); |
| 459 } | 460 } |
| 460 | 461 |
| 461 | 462 |
| 462 static void KeyedStoreGenerateMegamorphicHelper( | 463 static void KeyedStoreGenerateMegamorphicHelper( |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 780 Register value = StoreDescriptor::ValueRegister(); | 781 Register value = StoreDescriptor::ValueRegister(); |
| 781 Register dictionary = a5; | 782 Register dictionary = a5; |
| 782 DCHECK(!AreAliased( | 783 DCHECK(!AreAliased( |
| 783 value, receiver, name, VectorStoreICDescriptor::VectorRegister(), | 784 value, receiver, name, VectorStoreICDescriptor::VectorRegister(), |
| 784 VectorStoreICDescriptor::SlotRegister(), dictionary, a6, a7)); | 785 VectorStoreICDescriptor::SlotRegister(), dictionary, a6, a7)); |
| 785 | 786 |
| 786 __ ld(dictionary, FieldMemOperand(receiver, JSObject::kPropertiesOffset)); | 787 __ ld(dictionary, FieldMemOperand(receiver, JSObject::kPropertiesOffset)); |
| 787 | 788 |
| 788 GenerateDictionaryStore(masm, &miss, dictionary, name, value, a6, a7); | 789 GenerateDictionaryStore(masm, &miss, dictionary, name, value, a6, a7); |
| 789 Counters* counters = masm->isolate()->counters(); | 790 Counters* counters = masm->isolate()->counters(); |
| 790 __ IncrementCounter(counters->store_normal_hit(), 1, a6, a7); | 791 __ IncrementCounter(counters->ic_store_normal_hit(), 1, a6, a7); |
| 791 __ Ret(); | 792 __ Ret(); |
| 792 | 793 |
| 793 __ bind(&miss); | 794 __ bind(&miss); |
| 794 __ IncrementCounter(counters->store_normal_miss(), 1, a6, a7); | 795 __ IncrementCounter(counters->ic_store_normal_miss(), 1, a6, a7); |
| 795 GenerateMiss(masm); | 796 GenerateMiss(masm); |
| 796 } | 797 } |
| 797 | 798 |
| 798 | 799 |
| 799 #undef __ | 800 #undef __ |
| 800 | 801 |
| 801 | 802 |
| 802 Condition CompareIC::ComputeCondition(Token::Value op) { | 803 Condition CompareIC::ComputeCondition(Token::Value op) { |
| 803 switch (op) { | 804 switch (op) { |
| 804 case Token::EQ_STRICT: | 805 case Token::EQ_STRICT: |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 918 break; | 919 break; |
| 919 default: | 920 default: |
| 920 UNIMPLEMENTED(); | 921 UNIMPLEMENTED(); |
| 921 } | 922 } |
| 922 patcher.ChangeBranchCondition(branch_instr, opcode); | 923 patcher.ChangeBranchCondition(branch_instr, opcode); |
| 923 } | 924 } |
| 924 } // namespace internal | 925 } // namespace internal |
| 925 } // namespace v8 | 926 } // namespace v8 |
| 926 | 927 |
| 927 #endif // V8_TARGET_ARCH_MIPS64 | 928 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |