| 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_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ | 5 #ifndef V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ |
| 6 #define V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ | 6 #define V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ |
| 7 | 7 |
| 8 #include <cstring> | 8 #include <cstring> |
| 9 #include <iosfwd> | 9 #include <iosfwd> |
| 10 | 10 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 V(IsConstructCallAndBranch) \ | 108 V(IsConstructCallAndBranch) \ |
| 109 V(HasInPrototypeChainAndBranch) \ | 109 V(HasInPrototypeChainAndBranch) \ |
| 110 V(IsStringAndBranch) \ | 110 V(IsStringAndBranch) \ |
| 111 V(IsSmiAndBranch) \ | 111 V(IsSmiAndBranch) \ |
| 112 V(IsUndetectableAndBranch) \ | 112 V(IsUndetectableAndBranch) \ |
| 113 V(LeaveInlined) \ | 113 V(LeaveInlined) \ |
| 114 V(LoadContextSlot) \ | 114 V(LoadContextSlot) \ |
| 115 V(LoadFieldByIndex) \ | 115 V(LoadFieldByIndex) \ |
| 116 V(LoadFunctionPrototype) \ | 116 V(LoadFunctionPrototype) \ |
| 117 V(LoadGlobalGeneric) \ | 117 V(LoadGlobalGeneric) \ |
| 118 V(LoadGlobalViaContext) \ | |
| 119 V(LoadKeyed) \ | 118 V(LoadKeyed) \ |
| 120 V(LoadKeyedGeneric) \ | 119 V(LoadKeyedGeneric) \ |
| 121 V(LoadNamedField) \ | 120 V(LoadNamedField) \ |
| 122 V(LoadNamedGeneric) \ | 121 V(LoadNamedGeneric) \ |
| 123 V(LoadRoot) \ | 122 V(LoadRoot) \ |
| 124 V(MapEnumLength) \ | 123 V(MapEnumLength) \ |
| 125 V(MathFloorOfDiv) \ | 124 V(MathFloorOfDiv) \ |
| 126 V(MathMinMax) \ | 125 V(MathMinMax) \ |
| 127 V(MaybeGrowElements) \ | 126 V(MaybeGrowElements) \ |
| 128 V(Mod) \ | 127 V(Mod) \ |
| 129 V(Mul) \ | 128 V(Mul) \ |
| 130 V(OsrEntry) \ | 129 V(OsrEntry) \ |
| 131 V(Parameter) \ | 130 V(Parameter) \ |
| 132 V(Power) \ | 131 V(Power) \ |
| 133 V(Prologue) \ | 132 V(Prologue) \ |
| 134 V(PushArguments) \ | 133 V(PushArguments) \ |
| 135 V(RegExpLiteral) \ | 134 V(RegExpLiteral) \ |
| 136 V(Return) \ | 135 V(Return) \ |
| 137 V(Ror) \ | 136 V(Ror) \ |
| 138 V(Sar) \ | 137 V(Sar) \ |
| 139 V(SeqStringGetChar) \ | 138 V(SeqStringGetChar) \ |
| 140 V(SeqStringSetChar) \ | 139 V(SeqStringSetChar) \ |
| 141 V(Shl) \ | 140 V(Shl) \ |
| 142 V(Shr) \ | 141 V(Shr) \ |
| 143 V(Simulate) \ | 142 V(Simulate) \ |
| 144 V(StackCheck) \ | 143 V(StackCheck) \ |
| 145 V(StoreCodeEntry) \ | 144 V(StoreCodeEntry) \ |
| 146 V(StoreContextSlot) \ | 145 V(StoreContextSlot) \ |
| 147 V(StoreFrameContext) \ | 146 V(StoreFrameContext) \ |
| 148 V(StoreGlobalViaContext) \ | |
| 149 V(StoreKeyed) \ | 147 V(StoreKeyed) \ |
| 150 V(StoreKeyedGeneric) \ | 148 V(StoreKeyedGeneric) \ |
| 151 V(StoreNamedField) \ | 149 V(StoreNamedField) \ |
| 152 V(StoreNamedGeneric) \ | 150 V(StoreNamedGeneric) \ |
| 153 V(StringAdd) \ | 151 V(StringAdd) \ |
| 154 V(StringCharCodeAt) \ | 152 V(StringCharCodeAt) \ |
| 155 V(StringCharFromCode) \ | 153 V(StringCharFromCode) \ |
| 156 V(StringCompareAndBranch) \ | 154 V(StringCompareAndBranch) \ |
| 157 V(Sub) \ | 155 V(Sub) \ |
| 158 V(ThisFunction) \ | 156 V(ThisFunction) \ |
| (...skipping 5284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5443 SetAllSideEffects(); | 5441 SetAllSideEffects(); |
| 5444 } | 5442 } |
| 5445 | 5443 |
| 5446 Handle<String> name_; | 5444 Handle<String> name_; |
| 5447 TypeofMode typeof_mode_; | 5445 TypeofMode typeof_mode_; |
| 5448 Handle<TypeFeedbackVector> feedback_vector_; | 5446 Handle<TypeFeedbackVector> feedback_vector_; |
| 5449 FeedbackVectorSlot slot_; | 5447 FeedbackVectorSlot slot_; |
| 5450 }; | 5448 }; |
| 5451 | 5449 |
| 5452 | 5450 |
| 5453 class HLoadGlobalViaContext final : public HTemplateInstruction<1> { | |
| 5454 public: | |
| 5455 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HLoadGlobalViaContext, int, int); | |
| 5456 | |
| 5457 HValue* context() { return OperandAt(0); } | |
| 5458 int depth() const { return depth_; } | |
| 5459 int slot_index() const { return slot_index_; } | |
| 5460 | |
| 5461 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT | |
| 5462 | |
| 5463 Representation RequiredInputRepresentation(int index) override { | |
| 5464 return Representation::Tagged(); | |
| 5465 } | |
| 5466 | |
| 5467 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalViaContext) | |
| 5468 | |
| 5469 private: | |
| 5470 HLoadGlobalViaContext(HValue* context, int depth, int slot_index) | |
| 5471 : depth_(depth), slot_index_(slot_index) { | |
| 5472 SetOperandAt(0, context); | |
| 5473 set_representation(Representation::Tagged()); | |
| 5474 SetAllSideEffects(); | |
| 5475 } | |
| 5476 | |
| 5477 int const depth_; | |
| 5478 int const slot_index_; | |
| 5479 }; | |
| 5480 | |
| 5481 | |
| 5482 class HAllocate final : public HTemplateInstruction<2> { | 5451 class HAllocate final : public HTemplateInstruction<2> { |
| 5483 public: | 5452 public: |
| 5484 static bool CompatibleInstanceTypes(InstanceType type1, | 5453 static bool CompatibleInstanceTypes(InstanceType type1, |
| 5485 InstanceType type2) { | 5454 InstanceType type2) { |
| 5486 return ComputeFlags(TENURED, type1) == ComputeFlags(TENURED, type2) && | 5455 return ComputeFlags(TENURED, type1) == ComputeFlags(TENURED, type2) && |
| 5487 ComputeFlags(NOT_TENURED, type1) == ComputeFlags(NOT_TENURED, type2); | 5456 ComputeFlags(NOT_TENURED, type1) == ComputeFlags(NOT_TENURED, type2); |
| 5488 } | 5457 } |
| 5489 | 5458 |
| 5490 static HAllocate* New( | 5459 static HAllocate* New( |
| 5491 Isolate* isolate, Zone* zone, HValue* context, HValue* size, HType type, | 5460 Isolate* isolate, Zone* zone, HValue* context, HValue* size, HType type, |
| (...skipping 1510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7002 } | 6971 } |
| 7003 | 6972 |
| 7004 Handle<Name> name_; | 6973 Handle<Name> name_; |
| 7005 Handle<TypeFeedbackVector> feedback_vector_; | 6974 Handle<TypeFeedbackVector> feedback_vector_; |
| 7006 FeedbackVectorSlot slot_; | 6975 FeedbackVectorSlot slot_; |
| 7007 LanguageMode language_mode_; | 6976 LanguageMode language_mode_; |
| 7008 InlineCacheState initialization_state_; | 6977 InlineCacheState initialization_state_; |
| 7009 }; | 6978 }; |
| 7010 | 6979 |
| 7011 | 6980 |
| 7012 class HStoreGlobalViaContext final : public HTemplateInstruction<2> { | |
| 7013 public: | |
| 7014 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HStoreGlobalViaContext, HValue*, | |
| 7015 int, int, LanguageMode); | |
| 7016 HValue* context() const { return OperandAt(0); } | |
| 7017 HValue* value() const { return OperandAt(1); } | |
| 7018 int depth() const { return depth_; } | |
| 7019 int slot_index() const { return slot_index_; } | |
| 7020 LanguageMode language_mode() const { return language_mode_; } | |
| 7021 | |
| 7022 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT | |
| 7023 | |
| 7024 Representation RequiredInputRepresentation(int index) override { | |
| 7025 return Representation::Tagged(); | |
| 7026 } | |
| 7027 | |
| 7028 DECLARE_CONCRETE_INSTRUCTION(StoreGlobalViaContext) | |
| 7029 | |
| 7030 private: | |
| 7031 HStoreGlobalViaContext(HValue* context, HValue* value, int depth, | |
| 7032 int slot_index, LanguageMode language_mode) | |
| 7033 : depth_(depth), slot_index_(slot_index), language_mode_(language_mode) { | |
| 7034 SetOperandAt(0, context); | |
| 7035 SetOperandAt(1, value); | |
| 7036 SetAllSideEffects(); | |
| 7037 } | |
| 7038 | |
| 7039 int const depth_; | |
| 7040 int const slot_index_; | |
| 7041 LanguageMode const language_mode_; | |
| 7042 }; | |
| 7043 | |
| 7044 | |
| 7045 class HStoreKeyed final : public HTemplateInstruction<3>, | 6981 class HStoreKeyed final : public HTemplateInstruction<3>, |
| 7046 public ArrayInstructionInterface { | 6982 public ArrayInstructionInterface { |
| 7047 public: | 6983 public: |
| 7048 DECLARE_INSTRUCTION_FACTORY_P4(HStoreKeyed, HValue*, HValue*, HValue*, | 6984 DECLARE_INSTRUCTION_FACTORY_P4(HStoreKeyed, HValue*, HValue*, HValue*, |
| 7049 ElementsKind); | 6985 ElementsKind); |
| 7050 DECLARE_INSTRUCTION_FACTORY_P5(HStoreKeyed, HValue*, HValue*, HValue*, | 6986 DECLARE_INSTRUCTION_FACTORY_P5(HStoreKeyed, HValue*, HValue*, HValue*, |
| 7051 ElementsKind, StoreFieldOrKeyedMode); | 6987 ElementsKind, StoreFieldOrKeyedMode); |
| 7052 DECLARE_INSTRUCTION_FACTORY_P6(HStoreKeyed, HValue*, HValue*, HValue*, | 6988 DECLARE_INSTRUCTION_FACTORY_P6(HStoreKeyed, HValue*, HValue*, HValue*, |
| 7053 ElementsKind, StoreFieldOrKeyedMode, int); | 6989 ElementsKind, StoreFieldOrKeyedMode, int); |
| 7054 | 6990 |
| (...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7973 | 7909 |
| 7974 | 7910 |
| 7975 | 7911 |
| 7976 #undef DECLARE_INSTRUCTION | 7912 #undef DECLARE_INSTRUCTION |
| 7977 #undef DECLARE_CONCRETE_INSTRUCTION | 7913 #undef DECLARE_CONCRETE_INSTRUCTION |
| 7978 | 7914 |
| 7979 } // namespace internal | 7915 } // namespace internal |
| 7980 } // namespace v8 | 7916 } // namespace v8 |
| 7981 | 7917 |
| 7982 #endif // V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ | 7918 #endif // V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |