Commit 508f122d authored by jochen's avatar jochen Committed by Commit bot

Pass an isolate to RelocInfo

It needs ot to flush icaches all over the place

BUG=v8:2487
LOG=n
R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/1477343002

Cr-Commit-Position: refs/heads/master@{#32371}
parent 7ceaf727
......@@ -3659,6 +3659,7 @@ void Assembler::GrowBuffer() {
desc.instr_size = pc_offset();
desc.reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos();
desc.origin = this;
// Copy the data.
int pc_delta = desc.buffer - buffer_;
......@@ -3734,7 +3735,7 @@ void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
data = RecordedAstId().ToInt();
ClearRecordedAstId();
}
RelocInfo rinfo(pc_, rmode, data, NULL);
RelocInfo rinfo(isolate(), pc_, rmode, data, NULL);
reloc_info_writer.Write(&rinfo);
}
......
......@@ -2831,6 +2831,7 @@ void Assembler::GrowBuffer() {
// Set up new buffer.
desc.buffer = NewArray<byte>(desc.buffer_size);
desc.origin = this;
desc.instr_size = pc_offset();
desc.reloc_size =
......@@ -2868,7 +2869,7 @@ void Assembler::GrowBuffer() {
void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
// We do not try to reuse pool constants.
RelocInfo rinfo(reinterpret_cast<byte*>(pc_), rmode, data, NULL);
RelocInfo rinfo(isolate(), reinterpret_cast<byte*>(pc_), rmode, data, NULL);
if (((rmode >= RelocInfo::COMMENT) &&
(rmode <= RelocInfo::DEBUG_BREAK_SLOT_AT_CONSTRUCT_CALL)) ||
(rmode == RelocInfo::INTERNAL_REFERENCE) ||
......@@ -2897,8 +2898,8 @@ void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
}
DCHECK(buffer_space() >= kMaxRelocSize); // too late to grow buffer here
if (rmode == RelocInfo::CODE_TARGET_WITH_ID) {
RelocInfo reloc_info_with_ast_id(
reinterpret_cast<byte*>(pc_), rmode, RecordedAstId().ToInt(), NULL);
RelocInfo reloc_info_with_ast_id(isolate(), reinterpret_cast<byte*>(pc_),
rmode, RecordedAstId().ToInt(), NULL);
ClearRecordedAstId();
reloc_info_writer.Write(&reloc_info_with_ast_id);
} else {
......@@ -2987,9 +2988,8 @@ bool Assembler::ShouldEmitVeneer(int max_reachable_pc, int margin) {
void Assembler::RecordVeneerPool(int location_offset, int size) {
RelocInfo rinfo(buffer_ + location_offset,
RelocInfo::VENEER_POOL, static_cast<intptr_t>(size),
NULL);
RelocInfo rinfo(isolate(), buffer_ + location_offset, RelocInfo::VENEER_POOL,
static_cast<intptr_t>(size), NULL);
reloc_info_writer.Write(&rinfo);
}
......
......@@ -741,7 +741,8 @@ void RelocIterator::next() {
}
RelocIterator::RelocIterator(Code* code, int mode_mask) {
RelocIterator::RelocIterator(Code* code, int mode_mask)
: rinfo_(code->map()->GetIsolate()) {
rinfo_.host_ = code;
rinfo_.pc_ = code->instruction_start();
rinfo_.data_ = 0;
......@@ -766,7 +767,8 @@ RelocIterator::RelocIterator(Code* code, int mode_mask) {
}
RelocIterator::RelocIterator(const CodeDesc& desc, int mode_mask) {
RelocIterator::RelocIterator(const CodeDesc& desc, int mode_mask)
: rinfo_(desc.origin->isolate()) {
rinfo_.pc_ = desc.buffer;
rinfo_.data_ = 0;
// Relocation info is read backwards.
......
......@@ -432,10 +432,13 @@ class RelocInfo {
STATIC_ASSERT(NUMBER_OF_MODES <= kBitsPerInt);
RelocInfo() {}
explicit RelocInfo(Isolate* isolate) : isolate_(isolate) {
DCHECK_NOT_NULL(isolate);
}
RelocInfo(byte* pc, Mode rmode, intptr_t data, Code* host)
: pc_(pc), rmode_(rmode), data_(data), host_(host) {
RelocInfo(Isolate* isolate, byte* pc, Mode rmode, intptr_t data, Code* host)
: isolate_(isolate), pc_(pc), rmode_(rmode), data_(data), host_(host) {
DCHECK_NOT_NULL(isolate);
}
static inline bool IsRealRelocMode(Mode mode) {
......@@ -518,6 +521,7 @@ class RelocInfo {
static inline int ModeMask(Mode mode) { return 1 << mode; }
// Accessors
Isolate* isolate() const { return isolate_; }
byte* pc() const { return pc_; }
void set_pc(byte* pc) { pc_ = pc; }
Mode rmode() const { return rmode_; }
......@@ -658,6 +662,7 @@ class RelocInfo {
static const int kApplyMask; // Modes affected by apply. Depends on arch.
private:
Isolate* isolate_;
// On ARM, note that pc_ is the address of the constant pool entry
// to be relocated and not the address of the instruction
// referencing the constant pool entry (except when rmode_ ==
......
......@@ -106,7 +106,7 @@ class BreakLocation {
inline RelocInfo rinfo() const {
return RelocInfo(pc(), rmode(), data_, code());
return RelocInfo(debug_info_->GetIsolate(), pc(), rmode(), data_, code());
}
inline int position() const { return position_; }
......
......@@ -1307,7 +1307,8 @@ static Handle<Code> PatchPositionsInCode(
int new_position = TranslatePosition(position,
position_change_array);
if (position != new_position) {
RelocInfo info_copy(rinfo->pc(), rinfo->rmode(), new_position, NULL);
RelocInfo info_copy(rinfo->isolate(), rinfo->pc(), rinfo->rmode(),
new_position, NULL);
buffer_writer.Write(&info_copy);
continue;
}
......
......@@ -155,7 +155,8 @@ static int DecodeIt(Isolate* isolate, std::ostream* os,
// Print all the reloc info for this instruction which are not comments.
for (int i = 0; i < pcs.length(); i++) {
// Put together the reloc info
RelocInfo relocinfo(pcs[i], rmodes[i], datas[i], converter.code());
RelocInfo relocinfo(isolate, pcs[i], rmodes[i], datas[i],
converter.code());
// Indent the printing of the reloc info.
if (i == 0) {
......
......@@ -108,7 +108,7 @@ void IncrementalMarking::RecordWriteFromCode(HeapObject* obj, Object** slot,
void IncrementalMarking::RecordCodeTargetPatch(Code* host, Address pc,
HeapObject* value) {
if (IsMarking()) {
RelocInfo rinfo(pc, RelocInfo::CODE_TARGET, 0, host);
RelocInfo rinfo(heap_->isolate(), pc, RelocInfo::CODE_TARGET, 0, host);
RecordWriteIntoCode(host, &rinfo, value);
}
}
......@@ -119,7 +119,7 @@ void IncrementalMarking::RecordCodeTargetPatch(Address pc, HeapObject* value) {
Code* host = heap_->isolate()
->inner_pointer_to_code_cache()
->GcSafeFindCodeForInnerPointer(pc);
RelocInfo rinfo(pc, RelocInfo::CODE_TARGET, 0, host);
RelocInfo rinfo(heap_->isolate(), pc, RelocInfo::CODE_TARGET, 0, host);
RecordWriteIntoCode(host, &rinfo, value);
}
}
......
......@@ -2825,12 +2825,12 @@ static inline void UpdateSlot(Isolate* isolate, ObjectVisitor* v,
SlotsBuffer::SlotType slot_type, Address addr) {
switch (slot_type) {
case SlotsBuffer::CODE_TARGET_SLOT: {
RelocInfo rinfo(addr, RelocInfo::CODE_TARGET, 0, NULL);
RelocInfo rinfo(isolate, addr, RelocInfo::CODE_TARGET, 0, NULL);
rinfo.Visit(isolate, v);
break;
}
case SlotsBuffer::CELL_TARGET_SLOT: {
RelocInfo rinfo(addr, RelocInfo::CELL, 0, NULL);
RelocInfo rinfo(isolate, addr, RelocInfo::CELL, 0, NULL);
rinfo.Visit(isolate, v);
break;
}
......@@ -2844,12 +2844,13 @@ static inline void UpdateSlot(Isolate* isolate, ObjectVisitor* v,
break;
}
case SlotsBuffer::DEBUG_TARGET_SLOT: {
RelocInfo rinfo(addr, RelocInfo::DEBUG_BREAK_SLOT_AT_POSITION, 0, NULL);
RelocInfo rinfo(isolate, addr, RelocInfo::DEBUG_BREAK_SLOT_AT_POSITION, 0,
NULL);
if (rinfo.IsPatchedDebugBreakSlotSequence()) rinfo.Visit(isolate, v);
break;
}
case SlotsBuffer::EMBEDDED_OBJECT_SLOT: {
RelocInfo rinfo(addr, RelocInfo::EMBEDDED_OBJECT, 0, NULL);
RelocInfo rinfo(isolate, addr, RelocInfo::EMBEDDED_OBJECT, 0, NULL);
rinfo.Visit(isolate, v);
break;
}
......@@ -4166,7 +4167,7 @@ void MarkCompactCollector::RecordCodeTargetPatch(Address pc, Code* target) {
pc);
MarkBit mark_bit = Marking::MarkBitFrom(host);
if (Marking::IsBlack(mark_bit)) {
RelocInfo rinfo(pc, RelocInfo::CODE_TARGET, 0, host);
RelocInfo rinfo(isolate(), pc, RelocInfo::CODE_TARGET, 0, host);
RecordRelocSlot(&rinfo, target);
}
}
......
......@@ -133,7 +133,7 @@ void RelocInfo::set_target_object(Object* target,
DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
Memory::Object_at(pc_) = target;
if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
Assembler::FlushICacheWithoutIsolate(pc_, sizeof(Address));
Assembler::FlushICache(isolate_, pc_, sizeof(Address));
}
if (write_barrier_mode == UPDATE_WRITE_BARRIER &&
host() != NULL &&
......@@ -199,7 +199,7 @@ void RelocInfo::set_target_cell(Cell* cell,
Address address = cell->address() + Cell::kValueOffset;
Memory::Address_at(pc_) = address;
if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
Assembler::FlushICacheWithoutIsolate(pc_, sizeof(Address));
Assembler::FlushICache(isolate_, pc_, sizeof(Address));
}
if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != NULL) {
// TODO(1550) We are passing NULL as a slot because cell can never be on
......@@ -280,7 +280,7 @@ void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) {
RelocInfo::Mode mode = rmode();
if (mode == RelocInfo::EMBEDDED_OBJECT) {
visitor->VisitEmbeddedPointer(this);
Assembler::FlushICacheWithoutIsolate(pc_, sizeof(Address));
Assembler::FlushICache(isolate, pc_, sizeof(Address));
} else if (RelocInfo::IsCodeTarget(mode)) {
visitor->VisitCodeTarget(this);
} else if (mode == RelocInfo::CELL) {
......
......@@ -2776,6 +2776,7 @@ void Assembler::GrowBuffer() {
// Set up new buffer.
desc.buffer = NewArray<byte>(desc.buffer_size);
desc.origin = this;
desc.instr_size = pc_offset();
desc.reloc_size = (buffer_ + buffer_size_) - (reloc_info_writer.pos());
......@@ -2912,7 +2913,7 @@ void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
!serializer_enabled() && !emit_debug_code()) {
return;
}
RelocInfo rinfo(pc_, rmode, data, NULL);
RelocInfo rinfo(isolate(), pc_, rmode, data, NULL);
reloc_info_writer.Write(&rinfo);
}
......
......@@ -75,7 +75,7 @@ void Deoptimizer::EnsureRelocSpaceForLazyDeoptimization(Handle<Code> code) {
new_reloc->GetDataStartAddress() + padding, 0);
intptr_t comment_string
= reinterpret_cast<intptr_t>(RelocInfo::kFillerCommentString);
RelocInfo rinfo(0, RelocInfo::COMMENT, comment_string, NULL);
RelocInfo rinfo(isolate, 0, RelocInfo::COMMENT, comment_string, NULL);
for (int i = 0; i < additional_comments; ++i) {
#ifdef DEBUG
byte* pos_before = reloc_info_writer.pos();
......@@ -142,10 +142,9 @@ void Deoptimizer::PatchCodeForDeoptimization(Isolate* isolate, Code* code) {
Address deopt_entry = GetDeoptimizationEntry(isolate, i, LAZY);
patcher.masm()->call(deopt_entry, RelocInfo::NONE32);
// We use RUNTIME_ENTRY for deoptimization bailouts.
RelocInfo rinfo(call_address + 1, // 1 after the call opcode.
RelocInfo rinfo(isolate, call_address + 1, // 1 after the call opcode.
RelocInfo::RUNTIME_ENTRY,
reinterpret_cast<intptr_t>(deopt_entry),
NULL);
reinterpret_cast<intptr_t>(deopt_entry), NULL);
reloc_info_writer.Write(&rinfo);
DCHECK_GE(reloc_info_writer.pos(),
reloc_info->address() + ByteArray::kHeaderSize);
......
......@@ -92,7 +92,7 @@ void RelocInfo::apply(intptr_t delta) {
// Absolute code pointer inside code object moves with the code object.
byte* p = reinterpret_cast<byte*>(pc_);
int count = Assembler::RelocateInternalReference(rmode_, p, delta);
Assembler::FlushICacheWithoutIsolate(p, count * sizeof(uint32_t));
Assembler::FlushICache(isolate_, p, count * sizeof(uint32_t));
}
}
......
......@@ -2815,6 +2815,7 @@ void Assembler::GrowBuffer() {
// Set up new buffer.
desc.buffer = NewArray<byte>(desc.buffer_size);
desc.origin = this;
desc.instr_size = pc_offset();
desc.reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos();
......@@ -2893,7 +2894,7 @@ void Assembler::emit_code_stub_address(Code* stub) {
void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
// We do not try to reuse pool constants.
RelocInfo rinfo(pc_, rmode, data, NULL);
RelocInfo rinfo(isolate(), pc_, rmode, data, NULL);
if (rmode >= RelocInfo::COMMENT &&
rmode <= RelocInfo::DEBUG_BREAK_SLOT_AT_CONSTRUCT_CALL) {
// Adjust code for new modes.
......@@ -2910,10 +2911,8 @@ void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
}
DCHECK(buffer_space() >= kMaxRelocSize); // Too late to grow buffer here.
if (rmode == RelocInfo::CODE_TARGET_WITH_ID) {
RelocInfo reloc_info_with_ast_id(pc_,
rmode,
RecordedAstId().ToInt(),
NULL);
RelocInfo reloc_info_with_ast_id(isolate(), pc_, rmode,
RecordedAstId().ToInt(), NULL);
ClearRecordedAstId();
reloc_info_writer.Write(&reloc_info_with_ast_id);
} else {
......
......@@ -92,7 +92,7 @@ void RelocInfo::apply(intptr_t delta) {
// Absolute code pointer inside code object moves with the code object.
byte* p = reinterpret_cast<byte*>(pc_);
int count = Assembler::RelocateInternalReference(rmode_, p, delta);
Assembler::FlushICacheWithoutIsolate(p, count * sizeof(uint32_t));
Assembler::FlushICache(isolate_, p, count * sizeof(uint32_t));
}
}
......
......@@ -3024,6 +3024,7 @@ void Assembler::GrowBuffer() {
// Set up new buffer.
desc.buffer = NewArray<byte>(desc.buffer_size);
desc.origin = this;
desc.instr_size = pc_offset();
desc.reloc_size =
......@@ -3103,7 +3104,7 @@ void Assembler::emit_code_stub_address(Code* stub) {
void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
// We do not try to reuse pool constants.
RelocInfo rinfo(pc_, rmode, data, NULL);
RelocInfo rinfo(isolate(), pc_, rmode, data, NULL);
if (rmode >= RelocInfo::COMMENT &&
rmode <= RelocInfo::DEBUG_BREAK_SLOT_AT_CONSTRUCT_CALL) {
// Adjust code for new modes.
......@@ -3120,10 +3121,8 @@ void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
}
DCHECK(buffer_space() >= kMaxRelocSize); // Too late to grow buffer here.
if (rmode == RelocInfo::CODE_TARGET_WITH_ID) {
RelocInfo reloc_info_with_ast_id(pc_,
rmode,
RecordedAstId().ToInt(),
NULL);
RelocInfo reloc_info_with_ast_id(isolate(), pc_, rmode,
RecordedAstId().ToInt(), NULL);
ClearRecordedAstId();
reloc_info_writer.Write(&reloc_info_with_ast_id);
} else {
......
......@@ -2323,6 +2323,7 @@ void Assembler::GrowBuffer(int needed) {
// Set up new buffer.
desc.buffer = NewArray<byte>(desc.buffer_size);
desc.origin = this;
desc.instr_size = pc_offset();
desc.reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos();
......@@ -2401,7 +2402,7 @@ void Assembler::EmitRelocations() {
RelocInfo::Mode rmode = it->rmode();
Address pc = buffer_ + it->position();
Code* code = NULL;
RelocInfo rinfo(pc, rmode, it->data(), code);
RelocInfo rinfo(isolate(), pc, rmode, it->data(), code);
// Fix up internal references now that they are guaranteed to be bound.
if (RelocInfo::IsInternalReference(rmode)) {
......
......@@ -404,7 +404,7 @@ void RelocInfo::set_target_object(Object* target,
DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
Memory::Object_at(pc_) = target;
if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
Assembler::FlushICacheWithoutIsolate(pc_, sizeof(Address));
Assembler::FlushICache(isolate_, pc_, sizeof(Address));
}
if (write_barrier_mode == UPDATE_WRITE_BARRIER &&
host() != NULL &&
......@@ -451,7 +451,7 @@ void RelocInfo::set_target_cell(Cell* cell,
Address address = cell->address() + Cell::kValueOffset;
Memory::Address_at(pc_) = address;
if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
Assembler::FlushICacheWithoutIsolate(pc_, sizeof(Address));
Assembler::FlushICache(isolate_, pc_, sizeof(Address));
}
if (write_barrier_mode == UPDATE_WRITE_BARRIER &&
host() != NULL) {
......@@ -527,8 +527,9 @@ void RelocInfo::set_debug_call_address(Address target) {
DCHECK(IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence());
Memory::Address_at(pc_ + Assembler::kPatchDebugBreakSlotAddressOffset) =
target;
Assembler::FlushICacheWithoutIsolate(
pc_ + Assembler::kPatchDebugBreakSlotAddressOffset, sizeof(Address));
Assembler::FlushICache(isolate_,
pc_ + Assembler::kPatchDebugBreakSlotAddressOffset,
sizeof(Address));
if (host() != NULL) {
Object* target_code = Code::GetCodeFromTargetAddress(target);
host()->GetHeap()->incremental_marking()->RecordWriteIntoCode(
......@@ -541,7 +542,7 @@ void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) {
RelocInfo::Mode mode = rmode();
if (mode == RelocInfo::EMBEDDED_OBJECT) {
visitor->VisitEmbeddedPointer(this);
Assembler::FlushICacheWithoutIsolate(pc_, sizeof(Address));
Assembler::FlushICache(isolate, pc_, sizeof(Address));
} else if (RelocInfo::IsCodeTarget(mode)) {
visitor->VisitCodeTarget(this);
} else if (mode == RelocInfo::CELL) {
......
......@@ -389,6 +389,7 @@ void Assembler::GrowBuffer() {
// Set up new buffer.
desc.buffer = NewArray<byte>(desc.buffer_size);
desc.origin = this;
desc.instr_size = pc_offset();
desc.reloc_size =
static_cast<int>((buffer_ + buffer_size_) - (reloc_info_writer.pos()));
......@@ -4116,7 +4117,7 @@ void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
// Don't record psuedo relocation info for code age sequence mode.
return;
}
RelocInfo rinfo(pc_, rmode, data, NULL);
RelocInfo rinfo(isolate(), pc_, rmode, data, NULL);
reloc_info_writer.Write(&rinfo);
}
......
......@@ -134,7 +134,7 @@ void RelocInfo::set_target_object(Object* target,
DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
Memory::Object_at(pc_) = target;
if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
Assembler::FlushICacheWithoutIsolate(pc_, sizeof(Address));
Assembler::FlushICache(isolate_, pc_, sizeof(Address));
}
if (write_barrier_mode == UPDATE_WRITE_BARRIER &&
host() != NULL &&
......@@ -200,7 +200,7 @@ void RelocInfo::set_target_cell(Cell* cell,
Address address = cell->address() + Cell::kValueOffset;
Memory::Address_at(pc_) = address;
if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
Assembler::FlushICacheWithoutIsolate(pc_, sizeof(Address));
Assembler::FlushICache(isolate_, pc_, sizeof(Address));
}
if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != NULL) {
// TODO(1550) We are passing NULL as a slot because cell can never be on
......
......@@ -1945,6 +1945,7 @@ void Assembler::GrowBuffer() {
// Set up new buffer.
desc.buffer = NewArray<byte>(desc.buffer_size);
desc.origin = this;
desc.instr_size = pc_offset();
desc.reloc_size = (buffer_ + buffer_size_) - (reloc_info_writer.pos());
......@@ -2080,7 +2081,7 @@ void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
!serializer_enabled() && !emit_debug_code()) {
return;
}
RelocInfo rinfo(pc_, rmode, data, NULL);
RelocInfo rinfo(isolate(), pc_, rmode, data, NULL);
reloc_info_writer.Write(&rinfo);
}
......
......@@ -75,7 +75,7 @@ void Deoptimizer::EnsureRelocSpaceForLazyDeoptimization(Handle<Code> code) {
new_reloc->GetDataStartAddress() + padding, 0);
intptr_t comment_string
= reinterpret_cast<intptr_t>(RelocInfo::kFillerCommentString);
RelocInfo rinfo(0, RelocInfo::COMMENT, comment_string, NULL);
RelocInfo rinfo(isolate, 0, RelocInfo::COMMENT, comment_string, NULL);
for (int i = 0; i < additional_comments; ++i) {
#ifdef DEBUG
byte* pos_before = reloc_info_writer.pos();
......@@ -142,10 +142,9 @@ void Deoptimizer::PatchCodeForDeoptimization(Isolate* isolate, Code* code) {
Address deopt_entry = GetDeoptimizationEntry(isolate, i, LAZY);
patcher.masm()->call(deopt_entry, RelocInfo::NONE32);
// We use RUNTIME_ENTRY for deoptimization bailouts.
RelocInfo rinfo(call_address + 1, // 1 after the call opcode.
RelocInfo rinfo(isolate, call_address + 1, // 1 after the call opcode.
RelocInfo::RUNTIME_ENTRY,
reinterpret_cast<intptr_t>(deopt_entry),
NULL);
reinterpret_cast<intptr_t>(deopt_entry), NULL);
reloc_info_writer.Write(&rinfo);
DCHECK_GE(reloc_info_writer.pos(),
reloc_info->address() + ByteArray::kHeaderSize);
......
......@@ -29,6 +29,7 @@
#define V8_IMMINENT_DEPRECATION_WARNINGS
#include "src/assembler.h"
#include "src/macro-assembler.h"
#include "test/cctest/cctest.h"
namespace v8 {
......@@ -36,7 +37,7 @@ namespace internal {
static void WriteRinfo(RelocInfoWriter* writer,
byte* pc, RelocInfo::Mode mode, intptr_t data) {
RelocInfo rinfo(pc, mode, data, NULL);
RelocInfo rinfo(CcTest::i_isolate(), pc, mode, data, NULL);
writer->Write(&rinfo);
}
......@@ -44,6 +45,7 @@ static void WriteRinfo(RelocInfoWriter* writer,
// Tests that writing both types of positions and then reading either
// or both works as expected.
TEST(Positions) {
CcTest::InitializeVM();
const int code_size = 10 * KB;
int relocation_info_size = 10 * KB;
const int buffer_size = code_size + relocation_info_size;
......@@ -68,8 +70,9 @@ TEST(Positions) {
writer.Finish();
relocation_info_size = static_cast<int>(buffer_end - writer.pos());
CodeDesc desc = {buffer.get(), buffer_size, code_size, relocation_info_size,
0, NULL};
MacroAssembler assm(CcTest::i_isolate(), nullptr, 0, CodeObjectRequired::kNo);
CodeDesc desc = {buffer.get(), buffer_size, code_size,
relocation_info_size, 0, &assm};
// Read only (non-statement) positions.
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment