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

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: Addressed comment 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 9666 matching lines...) Expand 10 before | Expand all | Expand 10 after
9677 HValue* left = Pop(); 9677 HValue* left = Pop();
9678 HInstruction* instr = BuildBinaryOperation(expr, left, right); 9678 HInstruction* instr = BuildBinaryOperation(expr, left, right);
9679 instr->set_position(expr->position()); 9679 instr->set_position(expr->position());
9680 return ast_context()->ReturnInstruction(instr, expr->id()); 9680 return ast_context()->ReturnInstruction(instr, expr->id());
9681 } 9681 }
9682 9682
9683 9683
9684 // TODO(rossberg): this should die eventually. 9684 // TODO(rossberg): this should die eventually.
9685 Representation HOptimizedGraphBuilder::ToRepresentation(TypeInfo info) { 9685 Representation HOptimizedGraphBuilder::ToRepresentation(TypeInfo info) {
9686 if (info.IsUninitialized()) return Representation::None(); 9686 if (info.IsUninitialized()) return Representation::None();
9687 // TODO(verwaest): Return Smi rather than Integer32.
9687 if (info.IsSmi()) return Representation::Integer32(); 9688 if (info.IsSmi()) return Representation::Integer32();
9688 if (info.IsInteger32()) return Representation::Integer32(); 9689 if (info.IsInteger32()) return Representation::Integer32();
9689 if (info.IsDouble()) return Representation::Double(); 9690 if (info.IsDouble()) return Representation::Double();
9690 if (info.IsNumber()) return Representation::Double(); 9691 if (info.IsNumber()) return Representation::Double();
9691 return Representation::Tagged(); 9692 return Representation::Tagged();
9692 } 9693 }
9693 9694
9694 9695
9695 Representation HOptimizedGraphBuilder::ToRepresentation(Handle<Type> type) { 9696 Representation HOptimizedGraphBuilder::ToRepresentation(Handle<Type> type) {
9696 if (type->Is(Type::None())) return Representation::None(); 9697 if (type->Is(Type::None())) return Representation::None();
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
9910 return ast_context()->ReturnControl(result, expr->id()); 9911 return ast_context()->ReturnControl(result, expr->id());
9911 } else { 9912 } else {
9912 if (combined_rep.IsTagged() || combined_rep.IsNone()) { 9913 if (combined_rep.IsTagged() || combined_rep.IsNone()) {
9913 HCompareGeneric* result = 9914 HCompareGeneric* result =
9914 new(zone()) HCompareGeneric(context, left, right, op); 9915 new(zone()) HCompareGeneric(context, left, right, op);
9915 result->set_observed_input_representation(1, left_rep); 9916 result->set_observed_input_representation(1, left_rep);
9916 result->set_observed_input_representation(2, right_rep); 9917 result->set_observed_input_representation(2, right_rep);
9917 result->set_position(expr->position()); 9918 result->set_position(expr->position());
9918 return ast_context()->ReturnInstruction(result, expr->id()); 9919 return ast_context()->ReturnInstruction(result, expr->id());
9919 } else { 9920 } else {
9921 // TODO(verwaest): Remove once ToRepresentation properly returns Smi when
9922 // the IC measures Smi.
9923 if (left_type->Is(Type::Integer31())) left_rep = Representation::Smi();
9924 if (right_type->Is(Type::Integer31())) right_rep = Representation::Smi();
9920 HCompareIDAndBranch* result = 9925 HCompareIDAndBranch* result =
9921 new(zone()) HCompareIDAndBranch(left, right, op); 9926 new(zone()) HCompareIDAndBranch(left, right, op);
9922 result->set_observed_input_representation(left_rep, right_rep); 9927 result->set_observed_input_representation(left_rep, right_rep);
9923 result->set_position(expr->position()); 9928 result->set_position(expr->position());
9924 return ast_context()->ReturnControl(result, expr->id()); 9929 return ast_context()->ReturnControl(result, expr->id());
9925 } 9930 }
9926 } 9931 }
9927 } 9932 }
9928 9933
9929 9934
(...skipping 1684 matching lines...) Expand 10 before | Expand all | Expand 10 after
11614 } 11619 }
11615 } 11620 }
11616 11621
11617 #ifdef DEBUG 11622 #ifdef DEBUG
11618 if (graph_ != NULL) graph_->Verify(false); // No full verify. 11623 if (graph_ != NULL) graph_->Verify(false); // No full verify.
11619 if (allocator_ != NULL) allocator_->Verify(); 11624 if (allocator_ != NULL) allocator_->Verify();
11620 #endif 11625 #endif
11621 } 11626 }
11622 11627
11623 } } // namespace v8::internal 11628 } } // 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