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

Unified Diff: src/hydrogen.cc

Issue 6880276: Use type info for count operation in Crankshaft. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Switch back to generating Integer32 code for tagged case, instead of bailing out of compilation. Created 9 years, 8 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.h ('k') | src/type-info.h » ('j') | 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 27b8a2629307be9b036bb4bc7020336ae3873226..ef7e363658ca7692ad7bec6fb731166f56eda086 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -4653,12 +4653,18 @@ void HGraphBuilder::VisitUnaryOperation(UnaryOperation* expr) {
}
-HInstruction* HGraphBuilder::BuildIncrement(HValue* value, bool increment) {
+HInstruction* HGraphBuilder::BuildIncrement(HValue* value,
+ bool increment,
+ CountOperation* expr) {
HConstant* delta = increment
? graph_->GetConstant1()
: graph_->GetConstantMinus1();
HInstruction* instr = new(zone()) HAdd(value, delta);
- AssumeRepresentation(instr, Representation::Integer32());
+ Representation rep = ToRepresentation(oracle()->IncrementType(expr));
+ if (rep.IsTagged()) {
+ rep = Representation::Integer32();
+ }
+ AssumeRepresentation(instr, rep);
return instr;
}
@@ -4681,7 +4687,7 @@ void HGraphBuilder::VisitCountOperation(CountOperation* expr) {
// element for postfix operations in a non-effect context.
bool has_extra = expr->is_postfix() && !ast_context()->IsEffect();
HValue* before = has_extra ? Top() : Pop();
- HInstruction* after = BuildIncrement(before, inc);
+ HInstruction* after = BuildIncrement(before, inc, expr);
AddInstruction(after);
Push(after);
@@ -4733,7 +4739,7 @@ void HGraphBuilder::VisitCountOperation(CountOperation* expr) {
HValue* before = Pop();
// There is no deoptimization to after the increment, so we don't need
// to simulate the expression stack after this instruction.
- HInstruction* after = BuildIncrement(before, inc);
+ HInstruction* after = BuildIncrement(before, inc, expr);
AddInstruction(after);
HInstruction* store = BuildStoreNamed(obj, after, prop);
@@ -4769,7 +4775,7 @@ void HGraphBuilder::VisitCountOperation(CountOperation* expr) {
HValue* before = Pop();
// There is no deoptimization to after the increment, so we don't need
// to simulate the expression stack after this instruction.
- HInstruction* after = BuildIncrement(before, inc);
+ HInstruction* after = BuildIncrement(before, inc, expr);
AddInstruction(after);
expr->RecordTypeFeedback(oracle());
« no previous file with comments | « src/hydrogen.h ('k') | src/type-info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698