Index: src/assembler.cc |
diff --git a/src/assembler.cc b/src/assembler.cc |
index d81d4ae61480fe13483d3a5fdebf1a38d7f05bd2..0dbdf0061dc27102aa026b36c1b62ea8e903e137 100644 |
--- a/src/assembler.cc |
+++ b/src/assembler.cc |
@@ -313,6 +313,7 @@ void RelocInfoWriter::Write(const RelocInfo* rinfo) { |
#ifdef DEBUG |
byte* begin_pos = pos_; |
#endif |
+ ASSERT(rinfo->rmode() < RelocInfo::NUMBER_OF_MODES); |
ASSERT(rinfo->pc() - last_pc_ >= 0); |
ASSERT(RelocInfo::LAST_STANDARD_NONCOMPACT_ENUM - RelocInfo::LAST_COMPACT_ENUM |
<= kMaxStandardNonCompactModes); |
@@ -570,6 +571,15 @@ void RelocIterator::next() { |
} |
} |
} |
+ if (code_age_sequence_ != NULL) { |
+ byte* old_code_age_sequence = code_age_sequence_; |
+ code_age_sequence_ = NULL; |
+ if (SetMode(RelocInfo::CODE_AGE_SEQUENCE)) { |
+ rinfo_.data_ = 0; |
+ rinfo_.pc_ = old_code_age_sequence; |
+ return; |
+ } |
+ } |
done_ = true; |
} |
@@ -585,6 +595,12 @@ RelocIterator::RelocIterator(Code* code, int mode_mask) { |
mode_mask_ = mode_mask; |
last_id_ = 0; |
last_position_ = 0; |
+ byte* sequence = code->FindCodeAgeSequence(); |
+ if (sequence != NULL && !Code::IsYoungSequence(sequence)) { |
+ code_age_sequence_ = sequence; |
+ } else { |
+ code_age_sequence_ = NULL; |
+ } |
if (mode_mask_ == 0) pos_ = end_; |
next(); |
} |
@@ -600,6 +616,7 @@ RelocIterator::RelocIterator(const CodeDesc& desc, int mode_mask) { |
mode_mask_ = mode_mask; |
last_id_ = 0; |
last_position_ = 0; |
+ code_age_sequence_ = NULL; |
if (mode_mask_ == 0) pos_ = end_; |
next(); |
} |
@@ -652,6 +669,8 @@ const char* RelocInfo::RelocModeName(RelocInfo::Mode rmode) { |
UNREACHABLE(); |
#endif |
return "debug break slot"; |
+ case RelocInfo::CODE_AGE_SEQUENCE: |
+ return "code_age_sequence"; |
case RelocInfo::NUMBER_OF_MODES: |
UNREACHABLE(); |
return "number_of_modes"; |
@@ -739,6 +758,9 @@ void RelocInfo::Verify() { |
case NUMBER_OF_MODES: |
UNREACHABLE(); |
break; |
+ case CODE_AGE_SEQUENCE: |
+ ASSERT(Code::IsYoungSequence(pc_) || code_age_stub()->IsCode()); |
+ break; |
} |
} |
#endif // VERIFY_HEAP |
@@ -874,6 +896,13 @@ ExternalReference ExternalReference::get_date_field_function( |
} |
+ExternalReference ExternalReference::get_make_code_young_function( |
+ Isolate* isolate) { |
+ return ExternalReference(Redirect( |
+ isolate, FUNCTION_ADDR(Code::MakeCodeAgeSequenceYoung))); |
+} |
+ |
+ |
ExternalReference ExternalReference::date_cache_stamp(Isolate* isolate) { |
return ExternalReference(isolate->date_cache()->stamp_address()); |
} |