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

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

Issue 18854018: ARM: Do not omit the write-barrier if the input value is a smi. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
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 | Annotate | Revision Log
« 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 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 if (index < 0) { 563 if (index < 0) {
564 // Set the property straight into the object. 564 // Set the property straight into the object.
565 int offset = object->map()->instance_size() + (index * kPointerSize); 565 int offset = object->map()->instance_size() + (index * kPointerSize);
566 if (FLAG_track_double_fields && representation.IsDouble()) { 566 if (FLAG_track_double_fields && representation.IsDouble()) {
567 __ str(storage_reg, FieldMemOperand(receiver_reg, offset)); 567 __ str(storage_reg, FieldMemOperand(receiver_reg, offset));
568 } else { 568 } else {
569 __ str(value_reg, FieldMemOperand(receiver_reg, offset)); 569 __ str(value_reg, FieldMemOperand(receiver_reg, offset));
570 } 570 }
571 571
572 if (!FLAG_track_fields || !representation.IsSmi()) { 572 if (!FLAG_track_fields || !representation.IsSmi()) {
573 // Skip updating write barrier if storing a smi.
574 __ JumpIfSmi(value_reg, &exit);
575
576 // Update the write barrier for the array address. 573 // Update the write barrier for the array address.
577 if (!FLAG_track_double_fields || !representation.IsDouble()) { 574 if (!FLAG_track_double_fields || !representation.IsDouble()) {
578 __ mov(storage_reg, value_reg); 575 __ mov(storage_reg, value_reg);
579 } 576 }
580 __ RecordWriteField(receiver_reg, 577 __ RecordWriteField(receiver_reg,
581 offset, 578 offset,
582 storage_reg, 579 storage_reg,
583 scratch1, 580 scratch1,
584 kLRHasNotBeenSaved, 581 kLRHasNotBeenSaved,
585 kDontSaveFPRegs, 582 kDontSaveFPRegs,
586 EMIT_REMEMBERED_SET, 583 EMIT_REMEMBERED_SET,
587 smi_check); 584 smi_check);
588 } 585 }
589 } else { 586 } else {
590 // Write to the properties array. 587 // Write to the properties array.
591 int offset = index * kPointerSize + FixedArray::kHeaderSize; 588 int offset = index * kPointerSize + FixedArray::kHeaderSize;
592 // Get the properties array 589 // Get the properties array
593 __ ldr(scratch1, 590 __ ldr(scratch1,
594 FieldMemOperand(receiver_reg, JSObject::kPropertiesOffset)); 591 FieldMemOperand(receiver_reg, JSObject::kPropertiesOffset));
595 if (FLAG_track_double_fields && representation.IsDouble()) { 592 if (FLAG_track_double_fields && representation.IsDouble()) {
596 __ str(storage_reg, FieldMemOperand(scratch1, offset)); 593 __ str(storage_reg, FieldMemOperand(scratch1, offset));
597 } else { 594 } else {
598 __ str(value_reg, FieldMemOperand(scratch1, offset)); 595 __ str(value_reg, FieldMemOperand(scratch1, offset));
599 } 596 }
600 597
601 if (!FLAG_track_fields || !representation.IsSmi()) { 598 if (!FLAG_track_fields || !representation.IsSmi()) {
602 // Skip updating write barrier if storing a smi.
603 __ JumpIfSmi(value_reg, &exit);
604
605 // Update the write barrier for the array address. 599 // Update the write barrier for the array address.
606 if (!FLAG_track_double_fields || !representation.IsDouble()) { 600 if (!FLAG_track_double_fields || !representation.IsDouble()) {
607 __ mov(storage_reg, value_reg); 601 __ mov(storage_reg, value_reg);
608 } 602 }
609 __ RecordWriteField(scratch1, 603 __ RecordWriteField(scratch1,
610 offset, 604 offset,
611 storage_reg, 605 storage_reg,
612 receiver_reg, 606 receiver_reg,
613 kLRHasNotBeenSaved, 607 kLRHasNotBeenSaved,
614 kDontSaveFPRegs, 608 kDontSaveFPRegs,
(...skipping 3079 matching lines...) Expand 10 before | Expand all | Expand 10 after
3694 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow); 3688 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow);
3695 } 3689 }
3696 } 3690 }
3697 3691
3698 3692
3699 #undef __ 3693 #undef __
3700 3694
3701 } } // namespace v8::internal 3695 } } // namespace v8::internal
3702 3696
3703 #endif // V8_TARGET_ARCH_ARM 3697 #endif // V8_TARGET_ARCH_ARM
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