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 16957005: Temporarily patch HCompareIDAndBranch to accept Smi. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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 9675 matching lines...) Expand 10 before | Expand all | Expand 10 after
9686 HValue* right = Pop(); 9686 HValue* right = Pop();
9687 HValue* left = Pop(); 9687 HValue* left = Pop();
9688 HInstruction* instr = BuildBinaryOperation(expr, left, right); 9688 HInstruction* instr = BuildBinaryOperation(expr, left, right);
9689 instr->set_position(expr->position()); 9689 instr->set_position(expr->position());
9690 return ast_context()->ReturnInstruction(instr, expr->id()); 9690 return ast_context()->ReturnInstruction(instr, expr->id());
9691 } 9691 }
9692 9692
9693 9693
9694 Representation HOptimizedGraphBuilder::ToRepresentation(TypeInfo info) { 9694 Representation HOptimizedGraphBuilder::ToRepresentation(TypeInfo info) {
9695 if (info.IsUninitialized()) return Representation::None(); 9695 if (info.IsUninitialized()) return Representation::None();
9696 // TODO(verwaest): Return Smi rather than Integer32.
9696 if (info.IsSmi()) return Representation::Integer32(); 9697 if (info.IsSmi()) return Representation::Integer32();
9697 if (info.IsInteger32()) return Representation::Integer32(); 9698 if (info.IsInteger32()) return Representation::Integer32();
9698 if (info.IsDouble()) return Representation::Double(); 9699 if (info.IsDouble()) return Representation::Double();
9699 if (info.IsNumber()) return Representation::Double(); 9700 if (info.IsNumber()) return Representation::Double();
9700 return Representation::Tagged(); 9701 return Representation::Tagged();
9701 } 9702 }
9702 9703
9703 9704
9704 void HOptimizedGraphBuilder::HandleLiteralCompareTypeof(CompareOperation* expr, 9705 void HOptimizedGraphBuilder::HandleLiteralCompareTypeof(CompareOperation* expr,
9705 HTypeof* typeof_expr, 9706 HTypeof* typeof_expr,
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
9911 return ast_context()->ReturnControl(result, expr->id()); 9912 return ast_context()->ReturnControl(result, expr->id());
9912 } else { 9913 } else {
9913 if (combined_rep.IsTagged() || combined_rep.IsNone()) { 9914 if (combined_rep.IsTagged() || combined_rep.IsNone()) {
9914 HCompareGeneric* result = 9915 HCompareGeneric* result =
9915 new(zone()) HCompareGeneric(context, left, right, op); 9916 new(zone()) HCompareGeneric(context, left, right, op);
9916 result->set_observed_input_representation(1, left_rep); 9917 result->set_observed_input_representation(1, left_rep);
9917 result->set_observed_input_representation(2, right_rep); 9918 result->set_observed_input_representation(2, right_rep);
9918 result->set_position(expr->position()); 9919 result->set_position(expr->position());
9919 return ast_context()->ReturnInstruction(result, expr->id()); 9920 return ast_context()->ReturnInstruction(result, expr->id());
9920 } else { 9921 } else {
9922 // TODO(verwaest): Remove once ToRepresentation properly returns Smi when
9923 // the IC measures Smi.
9924 if (left_rep.IsInteger32()) left_rep = Representation::Smi();
Jakob Kummerow 2013/06/13 13:34:41 I think it would be a bit cleaner to formulate the
9925 if (right_rep.IsInteger32()) right_rep = Representation::Smi();
9921 HCompareIDAndBranch* result = 9926 HCompareIDAndBranch* result =
9922 new(zone()) HCompareIDAndBranch(left, right, op); 9927 new(zone()) HCompareIDAndBranch(left, right, op);
9923 result->set_observed_input_representation(left_rep, right_rep); 9928 result->set_observed_input_representation(left_rep, right_rep);
9924 result->set_position(expr->position()); 9929 result->set_position(expr->position());
9925 return ast_context()->ReturnControl(result, expr->id()); 9930 return ast_context()->ReturnControl(result, expr->id());
9926 } 9931 }
9927 } 9932 }
9928 } 9933 }
9929 9934
9930 9935
(...skipping 1685 matching lines...) Expand 10 before | Expand all | Expand 10 after
11616 } 11621 }
11617 } 11622 }
11618 11623
11619 #ifdef DEBUG 11624 #ifdef DEBUG
11620 if (graph_ != NULL) graph_->Verify(false); // No full verify. 11625 if (graph_ != NULL) graph_->Verify(false); // No full verify.
11621 if (allocator_ != NULL) allocator_->Verify(); 11626 if (allocator_ != NULL) allocator_->Verify();
11622 #endif 11627 #endif
11623 } 11628 }
11624 11629
11625 } } // namespace v8::internal 11630 } } // 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