| Index: runtime/vm/stub_code_mips.cc
|
| ===================================================================
|
| --- runtime/vm/stub_code_mips.cc (revision 36136)
|
| +++ runtime/vm/stub_code_mips.cc (working copy)
|
| @@ -700,6 +700,12 @@
|
| } else {
|
| __ bne(CMPRES1, ZR, &slow_case);
|
| }
|
| + __ bltz(A1, &slow_case);
|
| + // Check for maximum allowed length.
|
| + const intptr_t max_len =
|
| + reinterpret_cast<int32_t>(Smi::New(Array::kMaxElements));
|
| + __ BranchUnsignedGreater(A1, max_len, &slow_case);
|
| +
|
| __ lw(T0, FieldAddress(CTX, Context::isolate_offset()));
|
| __ lw(T0, Address(T0, Isolate::heap_offset()));
|
| __ lw(T0, Address(T0, Heap::new_space_offset()));
|
| @@ -717,8 +723,10 @@
|
| ASSERT(kSmiTagShift == 1);
|
| __ LoadImmediate(TMP, ~(kObjectAlignment - 1));
|
| __ and_(T3, T3, TMP);
|
| - __ addu(T2, T3, V0);
|
|
|
| + __ AdduDetectOverflow(T2, T3, V0, CMPRES1);
|
| + __ bltz(CMPRES1, &slow_case); // CMPRES1 < 0 on overflow.
|
| +
|
| // Check if the allocation fits into the remaining space.
|
| // V0: potential new object start.
|
| // A0: array element type.
|
|
|