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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 296453013: Fix bug with optimized try-catch and unboxed values. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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 | « no previous file | tests/language/try_catch_optimized3_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.cc
===================================================================
--- runtime/vm/intermediate_language.cc (revision 36427)
+++ runtime/vm/intermediate_language.cc (working copy)
@@ -1634,8 +1634,20 @@
}
+static bool HasTryBlockUse(Value* use_list) {
+ for (Value::Iterator it(use_list); !it.Done(); it.Advance()) {
+ Value* use = it.Current();
+ if (use->instruction()->MayThrow() &&
+ use->instruction()->GetBlock()->InsideTryBlock()) {
+ return true;
+ }
+ }
+ return false;
+}
+
+
Definition* BoxDoubleInstr::Canonicalize(FlowGraph* flow_graph) {
- if (input_use_list() == NULL) {
+ if ((input_use_list() == NULL) && !HasTryBlockUse(env_use_list())) {
// Environments can accomodate any representation. No need to box.
return value()->definition();
}
@@ -1670,7 +1682,7 @@
Definition* BoxFloat32x4Instr::Canonicalize(FlowGraph* flow_graph) {
- if (input_use_list() == NULL) {
+ if ((input_use_list() == NULL) && !HasTryBlockUse(env_use_list())) {
// Environments can accomodate any representation. No need to box.
return value()->definition();
}
@@ -1693,7 +1705,7 @@
Definition* BoxFloat64x2Instr::Canonicalize(FlowGraph* flow_graph) {
- if (input_use_list() == NULL) {
+ if ((input_use_list() == NULL) && !HasTryBlockUse(env_use_list())) {
// Environments can accomodate any representation. No need to box.
return value()->definition();
}
@@ -1717,7 +1729,7 @@
Definition* BoxInt32x4Instr::Canonicalize(FlowGraph* flow_graph) {
- if (input_use_list() == NULL) {
+ if ((input_use_list() == NULL) && !HasTryBlockUse(env_use_list())) {
// Environments can accomodate any representation. No need to box.
return value()->definition();
}
« no previous file with comments | « no previous file | tests/language/try_catch_optimized3_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698