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

Unified Diff: src/compiler/node-properties-inl.h

Issue 509343002: Better typing and type verification (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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
Index: src/compiler/node-properties-inl.h
diff --git a/src/compiler/node-properties-inl.h b/src/compiler/node-properties-inl.h
index bc52dfdb7519d6470a658e2729ab49ca7d32652c..72e031bb3b93e1b7f9cd33ea9f6ddd93dcd9d06b 100644
--- a/src/compiler/node-properties-inl.h
+++ b/src/compiler/node-properties-inl.h
@@ -192,7 +192,16 @@ inline void NodeProperties::ReplaceWithValue(Node* node, Node* value,
// -----------------------------------------------------------------------------
// Type Bounds.
-inline Bounds NodeProperties::GetBounds(Node* node) { return node->bounds(); }
+inline bool NodeProperties::IsTyped(Node* node) {
+ Bounds bounds = node->bounds();
+ DCHECK((bounds.lower == NULL) == (bounds.upper == NULL));
+ return bounds.upper != NULL;
+}
+
+inline Bounds NodeProperties::GetBounds(Node* node) {
+ DCHECK(IsTyped(node));
+ return node->bounds();
+}
inline void NodeProperties::SetBounds(Node* node, Bounds b) {
node->set_bounds(b);

Powered by Google App Engine
This is Rietveld 408576698