Commit 1e6d4f16 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[assembler] [cleanup] Cleanup RelocInfoWriter

Remove an unused constructor and an unused field, and compute a more
tight {kMaxSize}.
Beside being a cleanup, this might sometimes allow us to allocate a
little bit less memory on 32 bit systems.

R=mstarzinger@chromium.org

Change-Id: Ibf8fef231325f1b9047e2c7f4c66430797729fc1
Reviewed-on: https://chromium-review.googlesource.com/873534Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50696}
parent 478bfc91
...@@ -449,7 +449,6 @@ void RelocInfoWriter::Write(const RelocInfo* rinfo) { ...@@ -449,7 +449,6 @@ void RelocInfoWriter::Write(const RelocInfo* rinfo) {
} }
} }
last_pc_ = rinfo->pc(); last_pc_ = rinfo->pc();
last_mode_ = rmode;
#ifdef DEBUG #ifdef DEBUG
DCHECK_LE(begin_pos - pos_, kMaxSize); DCHECK_LE(begin_pos - pos_, kMaxSize);
#endif #endif
......
...@@ -635,7 +635,6 @@ class RelocInfo { ...@@ -635,7 +635,6 @@ class RelocInfo {
class RelocInfoWriter BASE_EMBEDDED { class RelocInfoWriter BASE_EMBEDDED {
public: public:
RelocInfoWriter() : pos_(nullptr), last_pc_(nullptr) {} RelocInfoWriter() : pos_(nullptr), last_pc_(nullptr) {}
RelocInfoWriter(byte* pos, byte* pc) : pos_(pos), last_pc_(pc) {}
byte* pos() const { return pos_; } byte* pos() const { return pos_; }
byte* last_pc() const { return last_pc_; } byte* last_pc() const { return last_pc_; }
...@@ -651,10 +650,7 @@ class RelocInfoWriter BASE_EMBEDDED { ...@@ -651,10 +650,7 @@ class RelocInfoWriter BASE_EMBEDDED {
// Max size (bytes) of a written RelocInfo. Longest encoding is // Max size (bytes) of a written RelocInfo. Longest encoding is
// ExtraTag, VariableLengthPCJump, ExtraTag, pc_delta, data_delta. // ExtraTag, VariableLengthPCJump, ExtraTag, pc_delta, data_delta.
// On ia32 and arm this is 1 + 4 + 1 + 1 + 4 = 11. static constexpr int kMaxSize = 1 + 4 + 1 + 1 + kPointerSize;
// On x64 this is 1 + 4 + 1 + 1 + 8 == 15;
// Here we use the maximum of the two.
static const int kMaxSize = 15;
private: private:
inline uint32_t WriteLongPCJump(uint32_t pc_delta); inline uint32_t WriteLongPCJump(uint32_t pc_delta);
...@@ -669,7 +665,6 @@ class RelocInfoWriter BASE_EMBEDDED { ...@@ -669,7 +665,6 @@ class RelocInfoWriter BASE_EMBEDDED {
byte* pos_; byte* pos_;
byte* last_pc_; byte* last_pc_;
RelocInfo::Mode last_mode_;
DISALLOW_COPY_AND_ASSIGN(RelocInfoWriter); DISALLOW_COPY_AND_ASSIGN(RelocInfoWriter);
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment