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

Unified Diff: src/hydrogen-instructions.h

Issue 234583005: Make sure that ranges are not accessed after range analysis. Remove HValue::PrintRangeTo. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased Created 6 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/hydrogen-instructions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index e558ac7ce262bba6a557fd36c4eda32c75eb7b6b..26501d07fbcde78e5afdbd83bff24dec6fa975b8 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -684,6 +684,9 @@ class HValue : public ZoneObject {
type_(type),
use_list_(NULL),
range_(NULL),
+#ifdef DEBUG
+ range_poisoned_(false),
+#endif
flags_(0) {}
virtual ~HValue() {}
@@ -854,9 +857,17 @@ class HValue : public ZoneObject {
return result;
}
- Range* range() const { return range_; }
- // TODO(svenpanne) We should really use the null object pattern here.
- bool HasRange() const { return range_ != NULL; }
+ Range* range() const {
+ ASSERT(!range_poisoned_);
+ return range_;
+ }
+ bool HasRange() const {
+ ASSERT(!range_poisoned_);
+ return range_ != NULL;
+ }
+#ifdef DEBUG
+ void PoisonRange() { range_poisoned_ = true; }
+#endif
void AddNewRange(Range* r, Zone* zone);
void RemoveLastAddedRange();
void ComputeInitialRange(Zone* zone);
@@ -888,7 +899,6 @@ class HValue : public ZoneObject {
virtual void PrintTo(StringStream* stream) = 0;
void PrintNameTo(StringStream* stream);
void PrintTypeTo(StringStream* stream);
- void PrintRangeTo(StringStream* stream);
void PrintChangesTo(StringStream* stream);
const char* Mnemonic() const;
@@ -1028,6 +1038,9 @@ class HValue : public ZoneObject {
HType type_;
HUseListNode* use_list_;
Range* range_;
+#ifdef DEBUG
+ bool range_poisoned_;
+#endif
int flags_;
GVNFlagSet changes_flags_;
GVNFlagSet depends_on_flags_;
« no previous file with comments | « no previous file | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698