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

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

Issue 658543002: Better typing and type verification (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 6 years, 2 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/node-properties.h ('k') | src/compiler/pipeline.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/node-properties-inl.h
diff --git a/src/compiler/node-properties-inl.h b/src/compiler/node-properties-inl.h
index 3f6d53105b1018e2a322f17c822f744c0df56497..78baf4d142bb96e1542739f530319769624d7b57 100644
--- a/src/compiler/node-properties-inl.h
+++ b/src/compiler/node-properties-inl.h
@@ -198,12 +198,30 @@ 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) {
+ DCHECK(b.lower != NULL && b.upper != NULL);
node->set_bounds(b);
}
+inline bool NodeProperties::AllValueInputsAreTyped(Node* node) {
+ int input_count = OperatorProperties::GetValueInputCount(node->op());
+ for (int i = 0; i < input_count; ++i) {
+ if (!IsTyped(GetValueInput(node, i))) return false;
+ }
+ return true;
+}
+
}
}
« no previous file with comments | « src/compiler/node-properties.h ('k') | src/compiler/pipeline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698