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

Side by Side Diff: src/assembler.cc

Issue 5277008: Save full source position state to avoid forced positions. (Closed)
Patch Set: Created 10 years 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
« no previous file with comments | « src/assembler.h ('k') | src/full-codegen.h » ('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) 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 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 return ExternalReference(Redirect(FUNCTION_ADDR(Debug::Break))); 794 return ExternalReference(Redirect(FUNCTION_ADDR(Debug::Break)));
795 } 795 }
796 796
797 797
798 ExternalReference ExternalReference::debug_step_in_fp_address() { 798 ExternalReference ExternalReference::debug_step_in_fp_address() {
799 return ExternalReference(Debug::step_in_fp_addr()); 799 return ExternalReference(Debug::step_in_fp_addr());
800 } 800 }
801 #endif 801 #endif
802 802
803 803
804 void PositionsRecorder::RecordPosition(int pos, 804 void PositionsRecorder::RecordPosition(int pos) {
805 PositionRecordingType recording_type) {
806 ASSERT(pos != RelocInfo::kNoPosition); 805 ASSERT(pos != RelocInfo::kNoPosition);
807 ASSERT(pos >= 0); 806 ASSERT(pos >= 0);
808 current_position_ = pos; 807 state_.current_position = pos;
809 current_position_recording_type_ = recording_type;
810 } 808 }
811 809
812 810
813 void PositionsRecorder::RecordStatementPosition(int pos) { 811 void PositionsRecorder::RecordStatementPosition(int pos) {
814 ASSERT(pos != RelocInfo::kNoPosition); 812 ASSERT(pos != RelocInfo::kNoPosition);
815 ASSERT(pos >= 0); 813 ASSERT(pos >= 0);
816 current_statement_position_ = pos; 814 state_.current_statement_position = pos;
817 } 815 }
818 816
819 817
820 bool PositionsRecorder::WriteRecordedPositions() { 818 bool PositionsRecorder::WriteRecordedPositions() {
821 bool written = false; 819 bool written = false;
822 820
823 // Write the statement position if it is different from what was written last 821 // Write the statement position if it is different from what was written last
824 // time. 822 // time.
825 if (current_statement_position_ != written_statement_position_) { 823 if (state_.current_statement_position != state_.written_statement_position) {
826 EnsureSpace ensure_space(assembler_); 824 EnsureSpace ensure_space(assembler_);
827 assembler_->RecordRelocInfo(RelocInfo::STATEMENT_POSITION, 825 assembler_->RecordRelocInfo(RelocInfo::STATEMENT_POSITION,
828 current_statement_position_); 826 state_.current_statement_position);
829 written_statement_position_ = current_statement_position_; 827 state_.written_statement_position = state_.current_statement_position;
830 written = true; 828 written = true;
831 } 829 }
832 830
833 // Write the position if it is different from what was written last time and 831 // Write the position if it is different from what was written last time and
834 // also different from the written statement position or was forced. 832 // also different from the written statement position.
835 if (current_position_ != written_position_ && 833 if (state_.current_position != state_.written_position &&
836 (current_position_ != current_statement_position_ || !written) && 834 state_.current_position != state_.written_statement_position) {
837 (current_position_ != written_statement_position_
838 || current_position_recording_type_ == FORCED_POSITION)) {
839 EnsureSpace ensure_space(assembler_); 835 EnsureSpace ensure_space(assembler_);
840 assembler_->RecordRelocInfo(RelocInfo::POSITION, current_position_); 836 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position);
841 written_position_ = current_position_; 837 state_.written_position = state_.current_position;
842 written = true; 838 written = true;
843 } 839 }
844 840
845 current_position_recording_type_ = NORMAL_POSITION;
846
847 // Return whether something was written. 841 // Return whether something was written.
848 return written; 842 return written;
849 } 843 }
850 844
851
852 } } // namespace v8::internal 845 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/assembler.h ('k') | src/full-codegen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698