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

Side by Side Diff: src/hydrogen-instructions.h

Issue 6794014: Remove redundant data member from HChange instructions. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/hydrogen-instructions.cc » ('j') | 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 914 matching lines...) Expand 10 before | Expand all | Expand 10 after
925 DECLARE_CONCRETE_INSTRUCTION(Throw, "throw") 925 DECLARE_CONCRETE_INSTRUCTION(Throw, "throw")
926 }; 926 };
927 927
928 928
929 class HChange: public HUnaryOperation { 929 class HChange: public HUnaryOperation {
930 public: 930 public:
931 HChange(HValue* value, 931 HChange(HValue* value,
932 Representation from, 932 Representation from,
933 Representation to, 933 Representation to,
934 bool is_truncating) 934 bool is_truncating)
935 : HUnaryOperation(value), from_(from), to_(to) { 935 : HUnaryOperation(value), from_(from) {
936 ASSERT(!from.IsNone() && !to.IsNone()); 936 ASSERT(!from.IsNone() && !to.IsNone());
937 ASSERT(!from.Equals(to)); 937 ASSERT(!from.Equals(to));
938 set_representation(to); 938 set_representation(to);
939 SetFlag(kUseGVN); 939 SetFlag(kUseGVN);
940 if (is_truncating) SetFlag(kTruncatingToInt32); 940 if (is_truncating) SetFlag(kTruncatingToInt32);
941 if (from.IsInteger32() && to.IsTagged() && value->range() != NULL && 941 if (from.IsInteger32() && to.IsTagged() && value->range() != NULL &&
942 value->range()->IsInSmiRange()) { 942 value->range()->IsInSmiRange()) {
943 set_type(HType::Smi()); 943 set_type(HType::Smi());
944 } 944 }
945 } 945 }
946 946
947 virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited); 947 virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited);
948 948
949 Representation from() const { return from_; } 949 Representation from() const { return from_; }
950 Representation to() const { return to_; } 950 Representation to() const { return representation(); }
951 virtual Representation RequiredInputRepresentation(int index) const { 951 virtual Representation RequiredInputRepresentation(int index) const {
952 return from_; 952 return from_;
953 } 953 }
954 954
955 bool CanTruncateToInt32() const { return CheckFlag(kTruncatingToInt32); } 955 bool CanTruncateToInt32() const { return CheckFlag(kTruncatingToInt32); }
956 956
957 virtual void PrintDataTo(StringStream* stream); 957 virtual void PrintDataTo(StringStream* stream);
958 958
959 DECLARE_CONCRETE_INSTRUCTION(Change, 959 DECLARE_CONCRETE_INSTRUCTION(Change,
960 CanTruncateToInt32() ? "truncate" : "change") 960 CanTruncateToInt32() ? "truncate" : "change")
961 961
962 protected: 962 protected:
963 virtual bool DataEquals(HValue* other) { 963 virtual bool DataEquals(HValue* other) {
964 if (!other->IsChange()) return false; 964 if (!other->IsChange()) return false;
965 HChange* change = HChange::cast(other); 965 HChange* change = HChange::cast(other);
966 return value() == change->value() 966 return value() == change->value()
967 && to().Equals(change->to()); 967 && to().Equals(change->to());
968 } 968 }
969 969
970 private: 970 private:
971 Representation from_; 971 Representation from_;
972 Representation to_;
973 }; 972 };
974 973
975 974
976 class HSimulate: public HInstruction { 975 class HSimulate: public HInstruction {
977 public: 976 public:
978 HSimulate(int ast_id, int pop_count, int environment_length) 977 HSimulate(int ast_id, int pop_count, int environment_length)
979 : ast_id_(ast_id), 978 : ast_id_(ast_id),
980 pop_count_(pop_count), 979 pop_count_(pop_count),
981 environment_length_(environment_length), 980 environment_length_(environment_length),
982 values_(2), 981 values_(2),
(...skipping 2636 matching lines...) Expand 10 before | Expand all | Expand 10 after
3619 HValue* object() { return left(); } 3618 HValue* object() { return left(); }
3620 HValue* key() { return right(); } 3619 HValue* key() { return right(); }
3621 }; 3620 };
3622 3621
3623 #undef DECLARE_INSTRUCTION 3622 #undef DECLARE_INSTRUCTION
3624 #undef DECLARE_CONCRETE_INSTRUCTION 3623 #undef DECLARE_CONCRETE_INSTRUCTION
3625 3624
3626 } } // namespace v8::internal 3625 } } // namespace v8::internal
3627 3626
3628 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 3627 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698