[assembler] Remove kCodeTargetMask
Since https://crrev.com/2951473002, there is only one reloc info for code targets, so there is no need for the special {kCodeTargetMask}. R=mstarzinger@chromium.org Bug: v8:7754 Change-Id: I1055108c0128c7de0f5cfefc5e90bbd9dc75522a Reviewed-on: https://chromium-review.googlesource.com/1098663 Reviewed-by: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Commit-Queue: Clemens Hammacher <clemensh@chromium.org> Cr-Commit-Position: refs/heads/master@{#53776}
This commit is contained in:
parent
7a8e24b48f
commit
3f3c6e692e
@ -157,9 +157,10 @@ CPURegList CPURegList::GetSafepointSavedRegisters() {
|
||||
// -----------------------------------------------------------------------------
|
||||
// Implementation of RelocInfo
|
||||
|
||||
const int RelocInfo::kApplyMask = RelocInfo::kCodeTargetMask |
|
||||
1 << RelocInfo::RUNTIME_ENTRY |
|
||||
1 << RelocInfo::INTERNAL_REFERENCE;
|
||||
const int RelocInfo::kApplyMask =
|
||||
RelocInfo::ModeMask(RelocInfo::CODE_TARGET) |
|
||||
RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY) |
|
||||
RelocInfo::ModeMask(RelocInfo::INTERNAL_REFERENCE);
|
||||
|
||||
bool RelocInfo::IsCodedSpecially() {
|
||||
// The deserializer needs to know whether a pointer is specially coded. Being
|
||||
|
@ -511,7 +511,7 @@ bool RelocInfo::RequiresRelocation(const CodeDesc& desc) {
|
||||
// Ensure there are no code targets or embedded objects present in the
|
||||
// deoptimization entries, they would require relocation after code
|
||||
// generation.
|
||||
int mode_mask = RelocInfo::kCodeTargetMask |
|
||||
int mode_mask = RelocInfo::ModeMask(RelocInfo::CODE_TARGET) |
|
||||
RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) |
|
||||
RelocInfo::kApplyMask;
|
||||
RelocIterator it(desc, mode_mask);
|
||||
|
@ -433,7 +433,7 @@ class RelocInfo {
|
||||
// Please note the order is important (see IsRealRelocMode, IsCodeTarget,
|
||||
// IsGCRelocMode, and IsShareableRelocMode predicates below).
|
||||
|
||||
CODE_TARGET, // LAST_CODE_ENUM
|
||||
CODE_TARGET,
|
||||
EMBEDDED_OBJECT, // LAST_GCED_ENUM
|
||||
|
||||
JS_TO_WASM_CALL,
|
||||
@ -476,7 +476,6 @@ class RelocInfo {
|
||||
|
||||
FIRST_REAL_RELOC_MODE = CODE_TARGET,
|
||||
LAST_REAL_RELOC_MODE = VENEER_POOL,
|
||||
LAST_CODE_ENUM = CODE_TARGET,
|
||||
LAST_GCED_ENUM = EMBEDDED_OBJECT,
|
||||
FIRST_SHAREABLE_RELOC_MODE = WASM_STUB_CALL,
|
||||
};
|
||||
@ -496,9 +495,7 @@ class RelocInfo {
|
||||
static inline bool IsRealRelocMode(Mode mode) {
|
||||
return mode >= FIRST_REAL_RELOC_MODE && mode <= LAST_REAL_RELOC_MODE;
|
||||
}
|
||||
static inline bool IsCodeTarget(Mode mode) {
|
||||
return mode <= LAST_CODE_ENUM;
|
||||
}
|
||||
static inline bool IsCodeTarget(Mode mode) { return mode == CODE_TARGET; }
|
||||
// Is the relocation mode affected by GC?
|
||||
static inline bool IsGCRelocMode(Mode mode) { return mode <= LAST_GCED_ENUM; }
|
||||
static inline bool IsShareableRelocMode(Mode mode) {
|
||||
@ -680,7 +677,6 @@ class RelocInfo {
|
||||
void Verify(Isolate* isolate);
|
||||
#endif
|
||||
|
||||
static const int kCodeTargetMask = (1 << (LAST_CODE_ENUM + 1)) - 1;
|
||||
static const int kApplyMask; // Modes affected by apply. Depends on arch.
|
||||
|
||||
private:
|
||||
|
@ -187,8 +187,10 @@ void Displacement::init(Label* L, Type type) {
|
||||
// Implementation of RelocInfo
|
||||
|
||||
const int RelocInfo::kApplyMask =
|
||||
RelocInfo::kCodeTargetMask | 1 << RelocInfo::RUNTIME_ENTRY |
|
||||
1 << RelocInfo::INTERNAL_REFERENCE | 1 << RelocInfo::JS_TO_WASM_CALL;
|
||||
RelocInfo::ModeMask(RelocInfo::CODE_TARGET) |
|
||||
RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY) |
|
||||
RelocInfo::ModeMask(RelocInfo::INTERNAL_REFERENCE) |
|
||||
RelocInfo::ModeMask(RelocInfo::JS_TO_WASM_CALL);
|
||||
|
||||
bool RelocInfo::IsCodedSpecially() {
|
||||
// The deserializer needs to know whether a pointer is specially coded. Being
|
||||
|
@ -443,7 +443,7 @@ class Code::BodyDescriptor final : public BodyDescriptorBase {
|
||||
|
||||
template <typename ObjectVisitor>
|
||||
static inline void IterateBody(Map* map, HeapObject* obj, ObjectVisitor* v) {
|
||||
int mode_mask = RelocInfo::kCodeTargetMask |
|
||||
int mode_mask = RelocInfo::ModeMask(RelocInfo::CODE_TARGET) |
|
||||
RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) |
|
||||
RelocInfo::ModeMask(RelocInfo::EXTERNAL_REFERENCE) |
|
||||
RelocInfo::ModeMask(RelocInfo::INTERNAL_REFERENCE) |
|
||||
|
@ -14081,7 +14081,7 @@ void Code::CopyFromNoFlush(Heap* heap, const CodeDesc& desc) {
|
||||
static_cast<size_t>(desc.reloc_size));
|
||||
|
||||
// unbox handles and relocate
|
||||
int mode_mask = RelocInfo::kCodeTargetMask |
|
||||
int mode_mask = RelocInfo::ModeMask(RelocInfo::CODE_TARGET) |
|
||||
RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) |
|
||||
RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY) |
|
||||
RelocInfo::kApplyMask;
|
||||
|
@ -258,7 +258,8 @@ Register ToRegister(int num) {
|
||||
// Implementation of RelocInfo
|
||||
|
||||
const int RelocInfo::kApplyMask =
|
||||
RelocInfo::kCodeTargetMask | 1 << RelocInfo::INTERNAL_REFERENCE;
|
||||
RelocInfo::ModeMask(RelocInfo::CODE_TARGET) |
|
||||
RelocInfo::ModeMask(RelocInfo::INTERNAL_REFERENCE);
|
||||
|
||||
bool RelocInfo::IsCodedSpecially() {
|
||||
// The deserializer needs to know whether a pointer is specially
|
||||
|
@ -993,7 +993,7 @@ void Serializer<AllocatorT>::ObjectSerializer::OutputCode(int size) {
|
||||
// To make snapshots reproducible, we make a copy of the code object
|
||||
// and wipe all pointers in the copy, which we then serialize.
|
||||
code = serializer_->CopyCode(code);
|
||||
int mode_mask = RelocInfo::kCodeTargetMask |
|
||||
int mode_mask = RelocInfo::ModeMask(RelocInfo::CODE_TARGET) |
|
||||
RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) |
|
||||
RelocInfo::ModeMask(RelocInfo::EXTERNAL_REFERENCE) |
|
||||
RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY) |
|
||||
|
@ -499,7 +499,8 @@ WasmCode* NativeModule::AddAnonymousCode(Handle<Code> code,
|
||||
|
||||
// Apply the relocation delta by iterating over the RelocInfo.
|
||||
intptr_t delta = ret->instruction_start() - code->InstructionStart();
|
||||
int mode_mask = RelocInfo::kApplyMask | RelocInfo::kCodeTargetMask |
|
||||
int mode_mask = RelocInfo::kApplyMask |
|
||||
RelocInfo::ModeMask(RelocInfo::CODE_TARGET) |
|
||||
RelocInfo::ModeMask(RelocInfo::WASM_STUB_CALL);
|
||||
RelocIterator orig_it(*code, mode_mask);
|
||||
for (RelocIterator it(ret->instructions(), ret->reloc_info(),
|
||||
@ -567,7 +568,8 @@ WasmCode* NativeModule::AddCode(
|
||||
// Apply the relocation delta by iterating over the RelocInfo.
|
||||
AllowDeferredHandleDereference embedding_raw_address;
|
||||
intptr_t delta = ret->instructions().start() - desc.buffer;
|
||||
int mode_mask = RelocInfo::kApplyMask | RelocInfo::kCodeTargetMask |
|
||||
int mode_mask = RelocInfo::kApplyMask |
|
||||
RelocInfo::ModeMask(RelocInfo::CODE_TARGET) |
|
||||
RelocInfo::ModeMask(RelocInfo::WASM_STUB_CALL);
|
||||
for (RelocIterator it(ret->instructions(), ret->reloc_info(),
|
||||
ret->constant_pool(), mode_mask);
|
||||
|
@ -4840,8 +4840,10 @@ void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
|
||||
}
|
||||
|
||||
const int RelocInfo::kApplyMask =
|
||||
RelocInfo::kCodeTargetMask | 1 << RelocInfo::RUNTIME_ENTRY |
|
||||
1 << RelocInfo::INTERNAL_REFERENCE | 1 << RelocInfo::WASM_CALL;
|
||||
RelocInfo::ModeMask(RelocInfo::CODE_TARGET) |
|
||||
RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY) |
|
||||
RelocInfo::ModeMask(RelocInfo::INTERNAL_REFERENCE) |
|
||||
RelocInfo::ModeMask(RelocInfo::WASM_CALL);
|
||||
|
||||
bool RelocInfo::IsCodedSpecially() {
|
||||
// The deserializer needs to know whether a pointer is specially coded. Being
|
||||
|
Loading…
Reference in New Issue
Block a user