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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 V(StoreFrameContext) \ | 149 V(StoreFrameContext) \ |
150 V(StoreKeyed) \ | 150 V(StoreKeyed) \ |
151 V(StoreKeyedGeneric) \ | 151 V(StoreKeyedGeneric) \ |
152 V(StoreNamedField) \ | 152 V(StoreNamedField) \ |
153 V(StoreNamedGeneric) \ | 153 V(StoreNamedGeneric) \ |
154 V(StringAdd) \ | 154 V(StringAdd) \ |
155 V(StringCharCodeAt) \ | 155 V(StringCharCodeAt) \ |
156 V(StringCharFromCode) \ | 156 V(StringCharFromCode) \ |
157 V(StringCompareAndBranch) \ | 157 V(StringCompareAndBranch) \ |
158 V(Sub) \ | 158 V(Sub) \ |
159 V(TailCallThroughMegamorphicCache) \ | |
160 V(ThisFunction) \ | 159 V(ThisFunction) \ |
161 V(ToFastProperties) \ | 160 V(ToFastProperties) \ |
162 V(TransitionElementsKind) \ | 161 V(TransitionElementsKind) \ |
163 V(TrapAllocationMemento) \ | 162 V(TrapAllocationMemento) \ |
164 V(Typeof) \ | 163 V(Typeof) \ |
165 V(TypeofIsAndBranch) \ | 164 V(TypeofIsAndBranch) \ |
166 V(UnaryMathOperation) \ | 165 V(UnaryMathOperation) \ |
167 V(UnknownOSRValue) \ | 166 V(UnknownOSRValue) \ |
168 V(UseConst) \ | 167 V(UseConst) \ |
169 V(WrapReceiver) | 168 V(WrapReceiver) |
(...skipping 5176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5346 private: | 5345 private: |
5347 HCallStub(HValue* context, CodeStub::Major major_key, int argument_count) | 5346 HCallStub(HValue* context, CodeStub::Major major_key, int argument_count) |
5348 : HUnaryCall(context, argument_count), | 5347 : HUnaryCall(context, argument_count), |
5349 major_key_(major_key) { | 5348 major_key_(major_key) { |
5350 } | 5349 } |
5351 | 5350 |
5352 CodeStub::Major major_key_; | 5351 CodeStub::Major major_key_; |
5353 }; | 5352 }; |
5354 | 5353 |
5355 | 5354 |
5356 class HTailCallThroughMegamorphicCache final : public HInstruction { | |
5357 public: | |
5358 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HTailCallThroughMegamorphicCache, | |
5359 HValue*, HValue*); | |
5360 | |
5361 Representation RequiredInputRepresentation(int index) override { | |
5362 return Representation::Tagged(); | |
5363 } | |
5364 | |
5365 virtual int OperandCount() const final override { return 3; } | |
5366 virtual HValue* OperandAt(int i) const final override { return inputs_[i]; } | |
5367 | |
5368 HValue* context() const { return OperandAt(0); } | |
5369 HValue* receiver() const { return OperandAt(1); } | |
5370 HValue* name() const { return OperandAt(2); } | |
5371 Code::Flags flags() const; | |
5372 | |
5373 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT | |
5374 | |
5375 DECLARE_CONCRETE_INSTRUCTION(TailCallThroughMegamorphicCache) | |
5376 | |
5377 protected: | |
5378 virtual void InternalSetOperandAt(int i, HValue* value) final override { | |
5379 inputs_[i] = value; | |
5380 } | |
5381 | |
5382 private: | |
5383 HTailCallThroughMegamorphicCache(HValue* context, HValue* receiver, | |
5384 HValue* name) { | |
5385 SetOperandAt(0, context); | |
5386 SetOperandAt(1, receiver); | |
5387 SetOperandAt(2, name); | |
5388 } | |
5389 | |
5390 EmbeddedContainer<HValue*, 3> inputs_; | |
5391 }; | |
5392 | |
5393 | |
5394 class HUnknownOSRValue final : public HTemplateInstruction<0> { | 5355 class HUnknownOSRValue final : public HTemplateInstruction<0> { |
5395 public: | 5356 public: |
5396 DECLARE_INSTRUCTION_FACTORY_P2(HUnknownOSRValue, HEnvironment*, int); | 5357 DECLARE_INSTRUCTION_FACTORY_P2(HUnknownOSRValue, HEnvironment*, int); |
5397 | 5358 |
5398 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT | 5359 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT |
5399 | 5360 |
5400 Representation RequiredInputRepresentation(int index) override { | 5361 Representation RequiredInputRepresentation(int index) override { |
5401 return Representation::None(); | 5362 return Representation::None(); |
5402 } | 5363 } |
5403 | 5364 |
(...skipping 29 matching lines...) Expand all Loading... |
5433 Handle<String>, bool); | 5394 Handle<String>, bool); |
5434 | 5395 |
5435 HValue* context() { return OperandAt(0); } | 5396 HValue* context() { return OperandAt(0); } |
5436 HValue* global_object() { return OperandAt(1); } | 5397 HValue* global_object() { return OperandAt(1); } |
5437 Handle<String> name() const { return name_; } | 5398 Handle<String> name() const { return name_; } |
5438 bool for_typeof() const { return for_typeof_; } | 5399 bool for_typeof() const { return for_typeof_; } |
5439 FeedbackVectorICSlot slot() const { return slot_; } | 5400 FeedbackVectorICSlot slot() const { return slot_; } |
5440 Handle<TypeFeedbackVector> feedback_vector() const { | 5401 Handle<TypeFeedbackVector> feedback_vector() const { |
5441 return feedback_vector_; | 5402 return feedback_vector_; |
5442 } | 5403 } |
5443 bool HasVectorAndSlot() const { return FLAG_vector_ics; } | 5404 bool HasVectorAndSlot() const { return true; } |
5444 void SetVectorAndSlot(Handle<TypeFeedbackVector> vector, | 5405 void SetVectorAndSlot(Handle<TypeFeedbackVector> vector, |
5445 FeedbackVectorICSlot slot) { | 5406 FeedbackVectorICSlot slot) { |
5446 DCHECK(FLAG_vector_ics); | |
5447 feedback_vector_ = vector; | 5407 feedback_vector_ = vector; |
5448 slot_ = slot; | 5408 slot_ = slot; |
5449 } | 5409 } |
5450 | 5410 |
5451 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT | 5411 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT |
5452 | 5412 |
5453 Representation RequiredInputRepresentation(int index) override { | 5413 Representation RequiredInputRepresentation(int index) override { |
5454 return Representation::Tagged(); | 5414 return Representation::Tagged(); |
5455 } | 5415 } |
5456 | 5416 |
(...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6441 HValue* object() const { return OperandAt(1); } | 6401 HValue* object() const { return OperandAt(1); } |
6442 Handle<Object> name() const { return name_; } | 6402 Handle<Object> name() const { return name_; } |
6443 | 6403 |
6444 InlineCacheState initialization_state() const { | 6404 InlineCacheState initialization_state() const { |
6445 return initialization_state_; | 6405 return initialization_state_; |
6446 } | 6406 } |
6447 FeedbackVectorICSlot slot() const { return slot_; } | 6407 FeedbackVectorICSlot slot() const { return slot_; } |
6448 Handle<TypeFeedbackVector> feedback_vector() const { | 6408 Handle<TypeFeedbackVector> feedback_vector() const { |
6449 return feedback_vector_; | 6409 return feedback_vector_; |
6450 } | 6410 } |
6451 bool HasVectorAndSlot() const { return FLAG_vector_ics; } | 6411 bool HasVectorAndSlot() const { return true; } |
6452 void SetVectorAndSlot(Handle<TypeFeedbackVector> vector, | 6412 void SetVectorAndSlot(Handle<TypeFeedbackVector> vector, |
6453 FeedbackVectorICSlot slot) { | 6413 FeedbackVectorICSlot slot) { |
6454 DCHECK(FLAG_vector_ics); | |
6455 feedback_vector_ = vector; | 6414 feedback_vector_ = vector; |
6456 slot_ = slot; | 6415 slot_ = slot; |
6457 } | 6416 } |
6458 | 6417 |
6459 Representation RequiredInputRepresentation(int index) override { | 6418 Representation RequiredInputRepresentation(int index) override { |
6460 return Representation::Tagged(); | 6419 return Representation::Tagged(); |
6461 } | 6420 } |
6462 | 6421 |
6463 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT | 6422 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT |
6464 | 6423 |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6724 HValue* key() const { return OperandAt(1); } | 6683 HValue* key() const { return OperandAt(1); } |
6725 HValue* context() const { return OperandAt(2); } | 6684 HValue* context() const { return OperandAt(2); } |
6726 InlineCacheState initialization_state() const { | 6685 InlineCacheState initialization_state() const { |
6727 return initialization_state_; | 6686 return initialization_state_; |
6728 } | 6687 } |
6729 FeedbackVectorICSlot slot() const { return slot_; } | 6688 FeedbackVectorICSlot slot() const { return slot_; } |
6730 Handle<TypeFeedbackVector> feedback_vector() const { | 6689 Handle<TypeFeedbackVector> feedback_vector() const { |
6731 return feedback_vector_; | 6690 return feedback_vector_; |
6732 } | 6691 } |
6733 bool HasVectorAndSlot() const { | 6692 bool HasVectorAndSlot() const { |
6734 DCHECK(!FLAG_vector_ics || initialization_state_ == MEGAMORPHIC || | 6693 DCHECK(initialization_state_ == MEGAMORPHIC || !feedback_vector_.is_null()); |
6735 !feedback_vector_.is_null()); | |
6736 return !feedback_vector_.is_null(); | 6694 return !feedback_vector_.is_null(); |
6737 } | 6695 } |
6738 void SetVectorAndSlot(Handle<TypeFeedbackVector> vector, | 6696 void SetVectorAndSlot(Handle<TypeFeedbackVector> vector, |
6739 FeedbackVectorICSlot slot) { | 6697 FeedbackVectorICSlot slot) { |
6740 DCHECK(FLAG_vector_ics); | |
6741 feedback_vector_ = vector; | 6698 feedback_vector_ = vector; |
6742 slot_ = slot; | 6699 slot_ = slot; |
6743 } | 6700 } |
6744 | 6701 |
6745 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT | 6702 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT |
6746 | 6703 |
6747 Representation RequiredInputRepresentation(int index) override { | 6704 Representation RequiredInputRepresentation(int index) override { |
6748 // tagged[tagged] | 6705 // tagged[tagged] |
6749 return Representation::Tagged(); | 6706 return Representation::Tagged(); |
6750 } | 6707 } |
(...skipping 1194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7945 }; | 7902 }; |
7946 | 7903 |
7947 | 7904 |
7948 | 7905 |
7949 #undef DECLARE_INSTRUCTION | 7906 #undef DECLARE_INSTRUCTION |
7950 #undef DECLARE_CONCRETE_INSTRUCTION | 7907 #undef DECLARE_CONCRETE_INSTRUCTION |
7951 | 7908 |
7952 } } // namespace v8::internal | 7909 } } // namespace v8::internal |
7953 | 7910 |
7954 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7911 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |