v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
builtins-bigint-gen.h
Go to the documentation of this file.
1// Copyright 2019 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_BUILTINS_BUILTINS_BIGINT_GEN_H_
6#define V8_BUILTINS_BUILTINS_BIGINT_GEN_H_
7
10
11namespace v8 {
12namespace internal {
13
15 public:
18
24
29
39
42 TNode<ExternalReference> mutable_big_int_absolute_add_and_canonicalize =
45 mutable_big_int_absolute_add_and_canonicalize_function());
46 CallCFunction(mutable_big_int_absolute_add_and_canonicalize,
48 std::make_pair(MachineType::AnyTagged(), result),
49 std::make_pair(MachineType::AnyTagged(), x),
50 std::make_pair(MachineType::AnyTagged(), y));
51 }
52
55 TNode<ExternalReference> mutable_big_int_absolute_sub_and_canonicalize =
58 mutable_big_int_absolute_sub_and_canonicalize_function());
59 CallCFunction(mutable_big_int_absolute_sub_and_canonicalize,
61 std::make_pair(MachineType::AnyTagged(), result),
62 std::make_pair(MachineType::AnyTagged(), x),
63 std::make_pair(MachineType::AnyTagged(), y));
64 }
65
69 TNode<ExternalReference> mutable_big_int_absolute_mul_and_canonicalize =
72 mutable_big_int_absolute_mul_and_canonicalize_function());
74 mutable_big_int_absolute_mul_and_canonicalize, MachineType::Int32(),
75 std::make_pair(MachineType::AnyTagged(), result),
76 std::make_pair(MachineType::AnyTagged(), x),
77 std::make_pair(MachineType::AnyTagged(), y)));
78 return return_code;
79 }
80
84 TNode<ExternalReference> mutable_big_int_absolute_div_and_canonicalize =
87 mutable_big_int_absolute_div_and_canonicalize_function());
89 mutable_big_int_absolute_div_and_canonicalize, MachineType::Int32(),
90 std::make_pair(MachineType::AnyTagged(), result),
91 std::make_pair(MachineType::AnyTagged(), x),
92 std::make_pair(MachineType::AnyTagged(), y)));
93 return return_code;
94 }
95
99 TNode<ExternalReference> mutable_big_int_absolute_mod_and_canonicalize =
102 mutable_big_int_absolute_mod_and_canonicalize_function());
104 mutable_big_int_absolute_mod_and_canonicalize, MachineType::Int32(),
105 std::make_pair(MachineType::AnyTagged(), result),
106 std::make_pair(MachineType::AnyTagged(), x),
107 std::make_pair(MachineType::AnyTagged(), y)));
108 return return_code;
109 }
110
114 mutable_big_int_bitwise_and_pos_pos_and_canonicalize = ExternalConstant(
116 mutable_big_int_bitwise_and_pp_and_canonicalize_function());
117 CallCFunction(mutable_big_int_bitwise_and_pos_pos_and_canonicalize,
119 std::make_pair(MachineType::AnyTagged(), result),
120 std::make_pair(MachineType::AnyTagged(), x),
121 std::make_pair(MachineType::AnyTagged(), y));
122 }
123
127 mutable_big_int_bitwise_and_neg_neg_and_canonicalize = ExternalConstant(
129 mutable_big_int_bitwise_and_nn_and_canonicalize_function());
130 CallCFunction(mutable_big_int_bitwise_and_neg_neg_and_canonicalize,
132 std::make_pair(MachineType::AnyTagged(), result),
133 std::make_pair(MachineType::AnyTagged(), x),
134 std::make_pair(MachineType::AnyTagged(), y));
135 }
136
140 mutable_big_int_bitwise_and_pos_neg_and_canonicalize = ExternalConstant(
142 mutable_big_int_bitwise_and_pn_and_canonicalize_function());
143 CallCFunction(mutable_big_int_bitwise_and_pos_neg_and_canonicalize,
145 std::make_pair(MachineType::AnyTagged(), result),
146 std::make_pair(MachineType::AnyTagged(), x),
147 std::make_pair(MachineType::AnyTagged(), y));
148 }
149
153 mutable_big_int_bitwise_or_pos_pos_and_canonicalize = ExternalConstant(
155 mutable_big_int_bitwise_or_pp_and_canonicalize_function());
156 CallCFunction(mutable_big_int_bitwise_or_pos_pos_and_canonicalize,
158 std::make_pair(MachineType::AnyTagged(), result),
159 std::make_pair(MachineType::AnyTagged(), x),
160 std::make_pair(MachineType::AnyTagged(), y));
161 }
162
166 mutable_big_int_bitwise_or_neg_neg_and_canonicalize = ExternalConstant(
168 mutable_big_int_bitwise_or_nn_and_canonicalize_function());
169 CallCFunction(mutable_big_int_bitwise_or_neg_neg_and_canonicalize,
171 std::make_pair(MachineType::AnyTagged(), result),
172 std::make_pair(MachineType::AnyTagged(), x),
173 std::make_pair(MachineType::AnyTagged(), y));
174 }
175
179 mutable_big_int_bitwise_or_pos_neg_and_canonicalize = ExternalConstant(
181 mutable_big_int_bitwise_or_pn_and_canonicalize_function());
182 CallCFunction(mutable_big_int_bitwise_or_pos_neg_and_canonicalize,
184 std::make_pair(MachineType::AnyTagged(), result),
185 std::make_pair(MachineType::AnyTagged(), x),
186 std::make_pair(MachineType::AnyTagged(), y));
187 }
188
192 mutable_big_int_bitwise_xor_pos_pos_and_canonicalize = ExternalConstant(
194 mutable_big_int_bitwise_xor_pp_and_canonicalize_function());
195 CallCFunction(mutable_big_int_bitwise_xor_pos_pos_and_canonicalize,
197 std::make_pair(MachineType::AnyTagged(), result),
198 std::make_pair(MachineType::AnyTagged(), x),
199 std::make_pair(MachineType::AnyTagged(), y));
200 }
201
205 mutable_big_int_bitwise_xor_neg_neg_and_canonicalize = ExternalConstant(
207 mutable_big_int_bitwise_xor_nn_and_canonicalize_function());
208 CallCFunction(mutable_big_int_bitwise_xor_neg_neg_and_canonicalize,
210 std::make_pair(MachineType::AnyTagged(), result),
211 std::make_pair(MachineType::AnyTagged(), x),
212 std::make_pair(MachineType::AnyTagged(), y));
213 }
214
218 mutable_big_int_bitwise_xor_pos_neg_and_canonicalize = ExternalConstant(
220 mutable_big_int_bitwise_xor_pn_and_canonicalize_function());
221 CallCFunction(mutable_big_int_bitwise_xor_pos_neg_and_canonicalize,
223 std::make_pair(MachineType::AnyTagged(), result),
224 std::make_pair(MachineType::AnyTagged(), x),
225 std::make_pair(MachineType::AnyTagged(), y));
226 }
227
229 TNode<IntPtrT> shift) {
230 TNode<ExternalReference> mutable_big_int_left_shift_and_canonicalize =
233 mutable_big_int_left_shift_and_canonicalize_function());
234 CallCFunction(mutable_big_int_left_shift_and_canonicalize,
236 std::make_pair(MachineType::AnyTagged(), result),
237 std::make_pair(MachineType::AnyTagged(), x),
238 std::make_pair(MachineType::IntPtr(), shift));
239 }
240
242 TNode<Uint32T> x_sign,
243 TNode<IntPtrT> shift) {
244 TNode<ExternalReference> big_int_right_shift_result_length =
246 ExternalReference::big_int_right_shift_result_length_function());
248 CallCFunction(big_int_right_shift_result_length, MachineType::Uint32(),
249 std::make_pair(MachineType::AnyTagged(), x),
250 std::make_pair(MachineType::Uint32(), x_sign),
251 std::make_pair(MachineType::IntPtr(), shift)));
252 }
253
255 TNode<IntPtrT> shift,
256 TNode<Uint32T> must_round_down) {
257 TNode<ExternalReference> mutable_big_int_right_shift_and_canonicalize =
260 mutable_big_int_right_shift_and_canonicalize_function());
261 CallCFunction(mutable_big_int_right_shift_and_canonicalize,
263 std::make_pair(MachineType::AnyTagged(), result),
264 std::make_pair(MachineType::AnyTagged(), x),
265 std::make_pair(MachineType::IntPtr(), shift),
266 std::make_pair(MachineType::Uint32(), must_round_down));
267 }
268
270 TNode<ExternalReference> mutable_big_int_absolute_compare =
272 ExternalReference::mutable_big_int_absolute_compare_function());
274 CallCFunction(mutable_big_int_absolute_compare, MachineType::Int32(),
275 std::make_pair(MachineType::AnyTagged(), x),
276 std::make_pair(MachineType::AnyTagged(), y)));
277 return result;
278 }
279};
280
281} // namespace internal
282} // namespace v8
283#endif // V8_BUILTINS_BUILTINS_BIGINT_GEN_H_
static constexpr U kMask
Definition bit-field.h:41
static constexpr int kShift
Definition bit-field.h:39
void CppBitwiseAndNegNegAndCanonicalize(TNode< BigInt > result, TNode< BigInt > x, TNode< BigInt > y)
BigIntBuiltinsAssembler(compiler::CodeAssemblerState *state)
TNode< Uint32T > ReadBigIntSign(TNode< BigInt > value)
TNode< Int32T > CppAbsoluteCompare(TNode< BigInt > x, TNode< BigInt > y)
void CppBitwiseXorPosPosAndCanonicalize(TNode< BigInt > result, TNode< BigInt > x, TNode< BigInt > y)
void CppBitwiseXorNegNegAndCanonicalize(TNode< BigInt > result, TNode< BigInt > x, TNode< BigInt > y)
void CppBitwiseOrPosPosAndCanonicalize(TNode< BigInt > result, TNode< BigInt > x, TNode< BigInt > y)
TNode< Uint32T > CppRightShiftResultLength(TNode< BigInt > x, TNode< Uint32T > x_sign, TNode< IntPtrT > shift)
void CppBitwiseAndPosNegAndCanonicalize(TNode< BigInt > result, TNode< BigInt > x, TNode< BigInt > y)
TNode< IntPtrT > ReadBigIntLength(TNode< BigInt > value)
void CppRightShiftAndCanonicalize(TNode< BigInt > result, TNode< BigInt > x, TNode< IntPtrT > shift, TNode< Uint32T > must_round_down)
void CppAbsoluteSubAndCanonicalize(TNode< BigInt > result, TNode< BigInt > x, TNode< BigInt > y)
void CppBitwiseOrPosNegAndCanonicalize(TNode< BigInt > result, TNode< BigInt > x, TNode< BigInt > y)
void CppBitwiseOrNegNegAndCanonicalize(TNode< BigInt > result, TNode< BigInt > x, TNode< BigInt > y)
void CppLeftShiftAndCanonicalize(TNode< BigInt > result, TNode< BigInt > x, TNode< IntPtrT > shift)
void CppBitwiseAndPosPosAndCanonicalize(TNode< BigInt > result, TNode< BigInt > x, TNode< BigInt > y)
TNode< Int32T > CppAbsoluteDivAndCanonicalize(TNode< BigInt > result, TNode< BigInt > x, TNode< BigInt > y)
TNode< Int32T > CppAbsoluteMulAndCanonicalize(TNode< BigInt > result, TNode< BigInt > x, TNode< BigInt > y)
void WriteBigIntSignAndLength(TNode< BigInt > bigint, TNode< Uint32T > sign, TNode< IntPtrT > length)
TNode< Int32T > CppAbsoluteModAndCanonicalize(TNode< BigInt > result, TNode< BigInt > x, TNode< BigInt > y)
void CppBitwiseXorPosNegAndCanonicalize(TNode< BigInt > result, TNode< BigInt > x, TNode< BigInt > y)
void CppAbsoluteAddAndCanonicalize(TNode< BigInt > result, TNode< BigInt > x, TNode< BigInt > y)
TNode< Int32T > TruncateIntPtrToInt32(TNode< IntPtrT > value)
TNode< Uint32T > DecodeWord32(TNode< Word32T > word32)
void StoreBigIntBitfield(TNode< BigInt > bigint, TNode< Word32T > bitfield)
TNode< Word32T > LoadBigIntBitfield(TNode< BigInt > bigint)
static constexpr MachineType Int32()
static constexpr MachineType AnyTagged()
static constexpr MachineType Uint32()
static constexpr MachineType IntPtr()
TNode< Int32T > Signed(TNode< Word32T > x)
TNode< T > UncheckedCast(Node *value)
TNode< Uint32T > Unsigned(TNode< Word32T > x)
TNode< Int32T > Word32And(TNode< Int32T > left, TNode< Int32T > right)
TNode< IntPtrT > ChangeInt32ToIntPtr(TNode< Word32T > value)
TNode< Int32T > Word32Or(TNode< Int32T > left, TNode< Int32T > right)
TNode< Int32T > Word32Shl(TNode< Int32T > left, TNode< Int32T > right)
TNode< ExternalReference > ExternalConstant(ExternalReference address)
TNode< Int32T > Int32Constant(int32_t value)
Node * CallCFunction(Node *function, std::optional< MachineType > return_type, CArgs... cargs)
ZoneVector< RpoNumber > & result
int x