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

Unified Diff: src/hydrogen.cc

Issue 9749004: Propagate representation: anything*double => double; -double => double (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 9 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 | no next file » | no next file with comments »
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 358256cbf2f4fc2ddd6253a910d55013f0eb305b..3cd1036c0ebe4c96059ef8d9610db12b7442dbb9 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -6190,6 +6190,9 @@ void HGraphBuilder::VisitSub(UnaryOperation* expr) {
info = TypeInfo::Unknown();
}
Representation rep = ToRepresentation(info);
+ if (value->representation().IsDouble()) {
+ rep = Representation::Double();
+ }
TraceRepresentation(expr->op(), info, instr, rep);
instr->AssumeRepresentation(rep);
return ast_context()->ReturnInstruction(instr, expr->id());
@@ -6522,6 +6525,11 @@ HInstruction* HGraphBuilder::BuildBinaryOperation(BinaryOperation* expr,
if (instr->IsBitwiseBinaryOperation() && rep.IsDouble()) {
rep = Representation::Integer32();
}
+ if (expr->op() == Token::MUL &&
+ (left->representation().IsDouble() ||
+ right->representation().IsDouble())) {
+ rep = Representation::Double();
+ }
TraceRepresentation(expr->op(), info, instr, rep);
instr->AssumeRepresentation(rep);
return instr;
« 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