OLD | NEW |
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
2 // All Rights Reserved. | 2 // All Rights Reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
10 // | 10 // |
(...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
954 // an instruction or relocation information. | 954 // an instruction or relocation information. |
955 inline bool buffer_overflow() const { | 955 inline bool buffer_overflow() const { |
956 return pc_ >= reloc_info_writer.pos() - kGap; | 956 return pc_ >= reloc_info_writer.pos() - kGap; |
957 } | 957 } |
958 | 958 |
959 // Get the number of bytes available in the buffer. | 959 // Get the number of bytes available in the buffer. |
960 inline int available_space() const { return reloc_info_writer.pos() - pc_; } | 960 inline int available_space() const { return reloc_info_writer.pos() - pc_; } |
961 | 961 |
962 static bool IsNop(Address addr); | 962 static bool IsNop(Address addr); |
963 | 963 |
964 PositionsRecorder* positions_recorder() { return &positions_recorder_; } | 964 AssemblerPositionsRecorder* positions_recorder() { |
| 965 return &positions_recorder_; |
| 966 } |
965 | 967 |
966 int relocation_writer_size() { | 968 int relocation_writer_size() { |
967 return (buffer_ + buffer_size_) - reloc_info_writer.pos(); | 969 return (buffer_ + buffer_size_) - reloc_info_writer.pos(); |
968 } | 970 } |
969 | 971 |
970 // Avoid overflows for displacements etc. | 972 // Avoid overflows for displacements etc. |
971 static const int kMaximalBufferSize = 512*MB; | 973 static const int kMaximalBufferSize = 512*MB; |
972 | 974 |
973 byte byte_at(int pos) { return buffer_[pos]; } | 975 byte byte_at(int pos) { return buffer_[pos]; } |
974 void set_byte_at(int pos, byte value) { buffer_[pos] = value; } | 976 void set_byte_at(int pos, byte value) { buffer_[pos] = value; } |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1041 friend class EnsureSpace; | 1043 friend class EnsureSpace; |
1042 | 1044 |
1043 // Internal reference positions, required for (potential) patching in | 1045 // Internal reference positions, required for (potential) patching in |
1044 // GrowBuffer(); contains only those internal references whose labels | 1046 // GrowBuffer(); contains only those internal references whose labels |
1045 // are already bound. | 1047 // are already bound. |
1046 std::deque<int> internal_reference_positions_; | 1048 std::deque<int> internal_reference_positions_; |
1047 | 1049 |
1048 // code generation | 1050 // code generation |
1049 RelocInfoWriter reloc_info_writer; | 1051 RelocInfoWriter reloc_info_writer; |
1050 | 1052 |
1051 PositionsRecorder positions_recorder_; | 1053 AssemblerPositionsRecorder positions_recorder_; |
1052 friend class PositionsRecorder; | 1054 friend class AssemblerPositionsRecorder; |
1053 }; | 1055 }; |
1054 | 1056 |
1055 | 1057 |
1056 // Helper class that ensures that there is enough space for generating | 1058 // Helper class that ensures that there is enough space for generating |
1057 // instructions and relocation information. The constructor makes | 1059 // instructions and relocation information. The constructor makes |
1058 // sure that there is enough space and (in debug mode) the destructor | 1060 // sure that there is enough space and (in debug mode) the destructor |
1059 // checks that we did not generate too much. | 1061 // checks that we did not generate too much. |
1060 class EnsureSpace BASE_EMBEDDED { | 1062 class EnsureSpace BASE_EMBEDDED { |
1061 public: | 1063 public: |
1062 explicit EnsureSpace(Assembler* assembler) : assembler_(assembler) { | 1064 explicit EnsureSpace(Assembler* assembler) : assembler_(assembler) { |
(...skipping 14 matching lines...) Expand all Loading... |
1077 Assembler* assembler_; | 1079 Assembler* assembler_; |
1078 #ifdef DEBUG | 1080 #ifdef DEBUG |
1079 int space_before_; | 1081 int space_before_; |
1080 #endif | 1082 #endif |
1081 }; | 1083 }; |
1082 | 1084 |
1083 } // namespace internal | 1085 } // namespace internal |
1084 } // namespace v8 | 1086 } // namespace v8 |
1085 | 1087 |
1086 #endif // V8_X87_ASSEMBLER_X87_H_ | 1088 #endif // V8_X87_ASSEMBLER_X87_H_ |
OLD | NEW |