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