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

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

Issue 6304001: Support StringCharCodeAt in hydrogen/lithium. (Closed)
Patch Set: Created 9 years, 11 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
OLDNEW
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
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 // HStringChartCodeAt
fschneider 2011/01/14 12:06:11 ->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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 // HCheckSmi 130 // HCheckSmi
130 // HDeleteProperty 131 // HDeleteProperty
131 // HFixedArrayLength 132 // HFixedArrayLength
132 // HJSArrayLength 133 // HJSArrayLength
133 // HLoadElements 134 // HLoadElements
134 // HTypeofIs 135 // HTypeofIs
135 // HLoadNamedField 136 // HLoadNamedField
136 // HLoadNamedGeneric 137 // HLoadNamedGeneric
137 // HLoadFunctionPrototype 138 // HLoadFunctionPrototype
138 // HPushArgument 139 // HPushArgument
140 // HStringLength
139 // HTypeof 141 // HTypeof
140 // HUnaryMathOperation 142 // HUnaryMathOperation
141 // HUnaryPredicate 143 // HUnaryPredicate
142 // HClassOfTest 144 // HClassOfTest
143 // HHasCachedArrayIndex 145 // HHasCachedArrayIndex
144 // HHasInstanceType 146 // HHasInstanceType
145 // HIsNull 147 // HIsNull
146 // HIsObject 148 // HIsObject
147 // HIsSmi 149 // HIsSmi
148 // HValueOf 150 // HValueOf
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 V(Sar) \ 241 V(Sar) \
240 V(Shl) \ 242 V(Shl) \
241 V(Shr) \ 243 V(Shr) \
242 V(Simulate) \ 244 V(Simulate) \
243 V(StackCheck) \ 245 V(StackCheck) \
244 V(StoreGlobal) \ 246 V(StoreGlobal) \
245 V(StoreKeyedFastElement) \ 247 V(StoreKeyedFastElement) \
246 V(StoreKeyedGeneric) \ 248 V(StoreKeyedGeneric) \
247 V(StoreNamedField) \ 249 V(StoreNamedField) \
248 V(StoreNamedGeneric) \ 250 V(StoreNamedGeneric) \
251 V(StringCharCodeAt) \
252 V(StringLength) \
249 V(Sub) \ 253 V(Sub) \
250 V(Throw) \ 254 V(Throw) \
251 V(Typeof) \ 255 V(Typeof) \
252 V(TypeofIs) \ 256 V(TypeofIs) \
253 V(UnaryMathOperation) \ 257 V(UnaryMathOperation) \
254 V(UnknownOSRValue) \ 258 V(UnknownOSRValue) \
255 V(ValueOf) 259 V(ValueOf)
256 260
257 #define GVN_FLAG_LIST(V) \ 261 #define GVN_FLAG_LIST(V) \
258 V(Calls) \ 262 V(Calls) \
(...skipping 2618 matching lines...) Expand 10 before | Expand all | Expand 10 after
2877 public: 2881 public:
2878 HStoreKeyedGeneric(HValue* obj, HValue* key, HValue* val) 2882 HStoreKeyedGeneric(HValue* obj, HValue* key, HValue* val)
2879 : HStoreKeyed(obj, key, val) { 2883 : HStoreKeyed(obj, key, val) {
2880 SetFlagMask(AllSideEffects()); 2884 SetFlagMask(AllSideEffects());
2881 } 2885 }
2882 2886
2883 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store_keyed_generic") 2887 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store_keyed_generic")
2884 }; 2888 };
2885 2889
2886 2890
2891 class HStringCharCodeAt: public HBinaryOperation {
2892 public:
2893 HStringCharCodeAt(HValue* string, HValue* index)
2894 : HBinaryOperation(string, index){
2895 set_representation(Representation::Integer32());
2896 SetFlag(kUseGVN);
2897 }
2898
2899 virtual Representation RequiredInputRepresentation(int index) const {
2900 // The index is supposed to be Integer32.
2901 return (index == 1) ? Representation::Integer32()
2902 : Representation::Tagged();
2903 }
2904
2905 virtual bool DataEquals(HValue* other) const { return true; }
2906
2907 HValue* string() const { return OperandAt(0); }
2908 HValue* index() const { return OperandAt(1); }
2909
2910 DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string_char_code_at")
2911 };
2912
2913
2914 class HStringLength: public HUnaryOperation {
fschneider 2011/01/14 12:06:11 Could you use HStringLength to optimize access lik
2915 public:
2916 explicit HStringLength(HValue* string) : HUnaryOperation(string) {
2917 set_representation(Representation::Tagged());
2918 SetFlag(kUseGVN);
2919 }
2920
2921 virtual Representation RequiredInputRepresentation(int index) const {
2922 return Representation::Tagged();
2923 }
2924
2925 virtual bool DataEquals(HValue* other) const { return true; }
2926
2927 DECLARE_CONCRETE_INSTRUCTION(StringLength, "string_length")
2928 };
2929
2930
2887 class HMaterializedLiteral: public HInstruction { 2931 class HMaterializedLiteral: public HInstruction {
2888 public: 2932 public:
2889 HMaterializedLiteral(int index, int depth) 2933 HMaterializedLiteral(int index, int depth)
2890 : literal_index_(index), depth_(depth) { 2934 : literal_index_(index), depth_(depth) {
2891 set_representation(Representation::Tagged()); 2935 set_representation(Representation::Tagged());
2892 } 2936 }
2893 2937
2894 int literal_index() const { return literal_index_; } 2938 int literal_index() const { return literal_index_; }
2895 int depth() const { return depth_; } 2939 int depth() const { return depth_; }
2896 2940
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
3023 HValue* object() const { return left(); } 3067 HValue* object() const { return left(); }
3024 HValue* key() const { return right(); } 3068 HValue* key() const { return right(); }
3025 }; 3069 };
3026 3070
3027 #undef DECLARE_INSTRUCTION 3071 #undef DECLARE_INSTRUCTION
3028 #undef DECLARE_CONCRETE_INSTRUCTION 3072 #undef DECLARE_CONCRETE_INSTRUCTION
3029 3073
3030 } } // namespace v8::internal 3074 } } // namespace v8::internal
3031 3075
3032 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 3076 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/ia32/lithium-codegen-ia32.h » ('j') | src/ia32/lithium-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698