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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 // Signed right shift is arithmetic shift. Tested in test-utils.cc. | 210 // Signed right shift is arithmetic shift. Tested in test-utils.cc. |
211 data_delta = data_delta >> kBitsPerByte; | 211 data_delta = data_delta >> kBitsPerByte; |
212 } | 212 } |
213 } | 213 } |
214 | 214 |
215 | 215 |
216 void RelocInfoWriter::Write(const RelocInfo* rinfo) { | 216 void RelocInfoWriter::Write(const RelocInfo* rinfo) { |
217 #ifdef DEBUG | 217 #ifdef DEBUG |
218 byte* begin_pos = pos_; | 218 byte* begin_pos = pos_; |
219 #endif | 219 #endif |
220 COUNTERS->reloc_info_count()->Increment(); | |
221 ASSERT(rinfo->pc() - last_pc_ >= 0); | 220 ASSERT(rinfo->pc() - last_pc_ >= 0); |
222 ASSERT(RelocInfo::NUMBER_OF_MODES <= kMaxRelocModes); | 221 ASSERT(RelocInfo::NUMBER_OF_MODES <= kMaxRelocModes); |
223 // Use unsigned delta-encoding for pc. | 222 // Use unsigned delta-encoding for pc. |
224 uint32_t pc_delta = static_cast<uint32_t>(rinfo->pc() - last_pc_); | 223 uint32_t pc_delta = static_cast<uint32_t>(rinfo->pc() - last_pc_); |
225 RelocInfo::Mode rmode = rinfo->rmode(); | 224 RelocInfo::Mode rmode = rinfo->rmode(); |
226 | 225 |
227 // The two most common modes are given small tags, and usually fit in a byte. | 226 // The two most common modes are given small tags, and usually fit in a byte. |
228 if (rmode == RelocInfo::EMBEDDED_OBJECT) { | 227 if (rmode == RelocInfo::EMBEDDED_OBJECT) { |
229 WriteTaggedPC(pc_delta, kEmbeddedObjectTag); | 228 WriteTaggedPC(pc_delta, kEmbeddedObjectTag); |
230 } else if (rmode == RelocInfo::CODE_TARGET) { | 229 } else if (rmode == RelocInfo::CODE_TARGET) { |
(...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1054 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position); | 1053 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position); |
1055 state_.written_position = state_.current_position; | 1054 state_.written_position = state_.current_position; |
1056 written = true; | 1055 written = true; |
1057 } | 1056 } |
1058 | 1057 |
1059 // Return whether something was written. | 1058 // Return whether something was written. |
1060 return written; | 1059 return written; |
1061 } | 1060 } |
1062 | 1061 |
1063 } } // namespace v8::internal | 1062 } } // namespace v8::internal |
OLD | NEW |