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

Unified Diff: src/ic.h

Issue 148223002: Remove CallICs (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Update test262 status file Created 6 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 64098ea0353f51a6abcf1adfe716aafcb068ead4..54fd1eb19ad64767137ab7ff3372f700d25d4d1f 100644
--- a/src/ic.h
+++ b/src/ic.h
@@ -42,8 +42,6 @@ const int kMaxKeyedPolymorphism = 4;
#define IC_UTIL_LIST(ICU) \
ICU(LoadIC_Miss) \
ICU(KeyedLoadIC_Miss) \
- ICU(CallIC_Miss) \
- ICU(KeyedCallIC_Miss) \
ICU(StoreIC_Miss) \
ICU(StoreIC_ArrayLength) \
ICU(StoreIC_Slow) \
@@ -63,8 +61,7 @@ const int kMaxKeyedPolymorphism = 4;
ICU(Unreachable) \
ICU(ToBooleanIC_Miss)
//
-// IC is the base class for LoadIC, StoreIC, CallIC, KeyedLoadIC,
-// and KeyedStoreIC.
+// IC is the base class for LoadIC, StoreIC, KeyedLoadIC, and KeyedStoreIC.
//
class IC {
public:
@@ -114,10 +111,6 @@ class IC {
bool IsStoreStub() const {
return target()->is_store_stub() || target()->is_keyed_store_stub();
}
-
- bool IsCallStub() const {
- return target()->is_call_stub() || target()->is_keyed_call_stub();
- }
#endif
// Determines which map must be used for keeping the code stub.
@@ -284,133 +277,22 @@ class IC_Utility {
};
-class CallICBase: public IC {
- public:
- // Returns a JSFunction or a Failure.
- MUST_USE_RESULT MaybeObject* LoadFunction(Handle<Object> object,
- Handle<String> name);
-
- protected:
- CallICBase(Code::Kind kind, Isolate* isolate)
- : IC(EXTRA_CALL_FRAME, isolate), kind_(kind) {}
-
- // Compute a monomorphic stub if possible, otherwise return a null handle.
- Handle<Code> ComputeMonomorphicStub(LookupResult* lookup,
- Handle<Object> object,
- Handle<String> name);
-
- // Update the inline cache and the global stub cache based on the lookup
- // result.
- void UpdateCaches(LookupResult* lookup,
- Handle<Object> object,
- Handle<String> name);
-
- // Returns a JSFunction if the object can be called as a function, and
- // patches the stack to be ready for the call. Otherwise, it returns the
- // undefined value.
- Handle<Object> TryCallAsFunction(Handle<Object> object);
-
- void ReceiverToObjectIfRequired(Handle<Object> callee, Handle<Object> object);
-
- static void Clear(Address address, Code* target);
-
- // Platform-specific code generation functions used by both call and
- // keyed call.
- static void GenerateMiss(MacroAssembler* masm,
- int argc,
- IC::UtilityId id,
- ExtraICState extra_state);
-
- static void GenerateNormal(MacroAssembler* masm, int argc);
-
- static void GenerateMonomorphicCacheProbe(MacroAssembler* masm,
- int argc,
- Code::Kind kind,
- ExtraICState extra_state);
-
- virtual Handle<Code> megamorphic_stub();
- virtual Handle<Code> pre_monomorphic_stub();
-
- Code::Kind kind_;
-
- friend class IC;
-};
-
-
-class CallIC: public CallICBase {
- public:
- explicit CallIC(Isolate* isolate)
- : CallICBase(Code::CALL_IC, isolate) {
- ASSERT(target()->is_call_stub());
- }
-
- // Code generator routines.
- static void GenerateInitialize(MacroAssembler* masm,
- int argc,
- ExtraICState extra_state) {
- GenerateMiss(masm, argc, extra_state);
- }
-
- static void GenerateMiss(MacroAssembler* masm,
- int argc,
- ExtraICState extra_state) {
- CallICBase::GenerateMiss(masm, argc, IC::kCallIC_Miss, extra_state);
- }
-
- static void GenerateMegamorphic(MacroAssembler* masm,
- int argc,
- ExtraICState extra_ic_state);
-
- static void GenerateNormal(MacroAssembler* masm, int argc) {
- CallICBase::GenerateNormal(masm, argc);
- GenerateMiss(masm, argc, kNoExtraICState);
- }
- bool TryUpdateExtraICState(LookupResult* lookup, Handle<Object> object);
-};
-
-
-class KeyedCallIC: public CallICBase {
- public:
- explicit KeyedCallIC(Isolate* isolate)
- : CallICBase(Code::KEYED_CALL_IC, isolate) {
- ASSERT(target()->is_keyed_call_stub());
- }
-
- MUST_USE_RESULT MaybeObject* LoadFunction(Handle<Object> object,
- Handle<Object> key);
-
- // Code generator routines.
- static void GenerateInitialize(MacroAssembler* masm, int argc) {
- GenerateMiss(masm, argc);
- }
-
- static void GenerateMiss(MacroAssembler* masm, int argc) {
- CallICBase::GenerateMiss(masm, argc, IC::kKeyedCallIC_Miss,
- kNoExtraICState);
- }
-
- static void GenerateMegamorphic(MacroAssembler* masm, int argc);
- static void GenerateNormal(MacroAssembler* masm, int argc);
- static void GenerateNonStrictArguments(MacroAssembler* masm, int argc);
-};
-
-
class LoadIC: public IC {
public:
// ExtraICState bits
- class Contextual: public BitField<ContextualMode, 0, 1> {};
+ class ContextualModeBits: public BitField<ContextualMode, 0, 1> {};
STATIC_ASSERT(static_cast<int>(NOT_CONTEXTUAL) == 0);
- static ExtraICState ComputeExtraICState(ContextualMode mode) {
- return Contextual::encode(mode);
+ static ExtraICState ComputeExtraICState(ContextualMode contextual_mode) {
+ return ContextualModeBits::encode(contextual_mode);
}
static ContextualMode GetContextualMode(ExtraICState state) {
- return Contextual::decode(state);
+ return ContextualModeBits::decode(state);
}
ContextualMode contextual_mode() const {
- return Contextual::decode(extra_ic_state());
+ return ContextualModeBits::decode(extra_ic_state());
}
explicit LoadIC(FrameDepth depth, Isolate* isolate)
@@ -435,11 +317,13 @@ class LoadIC: public IC {
GenerateMiss(masm);
}
static void GenerateMiss(MacroAssembler* masm);
- static void GenerateMegamorphic(MacroAssembler* masm, ContextualMode mode);
+ static void GenerateMegamorphic(MacroAssembler* masm,
+ ExtraICState extra_state);
static void GenerateNormal(MacroAssembler* masm);
static void GenerateRuntimeGetProperty(MacroAssembler* masm);
- static Handle<Code> initialize_stub(Isolate* isolate, ContextualMode mode);
+ static Handle<Code> initialize_stub(Isolate* isolate,
+ ExtraICState extra_state);
MUST_USE_RESULT MaybeObject* Load(Handle<Object> object,
Handle<String> name);
@@ -476,10 +360,10 @@ class LoadIC: public IC {
private:
// Stub accessors.
static Handle<Code> pre_monomorphic_stub(Isolate* isolate,
- ContextualMode mode);
+ ExtraICState exstra_state);
virtual Handle<Code> pre_monomorphic_stub() {
- return pre_monomorphic_stub(isolate(), contextual_mode());
+ return pre_monomorphic_stub(isolate(), extra_ic_state());
}
Handle<Code> SimpleFieldLoad(int offset,
@@ -1002,7 +886,6 @@ DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedLoadIC_MissFromStubFailure);
DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedStoreIC_MissFromStubFailure);
DECLARE_RUNTIME_FUNCTION(MaybeObject*, UnaryOpIC_Miss);
DECLARE_RUNTIME_FUNCTION(MaybeObject*, StoreIC_MissFromStubFailure);
-DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedCallIC_MissFromStubFailure);
DECLARE_RUNTIME_FUNCTION(MaybeObject*, ElementsTransitionAndStoreIC_Miss);
DECLARE_RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_Miss);
DECLARE_RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_MissWithAllocationSite);
« 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