Commit 2d566c71 authored by verwaest@chromium.org's avatar verwaest@chromium.org

Merge UpdateStoreCaches into a single function dispatching on...

Merge UpdateStoreCaches into a single function dispatching on ComputeStoreMonorphic and UpdateMegamorphicCache.

Review URL: https://chromiumcodereview.appspot.com/12057003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13503 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent a7e88a34
This diff is collapsed.
...@@ -165,6 +165,21 @@ class IC { ...@@ -165,6 +165,21 @@ class IC {
static inline void SetTargetAtAddress(Address address, Code* target); static inline void SetTargetAtAddress(Address address, Code* target);
static void PostPatching(Address address, Code* target, Code* old_target); static void PostPatching(Address address, Code* target, Code* old_target);
void PatchCache(State state,
StrictModeFlag strict_mode,
Handle<JSObject> receiver,
Handle<String> name,
Handle<Code> code);
virtual void UpdateMegamorphicCache(Map* map, String* name, Code* code);
virtual Handle<Code> megamorphic_stub() {
UNREACHABLE();
return Handle<Code>::null();
}
virtual Handle<Code> megamorphic_stub_strict() {
UNREACHABLE();
return Handle<Code>::null();
}
private: private:
// Frame pointer for the frame that uses (calls) the IC. // Frame pointer for the frame that uses (calls) the IC.
Address fp_; Address fp_;
...@@ -361,7 +376,6 @@ class LoadIC: public IC { ...@@ -361,7 +376,6 @@ class LoadIC: public IC {
virtual Handle<Code> ComputeLoadMonomorphic(LookupResult* lookup, virtual Handle<Code> ComputeLoadMonomorphic(LookupResult* lookup,
Handle<JSObject> receiver, Handle<JSObject> receiver,
Handle<String> name); Handle<String> name);
virtual void UpdateMegamorphicCache(Map* map, String* name, Code* code);
private: private:
// Stub accessors. // Stub accessors.
...@@ -502,12 +516,19 @@ class StoreIC: public IC { ...@@ -502,12 +516,19 @@ class StoreIC: public IC {
// Update the inline cache and the global stub cache based on the // Update the inline cache and the global stub cache based on the
// lookup result. // lookup result.
virtual void UpdateStoreCaches(LookupResult* lookup, void UpdateCaches(LookupResult* lookup,
State state, State state,
StrictModeFlag strict_mode, StrictModeFlag strict_mode,
Handle<JSObject> receiver, Handle<JSObject> receiver,
Handle<String> name, Handle<String> name,
Handle<Object> value); Handle<Object> value);
// Compute the code stub for this store; used for rewriting to
// monomorphic state and making sure that the code stub is in the
// stub cache.
virtual Handle<Code> ComputeStoreMonomorphic(LookupResult* lookup,
StrictModeFlag strict_mode,
Handle<JSObject> receiver,
Handle<String> name);
private: private:
void set_target(Code* code) { void set_target(Code* code) {
...@@ -607,13 +628,11 @@ class KeyedStoreIC: public StoreIC { ...@@ -607,13 +628,11 @@ class KeyedStoreIC: public StoreIC {
protected: protected:
virtual Code::Kind kind() const { return Code::KEYED_STORE_IC; } virtual Code::Kind kind() const { return Code::KEYED_STORE_IC; }
// Update the inline cache. virtual Handle<Code> ComputeStoreMonomorphic(LookupResult* lookup,
virtual void UpdateStoreCaches(LookupResult* lookup, StrictModeFlag strict_mode,
State state, Handle<JSObject> receiver,
StrictModeFlag strict_mode, Handle<String> name);
Handle<JSObject> receiver, virtual void UpdateMegamorphicCache(Map* map, String* name, Code* code) { }
Handle<String> name,
Handle<Object> value);
virtual Handle<Code> megamorphic_stub() { virtual Handle<Code> megamorphic_stub() {
return isolate()->builtins()->KeyedStoreIC_Generic(); return isolate()->builtins()->KeyedStoreIC_Generic();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment