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

Side by Side Diff: src/hydrogen.cc

Issue 7013025: Use type feedback for unary minus, improving the performance on e.g. 3d-cube by (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 7 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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 4612 matching lines...) Expand 10 before | Expand all | Expand 10 after
4623 HValue* value = Pop(); 4623 HValue* value = Pop();
4624 HInstruction* instr = new(zone()) HMul(value, graph_->GetConstant1()); 4624 HInstruction* instr = new(zone()) HMul(value, graph_->GetConstant1());
4625 ast_context()->ReturnInstruction(instr, expr->id()); 4625 ast_context()->ReturnInstruction(instr, expr->id());
4626 } 4626 }
4627 4627
4628 4628
4629 void HGraphBuilder::VisitSub(UnaryOperation* expr) { 4629 void HGraphBuilder::VisitSub(UnaryOperation* expr) {
4630 CHECK_ALIVE(VisitForValue(expr->expression())); 4630 CHECK_ALIVE(VisitForValue(expr->expression()));
4631 HValue* value = Pop(); 4631 HValue* value = Pop();
4632 HInstruction* instr = new(zone()) HMul(value, graph_->GetConstantMinus1()); 4632 HInstruction* instr = new(zone()) HMul(value, graph_->GetConstantMinus1());
4633 TypeInfo info = oracle()->UnaryType(expr);
4634 Representation rep = ToRepresentation(info);
4635 TraceRepresentation(expr->op(), info, instr, rep);
4636 AssumeRepresentation(instr, rep);
4633 ast_context()->ReturnInstruction(instr, expr->id()); 4637 ast_context()->ReturnInstruction(instr, expr->id());
4634 } 4638 }
4635 4639
4636 4640
4637 void HGraphBuilder::VisitBitNot(UnaryOperation* expr) { 4641 void HGraphBuilder::VisitBitNot(UnaryOperation* expr) {
4638 CHECK_ALIVE(VisitForValue(expr->expression())); 4642 CHECK_ALIVE(VisitForValue(expr->expression()));
4639 HValue* value = Pop(); 4643 HValue* value = Pop();
4640 HInstruction* instr = new(zone()) HBitNot(value); 4644 HInstruction* instr = new(zone()) HBitNot(value);
4641 ast_context()->ReturnInstruction(instr, expr->id()); 4645 ast_context()->ReturnInstruction(instr, expr->id());
4642 } 4646 }
(...skipping 1489 matching lines...) Expand 10 before | Expand all | Expand 10 after
6132 } 6136 }
6133 } 6137 }
6134 6138
6135 #ifdef DEBUG 6139 #ifdef DEBUG
6136 if (graph_ != NULL) graph_->Verify(); 6140 if (graph_ != NULL) graph_->Verify();
6137 if (allocator_ != NULL) allocator_->Verify(); 6141 if (allocator_ != NULL) allocator_->Verify();
6138 #endif 6142 #endif
6139 } 6143 }
6140 6144
6141 } } // namespace v8::internal 6145 } } // 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