| Index: src/code-stubs.h
|
| diff --git a/src/code-stubs.h b/src/code-stubs.h
|
| index fd0c0390b396e309b5e690035a1b67891645c068..ac51717a9d71c8677a7f82a750277834c579a210 100644
|
| --- a/src/code-stubs.h
|
| +++ b/src/code-stubs.h
|
| @@ -51,6 +51,7 @@ namespace internal {
|
| V(CompareIC) \
|
| V(CompareNilIC) \
|
| V(MathPow) \
|
| + V(CallIC) \
|
| V(FunctionPrototype) \
|
| V(RecordWrite) \
|
| V(StoreBufferOverflow) \
|
| @@ -838,6 +839,48 @@ class ICStub: public PlatformCodeStub {
|
| };
|
|
|
|
|
| +class CallICStub: public PlatformCodeStub {
|
| + public:
|
| + explicit CallICStub(const CallIC::State& state)
|
| + : state_(state) {}
|
| +
|
| + bool CallAsMethod() const { return state_.CallAsMethod(); }
|
| +
|
| + int arg_count() const { return state_.arg_count(); }
|
| +
|
| + static int ExtractArgcFromMinorKey(int minor_key) {
|
| + CallIC::State state((ExtraICState) minor_key);
|
| + return state.arg_count();
|
| + }
|
| +
|
| + virtual void Generate(MacroAssembler* masm);
|
| +
|
| + virtual Code::Kind GetCodeKind() const V8_OVERRIDE {
|
| + return Code::CALL_IC;
|
| + }
|
| +
|
| + virtual InlineCacheState GetICState() V8_FINAL V8_OVERRIDE {
|
| + return state_.GetICState();
|
| + }
|
| +
|
| + virtual ExtraICState GetExtraICState() V8_FINAL V8_OVERRIDE {
|
| + return state_.GetExtraICState();
|
| + }
|
| +
|
| + protected:
|
| + virtual int MinorKey() { return GetExtraICState(); }
|
| + virtual void PrintState(StringStream* stream) V8_FINAL V8_OVERRIDE;
|
| +
|
| + private:
|
| + virtual CodeStub::Major MajorKey() { return CallIC; }
|
| +
|
| + // Code generation helpers.
|
| + void GenerateMiss(MacroAssembler* masm);
|
| +
|
| + CallIC::State state_;
|
| +};
|
| +
|
| +
|
| class FunctionPrototypeStub: public ICStub {
|
| public:
|
| explicit FunctionPrototypeStub(Code::Kind kind) : ICStub(kind) { }
|
| @@ -1599,10 +1642,6 @@ class CallFunctionStub: public PlatformCodeStub {
|
|
|
| void Generate(MacroAssembler* masm);
|
|
|
| - virtual void FinishCode(Handle<Code> code) {
|
| - code->set_has_function_cache(RecordCallTarget());
|
| - }
|
| -
|
| static int ExtractArgcFromMinorKey(int minor_key) {
|
| return ArgcBits::decode(minor_key);
|
| }
|
| @@ -1623,10 +1662,6 @@ class CallFunctionStub: public PlatformCodeStub {
|
| return FlagBits::encode(flags_) | ArgcBits::encode(argc_);
|
| }
|
|
|
| - bool RecordCallTarget() {
|
| - return flags_ == RECORD_CALL_TARGET;
|
| - }
|
| -
|
| bool CallAsMethod() {
|
| return flags_ == CALL_AS_METHOD || flags_ == WRAP_AND_CALL;
|
| }
|
| @@ -1639,7 +1674,7 @@ class CallFunctionStub: public PlatformCodeStub {
|
|
|
| class CallConstructStub: public PlatformCodeStub {
|
| public:
|
| - explicit CallConstructStub(CallFunctionFlags flags) : flags_(flags) {}
|
| + explicit CallConstructStub(CallConstructorFlags flags) : flags_(flags) {}
|
|
|
| void Generate(MacroAssembler* masm);
|
|
|
| @@ -1648,7 +1683,7 @@ class CallConstructStub: public PlatformCodeStub {
|
| }
|
|
|
| private:
|
| - CallFunctionFlags flags_;
|
| + CallConstructorFlags flags_;
|
|
|
| virtual void PrintName(StringStream* stream);
|
|
|
| @@ -1656,11 +1691,7 @@ class CallConstructStub: public PlatformCodeStub {
|
| int MinorKey() { return flags_; }
|
|
|
| bool RecordCallTarget() {
|
| - return (flags_ & RECORD_CALL_TARGET) != 0;
|
| - }
|
| -
|
| - bool CallAsMethod() {
|
| - return (flags_ & CALL_AS_METHOD) != 0;
|
| + return (flags_ & RECORD_CONSTRUCTOR_TARGET) != 0;
|
| }
|
| };
|
|
|
|
|