Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Unified Diff: src/compiler/register-allocator.cc

Issue 1081053002: [turbofan] cleanup PointerMap (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: renames Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/register-allocator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/register-allocator.cc
diff --git a/src/compiler/register-allocator.cc b/src/compiler/register-allocator.cc
index f3875f7ffc7f07f2b5cad13b56bef5d0a7f68a47..e58082726291dfae133e7b8d5e011dfc6c4c5c46 100644
--- a/src/compiler/register-allocator.cc
+++ b/src/compiler/register-allocator.cc
@@ -722,8 +722,8 @@ InstructionOperand* RegisterAllocator::AllocateFixed(
if (is_tagged) {
TRACE("Fixed reg is tagged at %d\n", pos);
auto instr = InstructionAt(pos);
- if (instr->HasPointerMap()) {
- instr->pointer_map()->RecordPointer(operand, code_zone());
+ if (instr->HasReferenceMap()) {
+ instr->reference_map()->RecordReference(*operand);
}
}
return operand;
@@ -1226,8 +1226,8 @@ void RegisterAllocator::MeetConstraintsBefore(int instr_index) {
cur_input->set_virtual_register(second_output->virtual_register());
AddGapMove(instr_index, Instruction::END, input_copy, cur_input);
if (HasTaggedValue(input_vreg) && !HasTaggedValue(output_vreg)) {
- if (second->HasPointerMap()) {
- second->pointer_map()->RecordPointer(input_copy, code_zone());
+ if (second->HasReferenceMap()) {
+ second->reference_map()->RecordReference(*input_copy);
}
} else if (!HasTaggedValue(input_vreg) && HasTaggedValue(output_vreg)) {
// The input is assumed to immediately have a tagged representation,
@@ -1411,8 +1411,8 @@ void RegisterAllocator::ResolvePhis(const InstructionBlock* block) {
code()->InstructionBlockAt(block->predecessors()[i]);
AddGapMove(cur_block->last_instruction_index(), Instruction::END,
&phi->inputs()[i], &output);
- DCHECK(
- !InstructionAt(cur_block->last_instruction_index())->HasPointerMap());
+ DCHECK(!InstructionAt(cur_block->last_instruction_index())
+ ->HasReferenceMap());
}
auto live_range = LiveRangeFor(phi_vreg);
int gap_index = block->first_instruction_index();
@@ -1700,7 +1700,7 @@ void RegisterAllocator::ResolveControlFlow(const InstructionBlock* block,
position = Instruction::START;
} else {
DCHECK(pred->SuccessorCount() == 1);
- DCHECK(!InstructionAt(pred->last_instruction_index())->HasPointerMap());
+ DCHECK(!InstructionAt(pred->last_instruction_index())->HasReferenceMap());
gap_index = pred->last_instruction_index();
position = Instruction::END;
}
@@ -1822,7 +1822,7 @@ bool RegisterAllocator::ExistsUseWithoutDefinition() {
bool RegisterAllocator::SafePointsAreInOrder() const {
int safe_point = 0;
- for (auto map : *code()->pointer_maps()) {
+ for (auto map : *code()->reference_maps()) {
if (safe_point > map->instruction_position()) return false;
safe_point = map->instruction_position();
}
@@ -1830,14 +1830,14 @@ bool RegisterAllocator::SafePointsAreInOrder() const {
}
-void RegisterAllocator::PopulatePointerMaps() {
+void RegisterAllocator::PopulateReferenceMaps() {
DCHECK(SafePointsAreInOrder());
// Iterate over all safe point positions and record a pointer
// for all spilled live ranges at this point.
int last_range_start = 0;
- auto pointer_maps = code()->pointer_maps();
- PointerMapDeque::const_iterator first_it = pointer_maps->begin();
+ auto reference_maps = code()->reference_maps();
+ ReferenceMapDeque::const_iterator first_it = reference_maps->begin();
for (LiveRange* range : live_ranges()) {
if (range == nullptr) continue;
// Iterate over the first parts of multi-part live ranges.
@@ -1859,18 +1859,18 @@ void RegisterAllocator::PopulatePointerMaps() {
// 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.
- if (start < last_range_start) first_it = pointer_maps->begin();
+ if (start < last_range_start) first_it = reference_maps->begin();
last_range_start = start;
// 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.
- for (; first_it != pointer_maps->end(); ++first_it) {
+ for (; first_it != reference_maps->end(); ++first_it) {
auto map = *first_it;
if (map->instruction_position() >= start) break;
}
// 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;
int safe_point = map->instruction_position();
@@ -1894,7 +1894,7 @@ void RegisterAllocator::PopulatePointerMaps() {
!range->GetSpillOperand()->IsConstant()) {
TRACE("Pointer for range %d (spilled at %d) at safe point %d\n",
range->id(), range->spill_start_index(), safe_point);
- map->RecordPointer(range->GetSpillOperand(), code_zone());
+ map->RecordReference(*range->GetSpillOperand());
}
if (!cur->IsSpilled()) {
@@ -1902,9 +1902,9 @@ void RegisterAllocator::PopulatePointerMaps() {
"Pointer in register for range %d (start at %d) "
"at safe point %d\n",
cur->id(), cur->Start().Value(), safe_point);
- InstructionOperand* operand = cur->GetAssignedOperand(operand_cache());
- DCHECK(!operand->IsStackSlot());
- map->RecordPointer(operand, code_zone());
+ auto operand = cur->GetAssignedOperand();
+ DCHECK(!operand.IsStackSlot());
+ map->RecordReference(operand);
}
}
}
« no previous file with comments | « src/compiler/register-allocator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698