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

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

Issue 6532085: Fix broken build by removing more const qualifiers. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 10 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 765 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 : HControlInstruction(true_target, false_target) { 776 : HControlInstruction(true_target, false_target) {
777 SetOperandAt(0, value); 777 SetOperandAt(0, value);
778 } 778 }
779 779
780 virtual Representation RequiredInputRepresentation(int index) const { 780 virtual Representation RequiredInputRepresentation(int index) const {
781 return Representation::Tagged(); 781 return Representation::Tagged();
782 } 782 }
783 783
784 virtual void PrintDataTo(StringStream* stream); 784 virtual void PrintDataTo(StringStream* stream);
785 785
786 HValue* value() const { return OperandAt(0); } 786 HValue* value() { return OperandAt(0); }
787 virtual int OperandCount() const { return 1; } 787 virtual int OperandCount() { return 1; }
788 virtual HValue* OperandAt(int index) const { return operands_[index]; } 788 virtual HValue* OperandAt(int index) { return operands_[index]; }
789 789
790 DECLARE_INSTRUCTION(UnaryControlInstruction) 790 DECLARE_INSTRUCTION(UnaryControlInstruction)
791 791
792 protected: 792 protected:
793 virtual void InternalSetOperandAt(int index, HValue* value) { 793 virtual void InternalSetOperandAt(int index, HValue* value) {
794 operands_[index] = value; 794 operands_[index] = value;
795 } 795 }
796 796
797 private: 797 private:
798 HOperandVector<1> operands_; 798 HOperandVector<1> operands_;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 DECLARE_CONCRETE_INSTRUCTION(AbnormalExit, "abnormal_exit") 855 DECLARE_CONCRETE_INSTRUCTION(AbnormalExit, "abnormal_exit")
856 }; 856 };
857 857
858 858
859 class HUnaryOperation: public HInstruction { 859 class HUnaryOperation: public HInstruction {
860 public: 860 public:
861 explicit HUnaryOperation(HValue* value) { 861 explicit HUnaryOperation(HValue* value) {
862 SetOperandAt(0, value); 862 SetOperandAt(0, value);
863 } 863 }
864 864
865 HValue* value() const { return OperandAt(0); } 865 HValue* value() { return OperandAt(0); }
866 virtual void PrintDataTo(StringStream* stream); 866 virtual void PrintDataTo(StringStream* stream);
867 virtual int OperandCount() const { return 1; } 867 virtual int OperandCount() { return 1; }
868 virtual HValue* OperandAt(int index) const { return operands_[index]; } 868 virtual HValue* OperandAt(int index) { return operands_[index]; }
869 869
870 DECLARE_INSTRUCTION(UnaryOperation) 870 DECLARE_INSTRUCTION(UnaryOperation)
871 871
872 protected: 872 protected:
873 virtual void InternalSetOperandAt(int index, HValue* value) { 873 virtual void InternalSetOperandAt(int index, HValue* value) {
874 operands_[index] = value; 874 operands_[index] = value;
875 } 875 }
876 876
877 private: 877 private:
878 HOperandVector<1> operands_; 878 HOperandVector<1> operands_;
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
973 } 973 }
974 bool HasAssignedIndexAt(int index) const { 974 bool HasAssignedIndexAt(int index) const {
975 return assigned_indexes_[index] != kNoIndex; 975 return assigned_indexes_[index] != kNoIndex;
976 } 976 }
977 void AddAssignedValue(int index, HValue* value) { 977 void AddAssignedValue(int index, HValue* value) {
978 AddValue(index, value); 978 AddValue(index, value);
979 } 979 }
980 void AddPushedValue(HValue* value) { 980 void AddPushedValue(HValue* value) {
981 AddValue(kNoIndex, value); 981 AddValue(kNoIndex, value);
982 } 982 }
983 virtual int OperandCount() const { return values_.length(); } 983 virtual int OperandCount() { return values_.length(); }
984 virtual HValue* OperandAt(int index) const { return values_[index]; } 984 virtual HValue* OperandAt(int index) { return values_[index]; }
985 985
986 DECLARE_CONCRETE_INSTRUCTION(Simulate, "simulate") 986 DECLARE_CONCRETE_INSTRUCTION(Simulate, "simulate")
987 987
988 #ifdef DEBUG 988 #ifdef DEBUG
989 virtual void Verify(); 989 virtual void Verify();
990 #endif 990 #endif
991 991
992 protected: 992 protected:
993 virtual void InternalSetOperandAt(int index, HValue* value) { 993 virtual void InternalSetOperandAt(int index, HValue* value) {
994 values_[index] = value; 994 values_[index] = value;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
1048 1048
1049 1049
1050 class HPushArgument: public HUnaryOperation { 1050 class HPushArgument: public HUnaryOperation {
1051 public: 1051 public:
1052 explicit HPushArgument(HValue* value) : HUnaryOperation(value) { } 1052 explicit HPushArgument(HValue* value) : HUnaryOperation(value) { }
1053 1053
1054 virtual Representation RequiredInputRepresentation(int index) const { 1054 virtual Representation RequiredInputRepresentation(int index) const {
1055 return Representation::Tagged(); 1055 return Representation::Tagged();
1056 } 1056 }
1057 1057
1058 HValue* argument() const { return OperandAt(0); } 1058 HValue* argument() { return OperandAt(0); }
1059 1059
1060 DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push_argument") 1060 DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push_argument")
1061 }; 1061 };
1062 1062
1063 1063
1064 class HContext: public HInstruction { 1064 class HContext: public HInstruction {
1065 public: 1065 public:
1066 HContext() { 1066 HContext() {
1067 set_representation(Representation::Tagged()); 1067 set_representation(Representation::Tagged());
1068 SetFlag(kUseGVN); 1068 SetFlag(kUseGVN);
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
1141 1141
1142 class HUnaryCall: public HCall { 1142 class HUnaryCall: public HCall {
1143 public: 1143 public:
1144 HUnaryCall(HValue* value, int argument_count) 1144 HUnaryCall(HValue* value, int argument_count)
1145 : HCall(argument_count), value_(NULL) { 1145 : HCall(argument_count), value_(NULL) {
1146 SetOperandAt(0, value); 1146 SetOperandAt(0, value);
1147 } 1147 }
1148 1148
1149 virtual void PrintDataTo(StringStream* stream); 1149 virtual void PrintDataTo(StringStream* stream);
1150 1150
1151 HValue* value() const { return value_; } 1151 HValue* value() { return value_; }
1152 1152
1153 virtual int OperandCount() const { return 1; } 1153 virtual int OperandCount() { return 1; }
1154 virtual HValue* OperandAt(int index) const { 1154 virtual HValue* OperandAt(int index) {
1155 ASSERT(index == 0); 1155 ASSERT(index == 0);
1156 return value_; 1156 return value_;
1157 } 1157 }
1158 1158
1159 DECLARE_INSTRUCTION(UnaryCall) 1159 DECLARE_INSTRUCTION(UnaryCall)
1160 1160
1161 protected: 1161 protected:
1162 virtual void InternalSetOperandAt(int index, HValue* value) { 1162 virtual void InternalSetOperandAt(int index, HValue* value) {
1163 ASSERT(index == 0); 1163 ASSERT(index == 0);
1164 value_ = value; 1164 value_ = value;
(...skipping 10 matching lines...) Expand all
1175 : HCall(argument_count) { 1175 : HCall(argument_count) {
1176 SetOperandAt(0, first); 1176 SetOperandAt(0, first);
1177 SetOperandAt(1, second); 1177 SetOperandAt(1, second);
1178 } 1178 }
1179 1179
1180 virtual void PrintDataTo(StringStream* stream); 1180 virtual void PrintDataTo(StringStream* stream);
1181 1181
1182 HValue* first() const { return operands_[0]; } 1182 HValue* first() const { return operands_[0]; }
1183 HValue* second() const { return operands_[1]; } 1183 HValue* second() const { return operands_[1]; }
1184 1184
1185 virtual int OperandCount() const { return 2; } 1185 virtual int OperandCount() { return 2; }
1186 virtual HValue* OperandAt(int index) const { return operands_[index]; } 1186 virtual HValue* OperandAt(int index) { return operands_[index]; }
1187 1187
1188 DECLARE_INSTRUCTION(BinaryCall) 1188 DECLARE_INSTRUCTION(BinaryCall)
1189 1189
1190 protected: 1190 protected:
1191 virtual void InternalSetOperandAt(int index, HValue* value) { 1191 virtual void InternalSetOperandAt(int index, HValue* value) {
1192 operands_[index] = value; 1192 operands_[index] = value;
1193 } 1193 }
1194 1194
1195 private: 1195 private:
1196 HOperandVector<2> operands_; 1196 HOperandVector<2> operands_;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
1235 1235
1236 1236
1237 class HCallNamed: public HUnaryCall { 1237 class HCallNamed: public HUnaryCall {
1238 public: 1238 public:
1239 HCallNamed(HValue* context, Handle<String> name, int argument_count) 1239 HCallNamed(HValue* context, Handle<String> name, int argument_count)
1240 : HUnaryCall(context, argument_count), name_(name) { 1240 : HUnaryCall(context, argument_count), name_(name) {
1241 } 1241 }
1242 1242
1243 virtual void PrintDataTo(StringStream* stream); 1243 virtual void PrintDataTo(StringStream* stream);
1244 1244
1245 HValue* context() const { return value(); } 1245 HValue* context() { return value(); }
1246 Handle<String> name() const { return name_; } 1246 Handle<String> name() const { return name_; }
1247 1247
1248 DECLARE_CONCRETE_INSTRUCTION(CallNamed, "call_named") 1248 DECLARE_CONCRETE_INSTRUCTION(CallNamed, "call_named")
1249 1249
1250 private: 1250 private:
1251 Handle<String> name_; 1251 Handle<String> name_;
1252 }; 1252 };
1253 1253
1254 1254
1255 class HCallFunction: public HUnaryCall { 1255 class HCallFunction: public HUnaryCall {
1256 public: 1256 public:
1257 HCallFunction(HValue* context, int argument_count) 1257 HCallFunction(HValue* context, int argument_count)
1258 : HUnaryCall(context, argument_count) { 1258 : HUnaryCall(context, argument_count) {
1259 } 1259 }
1260 1260
1261 HValue* context() const { return value(); } 1261 HValue* context() { return value(); }
1262 1262
1263 DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call_function") 1263 DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call_function")
1264 }; 1264 };
1265 1265
1266 1266
1267 class HCallGlobal: public HUnaryCall { 1267 class HCallGlobal: public HUnaryCall {
1268 public: 1268 public:
1269 HCallGlobal(HValue* context, Handle<String> name, int argument_count) 1269 HCallGlobal(HValue* context, Handle<String> name, int argument_count)
1270 : HUnaryCall(context, argument_count), name_(name) { 1270 : HUnaryCall(context, argument_count), name_(name) {
1271 } 1271 }
1272 1272
1273 virtual void PrintDataTo(StringStream* stream); 1273 virtual void PrintDataTo(StringStream* stream);
1274 1274
1275 HValue* context() const { return value(); } 1275 HValue* context() { return value(); }
1276 Handle<String> name() const { return name_; } 1276 Handle<String> name() const { return name_; }
1277 1277
1278 DECLARE_CONCRETE_INSTRUCTION(CallGlobal, "call_global") 1278 DECLARE_CONCRETE_INSTRUCTION(CallGlobal, "call_global")
1279 1279
1280 private: 1280 private:
1281 Handle<String> name_; 1281 Handle<String> name_;
1282 }; 1282 };
1283 1283
1284 1284
1285 class HCallKnownGlobal: public HCall { 1285 class HCallKnownGlobal: public HCall {
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
1776 if (double_occurred) return Representation::Double(); 1776 if (double_occurred) return Representation::Double();
1777 if (int32_occurred) return Representation::Integer32(); 1777 if (int32_occurred) return Representation::Integer32();
1778 return Representation::None(); 1778 return Representation::None();
1779 } 1779 }
1780 1780
1781 virtual Range* InferRange(); 1781 virtual Range* InferRange();
1782 virtual Representation RequiredInputRepresentation(int index) const { 1782 virtual Representation RequiredInputRepresentation(int index) const {
1783 return representation(); 1783 return representation();
1784 } 1784 }
1785 virtual HType CalculateInferredType(); 1785 virtual HType CalculateInferredType();
1786 virtual int OperandCount() const { return inputs_.length(); } 1786 virtual int OperandCount() { return inputs_.length(); }
1787 virtual HValue* OperandAt(int index) const { return inputs_[index]; } 1787 virtual HValue* OperandAt(int index) { return inputs_[index]; }
1788 HValue* GetRedundantReplacement() const; 1788 HValue* GetRedundantReplacement();
1789 void AddInput(HValue* value); 1789 void AddInput(HValue* value);
1790 1790
1791 bool IsReceiver() { return merged_index_ == 0; } 1791 bool IsReceiver() { return merged_index_ == 0; }
1792 1792
1793 int merged_index() const { return merged_index_; } 1793 int merged_index() const { return merged_index_; }
1794 1794
1795 virtual const char* Mnemonic() const { return "phi"; } 1795 virtual const char* Mnemonic() const { return "phi"; }
1796 1796
1797 virtual void PrintTo(StringStream* stream); 1797 virtual void PrintTo(StringStream* stream);
1798 1798
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1913 1913
1914 1914
1915 class HBinaryOperation: public HInstruction { 1915 class HBinaryOperation: public HInstruction {
1916 public: 1916 public:
1917 HBinaryOperation(HValue* left, HValue* right) { 1917 HBinaryOperation(HValue* left, HValue* right) {
1918 ASSERT(left != NULL && right != NULL); 1918 ASSERT(left != NULL && right != NULL);
1919 SetOperandAt(0, left); 1919 SetOperandAt(0, left);
1920 SetOperandAt(1, right); 1920 SetOperandAt(1, right);
1921 } 1921 }
1922 1922
1923 HValue* left() const { return OperandAt(0); } 1923 HValue* left() { return OperandAt(0); }
1924 HValue* right() const { return OperandAt(1); } 1924 HValue* right() { return OperandAt(1); }
1925 1925
1926 // TODO(kasperl): Move these helpers to the IA-32 Lithium 1926 // TODO(kasperl): Move these helpers to the IA-32 Lithium
1927 // instruction sequence builder. 1927 // instruction sequence builder.
1928 HValue* LeastConstantOperand() const { 1928 HValue* LeastConstantOperand() {
1929 if (IsCommutative() && left()->IsConstant()) return right(); 1929 if (IsCommutative() && left()->IsConstant()) return right();
1930 return left(); 1930 return left();
1931 } 1931 }
1932 HValue* MostConstantOperand() const { 1932 HValue* MostConstantOperand() {
1933 if (IsCommutative() && left()->IsConstant()) return left(); 1933 if (IsCommutative() && left()->IsConstant()) return left();
1934 return right(); 1934 return right();
1935 } 1935 }
1936 1936
1937 virtual bool IsCommutative() const { return false; } 1937 virtual bool IsCommutative() const { return false; }
1938 1938
1939 virtual void PrintDataTo(StringStream* stream); 1939 virtual void PrintDataTo(StringStream* stream);
1940 virtual int OperandCount() const { return operands_.length(); } 1940 virtual int OperandCount() { return operands_.length(); }
1941 virtual HValue* OperandAt(int index) const { return operands_[index]; } 1941 virtual HValue* OperandAt(int index) { return operands_[index]; }
1942 1942
1943 DECLARE_INSTRUCTION(BinaryOperation) 1943 DECLARE_INSTRUCTION(BinaryOperation)
1944 1944
1945 protected: 1945 protected:
1946 virtual void InternalSetOperandAt(int index, HValue* value) { 1946 virtual void InternalSetOperandAt(int index, HValue* value) {
1947 operands_[index] = value; 1947 operands_[index] = value;
1948 } 1948 }
1949 1949
1950 HOperandVector<2> operands_; 1950 HOperandVector<2> operands_;
1951 }; 1951 };
(...skipping 13 matching lines...) Expand all
1965 SetAllSideEffects(); 1965 SetAllSideEffects();
1966 } 1966 }
1967 1967
1968 virtual Representation RequiredInputRepresentation(int index) const { 1968 virtual Representation RequiredInputRepresentation(int index) const {
1969 // The length is untagged, all other inputs are tagged. 1969 // The length is untagged, all other inputs are tagged.
1970 return (index == 2) 1970 return (index == 2)
1971 ? Representation::Integer32() 1971 ? Representation::Integer32()
1972 : Representation::Tagged(); 1972 : Representation::Tagged();
1973 } 1973 }
1974 1974
1975 HValue* function() const { return OperandAt(0); } 1975 HValue* function() { return OperandAt(0); }
1976 HValue* receiver() const { return OperandAt(1); } 1976 HValue* receiver() { return OperandAt(1); }
1977 HValue* length() const { return OperandAt(2); } 1977 HValue* length() { return OperandAt(2); }
1978 HValue* elements() const { return OperandAt(3); } 1978 HValue* elements() { return OperandAt(3); }
1979 1979
1980 virtual int OperandCount() const { return operands_.length(); } 1980 virtual int OperandCount() { return operands_.length(); }
1981 virtual HValue* OperandAt(int index) const { return operands_[index]; } 1981 virtual HValue* OperandAt(int index) { return operands_[index]; }
1982 1982
1983 DECLARE_CONCRETE_INSTRUCTION(ApplyArguments, "apply_arguments") 1983 DECLARE_CONCRETE_INSTRUCTION(ApplyArguments, "apply_arguments")
1984 1984
1985 protected: 1985 protected:
1986 virtual void InternalSetOperandAt(int index, HValue* value) { 1986 virtual void InternalSetOperandAt(int index, HValue* value) {
1987 operands_[index] = value; 1987 operands_[index] = value;
1988 } 1988 }
1989 1989
1990 private: 1990 private:
1991 HOperandVector<4> operands_; 1991 HOperandVector<4> operands_;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
2034 2034
2035 virtual void PrintDataTo(StringStream* stream); 2035 virtual void PrintDataTo(StringStream* stream);
2036 2036
2037 virtual Representation RequiredInputRepresentation(int index) const { 2037 virtual Representation RequiredInputRepresentation(int index) const {
2038 // The arguments elements is considered tagged. 2038 // The arguments elements is considered tagged.
2039 return index == 0 2039 return index == 0
2040 ? Representation::Tagged() 2040 ? Representation::Tagged()
2041 : Representation::Integer32(); 2041 : Representation::Integer32();
2042 } 2042 }
2043 2043
2044 HValue* arguments() const { return operands_[0]; } 2044 HValue* arguments() { return operands_[0]; }
2045 HValue* length() const { return operands_[1]; } 2045 HValue* length() { return operands_[1]; }
2046 HValue* index() const { return operands_[2]; } 2046 HValue* index() { return operands_[2]; }
2047 2047
2048 virtual int OperandCount() const { return operands_.length(); } 2048 virtual int OperandCount() { return operands_.length(); }
2049 virtual HValue* OperandAt(int index) const { return operands_[index]; } 2049 virtual HValue* OperandAt(int index) { return operands_[index]; }
2050 2050
2051 DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt, "access_arguments_at") 2051 DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt, "access_arguments_at")
2052 2052
2053 protected: 2053 protected:
2054 virtual void InternalSetOperandAt(int index, HValue* value) { 2054 virtual void InternalSetOperandAt(int index, HValue* value) {
2055 operands_[index] = value; 2055 operands_[index] = value;
2056 } 2056 }
2057 2057
2058 virtual bool DataEquals(HValue* other) { return true; } 2058 virtual bool DataEquals(HValue* other) { return true; }
2059 2059
(...skipping 12 matching lines...) Expand all
2072 virtual bool IsCheckInstruction() const { return true; } 2072 virtual bool IsCheckInstruction() const { return true; }
2073 2073
2074 virtual Representation RequiredInputRepresentation(int index) const { 2074 virtual Representation RequiredInputRepresentation(int index) const {
2075 return Representation::Integer32(); 2075 return Representation::Integer32();
2076 } 2076 }
2077 2077
2078 #ifdef DEBUG 2078 #ifdef DEBUG
2079 virtual void Verify(); 2079 virtual void Verify();
2080 #endif 2080 #endif
2081 2081
2082 HValue* index() const { return left(); } 2082 HValue* index() { return left(); }
2083 HValue* length() const { return right(); } 2083 HValue* length() { return right(); }
2084 2084
2085 DECLARE_CONCRETE_INSTRUCTION(BoundsCheck, "bounds_check") 2085 DECLARE_CONCRETE_INSTRUCTION(BoundsCheck, "bounds_check")
2086 2086
2087 protected: 2087 protected:
2088 virtual bool DataEquals(HValue* other) { return true; } 2088 virtual bool DataEquals(HValue* other) { return true; }
2089 }; 2089 };
2090 2090
2091 2091
2092 class HBitwiseBinaryOperation: public HBinaryOperation { 2092 class HBitwiseBinaryOperation: public HBinaryOperation {
2093 public: 2093 public:
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
2390 class HInstanceOf: public HInstruction { 2390 class HInstanceOf: public HInstruction {
2391 public: 2391 public:
2392 HInstanceOf(HValue* context, HValue* left, HValue* right) { 2392 HInstanceOf(HValue* context, HValue* left, HValue* right) {
2393 SetOperandAt(0, context); 2393 SetOperandAt(0, context);
2394 SetOperandAt(1, left); 2394 SetOperandAt(1, left);
2395 SetOperandAt(2, right); 2395 SetOperandAt(2, right);
2396 set_representation(Representation::Tagged()); 2396 set_representation(Representation::Tagged());
2397 SetAllSideEffects(); 2397 SetAllSideEffects();
2398 } 2398 }
2399 2399
2400 HValue* context() const { return operands_[0]; } 2400 HValue* context() { return operands_[0]; }
2401 HValue* left() const { return operands_[1]; } 2401 HValue* left() { return operands_[1]; }
2402 HValue* right() const { return operands_[2]; } 2402 HValue* right() { return operands_[2]; }
2403 2403
2404 virtual bool EmitAtUses() const { 2404 virtual bool EmitAtUses() const {
2405 return !HasSideEffects() && (uses()->length() <= 1); 2405 return !HasSideEffects() && (uses()->length() <= 1);
2406 } 2406 }
2407 2407
2408 virtual Representation RequiredInputRepresentation(int index) const { 2408 virtual Representation RequiredInputRepresentation(int index) const {
2409 return Representation::Tagged(); 2409 return Representation::Tagged();
2410 } 2410 }
2411 2411
2412 virtual void PrintDataTo(StringStream* stream); 2412 virtual void PrintDataTo(StringStream* stream);
2413 2413
2414 virtual int OperandCount() const { return 3; } 2414 virtual int OperandCount() { return 3; }
2415 virtual HValue* OperandAt(int index) const { return operands_[index]; } 2415 virtual HValue* OperandAt(int index) { return operands_[index]; }
2416 2416
2417 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance_of") 2417 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance_of")
2418 2418
2419 protected: 2419 protected:
2420 virtual void InternalSetOperandAt(int index, HValue* value) { 2420 virtual void InternalSetOperandAt(int index, HValue* value) {
2421 operands_[index] = value; 2421 operands_[index] = value;
2422 } 2422 }
2423 2423
2424 private: 2424 private:
2425 HOperandVector<3> operands_; 2425 HOperandVector<3> operands_;
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
2694 class HCallStub: public HUnaryCall { 2694 class HCallStub: public HUnaryCall {
2695 public: 2695 public:
2696 HCallStub(HValue* context, CodeStub::Major major_key, int argument_count) 2696 HCallStub(HValue* context, CodeStub::Major major_key, int argument_count)
2697 : HUnaryCall(context, argument_count), 2697 : HUnaryCall(context, argument_count),
2698 major_key_(major_key), 2698 major_key_(major_key),
2699 transcendental_type_(TranscendentalCache::kNumberOfCaches) { 2699 transcendental_type_(TranscendentalCache::kNumberOfCaches) {
2700 } 2700 }
2701 2701
2702 CodeStub::Major major_key() { return major_key_; } 2702 CodeStub::Major major_key() { return major_key_; }
2703 2703
2704 HValue* context() const { return value(); } 2704 HValue* context() { return value(); }
2705 2705
2706 void set_transcendental_type(TranscendentalCache::Type transcendental_type) { 2706 void set_transcendental_type(TranscendentalCache::Type transcendental_type) {
2707 transcendental_type_ = transcendental_type; 2707 transcendental_type_ = transcendental_type;
2708 } 2708 }
2709 TranscendentalCache::Type transcendental_type() { 2709 TranscendentalCache::Type transcendental_type() {
2710 return transcendental_type_; 2710 return transcendental_type_;
2711 } 2711 }
2712 2712
2713 virtual void PrintDataTo(StringStream* stream); 2713 virtual void PrintDataTo(StringStream* stream);
2714 2714
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
2827 } 2827 }
2828 2828
2829 2829
2830 class HStoreContextSlot: public HBinaryOperation { 2830 class HStoreContextSlot: public HBinaryOperation {
2831 public: 2831 public:
2832 HStoreContextSlot(HValue* context, int slot_index, HValue* value) 2832 HStoreContextSlot(HValue* context, int slot_index, HValue* value)
2833 : HBinaryOperation(context, value), slot_index_(slot_index) { 2833 : HBinaryOperation(context, value), slot_index_(slot_index) {
2834 SetFlag(kChangesContextSlots); 2834 SetFlag(kChangesContextSlots);
2835 } 2835 }
2836 2836
2837 HValue* context() const { return OperandAt(0); } 2837 HValue* context() { return OperandAt(0); }
2838 HValue* value() const { return OperandAt(1); } 2838 HValue* value() { return OperandAt(1); }
2839 int slot_index() const { return slot_index_; } 2839 int slot_index() const { return slot_index_; }
2840 2840
2841 bool NeedsWriteBarrier() const { 2841 bool NeedsWriteBarrier() {
2842 return StoringValueNeedsWriteBarrier(value()); 2842 return StoringValueNeedsWriteBarrier(value());
2843 } 2843 }
2844 2844
2845 virtual Representation RequiredInputRepresentation(int index) const { 2845 virtual Representation RequiredInputRepresentation(int index) const {
2846 return Representation::Tagged(); 2846 return Representation::Tagged();
2847 } 2847 }
2848 2848
2849 virtual void PrintDataTo(StringStream* stream); 2849 virtual void PrintDataTo(StringStream* stream);
2850 2850
2851 DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store_context_slot") 2851 DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store_context_slot")
(...skipping 11 matching lines...) Expand all
2863 offset_(offset) { 2863 offset_(offset) {
2864 set_representation(Representation::Tagged()); 2864 set_representation(Representation::Tagged());
2865 SetFlag(kUseGVN); 2865 SetFlag(kUseGVN);
2866 if (is_in_object) { 2866 if (is_in_object) {
2867 SetFlag(kDependsOnInobjectFields); 2867 SetFlag(kDependsOnInobjectFields);
2868 } else { 2868 } else {
2869 SetFlag(kDependsOnBackingStoreFields); 2869 SetFlag(kDependsOnBackingStoreFields);
2870 } 2870 }
2871 } 2871 }
2872 2872
2873 HValue* object() const { return OperandAt(0); } 2873 HValue* object() { return OperandAt(0); }
2874 bool is_in_object() const { return is_in_object_; } 2874 bool is_in_object() const { return is_in_object_; }
2875 int offset() const { return offset_; } 2875 int offset() const { return offset_; }
2876 2876
2877 virtual Representation RequiredInputRepresentation(int index) const { 2877 virtual Representation RequiredInputRepresentation(int index) const {
2878 return Representation::Tagged(); 2878 return Representation::Tagged();
2879 } 2879 }
2880 virtual void PrintDataTo(StringStream* stream); 2880 virtual void PrintDataTo(StringStream* stream);
2881 2881
2882 DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load_named_field") 2882 DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load_named_field")
2883 2883
(...skipping 10 matching lines...) Expand all
2894 2894
2895 2895
2896 class HLoadNamedGeneric: public HBinaryOperation { 2896 class HLoadNamedGeneric: public HBinaryOperation {
2897 public: 2897 public:
2898 HLoadNamedGeneric(HValue* context, HValue* object, Handle<Object> name) 2898 HLoadNamedGeneric(HValue* context, HValue* object, Handle<Object> name)
2899 : HBinaryOperation(context, object), name_(name) { 2899 : HBinaryOperation(context, object), name_(name) {
2900 set_representation(Representation::Tagged()); 2900 set_representation(Representation::Tagged());
2901 SetAllSideEffects(); 2901 SetAllSideEffects();
2902 } 2902 }
2903 2903
2904 HValue* context() const { return OperandAt(0); } 2904 HValue* context() { return OperandAt(0); }
2905 HValue* object() const { return OperandAt(1); } 2905 HValue* object() { return OperandAt(1); }
2906 Handle<Object> name() const { return name_; } 2906 Handle<Object> name() const { return name_; }
2907 2907
2908 virtual Representation RequiredInputRepresentation(int index) const { 2908 virtual Representation RequiredInputRepresentation(int index) const {
2909 return Representation::Tagged(); 2909 return Representation::Tagged();
2910 } 2910 }
2911 2911
2912 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load_named_generic") 2912 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load_named_generic")
2913 2913
2914 private: 2914 private:
2915 Handle<Object> name_; 2915 Handle<Object> name_;
2916 }; 2916 };
2917 2917
2918 2918
2919 class HLoadFunctionPrototype: public HUnaryOperation { 2919 class HLoadFunctionPrototype: public HUnaryOperation {
2920 public: 2920 public:
2921 explicit HLoadFunctionPrototype(HValue* function) 2921 explicit HLoadFunctionPrototype(HValue* function)
2922 : HUnaryOperation(function) { 2922 : HUnaryOperation(function) {
2923 set_representation(Representation::Tagged()); 2923 set_representation(Representation::Tagged());
2924 SetFlag(kUseGVN); 2924 SetFlag(kUseGVN);
2925 SetFlag(kDependsOnCalls); 2925 SetFlag(kDependsOnCalls);
2926 } 2926 }
2927 2927
2928 HValue* function() const { return OperandAt(0); } 2928 HValue* function() { return OperandAt(0); }
2929 2929
2930 virtual Representation RequiredInputRepresentation(int index) const { 2930 virtual Representation RequiredInputRepresentation(int index) const {
2931 return Representation::Tagged(); 2931 return Representation::Tagged();
2932 } 2932 }
2933 2933
2934 DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load_function_prototype") 2934 DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load_function_prototype")
2935 2935
2936 protected: 2936 protected:
2937 virtual bool DataEquals(HValue* other) { return true; } 2937 virtual bool DataEquals(HValue* other) { return true; }
2938 }; 2938 };
2939 2939
2940 2940
2941 class HLoadKeyed: public HBinaryOperation { 2941 class HLoadKeyed: public HBinaryOperation {
2942 public: 2942 public:
2943 HLoadKeyed(HValue* obj, HValue* key) : HBinaryOperation(obj, key) { 2943 HLoadKeyed(HValue* obj, HValue* key) : HBinaryOperation(obj, key) {
2944 set_representation(Representation::Tagged()); 2944 set_representation(Representation::Tagged());
2945 } 2945 }
2946 2946
2947 virtual void PrintDataTo(StringStream* stream); 2947 virtual void PrintDataTo(StringStream* stream);
2948 2948
2949 virtual Representation RequiredInputRepresentation(int index) const { 2949 virtual Representation RequiredInputRepresentation(int index) const {
2950 return Representation::Tagged(); 2950 return Representation::Tagged();
2951 } 2951 }
2952 HValue* object() const { return OperandAt(0); } 2952 HValue* object() { return OperandAt(0); }
2953 HValue* key() const { return OperandAt(1); } 2953 HValue* key() { return OperandAt(1); }
2954 2954
2955 DECLARE_INSTRUCTION(LoadKeyed) 2955 DECLARE_INSTRUCTION(LoadKeyed)
2956 }; 2956 };
2957 2957
2958 2958
2959 class HLoadKeyedFastElement: public HLoadKeyed { 2959 class HLoadKeyedFastElement: public HLoadKeyed {
2960 public: 2960 public:
2961 HLoadKeyedFastElement(HValue* obj, HValue* key) : HLoadKeyed(obj, key) { 2961 HLoadKeyedFastElement(HValue* obj, HValue* key) : HLoadKeyed(obj, key) {
2962 SetFlag(kDependsOnArrayElements); 2962 SetFlag(kDependsOnArrayElements);
2963 SetFlag(kUseGVN); 2963 SetFlag(kUseGVN);
(...skipping 26 matching lines...) Expand all
2990 2990
2991 virtual void PrintDataTo(StringStream* stream); 2991 virtual void PrintDataTo(StringStream* stream);
2992 2992
2993 virtual Representation RequiredInputRepresentation(int index) const { 2993 virtual Representation RequiredInputRepresentation(int index) const {
2994 // The key is supposed to be Integer32, but the base pointer 2994 // The key is supposed to be Integer32, but the base pointer
2995 // for the element load is a naked pointer. 2995 // for the element load is a naked pointer.
2996 return (index == 1) ? Representation::Integer32() 2996 return (index == 1) ? Representation::Integer32()
2997 : Representation::External(); 2997 : Representation::External();
2998 } 2998 }
2999 2999
3000 HValue* external_pointer() const { return OperandAt(0); } 3000 HValue* external_pointer() { return OperandAt(0); }
3001 HValue* key() const { return OperandAt(1); } 3001 HValue* key() { return OperandAt(1); }
3002 3002
3003 DECLARE_CONCRETE_INSTRUCTION(LoadPixelArrayElement, 3003 DECLARE_CONCRETE_INSTRUCTION(LoadPixelArrayElement,
3004 "load_pixel_array_element") 3004 "load_pixel_array_element")
3005 3005
3006 protected: 3006 protected:
3007 virtual bool DataEquals(HValue* other) { return true; } 3007 virtual bool DataEquals(HValue* other) { return true; }
3008 }; 3008 };
3009 3009
3010 3010
3011 class HLoadKeyedGeneric: public HLoadKeyed { 3011 class HLoadKeyedGeneric: public HLoadKeyed {
3012 public: 3012 public:
3013 HLoadKeyedGeneric(HContext* context, HValue* obj, HValue* key) 3013 HLoadKeyedGeneric(HContext* context, HValue* obj, HValue* key)
3014 : HLoadKeyed(obj, key), context_(NULL) { 3014 : HLoadKeyed(obj, key), context_(NULL) {
3015 SetOperandAt(2, context); 3015 SetOperandAt(2, context);
3016 SetAllSideEffects(); 3016 SetAllSideEffects();
3017 } 3017 }
3018 3018
3019 HValue* context() const { return context_; } 3019 HValue* context() const { return context_; }
3020 HValue* object() const { return operands_[0]; } 3020 HValue* object() { return operands_[0]; }
3021 HValue* key() const { return operands_[1]; } 3021 HValue* key() { return operands_[1]; }
3022 3022
3023 virtual int OperandCount() const { return 3; } 3023 virtual int OperandCount() { return 3; }
3024 virtual HValue* OperandAt(int index) const { 3024 virtual HValue* OperandAt(int index) {
3025 return (index < 2) ? operands_[index] : context_; 3025 return (index < 2) ? operands_[index] : context_;
3026 } 3026 }
3027 3027
3028 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load_keyed_generic") 3028 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load_keyed_generic")
3029 3029
3030 protected: 3030 protected:
3031 virtual void InternalSetOperandAt(int index, HValue* value); 3031 virtual void InternalSetOperandAt(int index, HValue* value);
3032 3032
3033 private: 3033 private:
3034 HValue* context_; 3034 HValue* context_;
3035 }; 3035 };
3036 3036
3037 3037
3038 class HStoreNamed: public HBinaryOperation { 3038 class HStoreNamed: public HBinaryOperation {
3039 public: 3039 public:
3040 HStoreNamed(HValue* obj, Handle<String> name, HValue* val) 3040 HStoreNamed(HValue* obj, Handle<String> name, HValue* val)
3041 : HBinaryOperation(obj, val), name_(name) { 3041 : HBinaryOperation(obj, val), name_(name) {
3042 } 3042 }
3043 3043
3044 virtual Representation RequiredInputRepresentation(int index) const { 3044 virtual Representation RequiredInputRepresentation(int index) const {
3045 return Representation::Tagged(); 3045 return Representation::Tagged();
3046 } 3046 }
3047 3047
3048 virtual void PrintDataTo(StringStream* stream); 3048 virtual void PrintDataTo(StringStream* stream);
3049 3049
3050 HValue* object() const { return OperandAt(0); } 3050 HValue* object() { return OperandAt(0); }
3051 Handle<String> name() const { return name_; } 3051 Handle<String> name() const { return name_; }
3052 HValue* value() const { return OperandAt(1); } 3052 HValue* value() { return OperandAt(1); }
3053 void set_value(HValue* value) { SetOperandAt(1, value); } 3053 void set_value(HValue* value) { SetOperandAt(1, value); }
3054 3054
3055 DECLARE_INSTRUCTION(StoreNamed) 3055 DECLARE_INSTRUCTION(StoreNamed)
3056 3056
3057 private: 3057 private:
3058 Handle<String> name_; 3058 Handle<String> name_;
3059 }; 3059 };
3060 3060
3061 3061
3062 class HStoreNamedField: public HStoreNamed { 3062 class HStoreNamedField: public HStoreNamed {
(...skipping 18 matching lines...) Expand all
3081 virtual Representation RequiredInputRepresentation(int index) const { 3081 virtual Representation RequiredInputRepresentation(int index) const {
3082 return Representation::Tagged(); 3082 return Representation::Tagged();
3083 } 3083 }
3084 virtual void PrintDataTo(StringStream* stream); 3084 virtual void PrintDataTo(StringStream* stream);
3085 3085
3086 bool is_in_object() const { return is_in_object_; } 3086 bool is_in_object() const { return is_in_object_; }
3087 int offset() const { return offset_; } 3087 int offset() const { return offset_; }
3088 Handle<Map> transition() const { return transition_; } 3088 Handle<Map> transition() const { return transition_; }
3089 void set_transition(Handle<Map> map) { transition_ = map; } 3089 void set_transition(Handle<Map> map) { transition_ = map; }
3090 3090
3091 bool NeedsWriteBarrier() const { 3091 bool NeedsWriteBarrier() {
3092 return StoringValueNeedsWriteBarrier(value()); 3092 return StoringValueNeedsWriteBarrier(value());
3093 } 3093 }
3094 3094
3095 private: 3095 private:
3096 bool is_in_object_; 3096 bool is_in_object_;
3097 int offset_; 3097 int offset_;
3098 Handle<Map> transition_; 3098 Handle<Map> transition_;
3099 }; 3099 };
3100 3100
3101 3101
3102 class HStoreNamedGeneric: public HStoreNamed { 3102 class HStoreNamedGeneric: public HStoreNamed {
3103 public: 3103 public:
3104 HStoreNamedGeneric(HValue* context, 3104 HStoreNamedGeneric(HValue* context,
3105 HValue* object, 3105 HValue* object,
3106 Handle<String> name, 3106 Handle<String> name,
3107 HValue* value) 3107 HValue* value)
3108 : HStoreNamed(object, name, value), context_(NULL) { 3108 : HStoreNamed(object, name, value), context_(NULL) {
3109 SetOperandAt(2, context); 3109 SetOperandAt(2, context);
3110 SetAllSideEffects(); 3110 SetAllSideEffects();
3111 } 3111 }
3112 3112
3113 HValue* context() const { return context_; } 3113 HValue* context() const { return context_; }
3114 HValue* object() const { return operands_[0]; } 3114 HValue* object() const { return operands_[0]; }
3115 HValue* value() const { return operands_[1]; } 3115 HValue* value() const { return operands_[1]; }
3116 3116
3117 virtual int OperandCount() const { return 3; } 3117 virtual int OperandCount() { return 3; }
3118 3118
3119 virtual HValue* OperandAt(int index) const { 3119 virtual HValue* OperandAt(int index) {
3120 return (index < 2) ? operands_[index] : context_; 3120 return (index < 2) ? operands_[index] : context_;
3121 } 3121 }
3122 3122
3123 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store_named_generic") 3123 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store_named_generic")
3124 3124
3125 protected: 3125 protected:
3126 virtual void InternalSetOperandAt(int index, HValue* value); 3126 virtual void InternalSetOperandAt(int index, HValue* value);
3127 3127
3128 private: 3128 private:
3129 HValue* context_; 3129 HValue* context_;
3130 }; 3130 };
3131 3131
3132 3132
3133 class HStoreKeyed: public HInstruction { 3133 class HStoreKeyed: public HInstruction {
3134 public: 3134 public:
3135 HStoreKeyed(HValue* obj, HValue* key, HValue* val) { 3135 HStoreKeyed(HValue* obj, HValue* key, HValue* val) {
3136 SetOperandAt(0, obj); 3136 SetOperandAt(0, obj);
3137 SetOperandAt(1, key); 3137 SetOperandAt(1, key);
3138 SetOperandAt(2, val); 3138 SetOperandAt(2, val);
3139 } 3139 }
3140 3140
3141 virtual void PrintDataTo(StringStream* stream); 3141 virtual void PrintDataTo(StringStream* stream);
3142 virtual int OperandCount() const { return operands_.length(); } 3142 virtual int OperandCount() { return operands_.length(); }
3143 virtual HValue* OperandAt(int index) const { return operands_[index]; } 3143 virtual HValue* OperandAt(int index) { return operands_[index]; }
3144 3144
3145 virtual Representation RequiredInputRepresentation(int index) const { 3145 virtual Representation RequiredInputRepresentation(int index) const {
3146 return Representation::Tagged(); 3146 return Representation::Tagged();
3147 } 3147 }
3148 3148
3149 HValue* object() const { return OperandAt(0); } 3149 HValue* object() { return OperandAt(0); }
3150 HValue* key() const { return OperandAt(1); } 3150 HValue* key() { return OperandAt(1); }
3151 HValue* value() const { return OperandAt(2); } 3151 HValue* value() { return OperandAt(2); }
3152 3152
3153 bool NeedsWriteBarrier() const { 3153 bool NeedsWriteBarrier() {
3154 return StoringValueNeedsWriteBarrier(value()); 3154 return StoringValueNeedsWriteBarrier(value());
3155 } 3155 }
3156 3156
3157 DECLARE_INSTRUCTION(StoreKeyed) 3157 DECLARE_INSTRUCTION(StoreKeyed)
3158 3158
3159 protected: 3159 protected:
3160 virtual void InternalSetOperandAt(int index, HValue* value) { 3160 virtual void InternalSetOperandAt(int index, HValue* value) {
3161 operands_[index] = value; 3161 operands_[index] = value;
3162 } 3162 }
3163 3163
(...skipping 22 matching lines...) Expand all
3186 class HStorePixelArrayElement: public HInstruction { 3186 class HStorePixelArrayElement: public HInstruction {
3187 public: 3187 public:
3188 HStorePixelArrayElement(HValue* external_elements, HValue* key, HValue* val) { 3188 HStorePixelArrayElement(HValue* external_elements, HValue* key, HValue* val) {
3189 SetFlag(kChangesPixelArrayElements); 3189 SetFlag(kChangesPixelArrayElements);
3190 SetOperandAt(0, external_elements); 3190 SetOperandAt(0, external_elements);
3191 SetOperandAt(1, key); 3191 SetOperandAt(1, key);
3192 SetOperandAt(2, val); 3192 SetOperandAt(2, val);
3193 } 3193 }
3194 3194
3195 virtual void PrintDataTo(StringStream* stream); 3195 virtual void PrintDataTo(StringStream* stream);
3196 virtual int OperandCount() const { return operands_.length(); } 3196 virtual int OperandCount() { return operands_.length(); }
3197 virtual HValue* OperandAt(int index) const { return operands_[index]; } 3197 virtual HValue* OperandAt(int index) { return operands_[index]; }
3198 3198
3199 virtual Representation RequiredInputRepresentation(int index) const { 3199 virtual Representation RequiredInputRepresentation(int index) const {
3200 if (index == 0) { 3200 if (index == 0) {
3201 return Representation::External(); 3201 return Representation::External();
3202 } else { 3202 } else {
3203 return Representation::Integer32(); 3203 return Representation::Integer32();
3204 } 3204 }
3205 } 3205 }
3206 3206
3207 HValue* external_pointer() const { return operands_[0]; } 3207 HValue* external_pointer() { return operands_[0]; }
3208 HValue* key() const { return operands_[1]; } 3208 HValue* key() { return operands_[1]; }
3209 HValue* value() const { return operands_[2]; } 3209 HValue* value() { return operands_[2]; }
3210 3210
3211 DECLARE_CONCRETE_INSTRUCTION(StorePixelArrayElement, 3211 DECLARE_CONCRETE_INSTRUCTION(StorePixelArrayElement,
3212 "store_pixel_array_element") 3212 "store_pixel_array_element")
3213 3213
3214 protected: 3214 protected:
3215 virtual void InternalSetOperandAt(int index, HValue* value) { 3215 virtual void InternalSetOperandAt(int index, HValue* value) {
3216 operands_[index] = value; 3216 operands_[index] = value;
3217 } 3217 }
3218 3218
3219 HOperandVector<3> operands_; 3219 HOperandVector<3> operands_;
3220 }; 3220 };
3221 3221
3222 3222
3223 class HStoreKeyedGeneric: public HStoreKeyed { 3223 class HStoreKeyedGeneric: public HStoreKeyed {
3224 public: 3224 public:
3225 HStoreKeyedGeneric(HValue* context, 3225 HStoreKeyedGeneric(HValue* context,
3226 HValue* object, 3226 HValue* object,
3227 HValue* key, 3227 HValue* key,
3228 HValue* value) 3228 HValue* value)
3229 : HStoreKeyed(object, key, value), context_(NULL) { 3229 : HStoreKeyed(object, key, value), context_(NULL) {
3230 SetOperandAt(3, context); 3230 SetOperandAt(3, context);
3231 SetAllSideEffects(); 3231 SetAllSideEffects();
3232 } 3232 }
3233 3233
3234 HValue* context() const { return context_; } 3234 HValue* context() { return context_; }
3235 HValue* object() const { return operands_[0]; } 3235 HValue* object() { return operands_[0]; }
3236 HValue* key() const { return operands_[1]; } 3236 HValue* key() { return operands_[1]; }
3237 HValue* value() const { return operands_[2]; } 3237 HValue* value() { return operands_[2]; }
3238 3238
3239 virtual int OperandCount() const { return 4; } 3239 virtual int OperandCount() { return 4; }
3240 3240
3241 virtual HValue* OperandAt(int index) const { 3241 virtual HValue* OperandAt(int index) {
3242 return (index < 3) ? operands_[index] : context_; 3242 return (index < 3) ? operands_[index] : context_;
3243 } 3243 }
3244 3244
3245 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store_keyed_generic") 3245 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store_keyed_generic")
3246 3246
3247 protected: 3247 protected:
3248 virtual void InternalSetOperandAt(int index, HValue* value); 3248 virtual void InternalSetOperandAt(int index, HValue* value);
3249 3249
3250 private: 3250 private:
3251 HValue* context_; 3251 HValue* context_;
3252 }; 3252 };
3253 3253
3254 3254
3255 class HStringCharCodeAt: public HBinaryOperation { 3255 class HStringCharCodeAt: public HBinaryOperation {
3256 public: 3256 public:
3257 HStringCharCodeAt(HValue* string, HValue* index) 3257 HStringCharCodeAt(HValue* string, HValue* index)
3258 : HBinaryOperation(string, index) { 3258 : HBinaryOperation(string, index) {
3259 set_representation(Representation::Integer32()); 3259 set_representation(Representation::Integer32());
3260 SetFlag(kUseGVN); 3260 SetFlag(kUseGVN);
3261 } 3261 }
3262 3262
3263 virtual Representation RequiredInputRepresentation(int index) const { 3263 virtual Representation RequiredInputRepresentation(int index) const {
3264 // The index is supposed to be Integer32. 3264 // The index is supposed to be Integer32.
3265 return (index == 1) ? Representation::Integer32() 3265 return (index == 1) ? Representation::Integer32()
3266 : Representation::Tagged(); 3266 : Representation::Tagged();
3267 } 3267 }
3268 3268
3269 HValue* string() const { return OperandAt(0); } 3269 HValue* string() { return OperandAt(0); }
3270 HValue* index() const { return OperandAt(1); } 3270 HValue* index() { return OperandAt(1); }
3271 3271
3272 DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string_char_code_at") 3272 DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string_char_code_at")
3273 3273
3274 protected: 3274 protected:
3275 virtual bool DataEquals(HValue* other) { return true; } 3275 virtual bool DataEquals(HValue* other) { return true; }
3276 3276
3277 virtual Range* InferRange() { 3277 virtual Range* InferRange() {
3278 return new Range(0, String::kMaxUC16CharCode); 3278 return new Range(0, String::kMaxUC16CharCode);
3279 } 3279 }
3280 }; 3280 };
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
3361 fast_elements_(fast_elements) { 3361 fast_elements_(fast_elements) {
3362 SetOperandAt(0, context); 3362 SetOperandAt(0, context);
3363 } 3363 }
3364 3364
3365 HValue* context() const { return context_; } 3365 HValue* context() const { return context_; }
3366 Handle<FixedArray> constant_properties() const { 3366 Handle<FixedArray> constant_properties() const {
3367 return constant_properties_; 3367 return constant_properties_;
3368 } 3368 }
3369 bool fast_elements() const { return fast_elements_; } 3369 bool fast_elements() const { return fast_elements_; }
3370 3370
3371 virtual int OperandCount() const { return 1; } 3371 virtual int OperandCount() { return 1; }
3372 virtual HValue* OperandAt(int index) const { return context_; } 3372 virtual HValue* OperandAt(int index) { return context_; }
3373 3373
3374 DECLARE_CONCRETE_INSTRUCTION(ObjectLiteral, "object_literal") 3374 DECLARE_CONCRETE_INSTRUCTION(ObjectLiteral, "object_literal")
3375 3375
3376 protected: 3376 protected:
3377 virtual void InternalSetOperandAt(int index, HValue* value) { 3377 virtual void InternalSetOperandAt(int index, HValue* value) {
3378 context_ = value; 3378 context_ = value;
3379 } 3379 }
3380 3380
3381 private: 3381 private:
3382 HValue* context_; 3382 HValue* context_;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
3454 set_representation(Representation::Tagged()); 3454 set_representation(Representation::Tagged());
3455 SetAllSideEffects(); 3455 SetAllSideEffects();
3456 } 3456 }
3457 3457
3458 virtual Representation RequiredInputRepresentation(int index) const { 3458 virtual Representation RequiredInputRepresentation(int index) const {
3459 return Representation::Tagged(); 3459 return Representation::Tagged();
3460 } 3460 }
3461 3461
3462 DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete_property") 3462 DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete_property")
3463 3463
3464 HValue* object() const { return left(); } 3464 HValue* object() { return left(); }
3465 HValue* key() const { return right(); } 3465 HValue* key() { return right(); }
3466 }; 3466 };
3467 3467
3468 #undef DECLARE_INSTRUCTION 3468 #undef DECLARE_INSTRUCTION
3469 #undef DECLARE_CONCRETE_INSTRUCTION 3469 #undef DECLARE_CONCRETE_INSTRUCTION
3470 3470
3471 } } // namespace v8::internal 3471 } } // namespace v8::internal
3472 3472
3473 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 3473 #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