Commit 97499e33 authored by dcarney's avatar dcarney Committed by Commit bot

[turbofan] cleanup PointerMap

rename to ReferenceMap
use ZoneVector for storage
drop dead code

BUG=

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

Cr-Commit-Position: refs/heads/master@{#27785}
parent 6fc394a1
...@@ -166,21 +166,18 @@ bool CodeGenerator::IsNextInAssemblyOrder(RpoNumber block) const { ...@@ -166,21 +166,18 @@ bool CodeGenerator::IsNextInAssemblyOrder(RpoNumber block) const {
} }
void CodeGenerator::RecordSafepoint(PointerMap* pointers, Safepoint::Kind kind, void CodeGenerator::RecordSafepoint(ReferenceMap* references,
int arguments, Safepoint::Kind kind, int arguments,
Safepoint::DeoptMode deopt_mode) { Safepoint::DeoptMode deopt_mode) {
const ZoneList<InstructionOperand*>* operands =
pointers->GetNormalizedOperands();
Safepoint safepoint = Safepoint safepoint =
safepoints()->DefineSafepoint(masm(), kind, arguments, deopt_mode); safepoints()->DefineSafepoint(masm(), kind, arguments, deopt_mode);
for (int i = 0; i < operands->length(); i++) { for (auto& operand : references->reference_operands()) {
InstructionOperand* pointer = operands->at(i); if (operand.IsStackSlot()) {
if (pointer->IsStackSlot()) { safepoint.DefinePointerSlot(StackSlotOperand::cast(operand).index(),
safepoint.DefinePointerSlot(StackSlotOperand::cast(pointer)->index(),
zone()); zone());
} else if (pointer->IsRegister() && (kind & Safepoint::kWithRegisters)) { } else if (operand.IsRegister() && (kind & Safepoint::kWithRegisters)) {
Register reg = Register::FromAllocationIndex( Register reg =
RegisterOperand::cast(pointer)->index()); Register::FromAllocationIndex(RegisterOperand::cast(operand).index());
safepoint.DefinePointerRegister(reg, zone()); safepoint.DefinePointerRegister(reg, zone());
} }
} }
...@@ -339,7 +336,7 @@ void CodeGenerator::RecordCallPosition(Instruction* instr) { ...@@ -339,7 +336,7 @@ void CodeGenerator::RecordCallPosition(Instruction* instr) {
bool needs_frame_state = (flags & CallDescriptor::kNeedsFrameState); bool needs_frame_state = (flags & CallDescriptor::kNeedsFrameState);
RecordSafepoint( RecordSafepoint(
instr->pointer_map(), Safepoint::kSimple, 0, instr->reference_map(), Safepoint::kSimple, 0,
needs_frame_state ? Safepoint::kLazyDeopt : Safepoint::kNoLazyDeopt); needs_frame_state ? Safepoint::kLazyDeopt : Safepoint::kNoLazyDeopt);
if (flags & CallDescriptor::kHasExceptionHandler) { if (flags & CallDescriptor::kHasExceptionHandler) {
......
...@@ -55,7 +55,7 @@ class CodeGenerator FINAL : public GapResolver::Assembler { ...@@ -55,7 +55,7 @@ class CodeGenerator FINAL : public GapResolver::Assembler {
bool IsNextInAssemblyOrder(RpoNumber block) const; bool IsNextInAssemblyOrder(RpoNumber block) const;
// Record a safepoint with the given pointer map. // Record a safepoint with the given pointer map.
void RecordSafepoint(PointerMap* pointers, Safepoint::Kind kind, void RecordSafepoint(ReferenceMap* references, Safepoint::Kind kind,
int arguments, Safepoint::DeoptMode deopt_mode); int arguments, Safepoint::DeoptMode deopt_mode);
// Assemble code for the specified instruction. // Assemble code for the specified instruction.
......
...@@ -126,7 +126,7 @@ Instruction::Instruction(InstructionCode opcode) ...@@ -126,7 +126,7 @@ Instruction::Instruction(InstructionCode opcode)
: opcode_(opcode), : opcode_(opcode),
bit_field_(OutputCountField::encode(0) | InputCountField::encode(0) | bit_field_(OutputCountField::encode(0) | InputCountField::encode(0) |
TempCountField::encode(0) | IsCallField::encode(false)), TempCountField::encode(0) | IsCallField::encode(false)),
pointer_map_(NULL) { reference_map_(NULL) {
parallel_moves_[0] = nullptr; parallel_moves_[0] = nullptr;
parallel_moves_[1] = nullptr; parallel_moves_[1] = nullptr;
} }
...@@ -141,7 +141,7 @@ Instruction::Instruction(InstructionCode opcode, size_t output_count, ...@@ -141,7 +141,7 @@ Instruction::Instruction(InstructionCode opcode, size_t output_count,
InputCountField::encode(input_count) | InputCountField::encode(input_count) |
TempCountField::encode(temp_count) | TempCountField::encode(temp_count) |
IsCallField::encode(false)), IsCallField::encode(false)),
pointer_map_(NULL) { reference_map_(NULL) {
parallel_moves_[0] = nullptr; parallel_moves_[0] = nullptr;
parallel_moves_[1] = nullptr; parallel_moves_[1] = nullptr;
size_t offset = 0; size_t offset = 0;
...@@ -187,42 +187,27 @@ std::ostream& operator<<(std::ostream& os, ...@@ -187,42 +187,27 @@ std::ostream& operator<<(std::ostream& os,
} }
void PointerMap::RecordPointer(InstructionOperand* op, Zone* zone) { void ReferenceMap::RecordReference(const InstructionOperand& op) {
// Do not record arguments as pointers. // Do not record arguments as pointers.
if (op->IsStackSlot() && StackSlotOperand::cast(op)->index() < 0) return; if (op.IsStackSlot() && StackSlotOperand::cast(op).index() < 0) return;
DCHECK(!op->IsDoubleRegister() && !op->IsDoubleStackSlot()); DCHECK(!op.IsDoubleRegister() && !op.IsDoubleStackSlot());
pointer_operands_.Add(op, zone); reference_operands_.push_back(op);
} }
void PointerMap::RemovePointer(InstructionOperand* op) { std::ostream& operator<<(std::ostream& os, const ReferenceMap& pm) {
// Do not record arguments as pointers.
if (op->IsStackSlot() && StackSlotOperand::cast(op)->index() < 0) return;
DCHECK(!op->IsDoubleRegister() && !op->IsDoubleStackSlot());
for (int i = 0; i < pointer_operands_.length(); ++i) {
if (pointer_operands_[i]->Equals(op)) {
pointer_operands_.Remove(i);
--i;
}
}
}
void PointerMap::RecordUntagged(InstructionOperand* op, Zone* zone) {
// Do not record arguments as pointers.
if (op->IsStackSlot() && StackSlotOperand::cast(op)->index() < 0) return;
DCHECK(!op->IsDoubleRegister() && !op->IsDoubleStackSlot());
untagged_operands_.Add(op, zone);
}
std::ostream& operator<<(std::ostream& os, const PointerMap& pm) {
os << "{"; os << "{";
for (ZoneList<InstructionOperand*>::iterator op = bool first = true;
pm.pointer_operands_.begin(); PrintableInstructionOperand poi = {RegisterConfiguration::ArchDefault(),
op != pm.pointer_operands_.end(); ++op) { nullptr};
if (op != pm.pointer_operands_.begin()) os << ";"; for (auto& op : pm.reference_operands_) {
os << *op; if (!first) {
os << ";";
} else {
first = false;
}
poi.op_ = &op;
os << poi;
} }
return os << "}"; return os << "}";
} }
...@@ -501,7 +486,7 @@ InstructionSequence::InstructionSequence(Isolate* isolate, ...@@ -501,7 +486,7 @@ InstructionSequence::InstructionSequence(Isolate* isolate,
immediates_(zone()), immediates_(zone()),
instructions_(zone()), instructions_(zone()),
next_virtual_register_(0), next_virtual_register_(0),
pointer_maps_(zone()), reference_maps_(zone()),
doubles_(std::less<int>(), VirtualRegisterSet::allocator_type(zone())), doubles_(std::less<int>(), VirtualRegisterSet::allocator_type(zone())),
references_(std::less<int>(), VirtualRegisterSet::allocator_type(zone())), references_(std::less<int>(), VirtualRegisterSet::allocator_type(zone())),
deoptimization_entries_(zone()) { deoptimization_entries_(zone()) {
...@@ -546,12 +531,12 @@ void InstructionSequence::EndBlock(RpoNumber rpo) { ...@@ -546,12 +531,12 @@ void InstructionSequence::EndBlock(RpoNumber rpo) {
int InstructionSequence::AddInstruction(Instruction* instr) { int InstructionSequence::AddInstruction(Instruction* instr) {
int index = static_cast<int>(instructions_.size()); int index = static_cast<int>(instructions_.size());
instructions_.push_back(instr); instructions_.push_back(instr);
if (instr->NeedsPointerMap()) { if (instr->NeedsReferenceMap()) {
DCHECK(instr->pointer_map() == NULL); DCHECK(instr->reference_map() == NULL);
PointerMap* pointer_map = new (zone()) PointerMap(zone()); ReferenceMap* reference_map = new (zone()) ReferenceMap(zone());
pointer_map->set_instruction_position(index); reference_map->set_instruction_position(index);
instr->set_pointer_map(pointer_map); instr->set_reference_map(reference_map);
pointer_maps_.push_back(pointer_map); reference_maps_.push_back(reference_map);
} }
return index; return index;
} }
......
...@@ -518,19 +518,13 @@ struct PrintableParallelMove { ...@@ -518,19 +518,13 @@ struct PrintableParallelMove {
std::ostream& operator<<(std::ostream& os, const PrintableParallelMove& pm); std::ostream& operator<<(std::ostream& os, const PrintableParallelMove& pm);
class PointerMap FINAL : public ZoneObject { class ReferenceMap FINAL : public ZoneObject {
public: public:
explicit PointerMap(Zone* zone) explicit ReferenceMap(Zone* zone)
: pointer_operands_(8, zone), : reference_operands_(8, zone), instruction_position_(-1) {}
untagged_operands_(0, zone),
instruction_position_(-1) {} const ZoneVector<InstructionOperand>& reference_operands() const {
return reference_operands_;
const ZoneList<InstructionOperand*>* GetNormalizedOperands() {
for (int i = 0; i < untagged_operands_.length(); ++i) {
RemovePointer(untagged_operands_[i]);
}
untagged_operands_.Clear();
return &pointer_operands_;
} }
int instruction_position() const { return instruction_position_; } int instruction_position() const { return instruction_position_; }
...@@ -539,21 +533,17 @@ class PointerMap FINAL : public ZoneObject { ...@@ -539,21 +533,17 @@ class PointerMap FINAL : public ZoneObject {
instruction_position_ = pos; instruction_position_ = pos;
} }
void RecordPointer(InstructionOperand* op, Zone* zone); void RecordReference(const InstructionOperand& op);
void RemovePointer(InstructionOperand* op);
void RecordUntagged(InstructionOperand* op, Zone* zone);
private: private:
friend std::ostream& operator<<(std::ostream& os, const PointerMap& pm); friend std::ostream& operator<<(std::ostream& os, const ReferenceMap& pm);
ZoneList<InstructionOperand*> pointer_operands_; ZoneVector<InstructionOperand> reference_operands_;
ZoneList<InstructionOperand*> untagged_operands_;
int instruction_position_; int instruction_position_;
}; };
std::ostream& operator<<(std::ostream& os, const PointerMap& pm); std::ostream& operator<<(std::ostream& os, const ReferenceMap& pm);
// TODO(titzer): s/PointerMap/ReferenceMap/
class Instruction { class Instruction {
public: public:
size_t OutputCount() const { return OutputCountField::decode(bit_field_); } size_t OutputCount() const { return OutputCountField::decode(bit_field_); }
...@@ -627,8 +617,8 @@ class Instruction { ...@@ -627,8 +617,8 @@ class Instruction {
return this; return this;
} }
bool IsCall() const { return IsCallField::decode(bit_field_); } bool IsCall() const { return IsCallField::decode(bit_field_); }
bool NeedsPointerMap() const { return IsCall(); } bool NeedsReferenceMap() const { return IsCall(); }
bool HasPointerMap() const { return pointer_map_ != NULL; } bool HasReferenceMap() const { return reference_map_ != NULL; }
bool IsSourcePosition() const { bool IsSourcePosition() const {
return opcode() == kSourcePositionInstruction; return opcode() == kSourcePositionInstruction;
...@@ -637,18 +627,18 @@ class Instruction { ...@@ -637,18 +627,18 @@ class Instruction {
bool ClobbersRegisters() const { return IsCall(); } bool ClobbersRegisters() const { return IsCall(); }
bool ClobbersTemps() const { return IsCall(); } bool ClobbersTemps() const { return IsCall(); }
bool ClobbersDoubleRegisters() const { return IsCall(); } bool ClobbersDoubleRegisters() const { return IsCall(); }
PointerMap* pointer_map() const { return pointer_map_; } ReferenceMap* reference_map() const { return reference_map_; }
void set_pointer_map(PointerMap* map) { void set_reference_map(ReferenceMap* map) {
DCHECK(NeedsPointerMap()); DCHECK(NeedsReferenceMap());
DCHECK(!pointer_map_); DCHECK(!reference_map_);
pointer_map_ = map; reference_map_ = map;
} }
void OverwriteWithNop() { void OverwriteWithNop() {
opcode_ = ArchOpcodeField::encode(kArchNop); opcode_ = ArchOpcodeField::encode(kArchNop);
bit_field_ = 0; bit_field_ = 0;
pointer_map_ = NULL; reference_map_ = NULL;
} }
bool IsNop() const { bool IsNop() const {
...@@ -700,7 +690,7 @@ class Instruction { ...@@ -700,7 +690,7 @@ class Instruction {
InstructionCode opcode_; InstructionCode opcode_;
uint32_t bit_field_; uint32_t bit_field_;
ParallelMove* parallel_moves_[2]; ParallelMove* parallel_moves_[2];
PointerMap* pointer_map_; ReferenceMap* reference_map_;
InstructionOperand operands_[1]; InstructionOperand operands_[1];
private: private:
...@@ -987,7 +977,7 @@ typedef std::map<int, Constant, std::less<int>, ...@@ -987,7 +977,7 @@ typedef std::map<int, Constant, std::less<int>,
zone_allocator<std::pair<int, Constant> > > ConstantMap; zone_allocator<std::pair<int, Constant> > > ConstantMap;
typedef ZoneDeque<Instruction*> InstructionDeque; typedef ZoneDeque<Instruction*> InstructionDeque;
typedef ZoneDeque<PointerMap*> PointerMapDeque; typedef ZoneDeque<ReferenceMap*> ReferenceMapDeque;
typedef ZoneVector<FrameStateDescriptor*> DeoptimizationVector; typedef ZoneVector<FrameStateDescriptor*> DeoptimizationVector;
typedef ZoneVector<InstructionBlock*> InstructionBlocks; typedef ZoneVector<InstructionBlock*> InstructionBlocks;
...@@ -1053,7 +1043,7 @@ class InstructionSequence FINAL : public ZoneObject { ...@@ -1053,7 +1043,7 @@ class InstructionSequence FINAL : public ZoneObject {
} }
Isolate* isolate() const { return isolate_; } Isolate* isolate() const { return isolate_; }
const PointerMapDeque* pointer_maps() const { return &pointer_maps_; } const ReferenceMapDeque* reference_maps() const { return &reference_maps_; }
Zone* zone() const { return zone_; } Zone* zone() const { return zone_; }
// Used by the instruction selector while adding instructions. // Used by the instruction selector while adding instructions.
...@@ -1133,7 +1123,7 @@ class InstructionSequence FINAL : public ZoneObject { ...@@ -1133,7 +1123,7 @@ class InstructionSequence FINAL : public ZoneObject {
Immediates immediates_; Immediates immediates_;
InstructionDeque instructions_; InstructionDeque instructions_;
int next_virtual_register_; int next_virtual_register_;
PointerMapDeque pointer_maps_; ReferenceMapDeque reference_maps_;
VirtualRegisterSet doubles_; VirtualRegisterSet doubles_;
VirtualRegisterSet references_; VirtualRegisterSet references_;
DeoptimizationVector deoptimization_entries_; DeoptimizationVector deoptimization_entries_;
......
...@@ -737,11 +737,11 @@ struct CommitAssignmentPhase { ...@@ -737,11 +737,11 @@ struct CommitAssignmentPhase {
}; };
struct PopulatePointerMapsPhase { struct PopulateReferenceMapsPhase {
static const char* phase_name() { return "populate pointer maps"; } static const char* phase_name() { return "populate pointer maps"; }
void Run(PipelineData* data, Zone* temp_zone) { void Run(PipelineData* data, Zone* temp_zone) {
data->register_allocator()->PopulatePointerMaps(); data->register_allocator()->PopulateReferenceMaps();
} }
}; };
...@@ -1217,7 +1217,7 @@ void Pipeline::AllocateRegisters(const RegisterConfiguration* config, ...@@ -1217,7 +1217,7 @@ void Pipeline::AllocateRegisters(const RegisterConfiguration* config,
Run<AssignSpillSlotsPhase>(); Run<AssignSpillSlotsPhase>();
Run<CommitAssignmentPhase>(); Run<CommitAssignmentPhase>();
Run<PopulatePointerMapsPhase>(); Run<PopulateReferenceMapsPhase>();
Run<ConnectRangesPhase>(); Run<ConnectRangesPhase>();
Run<ResolveControlFlowPhase>(); Run<ResolveControlFlowPhase>();
if (FLAG_turbo_move_optimization) { if (FLAG_turbo_move_optimization) {
......
...@@ -722,8 +722,8 @@ InstructionOperand* RegisterAllocator::AllocateFixed( ...@@ -722,8 +722,8 @@ InstructionOperand* RegisterAllocator::AllocateFixed(
if (is_tagged) { if (is_tagged) {
TRACE("Fixed reg is tagged at %d\n", pos); TRACE("Fixed reg is tagged at %d\n", pos);
auto instr = InstructionAt(pos); auto instr = InstructionAt(pos);
if (instr->HasPointerMap()) { if (instr->HasReferenceMap()) {
instr->pointer_map()->RecordPointer(operand, code_zone()); instr->reference_map()->RecordReference(*operand);
} }
} }
return operand; return operand;
...@@ -1226,8 +1226,8 @@ void RegisterAllocator::MeetConstraintsBefore(int instr_index) { ...@@ -1226,8 +1226,8 @@ void RegisterAllocator::MeetConstraintsBefore(int instr_index) {
cur_input->set_virtual_register(second_output->virtual_register()); cur_input->set_virtual_register(second_output->virtual_register());
AddGapMove(instr_index, Instruction::END, input_copy, cur_input); AddGapMove(instr_index, Instruction::END, input_copy, cur_input);
if (HasTaggedValue(input_vreg) && !HasTaggedValue(output_vreg)) { if (HasTaggedValue(input_vreg) && !HasTaggedValue(output_vreg)) {
if (second->HasPointerMap()) { if (second->HasReferenceMap()) {
second->pointer_map()->RecordPointer(input_copy, code_zone()); second->reference_map()->RecordReference(*input_copy);
} }
} else if (!HasTaggedValue(input_vreg) && HasTaggedValue(output_vreg)) { } else if (!HasTaggedValue(input_vreg) && HasTaggedValue(output_vreg)) {
// The input is assumed to immediately have a tagged representation, // The input is assumed to immediately have a tagged representation,
...@@ -1411,8 +1411,8 @@ void RegisterAllocator::ResolvePhis(const InstructionBlock* block) { ...@@ -1411,8 +1411,8 @@ void RegisterAllocator::ResolvePhis(const InstructionBlock* block) {
code()->InstructionBlockAt(block->predecessors()[i]); code()->InstructionBlockAt(block->predecessors()[i]);
AddGapMove(cur_block->last_instruction_index(), Instruction::END, AddGapMove(cur_block->last_instruction_index(), Instruction::END,
&phi->inputs()[i], &output); &phi->inputs()[i], &output);
DCHECK( DCHECK(!InstructionAt(cur_block->last_instruction_index())
!InstructionAt(cur_block->last_instruction_index())->HasPointerMap()); ->HasReferenceMap());
} }
auto live_range = LiveRangeFor(phi_vreg); auto live_range = LiveRangeFor(phi_vreg);
int gap_index = block->first_instruction_index(); int gap_index = block->first_instruction_index();
...@@ -1700,7 +1700,7 @@ void RegisterAllocator::ResolveControlFlow(const InstructionBlock* block, ...@@ -1700,7 +1700,7 @@ void RegisterAllocator::ResolveControlFlow(const InstructionBlock* block,
position = Instruction::START; position = Instruction::START;
} else { } else {
DCHECK(pred->SuccessorCount() == 1); DCHECK(pred->SuccessorCount() == 1);
DCHECK(!InstructionAt(pred->last_instruction_index())->HasPointerMap()); DCHECK(!InstructionAt(pred->last_instruction_index())->HasReferenceMap());
gap_index = pred->last_instruction_index(); gap_index = pred->last_instruction_index();
position = Instruction::END; position = Instruction::END;
} }
...@@ -1822,7 +1822,7 @@ bool RegisterAllocator::ExistsUseWithoutDefinition() { ...@@ -1822,7 +1822,7 @@ bool RegisterAllocator::ExistsUseWithoutDefinition() {
bool RegisterAllocator::SafePointsAreInOrder() const { bool RegisterAllocator::SafePointsAreInOrder() const {
int safe_point = 0; int safe_point = 0;
for (auto map : *code()->pointer_maps()) { for (auto map : *code()->reference_maps()) {
if (safe_point > map->instruction_position()) return false; if (safe_point > map->instruction_position()) return false;
safe_point = map->instruction_position(); safe_point = map->instruction_position();
} }
...@@ -1830,14 +1830,14 @@ bool RegisterAllocator::SafePointsAreInOrder() const { ...@@ -1830,14 +1830,14 @@ bool RegisterAllocator::SafePointsAreInOrder() const {
} }
void RegisterAllocator::PopulatePointerMaps() { void RegisterAllocator::PopulateReferenceMaps() {
DCHECK(SafePointsAreInOrder()); DCHECK(SafePointsAreInOrder());
// Iterate over all safe point positions and record a pointer // Iterate over all safe point positions and record a pointer
// for all spilled live ranges at this point. // for all spilled live ranges at this point.
int last_range_start = 0; int last_range_start = 0;
auto pointer_maps = code()->pointer_maps(); auto reference_maps = code()->reference_maps();
PointerMapDeque::const_iterator first_it = pointer_maps->begin(); ReferenceMapDeque::const_iterator first_it = reference_maps->begin();
for (LiveRange* range : live_ranges()) { for (LiveRange* range : live_ranges()) {
if (range == nullptr) continue; if (range == nullptr) continue;
// Iterate over the first parts of multi-part live ranges. // Iterate over the first parts of multi-part live ranges.
...@@ -1859,18 +1859,18 @@ void RegisterAllocator::PopulatePointerMaps() { ...@@ -1859,18 +1859,18 @@ void RegisterAllocator::PopulatePointerMaps() {
// Most of the ranges are in order, but not all. Keep an eye on when they // Most of the ranges are in order, but not all. Keep an eye on when they
// step backwards and reset the first_it so we don't miss any safe points. // step backwards and reset the first_it so we don't miss any safe points.
if (start < last_range_start) first_it = pointer_maps->begin(); if (start < last_range_start) first_it = reference_maps->begin();
last_range_start = start; last_range_start = start;
// Step across all the safe points that are before the start of this range, // Step across all the safe points that are before the start of this range,
// recording how far we step in order to save doing this for the next range. // recording how far we step in order to save doing this for the next range.
for (; first_it != pointer_maps->end(); ++first_it) { for (; first_it != reference_maps->end(); ++first_it) {
auto map = *first_it; auto map = *first_it;
if (map->instruction_position() >= start) break; if (map->instruction_position() >= start) break;
} }
// Step through the safe points to see whether they are in the range. // Step through the safe points to see whether they are in the range.
for (auto it = first_it; it != pointer_maps->end(); ++it) { for (auto it = first_it; it != reference_maps->end(); ++it) {
auto map = *it; auto map = *it;
int safe_point = map->instruction_position(); int safe_point = map->instruction_position();
...@@ -1894,7 +1894,7 @@ void RegisterAllocator::PopulatePointerMaps() { ...@@ -1894,7 +1894,7 @@ void RegisterAllocator::PopulatePointerMaps() {
!range->GetSpillOperand()->IsConstant()) { !range->GetSpillOperand()->IsConstant()) {
TRACE("Pointer for range %d (spilled at %d) at safe point %d\n", TRACE("Pointer for range %d (spilled at %d) at safe point %d\n",
range->id(), range->spill_start_index(), safe_point); range->id(), range->spill_start_index(), safe_point);
map->RecordPointer(range->GetSpillOperand(), code_zone()); map->RecordReference(*range->GetSpillOperand());
} }
if (!cur->IsSpilled()) { if (!cur->IsSpilled()) {
...@@ -1902,9 +1902,9 @@ void RegisterAllocator::PopulatePointerMaps() { ...@@ -1902,9 +1902,9 @@ void RegisterAllocator::PopulatePointerMaps() {
"Pointer in register for range %d (start at %d) " "Pointer in register for range %d (start at %d) "
"at safe point %d\n", "at safe point %d\n",
cur->id(), cur->Start().Value(), safe_point); cur->id(), cur->Start().Value(), safe_point);
InstructionOperand* operand = cur->GetAssignedOperand(operand_cache()); auto operand = cur->GetAssignedOperand();
DCHECK(!operand->IsStackSlot()); DCHECK(!operand.IsStackSlot());
map->RecordPointer(operand, code_zone()); map->RecordReference(operand);
} }
} }
} }
......
...@@ -480,7 +480,7 @@ class RegisterAllocator FINAL : public ZoneObject { ...@@ -480,7 +480,7 @@ class RegisterAllocator FINAL : public ZoneObject {
void CommitAssignment(); void CommitAssignment();
// Phase 7: compute values for pointer maps. // Phase 7: compute values for pointer maps.
void PopulatePointerMaps(); // TODO(titzer): rename to PopulateReferenceMaps. void PopulateReferenceMaps();
// Phase 8: reconnect split ranges with moves. // Phase 8: reconnect split ranges with moves.
void ConnectRanges(); void ConnectRanges();
......
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