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 | 5 |
6 #include "src/v8.h" | 6 #include "src/v8.h" |
7 | 7 |
8 #if V8_TARGET_ARCH_MIPS64 | 8 #if V8_TARGET_ARCH_MIPS64 |
9 | 9 |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 STATIC_ASSERT(kInternalizedTag == 0); | 243 STATIC_ASSERT(kInternalizedTag == 0); |
244 __ And(at, hash, Operand(kIsNotInternalizedMask)); | 244 __ And(at, hash, Operand(kIsNotInternalizedMask)); |
245 __ Branch(not_unique, ne, at, Operand(zero_reg)); | 245 __ Branch(not_unique, ne, at, Operand(zero_reg)); |
246 | 246 |
247 __ bind(&unique); | 247 __ bind(&unique); |
248 } | 248 } |
249 | 249 |
250 | 250 |
251 void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { | 251 void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { |
252 // The return address is in lr. | 252 // The return address is in lr. |
253 Register receiver = ReceiverRegister(); | 253 Register receiver = LoadConvention::ReceiverRegister(); |
254 Register name = NameRegister(); | 254 Register name = LoadConvention::NameRegister(); |
255 DCHECK(receiver.is(a1)); | 255 DCHECK(receiver.is(a1)); |
256 DCHECK(name.is(a2)); | 256 DCHECK(name.is(a2)); |
257 | 257 |
258 // Probe the stub cache. | 258 // Probe the stub cache. |
259 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 259 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
260 Code::ComputeHandlerFlags(Code::LOAD_IC)); | 260 Code::ComputeHandlerFlags(Code::LOAD_IC)); |
261 masm->isolate()->stub_cache()->GenerateProbe(masm, flags, receiver, name, a3, | 261 masm->isolate()->stub_cache()->GenerateProbe(masm, flags, receiver, name, a3, |
262 a4, a5, a6); | 262 a4, a5, a6); |
263 | 263 |
264 // Cache miss: Jump to runtime. | 264 // Cache miss: Jump to runtime. |
265 GenerateMiss(masm); | 265 GenerateMiss(masm); |
266 } | 266 } |
267 | 267 |
268 | 268 |
269 void LoadIC::GenerateNormal(MacroAssembler* masm) { | 269 void LoadIC::GenerateNormal(MacroAssembler* masm) { |
270 Register dictionary = a0; | 270 Register dictionary = a0; |
271 DCHECK(!dictionary.is(ReceiverRegister())); | 271 DCHECK(!dictionary.is(LoadConvention::ReceiverRegister())); |
272 DCHECK(!dictionary.is(NameRegister())); | 272 DCHECK(!dictionary.is(LoadConvention::NameRegister())); |
273 Label slow; | 273 Label slow; |
274 | 274 |
275 __ ld(dictionary, | 275 __ ld(dictionary, FieldMemOperand(LoadConvention::ReceiverRegister(), |
276 FieldMemOperand(ReceiverRegister(), JSObject::kPropertiesOffset)); | 276 JSObject::kPropertiesOffset)); |
277 GenerateDictionaryLoad(masm, &slow, dictionary, NameRegister(), v0, a3, a4); | 277 GenerateDictionaryLoad(masm, &slow, dictionary, |
| 278 LoadConvention::NameRegister(), v0, a3, a4); |
278 __ Ret(); | 279 __ Ret(); |
279 | 280 |
280 // Dictionary load failed, go slow (but don't miss). | 281 // Dictionary load failed, go slow (but don't miss). |
281 __ bind(&slow); | 282 __ bind(&slow); |
282 GenerateRuntimeGetProperty(masm); | 283 GenerateRuntimeGetProperty(masm); |
283 } | 284 } |
284 | 285 |
285 | 286 |
286 // A register that isn't one of the parameters to the load ic. | 287 // A register that isn't one of the parameters to the load ic. |
287 static const Register LoadIC_TempRegister() { return a3; } | 288 static const Register LoadIC_TempRegister() { return a3; } |
288 | 289 |
289 | 290 |
290 void LoadIC::GenerateMiss(MacroAssembler* masm) { | 291 void LoadIC::GenerateMiss(MacroAssembler* masm) { |
291 // The return address is on the stack. | 292 // The return address is on the stack. |
292 Isolate* isolate = masm->isolate(); | 293 Isolate* isolate = masm->isolate(); |
293 | 294 |
294 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, a3, a4); | 295 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, a3, a4); |
295 | 296 |
296 __ mov(LoadIC_TempRegister(), ReceiverRegister()); | 297 __ mov(LoadIC_TempRegister(), LoadConvention::ReceiverRegister()); |
297 __ Push(LoadIC_TempRegister(), NameRegister()); | 298 __ Push(LoadIC_TempRegister(), LoadConvention::NameRegister()); |
298 | 299 |
299 // Perform tail call to the entry. | 300 // Perform tail call to the entry. |
300 ExternalReference ref = ExternalReference(IC_Utility(kLoadIC_Miss), isolate); | 301 ExternalReference ref = ExternalReference(IC_Utility(kLoadIC_Miss), isolate); |
301 __ TailCallExternalReference(ref, 2, 1); | 302 __ TailCallExternalReference(ref, 2, 1); |
302 } | 303 } |
303 | 304 |
304 | 305 |
305 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { | 306 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
306 // The return address is in ra. | 307 // The return address is in ra. |
307 | 308 |
308 __ mov(LoadIC_TempRegister(), ReceiverRegister()); | 309 __ mov(LoadIC_TempRegister(), LoadConvention::ReceiverRegister()); |
309 __ Push(LoadIC_TempRegister(), NameRegister()); | 310 __ Push(LoadIC_TempRegister(), LoadConvention::NameRegister()); |
310 | 311 |
311 __ TailCallRuntime(Runtime::kGetProperty, 2, 1); | 312 __ TailCallRuntime(Runtime::kGetProperty, 2, 1); |
312 } | 313 } |
313 | 314 |
314 | 315 |
315 static MemOperand GenerateMappedArgumentsLookup( | 316 static MemOperand GenerateMappedArgumentsLookup( |
316 MacroAssembler* masm, Register object, Register key, Register scratch1, | 317 MacroAssembler* masm, Register object, Register key, Register scratch1, |
317 Register scratch2, Register scratch3, Label* unmapped_case, | 318 Register scratch2, Register scratch3, Label* unmapped_case, |
318 Label* slow_case) { | 319 Label* slow_case) { |
319 Heap* heap = masm->isolate()->heap(); | 320 Heap* heap = masm->isolate()->heap(); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 __ SmiUntag(scratch, key); | 385 __ SmiUntag(scratch, key); |
385 __ dsll(scratch, scratch, kPointerSizeLog2); | 386 __ dsll(scratch, scratch, kPointerSizeLog2); |
386 __ Daddu(scratch, scratch, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); | 387 __ Daddu(scratch, scratch, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); |
387 __ Daddu(scratch, backing_store, scratch); | 388 __ Daddu(scratch, backing_store, scratch); |
388 return MemOperand(scratch); | 389 return MemOperand(scratch); |
389 } | 390 } |
390 | 391 |
391 | 392 |
392 void KeyedLoadIC::GenerateSloppyArguments(MacroAssembler* masm) { | 393 void KeyedLoadIC::GenerateSloppyArguments(MacroAssembler* masm) { |
393 // The return address is in ra. | 394 // The return address is in ra. |
394 Register receiver = ReceiverRegister(); | 395 Register receiver = LoadConvention::ReceiverRegister(); |
395 Register key = NameRegister(); | 396 Register key = LoadConvention::NameRegister(); |
396 DCHECK(receiver.is(a1)); | 397 DCHECK(receiver.is(a1)); |
397 DCHECK(key.is(a2)); | 398 DCHECK(key.is(a2)); |
398 | 399 |
399 Label slow, notin; | 400 Label slow, notin; |
400 MemOperand mapped_location = GenerateMappedArgumentsLookup( | 401 MemOperand mapped_location = GenerateMappedArgumentsLookup( |
401 masm, receiver, key, a0, a3, a4, ¬in, &slow); | 402 masm, receiver, key, a0, a3, a4, ¬in, &slow); |
402 __ Ret(USE_DELAY_SLOT); | 403 __ Ret(USE_DELAY_SLOT); |
403 __ ld(v0, mapped_location); | 404 __ ld(v0, mapped_location); |
404 __ bind(¬in); | 405 __ bind(¬in); |
405 // The unmapped lookup expects that the parameter map is in a2. | 406 // The unmapped lookup expects that the parameter map is in a2. |
406 MemOperand unmapped_location = | 407 MemOperand unmapped_location = |
407 GenerateUnmappedArgumentsLookup(masm, key, a0, a3, &slow); | 408 GenerateUnmappedArgumentsLookup(masm, key, a0, a3, &slow); |
408 __ ld(a0, unmapped_location); | 409 __ ld(a0, unmapped_location); |
409 __ LoadRoot(a3, Heap::kTheHoleValueRootIndex); | 410 __ LoadRoot(a3, Heap::kTheHoleValueRootIndex); |
410 __ Branch(&slow, eq, a0, Operand(a3)); | 411 __ Branch(&slow, eq, a0, Operand(a3)); |
411 __ Ret(USE_DELAY_SLOT); | 412 __ Ret(USE_DELAY_SLOT); |
412 __ mov(v0, a0); | 413 __ mov(v0, a0); |
413 __ bind(&slow); | 414 __ bind(&slow); |
414 GenerateMiss(masm); | 415 GenerateMiss(masm); |
415 } | 416 } |
416 | 417 |
417 | 418 |
418 void KeyedStoreIC::GenerateSloppyArguments(MacroAssembler* masm) { | 419 void KeyedStoreIC::GenerateSloppyArguments(MacroAssembler* masm) { |
419 Register receiver = ReceiverRegister(); | 420 Register receiver = StoreConvention::ReceiverRegister(); |
420 Register key = NameRegister(); | 421 Register key = StoreConvention::NameRegister(); |
421 Register value = ValueRegister(); | 422 Register value = StoreConvention::ValueRegister(); |
422 DCHECK(value.is(a0)); | 423 DCHECK(value.is(a0)); |
423 | 424 |
424 Label slow, notin; | 425 Label slow, notin; |
425 // Store address is returned in register (of MemOperand) mapped_location. | 426 // Store address is returned in register (of MemOperand) mapped_location. |
426 MemOperand mapped_location = GenerateMappedArgumentsLookup( | 427 MemOperand mapped_location = GenerateMappedArgumentsLookup( |
427 masm, receiver, key, a3, a4, a5, ¬in, &slow); | 428 masm, receiver, key, a3, a4, a5, ¬in, &slow); |
428 __ sd(value, mapped_location); | 429 __ sd(value, mapped_location); |
429 __ mov(t1, value); | 430 __ mov(t1, value); |
430 DCHECK_EQ(mapped_location.offset(), 0); | 431 DCHECK_EQ(mapped_location.offset(), 0); |
431 __ RecordWrite(a3, mapped_location.rm(), t1, kRAHasNotBeenSaved, | 432 __ RecordWrite(a3, mapped_location.rm(), t1, kRAHasNotBeenSaved, |
(...skipping 16 matching lines...) Expand all Loading... |
448 GenerateMiss(masm); | 449 GenerateMiss(masm); |
449 } | 450 } |
450 | 451 |
451 | 452 |
452 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { | 453 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { |
453 // The return address is in ra. | 454 // The return address is in ra. |
454 Isolate* isolate = masm->isolate(); | 455 Isolate* isolate = masm->isolate(); |
455 | 456 |
456 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, a3, a4); | 457 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, a3, a4); |
457 | 458 |
458 __ Push(ReceiverRegister(), NameRegister()); | 459 __ Push(LoadConvention::ReceiverRegister(), LoadConvention::NameRegister()); |
459 | 460 |
460 // Perform tail call to the entry. | 461 // Perform tail call to the entry. |
461 ExternalReference ref = | 462 ExternalReference ref = |
462 ExternalReference(IC_Utility(kKeyedLoadIC_Miss), isolate); | 463 ExternalReference(IC_Utility(kKeyedLoadIC_Miss), isolate); |
463 | 464 |
464 __ TailCallExternalReference(ref, 2, 1); | 465 __ TailCallExternalReference(ref, 2, 1); |
465 } | 466 } |
466 | 467 |
467 | 468 |
468 // IC register specifications | |
469 const Register LoadIC::ReceiverRegister() { return a1; } | |
470 const Register LoadIC::NameRegister() { return a2; } | |
471 | |
472 | |
473 const Register LoadIC::SlotRegister() { | |
474 DCHECK(FLAG_vector_ics); | |
475 return a0; | |
476 } | |
477 | |
478 | |
479 const Register LoadIC::VectorRegister() { | |
480 DCHECK(FLAG_vector_ics); | |
481 return a3; | |
482 } | |
483 | |
484 | |
485 const Register StoreIC::ReceiverRegister() { return a1; } | |
486 const Register StoreIC::NameRegister() { return a2; } | |
487 const Register StoreIC::ValueRegister() { return a0; } | |
488 | |
489 | |
490 const Register KeyedStoreIC::MapRegister() { return a3; } | |
491 | |
492 | |
493 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { | 469 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
494 // The return address is in ra. | 470 // The return address is in ra. |
495 | 471 |
496 __ Push(ReceiverRegister(), NameRegister()); | 472 __ Push(LoadConvention::ReceiverRegister(), LoadConvention::NameRegister()); |
497 | 473 |
498 __ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1); | 474 __ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1); |
499 } | 475 } |
500 | 476 |
501 | 477 |
502 void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) { | 478 void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) { |
503 // The return address is in ra. | 479 // The return address is in ra. |
504 Label slow, check_name, index_smi, index_name, property_array_property; | 480 Label slow, check_name, index_smi, index_name, property_array_property; |
505 Label probe_dictionary, check_number_dictionary; | 481 Label probe_dictionary, check_number_dictionary; |
506 | 482 |
507 Register key = NameRegister(); | 483 Register key = LoadConvention::NameRegister(); |
508 Register receiver = ReceiverRegister(); | 484 Register receiver = LoadConvention::ReceiverRegister(); |
509 DCHECK(key.is(a2)); | 485 DCHECK(key.is(a2)); |
510 DCHECK(receiver.is(a1)); | 486 DCHECK(receiver.is(a1)); |
511 | 487 |
512 Isolate* isolate = masm->isolate(); | 488 Isolate* isolate = masm->isolate(); |
513 | 489 |
514 // Check that the key is a smi. | 490 // Check that the key is a smi. |
515 __ JumpIfNotSmi(key, &check_name); | 491 __ JumpIfNotSmi(key, &check_name); |
516 __ bind(&index_smi); | 492 __ bind(&index_smi); |
517 // Now the key is known to be a smi. This place is also jumped to from below | 493 // Now the key is known to be a smi. This place is also jumped to from below |
518 // where a numeric string is converted to a smi. | 494 // where a numeric string is converted to a smi. |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 __ IndexFromHash(a3, key); | 640 __ IndexFromHash(a3, key); |
665 // Now jump to the place where smi keys are handled. | 641 // Now jump to the place where smi keys are handled. |
666 __ Branch(&index_smi); | 642 __ Branch(&index_smi); |
667 } | 643 } |
668 | 644 |
669 | 645 |
670 void KeyedLoadIC::GenerateString(MacroAssembler* masm) { | 646 void KeyedLoadIC::GenerateString(MacroAssembler* masm) { |
671 // Return address is in ra. | 647 // Return address is in ra. |
672 Label miss; | 648 Label miss; |
673 | 649 |
674 Register receiver = ReceiverRegister(); | 650 Register receiver = LoadConvention::ReceiverRegister(); |
675 Register index = NameRegister(); | 651 Register index = LoadConvention::NameRegister(); |
676 Register scratch = a3; | 652 Register scratch = a3; |
677 Register result = v0; | 653 Register result = v0; |
678 DCHECK(!scratch.is(receiver) && !scratch.is(index)); | 654 DCHECK(!scratch.is(receiver) && !scratch.is(index)); |
679 | 655 |
680 StringCharAtGenerator char_at_generator(receiver, index, scratch, result, | 656 StringCharAtGenerator char_at_generator(receiver, index, scratch, result, |
681 &miss, // When not a string. | 657 &miss, // When not a string. |
682 &miss, // When not a number. | 658 &miss, // When not a number. |
683 &miss, // When index out of range. | 659 &miss, // When index out of range. |
684 STRING_INDEX_IS_ARRAY_INDEX); | 660 STRING_INDEX_IS_ARRAY_INDEX); |
685 char_at_generator.GenerateFast(masm); | 661 char_at_generator.GenerateFast(masm); |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 // -- a0 : value | 825 // -- a0 : value |
850 // -- a1 : key | 826 // -- a1 : key |
851 // -- a2 : receiver | 827 // -- a2 : receiver |
852 // -- ra : return address | 828 // -- ra : return address |
853 // ----------------------------------- | 829 // ----------------------------------- |
854 Label slow, fast_object, fast_object_grow; | 830 Label slow, fast_object, fast_object_grow; |
855 Label fast_double, fast_double_grow; | 831 Label fast_double, fast_double_grow; |
856 Label array, extra, check_if_double_array; | 832 Label array, extra, check_if_double_array; |
857 | 833 |
858 // Register usage. | 834 // Register usage. |
859 Register value = ValueRegister(); | 835 Register value = StoreConvention::ValueRegister(); |
860 Register key = NameRegister(); | 836 Register key = StoreConvention::NameRegister(); |
861 Register receiver = ReceiverRegister(); | 837 Register receiver = StoreConvention::ReceiverRegister(); |
862 DCHECK(value.is(a0)); | 838 DCHECK(value.is(a0)); |
863 Register receiver_map = a3; | 839 Register receiver_map = a3; |
864 Register elements_map = a6; | 840 Register elements_map = a6; |
865 Register elements = a7; // Elements array of the receiver. | 841 Register elements = a7; // Elements array of the receiver. |
866 // a4 and a5 are used as general scratch registers. | 842 // a4 and a5 are used as general scratch registers. |
867 | 843 |
868 // Check that the key is a smi. | 844 // Check that the key is a smi. |
869 __ JumpIfNotSmi(key, &slow); | 845 __ JumpIfNotSmi(key, &slow); |
870 // Check that the object isn't a smi. | 846 // Check that the object isn't a smi. |
871 __ JumpIfSmi(receiver, &slow); | 847 __ JumpIfSmi(receiver, &slow); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
935 &slow, kDontCheckMap, kIncrementLength, value, | 911 &slow, kDontCheckMap, kIncrementLength, value, |
936 key, receiver, receiver_map, elements_map, | 912 key, receiver, receiver_map, elements_map, |
937 elements); | 913 elements); |
938 } | 914 } |
939 | 915 |
940 | 916 |
941 void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { | 917 void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { |
942 // Return address is in ra. | 918 // Return address is in ra. |
943 Label slow; | 919 Label slow; |
944 | 920 |
945 Register receiver = ReceiverRegister(); | 921 Register receiver = LoadConvention::ReceiverRegister(); |
946 Register key = NameRegister(); | 922 Register key = LoadConvention::NameRegister(); |
947 Register scratch1 = a3; | 923 Register scratch1 = a3; |
948 Register scratch2 = a4; | 924 Register scratch2 = a4; |
949 DCHECK(!scratch1.is(receiver) && !scratch1.is(key)); | 925 DCHECK(!scratch1.is(receiver) && !scratch1.is(key)); |
950 DCHECK(!scratch2.is(receiver) && !scratch2.is(key)); | 926 DCHECK(!scratch2.is(receiver) && !scratch2.is(key)); |
951 | 927 |
952 // Check that the receiver isn't a smi. | 928 // Check that the receiver isn't a smi. |
953 __ JumpIfSmi(receiver, &slow); | 929 __ JumpIfSmi(receiver, &slow); |
954 | 930 |
955 // Check that the key is an array index, that is Uint32. | 931 // Check that the key is an array index, that is Uint32. |
956 __ And(a4, key, Operand(kSmiTagMask | kSmiSignMask)); | 932 __ And(a4, key, Operand(kSmiTagMask | kSmiSignMask)); |
(...skipping 16 matching lines...) Expand all Loading... |
973 masm->isolate()), | 949 masm->isolate()), |
974 2, 1); | 950 2, 1); |
975 | 951 |
976 __ bind(&slow); | 952 __ bind(&slow); |
977 GenerateMiss(masm); | 953 GenerateMiss(masm); |
978 } | 954 } |
979 | 955 |
980 | 956 |
981 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { | 957 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { |
982 // Push receiver, key and value for runtime call. | 958 // Push receiver, key and value for runtime call. |
983 __ Push(ReceiverRegister(), NameRegister(), ValueRegister()); | 959 __ Push(StoreConvention::ReceiverRegister(), StoreConvention::NameRegister(), |
| 960 StoreConvention::ValueRegister()); |
984 | 961 |
985 ExternalReference ref = | 962 ExternalReference ref = |
986 ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate()); | 963 ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate()); |
987 __ TailCallExternalReference(ref, 3, 1); | 964 __ TailCallExternalReference(ref, 3, 1); |
988 } | 965 } |
989 | 966 |
990 | 967 |
991 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { | 968 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { |
992 Register receiver = ReceiverRegister(); | 969 Register receiver = StoreConvention::ReceiverRegister(); |
993 Register name = NameRegister(); | 970 Register name = StoreConvention::NameRegister(); |
994 DCHECK(receiver.is(a1)); | 971 DCHECK(receiver.is(a1)); |
995 DCHECK(name.is(a2)); | 972 DCHECK(name.is(a2)); |
996 DCHECK(ValueRegister().is(a0)); | 973 DCHECK(StoreConvention::ValueRegister().is(a0)); |
997 | 974 |
998 // Get the receiver from the stack and probe the stub cache. | 975 // Get the receiver from the stack and probe the stub cache. |
999 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 976 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
1000 Code::ComputeHandlerFlags(Code::STORE_IC)); | 977 Code::ComputeHandlerFlags(Code::STORE_IC)); |
1001 masm->isolate()->stub_cache()->GenerateProbe(masm, flags, receiver, name, a3, | 978 masm->isolate()->stub_cache()->GenerateProbe(masm, flags, receiver, name, a3, |
1002 a4, a5, a6); | 979 a4, a5, a6); |
1003 | 980 |
1004 // Cache miss: Jump to runtime. | 981 // Cache miss: Jump to runtime. |
1005 GenerateMiss(masm); | 982 GenerateMiss(masm); |
1006 } | 983 } |
1007 | 984 |
1008 | 985 |
1009 void StoreIC::GenerateMiss(MacroAssembler* masm) { | 986 void StoreIC::GenerateMiss(MacroAssembler* masm) { |
1010 __ Push(ReceiverRegister(), NameRegister(), ValueRegister()); | 987 __ Push(StoreConvention::ReceiverRegister(), StoreConvention::NameRegister(), |
| 988 StoreConvention::ValueRegister()); |
1011 // Perform tail call to the entry. | 989 // Perform tail call to the entry. |
1012 ExternalReference ref = | 990 ExternalReference ref = |
1013 ExternalReference(IC_Utility(kStoreIC_Miss), masm->isolate()); | 991 ExternalReference(IC_Utility(kStoreIC_Miss), masm->isolate()); |
1014 __ TailCallExternalReference(ref, 3, 1); | 992 __ TailCallExternalReference(ref, 3, 1); |
1015 } | 993 } |
1016 | 994 |
1017 | 995 |
1018 void StoreIC::GenerateNormal(MacroAssembler* masm) { | 996 void StoreIC::GenerateNormal(MacroAssembler* masm) { |
1019 Label miss; | 997 Label miss; |
1020 Register receiver = ReceiverRegister(); | 998 Register receiver = StoreConvention::ReceiverRegister(); |
1021 Register name = NameRegister(); | 999 Register name = StoreConvention::NameRegister(); |
1022 Register value = ValueRegister(); | 1000 Register value = StoreConvention::ValueRegister(); |
1023 Register dictionary = a3; | 1001 Register dictionary = a3; |
1024 DCHECK(!AreAliased(value, receiver, name, dictionary, a4, a5)); | 1002 DCHECK(!AreAliased(value, receiver, name, dictionary, a4, a5)); |
1025 | 1003 |
1026 __ ld(dictionary, FieldMemOperand(receiver, JSObject::kPropertiesOffset)); | 1004 __ ld(dictionary, FieldMemOperand(receiver, JSObject::kPropertiesOffset)); |
1027 | 1005 |
1028 GenerateDictionaryStore(masm, &miss, a3, name, value, a4, a5); | 1006 GenerateDictionaryStore(masm, &miss, a3, name, value, a4, a5); |
1029 Counters* counters = masm->isolate()->counters(); | 1007 Counters* counters = masm->isolate()->counters(); |
1030 __ IncrementCounter(counters->store_normal_hit(), 1, a4, a5); | 1008 __ IncrementCounter(counters->store_normal_hit(), 1, a4, a5); |
1031 __ Ret(); | 1009 __ Ret(); |
1032 | 1010 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1128 patcher.ChangeBranchCondition(ne); | 1106 patcher.ChangeBranchCondition(ne); |
1129 } else { | 1107 } else { |
1130 DCHECK(Assembler::IsBne(branch_instr)); | 1108 DCHECK(Assembler::IsBne(branch_instr)); |
1131 patcher.ChangeBranchCondition(eq); | 1109 patcher.ChangeBranchCondition(eq); |
1132 } | 1110 } |
1133 } | 1111 } |
1134 } | 1112 } |
1135 } // namespace v8::internal | 1113 } // namespace v8::internal |
1136 | 1114 |
1137 #endif // V8_TARGET_ARCH_MIPS64 | 1115 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |