OLD | NEW |
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_IA32_H_ | 5 #ifndef VM_ASSEMBLER_IA32_H_ |
6 #define VM_ASSEMBLER_IA32_H_ | 6 #define VM_ASSEMBLER_IA32_H_ |
7 | 7 |
8 #ifndef VM_ASSEMBLER_H_ | 8 #ifndef VM_ASSEMBLER_H_ |
9 #error Do not include assembler_ia32.h directly; use assembler.h instead. | 9 #error Do not include assembler_ia32.h directly; use assembler.h instead. |
10 #endif | 10 #endif |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 void cmpl(Register reg, const Immediate& imm); | 529 void cmpl(Register reg, const Immediate& imm); |
530 void cmpl(Register reg0, Register reg1); | 530 void cmpl(Register reg0, Register reg1); |
531 void cmpl(Register reg, const Address& address); | 531 void cmpl(Register reg, const Address& address); |
532 | 532 |
533 void cmpl(const Address& address, Register reg); | 533 void cmpl(const Address& address, Register reg); |
534 void cmpl(const Address& address, const Immediate& imm); | 534 void cmpl(const Address& address, const Immediate& imm); |
535 void cmpb(const Address& address, const Immediate& imm); | 535 void cmpb(const Address& address, const Immediate& imm); |
536 | 536 |
537 void testl(Register reg1, Register reg2); | 537 void testl(Register reg1, Register reg2); |
538 void testl(Register reg, const Immediate& imm); | 538 void testl(Register reg, const Immediate& imm); |
| 539 void testb(const Address& address, const Immediate& imm); |
539 | 540 |
540 void andl(Register dst, const Immediate& imm); | 541 void andl(Register dst, const Immediate& imm); |
541 void andl(Register dst, Register src); | 542 void andl(Register dst, Register src); |
542 void andl(Register dst, const Address& address); | 543 void andl(Register dst, const Address& address); |
543 | 544 |
544 void orl(Register dst, const Immediate& imm); | 545 void orl(Register dst, const Immediate& imm); |
545 void orl(Register dst, Register src); | 546 void orl(Register dst, Register src); |
546 void orl(Register dst, const Address& address); | 547 void orl(Register dst, const Address& address); |
547 void orl(const Address& address, Register dst); | 548 void orl(const Address& address, Register dst); |
548 | 549 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 void LoadObject(Register dst, const Object& object); | 662 void LoadObject(Register dst, const Object& object); |
662 | 663 |
663 // If 'object' is a large Smi, xor it with a per-assembler cookie value to | 664 // If 'object' is a large Smi, xor it with a per-assembler cookie value to |
664 // prevent user-controlled immediates from appearing in the code stream. | 665 // prevent user-controlled immediates from appearing in the code stream. |
665 void LoadObjectSafely(Register dst, const Object& object); | 666 void LoadObjectSafely(Register dst, const Object& object); |
666 | 667 |
667 void PushObject(const Object& object); | 668 void PushObject(const Object& object); |
668 void CompareObject(Register reg, const Object& object); | 669 void CompareObject(Register reg, const Object& object); |
669 void LoadDoubleConstant(XmmRegister dst, double value); | 670 void LoadDoubleConstant(XmmRegister dst, double value); |
670 | 671 |
| 672 // When storing into a heap object field, knowledge of the previous content |
| 673 // is expressed through these constants. |
| 674 enum FieldContent { |
| 675 kEmptyOrSmiOrNull, // Empty = garbage/zapped in release/debug mode. |
| 676 kHeapObjectOrSmi, |
| 677 kOnlySmi, |
| 678 }; |
| 679 |
671 void StoreIntoObject(Register object, // Object we are storing into. | 680 void StoreIntoObject(Register object, // Object we are storing into. |
672 const Address& dest, // Where we are storing into. | 681 const Address& dest, // Where we are storing into. |
673 Register value, // Value we are storing. | 682 Register value, // Value we are storing. |
674 bool can_value_be_smi = true); | 683 bool can_value_be_smi = true); |
675 | 684 |
676 void StoreIntoObjectNoBarrier(Register object, | 685 void StoreIntoObjectNoBarrier(Register object, |
677 const Address& dest, | 686 const Address& dest, |
678 Register value); | 687 Register value, |
| 688 FieldContent old_content = kHeapObjectOrSmi); |
| 689 void InitializeFieldNoBarrier(Register object, |
| 690 const Address& dest, |
| 691 Register value) { |
| 692 return StoreIntoObjectNoBarrier(object, dest, value, kEmptyOrSmiOrNull); |
| 693 } |
679 void StoreIntoObjectNoBarrier(Register object, | 694 void StoreIntoObjectNoBarrier(Register object, |
680 const Address& dest, | 695 const Address& dest, |
681 const Object& value); | 696 const Object& value, |
| 697 FieldContent old_content = kHeapObjectOrSmi); |
| 698 void InitializeFieldNoBarrier(Register object, |
| 699 const Address& dest, |
| 700 const Object& value) { |
| 701 return StoreIntoObjectNoBarrier(object, dest, value, kEmptyOrSmiOrNull); |
| 702 } |
682 | 703 |
683 // Stores a Smi value into a heap object field that always contains a Smi. | 704 // Stores a Smi value into a heap object field that always contains a Smi. |
684 void StoreIntoSmiField(const Address& dest, Register value); | 705 void StoreIntoSmiField(const Address& dest, Register value); |
685 void ZeroSmiField(const Address& dest); | 706 void ZeroInitSmiField(const Address& dest); |
686 // Increments a Smi field. Leaves flags in same state as an 'addl'. | 707 // Increments a Smi field. Leaves flags in same state as an 'addl'. |
687 void IncrementSmiField(const Address& dest, int32_t increment); | 708 void IncrementSmiField(const Address& dest, int32_t increment); |
688 | 709 |
689 void DoubleNegate(XmmRegister d); | 710 void DoubleNegate(XmmRegister d); |
690 void FloatNegate(XmmRegister f); | 711 void FloatNegate(XmmRegister f); |
691 | 712 |
692 void DoubleAbs(XmmRegister reg); | 713 void DoubleAbs(XmmRegister reg); |
693 | 714 |
694 void LockCmpxchgl(const Address& address, Register reg) { | 715 void LockCmpxchgl(const Address& address, Register reg) { |
695 lock(); | 716 lock(); |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
938 | 959 |
939 void EmitGenericShift(int rm, Register reg, const Immediate& imm); | 960 void EmitGenericShift(int rm, Register reg, const Immediate& imm); |
940 void EmitGenericShift(int rm, const Operand& operand, Register shifter); | 961 void EmitGenericShift(int rm, const Operand& operand, Register shifter); |
941 | 962 |
942 void StoreIntoObjectFilter(Register object, Register value, Label* no_update); | 963 void StoreIntoObjectFilter(Register object, Register value, Label* no_update); |
943 | 964 |
944 // Shorter filtering sequence that assumes that value is not a smi. | 965 // Shorter filtering sequence that assumes that value is not a smi. |
945 void StoreIntoObjectFilterNoSmi(Register object, | 966 void StoreIntoObjectFilterNoSmi(Register object, |
946 Register value, | 967 Register value, |
947 Label* no_update); | 968 Label* no_update); |
948 | 969 #if defined(DEBUG) |
949 // Analogous to VerifiedMemory::Verify(address, kWordSize). | 970 void VerifyUninitialized(const Address& address); |
950 void VerifyHeapWord(const Address& address); | 971 void VerifyObjectOrSmi(const Address& address); |
951 // Analogous to VerifiedMemory::Write. | 972 void VerifySmi(const Address& address, const char* stop_msg = "Expected Smi"); |
952 void VerifiedWrite(const Address& dest, Register value); | 973 #endif // DEBUG |
| 974 // Like VerifiedMemory::Verify(address, kWordSize) and ::Write, but also, |
| 975 // in DEBUG mode, verifies that 'address' has content of type 'old_content'. |
| 976 void VerifyHeapWord(const Address& address, FieldContent old_content); |
| 977 void VerifiedWrite(const Address& dest, |
| 978 Register value, |
| 979 FieldContent old_content); |
953 void UnverifiedStoreOldObject(const Address& dest, const Object& value); | 980 void UnverifiedStoreOldObject(const Address& dest, const Object& value); |
954 | 981 |
955 int32_t jit_cookie(); | 982 int32_t jit_cookie(); |
956 | 983 |
957 AssemblerBuffer buffer_; | 984 AssemblerBuffer buffer_; |
958 GrowableObjectArray& object_pool_; // Object pool is not used on ia32. | 985 GrowableObjectArray& object_pool_; // Object pool is not used on ia32. |
959 intptr_t prologue_offset_; | 986 intptr_t prologue_offset_; |
960 int32_t jit_cookie_; | 987 int32_t jit_cookie_; |
961 GrowableArray<CodeComment*> comments_; | 988 GrowableArray<CodeComment*> comments_; |
962 | 989 |
(...skipping 28 matching lines...) Expand all Loading... |
991 } | 1018 } |
992 | 1019 |
993 | 1020 |
994 inline void Assembler::EmitOperandSizeOverride() { | 1021 inline void Assembler::EmitOperandSizeOverride() { |
995 EmitUint8(0x66); | 1022 EmitUint8(0x66); |
996 } | 1023 } |
997 | 1024 |
998 } // namespace dart | 1025 } // namespace dart |
999 | 1026 |
1000 #endif // VM_ASSEMBLER_IA32_H_ | 1027 #endif // VM_ASSEMBLER_IA32_H_ |
OLD | NEW |