Index: src/ic/x87/handler-compiler-x87.cc |
diff --git a/src/ic/x87/handler-compiler-x87.cc b/src/ic/x87/handler-compiler-x87.cc |
index 105e49af4ae61df119583f1a170baa9ae5377989..00eb077e43b0976a5c8448e732fd99ad373d4911 100644 |
--- a/src/ic/x87/handler-compiler-x87.cc |
+++ b/src/ic/x87/handler-compiler-x87.cc |
@@ -687,13 +687,21 @@ void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) { |
Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( |
- Handle<JSObject> object, Handle<Name> name, int accessor_index) { |
+ Handle<JSObject> object, Handle<Name> name, |
+ Handle<ExecutableAccessorInfo> callback) { |
Register holder_reg = Frontend(name); |
__ pop(scratch1()); // remove the return address |
__ push(receiver()); |
__ push(holder_reg); |
- __ Push(Smi::FromInt(accessor_index)); |
+ // If the callback cannot leak, then push the callback directly, |
+ // otherwise wrap it in a weak cell. |
+ if (callback->data()->IsUndefined() || callback->data()->IsSmi()) { |
+ __ Push(callback); |
+ } else { |
+ Handle<WeakCell> cell = isolate()->factory()->NewWeakCell(callback); |
+ __ Push(cell); |
+ } |
__ Push(name); |
__ push(value()); |
__ push(scratch1()); // restore return address |