• Home
  • Raw
  • Download

Lines Matching refs:MutableBigInt

44 class MutableBigInt : public FreshlyAllocatedBigInt {  class
47 static MaybeHandle<BigInt> MakeImmutable(MaybeHandle<MutableBigInt> maybe);
49 static Handle<BigInt> MakeImmutable(Handle<MutableBigInt> result);
51 static void Canonicalize(MutableBigInt result);
55 static MaybeHandle<MutableBigInt> New(
61 static Handle<MutableBigInt> Copy(Isolate* isolate,
71 static Handle<MutableBigInt> Cast(Handle<FreshlyAllocatedBigInt> bigint) { in Cast()
73 return Handle<MutableBigInt>::cast(bigint); in Cast()
75 static MutableBigInt cast(Object o) { in cast()
77 return MutableBigInt(o.ptr()); in cast()
79 static MutableBigInt unchecked_cast(Object o) { in unchecked_cast()
80 return MutableBigInt(o.ptr()); in unchecked_cast()
84 static MaybeHandle<MutableBigInt> AbsoluteAddOne(
86 MutableBigInt result_storage = MutableBigInt());
87 static Handle<MutableBigInt> AbsoluteSubOne(Isolate* isolate,
143 OBJECT_CONSTRUCTORS(MutableBigInt, FreshlyAllocatedBigInt);
146 OBJECT_CONSTRUCTORS_IMPL(MutableBigInt, FreshlyAllocatedBigInt) in OBJECT_CONSTRUCTORS_IMPL() argument
147 NEVER_READ_ONLY_SPACE_IMPL(MutableBigInt) in OBJECT_CONSTRUCTORS_IMPL()
162 bigint::RWDigits GetRWDigits(MutableBigInt bigint) { in GetRWDigits()
168 bigint::RWDigits GetRWDigits(Handle<MutableBigInt> bigint) { in GetRWDigits()
187 MaybeHandle<MutableBigInt> MutableBigInt::New(IsolateT* isolate, int length, in New()
190 return ThrowBigIntTooBig<MutableBigInt>(isolate); in New()
192 Handle<MutableBigInt> result = in New()
201 Handle<BigInt> MutableBigInt::NewFromInt(Isolate* isolate, int value) { in NewFromInt()
203 Handle<MutableBigInt> result = Cast(isolate->factory()->NewBigInt(1)); in NewFromInt()
219 Handle<BigInt> MutableBigInt::NewFromDouble(Isolate* isolate, double value) { in NewFromDouble()
232 Handle<MutableBigInt> result = Cast(isolate->factory()->NewBigInt(digits)); in NewFromDouble()
287 Handle<MutableBigInt> MutableBigInt::Copy(Isolate* isolate, in Copy()
291 Handle<MutableBigInt> result = New(isolate, length).ToHandleChecked(); in Copy()
298 void MutableBigInt::InitializeDigits(int length, byte value) { in InitializeDigits()
303 MaybeHandle<BigInt> MutableBigInt::MakeImmutable( in MakeImmutable()
304 MaybeHandle<MutableBigInt> maybe) { in MakeImmutable()
305 Handle<MutableBigInt> result; in MakeImmutable()
311 Handle<BigInt> MutableBigInt::MakeImmutable(Handle<MutableBigInt> result) { in MakeImmutable()
312 MutableBigInt::Canonicalize(*result); in MakeImmutable()
316 void MutableBigInt::Canonicalize(MutableBigInt result) { in Canonicalize()
323 int size_delta = to_trim * MutableBigInt::kDigitSize; in Canonicalize()
346 return MutableBigInt::Zero(isolate, allocation); in Zero()
358 Handle<MutableBigInt> result = MutableBigInt::Copy(isolate, x); in UnaryMinus()
360 return MutableBigInt::MakeImmutable(result); in UnaryMinus()
364 MaybeHandle<MutableBigInt> result; in BitwiseNot()
367 result = MutableBigInt::AbsoluteSubOne(isolate, x); in BitwiseNot()
370 result = MutableBigInt::AbsoluteAddOne(isolate, x, true); in BitwiseNot()
372 return MutableBigInt::MakeImmutable(result); in BitwiseNot()
385 return MutableBigInt::NewFromInt(isolate, 1); in Exponentiate()
414 Handle<MutableBigInt> result; in Exponentiate()
415 if (!MutableBigInt::New(isolate, needed_digits).ToHandle(&result)) { in Exponentiate()
424 return MutableBigInt::MakeImmutable(result); in Exponentiate()
452 Handle<MutableBigInt> result; in Multiply()
453 if (!MutableBigInt::New(isolate, result_length).ToHandle(&result)) { in Multiply()
465 return MutableBigInt::MakeImmutable(result); in Multiply()
485 Handle<MutableBigInt> quotient; in Divide()
487 if (!MutableBigInt::New(isolate, result_length).ToHandle(&quotient)) { in Divide()
499 return MutableBigInt::MakeImmutable(quotient); in Divide()
513 Handle<MutableBigInt> remainder; in Remainder()
515 if (!MutableBigInt::New(isolate, result_length).ToHandle(&remainder)) { in Remainder()
527 return MutableBigInt::MakeImmutable(remainder); in Remainder()
538 Handle<MutableBigInt> result; in Add()
539 if (!MutableBigInt::New(isolate, result_length).ToHandle(&result)) { in Add()
547 return MutableBigInt::MakeImmutable(result); in Add()
558 Handle<MutableBigInt> result; in Subtract()
559 if (!MutableBigInt::New(isolate, result_length).ToHandle(&result)) { in Subtract()
567 return MutableBigInt::MakeImmutable(result); in Subtract()
573 if (y->sign()) return MutableBigInt::RightShiftByAbsolute(isolate, x, y); in LeftShift()
574 return MutableBigInt::LeftShiftByAbsolute(isolate, x, y); in LeftShift()
580 if (y->sign()) return MutableBigInt::LeftShiftByAbsolute(isolate, x, y); in SignedRightShift()
581 return MutableBigInt::RightShiftByAbsolute(isolate, x, y); in SignedRightShift()
636 Handle<MutableBigInt> result; in BitwiseAnd()
640 result = MutableBigInt::New(isolate, result_length).ToHandleChecked(); in BitwiseAnd()
646 if (!MutableBigInt::New(isolate, result_length).ToHandle(&result)) { in BitwiseAnd()
654 result = MutableBigInt::New(isolate, result_length).ToHandleChecked(); in BitwiseAnd()
658 return MutableBigInt::MakeImmutable(result); in BitwiseAnd()
665 Handle<MutableBigInt> result; in BitwiseXor()
669 result = MutableBigInt::New(isolate, result_length).ToHandleChecked(); in BitwiseXor()
675 result = MutableBigInt::New(isolate, result_length).ToHandleChecked(); in BitwiseXor()
682 if (!MutableBigInt::New(isolate, result_length).ToHandle(&result)) { in BitwiseXor()
688 return MutableBigInt::MakeImmutable(result); in BitwiseXor()
696 Handle<MutableBigInt> result = in BitwiseOr()
697 MutableBigInt::New(isolate, result_length).ToHandleChecked(); in BitwiseOr()
709 return MutableBigInt::MakeImmutable(result); in BitwiseOr()
714 Handle<MutableBigInt> result = MutableBigInt::AbsoluteSubOne(isolate, x); in Increment()
716 return MutableBigInt::MakeImmutable(result); in Increment()
718 return MutableBigInt::MakeImmutable( in Increment()
719 MutableBigInt::AbsoluteAddOne(isolate, x, false)); in Increment()
724 MaybeHandle<MutableBigInt> result; in Decrement()
726 result = MutableBigInt::AbsoluteAddOne(isolate, x, true); in Decrement()
729 return MutableBigInt::NewFromInt(isolate, -1); in Decrement()
731 result = MutableBigInt::AbsoluteSubOne(isolate, x); in Decrement()
733 return MutableBigInt::MakeImmutable(result); in Decrement()
1022 return MutableBigInt::NewFromInt(isolate, Smi::ToInt(*number)); in FromNumber()
1030 return MutableBigInt::NewFromDouble(isolate, value); in FromNumber()
1043 return MutableBigInt::NewFromInt(isolate, obj->BooleanValue(isolate)); in FromObject()
1084 double result = MutableBigInt::ToDouble(x); in ToNumber()
1088 double MutableBigInt::ToDouble(Handle<BigIntBase> x) { in ToDouble()
1145 MutableBigInt::Rounding MutableBigInt::DecideRounding(Handle<BigIntBase> x, in DecideRounding()
1195 MaybeHandle<MutableBigInt> MutableBigInt::AbsoluteAddOne( in AbsoluteAddOne()
1197 MutableBigInt result_storage) { in AbsoluteAddOne()
1209 Handle<MutableBigInt> result(result_storage, isolate); in AbsoluteAddOne()
1212 return MaybeHandle<MutableBigInt>(); in AbsoluteAddOne()
1229 Handle<MutableBigInt> MutableBigInt::AbsoluteSubOne(Isolate* isolate, in AbsoluteSubOne()
1233 Handle<MutableBigInt> result = New(isolate, length).ToHandleChecked(); in AbsoluteSubOne()
1242 MaybeHandle<BigInt> MutableBigInt::LeftShiftByAbsolute(Isolate* isolate, in LeftShiftByAbsolute()
1255 Handle<MutableBigInt> result; in LeftShiftByAbsolute()
1264 Handle<BigInt> MutableBigInt::RightShiftByAbsolute(Isolate* isolate, in RightShiftByAbsolute()
1280 Handle<MutableBigInt> result = New(isolate, result_length).ToHandleChecked(); in RightShiftByAbsolute()
1286 Handle<BigInt> MutableBigInt::RightShiftByMaximum(Isolate* isolate, bool sign) { in RightShiftByMaximum()
1297 Maybe<BigInt::digit_t> MutableBigInt::ToShiftAmount(Handle<BigIntBase> x) { in ToShiftAmount()
1315 Handle<MutableBigInt> result = in Allocate()
1316 MutableBigInt::New(isolate, digits, allocation).ToHandleChecked(); in Allocate()
1324 return MutableBigInt::MakeImmutable(result); in Allocate()
1376 Handle<MutableBigInt> result = in FromSerializedDigits()
1377 MutableBigInt::Cast(isolate->factory()->NewBigInt(length)); in FromSerializedDigits()
1408 return MutableBigInt::MakeImmutable(result); in FromSerializedDigits()
1413 if (n == 0) return MutableBigInt::Zero(isolate); in AsIntN()
1417 Handle<MutableBigInt> result = in AsIntN()
1418 MutableBigInt::New(isolate, needed_length).ToHandleChecked(); in AsIntN()
1422 return MutableBigInt::MakeImmutable(result); in AsIntN()
1428 if (n == 0) return MutableBigInt::Zero(isolate); in AsUintN()
1429 Handle<MutableBigInt> result; in AsUintN()
1435 result = MutableBigInt::New(isolate, result_length).ToHandleChecked(); in AsUintN()
1442 result = MutableBigInt::New(isolate, result_length).ToHandleChecked(); in AsUintN()
1446 return MutableBigInt::MakeImmutable(result); in AsUintN()
1450 if (n == 0) return MutableBigInt::Zero(isolate); in FromInt64()
1453 Handle<MutableBigInt> result = in FromInt64()
1454 MutableBigInt::Cast(isolate->factory()->NewBigInt(length)); in FromInt64()
1468 return MutableBigInt::MakeImmutable(result); in FromInt64()
1472 if (n == 0) return MutableBigInt::Zero(isolate); in FromUint64()
1475 Handle<MutableBigInt> result = in FromUint64()
1476 MutableBigInt::Cast(isolate->factory()->NewBigInt(length)); in FromUint64()
1479 return MutableBigInt::MakeImmutable(result); in FromUint64()
1488 if (words64_count == 0) return MutableBigInt::Zero(isolate); in FromWords64()
1494 Handle<MutableBigInt> result; in FromWords64()
1495 if (!MutableBigInt::New(isolate, length).ToHandle(&result)) { in FromWords64()
1513 return MutableBigInt::MakeImmutable(result); in FromWords64()
1545 uint64_t MutableBigInt::GetRawBits(BigIntBase x, bool* lossless) { in GetRawBits()
1560 uint64_t raw = MutableBigInt::GetRawBits(*this, lossless); in AsInt64()
1567 uint64_t result = MutableBigInt::GetRawBits(*this, lossless); in AsUint64()
1572 void MutableBigInt::set_64_bits(uint64_t bits) { in set_64_bits()
1603 MutableBigInt result = MutableBigInt::cast(Object(result_addr)); in MutableBigInt_AbsoluteAddAndCanonicalize()
1606 MutableBigInt::Canonicalize(result); in MutableBigInt_AbsoluteAddAndCanonicalize()
1620 MutableBigInt result = MutableBigInt::cast(Object(result_addr)); in MutableBigInt_AbsoluteSubAndCanonicalize()
1623 MutableBigInt::Canonicalize(result); in MutableBigInt_AbsoluteSubAndCanonicalize()