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

Unified Diff: src/ic.h

Issue 12036017: Merge Store from Keyed and Named store. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 11 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 | « no previous file | src/ic.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic.h
diff --git a/src/ic.h b/src/ic.h
index c95f2e3c8dc314684378d3fcded1058ff1edcc06..784512a1c49f8b2f421495dc93cee5d1a1fafadb 100644
--- a/src/ic.h
+++ b/src/ic.h
@@ -136,6 +136,15 @@ class IC {
Handle<Object> object,
Handle<String> name);
+ MUST_USE_RESULT MaybeObject* Store(
+ State state,
+ StrictModeFlag strict_mode,
+ Handle<Object> object,
+ Handle<String> name,
+ Handle<Object> value,
+ JSReceiver::StoreFromKeyed store_mode =
+ JSReceiver::CERTAINLY_NOT_STORE_FROM_KEYED);
+
protected:
virtual Handle<Code> pre_monomorphic_stub() {
UNREACHABLE();
@@ -145,6 +154,10 @@ class IC {
UNREACHABLE();
return Handle<Code>::null();
}
+ virtual Handle<Code> megamorphic_stub_strict() {
+ UNREACHABLE();
+ return Handle<Code>::null();
+ }
virtual Handle<Code> generic_stub() const {
UNREACHABLE();
return Handle<Code>::null();
@@ -153,12 +166,29 @@ class IC {
UNREACHABLE();
return Code::STUB;
}
+ virtual Handle<Code> global_proxy_stub() {
+ UNREACHABLE();
+ return Handle<Code>::null();
+ }
+ virtual Handle<Code> global_proxy_stub_strict() {
+ UNREACHABLE();
+ return Handle<Code>::null();
+ }
+
virtual void UpdateLoadCaches(LookupResult* lookup,
State state,
Handle<Object> object,
Handle<String> name) {
UNREACHABLE();
}
+ virtual void UpdateStoreCaches(LookupResult* lookup,
+ State state,
+ StrictModeFlag strict_mode,
+ Handle<JSObject> receiver,
+ Handle<String> name,
+ Handle<Object> value) {
+ UNREACHABLE();
+ }
Address fp() const { return fp_; }
Address pc() const { return *pc_address_; }
Isolate* isolate() const { return isolate_; }
@@ -378,9 +408,8 @@ class LoadIC: public IC {
private:
// Stub accessors.
- static Code* initialize_stub() {
- return Isolate::Current()->builtins()->builtin(
- Builtins::kLoadIC_Initialize);
+ static Handle<Code> initialize_stub() {
+ return Isolate::Current()->builtins()->LoadIC_Initialize();
}
virtual Handle<Code> pre_monomorphic_stub() {
return isolate()->builtins()->LoadIC_PreMonomorphic();
@@ -565,9 +594,8 @@ class KeyedLoadIC: public KeyedIC {
private:
// Stub accessors.
- static Code* initialize_stub() {
- return Isolate::Current()->builtins()->builtin(
- Builtins::kKeyedLoadIC_Initialize);
+ static Handle<Code> initialize_stub() {
+ return Isolate::Current()->builtins()->KeyedLoadIC_Initialize();
}
virtual Handle<Code> pre_monomorphic_stub() {
return isolate()->builtins()->KeyedLoadIC_PreMonomorphic();
@@ -591,12 +619,6 @@ class StoreIC: public IC {
ASSERT(target()->is_store_stub());
}
- MUST_USE_RESULT MaybeObject* Store(State state,
- StrictModeFlag strict_mode,
- Handle<Object> object,
- Handle<String> name,
- Handle<Object> value);
-
// Code generators for stub routines. Only called once at startup.
static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); }
static void GenerateMiss(MacroAssembler* masm);
@@ -612,17 +634,28 @@ class StoreIC: public IC {
virtual Handle<Code> megamorphic_stub() {
return isolate()->builtins()->StoreIC_Megamorphic();
}
+ // Stub accessors.
+ virtual Handle<Code> megamorphic_stub_strict() {
+ return isolate()->builtins()->StoreIC_Megamorphic_Strict();
+ }
+ virtual Handle<Code> global_proxy_stub() {
+ return isolate()->builtins()->StoreIC_GlobalProxy();
+ }
+ virtual Handle<Code> global_proxy_stub_strict() {
+ return isolate()->builtins()->StoreIC_GlobalProxy_Strict();
+ }
+
- private:
// Update the inline cache and the global stub cache based on the
// lookup result.
- void UpdateCaches(LookupResult* lookup,
- State state,
- StrictModeFlag strict_mode,
- Handle<JSObject> receiver,
- Handle<String> name,
- Handle<Object> value);
+ virtual void UpdateStoreCaches(LookupResult* lookup,
+ State state,
+ StrictModeFlag strict_mode,
+ Handle<JSObject> receiver,
+ Handle<String> name,
+ Handle<Object> value);
+ private:
void set_target(Code* code) {
// Strict mode must be preserved across IC patching.
ASSERT(Code::GetStrictMode(code->extra_ic_state()) ==
@@ -630,26 +663,12 @@ class StoreIC: public IC {
IC::set_target(code);
}
- // Stub accessors.
- Code* megamorphic_stub_strict() {
- return isolate()->builtins()->builtin(
- Builtins::kStoreIC_Megamorphic_Strict);
- }
- static Code* initialize_stub() {
- return Isolate::Current()->builtins()->builtin(
- Builtins::kStoreIC_Initialize);
+ static Handle<Code> initialize_stub() {
+ return Isolate::Current()->builtins()->StoreIC_Initialize();
}
- static Code* initialize_stub_strict() {
- return Isolate::Current()->builtins()->builtin(
- Builtins::kStoreIC_Initialize_Strict);
+ static Handle<Code> initialize_stub_strict() {
+ return Isolate::Current()->builtins()->StoreIC_Initialize_Strict();
}
- Handle<Code> global_proxy_stub() {
- return isolate()->builtins()->StoreIC_GlobalProxy();
- }
- Handle<Code> global_proxy_stub_strict() {
- return isolate()->builtins()->StoreIC_GlobalProxy_Strict();
- }
-
static void Clear(Address address, Code* target);
friend class IC;
@@ -706,15 +725,22 @@ class KeyedStoreIC: public KeyedIC {
StrictModeFlag strict_mode,
KeyedAccessGrowMode grow_mode);
- private:
// Update the inline cache.
- void UpdateCaches(LookupResult* lookup,
- State state,
- StrictModeFlag strict_mode,
- Handle<JSObject> receiver,
- Handle<String> name,
- Handle<Object> value);
+ virtual void UpdateStoreCaches(LookupResult* lookup,
+ State state,
+ StrictModeFlag strict_mode,
+ Handle<JSObject> receiver,
+ Handle<String> name,
+ Handle<Object> value);
+
+ virtual Handle<Code> megamorphic_stub() {
+ return isolate()->builtins()->KeyedStoreIC_Generic();
+ }
+ virtual Handle<Code> megamorphic_stub_strict() {
+ return isolate()->builtins()->KeyedStoreIC_Generic_Strict();
+ }
+ private:
void set_target(Code* code) {
// Strict mode must be preserved across IC patching.
ASSERT(Code::GetStrictMode(code->extra_ic_state()) ==
@@ -723,19 +749,11 @@ class KeyedStoreIC: public KeyedIC {
}
// Stub accessors.
- static Code* initialize_stub() {
- return Isolate::Current()->builtins()->builtin(
- Builtins::kKeyedStoreIC_Initialize);
- }
- static Code* initialize_stub_strict() {
- return Isolate::Current()->builtins()->builtin(
- Builtins::kKeyedStoreIC_Initialize_Strict);
+ static Handle<Code> initialize_stub() {
+ return Isolate::Current()->builtins()->KeyedStoreIC_Initialize();
}
- Handle<Code> megamorphic_stub() {
- return isolate()->builtins()->KeyedStoreIC_Generic();
- }
- Handle<Code> megamorphic_stub_strict() {
- return isolate()->builtins()->KeyedStoreIC_Generic_Strict();
+ static Handle<Code> initialize_stub_strict() {
+ return Isolate::Current()->builtins()->KeyedStoreIC_Initialize_Strict();
}
Handle<Code> generic_stub() const {
return isolate()->builtins()->KeyedStoreIC_Generic();
« no previous file with comments | « no previous file | src/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698