OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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_CODE_STUB_ASSEMBLER_H_ | 5 #ifndef V8_CODE_STUB_ASSEMBLER_H_ |
6 #define V8_CODE_STUB_ASSEMBLER_H_ | 6 #define V8_CODE_STUB_ASSEMBLER_H_ |
7 | 7 |
8 #include <functional> | 8 #include <functional> |
9 | 9 |
10 #include "src/compiler/code-assembler.h" | 10 #include "src/compiler/code-assembler.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 Node* UntagParameter(Node* value, ParameterMode mode) { | 87 Node* UntagParameter(Node* value, ParameterMode mode) { |
88 if (mode != SMI_PARAMETERS) value = SmiUntag(value); | 88 if (mode != SMI_PARAMETERS) value = SmiUntag(value); |
89 return value; | 89 return value; |
90 } | 90 } |
91 | 91 |
92 Node* TagParameter(Node* value, ParameterMode mode) { | 92 Node* TagParameter(Node* value, ParameterMode mode) { |
93 if (mode != SMI_PARAMETERS) value = SmiTag(value); | 93 if (mode != SMI_PARAMETERS) value = SmiTag(value); |
94 return value; | 94 return value; |
95 } | 95 } |
96 | 96 |
| 97 #define PARAMETER_BINARY_OPERATION(OpName, IntPtrOpName, SmiOpName, \ |
| 98 Int32OpName) \ |
| 99 Node* OpName(Node* value1, Node* value2, ParameterMode mode) { \ |
| 100 if (mode == SMI_PARAMETERS) { \ |
| 101 return SmiOpName(value1, value2); \ |
| 102 } else if (mode == INTPTR_PARAMETERS) { \ |
| 103 return IntPtrOpName(value1, value2); \ |
| 104 } else { \ |
| 105 DCHECK_EQ(INTEGER_PARAMETERS, mode); \ |
| 106 return Int32OpName(value1, value2); \ |
| 107 } \ |
| 108 } |
| 109 PARAMETER_BINARY_OPERATION(IntPtrOrSmiAdd, IntPtrAdd, SmiAdd, Int32Add) |
| 110 PARAMETER_BINARY_OPERATION(IntPtrOrSmiLessThan, IntPtrLessThan, SmiLessThan, |
| 111 Int32LessThan) |
| 112 PARAMETER_BINARY_OPERATION(IntPtrOrSmiGreaterThan, IntPtrGreaterThan, |
| 113 SmiGreaterThan, Int32GreaterThan) |
| 114 PARAMETER_BINARY_OPERATION(UintPtrOrSmiLessThan, UintPtrLessThan, SmiBelow, |
| 115 Uint32LessThan) |
| 116 |
| 117 #undef PARAMETER_BINARY_OPERATION |
| 118 |
97 Node* NoContextConstant(); | 119 Node* NoContextConstant(); |
98 #define HEAP_CONSTANT_ACCESSOR(rootName, name) Node* name##Constant(); | 120 #define HEAP_CONSTANT_ACCESSOR(rootName, name) Node* name##Constant(); |
99 HEAP_CONSTANT_LIST(HEAP_CONSTANT_ACCESSOR) | 121 HEAP_CONSTANT_LIST(HEAP_CONSTANT_ACCESSOR) |
100 #undef HEAP_CONSTANT_ACCESSOR | 122 #undef HEAP_CONSTANT_ACCESSOR |
101 | 123 |
102 #define HEAP_CONSTANT_TEST(rootName, name) Node* Is##name(Node* value); | 124 #define HEAP_CONSTANT_TEST(rootName, name) Node* Is##name(Node* value); |
103 HEAP_CONSTANT_LIST(HEAP_CONSTANT_TEST) | 125 HEAP_CONSTANT_LIST(HEAP_CONSTANT_TEST) |
104 #undef HEAP_CONSTANT_TEST | 126 #undef HEAP_CONSTANT_TEST |
105 | 127 |
106 Node* HashSeed(); | 128 Node* HashSeed(); |
(...skipping 28 matching lines...) Expand all Loading... |
135 | 157 |
136 // Smi operations. | 158 // Smi operations. |
137 Node* SmiAdd(Node* a, Node* b); | 159 Node* SmiAdd(Node* a, Node* b); |
138 Node* SmiSub(Node* a, Node* b); | 160 Node* SmiSub(Node* a, Node* b); |
139 Node* SmiEqual(Node* a, Node* b); | 161 Node* SmiEqual(Node* a, Node* b); |
140 Node* SmiAbove(Node* a, Node* b); | 162 Node* SmiAbove(Node* a, Node* b); |
141 Node* SmiAboveOrEqual(Node* a, Node* b); | 163 Node* SmiAboveOrEqual(Node* a, Node* b); |
142 Node* SmiBelow(Node* a, Node* b); | 164 Node* SmiBelow(Node* a, Node* b); |
143 Node* SmiLessThan(Node* a, Node* b); | 165 Node* SmiLessThan(Node* a, Node* b); |
144 Node* SmiLessThanOrEqual(Node* a, Node* b); | 166 Node* SmiLessThanOrEqual(Node* a, Node* b); |
| 167 Node* SmiGreaterThan(Node* a, Node* b); |
145 Node* SmiMax(Node* a, Node* b); | 168 Node* SmiMax(Node* a, Node* b); |
146 Node* SmiMin(Node* a, Node* b); | 169 Node* SmiMin(Node* a, Node* b); |
147 // Computes a % b for Smi inputs a and b; result is not necessarily a Smi. | 170 // Computes a % b for Smi inputs a and b; result is not necessarily a Smi. |
148 Node* SmiMod(Node* a, Node* b); | 171 Node* SmiMod(Node* a, Node* b); |
149 // Computes a * b for Smi inputs a and b; result is not necessarily a Smi. | 172 // Computes a * b for Smi inputs a and b; result is not necessarily a Smi. |
150 Node* SmiMul(Node* a, Node* b); | 173 Node* SmiMul(Node* a, Node* b); |
151 Node* SmiOr(Node* a, Node* b) { | 174 Node* SmiOr(Node* a, Node* b) { |
152 return BitcastWordToTaggedSigned( | 175 return BitcastWordToTaggedSigned( |
153 WordOr(BitcastTaggedToWord(a), BitcastTaggedToWord(b))); | 176 WordOr(BitcastTaggedToWord(a), BitcastTaggedToWord(b))); |
154 } | 177 } |
(...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1131 } | 1154 } |
1132 #else | 1155 #else |
1133 #define CSA_SLOW_ASSERT(csa, x) ((void)0) | 1156 #define CSA_SLOW_ASSERT(csa, x) ((void)0) |
1134 #endif | 1157 #endif |
1135 | 1158 |
1136 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 1159 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
1137 | 1160 |
1138 } // namespace internal | 1161 } // namespace internal |
1139 } // namespace v8 | 1162 } // namespace v8 |
1140 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 1163 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
OLD | NEW |