| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 #define HYDROGEN_CONCRETE_INSTRUCTION_LIST(V) \ | 64 #define HYDROGEN_CONCRETE_INSTRUCTION_LIST(V) \ |
| 65 V(AbnormalExit) \ | 65 V(AbnormalExit) \ |
| 66 V(AccessArgumentsAt) \ | 66 V(AccessArgumentsAt) \ |
| 67 V(Add) \ | 67 V(Add) \ |
| 68 V(Allocate) \ | 68 V(Allocate) \ |
| 69 V(AllocateObject) \ | 69 V(AllocateObject) \ |
| 70 V(ApplyArguments) \ | 70 V(ApplyArguments) \ |
| 71 V(ArgumentsElements) \ | 71 V(ArgumentsElements) \ |
| 72 V(ArgumentsLength) \ | 72 V(ArgumentsLength) \ |
| 73 V(ArgumentsObject) \ | 73 V(ArgumentsObject) \ |
| 74 V(BitNot) \ |
| 74 V(Bitwise) \ | 75 V(Bitwise) \ |
| 75 V(BitNot) \ | |
| 76 V(BlockEntry) \ | 76 V(BlockEntry) \ |
| 77 V(BoundsCheck) \ | 77 V(BoundsCheck) \ |
| 78 V(BoundsCheckBaseIndexInformation) \ | 78 V(BoundsCheckBaseIndexInformation) \ |
| 79 V(Branch) \ | 79 V(Branch) \ |
| 80 V(CallConstantFunction) \ | 80 V(CallConstantFunction) \ |
| 81 V(CallFunction) \ | 81 V(CallFunction) \ |
| 82 V(CallGlobal) \ | 82 V(CallGlobal) \ |
| 83 V(CallKeyed) \ | 83 V(CallKeyed) \ |
| 84 V(CallKnownGlobal) \ | 84 V(CallKnownGlobal) \ |
| 85 V(CallNamed) \ | 85 V(CallNamed) \ |
| 86 V(CallNew) \ | 86 V(CallNew) \ |
| 87 V(CallNewArray) \ | 87 V(CallNewArray) \ |
| 88 V(CallRuntime) \ | 88 V(CallRuntime) \ |
| 89 V(CallStub) \ | 89 V(CallStub) \ |
| 90 V(Change) \ | 90 V(Change) \ |
| 91 V(CheckFunction) \ | 91 V(CheckFunction) \ |
| 92 V(CheckInstanceType) \ | 92 V(CheckInstanceType) \ |
| 93 V(CheckMaps) \ | 93 V(CheckMaps) \ |
| 94 V(CheckNonSmi) \ | 94 V(CheckNonSmi) \ |
| 95 V(CheckPrototypeMaps) \ | 95 V(CheckPrototypeMaps) \ |
| 96 V(ClampToUint8) \ | 96 V(ClampToUint8) \ |
| 97 V(ClassOfTestAndBranch) \ | 97 V(ClassOfTestAndBranch) \ |
| 98 V(CompareConstantEqAndBranch) \ |
| 99 V(CompareGeneric) \ |
| 98 V(CompareIDAndBranch) \ | 100 V(CompareIDAndBranch) \ |
| 99 V(CompareGeneric) \ | 101 V(CompareMap) \ |
| 100 V(CompareObjectEqAndBranch) \ | 102 V(CompareObjectEqAndBranch) \ |
| 101 V(CompareMap) \ | |
| 102 V(CompareConstantEqAndBranch) \ | |
| 103 V(Constant) \ | 103 V(Constant) \ |
| 104 V(Context) \ | 104 V(Context) \ |
| 105 V(DebugBreak) \ | 105 V(DebugBreak) \ |
| 106 V(DeclareGlobals) \ | 106 V(DeclareGlobals) \ |
| 107 V(DeleteProperty) \ | 107 V(DeleteProperty) \ |
| 108 V(Deoptimize) \ | 108 V(Deoptimize) \ |
| 109 V(Div) \ | 109 V(Div) \ |
| 110 V(DummyUse) \ | 110 V(DummyUse) \ |
| 111 V(ElementsKind) \ | 111 V(ElementsKind) \ |
| 112 V(EnterInlined) \ | 112 V(EnterInlined) \ |
| 113 V(EnterTry) \ |
| 113 V(EnvironmentMarker) \ | 114 V(EnvironmentMarker) \ |
| 114 V(FixedArrayBaseLength) \ | 115 V(FixedArrayBaseLength) \ |
| 115 V(ForceRepresentation) \ | 116 V(ForceRepresentation) \ |
| 116 V(FunctionLiteral) \ | 117 V(FunctionLiteral) \ |
| 117 V(GetCachedArrayIndex) \ | 118 V(GetCachedArrayIndex) \ |
| 118 V(GlobalObject) \ | 119 V(GlobalObject) \ |
| 119 V(GlobalReceiver) \ | 120 V(GlobalReceiver) \ |
| 120 V(Goto) \ | 121 V(Goto) \ |
| 121 V(HasCachedArrayIndexAndBranch) \ | 122 V(HasCachedArrayIndexAndBranch) \ |
| 122 V(HasInstanceTypeAndBranch) \ | 123 V(HasInstanceTypeAndBranch) \ |
| 123 V(InductionVariableAnnotation) \ | 124 V(InductionVariableAnnotation) \ |
| 124 V(In) \ | 125 V(In) \ |
| 125 V(InnerAllocatedObject) \ | 126 V(InnerAllocatedObject) \ |
| 126 V(InstanceOf) \ | 127 V(InstanceOf) \ |
| 127 V(InstanceOfKnownGlobal) \ | 128 V(InstanceOfKnownGlobal) \ |
| 128 V(InstanceSize) \ | 129 V(InstanceSize) \ |
| 129 V(InvokeFunction) \ | 130 V(InvokeFunction) \ |
| 130 V(IsConstructCallAndBranch) \ | 131 V(IsConstructCallAndBranch) \ |
| 131 V(IsObjectAndBranch) \ | 132 V(IsObjectAndBranch) \ |
| 133 V(IsSmiAndBranch) \ |
| 132 V(IsStringAndBranch) \ | 134 V(IsStringAndBranch) \ |
| 133 V(IsSmiAndBranch) \ | |
| 134 V(IsUndetectableAndBranch) \ | 135 V(IsUndetectableAndBranch) \ |
| 135 V(LeaveInlined) \ | 136 V(LeaveInlined) \ |
| 137 V(LeaveTry) \ |
| 136 V(LoadContextSlot) \ | 138 V(LoadContextSlot) \ |
| 137 V(LoadExternalArrayPointer) \ | 139 V(LoadExternalArrayPointer) \ |
| 138 V(LoadFunctionPrototype) \ | 140 V(LoadFunctionPrototype) \ |
| 139 V(LoadGlobalCell) \ | 141 V(LoadGlobalCell) \ |
| 140 V(LoadGlobalGeneric) \ | 142 V(LoadGlobalGeneric) \ |
| 141 V(LoadKeyed) \ | 143 V(LoadKeyed) \ |
| 142 V(LoadKeyedGeneric) \ | 144 V(LoadKeyedGeneric) \ |
| 143 V(LoadNamedField) \ | 145 V(LoadNamedField) \ |
| 144 V(LoadNamedFieldPolymorphic) \ | 146 V(LoadNamedFieldPolymorphic) \ |
| 145 V(LoadNamedGeneric) \ | 147 V(LoadNamedGeneric) \ |
| (...skipping 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1346 HValue* OperandAt(int i) const { return inputs_[i]; } | 1348 HValue* OperandAt(int i) const { return inputs_[i]; } |
| 1347 | 1349 |
| 1348 protected: | 1350 protected: |
| 1349 void InternalSetOperandAt(int i, HValue* value) { inputs_[i] = value; } | 1351 void InternalSetOperandAt(int i, HValue* value) { inputs_[i] = value; } |
| 1350 | 1352 |
| 1351 private: | 1353 private: |
| 1352 EmbeddedContainer<HValue*, V> inputs_; | 1354 EmbeddedContainer<HValue*, V> inputs_; |
| 1353 }; | 1355 }; |
| 1354 | 1356 |
| 1355 | 1357 |
| 1358 template <> |
| 1359 class HTemplateInstruction<0> : public HInstruction { |
| 1360 public: |
| 1361 int OperandCount() { return 0; } |
| 1362 virtual HValue* OperandAt(int i) const { |
| 1363 UNREACHABLE(); |
| 1364 return NULL; |
| 1365 } |
| 1366 |
| 1367 virtual Representation RequiredInputRepresentation(int index) { |
| 1368 return Representation::None(); |
| 1369 } |
| 1370 |
| 1371 protected: |
| 1372 void InternalSetOperandAt(int i, HValue* value) { UNREACHABLE(); } |
| 1373 }; |
| 1374 |
| 1375 |
| 1356 class HControlInstruction: public HInstruction { | 1376 class HControlInstruction: public HInstruction { |
| 1357 public: | 1377 public: |
| 1358 virtual HBasicBlock* SuccessorAt(int i) = 0; | 1378 virtual HBasicBlock* SuccessorAt(int i) = 0; |
| 1359 virtual int SuccessorCount() = 0; | 1379 virtual int SuccessorCount() = 0; |
| 1360 virtual void SetSuccessorAt(int i, HBasicBlock* block) = 0; | 1380 virtual void SetSuccessorAt(int i, HBasicBlock* block) = 0; |
| 1361 | 1381 |
| 1362 virtual void PrintDataTo(StringStream* stream); | 1382 virtual void PrintDataTo(StringStream* stream); |
| 1363 | 1383 |
| 1364 HBasicBlock* FirstSuccessor() { | 1384 HBasicBlock* FirstSuccessor() { |
| 1365 return SuccessorCount() > 0 ? SuccessorAt(0) : NULL; | 1385 return SuccessorCount() > 0 ? SuccessorAt(0) : NULL; |
| (...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2008 bool is_function_entry() { return type_ == kFunctionEntry; } | 2028 bool is_function_entry() { return type_ == kFunctionEntry; } |
| 2009 bool is_backwards_branch() { return type_ == kBackwardsBranch; } | 2029 bool is_backwards_branch() { return type_ == kBackwardsBranch; } |
| 2010 | 2030 |
| 2011 DECLARE_CONCRETE_INSTRUCTION(StackCheck) | 2031 DECLARE_CONCRETE_INSTRUCTION(StackCheck) |
| 2012 | 2032 |
| 2013 private: | 2033 private: |
| 2014 Type type_; | 2034 Type type_; |
| 2015 }; | 2035 }; |
| 2016 | 2036 |
| 2017 | 2037 |
| 2038 class HEnterTry: public HTemplateInstruction<0> { |
| 2039 public: |
| 2040 explicit HEnterTry(int index) : index_(index) { |
| 2041 SetAllSideEffects(); |
| 2042 } |
| 2043 |
| 2044 DECLARE_CONCRETE_INSTRUCTION(EnterTry) |
| 2045 |
| 2046 int index() { return index_; } |
| 2047 |
| 2048 private: |
| 2049 int index_; |
| 2050 }; |
| 2051 |
| 2052 |
| 2053 class HLeaveTry: public HTemplateInstruction<0> { |
| 2054 public: |
| 2055 HLeaveTry() { SetAllSideEffects(); } |
| 2056 |
| 2057 DECLARE_CONCRETE_INSTRUCTION(LeaveTry) |
| 2058 }; |
| 2059 |
| 2060 |
| 2018 enum InliningKind { | 2061 enum InliningKind { |
| 2019 NORMAL_RETURN, // Normal function/method call and return. | 2062 NORMAL_RETURN, // Normal function/method call and return. |
| 2020 DROP_EXTRA_ON_RETURN, // Drop an extra value from the environment on return. | 2063 DROP_EXTRA_ON_RETURN, // Drop an extra value from the environment on return. |
| 2021 CONSTRUCT_CALL_RETURN, // Either use allocated receiver or return value. | 2064 CONSTRUCT_CALL_RETURN, // Either use allocated receiver or return value. |
| 2022 GETTER_CALL_RETURN, // Returning from a getter, need to restore context. | 2065 GETTER_CALL_RETURN, // Returning from a getter, need to restore context. |
| 2023 SETTER_CALL_RETURN // Use the RHS of the assignment as the return value. | 2066 SETTER_CALL_RETURN // Use the RHS of the assignment as the return value. |
| 2024 }; | 2067 }; |
| 2025 | 2068 |
| 2026 | 2069 |
| 2027 class HArgumentsObject; | 2070 class HArgumentsObject; |
| (...skipping 4613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6641 virtual bool IsDeletable() const { return true; } | 6684 virtual bool IsDeletable() const { return true; } |
| 6642 }; | 6685 }; |
| 6643 | 6686 |
| 6644 | 6687 |
| 6645 #undef DECLARE_INSTRUCTION | 6688 #undef DECLARE_INSTRUCTION |
| 6646 #undef DECLARE_CONCRETE_INSTRUCTION | 6689 #undef DECLARE_CONCRETE_INSTRUCTION |
| 6647 | 6690 |
| 6648 } } // namespace v8::internal | 6691 } } // namespace v8::internal |
| 6649 | 6692 |
| 6650 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 6693 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |