Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Side by Side Diff: src/ic/mips64/ic-mips64.cc

Issue 2374003002: [ic][mips][mips64] Ensure store handlers return value in proper register. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ic/mips64/handler-compiler-mips64.cc ('k') | test/mjsunit/regress/regress-crbug-650973.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 // Add 1 to receiver->length. 489 // Add 1 to receiver->length.
490 __ Daddu(scratch, key, Operand(Smi::FromInt(1))); 490 __ Daddu(scratch, key, Operand(Smi::FromInt(1)));
491 __ sd(scratch, FieldMemOperand(receiver, JSArray::kLengthOffset)); 491 __ sd(scratch, FieldMemOperand(receiver, JSArray::kLengthOffset));
492 } 492 }
493 // It's irrelevant whether array is smi-only or not when writing a smi. 493 // It's irrelevant whether array is smi-only or not when writing a smi.
494 __ Daddu(address, elements, 494 __ Daddu(address, elements,
495 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); 495 Operand(FixedArray::kHeaderSize - kHeapObjectTag));
496 __ SmiScale(scratch, key, kPointerSizeLog2); 496 __ SmiScale(scratch, key, kPointerSizeLog2);
497 __ Daddu(address, address, scratch); 497 __ Daddu(address, address, scratch);
498 __ sd(value, MemOperand(address)); 498 __ sd(value, MemOperand(address));
499 __ Ret(); 499 __ Ret(USE_DELAY_SLOT);
500 __ Move(v0, value); // Ensure the stub returns correct value.
500 501
501 __ bind(&non_smi_value); 502 __ bind(&non_smi_value);
502 // Escape to elements kind transition case. 503 // Escape to elements kind transition case.
503 __ CheckFastObjectElements(receiver_map, scratch, &transition_smi_elements); 504 __ CheckFastObjectElements(receiver_map, scratch, &transition_smi_elements);
504 505
505 // Fast elements array, store the value to the elements backing store. 506 // Fast elements array, store the value to the elements backing store.
506 __ bind(&finish_object_store); 507 __ bind(&finish_object_store);
507 if (increment_length == kIncrementLength) { 508 if (increment_length == kIncrementLength) {
508 // Add 1 to receiver->length. 509 // Add 1 to receiver->length.
509 __ Daddu(scratch, key, Operand(Smi::FromInt(1))); 510 __ Daddu(scratch, key, Operand(Smi::FromInt(1)));
510 __ sd(scratch, FieldMemOperand(receiver, JSArray::kLengthOffset)); 511 __ sd(scratch, FieldMemOperand(receiver, JSArray::kLengthOffset));
511 } 512 }
512 __ Daddu(address, elements, 513 __ Daddu(address, elements,
513 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); 514 Operand(FixedArray::kHeaderSize - kHeapObjectTag));
514 __ SmiScale(scratch, key, kPointerSizeLog2); 515 __ SmiScale(scratch, key, kPointerSizeLog2);
515 __ Daddu(address, address, scratch); 516 __ Daddu(address, address, scratch);
516 __ sd(value, MemOperand(address)); 517 __ sd(value, MemOperand(address));
517 // Update write barrier for the elements array address. 518 // Update write barrier for the elements array address.
518 __ mov(scratch, value); // Preserve the value which is returned. 519 __ mov(scratch, value); // Preserve the value which is returned.
519 __ RecordWrite(elements, address, scratch, kRAHasNotBeenSaved, 520 __ RecordWrite(elements, address, scratch, kRAHasNotBeenSaved,
520 kDontSaveFPRegs, EMIT_REMEMBERED_SET, OMIT_SMI_CHECK); 521 kDontSaveFPRegs, EMIT_REMEMBERED_SET, OMIT_SMI_CHECK);
521 __ Ret(); 522 __ Ret(USE_DELAY_SLOT);
523 __ Move(v0, value); // Ensure the stub returns correct value.
522 524
523 __ bind(fast_double); 525 __ bind(fast_double);
524 if (check_map == kCheckMap) { 526 if (check_map == kCheckMap) {
525 // Check for fast double array case. If this fails, call through to the 527 // Check for fast double array case. If this fails, call through to the
526 // runtime. 528 // runtime.
527 __ LoadRoot(at, Heap::kFixedDoubleArrayMapRootIndex); 529 __ LoadRoot(at, Heap::kFixedDoubleArrayMapRootIndex);
528 __ Branch(slow, ne, elements_map, Operand(at)); 530 __ Branch(slow, ne, elements_map, Operand(at));
529 } 531 }
530 532
531 // HOLECHECK: guards "A[i] double hole?" 533 // HOLECHECK: guards "A[i] double hole?"
(...skipping 10 matching lines...) Expand all
542 __ JumpIfDictionaryInPrototypeChain(receiver, elements_map, scratch, slow); 544 __ JumpIfDictionaryInPrototypeChain(receiver, elements_map, scratch, slow);
543 545
544 __ bind(&fast_double_without_map_check); 546 __ bind(&fast_double_without_map_check);
545 __ StoreNumberToDoubleElements(value, key, elements, scratch, scratch2, 547 __ StoreNumberToDoubleElements(value, key, elements, scratch, scratch2,
546 &transition_double_elements); 548 &transition_double_elements);
547 if (increment_length == kIncrementLength) { 549 if (increment_length == kIncrementLength) {
548 // Add 1 to receiver->length. 550 // Add 1 to receiver->length.
549 __ Daddu(scratch, key, Operand(Smi::FromInt(1))); 551 __ Daddu(scratch, key, Operand(Smi::FromInt(1)));
550 __ sd(scratch, FieldMemOperand(receiver, JSArray::kLengthOffset)); 552 __ sd(scratch, FieldMemOperand(receiver, JSArray::kLengthOffset));
551 } 553 }
552 __ Ret(); 554 __ Ret(USE_DELAY_SLOT);
555 __ Move(v0, value); // Ensure the stub returns correct value.
553 556
554 __ bind(&transition_smi_elements); 557 __ bind(&transition_smi_elements);
555 // Transition the array appropriately depending on the value type. 558 // Transition the array appropriately depending on the value type.
556 __ ld(scratch, FieldMemOperand(value, HeapObject::kMapOffset)); 559 __ ld(scratch, FieldMemOperand(value, HeapObject::kMapOffset));
557 __ LoadRoot(at, Heap::kHeapNumberMapRootIndex); 560 __ LoadRoot(at, Heap::kHeapNumberMapRootIndex);
558 __ Branch(&non_double_value, ne, scratch, Operand(at)); 561 __ Branch(&non_double_value, ne, scratch, Operand(at));
559 562
560 // Value is a double. Transition FAST_SMI_ELEMENTS -> 563 // Value is a double. Transition FAST_SMI_ELEMENTS ->
561 // FAST_DOUBLE_ELEMENTS and complete the store. 564 // FAST_DOUBLE_ELEMENTS and complete the store.
562 __ LoadTransitionedArrayMapConditional( 565 __ LoadTransitionedArrayMapConditional(
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 Register dictionary = a5; 755 Register dictionary = a5;
753 DCHECK(!AreAliased( 756 DCHECK(!AreAliased(
754 value, receiver, name, StoreWithVectorDescriptor::VectorRegister(), 757 value, receiver, name, StoreWithVectorDescriptor::VectorRegister(),
755 StoreWithVectorDescriptor::SlotRegister(), dictionary, a6, a7)); 758 StoreWithVectorDescriptor::SlotRegister(), dictionary, a6, a7));
756 759
757 __ ld(dictionary, FieldMemOperand(receiver, JSObject::kPropertiesOffset)); 760 __ ld(dictionary, FieldMemOperand(receiver, JSObject::kPropertiesOffset));
758 761
759 GenerateDictionaryStore(masm, &miss, dictionary, name, value, a6, a7); 762 GenerateDictionaryStore(masm, &miss, dictionary, name, value, a6, a7);
760 Counters* counters = masm->isolate()->counters(); 763 Counters* counters = masm->isolate()->counters();
761 __ IncrementCounter(counters->ic_store_normal_hit(), 1, a6, a7); 764 __ IncrementCounter(counters->ic_store_normal_hit(), 1, a6, a7);
762 __ Ret(); 765 __ Ret(USE_DELAY_SLOT);
766 __ Move(v0, value); // Ensure the stub returns correct value.
763 767
764 __ bind(&miss); 768 __ bind(&miss);
765 __ IncrementCounter(counters->ic_store_normal_miss(), 1, a6, a7); 769 __ IncrementCounter(counters->ic_store_normal_miss(), 1, a6, a7);
766 GenerateMiss(masm); 770 GenerateMiss(masm);
767 } 771 }
768 772
769 773
770 #undef __ 774 #undef __
771 775
772 776
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 break; 894 break;
891 default: 895 default:
892 UNIMPLEMENTED(); 896 UNIMPLEMENTED();
893 } 897 }
894 patcher.ChangeBranchCondition(branch_instr, opcode); 898 patcher.ChangeBranchCondition(branch_instr, opcode);
895 } 899 }
896 } // namespace internal 900 } // namespace internal
897 } // namespace v8 901 } // namespace v8
898 902
899 #endif // V8_TARGET_ARCH_MIPS64 903 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/ic/mips64/handler-compiler-mips64.cc ('k') | test/mjsunit/regress/regress-crbug-650973.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698