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" |
11 | 11 |
12 #include "src/allocation.h" | 12 #include "src/allocation.h" |
13 #include "src/base/bits.h" | 13 #include "src/base/bits.h" |
14 #include "src/code-stubs.h" | 14 #include "src/code-stubs.h" |
15 #include "src/conversions.h" | 15 #include "src/conversions.h" |
16 #include "src/data-flow.h" | 16 #include "src/data-flow.h" |
17 #include "src/deoptimizer.h" | 17 #include "src/deoptimizer.h" |
18 #include "src/feedback-slots.h" | |
19 #include "src/hydrogen-types.h" | 18 #include "src/hydrogen-types.h" |
20 #include "src/small-pointer-list.h" | 19 #include "src/small-pointer-list.h" |
21 #include "src/unique.h" | 20 #include "src/unique.h" |
22 #include "src/utils.h" | 21 #include "src/utils.h" |
23 #include "src/zone.h" | 22 #include "src/zone.h" |
24 | 23 |
25 namespace v8 { | 24 namespace v8 { |
26 namespace internal { | 25 namespace internal { |
27 | 26 |
28 // Forward declarations. | 27 // Forward declarations. |
(...skipping 5439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5468 class HLoadGlobalGeneric FINAL : public HTemplateInstruction<2> { | 5467 class HLoadGlobalGeneric FINAL : public HTemplateInstruction<2> { |
5469 public: | 5468 public: |
5470 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HLoadGlobalGeneric, HValue*, | 5469 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HLoadGlobalGeneric, HValue*, |
5471 Handle<String>, bool); | 5470 Handle<String>, bool); |
5472 | 5471 |
5473 HValue* context() { return OperandAt(0); } | 5472 HValue* context() { return OperandAt(0); } |
5474 HValue* global_object() { return OperandAt(1); } | 5473 HValue* global_object() { return OperandAt(1); } |
5475 Handle<String> name() const { return name_; } | 5474 Handle<String> name() const { return name_; } |
5476 bool for_typeof() const { return for_typeof_; } | 5475 bool for_typeof() const { return for_typeof_; } |
5477 int slot() const { | 5476 int slot() const { |
5478 DCHECK(FLAG_vector_ics && | 5477 DCHECK(FLAG_vector_ics && slot_ != AstNode::kInvalidFeedbackSlot); |
5479 slot_ != FeedbackSlotInterface::kInvalidFeedbackSlot); | |
5480 return slot_; | 5478 return slot_; |
5481 } | 5479 } |
5482 Handle<FixedArray> feedback_vector() const { return feedback_vector_; } | 5480 Handle<FixedArray> feedback_vector() const { return feedback_vector_; } |
5483 void SetVectorAndSlot(Handle<FixedArray> vector, int slot) { | 5481 void SetVectorAndSlot(Handle<FixedArray> vector, int slot) { |
5484 DCHECK(FLAG_vector_ics); | 5482 DCHECK(FLAG_vector_ics); |
5485 feedback_vector_ = vector; | 5483 feedback_vector_ = vector; |
5486 slot_ = slot; | 5484 slot_ = slot; |
5487 } | 5485 } |
5488 | 5486 |
5489 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT | 5487 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
5490 | 5488 |
5491 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 5489 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
5492 return Representation::Tagged(); | 5490 return Representation::Tagged(); |
5493 } | 5491 } |
5494 | 5492 |
5495 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric) | 5493 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric) |
5496 | 5494 |
5497 private: | 5495 private: |
5498 HLoadGlobalGeneric(HValue* context, HValue* global_object, | 5496 HLoadGlobalGeneric(HValue* context, HValue* global_object, |
5499 Handle<String> name, bool for_typeof) | 5497 Handle<String> name, bool for_typeof) |
5500 : name_(name), for_typeof_(for_typeof), | 5498 : name_(name), |
5501 slot_(FeedbackSlotInterface::kInvalidFeedbackSlot) { | 5499 for_typeof_(for_typeof), |
| 5500 slot_(AstNode::kInvalidFeedbackSlot) { |
5502 SetOperandAt(0, context); | 5501 SetOperandAt(0, context); |
5503 SetOperandAt(1, global_object); | 5502 SetOperandAt(1, global_object); |
5504 set_representation(Representation::Tagged()); | 5503 set_representation(Representation::Tagged()); |
5505 SetAllSideEffects(); | 5504 SetAllSideEffects(); |
5506 } | 5505 } |
5507 | 5506 |
5508 Handle<String> name_; | 5507 Handle<String> name_; |
5509 bool for_typeof_; | 5508 bool for_typeof_; |
5510 Handle<FixedArray> feedback_vector_; | 5509 Handle<FixedArray> feedback_vector_; |
5511 int slot_; | 5510 int slot_; |
(...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6471 class HLoadNamedGeneric FINAL : public HTemplateInstruction<2> { | 6470 class HLoadNamedGeneric FINAL : public HTemplateInstruction<2> { |
6472 public: | 6471 public: |
6473 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HLoadNamedGeneric, HValue*, | 6472 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HLoadNamedGeneric, HValue*, |
6474 Handle<Object>); | 6473 Handle<Object>); |
6475 | 6474 |
6476 HValue* context() const { return OperandAt(0); } | 6475 HValue* context() const { return OperandAt(0); } |
6477 HValue* object() const { return OperandAt(1); } | 6476 HValue* object() const { return OperandAt(1); } |
6478 Handle<Object> name() const { return name_; } | 6477 Handle<Object> name() const { return name_; } |
6479 | 6478 |
6480 int slot() const { | 6479 int slot() const { |
6481 DCHECK(FLAG_vector_ics && | 6480 DCHECK(FLAG_vector_ics && slot_ != AstNode::kInvalidFeedbackSlot); |
6482 slot_ != FeedbackSlotInterface::kInvalidFeedbackSlot); | |
6483 return slot_; | 6481 return slot_; |
6484 } | 6482 } |
6485 Handle<FixedArray> feedback_vector() const { return feedback_vector_; } | 6483 Handle<FixedArray> feedback_vector() const { return feedback_vector_; } |
6486 void SetVectorAndSlot(Handle<FixedArray> vector, int slot) { | 6484 void SetVectorAndSlot(Handle<FixedArray> vector, int slot) { |
6487 DCHECK(FLAG_vector_ics); | 6485 DCHECK(FLAG_vector_ics); |
6488 feedback_vector_ = vector; | 6486 feedback_vector_ = vector; |
6489 slot_ = slot; | 6487 slot_ = slot; |
6490 } | 6488 } |
6491 | 6489 |
6492 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 6490 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
6493 return Representation::Tagged(); | 6491 return Representation::Tagged(); |
6494 } | 6492 } |
6495 | 6493 |
6496 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT | 6494 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
6497 | 6495 |
6498 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric) | 6496 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric) |
6499 | 6497 |
6500 private: | 6498 private: |
6501 HLoadNamedGeneric(HValue* context, HValue* object, Handle<Object> name) | 6499 HLoadNamedGeneric(HValue* context, HValue* object, Handle<Object> name) |
6502 : name_(name), | 6500 : name_(name), slot_(AstNode::kInvalidFeedbackSlot) { |
6503 slot_(FeedbackSlotInterface::kInvalidFeedbackSlot) { | |
6504 SetOperandAt(0, context); | 6501 SetOperandAt(0, context); |
6505 SetOperandAt(1, object); | 6502 SetOperandAt(1, object); |
6506 set_representation(Representation::Tagged()); | 6503 set_representation(Representation::Tagged()); |
6507 SetAllSideEffects(); | 6504 SetAllSideEffects(); |
6508 } | 6505 } |
6509 | 6506 |
6510 Handle<Object> name_; | 6507 Handle<Object> name_; |
6511 Handle<FixedArray> feedback_vector_; | 6508 Handle<FixedArray> feedback_vector_; |
6512 int slot_; | 6509 int slot_; |
6513 }; | 6510 }; |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6749 | 6746 |
6750 | 6747 |
6751 class HLoadKeyedGeneric FINAL : public HTemplateInstruction<3> { | 6748 class HLoadKeyedGeneric FINAL : public HTemplateInstruction<3> { |
6752 public: | 6749 public: |
6753 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HLoadKeyedGeneric, HValue*, | 6750 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HLoadKeyedGeneric, HValue*, |
6754 HValue*); | 6751 HValue*); |
6755 HValue* object() const { return OperandAt(0); } | 6752 HValue* object() const { return OperandAt(0); } |
6756 HValue* key() const { return OperandAt(1); } | 6753 HValue* key() const { return OperandAt(1); } |
6757 HValue* context() const { return OperandAt(2); } | 6754 HValue* context() const { return OperandAt(2); } |
6758 int slot() const { | 6755 int slot() const { |
6759 DCHECK(FLAG_vector_ics && | 6756 DCHECK(FLAG_vector_ics && slot_ != AstNode::kInvalidFeedbackSlot); |
6760 slot_ != FeedbackSlotInterface::kInvalidFeedbackSlot); | |
6761 return slot_; | 6757 return slot_; |
6762 } | 6758 } |
6763 Handle<FixedArray> feedback_vector() const { return feedback_vector_; } | 6759 Handle<FixedArray> feedback_vector() const { return feedback_vector_; } |
6764 void SetVectorAndSlot(Handle<FixedArray> vector, int slot) { | 6760 void SetVectorAndSlot(Handle<FixedArray> vector, int slot) { |
6765 DCHECK(FLAG_vector_ics); | 6761 DCHECK(FLAG_vector_ics); |
6766 feedback_vector_ = vector; | 6762 feedback_vector_ = vector; |
6767 slot_ = slot; | 6763 slot_ = slot; |
6768 } | 6764 } |
6769 | 6765 |
6770 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT | 6766 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
6771 | 6767 |
6772 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 6768 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
6773 // tagged[tagged] | 6769 // tagged[tagged] |
6774 return Representation::Tagged(); | 6770 return Representation::Tagged(); |
6775 } | 6771 } |
6776 | 6772 |
6777 virtual HValue* Canonicalize() OVERRIDE; | 6773 virtual HValue* Canonicalize() OVERRIDE; |
6778 | 6774 |
6779 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric) | 6775 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric) |
6780 | 6776 |
6781 private: | 6777 private: |
6782 HLoadKeyedGeneric(HValue* context, HValue* obj, HValue* key) | 6778 HLoadKeyedGeneric(HValue* context, HValue* obj, HValue* key) |
6783 : slot_(FeedbackSlotInterface::kInvalidFeedbackSlot) { | 6779 : slot_(AstNode::kInvalidFeedbackSlot) { |
6784 set_representation(Representation::Tagged()); | 6780 set_representation(Representation::Tagged()); |
6785 SetOperandAt(0, obj); | 6781 SetOperandAt(0, obj); |
6786 SetOperandAt(1, key); | 6782 SetOperandAt(1, key); |
6787 SetOperandAt(2, context); | 6783 SetOperandAt(2, context); |
6788 SetAllSideEffects(); | 6784 SetAllSideEffects(); |
6789 } | 6785 } |
6790 | 6786 |
6791 Handle<FixedArray> feedback_vector_; | 6787 Handle<FixedArray> feedback_vector_; |
6792 int slot_; | 6788 int slot_; |
6793 }; | 6789 }; |
(...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7897 }; | 7893 }; |
7898 | 7894 |
7899 | 7895 |
7900 | 7896 |
7901 #undef DECLARE_INSTRUCTION | 7897 #undef DECLARE_INSTRUCTION |
7902 #undef DECLARE_CONCRETE_INSTRUCTION | 7898 #undef DECLARE_CONCRETE_INSTRUCTION |
7903 | 7899 |
7904 } } // namespace v8::internal | 7900 } } // namespace v8::internal |
7905 | 7901 |
7906 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7902 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |