Index: src/stub-cache.h |
diff --git a/src/stub-cache.h b/src/stub-cache.h |
index 25009b9a66b4e670c2f7809223d343e2e2cf3b61..a267100df58b9460f646e9f9176082518e9bb0f2 100644 |
--- a/src/stub-cache.h |
+++ b/src/stub-cache.h |
@@ -48,6 +48,8 @@ namespace internal { |
// invalidate the cache whenever a prototype map is changed. The stub |
// validates the map chain as in the mono-morphic case. |
+ |
+class CallOptimization; |
class SmallMapList; |
class StubCache; |
@@ -136,6 +138,11 @@ class StubCache { |
Handle<JSObject> holder, |
Handle<ExecutableAccessorInfo> callback); |
+ Handle<Code> ComputeLoadCallback(Handle<Name> name, |
+ Handle<JSObject> object, |
+ Handle<JSObject> holder, |
+ const CallOptimization& call_optimization); |
+ |
Handle<Code> ComputeLoadViaGetter(Handle<Name> name, |
Handle<JSObject> object, |
Handle<JSObject> holder, |
@@ -173,6 +180,12 @@ class StubCache { |
Handle<JSObject> holder, |
Handle<ExecutableAccessorInfo> callback); |
+ Handle<Code> ComputeKeyedLoadCallback( |
+ Handle<Name> name, |
+ Handle<JSObject> object, |
+ Handle<JSObject> holder, |
+ const CallOptimization& call_optimization); |
+ |
Handle<Code> ComputeKeyedLoadConstant(Handle<Name> name, |
Handle<JSObject> object, |
Handle<JSObject> holder, |
@@ -705,6 +718,11 @@ class BaseLoadStubCompiler: public BaseLoadStoreStubCompiler { |
Handle<Name> name, |
Handle<ExecutableAccessorInfo> callback); |
+ Handle<Code> CompileLoadCallback(Handle<JSObject> object, |
+ Handle<JSObject> holder, |
+ Handle<Name> name, |
+ const CallOptimization& call_optimization); |
+ |
Handle<Code> CompileLoadConstant(Handle<JSObject> object, |
Handle<JSObject> holder, |
Handle<Name> name, |
@@ -730,7 +748,7 @@ class BaseLoadStubCompiler: public BaseLoadStoreStubCompiler { |
Handle<JSObject> holder, |
Handle<Name> name, |
Label* success, |
- Handle<ExecutableAccessorInfo> callback); |
+ Handle<Object> callback); |
void NonexistentHandlerFrontend(Handle<JSObject> object, |
Handle<JSObject> last, |
Handle<Name> name, |
@@ -744,6 +762,7 @@ class BaseLoadStubCompiler: public BaseLoadStoreStubCompiler { |
void GenerateLoadConstant(Handle<Object> value); |
void GenerateLoadCallback(Register reg, |
Handle<ExecutableAccessorInfo> callback); |
+ void GenerateLoadCallback(const CallOptimization& call_optimization); |
void GenerateLoadInterceptor(Register holder_reg, |
Handle<JSObject> object, |
Handle<JSObject> holder, |
@@ -1028,8 +1047,6 @@ class KeyedStoreStubCompiler: public BaseStoreStubCompiler { |
V(ArrayCode) |
-class CallOptimization; |
- |
class CallStubCompiler: public StubCompiler { |
public: |
CallStubCompiler(Isolate* isolate, |
@@ -1161,6 +1178,12 @@ class CallOptimization BASE_EMBEDDED { |
int GetPrototypeDepthOfExpectedType(Handle<JSObject> object, |
Handle<JSObject> holder) const; |
+ bool IsCompatibleReceiver(Object* receiver) { |
+ ASSERT(is_simple_api_call()); |
+ if (expected_receiver_type_.is_null()) return true; |
+ return receiver->IsInstanceOf(*expected_receiver_type_); |
+ } |
+ |
private: |
void Initialize(Handle<JSFunction> function); |