Lines Matching defs:length
56 IsolateT* isolate, int length,
60 void InitializeDigits(int length, byte value = 0);
125 inline void initialize_bitfield(bool sign, int length) {
126 int32_t bitfield = LengthBits::encode(length) | SignBits::encode(sign);
130 SLOW_DCHECK(0 <= n && n < length());
156 bigint.length());
166 bigint.length());
176 // those from exceeding the maximum length, effectively preventing a
181 FATAL("Aborting on invalid BigInt length");
187 MaybeHandle<MutableBigInt> MutableBigInt::New(IsolateT* isolate, int length,
189 if (length > BigInt::kMaxLength) {
193 Cast(isolate->factory()->NewBigInt(length, allocation));
194 result->initialize_bitfield(false, length);
196 result->InitializeDigits(length, 0xBF);
289 int length = source->length();
290 // Allocating a BigInt of the same length as an existing BigInt cannot throw.
291 Handle<MutableBigInt> result = New(isolate, length).ToHandleChecked();
294 BigInt::SizeFor(length) - BigIntBase::kHeaderSize);
298 void MutableBigInt::InitializeDigits(int length, byte value) {
300 length * kDigitSize);
318 int old_length = result.length();
340 DCHECK_IMPLIES(result.length() > 0,
341 result.digit(result.length() - 1) != 0); // MSD is non-zero.
390 if (base->length() == 1 && base->digit(0) == 1) {
401 if (exponent->length() > 1) {
411 if (base->length() == 1 && base->digit(0) == 2) {
482 if (y->length() == 1 && y->digit(0) == 1) {
512 if (y->length() == 1 && y->digit(0) == 1) return Zero(isolate);
537 bigint::AddSignedResultLength(x->length(), y->length(), xsign == ysign);
557 x->length(), y->length(), xsign == ysign);
625 if (x.length() != y.length()) return false;
626 for (int i = 0; i < x.length(); i++) {
639 bigint::BitwiseAnd_PosPos_ResultLength(x->length(), y->length());
645 bigint::BitwiseAnd_NegNeg_ResultLength(x->length(), y->length());
653 int result_length = bigint::BitwiseAnd_PosNeg_ResultLength(x->length());
668 bigint::BitwiseXor_PosPos_ResultLength(x->length(), y->length());
674 bigint::BitwiseXor_NegNeg_ResultLength(x->length(), y->length());
681 bigint::BitwiseXor_PosNeg_ResultLength(x->length(), y->length());
695 int result_length = bigint::BitwiseOrResultLength(x->length(), y->length());
781 return (x->length() == 1) && (x->sign() == (value < 0)) &&
805 if (x->length() > 1) return AbsoluteGreater(x_sign);
850 int x_length = x->length();
933 if (bigint->length() == 1 && radix == 10) {
1008 DCHECK(result->length() == chars_written);
1056 if (str->length() > kMaxRenderedLength) {
1079 if (x->length() == 1 && x->digit(0) < Smi::kMaxValue) {
1090 int x_length = x->length();
1179 int len = length();
1198 int input_length = x->length();
1215 DCHECK(result->length() == result_length);
1232 int length = x->length();
1233 Handle<MutableBigInt> result = New(isolate, length).ToHandleChecked();
1234 if (length == 1) {
1251 x->length(), x->digit(x->length() - 1), shift);
1276 DCHECK_LE(result_length, x->length());
1295 // Returns the value of {x} if it is less than the maximum bit length of
1298 if (x->length() > 1) return Nothing<digit_t>();
1337 // we convert the length-in-digits to length-in-bytes for serialization.
1340 int bytelength = length() * kDigitSize;
1354 int bytelength = length() * kDigitSize;
1359 for (int i = 0; i < length(); i++) {
1373 DCHECK(digits_storage.length() == bytelength);
1375 int length = (bytelength + kDigitSize - 1) / kDigitSize; // Round up.
1377 MutableBigInt::Cast(isolate->factory()->NewBigInt(length));
1378 result->initialize_bitfield(sign, length);
1385 memset(padding_start, 0, length * kDigitSize - bytelength);
1452 int length = 64 / kDigitBits;
1454 MutableBigInt::Cast(isolate->factory()->NewBigInt(length));
1456 result->initialize_bitfield(sign, length);
1474 int length = 64 / kDigitBits;
1476 MutableBigInt::Cast(isolate->factory()->NewBigInt(length));
1477 result->initialize_bitfield(false, length);
1490 int length = (64 / kDigitBits) * words64_count;
1491 DCHECK_GT(length, 0);
1492 if (kDigitBits == 32 && words[words64_count - 1] <= (1ULL << 32)) length--;
1495 if (!MutableBigInt::New(isolate, length).ToHandle(&result)) {
1501 for (int i = 0; i < length; ++i) {
1505 for (int i = 0; i < length; i += 2) {
1509 if (i + 1 < length) result->set_digit(i + 1, hi);
1518 return length() / (64 / kDigitBits) +
1519 (kDigitBits == 32 && length() % 2 == 1 ? 1 : 0);
1532 int len = length();
1548 int len = x.length();
1586 int len = length();
1587 os << "\n- length: " << len;