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 5456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5467 | 5467 |
5468 class HLoadGlobalGeneric FINAL : public HTemplateInstruction<2> { | 5468 class HLoadGlobalGeneric FINAL : public HTemplateInstruction<2> { |
5469 public: | 5469 public: |
5470 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HLoadGlobalGeneric, HValue*, | 5470 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HLoadGlobalGeneric, HValue*, |
5471 Handle<String>, bool); | 5471 Handle<String>, bool); |
5472 | 5472 |
5473 HValue* context() { return OperandAt(0); } | 5473 HValue* context() { return OperandAt(0); } |
5474 HValue* global_object() { return OperandAt(1); } | 5474 HValue* global_object() { return OperandAt(1); } |
5475 Handle<String> name() const { return name_; } | 5475 Handle<String> name() const { return name_; } |
5476 bool for_typeof() const { return for_typeof_; } | 5476 bool for_typeof() const { return for_typeof_; } |
5477 int slot() const { | 5477 FeedbackVectorSlot slot() const { |
5478 DCHECK(FLAG_vector_ics && slot_ != AstNode::kInvalidFeedbackSlot); | 5478 DCHECK(FLAG_vector_ics && !slot_.IsInvalid()); |
5479 return slot_; | 5479 return slot_; |
5480 } | 5480 } |
5481 Handle<FixedArray> feedback_vector() const { return feedback_vector_; } | 5481 Handle<FixedArray> feedback_vector() const { return feedback_vector_; } |
5482 void SetVectorAndSlot(Handle<FixedArray> vector, int slot) { | 5482 void SetVectorAndSlot(Handle<FixedArray> vector, FeedbackVectorSlot slot) { |
5483 DCHECK(FLAG_vector_ics); | 5483 DCHECK(FLAG_vector_ics); |
5484 feedback_vector_ = vector; | 5484 feedback_vector_ = vector; |
5485 slot_ = slot; | 5485 slot_ = slot; |
5486 } | 5486 } |
5487 | 5487 |
5488 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT | 5488 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
5489 | 5489 |
5490 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 5490 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
5491 return Representation::Tagged(); | 5491 return Representation::Tagged(); |
5492 } | 5492 } |
5493 | 5493 |
5494 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric) | 5494 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric) |
5495 | 5495 |
5496 private: | 5496 private: |
5497 HLoadGlobalGeneric(HValue* context, HValue* global_object, | 5497 HLoadGlobalGeneric(HValue* context, HValue* global_object, |
5498 Handle<String> name, bool for_typeof) | 5498 Handle<String> name, bool for_typeof) |
5499 : name_(name), | 5499 : name_(name), |
5500 for_typeof_(for_typeof), | 5500 for_typeof_(for_typeof), |
5501 slot_(AstNode::kInvalidFeedbackSlot) { | 5501 slot_(FeedbackVectorSlot::Invalid()) { |
5502 SetOperandAt(0, context); | 5502 SetOperandAt(0, context); |
5503 SetOperandAt(1, global_object); | 5503 SetOperandAt(1, global_object); |
5504 set_representation(Representation::Tagged()); | 5504 set_representation(Representation::Tagged()); |
5505 SetAllSideEffects(); | 5505 SetAllSideEffects(); |
5506 } | 5506 } |
5507 | 5507 |
5508 Handle<String> name_; | 5508 Handle<String> name_; |
5509 bool for_typeof_; | 5509 bool for_typeof_; |
5510 Handle<FixedArray> feedback_vector_; | 5510 Handle<FixedArray> feedback_vector_; |
5511 int slot_; | 5511 FeedbackVectorSlot slot_; |
5512 }; | 5512 }; |
5513 | 5513 |
5514 | 5514 |
5515 class HAllocate FINAL : public HTemplateInstruction<2> { | 5515 class HAllocate FINAL : public HTemplateInstruction<2> { |
5516 public: | 5516 public: |
5517 static bool CompatibleInstanceTypes(InstanceType type1, | 5517 static bool CompatibleInstanceTypes(InstanceType type1, |
5518 InstanceType type2) { | 5518 InstanceType type2) { |
5519 return ComputeFlags(TENURED, type1) == ComputeFlags(TENURED, type2) && | 5519 return ComputeFlags(TENURED, type1) == ComputeFlags(TENURED, type2) && |
5520 ComputeFlags(NOT_TENURED, type1) == ComputeFlags(NOT_TENURED, type2); | 5520 ComputeFlags(NOT_TENURED, type1) == ComputeFlags(NOT_TENURED, type2); |
5521 } | 5521 } |
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6472 | 6472 |
6473 class HLoadNamedGeneric FINAL : public HTemplateInstruction<2> { | 6473 class HLoadNamedGeneric FINAL : public HTemplateInstruction<2> { |
6474 public: | 6474 public: |
6475 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HLoadNamedGeneric, HValue*, | 6475 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HLoadNamedGeneric, HValue*, |
6476 Handle<Object>); | 6476 Handle<Object>); |
6477 | 6477 |
6478 HValue* context() const { return OperandAt(0); } | 6478 HValue* context() const { return OperandAt(0); } |
6479 HValue* object() const { return OperandAt(1); } | 6479 HValue* object() const { return OperandAt(1); } |
6480 Handle<Object> name() const { return name_; } | 6480 Handle<Object> name() const { return name_; } |
6481 | 6481 |
6482 int slot() const { | 6482 FeedbackVectorSlot slot() const { |
6483 DCHECK(FLAG_vector_ics && slot_ != AstNode::kInvalidFeedbackSlot); | 6483 DCHECK(FLAG_vector_ics && !slot_.IsInvalid()); |
6484 return slot_; | 6484 return slot_; |
6485 } | 6485 } |
6486 Handle<FixedArray> feedback_vector() const { return feedback_vector_; } | 6486 Handle<FixedArray> feedback_vector() const { return feedback_vector_; } |
6487 void SetVectorAndSlot(Handle<FixedArray> vector, int slot) { | 6487 void SetVectorAndSlot(Handle<FixedArray> vector, FeedbackVectorSlot slot) { |
6488 DCHECK(FLAG_vector_ics); | 6488 DCHECK(FLAG_vector_ics); |
6489 feedback_vector_ = vector; | 6489 feedback_vector_ = vector; |
6490 slot_ = slot; | 6490 slot_ = slot; |
6491 } | 6491 } |
6492 | 6492 |
6493 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 6493 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
6494 return Representation::Tagged(); | 6494 return Representation::Tagged(); |
6495 } | 6495 } |
6496 | 6496 |
6497 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT | 6497 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
6498 | 6498 |
6499 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric) | 6499 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric) |
6500 | 6500 |
6501 private: | 6501 private: |
6502 HLoadNamedGeneric(HValue* context, HValue* object, Handle<Object> name) | 6502 HLoadNamedGeneric(HValue* context, HValue* object, Handle<Object> name) |
6503 : name_(name), slot_(AstNode::kInvalidFeedbackSlot) { | 6503 : name_(name), slot_(FeedbackVectorSlot::Invalid()) { |
6504 SetOperandAt(0, context); | 6504 SetOperandAt(0, context); |
6505 SetOperandAt(1, object); | 6505 SetOperandAt(1, object); |
6506 set_representation(Representation::Tagged()); | 6506 set_representation(Representation::Tagged()); |
6507 SetAllSideEffects(); | 6507 SetAllSideEffects(); |
6508 } | 6508 } |
6509 | 6509 |
6510 Handle<Object> name_; | 6510 Handle<Object> name_; |
6511 Handle<FixedArray> feedback_vector_; | 6511 Handle<FixedArray> feedback_vector_; |
6512 int slot_; | 6512 FeedbackVectorSlot slot_; |
6513 }; | 6513 }; |
6514 | 6514 |
6515 | 6515 |
6516 class HLoadFunctionPrototype FINAL : public HUnaryOperation { | 6516 class HLoadFunctionPrototype FINAL : public HUnaryOperation { |
6517 public: | 6517 public: |
6518 DECLARE_INSTRUCTION_FACTORY_P1(HLoadFunctionPrototype, HValue*); | 6518 DECLARE_INSTRUCTION_FACTORY_P1(HLoadFunctionPrototype, HValue*); |
6519 | 6519 |
6520 HValue* function() { return OperandAt(0); } | 6520 HValue* function() { return OperandAt(0); } |
6521 | 6521 |
6522 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 6522 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6748 }; | 6748 }; |
6749 | 6749 |
6750 | 6750 |
6751 class HLoadKeyedGeneric FINAL : public HTemplateInstruction<3> { | 6751 class HLoadKeyedGeneric FINAL : public HTemplateInstruction<3> { |
6752 public: | 6752 public: |
6753 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HLoadKeyedGeneric, HValue*, | 6753 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HLoadKeyedGeneric, HValue*, |
6754 HValue*); | 6754 HValue*); |
6755 HValue* object() const { return OperandAt(0); } | 6755 HValue* object() const { return OperandAt(0); } |
6756 HValue* key() const { return OperandAt(1); } | 6756 HValue* key() const { return OperandAt(1); } |
6757 HValue* context() const { return OperandAt(2); } | 6757 HValue* context() const { return OperandAt(2); } |
6758 int slot() const { | 6758 FeedbackVectorSlot slot() const { |
6759 DCHECK(FLAG_vector_ics && slot_ != AstNode::kInvalidFeedbackSlot); | 6759 DCHECK(FLAG_vector_ics && !slot_.IsInvalid()); |
6760 return slot_; | 6760 return slot_; |
6761 } | 6761 } |
6762 Handle<FixedArray> feedback_vector() const { return feedback_vector_; } | 6762 Handle<FixedArray> feedback_vector() const { return feedback_vector_; } |
6763 void SetVectorAndSlot(Handle<FixedArray> vector, int slot) { | 6763 void SetVectorAndSlot(Handle<FixedArray> vector, FeedbackVectorSlot slot) { |
6764 DCHECK(FLAG_vector_ics); | 6764 DCHECK(FLAG_vector_ics); |
6765 feedback_vector_ = vector; | 6765 feedback_vector_ = vector; |
6766 slot_ = slot; | 6766 slot_ = slot; |
6767 } | 6767 } |
6768 | 6768 |
6769 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT | 6769 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
6770 | 6770 |
6771 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 6771 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
6772 // tagged[tagged] | 6772 // tagged[tagged] |
6773 return Representation::Tagged(); | 6773 return Representation::Tagged(); |
6774 } | 6774 } |
6775 | 6775 |
6776 virtual HValue* Canonicalize() OVERRIDE; | 6776 virtual HValue* Canonicalize() OVERRIDE; |
6777 | 6777 |
6778 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric) | 6778 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric) |
6779 | 6779 |
6780 private: | 6780 private: |
6781 HLoadKeyedGeneric(HValue* context, HValue* obj, HValue* key) | 6781 HLoadKeyedGeneric(HValue* context, HValue* obj, HValue* key) |
6782 : slot_(AstNode::kInvalidFeedbackSlot) { | 6782 : slot_(FeedbackVectorSlot::Invalid()) { |
6783 set_representation(Representation::Tagged()); | 6783 set_representation(Representation::Tagged()); |
6784 SetOperandAt(0, obj); | 6784 SetOperandAt(0, obj); |
6785 SetOperandAt(1, key); | 6785 SetOperandAt(1, key); |
6786 SetOperandAt(2, context); | 6786 SetOperandAt(2, context); |
6787 SetAllSideEffects(); | 6787 SetAllSideEffects(); |
6788 } | 6788 } |
6789 | 6789 |
6790 Handle<FixedArray> feedback_vector_; | 6790 Handle<FixedArray> feedback_vector_; |
6791 int slot_; | 6791 FeedbackVectorSlot slot_; |
6792 }; | 6792 }; |
6793 | 6793 |
6794 | 6794 |
6795 // Indicates whether the store is a store to an entry that was previously | 6795 // Indicates whether the store is a store to an entry that was previously |
6796 // initialized or not. | 6796 // initialized or not. |
6797 enum StoreFieldOrKeyedMode { | 6797 enum StoreFieldOrKeyedMode { |
6798 // The entry could be either previously initialized or not. | 6798 // The entry could be either previously initialized or not. |
6799 INITIALIZING_STORE, | 6799 INITIALIZING_STORE, |
6800 // At the time of this store it is guaranteed that the entry is already | 6800 // At the time of this store it is guaranteed that the entry is already |
6801 // initialized. | 6801 // initialized. |
(...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7896 }; | 7896 }; |
7897 | 7897 |
7898 | 7898 |
7899 | 7899 |
7900 #undef DECLARE_INSTRUCTION | 7900 #undef DECLARE_INSTRUCTION |
7901 #undef DECLARE_CONCRETE_INSTRUCTION | 7901 #undef DECLARE_CONCRETE_INSTRUCTION |
7902 | 7902 |
7903 } } // namespace v8::internal | 7903 } } // namespace v8::internal |
7904 | 7904 |
7905 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7905 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |