Chromium Code Reviews| 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) |