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

Unified Diff: src/hydrogen.cc

Issue 23654041: Ensure constant truncation is only done when it is safe. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 | « no previous file | src/hydrogen-instructions.h » ('j') | src/hydrogen-instructions.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index bf51aa7f3a5aefd9ff345b53eb855563f1265b7e..ef5a4148204e7946d058193ca14a98cb2aba4481 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -7694,10 +7694,11 @@ bool CanBeZero(HValue* right) {
HValue* HGraphBuilder::TruncateToNumber(HValue* value, Handle<Type>* expected) {
if (value->IsConstant()) {
HConstant* constant = HConstant::cast(value);
- Maybe<HConstant*> number = constant->CopyToTruncatedNumber(zone());
+ Maybe<HConstant*> number =
+ constant->CopyToTruncatedNumberAndAdd(zone(), this);
if (number.has_value) {
*expected = handle(Type::Number(), isolate());
- return AddInstruction(number.value);
+ return number.value;
}
}
« no previous file with comments | « no previous file | src/hydrogen-instructions.h » ('j') | src/hydrogen-instructions.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698