| Index: src/ic/mips64/handler-compiler-mips64.cc
|
| diff --git a/src/ic/mips64/handler-compiler-mips64.cc b/src/ic/mips64/handler-compiler-mips64.cc
|
| index 65f0902377453d2396b05ba8713eb917072e170a..a64b9440f59f40011266ad4c12d09b40f9fcaa0e 100644
|
| --- a/src/ic/mips64/handler-compiler-mips64.cc
|
| +++ b/src/ic/mips64/handler-compiler-mips64.cc
|
| @@ -560,12 +560,15 @@ void NamedLoadHandlerCompiler::GenerateLoadCallback(
|
| DCHECK(!scratch3().is(reg));
|
| DCHECK(!scratch4().is(reg));
|
| __ push(receiver());
|
| - if (heap()->InNewSpace(callback->data())) {
|
| - __ li(scratch3(), callback);
|
| - __ ld(scratch3(),
|
| - FieldMemOperand(scratch3(), ExecutableAccessorInfo::kDataOffset));
|
| + Handle<Object> data(callback->data(), isolate());
|
| + if (data->IsUndefined() || data->IsSmi()) {
|
| + __ li(scratch3(), data);
|
| } else {
|
| - __ li(scratch3(), Handle<Object>(callback->data(), isolate()));
|
| + Handle<WeakCell> cell =
|
| + isolate()->factory()->NewWeakCell(Handle<HeapObject>::cast(data));
|
| + // The callback is alive if this instruction is executed,
|
| + // so the weak cell is not cleared and points to data.
|
| + __ GetWeakValue(scratch3(), cell);
|
| }
|
| __ Dsubu(sp, sp, 6 * kPointerSize);
|
| __ sd(scratch3(), MemOperand(sp, 5 * kPointerSize));
|
|
|