| Index: src/ic.h
|
| diff --git a/src/ic.h b/src/ic.h
|
| index dd6b609743f604b37519542abc0dcd710630b8cd..15cb0ec9c8c41a127530d03c6ccbd91db1625db4 100644
|
| --- a/src/ic.h
|
| +++ b/src/ic.h
|
| @@ -42,6 +42,7 @@ const int kMaxKeyedPolymorphism = 4;
|
| #define IC_UTIL_LIST(ICU) \
|
| ICU(LoadIC_Miss) \
|
| ICU(KeyedLoadIC_Miss) \
|
| + ICU(CallIC_Miss) \
|
| ICU(StoreIC_Miss) \
|
| ICU(StoreIC_ArrayLength) \
|
| ICU(StoreIC_Slow) \
|
| @@ -127,6 +128,10 @@ class IC {
|
| bool IsStoreStub() const {
|
| return target()->is_store_stub() || target()->is_keyed_store_stub();
|
| }
|
| +
|
| + bool IsCallStub() const {
|
| + return target()->is_call_stub();
|
| + }
|
| #endif
|
|
|
| // Determines which map must be used for keeping the code stub.
|
| @@ -350,6 +355,78 @@ class IC_Utility {
|
| };
|
|
|
|
|
| +class CallIC: public IC {
|
| + public:
|
| + enum CallType { METHOD, FUNCTION };
|
| +
|
| + class State V8_FINAL BASE_EMBEDDED {
|
| + public:
|
| + explicit State(ExtraICState extra_ic_state);
|
| +
|
| + static State DefaultCallState(int argc, CallType call_type) {
|
| + return State(argc, call_type);
|
| + }
|
| +
|
| + static State MegamorphicCallState(int argc, CallType call_type) {
|
| + return State(argc, call_type);
|
| + }
|
| +
|
| + InlineCacheState GetICState() const { return ::v8::internal::GENERIC; }
|
| +
|
| + ExtraICState GetExtraICState() const;
|
| +
|
| + static void GenerateAheadOfTime(
|
| + Isolate*, void (*Generate)(Isolate*, const State&));
|
| +
|
| + int arg_count() const { return argc_; }
|
| + CallType call_type() const { return call_type_; }
|
| +
|
| + bool CallAsMethod() const { return call_type_ == METHOD; }
|
| +
|
| + void Print(StringStream* stream) const;
|
| +
|
| + bool operator==(const State& other_state) const {
|
| + return (argc_ == other_state.argc_ &&
|
| + call_type_ == other_state.call_type_);
|
| + }
|
| +
|
| + bool operator!=(const State& other_state) const {
|
| + return !(*this == other_state);
|
| + }
|
| +
|
| + private:
|
| + State(int argc,
|
| + CallType call_type)
|
| + : argc_(argc),
|
| + call_type_(call_type) {
|
| + }
|
| +
|
| + class ArgcBits: public BitField<int, 0, Code::kArgumentsBits> {};
|
| + class CallTypeBits: public BitField<CallType, Code::kArgumentsBits, 1> {};
|
| +
|
| + const int argc_;
|
| + const CallType call_type_;
|
| + };
|
| +
|
| + explicit CallIC(Isolate* isolate)
|
| + : IC(EXTRA_CALL_FRAME, isolate) {
|
| + }
|
| +
|
| + void HandleMiss(Handle<Object> receiver,
|
| + Handle<Object> function,
|
| + Handle<FixedArray> vector,
|
| + Handle<Smi> slot);
|
| +
|
| + // Code generator routines.
|
| + static Handle<Code> initialize_stub(Isolate* isolate,
|
| + int argc,
|
| + CallType call_type);
|
| +
|
| + static void Clear(Isolate* isolate, Address address, Code* target,
|
| + ConstantPoolArray* constant_pool);
|
| +};
|
| +
|
| +
|
| class LoadIC: public IC {
|
| public:
|
| // ExtraICState bits
|
|
|