diff --git a/BUILD.gn b/BUILD.gn
index 7ac7293c0f..eb2b1113ea 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -1493,6 +1493,8 @@ v8_source_set("v8_base") {
"src/code-events.h",
"src/code-factory.cc",
"src/code-factory.h",
+ "src/code-reference.cc",
+ "src/code-reference.h",
"src/code-stub-assembler.cc",
"src/code-stub-assembler.h",
"src/code-stubs-utils.h",
diff --git a/src/assembler.cc b/src/assembler.cc
index efe857175e..59d280a5ef 100644
--- a/src/assembler.cc
+++ b/src/assembler.cc
@@ -96,7 +96,7 @@ void AssemblerBase::FlushICache(void* start, size_t size) {
void AssemblerBase::Print(Isolate* isolate) {
OFStream os(stdout);
- v8::internal::Disassembler::Decode(isolate, &os, buffer_, pc_, nullptr);
+ v8::internal::Disassembler::Decode(isolate, &os, buffer_, pc_);
}
// -----------------------------------------------------------------------------
@@ -457,12 +457,24 @@ RelocIterator::RelocIterator(Code* code, int mode_mask)
rinfo_.data_ = 0;
rinfo_.constant_pool_ = code->constant_pool();
// Relocation info is read backwards.
- pos_ = code->relocation_start() + code->relocation_size();
+ pos_ = code->relocation_end();
end_ = code->relocation_start();
if (mode_mask_ == 0) pos_ = end_;
next();
}
+RelocIterator::RelocIterator(const CodeReference code_reference, int mode_mask)
+ : mode_mask_(mode_mask) {
+ rinfo_.pc_ = code_reference.instruction_start();
+ rinfo_.data_ = 0;
+ rinfo_.constant_pool_ = code_reference.constant_pool();
+ // Relocation info is read backwards.
+ pos_ = code_reference.relocation_end();
+ end_ = code_reference.relocation_start();
+ if (mode_mask_ == 0) pos_ = end_;
+ next();
+}
+
RelocIterator::RelocIterator(const CodeDesc& desc, int mode_mask)
: mode_mask_(mode_mask) {
rinfo_.pc_ = reinterpret_cast
(desc.buffer);
diff --git a/src/assembler.h b/src/assembler.h
index 6a6750888b..0f8de8d0d1 100644
--- a/src/assembler.h
+++ b/src/assembler.h
@@ -40,6 +40,7 @@
#include