OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 V(OsrEntry) \ | 152 V(OsrEntry) \ |
153 V(OuterContext) \ | 153 V(OuterContext) \ |
154 V(Parameter) \ | 154 V(Parameter) \ |
155 V(Power) \ | 155 V(Power) \ |
156 V(PushArgument) \ | 156 V(PushArgument) \ |
157 V(Random) \ | 157 V(Random) \ |
158 V(RegExpLiteral) \ | 158 V(RegExpLiteral) \ |
159 V(Return) \ | 159 V(Return) \ |
160 V(Ror) \ | 160 V(Ror) \ |
161 V(Sar) \ | 161 V(Sar) \ |
162 V(SeqStringGetChar) \ | |
163 V(SeqStringSetChar) \ | 162 V(SeqStringSetChar) \ |
164 V(Shl) \ | 163 V(Shl) \ |
165 V(Shr) \ | 164 V(Shr) \ |
166 V(Simulate) \ | 165 V(Simulate) \ |
167 V(StackCheck) \ | 166 V(StackCheck) \ |
168 V(StoreCodeEntry) \ | 167 V(StoreCodeEntry) \ |
169 V(StoreContextSlot) \ | 168 V(StoreContextSlot) \ |
170 V(StoreGlobalCell) \ | 169 V(StoreGlobalCell) \ |
171 V(StoreGlobalGeneric) \ | 170 V(StoreGlobalGeneric) \ |
172 V(StoreKeyed) \ | 171 V(StoreKeyed) \ |
(...skipping 6844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7017 private: | 7016 private: |
7018 HDateField(HValue* date, Smi* index) | 7017 HDateField(HValue* date, Smi* index) |
7019 : HUnaryOperation(date), index_(index) { | 7018 : HUnaryOperation(date), index_(index) { |
7020 set_representation(Representation::Tagged()); | 7019 set_representation(Representation::Tagged()); |
7021 } | 7020 } |
7022 | 7021 |
7023 Smi* index_; | 7022 Smi* index_; |
7024 }; | 7023 }; |
7025 | 7024 |
7026 | 7025 |
7027 class HSeqStringGetChar V8_FINAL : public HTemplateInstruction<2> { | |
7028 public: | |
7029 static HInstruction* New(Zone* zone, | |
7030 HValue* context, | |
7031 String::Encoding encoding, | |
7032 HValue* string, | |
7033 HValue* index); | |
7034 | |
7035 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | |
7036 return (index == 0) ? Representation::Tagged() | |
7037 : Representation::Integer32(); | |
7038 } | |
7039 | |
7040 String::Encoding encoding() const { return encoding_; } | |
7041 HValue* string() const { return OperandAt(0); } | |
7042 HValue* index() const { return OperandAt(1); } | |
7043 | |
7044 DECLARE_CONCRETE_INSTRUCTION(SeqStringGetChar) | |
7045 | |
7046 protected: | |
7047 virtual bool DataEquals(HValue* other) V8_OVERRIDE { | |
7048 return encoding() == HSeqStringGetChar::cast(other)->encoding(); | |
7049 } | |
7050 | |
7051 virtual Range* InferRange(Zone* zone) V8_OVERRIDE { | |
7052 if (encoding() == String::ONE_BYTE_ENCODING) { | |
7053 return new(zone) Range(0, String::kMaxOneByteCharCode); | |
7054 } else { | |
7055 ASSERT_EQ(String::TWO_BYTE_ENCODING, encoding()); | |
7056 return new(zone) Range(0, String::kMaxUtf16CodeUnit); | |
7057 } | |
7058 } | |
7059 | |
7060 private: | |
7061 HSeqStringGetChar(String::Encoding encoding, | |
7062 HValue* string, | |
7063 HValue* index) : encoding_(encoding) { | |
7064 SetOperandAt(0, string); | |
7065 SetOperandAt(1, index); | |
7066 set_representation(Representation::Integer32()); | |
7067 SetFlag(kUseGVN); | |
7068 SetGVNFlag(kDependsOnStringChars); | |
7069 } | |
7070 | |
7071 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | |
7072 | |
7073 String::Encoding encoding_; | |
7074 }; | |
7075 | |
7076 | |
7077 class HSeqStringSetChar V8_FINAL : public HTemplateInstruction<3> { | 7026 class HSeqStringSetChar V8_FINAL : public HTemplateInstruction<3> { |
7078 public: | 7027 public: |
7079 DECLARE_INSTRUCTION_FACTORY_P4(HSeqStringSetChar, String::Encoding, | 7028 DECLARE_INSTRUCTION_FACTORY_P4(HSeqStringSetChar, String::Encoding, |
7080 HValue*, HValue*, HValue*); | 7029 HValue*, HValue*, HValue*); |
7081 | 7030 |
7082 String::Encoding encoding() { return encoding_; } | 7031 String::Encoding encoding() { return encoding_; } |
7083 HValue* string() { return OperandAt(0); } | 7032 HValue* string() { return OperandAt(0); } |
7084 HValue* index() { return OperandAt(1); } | 7033 HValue* index() { return OperandAt(1); } |
7085 HValue* value() { return OperandAt(2); } | 7034 HValue* value() { return OperandAt(2); } |
7086 | 7035 |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7244 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | 7193 virtual bool IsDeletable() const V8_OVERRIDE { return true; } |
7245 }; | 7194 }; |
7246 | 7195 |
7247 | 7196 |
7248 #undef DECLARE_INSTRUCTION | 7197 #undef DECLARE_INSTRUCTION |
7249 #undef DECLARE_CONCRETE_INSTRUCTION | 7198 #undef DECLARE_CONCRETE_INSTRUCTION |
7250 | 7199 |
7251 } } // namespace v8::internal | 7200 } } // namespace v8::internal |
7252 | 7201 |
7253 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7202 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |