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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 23480005: Change Bool::Get to return a handle instead of a pointer to a raw object. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 fe49cd9e2f5d7e5ad16e26647eb0abf65e30d58d..3a33d40f8165c95042250b31ea513ed091479d1a 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -1213,8 +1213,7 @@ void ValueGraphVisitor::BuildTypeTest(ComparisonNode* node) {
EffectGraphVisitor for_left_value(owner(), temp_index());
node->left()->Visit(&for_left_value);
Append(for_left_value);
- ReturnDefinition(new ConstantInstr(negate_result ?
- Bool::False() : Bool::True()));
+ ReturnDefinition(new ConstantInstr(Bool::Get(!negate_result)));
return;
}
@@ -1229,11 +1228,9 @@ void ValueGraphVisitor::BuildTypeTest(ComparisonNode* node) {
if (literal_value.IsInstanceOf(type,
TypeArguments::Handle(),
&malformed_error)) {
- result = new ConstantInstr(negate_result ?
- Bool::False() : Bool::True());
+ result = new ConstantInstr(Bool::Get(!negate_result));
} else {
- result = new ConstantInstr(negate_result ?
- Bool::True() : Bool::False());
+ result = new ConstantInstr(Bool::Get(negate_result));
}
ASSERT(malformed_error.IsNull());
@@ -1264,8 +1261,7 @@ void ValueGraphVisitor::BuildTypeTest(ComparisonNode* node) {
Value* type_arg = Bind(
new ConstantInstr(node->right()->AsTypeNode()->type()));
arguments->Add(PushArgument(type_arg));
- const Bool& negate = (node->kind() == Token::kISNOT) ? Bool::True() :
- Bool::False();
+ const Bool& negate = Bool::Get(node->kind() == Token::kISNOT);
Value* negate_arg = Bind(new ConstantInstr(negate));
arguments->Add(PushArgument(negate_arg));
const intptr_t kNumArgsChecked = 1;

Powered by Google App Engine
This is Rietveld 408576698