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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 798933002: When canonicalizing UnboxInt32([tr], BoxInt64()) make sure to mark resulting converter truncating. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.cc
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index a4d70faf9b5a513af6b9a315108e3234a4cefd57..956797c49bf934dbaad44a68e0871532cf068a4b 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -1208,6 +1208,8 @@ bool UnboxInt32Instr::CanDeoptimize() const {
return !is_truncating() &&
!RangeUtils::Fits(value()->definition()->range(),
RangeBoundary::kRangeBoundaryInt32);
+ } else if (is_truncating() && value()->definition()->IsBoxInteger()) {
+ return false;
} else if ((kSmiBits < 32) && value()->Type()->IsInt()) {
// Note: we don't support truncation of Bigint values.
return !RangeUtils::Fits(value()->definition()->range(),
@@ -2063,7 +2065,7 @@ Definition* UnboxIntegerInstr::Canonicalize(FlowGraph* flow_graph) {
box_defn->value()->CopyWithType(),
(representation() == kUnboxedInt32) ?
GetDeoptId() : Isolate::kNoDeoptId);
- if ((representation() == kUnboxedInt32) && !CanDeoptimize()) {
+ if ((representation() == kUnboxedInt32) && is_truncating()) {
converter->mark_truncating();
}
flow_graph->InsertBefore(this, converter, env(), FlowGraph::kValue);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698