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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/compiler/node-properties.h ('k') | src/compiler/pipeline.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_COMPILER_NODE_PROPERTIES_INL_H_ 5 #ifndef V8_COMPILER_NODE_PROPERTIES_INL_H_
6 #define V8_COMPILER_NODE_PROPERTIES_INL_H_ 6 #define V8_COMPILER_NODE_PROPERTIES_INL_H_
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/compiler/common-operator.h" 10 #include "src/compiler/common-operator.h"
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 } else { 191 } else {
192 iter = iter.UpdateToAndIncrement(value); 192 iter = iter.UpdateToAndIncrement(value);
193 } 193 }
194 } 194 }
195 } 195 }
196 196
197 197
198 // ----------------------------------------------------------------------------- 198 // -----------------------------------------------------------------------------
199 // Type Bounds. 199 // Type Bounds.
200 200
201 inline Bounds NodeProperties::GetBounds(Node* node) { return node->bounds(); } 201 inline bool NodeProperties::IsTyped(Node* node) {
202 Bounds bounds = node->bounds();
203 DCHECK((bounds.lower == NULL) == (bounds.upper == NULL));
204 return bounds.upper != NULL;
205 }
206
207 inline Bounds NodeProperties::GetBounds(Node* node) {
208 DCHECK(IsTyped(node));
209 return node->bounds();
210 }
202 211
203 inline void NodeProperties::SetBounds(Node* node, Bounds b) { 212 inline void NodeProperties::SetBounds(Node* node, Bounds b) {
213 DCHECK(b.lower != NULL && b.upper != NULL);
204 node->set_bounds(b); 214 node->set_bounds(b);
205 } 215 }
206 216
217 inline bool NodeProperties::AllValueInputsAreTyped(Node* node) {
218 int input_count = OperatorProperties::GetValueInputCount(node->op());
219 for (int i = 0; i < input_count; ++i) {
220 if (!IsTyped(GetValueInput(node, i))) return false;
221 }
222 return true;
223 }
224
207 225
208 } 226 }
209 } 227 }
210 } // namespace v8::internal::compiler 228 } // namespace v8::internal::compiler
211 229
212 #endif // V8_COMPILER_NODE_PROPERTIES_INL_H_ 230 #endif // V8_COMPILER_NODE_PROPERTIES_INL_H_
OLDNEW
« 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