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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index 5cc8432c00689865d73bc879ce0c42c09969ee0d..ad3ad9781b753b199a900fa164def4972c70826f 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -81,6 +81,7 @@ class LChunkBuilder;
// HStoreNamed
// HStoreNamedField
// HStoreNamedGeneric
+// HStringChartCodeAt
fschneider 2011/01/14 12:06:11 ->HStringCharCodeAt
// HBlockEntry
// HCall
// HCallConstantFunction
@@ -136,6 +137,7 @@ class LChunkBuilder;
// HLoadNamedGeneric
// HLoadFunctionPrototype
// HPushArgument
+// HStringLength
// HTypeof
// HUnaryMathOperation
// HUnaryPredicate
@@ -246,6 +248,8 @@ class LChunkBuilder;
V(StoreKeyedGeneric) \
V(StoreNamedField) \
V(StoreNamedGeneric) \
+ V(StringCharCodeAt) \
+ V(StringLength) \
V(Sub) \
V(Throw) \
V(Typeof) \
@@ -2884,6 +2888,46 @@ class HStoreKeyedGeneric: public HStoreKeyed {
};
+class HStringCharCodeAt: public HBinaryOperation {
+ public:
+ HStringCharCodeAt(HValue* string, HValue* index)
+ : HBinaryOperation(string, index){
+ set_representation(Representation::Integer32());
+ SetFlag(kUseGVN);
+ }
+
+ virtual Representation RequiredInputRepresentation(int index) const {
+ // The index is supposed to be Integer32.
+ return (index == 1) ? Representation::Integer32()
+ : Representation::Tagged();
+ }
+
+ virtual bool DataEquals(HValue* other) const { return true; }
+
+ HValue* string() const { return OperandAt(0); }
+ HValue* index() const { return OperandAt(1); }
+
+ DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string_char_code_at")
+};
+
+
+class HStringLength: public HUnaryOperation {
fschneider 2011/01/14 12:06:11 Could you use HStringLength to optimize access lik
+ public:
+ explicit HStringLength(HValue* string) : HUnaryOperation(string) {
+ set_representation(Representation::Tagged());
+ SetFlag(kUseGVN);
+ }
+
+ virtual Representation RequiredInputRepresentation(int index) const {
+ return Representation::Tagged();
+ }
+
+ virtual bool DataEquals(HValue* other) const { return true; }
+
+ DECLARE_CONCRETE_INSTRUCTION(StringLength, "string_length")
+};
+
+
class HMaterializedLiteral: public HInstruction {
public:
HMaterializedLiteral(int index, int depth)
« 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