OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_ | 5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_ |
6 #define V8_HYDROGEN_INSTRUCTIONS_H_ | 6 #define V8_HYDROGEN_INSTRUCTIONS_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 | 9 |
10 #include "src/v8.h" | 10 #include "src/v8.h" |
(...skipping 1494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1505 Unique<Map> map() const { return map_; } | 1505 Unique<Map> map() const { return map_; } |
1506 bool map_is_stable() const { return map_is_stable_; } | 1506 bool map_is_stable() const { return map_is_stable_; } |
1507 | 1507 |
1508 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 1508 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
1509 return Representation::Tagged(); | 1509 return Representation::Tagged(); |
1510 } | 1510 } |
1511 | 1511 |
1512 DECLARE_CONCRETE_INSTRUCTION(CompareMap) | 1512 DECLARE_CONCRETE_INSTRUCTION(CompareMap) |
1513 | 1513 |
1514 protected: | 1514 protected: |
1515 virtual int RedefinedOperandIndex() { return 0; } | 1515 virtual int RedefinedOperandIndex() OVERRIDE { return 0; } |
1516 | 1516 |
1517 private: | 1517 private: |
1518 HCompareMap(HValue* value, | 1518 HCompareMap(HValue* value, |
1519 Handle<Map> map, | 1519 Handle<Map> map, |
1520 HBasicBlock* true_target = NULL, | 1520 HBasicBlock* true_target = NULL, |
1521 HBasicBlock* false_target = NULL) | 1521 HBasicBlock* false_target = NULL) |
1522 : HUnaryControlInstruction(value, true_target, false_target), | 1522 : HUnaryControlInstruction(value, true_target, false_target), |
1523 known_successor_index_(kNoKnownSuccessorIndex), | 1523 known_successor_index_(kNoKnownSuccessorIndex), |
1524 map_is_stable_(map->is_stable()), | 1524 map_is_stable_(map->is_stable()), |
1525 map_(Unique<Map>::CreateImmovable(map)) { | 1525 map_(Unique<Map>::CreateImmovable(map)) { |
(...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2793 return instr->Prepend(new(zone) HCheckMaps(value, maps, maps_are_stable)); | 2793 return instr->Prepend(new(zone) HCheckMaps(value, maps, maps_are_stable)); |
2794 } | 2794 } |
2795 | 2795 |
2796 DECLARE_CONCRETE_INSTRUCTION(CheckMaps) | 2796 DECLARE_CONCRETE_INSTRUCTION(CheckMaps) |
2797 | 2797 |
2798 protected: | 2798 protected: |
2799 virtual bool DataEquals(HValue* other) OVERRIDE { | 2799 virtual bool DataEquals(HValue* other) OVERRIDE { |
2800 return this->maps()->Equals(HCheckMaps::cast(other)->maps()); | 2800 return this->maps()->Equals(HCheckMaps::cast(other)->maps()); |
2801 } | 2801 } |
2802 | 2802 |
2803 virtual int RedefinedOperandIndex() { return 0; } | 2803 virtual int RedefinedOperandIndex() OVERRIDE { return 0; } |
2804 | 2804 |
2805 private: | 2805 private: |
2806 HCheckMaps(HValue* value, const UniqueSet<Map>* maps, bool maps_are_stable) | 2806 HCheckMaps(HValue* value, const UniqueSet<Map>* maps, bool maps_are_stable) |
2807 : HTemplateInstruction<2>(HType::HeapObject()), maps_(maps), | 2807 : HTemplateInstruction<2>(HType::HeapObject()), maps_(maps), |
2808 has_migration_target_(false), is_stability_check_(false), | 2808 has_migration_target_(false), is_stability_check_(false), |
2809 maps_are_stable_(maps_are_stable) { | 2809 maps_are_stable_(maps_are_stable) { |
2810 DCHECK_NE(0, maps->size()); | 2810 DCHECK_NE(0, maps->size()); |
2811 SetOperandAt(0, value); | 2811 SetOperandAt(0, value); |
2812 // Use the object value for the dependency. | 2812 // Use the object value for the dependency. |
2813 SetOperandAt(1, value); | 2813 SetOperandAt(1, value); |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2945 | 2945 |
2946 protected: | 2946 protected: |
2947 // TODO(ager): It could be nice to allow the ommision of instance | 2947 // TODO(ager): It could be nice to allow the ommision of instance |
2948 // type checks if we have already performed an instance type check | 2948 // type checks if we have already performed an instance type check |
2949 // with a larger range. | 2949 // with a larger range. |
2950 virtual bool DataEquals(HValue* other) OVERRIDE { | 2950 virtual bool DataEquals(HValue* other) OVERRIDE { |
2951 HCheckInstanceType* b = HCheckInstanceType::cast(other); | 2951 HCheckInstanceType* b = HCheckInstanceType::cast(other); |
2952 return check_ == b->check_; | 2952 return check_ == b->check_; |
2953 } | 2953 } |
2954 | 2954 |
2955 virtual int RedefinedOperandIndex() { return 0; } | 2955 virtual int RedefinedOperandIndex() OVERRIDE { return 0; } |
2956 | 2956 |
2957 private: | 2957 private: |
2958 const char* GetCheckName() const; | 2958 const char* GetCheckName() const; |
2959 | 2959 |
2960 HCheckInstanceType(HValue* value, Check check) | 2960 HCheckInstanceType(HValue* value, Check check) |
2961 : HUnaryOperation(value, HType::HeapObject()), check_(check) { | 2961 : HUnaryOperation(value, HType::HeapObject()), check_(check) { |
2962 set_representation(Representation::Tagged()); | 2962 set_representation(Representation::Tagged()); |
2963 SetFlag(kUseGVN); | 2963 SetFlag(kUseGVN); |
2964 } | 2964 } |
2965 | 2965 |
(...skipping 1202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4168 if (new_rep.IsDouble()) new_rep = Representation::Integer32(); | 4168 if (new_rep.IsDouble()) new_rep = Representation::Integer32(); |
4169 HBinaryOperation::UpdateRepresentation(new_rep, h_infer, reason); | 4169 HBinaryOperation::UpdateRepresentation(new_rep, h_infer, reason); |
4170 } | 4170 } |
4171 | 4171 |
4172 virtual Representation observed_input_representation(int index) OVERRIDE { | 4172 virtual Representation observed_input_representation(int index) OVERRIDE { |
4173 Representation r = HBinaryOperation::observed_input_representation(index); | 4173 Representation r = HBinaryOperation::observed_input_representation(index); |
4174 if (r.IsDouble()) return Representation::Integer32(); | 4174 if (r.IsDouble()) return Representation::Integer32(); |
4175 return r; | 4175 return r; |
4176 } | 4176 } |
4177 | 4177 |
4178 virtual void initialize_output_representation(Representation observed) { | 4178 virtual void initialize_output_representation( |
| 4179 Representation observed) OVERRIDE { |
4179 if (observed.IsDouble()) observed = Representation::Integer32(); | 4180 if (observed.IsDouble()) observed = Representation::Integer32(); |
4180 HBinaryOperation::initialize_output_representation(observed); | 4181 HBinaryOperation::initialize_output_representation(observed); |
4181 } | 4182 } |
4182 | 4183 |
4183 DECLARE_ABSTRACT_INSTRUCTION(BitwiseBinaryOperation) | 4184 DECLARE_ABSTRACT_INSTRUCTION(BitwiseBinaryOperation) |
4184 | 4185 |
4185 private: | 4186 private: |
4186 virtual bool IsDeletable() const OVERRIDE { return true; } | 4187 virtual bool IsDeletable() const OVERRIDE { return true; } |
4187 }; | 4188 }; |
4188 | 4189 |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4467 | 4468 |
4468 static const int kNoKnownSuccessorIndex = -1; | 4469 static const int kNoKnownSuccessorIndex = -1; |
4469 int known_successor_index() const { return known_successor_index_; } | 4470 int known_successor_index() const { return known_successor_index_; } |
4470 void set_known_successor_index(int known_successor_index) { | 4471 void set_known_successor_index(int known_successor_index) { |
4471 known_successor_index_ = known_successor_index; | 4472 known_successor_index_ = known_successor_index; |
4472 } | 4473 } |
4473 | 4474 |
4474 DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch) | 4475 DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch) |
4475 | 4476 |
4476 protected: | 4477 protected: |
4477 virtual int RedefinedOperandIndex() { return 0; } | 4478 virtual int RedefinedOperandIndex() OVERRIDE { return 0; } |
4478 | 4479 |
4479 private: | 4480 private: |
4480 HIsStringAndBranch(HValue* value, HBasicBlock* true_target = NULL, | 4481 HIsStringAndBranch(HValue* value, HBasicBlock* true_target = NULL, |
4481 HBasicBlock* false_target = NULL) | 4482 HBasicBlock* false_target = NULL) |
4482 : HUnaryControlInstruction(value, true_target, false_target), | 4483 : HUnaryControlInstruction(value, true_target, false_target), |
4483 known_successor_index_(kNoKnownSuccessorIndex) { | 4484 known_successor_index_(kNoKnownSuccessorIndex) { |
4484 set_representation(Representation::Tagged()); | 4485 set_representation(Representation::Tagged()); |
4485 } | 4486 } |
4486 | 4487 |
4487 int known_successor_index_; | 4488 int known_successor_index_; |
4488 }; | 4489 }; |
4489 | 4490 |
4490 | 4491 |
4491 class HIsSmiAndBranch FINAL : public HUnaryControlInstruction { | 4492 class HIsSmiAndBranch FINAL : public HUnaryControlInstruction { |
4492 public: | 4493 public: |
4493 DECLARE_INSTRUCTION_FACTORY_P1(HIsSmiAndBranch, HValue*); | 4494 DECLARE_INSTRUCTION_FACTORY_P1(HIsSmiAndBranch, HValue*); |
4494 DECLARE_INSTRUCTION_FACTORY_P3(HIsSmiAndBranch, HValue*, | 4495 DECLARE_INSTRUCTION_FACTORY_P3(HIsSmiAndBranch, HValue*, |
4495 HBasicBlock*, HBasicBlock*); | 4496 HBasicBlock*, HBasicBlock*); |
4496 | 4497 |
4497 DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch) | 4498 DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch) |
4498 | 4499 |
4499 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 4500 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
4500 return Representation::Tagged(); | 4501 return Representation::Tagged(); |
4501 } | 4502 } |
4502 | 4503 |
4503 protected: | 4504 protected: |
4504 virtual bool DataEquals(HValue* other) OVERRIDE { return true; } | 4505 virtual bool DataEquals(HValue* other) OVERRIDE { return true; } |
4505 virtual int RedefinedOperandIndex() { return 0; } | 4506 virtual int RedefinedOperandIndex() OVERRIDE { return 0; } |
4506 | 4507 |
4507 private: | 4508 private: |
4508 HIsSmiAndBranch(HValue* value, | 4509 HIsSmiAndBranch(HValue* value, |
4509 HBasicBlock* true_target = NULL, | 4510 HBasicBlock* true_target = NULL, |
4510 HBasicBlock* false_target = NULL) | 4511 HBasicBlock* false_target = NULL) |
4511 : HUnaryControlInstruction(value, true_target, false_target) { | 4512 : HUnaryControlInstruction(value, true_target, false_target) { |
4512 set_representation(Representation::Tagged()); | 4513 set_representation(Representation::Tagged()); |
4513 } | 4514 } |
4514 }; | 4515 }; |
4515 | 4516 |
(...skipping 867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5383 } | 5384 } |
5384 | 5385 |
5385 Code::Flags flags_; | 5386 Code::Flags flags_; |
5386 }; | 5387 }; |
5387 | 5388 |
5388 | 5389 |
5389 class HUnknownOSRValue FINAL : public HTemplateInstruction<0> { | 5390 class HUnknownOSRValue FINAL : public HTemplateInstruction<0> { |
5390 public: | 5391 public: |
5391 DECLARE_INSTRUCTION_FACTORY_P2(HUnknownOSRValue, HEnvironment*, int); | 5392 DECLARE_INSTRUCTION_FACTORY_P2(HUnknownOSRValue, HEnvironment*, int); |
5392 | 5393 |
5393 virtual std::ostream& PrintDataTo(std::ostream& os) const; // NOLINT | 5394 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
5394 | 5395 |
5395 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 5396 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
5396 return Representation::None(); | 5397 return Representation::None(); |
5397 } | 5398 } |
5398 | 5399 |
5399 void set_incoming_value(HPhi* value) { incoming_value_ = value; } | 5400 void set_incoming_value(HPhi* value) { incoming_value_ = value; } |
5400 HPhi* incoming_value() { return incoming_value_; } | 5401 HPhi* incoming_value() { return incoming_value_; } |
5401 HEnvironment *environment() { return environment_; } | 5402 HEnvironment *environment() { return environment_; } |
5402 int index() { return index_; } | 5403 int index() { return index_; } |
5403 | 5404 |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5706 | 5707 |
5707 class HStoreCodeEntry FINAL: public HTemplateInstruction<2> { | 5708 class HStoreCodeEntry FINAL: public HTemplateInstruction<2> { |
5708 public: | 5709 public: |
5709 static HStoreCodeEntry* New(Zone* zone, | 5710 static HStoreCodeEntry* New(Zone* zone, |
5710 HValue* context, | 5711 HValue* context, |
5711 HValue* function, | 5712 HValue* function, |
5712 HValue* code) { | 5713 HValue* code) { |
5713 return new(zone) HStoreCodeEntry(function, code); | 5714 return new(zone) HStoreCodeEntry(function, code); |
5714 } | 5715 } |
5715 | 5716 |
5716 virtual Representation RequiredInputRepresentation(int index) { | 5717 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
5717 return Representation::Tagged(); | 5718 return Representation::Tagged(); |
5718 } | 5719 } |
5719 | 5720 |
5720 HValue* function() { return OperandAt(0); } | 5721 HValue* function() { return OperandAt(0); } |
5721 HValue* code_object() { return OperandAt(1); } | 5722 HValue* code_object() { return OperandAt(1); } |
5722 | 5723 |
5723 DECLARE_CONCRETE_INSTRUCTION(StoreCodeEntry) | 5724 DECLARE_CONCRETE_INSTRUCTION(StoreCodeEntry) |
5724 | 5725 |
5725 private: | 5726 private: |
5726 HStoreCodeEntry(HValue* function, HValue* code) { | 5727 HStoreCodeEntry(HValue* function, HValue* code) { |
(...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6590 return is_external() || is_fixed_typed_array(); | 6591 return is_external() || is_fixed_typed_array(); |
6591 } | 6592 } |
6592 HValue* elements() const { return OperandAt(0); } | 6593 HValue* elements() const { return OperandAt(0); } |
6593 HValue* key() const { return OperandAt(1); } | 6594 HValue* key() const { return OperandAt(1); } |
6594 HValue* dependency() const { | 6595 HValue* dependency() const { |
6595 DCHECK(HasDependency()); | 6596 DCHECK(HasDependency()); |
6596 return OperandAt(2); | 6597 return OperandAt(2); |
6597 } | 6598 } |
6598 bool HasDependency() const { return OperandAt(0) != OperandAt(2); } | 6599 bool HasDependency() const { return OperandAt(0) != OperandAt(2); } |
6599 uint32_t base_offset() const { return BaseOffsetField::decode(bit_field_); } | 6600 uint32_t base_offset() const { return BaseOffsetField::decode(bit_field_); } |
6600 bool TryIncreaseBaseOffset(uint32_t increase_by_value); | 6601 bool TryIncreaseBaseOffset(uint32_t increase_by_value) OVERRIDE; |
6601 HValue* GetKey() { return key(); } | 6602 HValue* GetKey() OVERRIDE { return key(); } |
6602 void SetKey(HValue* key) { SetOperandAt(1, key); } | 6603 void SetKey(HValue* key) OVERRIDE { SetOperandAt(1, key); } |
6603 bool IsDehoisted() const { return IsDehoistedField::decode(bit_field_); } | 6604 bool IsDehoisted() const OVERRIDE { |
6604 void SetDehoisted(bool is_dehoisted) { | 6605 return IsDehoistedField::decode(bit_field_); |
| 6606 } |
| 6607 void SetDehoisted(bool is_dehoisted) OVERRIDE { |
6605 bit_field_ = IsDehoistedField::update(bit_field_, is_dehoisted); | 6608 bit_field_ = IsDehoistedField::update(bit_field_, is_dehoisted); |
6606 } | 6609 } |
6607 virtual ElementsKind elements_kind() const OVERRIDE { | 6610 virtual ElementsKind elements_kind() const OVERRIDE { |
6608 return ElementsKindField::decode(bit_field_); | 6611 return ElementsKindField::decode(bit_field_); |
6609 } | 6612 } |
6610 LoadKeyedHoleMode hole_mode() const { | 6613 LoadKeyedHoleMode hole_mode() const { |
6611 return HoleModeField::decode(bit_field_); | 6614 return HoleModeField::decode(bit_field_); |
6612 } | 6615 } |
6613 | 6616 |
6614 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 6617 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7068 return r; | 7071 return r; |
7069 } | 7072 } |
7070 | 7073 |
7071 HValue* elements() const { return OperandAt(0); } | 7074 HValue* elements() const { return OperandAt(0); } |
7072 HValue* key() const { return OperandAt(1); } | 7075 HValue* key() const { return OperandAt(1); } |
7073 HValue* value() const { return OperandAt(2); } | 7076 HValue* value() const { return OperandAt(2); } |
7074 bool value_is_smi() const { | 7077 bool value_is_smi() const { |
7075 return IsFastSmiElementsKind(elements_kind_); | 7078 return IsFastSmiElementsKind(elements_kind_); |
7076 } | 7079 } |
7077 StoreFieldOrKeyedMode store_mode() const { return store_mode_; } | 7080 StoreFieldOrKeyedMode store_mode() const { return store_mode_; } |
7078 ElementsKind elements_kind() const { return elements_kind_; } | 7081 ElementsKind elements_kind() const OVERRIDE { return elements_kind_; } |
7079 uint32_t base_offset() const { return base_offset_; } | 7082 uint32_t base_offset() const { return base_offset_; } |
7080 bool TryIncreaseBaseOffset(uint32_t increase_by_value); | 7083 bool TryIncreaseBaseOffset(uint32_t increase_by_value) OVERRIDE; |
7081 HValue* GetKey() { return key(); } | 7084 HValue* GetKey() OVERRIDE { return key(); } |
7082 void SetKey(HValue* key) { SetOperandAt(1, key); } | 7085 void SetKey(HValue* key) OVERRIDE { SetOperandAt(1, key); } |
7083 bool IsDehoisted() const { return is_dehoisted_; } | 7086 bool IsDehoisted() const OVERRIDE { return is_dehoisted_; } |
7084 void SetDehoisted(bool is_dehoisted) { is_dehoisted_ = is_dehoisted; } | 7087 void SetDehoisted(bool is_dehoisted) OVERRIDE { |
| 7088 is_dehoisted_ = is_dehoisted; |
| 7089 } |
7085 bool IsUninitialized() { return is_uninitialized_; } | 7090 bool IsUninitialized() { return is_uninitialized_; } |
7086 void SetUninitialized(bool is_uninitialized) { | 7091 void SetUninitialized(bool is_uninitialized) { |
7087 is_uninitialized_ = is_uninitialized; | 7092 is_uninitialized_ = is_uninitialized; |
7088 } | 7093 } |
7089 | 7094 |
7090 bool IsConstantHoleStore() { | 7095 bool IsConstantHoleStore() { |
7091 return value()->IsConstant() && HConstant::cast(value())->IsTheHole(); | 7096 return value()->IsConstant() && HConstant::cast(value())->IsTheHole(); |
7092 } | 7097 } |
7093 | 7098 |
7094 virtual bool HandleSideEffectDominator(GVNFlag side_effect, | 7099 virtual bool HandleSideEffectDominator(GVNFlag side_effect, |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7236 | 7241 |
7237 DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind) | 7242 DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind) |
7238 | 7243 |
7239 protected: | 7244 protected: |
7240 virtual bool DataEquals(HValue* other) OVERRIDE { | 7245 virtual bool DataEquals(HValue* other) OVERRIDE { |
7241 HTransitionElementsKind* instr = HTransitionElementsKind::cast(other); | 7246 HTransitionElementsKind* instr = HTransitionElementsKind::cast(other); |
7242 return original_map_ == instr->original_map_ && | 7247 return original_map_ == instr->original_map_ && |
7243 transitioned_map_ == instr->transitioned_map_; | 7248 transitioned_map_ == instr->transitioned_map_; |
7244 } | 7249 } |
7245 | 7250 |
7246 virtual int RedefinedOperandIndex() { return 0; } | 7251 virtual int RedefinedOperandIndex() OVERRIDE { return 0; } |
7247 | 7252 |
7248 private: | 7253 private: |
7249 HTransitionElementsKind(HValue* context, | 7254 HTransitionElementsKind(HValue* context, |
7250 HValue* object, | 7255 HValue* object, |
7251 Handle<Map> original_map, | 7256 Handle<Map> original_map, |
7252 Handle<Map> transitioned_map) | 7257 Handle<Map> transitioned_map) |
7253 : original_map_(Unique<Map>(original_map)), | 7258 : original_map_(Unique<Map>(original_map)), |
7254 transitioned_map_(Unique<Map>(transitioned_map)), | 7259 transitioned_map_(Unique<Map>(transitioned_map)), |
7255 from_kind_(original_map->elements_kind()), | 7260 from_kind_(original_map->elements_kind()), |
7256 to_kind_(transitioned_map->elements_kind()) { | 7261 to_kind_(transitioned_map->elements_kind()) { |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7329 const PretenureFlag pretenure_flag_; | 7334 const PretenureFlag pretenure_flag_; |
7330 }; | 7335 }; |
7331 | 7336 |
7332 | 7337 |
7333 class HStringCharCodeAt FINAL : public HTemplateInstruction<3> { | 7338 class HStringCharCodeAt FINAL : public HTemplateInstruction<3> { |
7334 public: | 7339 public: |
7335 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HStringCharCodeAt, | 7340 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HStringCharCodeAt, |
7336 HValue*, | 7341 HValue*, |
7337 HValue*); | 7342 HValue*); |
7338 | 7343 |
7339 virtual Representation RequiredInputRepresentation(int index) { | 7344 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
7340 // The index is supposed to be Integer32. | 7345 // The index is supposed to be Integer32. |
7341 return index == 2 | 7346 return index == 2 |
7342 ? Representation::Integer32() | 7347 ? Representation::Integer32() |
7343 : Representation::Tagged(); | 7348 : Representation::Tagged(); |
7344 } | 7349 } |
7345 | 7350 |
7346 HValue* context() const { return OperandAt(0); } | 7351 HValue* context() const { return OperandAt(0); } |
7347 HValue* string() const { return OperandAt(1); } | 7352 HValue* string() const { return OperandAt(1); } |
7348 HValue* index() const { return OperandAt(2); } | 7353 HValue* index() const { return OperandAt(2); } |
7349 | 7354 |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7722 } | 7727 } |
7723 | 7728 |
7724 HValue* value() const { return OperandAt(0); } | 7729 HValue* value() const { return OperandAt(0); } |
7725 HValue* map() const { return OperandAt(1); } | 7730 HValue* map() const { return OperandAt(1); } |
7726 | 7731 |
7727 virtual HValue* Canonicalize() OVERRIDE; | 7732 virtual HValue* Canonicalize() OVERRIDE; |
7728 | 7733 |
7729 DECLARE_CONCRETE_INSTRUCTION(CheckMapValue) | 7734 DECLARE_CONCRETE_INSTRUCTION(CheckMapValue) |
7730 | 7735 |
7731 protected: | 7736 protected: |
7732 virtual int RedefinedOperandIndex() { return 0; } | 7737 virtual int RedefinedOperandIndex() OVERRIDE { return 0; } |
7733 | 7738 |
7734 virtual bool DataEquals(HValue* other) OVERRIDE { | 7739 virtual bool DataEquals(HValue* other) OVERRIDE { |
7735 return true; | 7740 return true; |
7736 } | 7741 } |
7737 | 7742 |
7738 private: | 7743 private: |
7739 HCheckMapValue(HValue* value, HValue* map) | 7744 HCheckMapValue(HValue* value, HValue* map) |
7740 : HTemplateInstruction<2>(HType::HeapObject()) { | 7745 : HTemplateInstruction<2>(HType::HeapObject()) { |
7741 SetOperandAt(0, value); | 7746 SetOperandAt(0, value); |
7742 SetOperandAt(1, map); | 7747 SetOperandAt(1, map); |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7855 virtual bool IsDeletable() const OVERRIDE { return true; } | 7860 virtual bool IsDeletable() const OVERRIDE { return true; } |
7856 }; | 7861 }; |
7857 | 7862 |
7858 | 7863 |
7859 class HStoreFrameContext: public HUnaryOperation { | 7864 class HStoreFrameContext: public HUnaryOperation { |
7860 public: | 7865 public: |
7861 DECLARE_INSTRUCTION_FACTORY_P1(HStoreFrameContext, HValue*); | 7866 DECLARE_INSTRUCTION_FACTORY_P1(HStoreFrameContext, HValue*); |
7862 | 7867 |
7863 HValue* context() { return OperandAt(0); } | 7868 HValue* context() { return OperandAt(0); } |
7864 | 7869 |
7865 virtual Representation RequiredInputRepresentation(int index) { | 7870 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
7866 return Representation::Tagged(); | 7871 return Representation::Tagged(); |
7867 } | 7872 } |
7868 | 7873 |
7869 DECLARE_CONCRETE_INSTRUCTION(StoreFrameContext) | 7874 DECLARE_CONCRETE_INSTRUCTION(StoreFrameContext) |
7870 private: | 7875 private: |
7871 explicit HStoreFrameContext(HValue* context) | 7876 explicit HStoreFrameContext(HValue* context) |
7872 : HUnaryOperation(context) { | 7877 : HUnaryOperation(context) { |
7873 set_representation(Representation::Tagged()); | 7878 set_representation(Representation::Tagged()); |
7874 SetChangesFlag(kContextSlots); | 7879 SetChangesFlag(kContextSlots); |
7875 } | 7880 } |
7876 }; | 7881 }; |
7877 | 7882 |
7878 | 7883 |
7879 class HAllocateBlockContext: public HTemplateInstruction<2> { | 7884 class HAllocateBlockContext: public HTemplateInstruction<2> { |
7880 public: | 7885 public: |
7881 DECLARE_INSTRUCTION_FACTORY_P3(HAllocateBlockContext, HValue*, | 7886 DECLARE_INSTRUCTION_FACTORY_P3(HAllocateBlockContext, HValue*, |
7882 HValue*, Handle<ScopeInfo>); | 7887 HValue*, Handle<ScopeInfo>); |
7883 HValue* context() const { return OperandAt(0); } | 7888 HValue* context() const { return OperandAt(0); } |
7884 HValue* function() const { return OperandAt(1); } | 7889 HValue* function() const { return OperandAt(1); } |
7885 Handle<ScopeInfo> scope_info() const { return scope_info_; } | 7890 Handle<ScopeInfo> scope_info() const { return scope_info_; } |
7886 | 7891 |
7887 virtual Representation RequiredInputRepresentation(int index) { | 7892 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
7888 return Representation::Tagged(); | 7893 return Representation::Tagged(); |
7889 } | 7894 } |
7890 | 7895 |
7891 virtual std::ostream& PrintDataTo(std::ostream& os) const; // NOLINT | 7896 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
7892 | 7897 |
7893 DECLARE_CONCRETE_INSTRUCTION(AllocateBlockContext) | 7898 DECLARE_CONCRETE_INSTRUCTION(AllocateBlockContext) |
7894 | 7899 |
7895 private: | 7900 private: |
7896 HAllocateBlockContext(HValue* context, | 7901 HAllocateBlockContext(HValue* context, |
7897 HValue* function, | 7902 HValue* function, |
7898 Handle<ScopeInfo> scope_info) | 7903 Handle<ScopeInfo> scope_info) |
7899 : scope_info_(scope_info) { | 7904 : scope_info_(scope_info) { |
7900 SetOperandAt(0, context); | 7905 SetOperandAt(0, context); |
7901 SetOperandAt(1, function); | 7906 SetOperandAt(1, function); |
7902 set_representation(Representation::Tagged()); | 7907 set_representation(Representation::Tagged()); |
7903 } | 7908 } |
7904 | 7909 |
7905 Handle<ScopeInfo> scope_info_; | 7910 Handle<ScopeInfo> scope_info_; |
7906 }; | 7911 }; |
7907 | 7912 |
7908 | 7913 |
7909 | 7914 |
7910 #undef DECLARE_INSTRUCTION | 7915 #undef DECLARE_INSTRUCTION |
7911 #undef DECLARE_CONCRETE_INSTRUCTION | 7916 #undef DECLARE_CONCRETE_INSTRUCTION |
7912 | 7917 |
7913 } } // namespace v8::internal | 7918 } } // namespace v8::internal |
7914 | 7919 |
7915 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7920 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |