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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 6172 matching lines...) Expand 10 before | Expand all | Expand 10 after
6183 HValue* context = environment()->LookupContext(); 6183 HValue* context = environment()->LookupContext();
6184 HInstruction* instr = 6184 HInstruction* instr =
6185 new(zone()) HMul(context, value, graph_->GetConstantMinus1()); 6185 new(zone()) HMul(context, value, graph_->GetConstantMinus1());
6186 TypeInfo info = oracle()->UnaryType(expr); 6186 TypeInfo info = oracle()->UnaryType(expr);
6187 if (info.IsUninitialized()) { 6187 if (info.IsUninitialized()) {
6188 AddInstruction(new(zone()) HSoftDeoptimize); 6188 AddInstruction(new(zone()) HSoftDeoptimize);
6189 current_block()->MarkAsDeoptimizing(); 6189 current_block()->MarkAsDeoptimizing();
6190 info = TypeInfo::Unknown(); 6190 info = TypeInfo::Unknown();
6191 } 6191 }
6192 Representation rep = ToRepresentation(info); 6192 Representation rep = ToRepresentation(info);
6193 if (value->representation().IsDouble()) {
6194 rep = Representation::Double();
6195 }
6193 TraceRepresentation(expr->op(), info, instr, rep); 6196 TraceRepresentation(expr->op(), info, instr, rep);
6194 instr->AssumeRepresentation(rep); 6197 instr->AssumeRepresentation(rep);
6195 return ast_context()->ReturnInstruction(instr, expr->id()); 6198 return ast_context()->ReturnInstruction(instr, expr->id());
6196 } 6199 }
6197 6200
6198 6201
6199 void HGraphBuilder::VisitBitNot(UnaryOperation* expr) { 6202 void HGraphBuilder::VisitBitNot(UnaryOperation* expr) {
6200 CHECK_ALIVE(VisitForValue(expr->expression())); 6203 CHECK_ALIVE(VisitForValue(expr->expression()));
6201 HValue* value = Pop(); 6204 HValue* value = Pop();
6202 TypeInfo info = oracle()->UnaryType(expr); 6205 TypeInfo info = oracle()->UnaryType(expr);
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
6515 if (info.IsSmi() && 6518 if (info.IsSmi() &&
6516 ((left->IsConstant() && HConstant::cast(left)->HasStringValue()) || 6519 ((left->IsConstant() && HConstant::cast(left)->HasStringValue()) ||
6517 (right->IsConstant() && HConstant::cast(right)->HasStringValue()))) { 6520 (right->IsConstant() && HConstant::cast(right)->HasStringValue()))) {
6518 return instr; 6521 return instr;
6519 } 6522 }
6520 Representation rep = ToRepresentation(info); 6523 Representation rep = ToRepresentation(info);
6521 // We only generate either int32 or generic tagged bitwise operations. 6524 // We only generate either int32 or generic tagged bitwise operations.
6522 if (instr->IsBitwiseBinaryOperation() && rep.IsDouble()) { 6525 if (instr->IsBitwiseBinaryOperation() && rep.IsDouble()) {
6523 rep = Representation::Integer32(); 6526 rep = Representation::Integer32();
6524 } 6527 }
6528 if (expr->op() == Token::MUL &&
6529 (left->representation().IsDouble() ||
6530 right->representation().IsDouble())) {
6531 rep = Representation::Double();
6532 }
6525 TraceRepresentation(expr->op(), info, instr, rep); 6533 TraceRepresentation(expr->op(), info, instr, rep);
6526 instr->AssumeRepresentation(rep); 6534 instr->AssumeRepresentation(rep);
6527 return instr; 6535 return instr;
6528 } 6536 }
6529 6537
6530 6538
6531 // Check for the form (%_ClassOf(foo) === 'BarClass'). 6539 // Check for the form (%_ClassOf(foo) === 'BarClass').
6532 static bool IsClassOfTest(CompareOperation* expr) { 6540 static bool IsClassOfTest(CompareOperation* expr) {
6533 if (expr->op() != Token::EQ_STRICT) return false; 6541 if (expr->op() != Token::EQ_STRICT) return false;
6534 CallRuntime* call = expr->left()->AsCallRuntime(); 6542 CallRuntime* call = expr->left()->AsCallRuntime();
(...skipping 1630 matching lines...) Expand 10 before | Expand all | Expand 10 after
8165 } 8173 }
8166 } 8174 }
8167 8175
8168 #ifdef DEBUG 8176 #ifdef DEBUG
8169 if (graph_ != NULL) graph_->Verify(false); // No full verify. 8177 if (graph_ != NULL) graph_->Verify(false); // No full verify.
8170 if (allocator_ != NULL) allocator_->Verify(); 8178 if (allocator_ != NULL) allocator_->Verify();
8171 #endif 8179 #endif
8172 } 8180 }
8173 8181
8174 } } // namespace v8::internal 8182 } } // namespace v8::internal
OLDNEW
« 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