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

Side by Side Diff: runtime/vm/assembler_x64.h

Issue 738453002: Add missing verified write on x64; extend test coverage (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 1 month 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 | runtime/vm/assembler_x64.cc » ('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 (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_ASSEMBLER_X64_H_ 5 #ifndef VM_ASSEMBLER_X64_H_
6 #define VM_ASSEMBLER_X64_H_ 6 #define VM_ASSEMBLER_X64_H_
7 7
8 #ifndef VM_ASSEMBLER_H_ 8 #ifndef VM_ASSEMBLER_H_
9 #error Do not include assembler_x64.h directly; use assembler.h instead. 9 #error Do not include assembler_x64.h directly; use assembler.h instead.
10 #endif 10 #endif
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 668
669 void cmpxchgq(const Address& address, Register reg); 669 void cmpxchgq(const Address& address, Register reg);
670 void lock_cmpxchgq(const Address& address, Register reg) { 670 void lock_cmpxchgq(const Address& address, Register reg) {
671 lock(); 671 lock();
672 cmpxchgq(address, reg); 672 cmpxchgq(address, reg);
673 } 673 }
674 674
675 void cpuid(); 675 void cpuid();
676 676
677 // Issue memory to memory move through a TMP register. 677 // Issue memory to memory move through a TMP register.
678 // TODO(koda): Assert that these are not used for heap objects.
678 void MoveMemoryToMemory(const Address& dst, const Address& src) { 679 void MoveMemoryToMemory(const Address& dst, const Address& src) {
679 movq(TMP, src); 680 movq(TMP, src);
680 movq(dst, TMP); 681 movq(dst, TMP);
681 } 682 }
682 683
683 void Exchange(Register reg, const Address& mem) { 684 void Exchange(Register reg, const Address& mem) {
684 movq(TMP, mem); 685 movq(TMP, mem);
685 movq(mem, reg); 686 movq(mem, reg);
686 movq(reg, TMP); 687 movq(reg, TMP);
687 } 688 }
(...skipping 12 matching lines...) Expand all
700 void CompareRegisters(Register a, Register b); 701 void CompareRegisters(Register a, Register b);
701 702
702 // Issues a move instruction if 'to' is not the same as 'from'. 703 // Issues a move instruction if 'to' is not the same as 'from'.
703 void MoveRegister(Register to, Register from); 704 void MoveRegister(Register to, Register from);
704 void PopRegister(Register r); 705 void PopRegister(Register r);
705 706
706 // Macros accepting a pp Register argument may attempt to load values from 707 // Macros accepting a pp Register argument may attempt to load values from
707 // the object pool when possible. Unless you are sure that the untagged object 708 // the object pool when possible. Unless you are sure that the untagged object
708 // pool pointer is in another register, or that it is not available at all, 709 // pool pointer is in another register, or that it is not available at all,
709 // PP should be passed for pp. 710 // PP should be passed for pp.
711 // TODO(koda): Assert that these are not used for heap objects.
710 void AddImmediate(Register reg, const Immediate& imm, Register pp); 712 void AddImmediate(Register reg, const Immediate& imm, Register pp);
711 void AddImmediate(const Address& address, const Immediate& imm, Register pp); 713 void AddImmediate(const Address& address, const Immediate& imm, Register pp);
712 void SubImmediate(Register reg, const Immediate& imm, Register pp); 714 void SubImmediate(Register reg, const Immediate& imm, Register pp);
713 void SubImmediate(const Address& address, const Immediate& imm, Register pp); 715 void SubImmediate(const Address& address, const Immediate& imm, Register pp);
714 716
715 void Drop(intptr_t stack_elements); 717 void Drop(intptr_t stack_elements);
716 718
717 enum Patchability { 719 enum Patchability {
718 kPatchable, 720 kPatchable,
719 kNotPatchable, 721 kNotPatchable,
720 }; 722 };
721 723
722 bool allow_constant_pool() const { 724 bool allow_constant_pool() const {
723 return allow_constant_pool_; 725 return allow_constant_pool_;
724 } 726 }
725 void set_allow_constant_pool(bool b) { 727 void set_allow_constant_pool(bool b) {
726 allow_constant_pool_ = b; 728 allow_constant_pool_ = b;
727 } 729 }
728 730
729 bool CanLoadImmediateFromPool(const Immediate& imm, Register pp); 731 bool CanLoadImmediateFromPool(const Immediate& imm, Register pp);
730 void LoadImmediate(Register reg, const Immediate& imm, Register pp); 732 void LoadImmediate(Register reg, const Immediate& imm, Register pp);
731 void LoadImmediate(const Address& dst, const Immediate& imm, Register pp);
732 void LoadIsolate(Register dst); 733 void LoadIsolate(Register dst);
733 void LoadObject(Register dst, const Object& obj, Register pp); 734 void LoadObject(Register dst, const Object& obj, Register pp);
734 void JmpPatchable(const ExternalLabel* label, Register pp); 735 void JmpPatchable(const ExternalLabel* label, Register pp);
735 void Jmp(const ExternalLabel* label, Register pp); 736 void Jmp(const ExternalLabel* label, Register pp);
736 void J(Condition condition, const ExternalLabel* label, Register pp); 737 void J(Condition condition, const ExternalLabel* label, Register pp);
737 void CallPatchable(const ExternalLabel* label); 738 void CallPatchable(const ExternalLabel* label);
738 void Call(const ExternalLabel* label, Register pp); 739 void Call(const ExternalLabel* label, Register pp);
740 // Unaware of write barrier (use StoreInto* methods for storing to objects).
741 // TODO(koda): Add StackAddress/HeapAddress types to prevent misuse.
739 void StoreObject(const Address& dst, const Object& obj, Register pp); 742 void StoreObject(const Address& dst, const Object& obj, Register pp);
740 void PushObject(const Object& object, Register pp); 743 void PushObject(const Object& object, Register pp);
741 void CompareObject(Register reg, const Object& object, Register pp); 744 void CompareObject(Register reg, const Object& object, Register pp);
742 745
743 // Destroys value. 746 // Destroys value.
744 void StoreIntoObject(Register object, // Object we are storing into. 747 void StoreIntoObject(Register object, // Object we are storing into.
745 const Address& dest, // Where we are storing into. 748 const Address& dest, // Where we are storing into.
746 Register value, // Value we are storing. 749 Register value, // Value we are storing.
747 bool can_value_be_smi = true); 750 bool can_value_be_smi = true);
748 751
749 void StoreIntoObjectNoBarrier(Register object, 752 void StoreIntoObjectNoBarrier(Register object,
750 const Address& dest, 753 const Address& dest,
751 Register value); 754 Register value);
755 void StoreIntoObjectNoBarrier(Register object,
756 const Address& dest,
757 const Object& value,
758 Register pp);
752 759
753 // Stores a Smi value into a heap object field that always contains a Smi. 760 // Stores a Smi value into a heap object field that always contains a Smi.
754 void StoreIntoSmiField(const Address& dest, Register value); 761 void StoreIntoSmiField(const Address& dest, Register value);
755 void ZeroSmiField(const Address& dest); 762 void ZeroSmiField(const Address& dest);
756 // Increments a Smi field. Leaves flags in same state as an 'addq'. 763 // Increments a Smi field. Leaves flags in same state as an 'addq'.
757 void IncrementSmiField(const Address& dest, int64_t increment); 764 void IncrementSmiField(const Address& dest, int64_t increment);
758 765
759 void DoubleNegate(XmmRegister d); 766 void DoubleNegate(XmmRegister d);
760 void FloatNegate(XmmRegister f); 767 void FloatNegate(XmmRegister f);
761 768
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
1081 1088
1082 // Shorter filtering sequence that assumes that value is not a smi. 1089 // Shorter filtering sequence that assumes that value is not a smi.
1083 void StoreIntoObjectFilterNoSmi(Register object, 1090 void StoreIntoObjectFilterNoSmi(Register object,
1084 Register value, 1091 Register value,
1085 Label* no_update); 1092 Label* no_update);
1086 1093
1087 // Analogous to VerifiedMemory::Verify(address, kWordSize). 1094 // Analogous to VerifiedMemory::Verify(address, kWordSize).
1088 void VerifyHeapWord(const Address& address); 1095 void VerifyHeapWord(const Address& address);
1089 // Analogous to VerifiedMemory::Write. 1096 // Analogous to VerifiedMemory::Write.
1090 void VerifiedWrite(const Address& dest, Register value); 1097 void VerifiedWrite(const Address& dest, Register value);
1098 // Unaware of write barrier (use StoreInto* methods for storing to objects).
1099 void MoveImmediate(const Address& dst, const Immediate& imm, Register pp);
1091 1100
1092 void ComputeCounterAddressesForCid(intptr_t cid, 1101 void ComputeCounterAddressesForCid(intptr_t cid,
1093 Heap::Space space, 1102 Heap::Space space,
1094 Address* count_address, 1103 Address* count_address,
1095 Address* size_address); 1104 Address* size_address);
1096 DISALLOW_ALLOCATION(); 1105 DISALLOW_ALLOCATION();
1097 DISALLOW_COPY_AND_ASSIGN(Assembler); 1106 DISALLOW_COPY_AND_ASSIGN(Assembler);
1098 }; 1107 };
1099 1108
1100 1109
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
1169 } 1178 }
1170 1179
1171 1180
1172 inline void Assembler::EmitOperandSizeOverride() { 1181 inline void Assembler::EmitOperandSizeOverride() {
1173 EmitUint8(0x66); 1182 EmitUint8(0x66);
1174 } 1183 }
1175 1184
1176 } // namespace dart 1185 } // namespace dart
1177 1186
1178 #endif // VM_ASSEMBLER_X64_H_ 1187 #endif // VM_ASSEMBLER_X64_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/assembler_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698