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

Unified Diff: src/assembler.cc

Issue 2072963003: Simplify AssemblerPositionsRecorder. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: addressed comment Created 4 years, 6 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/assembler.h ('k') | src/compiler/code-generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/assembler.cc
diff --git a/src/assembler.cc b/src/assembler.cc
index b72e3f877a2119ab6cd4631572eb63ee5c3d91b6..b93149407e8709b0666e2baa833c44f860439ff0 100644
--- a/src/assembler.cc
+++ b/src/assembler.cc
@@ -1826,25 +1826,27 @@ std::ostream& operator<<(std::ostream& os, ExternalReference reference) {
return os;
}
-void AssemblerPositionsRecorder::RecordPosition(int pos) {
+bool AssemblerPositionsRecorder::RecordPosition(int pos) {
DCHECK(pos != RelocInfo::kNoPosition);
DCHECK(pos >= 0);
- state_.current_position = pos;
+ current_position_ = pos;
LOG_CODE_EVENT(assembler_->isolate(),
CodeLinePosInfoAddPositionEvent(jit_handler_data_,
assembler_->pc_offset(),
pos));
+ return WriteRecordedPositions();
}
-void AssemblerPositionsRecorder::RecordStatementPosition(int pos) {
+bool AssemblerPositionsRecorder::RecordStatementPosition(int pos) {
DCHECK(pos != RelocInfo::kNoPosition);
DCHECK(pos >= 0);
- state_.current_statement_position = pos;
+ current_statement_position_ = pos;
LOG_CODE_EVENT(assembler_->isolate(),
CodeLinePosInfoAddStatementPositionEvent(
jit_handler_data_,
assembler_->pc_offset(),
pos));
+ return RecordPosition(pos);
}
bool AssemblerPositionsRecorder::WriteRecordedPositions() {
@@ -1852,21 +1854,21 @@ bool AssemblerPositionsRecorder::WriteRecordedPositions() {
// Write the statement position if it is different from what was written last
// time.
- if (state_.current_statement_position != state_.written_statement_position) {
+ if (current_statement_position_ != written_statement_position_) {
EnsureSpace ensure_space(assembler_);
assembler_->RecordRelocInfo(RelocInfo::STATEMENT_POSITION,
- state_.current_statement_position);
- state_.written_position = state_.current_statement_position;
- state_.written_statement_position = state_.current_statement_position;
+ current_statement_position_);
+ written_position_ = current_statement_position_;
+ written_statement_position_ = current_statement_position_;
written = true;
}
// Write the position if it is different from what was written last time and
// also different from the statement position that was just written.
- if (state_.current_position != state_.written_position) {
+ if (current_position_ != written_position_) {
EnsureSpace ensure_space(assembler_);
- assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position);
- state_.written_position = state_.current_position;
+ assembler_->RecordRelocInfo(RelocInfo::POSITION, current_position_);
+ written_position_ = current_position_;
written = true;
}
« no previous file with comments | « src/assembler.h ('k') | src/compiler/code-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698