| Index: src/mips/builtins-mips.cc
|
| diff --git a/src/mips/builtins-mips.cc b/src/mips/builtins-mips.cc
|
| index 530e8116166a17954bb5b47078a4d722036f467a..e38401168657d038509aac5adbe4655ebfdd4bf1 100644
|
| --- a/src/mips/builtins-mips.cc
|
| +++ b/src/mips/builtins-mips.cc
|
| @@ -1273,13 +1273,28 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
|
| SharedFunctionInfo::kOffsetToPreviousOsrAstId));
|
| const int bailout_id = BailoutId::None().ToInt();
|
| __ Branch(&loop_bottom, ne, temp, Operand(Smi::FromInt(bailout_id)));
|
| +
|
| // Literals available?
|
| + Label got_literals, maybe_cleared_weakcell;
|
| __ lw(temp, FieldMemOperand(array_pointer,
|
| SharedFunctionInfo::kOffsetToPreviousLiterals));
|
| + // temp contains either a WeakCell pointing to the literals array or the
|
| + // literals array directly.
|
| + STATIC_ASSERT(WeakCell::kValueOffset == FixedArray::kLengthOffset);
|
| + __ lw(t0, FieldMemOperand(temp, WeakCell::kValueOffset));
|
| + __ JumpIfSmi(t0, &maybe_cleared_weakcell);
|
| + // t0 is a pointer, therefore temp is a WeakCell pointing to a literals array.
|
| __ lw(temp, FieldMemOperand(temp, WeakCell::kValueOffset));
|
| - __ JumpIfSmi(temp, &gotta_call_runtime);
|
| + __ jmp(&got_literals);
|
| +
|
| + // t0 is a smi. If it's 0, then we are looking at a cleared WeakCell
|
| + // around the literals array, and we should visit the runtime. If it's > 0,
|
| + // then temp already contains the literals array.
|
| + __ bind(&maybe_cleared_weakcell);
|
| + __ Branch(&gotta_call_runtime, eq, t0, Operand(Smi::FromInt(0)));
|
|
|
| // Save the literals in the closure.
|
| + __ bind(&got_literals);
|
| __ lw(t0, MemOperand(sp, 0));
|
| __ sw(temp, FieldMemOperand(t0, JSFunction::kLiteralsOffset));
|
| __ push(index);
|
|
|