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 <cstring> | 8 #include <cstring> |
9 #include <iosfwd> | 9 #include <iosfwd> |
10 | 10 |
(...skipping 5398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5409 HPhi* incoming_value_; | 5409 HPhi* incoming_value_; |
5410 }; | 5410 }; |
5411 | 5411 |
5412 | 5412 |
5413 class HLoadGlobalCell FINAL : public HTemplateInstruction<0> { | 5413 class HLoadGlobalCell FINAL : public HTemplateInstruction<0> { |
5414 public: | 5414 public: |
5415 DECLARE_INSTRUCTION_FACTORY_P2(HLoadGlobalCell, Handle<Cell>, | 5415 DECLARE_INSTRUCTION_FACTORY_P2(HLoadGlobalCell, Handle<Cell>, |
5416 PropertyDetails); | 5416 PropertyDetails); |
5417 | 5417 |
5418 Unique<Cell> cell() const { return cell_; } | 5418 Unique<Cell> cell() const { return cell_; } |
5419 bool RequiresHoleCheck() const; | 5419 // TODO(dcarney): remove this. |
| 5420 bool RequiresHoleCheck() const { return false; } |
5420 | 5421 |
5421 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT | 5422 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
5422 | 5423 |
5423 intptr_t Hashcode() OVERRIDE { return cell_.Hashcode(); } | 5424 intptr_t Hashcode() OVERRIDE { return cell_.Hashcode(); } |
5424 | 5425 |
5425 void FinalizeUniqueness() OVERRIDE { cell_ = Unique<Cell>(cell_.handle()); } | 5426 void FinalizeUniqueness() OVERRIDE { cell_ = Unique<Cell>(cell_.handle()); } |
5426 | 5427 |
5427 Representation RequiredInputRepresentation(int index) OVERRIDE { | 5428 Representation RequiredInputRepresentation(int index) OVERRIDE { |
5428 return Representation::None(); | 5429 return Representation::None(); |
5429 } | 5430 } |
5430 | 5431 |
5431 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalCell) | 5432 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalCell) |
5432 | 5433 |
5433 protected: | 5434 protected: |
5434 bool DataEquals(HValue* other) OVERRIDE { | 5435 bool DataEquals(HValue* other) OVERRIDE { |
5435 return cell_ == HLoadGlobalCell::cast(other)->cell_; | 5436 return cell_ == HLoadGlobalCell::cast(other)->cell_; |
5436 } | 5437 } |
5437 | 5438 |
5438 private: | 5439 private: |
5439 HLoadGlobalCell(Handle<Cell> cell, PropertyDetails details) | 5440 HLoadGlobalCell(Handle<Cell> cell, PropertyDetails details) |
5440 : cell_(Unique<Cell>::CreateUninitialized(cell)), details_(details) { | 5441 : cell_(Unique<Cell>::CreateUninitialized(cell)), details_(details) { |
5441 set_representation(Representation::Tagged()); | 5442 set_representation(Representation::Tagged()); |
5442 SetFlag(kUseGVN); | 5443 SetFlag(kUseGVN); |
5443 SetDependsOnFlag(kGlobalVars); | 5444 SetDependsOnFlag(kGlobalVars); |
5444 } | 5445 } |
5445 | 5446 |
5446 bool IsDeletable() const OVERRIDE { return !RequiresHoleCheck(); } | 5447 bool IsDeletable() const OVERRIDE { return true; } |
5447 | 5448 |
5448 Unique<Cell> cell_; | 5449 Unique<Cell> cell_; |
5449 PropertyDetails details_; | 5450 PropertyDetails details_; |
5450 }; | 5451 }; |
5451 | 5452 |
5452 | 5453 |
5453 class HLoadGlobalGeneric FINAL : public HTemplateInstruction<2> { | 5454 class HLoadGlobalGeneric FINAL : public HTemplateInstruction<2> { |
5454 public: | 5455 public: |
5455 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HLoadGlobalGeneric, HValue*, | 5456 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HLoadGlobalGeneric, HValue*, |
5456 Handle<String>, bool); | 5457 Handle<String>, bool); |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5800 return kPointersToHereMaybeInteresting; | 5801 return kPointersToHereMaybeInteresting; |
5801 } | 5802 } |
5802 | 5803 |
5803 | 5804 |
5804 class HStoreGlobalCell FINAL : public HUnaryOperation { | 5805 class HStoreGlobalCell FINAL : public HUnaryOperation { |
5805 public: | 5806 public: |
5806 DECLARE_INSTRUCTION_FACTORY_P3(HStoreGlobalCell, HValue*, | 5807 DECLARE_INSTRUCTION_FACTORY_P3(HStoreGlobalCell, HValue*, |
5807 Handle<PropertyCell>, PropertyDetails); | 5808 Handle<PropertyCell>, PropertyDetails); |
5808 | 5809 |
5809 Unique<PropertyCell> cell() const { return cell_; } | 5810 Unique<PropertyCell> cell() const { return cell_; } |
5810 bool RequiresHoleCheck() { return details_.IsConfigurable(); } | 5811 // TODO(dcarney): remove |
| 5812 bool RequiresHoleCheck() const { return false; } |
5811 bool NeedsWriteBarrier() { | 5813 bool NeedsWriteBarrier() { |
5812 return StoringValueNeedsWriteBarrier(value()); | 5814 return StoringValueNeedsWriteBarrier(value()); |
5813 } | 5815 } |
5814 | 5816 |
5815 void FinalizeUniqueness() OVERRIDE { | 5817 void FinalizeUniqueness() OVERRIDE { |
5816 cell_ = Unique<PropertyCell>(cell_.handle()); | 5818 cell_ = Unique<PropertyCell>(cell_.handle()); |
5817 } | 5819 } |
5818 | 5820 |
5819 Representation RequiredInputRepresentation(int index) OVERRIDE { | 5821 Representation RequiredInputRepresentation(int index) OVERRIDE { |
5820 return Representation::Tagged(); | 5822 return Representation::Tagged(); |
(...skipping 2152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7973 }; | 7975 }; |
7974 | 7976 |
7975 | 7977 |
7976 | 7978 |
7977 #undef DECLARE_INSTRUCTION | 7979 #undef DECLARE_INSTRUCTION |
7978 #undef DECLARE_CONCRETE_INSTRUCTION | 7980 #undef DECLARE_CONCRETE_INSTRUCTION |
7979 | 7981 |
7980 } } // namespace v8::internal | 7982 } } // namespace v8::internal |
7981 | 7983 |
7982 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7984 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |