Index: src/ic/arm64/handler-compiler-arm64.cc |
diff --git a/src/ic/arm64/handler-compiler-arm64.cc b/src/ic/arm64/handler-compiler-arm64.cc |
index 3a6d156943aa8f4e1f23224ffccd2ca81608aa01..88a5f2229b2f5d200a5b4cfb95d550ea893f1f36 100644 |
--- a/src/ic/arm64/handler-compiler-arm64.cc |
+++ b/src/ic/arm64/handler-compiler-arm64.cc |
@@ -626,12 +626,15 @@ void NamedLoadHandlerCompiler::GenerateLoadCallback( |
__ Push(receiver()); |
- if (heap()->InNewSpace(callback->data())) { |
- __ Mov(scratch3(), Operand(callback)); |
- __ Ldr(scratch3(), |
- FieldMemOperand(scratch3(), ExecutableAccessorInfo::kDataOffset)); |
+ Handle<Object> data(callback->data(), isolate()); |
+ if (data->IsUndefined() || data->IsSmi()) { |
+ __ Mov(scratch3(), Operand(data)); |
} else { |
- __ Mov(scratch3(), Operand(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); |
} |
__ LoadRoot(scratch4(), Heap::kUndefinedValueRootIndex); |
__ Mov(scratch2(), Operand(ExternalReference::isolate_address(isolate()))); |