Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(788)

Unified Diff: runtime/vm/bigint_operations.cc

Issue 23537003: - Allow the collection of intermediate values during long BigintOperations. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/bigint_operations.cc
===================================================================
--- runtime/vm/bigint_operations.cc (revision 26762)
+++ runtime/vm/bigint_operations.cc (working copy)
@@ -329,10 +329,10 @@
(kIntptrMax - 10) / kLog2Dividend / kDigitBitSize * kLog2Divisor;
intptr_t length = bigint.Length();
+ Isolate* isolate = Isolate::Current();
if (length >= kMaxAllowedDigitLength) {
// Use the preallocated out of memory exception to avoid calling
// into dart code or allocating any code.
- Isolate* isolate = Isolate::Current();
const Instance& exception =
Instance::Handle(isolate->object_store()->out_of_memory());
Exceptions::Throw(exception);
@@ -370,6 +370,7 @@
Bigint& quotient = Bigint::Handle();
Bigint& remainder = Bigint::Handle();
while (!rest.IsZero()) {
+ HANDLESCOPE(isolate);
DivideRemainder(rest, divisor, &quotient, &remainder);
ASSERT(remainder.Length() <= 1);
intptr_t part = (remainder.Length() == 1)
@@ -1537,7 +1538,9 @@
Bigint& shifted_divisor =
Bigint::Handle(DigitsShiftLeft(divisor, divisor_shift_amount));
Chunk first_quotient_digit = 0;
+ Isolate* isolate = Isolate::Current();
while (UnsignedCompare(dividend, shifted_divisor) >= 0) {
+ HANDLESCOPE(isolate);
first_quotient_digit++;
dividend = Subtract(dividend, shifted_divisor);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698