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

Side by Side Diff: src/mips/stub-cache-mips.cc

Issue 18118010: MIPS: Do not omit the write-barrier if the input value is a smi. (Closed) Base URL: https://github.com/v8/v8.git@gbl
Patch Set: Created 7 years, 5 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 | « no previous file | no next file » | 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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 if (index < 0) { 587 if (index < 0) {
588 // Set the property straight into the object. 588 // Set the property straight into the object.
589 int offset = object->map()->instance_size() + (index * kPointerSize); 589 int offset = object->map()->instance_size() + (index * kPointerSize);
590 if (FLAG_track_double_fields && representation.IsDouble()) { 590 if (FLAG_track_double_fields && representation.IsDouble()) {
591 __ sw(storage_reg, FieldMemOperand(receiver_reg, offset)); 591 __ sw(storage_reg, FieldMemOperand(receiver_reg, offset));
592 } else { 592 } else {
593 __ sw(value_reg, FieldMemOperand(receiver_reg, offset)); 593 __ sw(value_reg, FieldMemOperand(receiver_reg, offset));
594 } 594 }
595 595
596 if (!FLAG_track_fields || !representation.IsSmi()) { 596 if (!FLAG_track_fields || !representation.IsSmi()) {
597 // Skip updating write barrier if storing a smi.
598 __ JumpIfSmi(value_reg, &exit);
599
600 // Update the write barrier for the array address. 597 // Update the write barrier for the array address.
601 // Pass the now unused name_reg as a scratch register. 598 // Pass the now unused name_reg as a scratch register.
602 if (!FLAG_track_double_fields || !representation.IsDouble()) { 599 if (!FLAG_track_double_fields || !representation.IsDouble()) {
603 __ mov(name_reg, value_reg); 600 __ mov(name_reg, value_reg);
604 } else { 601 } else {
605 ASSERT(storage_reg.is(name_reg)); 602 ASSERT(storage_reg.is(name_reg));
606 } 603 }
607 __ RecordWriteField(receiver_reg, 604 __ RecordWriteField(receiver_reg,
608 offset, 605 offset,
609 name_reg, 606 name_reg,
610 scratch1, 607 scratch1,
611 kRAHasNotBeenSaved, 608 kRAHasNotBeenSaved,
612 kDontSaveFPRegs, 609 kDontSaveFPRegs,
613 EMIT_REMEMBERED_SET, 610 EMIT_REMEMBERED_SET,
614 smi_check); 611 smi_check);
615 } 612 }
616 } else { 613 } else {
617 // Write to the properties array. 614 // Write to the properties array.
618 int offset = index * kPointerSize + FixedArray::kHeaderSize; 615 int offset = index * kPointerSize + FixedArray::kHeaderSize;
619 // Get the properties array 616 // Get the properties array
620 __ lw(scratch1, 617 __ lw(scratch1,
621 FieldMemOperand(receiver_reg, JSObject::kPropertiesOffset)); 618 FieldMemOperand(receiver_reg, JSObject::kPropertiesOffset));
622 if (FLAG_track_double_fields && representation.IsDouble()) { 619 if (FLAG_track_double_fields && representation.IsDouble()) {
623 __ sw(storage_reg, FieldMemOperand(scratch1, offset)); 620 __ sw(storage_reg, FieldMemOperand(scratch1, offset));
624 } else { 621 } else {
625 __ sw(value_reg, FieldMemOperand(scratch1, offset)); 622 __ sw(value_reg, FieldMemOperand(scratch1, offset));
626 } 623 }
627 624
628 if (!FLAG_track_fields || !representation.IsSmi()) { 625 if (!FLAG_track_fields || !representation.IsSmi()) {
629 // Skip updating write barrier if storing a smi.
630 __ JumpIfSmi(value_reg, &exit);
631
632 // Update the write barrier for the array address. 626 // Update the write barrier for the array address.
633 // Ok to clobber receiver_reg and name_reg, since we return. 627 // Ok to clobber receiver_reg and name_reg, since we return.
634 if (!FLAG_track_double_fields || !representation.IsDouble()) { 628 if (!FLAG_track_double_fields || !representation.IsDouble()) {
635 __ mov(name_reg, value_reg); 629 __ mov(name_reg, value_reg);
636 } else { 630 } else {
637 ASSERT(storage_reg.is(name_reg)); 631 ASSERT(storage_reg.is(name_reg));
638 } 632 }
639 __ RecordWriteField(scratch1, 633 __ RecordWriteField(scratch1,
640 offset, 634 offset,
641 name_reg, 635 name_reg,
(...skipping 3193 matching lines...) Expand 10 before | Expand all | Expand 10 after
3835 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow); 3829 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow);
3836 } 3830 }
3837 } 3831 }
3838 3832
3839 3833
3840 #undef __ 3834 #undef __
3841 3835
3842 } } // namespace v8::internal 3836 } } // namespace v8::internal
3843 3837
3844 #endif // V8_TARGET_ARCH_MIPS 3838 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698