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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 22819005: Make Null a public class of dart:core. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: type cast, extends/implements prohibition Created 7 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: runtime/vm/flow_graph_builder.cc
diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc
index f9c395cd0c2c224f935a90ec88a342ab2295b797..a5989efb5348360303b56731422a4ca8f7ef8dc5 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -1173,27 +1173,18 @@ void ValueGraphVisitor::BuildTypeTest(ComparisonNode* node) {
node->left()->IsLiteralNode() &&
type.IsInstantiated()) {
const Instance& literal_value = node->left()->AsLiteralNode()->literal();
- const Class& cls = Class::Handle(literal_value.clazz());
ConstantInstr* result = NULL;
- if (cls.IsNullClass()) {
- // A null object is only an instance of Object and dynamic, which has
- // already been checked above (if the type is instantiated). So we can
- // return false here if the instance is null (and if the type is
- // instantiated).
- result = new ConstantInstr(negate_result ? Bool::True() : Bool::False());
+ Error& malformed_error = Error::Handle();
+ if (literal_value.IsInstanceOf(type,
+ TypeArguments::Handle(),
+ &malformed_error)) {
+ result = new ConstantInstr(negate_result ?
+ Bool::False() : Bool::True());
} else {
- Error& malformed_error = Error::Handle();
- if (literal_value.IsInstanceOf(type,
- TypeArguments::Handle(),
- &malformed_error)) {
- result = new ConstantInstr(negate_result ?
- Bool::False() : Bool::True());
- } else {
- result = new ConstantInstr(negate_result ?
- Bool::True() : Bool::False());
- }
- ASSERT(malformed_error.IsNull());
+ result = new ConstantInstr(negate_result ?
+ Bool::True() : Bool::False());
}
+ ASSERT(malformed_error.IsNull());
ReturnDefinition(result);
return;
}

Powered by Google App Engine
This is Rietveld 408576698