Index: src/stub-cache.cc |
diff --git a/src/stub-cache.cc b/src/stub-cache.cc |
index 19cfd5a1a83c7133c3fa8698b325112c0a81a3c9..c7c6bc3543d33070e2490f550e0321153dfe5320 100644 |
--- a/src/stub-cache.cc |
+++ b/src/stub-cache.cc |
@@ -315,6 +315,24 @@ Handle<Code> StubCache::ComputeLoadCallback( |
} |
+Handle<Code> StubCache::ComputeLoadCallback( |
+ Handle<Name> name, |
+ Handle<JSObject> receiver, |
+ Handle<JSObject> holder, |
+ const CallOptimization& call_optimization) { |
+ Handle<JSObject> stub_holder = StubHolder(receiver, holder); |
+ Handle<Code> stub = FindLoadHandler( |
+ name, receiver, stub_holder, Code::LOAD_IC, Code::CALLBACKS); |
+ if (!stub.is_null()) return stub; |
+ |
+ LoadStubCompiler compiler(isolate_); |
+ Handle<Code> handler = |
+ compiler.CompileLoadCallback(receiver, holder, name, call_optimization); |
+ JSObject::UpdateMapCodeCache(stub_holder, name, handler); |
+ return handler; |
+} |
+ |
+ |
Handle<Code> StubCache::ComputeLoadViaGetter(Handle<Name> name, |
Handle<JSObject> receiver, |
Handle<JSObject> holder, |
@@ -465,6 +483,24 @@ Handle<Code> StubCache::ComputeKeyedLoadCallback( |
} |
+Handle<Code> StubCache::ComputeKeyedLoadCallback( |
+ Handle<Name> name, |
+ Handle<JSObject> receiver, |
+ Handle<JSObject> holder, |
+ const CallOptimization& call_optimization) { |
+ Handle<JSObject> stub_holder = StubHolder(receiver, holder); |
+ Handle<Code> stub = FindLoadHandler( |
+ name, receiver, stub_holder, Code::KEYED_LOAD_IC, Code::CALLBACKS); |
+ if (!stub.is_null()) return stub; |
+ |
+ KeyedLoadStubCompiler compiler(isolate_); |
+ Handle<Code> handler = |
+ compiler.CompileLoadCallback(receiver, holder, name, call_optimization); |
+ JSObject::UpdateMapCodeCache(stub_holder, name, handler); |
+ return handler; |
+} |
+ |
+ |
Handle<Code> StubCache::ComputeStoreField(Handle<Name> name, |
Handle<JSObject> receiver, |
LookupResult* lookup, |
@@ -1648,6 +1684,25 @@ Handle<Code> BaseLoadStubCompiler::CompileLoadCallback( |
} |
+Handle<Code> BaseLoadStubCompiler::CompileLoadCallback( |
+ Handle<JSObject> object, |
+ Handle<JSObject> holder, |
+ Handle<Name> name, |
+ const CallOptimization& call_optimization) { |
+ ASSERT(call_optimization.is_simple_api_call()); |
+ Label success; |
+ |
+ Handle<JSFunction> callback = call_optimization.constant_function(); |
+ CallbackHandlerFrontend( |
+ object, receiver(), holder, name, &success, callback); |
+ __ bind(&success); |
+ GenerateLoadCallback(call_optimization); |
+ |
+ // Return the generated code. |
+ return GetCode(kind(), Code::CALLBACKS, name); |
+} |
+ |
+ |
Handle<Code> BaseLoadStubCompiler::CompileLoadInterceptor( |
Handle<JSObject> object, |
Handle<JSObject> holder, |