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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 10909200: Fix issues 5137: instance of test on constant value should return true or false, not the value itse… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 | « runtime/vm/flow_graph_optimizer.h ('k') | tests/standalone/medium_integer_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_optimizer.cc
===================================================================
--- runtime/vm/flow_graph_optimizer.cc (revision 12311)
+++ runtime/vm/flow_graph_optimizer.cc (working copy)
@@ -1253,11 +1253,13 @@
// builder did already.
if (FLAG_eliminate_type_checks &&
instr->value()->BindsToConstant() &&
- !instr->value()->BindsToConstantNull() &&
- instr->value()->CompileTypeIsMoreSpecificThan(instr->type())) {
- Value* use = instr->value();
- Definition* result = use->definition();
- ASSERT(result != NULL);
+ !instr->value()->BindsToConstantNull()) {
+ const Bool& bool_result =
+ instr->value()->CompileTypeIsMoreSpecificThan(instr->type()) ?
+ Bool::ZoneHandle(Bool::True()) : Bool::ZoneHandle(Bool::False());
+ Definition* result = new ConstantInstr(bool_result);
+ result->set_ssa_temp_index(flow_graph_->alloc_ssa_temp_index());
+ result->InsertBefore(instr);
// Replace uses and remove the current instruction via the iterator.
instr->ReplaceUsesWith(result);
ASSERT(current_iterator()->Current() == instr);
« no previous file with comments | « runtime/vm/flow_graph_optimizer.h ('k') | tests/standalone/medium_integer_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698