Index: src/assembler.cc |
diff --git a/src/assembler.cc b/src/assembler.cc |
index 0530522de8489a42d45ab20ab558a93733b09bdf..3fda7d84bace54cdb4985e0c3b002b6f253320ac 100644 |
--- a/src/assembler.cc |
+++ b/src/assembler.cc |
@@ -280,16 +280,12 @@ unsigned CpuFeatures::dcache_line_size_ = 0; |
// 01: code_target: [6-bit pc delta] 01 |
// |
// 10: short_data_record: [6-bit pc delta] 10 followed by |
-// [6-bit data delta] [2-bit data type tag] |
+// [8-bit data delta] |
// |
// 11: long_record [6 bit reloc mode] 11 |
// followed by pc delta |
// followed by optional data depending on type. |
// |
-// 1-bit data type tags, used in short_data_record and data_jump long_record: |
-// code_target_with_id: 0 |
-// deopt_reason: 1 |
-// |
// If a pc delta exceeds 6 bits, it is split into a remainder that fits into |
// 6 bits and a part that does not. The latter is encoded as a long record |
// with PC_JUMP as pseudo reloc info mode. The former is encoded as part of |
@@ -305,8 +301,6 @@ unsigned CpuFeatures::dcache_line_size_ = 0; |
const int kTagBits = 2; |
const int kTagMask = (1 << kTagBits) - 1; |
const int kLongTagBits = 6; |
-const int kShortDataTypeTagBits = 1; |
-const int kShortDataBits = kBitsPerByte - kShortDataTypeTagBits; |
const int kEmbeddedObjectTag = 0; |
const int kCodeTargetTag = 1; |
@@ -323,9 +317,6 @@ const int kLastChunkTagBits = 1; |
const int kLastChunkTagMask = 1; |
const int kLastChunkTag = 1; |
-const int kCodeWithIdTag = 0; |
-const int kDeoptReasonTag = 1; |
- |
void RelocInfo::update_wasm_memory_reference( |
Isolate* isolate, Address old_base, Address new_base, |
ICacheFlushMode icache_flush_mode) { |
@@ -411,9 +402,8 @@ void RelocInfoWriter::WriteShortTaggedPC(uint32_t pc_delta, int tag) { |
*--pos_ = pc_delta << kTagBits | tag; |
} |
- |
-void RelocInfoWriter::WriteShortTaggedData(intptr_t data_delta, int tag) { |
- *--pos_ = static_cast<byte>(data_delta << kShortDataTypeTagBits | tag); |
+void RelocInfoWriter::WriteShortData(intptr_t data_delta) { |
+ *--pos_ = static_cast<byte>(data_delta); |
} |
@@ -465,24 +455,10 @@ void RelocInfoWriter::Write(const RelocInfo* rinfo) { |
} else if (rmode == RelocInfo::CODE_TARGET) { |
WriteShortTaggedPC(pc_delta, kCodeTargetTag); |
DCHECK(begin_pos - pos_ <= RelocInfo::kMaxCallSize); |
- } else if (rmode == RelocInfo::CODE_TARGET_WITH_ID) { |
- // Use signed delta-encoding for id. |
- DCHECK_EQ(static_cast<int>(rinfo->data()), rinfo->data()); |
- int id_delta = static_cast<int>(rinfo->data()) - last_id_; |
- // Check if delta is small enough to fit in a tagged byte. |
- if (is_intn(id_delta, kShortDataBits)) { |
- WriteShortTaggedPC(pc_delta, kLocatableTag); |
- WriteShortTaggedData(id_delta, kCodeWithIdTag); |
- } else { |
- // Otherwise, use costly encoding. |
- WriteModeAndPC(pc_delta, rmode); |
- WriteIntData(id_delta); |
- } |
- last_id_ = static_cast<int>(rinfo->data()); |
} else if (rmode == RelocInfo::DEOPT_REASON) { |
- DCHECK(rinfo->data() < (1 << kShortDataBits)); |
+ DCHECK(rinfo->data() < (1 << kBitsPerByte)); |
WriteShortTaggedPC(pc_delta, kLocatableTag); |
- WriteShortTaggedData(rinfo->data(), kDeoptReasonTag); |
+ WriteShortData(rinfo->data()); |
} else { |
WriteModeAndPC(pc_delta, rmode); |
if (RelocInfo::IsComment(rmode)) { |
@@ -523,16 +499,6 @@ inline void RelocIterator::AdvanceReadPC() { |
} |
-void RelocIterator::AdvanceReadId() { |
- int x = 0; |
- for (int i = 0; i < kIntSize; i++) { |
- x |= static_cast<int>(*--pos_) << i * kBitsPerByte; |
- } |
- last_id_ += x; |
- rinfo_.data_ = last_id_; |
-} |
- |
- |
void RelocIterator::AdvanceReadInt() { |
int x = 0; |
for (int i = 0; i < kIntSize; i++) { |
@@ -566,23 +532,9 @@ void RelocIterator::AdvanceReadLongPCJump() { |
rinfo_.pc_ += pc_jump << kSmallPCDeltaBits; |
} |
- |
-inline int RelocIterator::GetShortDataTypeTag() { |
- return *pos_ & ((1 << kShortDataTypeTagBits) - 1); |
-} |
- |
- |
-inline void RelocIterator::ReadShortTaggedId() { |
- int8_t signed_b = *pos_; |
- // Signed right shift is arithmetic shift. Tested in test-utils.cc. |
- last_id_ += signed_b >> kShortDataTypeTagBits; |
- rinfo_.data_ = last_id_; |
-} |
- |
- |
-inline void RelocIterator::ReadShortTaggedData() { |
+inline void RelocIterator::ReadShortData() { |
uint8_t unsigned_b = *pos_; |
- rinfo_.data_ = unsigned_b >> kShortDataTypeTagBits; |
+ rinfo_.data_ = unsigned_b; |
} |
@@ -604,18 +556,9 @@ void RelocIterator::next() { |
} else if (tag == kLocatableTag) { |
ReadShortTaggedPC(); |
Advance(); |
- int data_type_tag = GetShortDataTypeTag(); |
- if (data_type_tag == kCodeWithIdTag) { |
- if (SetMode(RelocInfo::CODE_TARGET_WITH_ID)) { |
- ReadShortTaggedId(); |
- return; |
- } |
- } else { |
- DCHECK(data_type_tag == kDeoptReasonTag); |
- if (SetMode(RelocInfo::DEOPT_REASON)) { |
- ReadShortTaggedData(); |
- return; |
- } |
+ if (SetMode(RelocInfo::DEOPT_REASON)) { |
+ ReadShortData(); |
+ return; |
} |
} else { |
DCHECK(tag == kDefaultTag); |
@@ -624,13 +567,7 @@ void RelocIterator::next() { |
AdvanceReadLongPCJump(); |
} else { |
AdvanceReadPC(); |
- if (rmode == RelocInfo::CODE_TARGET_WITH_ID) { |
- if (SetMode(rmode)) { |
- AdvanceReadId(); |
- return; |
- } |
- Advance(kIntSize); |
- } else if (RelocInfo::IsComment(rmode)) { |
+ if (RelocInfo::IsComment(rmode)) { |
if (SetMode(rmode)) { |
AdvanceReadData(); |
return; |
@@ -673,7 +610,6 @@ RelocIterator::RelocIterator(Code* code, int mode_mask) { |
end_ = code->relocation_start(); |
done_ = false; |
mode_mask_ = mode_mask; |
- last_id_ = 0; |
byte* sequence = code->FindCodeAgeSequence(); |
// We get the isolate from the map, because at serialization time |
// the code pointer has been cloned and isn't really in heap space. |
@@ -695,7 +631,6 @@ RelocIterator::RelocIterator(const CodeDesc& desc, int mode_mask) { |
end_ = pos_ - desc.reloc_size; |
done_ = false; |
mode_mask_ = mode_mask; |
- last_id_ = 0; |
code_age_sequence_ = NULL; |
if (mode_mask_ == 0) pos_ = end_; |
next(); |
@@ -735,8 +670,6 @@ const char* RelocInfo::RelocModeName(RelocInfo::Mode rmode) { |
return "embedded object"; |
case CODE_TARGET: |
return "code target"; |
- case CODE_TARGET_WITH_ID: |
- return "code target with id"; |
case CELL: |
return "property cell"; |
case RUNTIME_ENTRY: |
@@ -810,9 +743,6 @@ void RelocInfo::Print(Isolate* isolate, std::ostream& os) { // NOLINT |
Code* code = Code::GetCodeFromTargetAddress(target_address()); |
os << " (" << Code::Kind2String(code->kind()) << ") (" |
<< static_cast<const void*>(target_address()) << ")"; |
- if (rmode_ == CODE_TARGET_WITH_ID) { |
- os << " (id=" << static_cast<int>(data_) << ")"; |
- } |
} else if (IsRuntimeEntry(rmode_) && |
isolate->deoptimizer_data() != NULL) { |
// Depotimization bailouts are stored as runtime entries. |
@@ -839,7 +769,6 @@ void RelocInfo::Verify(Isolate* isolate) { |
case CELL: |
Object::VerifyPointer(target_cell()); |
break; |
- case CODE_TARGET_WITH_ID: |
case CODE_TARGET: { |
// convert inline target address to code object |
Address addr = target_address(); |