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

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

Issue 1895013003: [turbofan] Fixes to validator (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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 | « no previous file | src/compiler/register-allocator-verifier.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/register-allocator-verifier.h
diff --git a/src/compiler/register-allocator-verifier.h b/src/compiler/register-allocator-verifier.h
index 18d38c58a1511af434eeaf290c9d69a8a083f282..251840658ce97781c08e4f222fa8829e37aa7ff4 100644
--- a/src/compiler/register-allocator-verifier.h
+++ b/src/compiler/register-allocator-verifier.h
@@ -62,25 +62,6 @@ class Assessment : public ZoneObject {
DISALLOW_COPY_AND_ASSIGN(Assessment);
};
-// FinalAssessmens are associated to operands that we know to be a certain
-// virtual register.
-class FinalAssessment final : public Assessment {
- public:
- explicit FinalAssessment(int virtual_register)
- : Assessment(Final), virtual_register_(virtual_register) {}
-
- int virtual_register() const { return virtual_register_; }
- static const FinalAssessment* cast(const Assessment* assessment) {
- CHECK(assessment->kind() == Final);
- return static_cast<const FinalAssessment*>(assessment);
- }
-
- private:
- int virtual_register_;
-
- DISALLOW_COPY_AND_ASSIGN(FinalAssessment);
-};
-
// PendingAssessments are associated to operands coming from the multiple
// predecessors of a block. We only record the operand and the block, and
// will determine if the way the operand is defined (from the predecessors)
@@ -108,6 +89,33 @@ class PendingAssessment final : public Assessment {
DISALLOW_COPY_AND_ASSIGN(PendingAssessment);
};
+// FinalAssessmens are associated to operands that we know to be a certain
+// virtual register.
+class FinalAssessment final : public Assessment {
+ public:
+ explicit FinalAssessment(int virtual_register,
+ const PendingAssessment* original_pending = nullptr)
+ : Assessment(Final),
+ virtual_register_(virtual_register),
+ original_pending_assessment_(original_pending) {}
+
+ int virtual_register() const { return virtual_register_; }
+ static const FinalAssessment* cast(const Assessment* assessment) {
+ CHECK(assessment->kind() == Final);
+ return static_cast<const FinalAssessment*>(assessment);
+ }
+
+ const PendingAssessment* original_pending_assessment() const {
+ return original_pending_assessment_;
+ }
+
+ private:
+ int virtual_register_;
+ const PendingAssessment* original_pending_assessment_;
+
+ DISALLOW_COPY_AND_ASSIGN(FinalAssessment);
+};
+
struct OperandAsKeyLess {
bool operator()(const InstructionOperand& a,
const InstructionOperand& b) const {
@@ -231,8 +239,13 @@ class RegisterAllocatorVerifier final : public ZoneObject {
BlockAssessments* CreateForBlock(const InstructionBlock* block);
void ValidatePendingAssessment(RpoNumber block_id, InstructionOperand op,
- PendingAssessment* assessment,
+ BlockAssessments* current_assessments,
+ const PendingAssessment* assessment,
int virtual_register);
+ void ValidateFinalAssessment(RpoNumber block_id, InstructionOperand op,
+ BlockAssessments* current_assessments,
+ const FinalAssessment* assessment,
+ int virtual_register);
void ValidateUse(RpoNumber block_id, BlockAssessments* current_assessments,
InstructionOperand op, int virtual_register);
@@ -243,11 +256,6 @@ class RegisterAllocatorVerifier final : public ZoneObject {
ZoneMap<RpoNumber, BlockAssessments*> assessments_;
ZoneMap<RpoNumber, DelayedAssessments*> outstanding_assessments_;
- // Cached structures, to avoid memory churn. Needed solely in
- // ValidatePendingAssessment.
- ZoneQueue<std::pair<PendingAssessment*, int>> worklist_;
- ZoneSet<RpoNumber> seen_;
-
DISALLOW_COPY_AND_ASSIGN(RegisterAllocatorVerifier);
};
« no previous file with comments | « no previous file | src/compiler/register-allocator-verifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698