Commit 2f696693 authored by Sigurd Schneider's avatar Sigurd Schneider Committed by Commit Bot

[cleanup] Clean up uses of IsShareableRelocMode

uses of the function where that was assumed to not be the case.

RelocInfo: :NONE satisfies IsShareableRelocMode; this cleans up some
Change-Id: Iafd7262496edc389131966f07f4e5b4fa8b5c1e6
Reviewed-on: https://chromium-review.googlesource.com/1158574Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54845}
parent a0541033
......@@ -347,7 +347,7 @@ bool ConstPool::RecordEntry(intptr_t data, RelocInfo::Mode mode) {
first_use_ = offset;
}
if (CanBeShared(mode)) {
if (RelocInfo::IsShareableRelocMode(mode)) {
write_reloc_info = AddSharedEntry(shared_entries_, raw_data, offset);
} else if (mode == RelocInfo::CODE_TARGET && raw_data != 0) {
// A zero data value is a placeholder and must not be shared.
......@@ -476,11 +476,6 @@ void ConstPool::Clear() {
}
bool ConstPool::CanBeShared(RelocInfo::Mode mode) {
return RelocInfo::IsNone(mode) || RelocInfo::IsShareableRelocMode(mode);
}
void ConstPool::EmitMarker() {
// A constant pool size is expressed in number of 32-bits words.
// Currently all entries are 64-bit.
......
......@@ -848,7 +848,6 @@ class ConstPool {
void Clear();
private:
bool CanBeShared(RelocInfo::Mode mode);
void EmitMarker();
void EmitGuard();
void EmitEntries();
......
......@@ -514,6 +514,9 @@ class RelocInfo {
// Is the relocation mode affected by GC?
static inline bool IsGCRelocMode(Mode mode) { return mode <= LAST_GCED_ENUM; }
static inline bool IsShareableRelocMode(Mode mode) {
static_assert(RelocInfo::NONE >= RelocInfo::FIRST_SHAREABLE_RELOC_MODE,
"Users of this function rely on NONE being a sharable "
"relocation mode.");
return mode >= RelocInfo::FIRST_SHAREABLE_RELOC_MODE;
}
static inline bool IsCodeTarget(Mode mode) { return mode == CODE_TARGET; }
......
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