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

Unified Diff: src/hydrogen-instructions.cc

Issue 556563005: Fix Smi vs. HeapObject confusion in HConstants. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | « src/hydrogen-instructions.h ('k') | src/hydrogen-types.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index 8539da21e8e3e86e6042a8f65ece245b8496b8aa..a057217cc514f091ea9f71f2a0a17474cb56b0a5 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -2815,6 +2815,13 @@ void HConstant::Initialize(Representation r) {
r = Representation::Tagged();
}
}
+ if (r.IsSmi()) {
+ // If we have an existing handle, zap it, because it might be a heap
+ // number which we must not re-use when copying this HConstant to
+ // Tagged representation later, because having Smi representation now
+ // could cause heap object checks not to get emitted.
+ object_ = Unique<Object>(Handle<Object>::null());
+ }
set_representation(r);
SetFlag(kUseGVN);
}
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/hydrogen-types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698