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

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

Issue 803493002: revert r25736 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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/pipeline.cc ('k') | src/compiler/register-allocator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/register-allocator.h
diff --git a/src/compiler/register-allocator.h b/src/compiler/register-allocator.h
index 19cac29326bbeebfb4d621fe98fd2bd9d32d8bab..2440f35a6027a2a2d5d1b16a7898e7bf47445945 100644
--- a/src/compiler/register-allocator.h
+++ b/src/compiler/register-allocator.h
@@ -197,7 +197,7 @@ class LiveRange FINAL : public ZoneObject {
int assigned_register() const { return assigned_register_; }
int spill_start_index() const { return spill_start_index_; }
void set_assigned_register(int reg, Zone* zone);
- void MakeSpilled();
+ void MakeSpilled(Zone* zone);
bool is_phi() const { return is_phi_; }
void set_is_phi(bool is_phi) { is_phi_ = is_phi; }
bool is_non_loop_phi() const { return is_non_loop_phi_; }
@@ -260,27 +260,13 @@ class LiveRange FINAL : public ZoneObject {
return last_interval_->end();
}
- enum class SpillType { kNoSpillType, kSpillOperand, kSpillRange };
- SpillType spill_type() const { return spill_type_; }
- InstructionOperand* GetSpillOperand() const {
- return spill_type_ == SpillType::kSpillOperand ? spill_operand_ : nullptr;
- }
- SpillRange* GetSpillRange() const {
- return spill_type_ == SpillType::kSpillRange ? spill_range_ : nullptr;
- }
- bool HasNoSpillType() const { return spill_type_ == SpillType::kNoSpillType; }
- bool HasSpillOperand() const {
- return spill_type_ == SpillType::kSpillOperand;
- }
- bool HasSpillRange() const { return spill_type_ == SpillType::kSpillRange; }
-
- void SpillAtDefinition(Zone* zone, int gap_index,
- InstructionOperand* operand);
+ bool HasAllocatedSpillOperand() const;
+ InstructionOperand* GetSpillOperand() const { return spill_operand_; }
void SetSpillOperand(InstructionOperand* operand);
- void SetSpillRange(SpillRange* spill_range);
+
+ void SetSpillRange(SpillRange* spill_range) { spill_range_ = spill_range; }
+ SpillRange* GetSpillRange() const { return spill_range_; }
void CommitSpillOperand(InstructionOperand* operand);
- void CommitSpillsAtDefinition(InstructionSequence* sequence,
- InstructionOperand* operand);
void SetSpillStartIndex(int start) {
spill_start_index_ = Min(start, spill_start_index_);
@@ -307,14 +293,12 @@ class LiveRange FINAL : public ZoneObject {
#endif
private:
- struct SpillAtDefinitionList;
-
+ void ConvertOperands(Zone* zone);
void ConvertUsesToOperand(InstructionOperand* op);
UseInterval* FirstSearchIntervalForPosition(LifetimePosition position) const;
void AdvanceLastProcessedMarker(UseInterval* to_start_of,
LifetimePosition but_not_past) const;
- // TODO(dcarney): pack this structure better.
int id_;
bool spilled_;
bool is_phi_;
@@ -331,13 +315,9 @@ class LiveRange FINAL : public ZoneObject {
UsePosition* last_processed_use_;
// This is used as a cache, it's invalid outside of BuildLiveRanges.
InstructionOperand* current_hint_operand_;
+ InstructionOperand* spill_operand_;
int spill_start_index_;
- SpillType spill_type_;
- union {
- InstructionOperand* spill_operand_;
- SpillRange* spill_range_;
- };
- SpillAtDefinitionList* spills_at_definition_;
+ SpillRange* spill_range_;
friend class RegisterAllocator; // Assigns to kind_.
@@ -408,16 +388,13 @@ class RegisterAllocator FINAL : public ZoneObject {
// Phase 5: reassign spill splots for maximal reuse.
void ReuseSpillSlots();
- // Phase 6: commit assignment.
- void CommitAssignment();
-
- // Phase 7: compute values for pointer maps.
+ // Phase 6: compute values for pointer maps.
void PopulatePointerMaps(); // TODO(titzer): rename to PopulateReferenceMaps.
- // Phase 8: reconnect split ranges with moves.
+ // Phase 7: reconnect split ranges with moves.
void ConnectRanges();
- // Phase 9: insert moves to connect ranges across basic blocks.
+ // Phase 8: insert moves to connect ranges across basic blocks.
void ResolveControlFlow();
private:
« no previous file with comments | « src/compiler/pipeline.cc ('k') | src/compiler/register-allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698