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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 Node* Allocate(int size, AllocationFlags flags = kNone); | 162 Node* Allocate(int size, AllocationFlags flags = kNone); |
163 Node* InnerAllocate(Node* previous, int offset); | 163 Node* InnerAllocate(Node* previous, int offset); |
164 Node* InnerAllocate(Node* previous, Node* offset); | 164 Node* InnerAllocate(Node* previous, Node* offset); |
165 Node* IsRegularHeapObjectSize(Node* size); | 165 Node* IsRegularHeapObjectSize(Node* size); |
166 | 166 |
167 typedef std::function<Node*()> NodeGenerator; | 167 typedef std::function<Node*()> NodeGenerator; |
168 | 168 |
169 void Assert(const NodeGenerator& condition_body, const char* string = nullptr, | 169 void Assert(const NodeGenerator& condition_body, const char* string = nullptr, |
170 const char* file = nullptr, int line = 0); | 170 const char* file = nullptr, int line = 0); |
171 | 171 |
| 172 Node* Select(Node* condition, const NodeGenerator& true_body, |
| 173 const NodeGenerator& false_body, MachineRepresentation rep); |
| 174 |
| 175 Node* SelectConstant(Node* condition, Node* true_value, Node* false_value, |
| 176 MachineRepresentation rep); |
| 177 |
| 178 Node* SelectInt32Constant(Node* condition, int true_value, int false_value); |
| 179 Node* SelectIntPtrConstant(Node* condition, int true_value, int false_value); |
| 180 Node* SelectBooleanConstant(Node* condition); |
| 181 Node* SelectTaggedConstant(Node* condition, Node* true_value, |
| 182 Node* false_value); |
| 183 |
172 // Check a value for smi-ness | 184 // Check a value for smi-ness |
173 Node* TaggedIsSmi(Node* a); | 185 Node* TaggedIsSmi(Node* a); |
174 Node* TaggedIsNotSmi(Node* a); | 186 Node* TaggedIsNotSmi(Node* a); |
175 // Check that the value is a non-negative smi. | 187 // Check that the value is a non-negative smi. |
176 Node* WordIsPositiveSmi(Node* a); | 188 Node* WordIsPositiveSmi(Node* a); |
177 // Check that a word has a word-aligned address. | 189 // Check that a word has a word-aligned address. |
178 Node* WordIsWordAligned(Node* word); | 190 Node* WordIsWordAligned(Node* word); |
179 Node* WordIsPowerOfTwo(Node* value); | 191 Node* WordIsPowerOfTwo(Node* value); |
180 | 192 |
181 void BranchIfSmiEqual(Node* a, Node* b, Label* if_true, Label* if_false) { | 193 void BranchIfSmiEqual(Node* a, Node* b, Label* if_true, Label* if_false) { |
(...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1111 } | 1123 } |
1112 #else | 1124 #else |
1113 #define CSA_SLOW_ASSERT(csa, x) ((void)0) | 1125 #define CSA_SLOW_ASSERT(csa, x) ((void)0) |
1114 #endif | 1126 #endif |
1115 | 1127 |
1116 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 1128 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
1117 | 1129 |
1118 } // namespace internal | 1130 } // namespace internal |
1119 } // namespace v8 | 1131 } // namespace v8 |
1120 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 1132 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
OLD | NEW |