| Index: src/assembler.cc
|
| diff --git a/src/assembler.cc b/src/assembler.cc
|
| index 21f1715859859fb5cd54107a26e06b218c43a3cd..cec9219ea8bc0c2d028e286b1bae2ee7959a3af0 100644
|
| --- a/src/assembler.cc
|
| +++ b/src/assembler.cc
|
| @@ -328,6 +328,9 @@ const int kNonstatementPositionTag = 1;
|
| const int kStatementPositionTag = 2;
|
| const int kCommentTag = 3;
|
|
|
| +// Reuse the same value for deopt reason tag in short record format.
|
| +const int kDeoptReasonTag = 3;
|
| +
|
| const int kPoolExtraTag = kPCJumpExtraTag - 2;
|
| const int kConstPoolTag = 0;
|
| const int kVeneerPoolTag = 1;
|
| @@ -423,7 +426,10 @@ void RelocInfoWriter::Write(const RelocInfo* rinfo) {
|
| RelocInfo::Mode rmode = rinfo->rmode();
|
|
|
| // The two most common modes are given small tags, and usually fit in a byte.
|
| - if (rmode == RelocInfo::EMBEDDED_OBJECT) {
|
| + if (rmode == RelocInfo::DEOPT_REASON) {
|
| + WriteTaggedPC(pc_delta, kLocatableTag);
|
| + WriteTaggedData(rinfo->data(), kDeoptReasonTag);
|
| + } else if (rmode == RelocInfo::EMBEDDED_OBJECT) {
|
| WriteTaggedPC(pc_delta, kEmbeddedObjectTag);
|
| } else if (rmode == RelocInfo::CODE_TARGET) {
|
| WriteTaggedPC(pc_delta, kCodeTargetTag);
|
| @@ -583,6 +589,12 @@ inline void RelocIterator::ReadTaggedPosition() {
|
| }
|
|
|
|
|
| +inline void RelocIterator::ReadTaggedData() {
|
| + uint8_t unsigned_b = *pos_;
|
| + rinfo_.data_ = unsigned_b >> kTagBits;
|
| +}
|
| +
|
| +
|
| static inline RelocInfo::Mode GetPositionModeFromTag(int tag) {
|
| DCHECK(tag == kNonstatementPositionTag ||
|
| tag == kStatementPositionTag);
|
| @@ -616,9 +628,10 @@ void RelocIterator::next() {
|
| ReadTaggedId();
|
| return;
|
| }
|
| + } else if (locatable_tag == kDeoptReasonTag) {
|
| + ReadTaggedData();
|
| + if (SetMode(RelocInfo::DEOPT_REASON)) return;
|
| } else {
|
| - // Compact encoding is never used for comments,
|
| - // so it must be a position.
|
| DCHECK(locatable_tag == kNonstatementPositionTag ||
|
| locatable_tag == kStatementPositionTag);
|
| if (mode_mask_ & RelocInfo::kPositionMask) {
|
| @@ -783,6 +796,8 @@ const char* RelocInfo::RelocModeName(RelocInfo::Mode rmode) {
|
| return "external reference";
|
| case RelocInfo::INTERNAL_REFERENCE:
|
| return "internal reference";
|
| + case RelocInfo::DEOPT_REASON:
|
| + return "deopt reason";
|
| case RelocInfo::CONST_POOL:
|
| return "constant pool";
|
| case RelocInfo::VENEER_POOL:
|
| @@ -803,6 +818,9 @@ void RelocInfo::Print(Isolate* isolate, std::ostream& os) { // NOLINT
|
| os << static_cast<const void*>(pc_) << " " << RelocModeName(rmode_);
|
| if (IsComment(rmode_)) {
|
| os << " (" << reinterpret_cast<char*>(data_) << ")";
|
| + } else if (rmode_ == DEOPT_REASON) {
|
| + os << " (" << Deoptimizer::GetDeoptReason(
|
| + static_cast<Deoptimizer::DeoptReason>(data_)) << ")";
|
| } else if (rmode_ == EMBEDDED_OBJECT) {
|
| os << " (" << Brief(target_object()) << ")";
|
| } else if (rmode_ == EXTERNAL_REFERENCE) {
|
| @@ -863,6 +881,7 @@ void RelocInfo::Verify(Isolate* isolate) {
|
| case STATEMENT_POSITION:
|
| case EXTERNAL_REFERENCE:
|
| case INTERNAL_REFERENCE:
|
| + case DEOPT_REASON:
|
| case CONST_POOL:
|
| case VENEER_POOL:
|
| case DEBUG_BREAK_SLOT:
|
|
|