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

Side by Side Diff: src/assembler.cc

Issue 4469002: Improve positions recording for calls. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 10 years, 1 month 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 | Annotate | Revision Log
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 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 ExternalReference ExternalReference::debug_break() { 797 ExternalReference ExternalReference::debug_break() {
798 return ExternalReference(Redirect(FUNCTION_ADDR(Debug::Break))); 798 return ExternalReference(Redirect(FUNCTION_ADDR(Debug::Break)));
799 } 799 }
800 800
801 801
802 ExternalReference ExternalReference::debug_step_in_fp_address() { 802 ExternalReference ExternalReference::debug_step_in_fp_address() {
803 return ExternalReference(Debug::step_in_fp_addr()); 803 return ExternalReference(Debug::step_in_fp_addr());
804 } 804 }
805 #endif 805 #endif
806 806
807
808 void PositionsRecorder::RecordPosition(int pos,
809 PositionRecordingType recording_type) {
810 ASSERT(pos != RelocInfo::kNoPosition);
811 ASSERT(pos >= 0);
812 current_position_ = pos;
813 current_position_recording_type_ = recording_type;
814 }
815
816
817 void PositionsRecorder::RecordStatementPosition(int pos) {
818 ASSERT(pos != RelocInfo::kNoPosition);
819 ASSERT(pos >= 0);
820 current_statement_position_ = pos;
821 }
822
823
824 bool PositionsRecorder::WriteRecordedPositions() {
825 bool written = false;
826
827 // Write the statement position if it is different from what was written last
828 // time.
829 if (current_statement_position_ != written_statement_position_) {
830 EnsureSpace ensure_space(assembler_);
831 assembler_->RecordRelocInfo(RelocInfo::STATEMENT_POSITION,
832 current_statement_position_);
833 written_statement_position_ = current_statement_position_;
834 written = true;
835 }
836
837 // Write the position if it is different from what was written last time and
838 // also different from the written statement position or was forced.
839 if (current_position_ != written_position_ &&
840 (current_position_ != current_statement_position_ || !written) &&
841 (current_position_ != written_statement_position_
842 || current_position_recording_type_ == FORCED_POSITION)) {
843 EnsureSpace ensure_space(assembler_);
844 assembler_->RecordRelocInfo(RelocInfo::POSITION, current_position_);
845 written_position_ = current_position_;
846 written = true;
847 }
848
849 current_position_recording_type_ = NORMAL_POSITION;
850
851 // Return whether something was written.
852 return written;
853 }
854
855
807 } } // namespace v8::internal 856 } } // namespace v8::internal
OLDNEW
« src/assembler.h ('K') | « src/assembler.h ('k') | src/codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698