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

Unified Diff: src/assembler.h

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/arm64/macro-assembler-arm64.cc ('k') | src/assembler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/assembler.h
diff --git a/src/assembler.h b/src/assembler.h
index 6c7c65efe0efd2ec4e821923e538cae0d07aa3b1..2ae221e355fba5ecedb2b472fb116930819deab5 100644
--- a/src/assembler.h
+++ b/src/assembler.h
@@ -1142,42 +1142,32 @@ std::ostream& operator<<(std::ostream&, ExternalReference);
// -----------------------------------------------------------------------------
// Position recording support
-struct PositionState {
- PositionState() : current_position(RelocInfo::kNoPosition),
- written_position(RelocInfo::kNoPosition),
- current_statement_position(RelocInfo::kNoPosition),
- written_statement_position(RelocInfo::kNoPosition) {}
-
- int current_position;
- int written_position;
-
- int current_statement_position;
- int written_statement_position;
-};
-
class AssemblerPositionsRecorder : public PositionsRecorder {
public:
explicit AssemblerPositionsRecorder(Assembler* assembler)
- : assembler_(assembler) {}
+ : assembler_(assembler),
+ current_position_(RelocInfo::kNoPosition),
+ written_position_(RelocInfo::kNoPosition),
+ current_statement_position_(RelocInfo::kNoPosition),
+ written_statement_position_(RelocInfo::kNoPosition) {}
// Set current position to pos.
- void RecordPosition(int pos);
+ bool RecordPosition(int pos);
// Set current statement position to pos.
- void RecordStatementPosition(int pos);
+ bool RecordStatementPosition(int pos);
+ private:
// Write recorded positions to relocation information.
bool WriteRecordedPositions();
- int current_position() const { return state_.current_position; }
+ Assembler* assembler_;
- int current_statement_position() const {
- return state_.current_statement_position;
- }
+ int current_position_;
+ int written_position_;
- private:
- Assembler* assembler_;
- PositionState state_;
+ int current_statement_position_;
+ int written_statement_position_;
DISALLOW_COPY_AND_ASSIGN(AssemblerPositionsRecorder);
};
« no previous file with comments | « src/arm64/macro-assembler-arm64.cc ('k') | src/assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698