| 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 : assembler_(assembler), | 166 : assembler_(assembler), |
| 167 expected_size_(expected_size), | 167 expected_size_(expected_size), |
| 168 start_offset_(assembler->pc_offset()), | 168 start_offset_(assembler->pc_offset()), |
| 169 old_value_(assembler->predictable_code_size()) { | 169 old_value_(assembler->predictable_code_size()) { |
| 170 assembler_->set_predictable_code_size(true); | 170 assembler_->set_predictable_code_size(true); |
| 171 } | 171 } |
| 172 | 172 |
| 173 | 173 |
| 174 PredictableCodeSizeScope::~PredictableCodeSizeScope() { | 174 PredictableCodeSizeScope::~PredictableCodeSizeScope() { |
| 175 // TODO(svenpanne) Remove the 'if' when everything works. | 175 // TODO(svenpanne) Remove the 'if' when everything works. |
| 176 if (expected_size_ >= 0) { | |
| 177 CHECK_EQ(expected_size_, assembler_->pc_offset() - start_offset_); | |
| 178 } | |
| 179 assembler_->set_predictable_code_size(old_value_); | 176 assembler_->set_predictable_code_size(old_value_); |
| 180 } | 177 } |
| 181 | 178 |
| 182 | 179 |
| 183 // ----------------------------------------------------------------------------- | 180 // ----------------------------------------------------------------------------- |
| 184 // Implementation of CpuFeatureScope | 181 // Implementation of CpuFeatureScope |
| 185 | 182 |
| 186 #ifdef DEBUG | 183 #ifdef DEBUG |
| 187 CpuFeatureScope::CpuFeatureScope(AssemblerBase* assembler, CpuFeature f) | 184 CpuFeatureScope::CpuFeatureScope(AssemblerBase* assembler, CpuFeature f) |
| 188 : assembler_(assembler) { | 185 : assembler_(assembler) { |
| (...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 rinfo_.pc_ = code->entry(); | 679 rinfo_.pc_ = code->entry(); |
| 683 rinfo_.data_ = 0; | 680 rinfo_.data_ = 0; |
| 684 // Relocation info is read backwards. | 681 // Relocation info is read backwards. |
| 685 pos_ = code->relocation_start() + code->relocation_size(); | 682 pos_ = code->relocation_start() + code->relocation_size(); |
| 686 end_ = code->relocation_start(); | 683 end_ = code->relocation_start(); |
| 687 done_ = false; | 684 done_ = false; |
| 688 mode_mask_ = mode_mask; | 685 mode_mask_ = mode_mask; |
| 689 last_id_ = 0; | 686 last_id_ = 0; |
| 690 last_position_ = 0; | 687 last_position_ = 0; |
| 691 byte* sequence = code->FindCodeAgeSequence(); | 688 byte* sequence = code->FindCodeAgeSequence(); |
| 692 if (sequence != NULL && !Code::IsYoungSequence(sequence)) { | 689 if (sequence != NULL && |
| 690 !Code::IsYoungSequence(sequence, code->is_thumb_mode())) { |
| 693 code_age_sequence_ = sequence; | 691 code_age_sequence_ = sequence; |
| 694 } else { | 692 } else { |
| 695 code_age_sequence_ = NULL; | 693 code_age_sequence_ = NULL; |
| 696 } | 694 } |
| 697 if (mode_mask_ == 0) pos_ = end_; | 695 if (mode_mask_ == 0) pos_ = end_; |
| 698 next(); | 696 next(); |
| 699 } | 697 } |
| 700 | 698 |
| 701 | 699 |
| 702 RelocIterator::RelocIterator(const CodeDesc& desc, int mode_mask) { | 700 RelocIterator::RelocIterator(const CodeDesc& desc, int mode_mask) { |
| (...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1677 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position); | 1675 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position); |
| 1678 state_.written_position = state_.current_position; | 1676 state_.written_position = state_.current_position; |
| 1679 written = true; | 1677 written = true; |
| 1680 } | 1678 } |
| 1681 | 1679 |
| 1682 // Return whether something was written. | 1680 // Return whether something was written. |
| 1683 return written; | 1681 return written; |
| 1684 } | 1682 } |
| 1685 | 1683 |
| 1686 } } // namespace v8::internal | 1684 } } // namespace v8::internal |
| OLD | NEW |