| Index: src/hydrogen-instructions.h
|
| diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
|
| index 66050f1398c1da307365f11854be912f3a39afc3..15f307783b90718525ddd747f6a1d41fd0a30611 100644
|
| --- a/src/hydrogen-instructions.h
|
| +++ b/src/hydrogen-instructions.h
|
| @@ -159,6 +159,7 @@ class LChunkBuilder;
|
| V(Return) \
|
| V(Ror) \
|
| V(Sar) \
|
| + V(SeqStringGetChar) \
|
| V(SeqStringSetChar) \
|
| V(Shl) \
|
| V(Shr) \
|
| @@ -7023,6 +7024,56 @@ class HDateField V8_FINAL : public HUnaryOperation {
|
| };
|
|
|
|
|
| +class HSeqStringGetChar V8_FINAL : public HTemplateInstruction<2> {
|
| + public:
|
| + static HInstruction* New(Zone* zone,
|
| + HValue* context,
|
| + String::Encoding encoding,
|
| + HValue* string,
|
| + HValue* index);
|
| +
|
| + virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
|
| + return (index == 0) ? Representation::Tagged()
|
| + : Representation::Integer32();
|
| + }
|
| +
|
| + String::Encoding encoding() const { return encoding_; }
|
| + HValue* string() const { return OperandAt(0); }
|
| + HValue* index() const { return OperandAt(1); }
|
| +
|
| + DECLARE_CONCRETE_INSTRUCTION(SeqStringGetChar)
|
| +
|
| + protected:
|
| + virtual bool DataEquals(HValue* other) V8_OVERRIDE {
|
| + return encoding() == HSeqStringGetChar::cast(other)->encoding();
|
| + }
|
| +
|
| + virtual Range* InferRange(Zone* zone) V8_OVERRIDE {
|
| + if (encoding() == String::ONE_BYTE_ENCODING) {
|
| + return new(zone) Range(0, String::kMaxOneByteCharCode);
|
| + } else {
|
| + ASSERT_EQ(String::TWO_BYTE_ENCODING, encoding());
|
| + return new(zone) Range(0, String::kMaxUtf16CodeUnit);
|
| + }
|
| + }
|
| +
|
| + private:
|
| + HSeqStringGetChar(String::Encoding encoding,
|
| + HValue* string,
|
| + HValue* index) : encoding_(encoding) {
|
| + SetOperandAt(0, string);
|
| + SetOperandAt(1, index);
|
| + set_representation(Representation::Integer32());
|
| + SetFlag(kUseGVN);
|
| + SetGVNFlag(kDependsOnStringChars);
|
| + }
|
| +
|
| + virtual bool IsDeletable() const V8_OVERRIDE { return true; }
|
| +
|
| + String::Encoding encoding_;
|
| +};
|
| +
|
| +
|
| class HSeqStringSetChar V8_FINAL : public HTemplateInstruction<3> {
|
| public:
|
| DECLARE_INSTRUCTION_FACTORY_P4(HSeqStringSetChar, String::Encoding,
|
|
|