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

Unified Diff: src/ic.h

Issue 11973008: Replace special IC builtins and stubs in the map's cache by codestubs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments 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 | « src/ia32/stub-cache-ia32.cc ('k') | 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 0cc6aa461354612ae774a6960537f5e9af465c04..a0c0f381e25f2d72a6fa677f75fde9af5a6f5cbd 100644
--- a/src/ic.h
+++ b/src/ic.h
@@ -133,6 +133,18 @@ class IC {
InlineCacheHolderFlag holder);
protected:
+ virtual Handle<Code> pre_monomorphic_stub() {
+ UNREACHABLE();
+ return Handle<Code>::null();
+ }
+ virtual Handle<Code> megamorphic_stub() {
+ UNREACHABLE();
+ return Handle<Code>::null();
+ }
+ virtual Code::Kind kind() const {
+ UNREACHABLE();
+ return Code::STUB;
+ }
Address fp() const { return fp_; }
Address pc() const { return *pc_address_; }
Isolate* isolate() const { return isolate_; }
@@ -165,6 +177,11 @@ class IC {
static inline void SetTargetAtAddress(Address address, Code* target);
static void PostPatching(Address address, Code* target, Code* old_target);
+ bool HandleLoad(State state,
+ Handle<Object> object,
+ Handle<String> name,
+ MaybeObject** result);
+
private:
// Frame pointer for the frame that uses (calls) the IC.
Address fp_;
@@ -338,10 +355,15 @@ class LoadIC: public IC {
// Specialized code generator routines.
static void GenerateArrayLength(MacroAssembler* masm);
- static void GenerateStringLength(MacroAssembler* masm,
- bool support_wrappers);
static void GenerateFunctionPrototype(MacroAssembler* masm);
+ protected:
+ virtual Code::Kind kind() const { return Code::LOAD_IC; }
+
+ virtual Handle<Code> megamorphic_stub() {
+ return isolate()->builtins()->LoadIC_Megamorphic();
+ }
+
private:
// Update the inline cache and the global stub cache based on the
// lookup result.
@@ -351,14 +373,11 @@ class LoadIC: public IC {
Handle<String> name);
// Stub accessors.
- Handle<Code> megamorphic_stub() {
- return isolate()->builtins()->LoadIC_Megamorphic();
- }
static Code* initialize_stub() {
return Isolate::Current()->builtins()->builtin(
Builtins::kLoadIC_Initialize);
}
- Handle<Code> pre_monomorphic_stub() {
+ virtual Handle<Code> pre_monomorphic_stub() {
return isolate()->builtins()->LoadIC_PreMonomorphic();
}
@@ -429,8 +448,6 @@ class KeyedIC: public IC {
return Handle<Code>::null();
}
- virtual Code::Kind kind() const = 0;
-
Handle<Code> ComputeStub(Handle<JSObject> receiver,
StubKind stub_kind,
StrictModeFlag strict_mode,
@@ -520,6 +537,10 @@ class KeyedLoadIC: public KeyedIC {
protected:
virtual Code::Kind kind() const { return Code::KEYED_LOAD_IC; }
+ virtual Handle<Code> megamorphic_stub() {
+ return isolate()->builtins()->KeyedLoadIC_Generic();
+ }
+
virtual Handle<Code> ComputePolymorphicStub(MapHandleList* receiver_maps,
StrictModeFlag strict_mode,
KeyedAccessGrowMode grow_mode);
@@ -540,13 +561,10 @@ class KeyedLoadIC: public KeyedIC {
return Isolate::Current()->builtins()->builtin(
Builtins::kKeyedLoadIC_Initialize);
}
- Handle<Code> megamorphic_stub() {
- return isolate()->builtins()->KeyedLoadIC_Generic();
- }
Handle<Code> generic_stub() const {
return isolate()->builtins()->KeyedLoadIC_Generic();
}
- Handle<Code> pre_monomorphic_stub() {
+ virtual Handle<Code> pre_monomorphic_stub() {
return isolate()->builtins()->KeyedLoadIC_PreMonomorphic();
}
Handle<Code> indexed_interceptor_stub() {
@@ -584,6 +602,12 @@ class StoreIC: public IC {
static void GenerateGlobalProxy(MacroAssembler* masm,
StrictModeFlag strict_mode);
+ protected:
+ virtual Code::Kind kind() const { return Code::STORE_IC; }
+ virtual Handle<Code> megamorphic_stub() {
+ return isolate()->builtins()->StoreIC_Megamorphic();
+ }
+
private:
// Update the inline cache and the global stub cache based on the
// lookup result.
@@ -602,10 +626,6 @@ class StoreIC: public IC {
}
// Stub accessors.
- Code* megamorphic_stub() {
- return isolate()->builtins()->builtin(
- Builtins::kStoreIC_Megamorphic);
- }
Code* megamorphic_stub_strict() {
return isolate()->builtins()->builtin(
Builtins::kStoreIC_Megamorphic_Strict);
« no previous file with comments | « src/ia32/stub-cache-ia32.cc ('k') | src/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698