Commit 2a5046c4 authored by bmeurer's avatar bmeurer Committed by Commit bot

[stubs] Rip out obsolete CallICState.

The CallIC is already not a traditional IC in the V8 sense, so it
doesn't make sense to integrate with the traditional IC machinery.
The plan is to migrate it away completely from the IC world and use
the code that is already available in the interpreter instead.

R=yangguo@chromium.org
BUG=v8:5049

Review-Url: https://codereview.chromium.org/2676543002
Cr-Commit-Position: refs/heads/master@{#42879}
parent d9399cc3
...@@ -88,7 +88,7 @@ Callable CodeFactory::KeyedLoadICInOptimizedCode(Isolate* isolate) { ...@@ -88,7 +88,7 @@ Callable CodeFactory::KeyedLoadICInOptimizedCode(Isolate* isolate) {
// static // static
Callable CodeFactory::CallIC(Isolate* isolate, ConvertReceiverMode mode, Callable CodeFactory::CallIC(Isolate* isolate, ConvertReceiverMode mode,
TailCallMode tail_call_mode) { TailCallMode tail_call_mode) {
CallICStub stub(isolate, CallICState(mode, tail_call_mode)); CallICStub stub(isolate, mode, tail_call_mode);
return make_callable(stub); return make_callable(stub);
} }
...@@ -96,7 +96,7 @@ Callable CodeFactory::CallIC(Isolate* isolate, ConvertReceiverMode mode, ...@@ -96,7 +96,7 @@ Callable CodeFactory::CallIC(Isolate* isolate, ConvertReceiverMode mode,
Callable CodeFactory::CallICTrampoline(Isolate* isolate, Callable CodeFactory::CallICTrampoline(Isolate* isolate,
ConvertReceiverMode mode, ConvertReceiverMode mode,
TailCallMode tail_call_mode) { TailCallMode tail_call_mode) {
CallICTrampolineStub stub(isolate, CallICState(mode, tail_call_mode)); CallICTrampolineStub stub(isolate, mode, tail_call_mode);
return make_callable(stub); return make_callable(stub);
} }
......
...@@ -1756,7 +1756,11 @@ void HydrogenCodeStub::TraceTransition(StateType from, StateType to) { ...@@ -1756,7 +1756,11 @@ void HydrogenCodeStub::TraceTransition(StateType from, StateType to) {
} }
void CallICStub::PrintState(std::ostream& os) const { // NOLINT void CallICStub::PrintState(std::ostream& os) const { // NOLINT
os << state(); os << convert_mode() << ", " << tail_call_mode();
}
void CallICTrampolineStub::PrintState(std::ostream& os) const { // NOLINT
os << convert_mode() << ", " << tail_call_mode();
} }
void CallICTrampolineStub::GenerateAssembly( void CallICTrampolineStub::GenerateAssembly(
......
...@@ -916,9 +916,11 @@ class MathPowStub: public PlatformCodeStub { ...@@ -916,9 +916,11 @@ class MathPowStub: public PlatformCodeStub {
class CallICStub: public PlatformCodeStub { class CallICStub: public PlatformCodeStub {
public: public:
CallICStub(Isolate* isolate, const CallICState& state) CallICStub(Isolate* isolate, ConvertReceiverMode convert_mode,
TailCallMode tail_call_mode)
: PlatformCodeStub(isolate) { : PlatformCodeStub(isolate) {
minor_key_ = state.GetExtraICState(); minor_key_ = ConvertModeBits::encode(convert_mode) |
TailCallModeBits::encode(tail_call_mode);
} }
Code::Kind GetCodeKind() const override { return Code::CALL_IC; } Code::Kind GetCodeKind() const override { return Code::CALL_IC; }
...@@ -928,10 +930,15 @@ class CallICStub: public PlatformCodeStub { ...@@ -928,10 +930,15 @@ class CallICStub: public PlatformCodeStub {
} }
protected: protected:
ConvertReceiverMode convert_mode() const { return state().convert_mode(); } typedef BitField<ConvertReceiverMode, 0, 2> ConvertModeBits;
TailCallMode tail_call_mode() const { return state().tail_call_mode(); } typedef BitField<TailCallMode, ConvertModeBits::kNext, 1> TailCallModeBits;
CallICState state() const { return CallICState(GetExtraICState()); } ConvertReceiverMode convert_mode() const {
return ConvertModeBits::decode(minor_key_);
}
TailCallMode tail_call_mode() const {
return TailCallModeBits::decode(minor_key_);
}
// Code generation helpers. // Code generation helpers.
void GenerateMiss(MacroAssembler* masm); void GenerateMiss(MacroAssembler* masm);
...@@ -1597,9 +1604,11 @@ class StringCharAtGenerator { ...@@ -1597,9 +1604,11 @@ class StringCharAtGenerator {
class CallICTrampolineStub : public TurboFanCodeStub { class CallICTrampolineStub : public TurboFanCodeStub {
public: public:
CallICTrampolineStub(Isolate* isolate, const CallICState& state) CallICTrampolineStub(Isolate* isolate, ConvertReceiverMode convert_mode,
TailCallMode tail_call_mode)
: TurboFanCodeStub(isolate) { : TurboFanCodeStub(isolate) {
minor_key_ = state.GetExtraICState(); minor_key_ = ConvertModeBits::encode(convert_mode) |
TailCallModeBits::encode(tail_call_mode);
} }
Code::Kind GetCodeKind() const override { return Code::CALL_IC; } Code::Kind GetCodeKind() const override { return Code::CALL_IC; }
...@@ -1609,11 +1618,18 @@ class CallICTrampolineStub : public TurboFanCodeStub { ...@@ -1609,11 +1618,18 @@ class CallICTrampolineStub : public TurboFanCodeStub {
} }
protected: protected:
ConvertReceiverMode convert_mode() const { return state().convert_mode(); } typedef BitField<ConvertReceiverMode, 0, 2> ConvertModeBits;
TailCallMode tail_call_mode() const { return state().tail_call_mode(); } typedef BitField<TailCallMode, ConvertModeBits::kNext, 1> TailCallModeBits;
CallICState state() const {
return CallICState(static_cast<ExtraICState>(minor_key_)); ConvertReceiverMode convert_mode() const {
return ConvertModeBits::decode(minor_key_);
} }
TailCallMode tail_call_mode() const {
return TailCallModeBits::decode(minor_key_);
}
private:
void PrintState(std::ostream& os) const override; // NOLINT
DEFINE_CALL_INTERFACE_DESCRIPTOR(CallFunctionWithFeedback); DEFINE_CALL_INTERFACE_DESCRIPTOR(CallFunctionWithFeedback);
DEFINE_TURBOFAN_CODE_STUB(CallICTrampoline, TurboFanCodeStub); DEFINE_TURBOFAN_CODE_STUB(CallICTrampoline, TurboFanCodeStub);
......
...@@ -16,11 +16,6 @@ void ICUtility::Clear(Isolate* isolate, Address address, ...@@ -16,11 +16,6 @@ void ICUtility::Clear(Isolate* isolate, Address address,
} }
std::ostream& operator<<(std::ostream& os, const CallICState& s) {
return os << "(" << s.convert_mode() << ", " << s.tail_call_mode() << ")";
}
// static // static
STATIC_CONST_MEMBER_DEFINITION const int BinaryOpICState::FIRST_TOKEN; STATIC_CONST_MEMBER_DEFINITION const int BinaryOpICState::FIRST_TOKEN;
......
...@@ -22,38 +22,6 @@ class ICUtility : public AllStatic { ...@@ -22,38 +22,6 @@ class ICUtility : public AllStatic {
}; };
class CallICState final BASE_EMBEDDED {
public:
explicit CallICState(ExtraICState extra_ic_state)
: bit_field_(extra_ic_state) {}
CallICState(ConvertReceiverMode convert_mode, TailCallMode tail_call_mode)
: bit_field_(ConvertModeBits::encode(convert_mode) |
TailCallModeBits::encode(tail_call_mode)) {}
ExtraICState GetExtraICState() const { return bit_field_; }
static void GenerateAheadOfTime(Isolate*,
void (*Generate)(Isolate*,
const CallICState&));
ConvertReceiverMode convert_mode() const {
return ConvertModeBits::decode(bit_field_);
}
TailCallMode tail_call_mode() const {
return TailCallModeBits::decode(bit_field_);
}
private:
typedef BitField<ConvertReceiverMode, 0, 2> ConvertModeBits;
typedef BitField<TailCallMode, ConvertModeBits::kNext, 1> TailCallModeBits;
int const bit_field_;
};
std::ostream& operator<<(std::ostream& os, const CallICState& s);
class BinaryOpICState final BASE_EMBEDDED { class BinaryOpICState final BASE_EMBEDDED {
public: public:
BinaryOpICState(Isolate* isolate, ExtraICState extra_ic_state); BinaryOpICState(Isolate* isolate, ExtraICState extra_ic_state);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment