OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 // HCompareJSObjectEq | 74 // HCompareJSObjectEq |
75 // HInstanceOf | 75 // HInstanceOf |
76 // HInstanceOfKnownGlobal | 76 // HInstanceOfKnownGlobal |
77 // HLoadKeyed | 77 // HLoadKeyed |
78 // HLoadKeyedFastElement | 78 // HLoadKeyedFastElement |
79 // HLoadKeyedGeneric | 79 // HLoadKeyedGeneric |
80 // HPower | 80 // HPower |
81 // HStoreNamed | 81 // HStoreNamed |
82 // HStoreNamedField | 82 // HStoreNamedField |
83 // HStoreNamedGeneric | 83 // HStoreNamedGeneric |
| 84 // HStringCharCodeAt |
84 // HBlockEntry | 85 // HBlockEntry |
85 // HCall | 86 // HCall |
86 // HCallConstantFunction | 87 // HCallConstantFunction |
87 // HCallFunction | 88 // HCallFunction |
88 // HCallGlobal | 89 // HCallGlobal |
89 // HCallKeyed | 90 // HCallKeyed |
90 // HCallKnownGlobal | 91 // HCallKnownGlobal |
91 // HCallNamed | 92 // HCallNamed |
92 // HCallNew | 93 // HCallNew |
93 // HCallRuntime | 94 // HCallRuntime |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 // HCheckSmi | 131 // HCheckSmi |
131 // HDeleteProperty | 132 // HDeleteProperty |
132 // HFixedArrayLength | 133 // HFixedArrayLength |
133 // HJSArrayLength | 134 // HJSArrayLength |
134 // HLoadElements | 135 // HLoadElements |
135 // HTypeofIs | 136 // HTypeofIs |
136 // HLoadNamedField | 137 // HLoadNamedField |
137 // HLoadNamedGeneric | 138 // HLoadNamedGeneric |
138 // HLoadFunctionPrototype | 139 // HLoadFunctionPrototype |
139 // HPushArgument | 140 // HPushArgument |
| 141 // HStringLength |
140 // HTypeof | 142 // HTypeof |
141 // HUnaryMathOperation | 143 // HUnaryMathOperation |
142 // HUnaryPredicate | 144 // HUnaryPredicate |
143 // HClassOfTest | 145 // HClassOfTest |
144 // HHasCachedArrayIndex | 146 // HHasCachedArrayIndex |
145 // HHasInstanceType | 147 // HHasInstanceType |
146 // HIsNull | 148 // HIsNull |
147 // HIsObject | 149 // HIsObject |
148 // HIsSmi | 150 // HIsSmi |
149 // HValueOf | 151 // HValueOf |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 V(Sar) \ | 243 V(Sar) \ |
242 V(Shl) \ | 244 V(Shl) \ |
243 V(Shr) \ | 245 V(Shr) \ |
244 V(Simulate) \ | 246 V(Simulate) \ |
245 V(StackCheck) \ | 247 V(StackCheck) \ |
246 V(StoreGlobal) \ | 248 V(StoreGlobal) \ |
247 V(StoreKeyedFastElement) \ | 249 V(StoreKeyedFastElement) \ |
248 V(StoreKeyedGeneric) \ | 250 V(StoreKeyedGeneric) \ |
249 V(StoreNamedField) \ | 251 V(StoreNamedField) \ |
250 V(StoreNamedGeneric) \ | 252 V(StoreNamedGeneric) \ |
| 253 V(StringCharCodeAt) \ |
| 254 V(StringLength) \ |
251 V(Sub) \ | 255 V(Sub) \ |
252 V(Throw) \ | 256 V(Throw) \ |
253 V(Typeof) \ | 257 V(Typeof) \ |
254 V(TypeofIs) \ | 258 V(TypeofIs) \ |
255 V(UnaryMathOperation) \ | 259 V(UnaryMathOperation) \ |
256 V(UnknownOSRValue) \ | 260 V(UnknownOSRValue) \ |
257 V(ValueOf) | 261 V(ValueOf) |
258 | 262 |
259 #define GVN_FLAG_LIST(V) \ | 263 #define GVN_FLAG_LIST(V) \ |
260 V(Calls) \ | 264 V(Calls) \ |
(...skipping 1311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1572 | 1576 |
1573 class HCheckInstanceType: public HUnaryOperation { | 1577 class HCheckInstanceType: public HUnaryOperation { |
1574 public: | 1578 public: |
1575 // Check that the instance type is in the range [first, last] where | 1579 // Check that the instance type is in the range [first, last] where |
1576 // both first and last are included. | 1580 // both first and last are included. |
1577 HCheckInstanceType(HValue* value, InstanceType first, InstanceType last) | 1581 HCheckInstanceType(HValue* value, InstanceType first, InstanceType last) |
1578 : HUnaryOperation(value), first_(first), last_(last) { | 1582 : HUnaryOperation(value), first_(first), last_(last) { |
1579 ASSERT(first <= last); | 1583 ASSERT(first <= last); |
1580 set_representation(Representation::Tagged()); | 1584 set_representation(Representation::Tagged()); |
1581 SetFlag(kUseGVN); | 1585 SetFlag(kUseGVN); |
| 1586 if ((FIRST_STRING_TYPE < first && last <= LAST_STRING_TYPE) || |
| 1587 (FIRST_STRING_TYPE <= first && last < LAST_STRING_TYPE)) { |
| 1588 // A particular string instance type can change because of GC or |
| 1589 // externalization, but the value still remains a string. |
| 1590 SetFlag(kDependsOnMaps); |
| 1591 } |
1582 } | 1592 } |
1583 | 1593 |
1584 virtual bool IsCheckInstruction() const { return true; } | 1594 virtual bool IsCheckInstruction() const { return true; } |
1585 | 1595 |
1586 virtual Representation RequiredInputRepresentation(int index) const { | 1596 virtual Representation RequiredInputRepresentation(int index) const { |
1587 return Representation::Tagged(); | 1597 return Representation::Tagged(); |
1588 } | 1598 } |
1589 | 1599 |
1590 #ifdef DEBUG | 1600 #ifdef DEBUG |
1591 virtual void Verify() const; | 1601 virtual void Verify() const; |
(...skipping 1338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2930 public: | 2940 public: |
2931 HStoreKeyedGeneric(HValue* obj, HValue* key, HValue* val) | 2941 HStoreKeyedGeneric(HValue* obj, HValue* key, HValue* val) |
2932 : HStoreKeyed(obj, key, val) { | 2942 : HStoreKeyed(obj, key, val) { |
2933 SetFlagMask(AllSideEffects()); | 2943 SetFlagMask(AllSideEffects()); |
2934 } | 2944 } |
2935 | 2945 |
2936 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store_keyed_generic") | 2946 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store_keyed_generic") |
2937 }; | 2947 }; |
2938 | 2948 |
2939 | 2949 |
| 2950 class HStringCharCodeAt: public HBinaryOperation { |
| 2951 public: |
| 2952 HStringCharCodeAt(HValue* string, HValue* index) |
| 2953 : HBinaryOperation(string, index) { |
| 2954 set_representation(Representation::Integer32()); |
| 2955 SetFlag(kUseGVN); |
| 2956 } |
| 2957 |
| 2958 virtual Representation RequiredInputRepresentation(int index) const { |
| 2959 // The index is supposed to be Integer32. |
| 2960 return (index == 1) ? Representation::Integer32() |
| 2961 : Representation::Tagged(); |
| 2962 } |
| 2963 |
| 2964 virtual bool DataEquals(HValue* other) const { return true; } |
| 2965 |
| 2966 HValue* string() const { return OperandAt(0); } |
| 2967 HValue* index() const { return OperandAt(1); } |
| 2968 |
| 2969 DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string_char_code_at") |
| 2970 |
| 2971 protected: |
| 2972 virtual Range* InferRange() { |
| 2973 return new Range(0, String::kMaxUC16CharCode); |
| 2974 } |
| 2975 }; |
| 2976 |
| 2977 |
| 2978 class HStringLength: public HUnaryOperation { |
| 2979 public: |
| 2980 explicit HStringLength(HValue* string) : HUnaryOperation(string) { |
| 2981 set_representation(Representation::Tagged()); |
| 2982 SetFlag(kUseGVN); |
| 2983 } |
| 2984 |
| 2985 virtual Representation RequiredInputRepresentation(int index) const { |
| 2986 return Representation::Tagged(); |
| 2987 } |
| 2988 |
| 2989 virtual HType CalculateInferredType() const { |
| 2990 STATIC_ASSERT(String::kMaxLength <= Smi::kMaxValue); |
| 2991 return HType::Smi(); |
| 2992 } |
| 2993 |
| 2994 virtual bool DataEquals(HValue* other) const { return true; } |
| 2995 |
| 2996 DECLARE_CONCRETE_INSTRUCTION(StringLength, "string_length") |
| 2997 |
| 2998 protected: |
| 2999 virtual Range* InferRange() { |
| 3000 return new Range(0, String::kMaxLength); |
| 3001 } |
| 3002 }; |
| 3003 |
| 3004 |
2940 class HMaterializedLiteral: public HInstruction { | 3005 class HMaterializedLiteral: public HInstruction { |
2941 public: | 3006 public: |
2942 HMaterializedLiteral(int index, int depth) | 3007 HMaterializedLiteral(int index, int depth) |
2943 : literal_index_(index), depth_(depth) { | 3008 : literal_index_(index), depth_(depth) { |
2944 set_representation(Representation::Tagged()); | 3009 set_representation(Representation::Tagged()); |
2945 } | 3010 } |
2946 | 3011 |
2947 int literal_index() const { return literal_index_; } | 3012 int literal_index() const { return literal_index_; } |
2948 int depth() const { return depth_; } | 3013 int depth() const { return depth_; } |
2949 | 3014 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3076 HValue* object() const { return left(); } | 3141 HValue* object() const { return left(); } |
3077 HValue* key() const { return right(); } | 3142 HValue* key() const { return right(); } |
3078 }; | 3143 }; |
3079 | 3144 |
3080 #undef DECLARE_INSTRUCTION | 3145 #undef DECLARE_INSTRUCTION |
3081 #undef DECLARE_CONCRETE_INSTRUCTION | 3146 #undef DECLARE_CONCRETE_INSTRUCTION |
3082 | 3147 |
3083 } } // namespace v8::internal | 3148 } } // namespace v8::internal |
3084 | 3149 |
3085 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 3150 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |