Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Unified Diff: src/ic/ic.cc

Issue 926293004: Embed store callback in handler via weak cell. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: typo Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ic/ia32/handler-compiler-ia32.cc ('k') | src/ic/mips/handler-compiler-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/ic.cc
diff --git a/src/ic/ic.cc b/src/ic/ic.cc
index 620f5724d22faf2a0f81546bce9f825c1b00ebff..93f33cf663f0b7ecee75a53f816f056dd307e987 100644
--- a/src/ic/ic.cc
+++ b/src/ic/ic.cc
@@ -1690,8 +1690,7 @@ Handle<Code> StoreIC::CompileHandler(LookupIterator* lookup,
break;
}
NamedStoreHandlerCompiler compiler(isolate(), receiver_map(), holder);
- return compiler.CompileStoreCallback(receiver, lookup->name(),
- lookup->GetAccessorIndex());
+ return compiler.CompileStoreCallback(receiver, lookup->name(), info);
} else if (accessors->IsAccessorPair()) {
Handle<Object> setter(Handle<AccessorPair>::cast(accessors)->setter(),
isolate());
@@ -2763,14 +2762,16 @@ RUNTIME_FUNCTION(ToBooleanIC_Miss) {
RUNTIME_FUNCTION(StoreCallbackProperty) {
Handle<JSObject> receiver = args.at<JSObject>(0);
Handle<JSObject> holder = args.at<JSObject>(1);
- Handle<Smi> accessor_index = args.at<Smi>(2);
+ Handle<HeapObject> callback_or_cell = args.at<HeapObject>(2);
Handle<Name> name = args.at<Name>(3);
Handle<Object> value = args.at<Object>(4);
HandleScope scope(isolate);
- Handle<ExecutableAccessorInfo> callback(ExecutableAccessorInfo::cast(
- holder->map()->instance_descriptors()->GetCallbacksObject(
- accessor_index->value())));
+ Handle<ExecutableAccessorInfo> callback(
+ callback_or_cell->IsWeakCell()
+ ? ExecutableAccessorInfo::cast(
+ WeakCell::cast(*callback_or_cell)->value())
+ : ExecutableAccessorInfo::cast(*callback_or_cell));
DCHECK(callback->IsCompatibleReceiver(*receiver));
« no previous file with comments | « src/ic/ia32/handler-compiler-ia32.cc ('k') | src/ic/mips/handler-compiler-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698