Commit 1ca3d099 authored by ishell's avatar ishell Committed by Commit bot

[stubs] Cleanup CodeFactory.

Inline XxxIC::initialize_stub_in_optimized_code() methods to CodeFactory and use stub's call interface descriptor instead of hard-coded one.

BUG=v8:5236

Review-Url: https://codereview.chromium.org/2184063002
Cr-Commit-Position: refs/heads/master@{#38093}
parent 45b50197
This diff is collapsed.
......@@ -1952,6 +1952,12 @@ class CompareICStub : public PlatformCodeStub {
LeftStateBits::encode(left) | RightStateBits::encode(right) |
StateBits::encode(state);
}
// Creates uninitialized compare stub.
CompareICStub(Isolate* isolate, Token::Value op)
: CompareICStub(isolate, op, CompareICState::UNINITIALIZED,
CompareICState::UNINITIALIZED,
CompareICState::UNINITIALIZED) {}
CompareICStub(Isolate* isolate, ExtraICState extra_ic_state)
: PlatformCodeStub(isolate) {
minor_key_ = extra_ic_state;
......
......@@ -817,32 +817,6 @@ void IC::PatchCache(Handle<Name> name, Handle<Object> code) {
}
}
Handle<Code> LoadIC::initialize_stub_in_optimized_code(Isolate* isolate) {
if (FLAG_tf_load_ic_stub) {
return LoadICTFStub(isolate).GetCode();
}
return LoadICStub(isolate).GetCode();
}
Handle<Code> LoadGlobalIC::initialize_stub_in_optimized_code(
Isolate* isolate, ExtraICState extra_state) {
return LoadGlobalICStub(isolate, LoadGlobalICState(extra_state)).GetCode();
}
Handle<Code> KeyedLoadIC::initialize_stub_in_optimized_code(Isolate* isolate) {
if (FLAG_tf_load_ic_stub) {
return KeyedLoadICTFStub(isolate).GetCode();
}
return KeyedLoadICStub(isolate).GetCode();
}
Handle<Code> KeyedStoreIC::initialize_stub_in_optimized_code(
Isolate* isolate, LanguageMode language_mode) {
StoreICState state = StoreICState(language_mode);
return KeyedStoreICStub(isolate, state).GetCode();
}
Handle<Code> KeyedStoreIC::ChooseMegamorphicStub(Isolate* isolate,
ExtraICState extra_state) {
LanguageMode mode = StoreICState::GetLanguageMode(extra_state);
......@@ -1594,20 +1568,6 @@ MaybeHandle<Object> StoreIC::Store(Handle<Object> object, Handle<Name> name,
return value;
}
Handle<Code> CallIC::initialize_stub_in_optimized_code(
Isolate* isolate, int argc, ConvertReceiverMode mode,
TailCallMode tail_call_mode) {
CallICStub stub(isolate, CallICState(argc, mode, tail_call_mode));
Handle<Code> code = stub.GetCode();
return code;
}
Handle<Code> StoreIC::initialize_stub_in_optimized_code(
Isolate* isolate, LanguageMode language_mode) {
StoreICStub stub(isolate, StoreICState(language_mode));
return stub.GetCode();
}
void StoreIC::UpdateCaches(LookupIterator* lookup, Handle<Object> value,
JSReceiver::StoreFromKeyed store_mode) {
if (state() == UNINITIALIZED) {
......@@ -2729,14 +2689,6 @@ Code* CompareIC::GetRawUninitialized(Isolate* isolate, Token::Value op) {
return code;
}
Handle<Code> CompareIC::GetUninitialized(Isolate* isolate, Token::Value op) {
CompareICStub stub(isolate, op, CompareICState::UNINITIALIZED,
CompareICState::UNINITIALIZED,
CompareICState::UNINITIALIZED);
return stub.GetCode();
}
Code* CompareIC::UpdateCaches(Handle<Object> x, Handle<Object> y) {
HandleScope scope(isolate());
CompareICStub old_stub(target()->stub_key(), isolate());
......
......@@ -260,11 +260,6 @@ class CallIC : public IC {
void HandleMiss(Handle<Object> function);
// Code generator routines.
static Handle<Code> initialize_stub_in_optimized_code(
Isolate* isolate, int argc, ConvertReceiverMode mode,
TailCallMode tail_call_mode);
static void Clear(Isolate* isolate, Code* host, CallICNexus* nexus);
};
......@@ -289,8 +284,6 @@ class LoadIC : public IC {
static void GenerateRuntimeGetProperty(MacroAssembler* masm);
static void GenerateNormal(MacroAssembler* masm);
static Handle<Code> initialize_stub_in_optimized_code(Isolate* isolate);
MUST_USE_RESULT MaybeHandle<Object> Load(Handle<Object> object,
Handle<Name> name);
......@@ -321,9 +314,6 @@ class LoadGlobalIC : public LoadIC {
LoadGlobalIC(FrameDepth depth, Isolate* isolate, FeedbackNexus* nexus = NULL)
: LoadIC(depth, isolate, nexus) {}
static Handle<Code> initialize_stub_in_optimized_code(
Isolate* isolate, ExtraICState extra_state);
MUST_USE_RESULT MaybeHandle<Object> Load(Handle<Name> name);
static void Clear(Isolate* isolate, Code* host, LoadGlobalICNexus* nexus);
......@@ -355,7 +345,6 @@ class KeyedLoadIC : public LoadIC {
static void GenerateRuntimeGetProperty(MacroAssembler* masm);
static void GenerateMegamorphic(MacroAssembler* masm);
static Handle<Code> initialize_stub_in_optimized_code(Isolate* isolate);
static Handle<Code> ChooseMegamorphicStub(Isolate* isolate,
ExtraICState extra_state);
......@@ -386,9 +375,6 @@ class StoreIC : public IC {
static void GenerateMiss(MacroAssembler* masm);
static void GenerateNormal(MacroAssembler* masm);
static Handle<Code> initialize_stub_in_optimized_code(
Isolate* isolate, LanguageMode language_mode);
MUST_USE_RESULT MaybeHandle<Object> Store(
Handle<Object> object, Handle<Name> name, Handle<Object> value,
JSReceiver::StoreFromKeyed store_mode =
......@@ -452,8 +438,6 @@ class KeyedStoreIC : public StoreIC {
static void GenerateMegamorphic(MacroAssembler* masm,
LanguageMode language_mode);
static Handle<Code> initialize_stub_in_optimized_code(
Isolate* isolate, LanguageMode language_mode);
static Handle<Code> ChooseMegamorphicStub(Isolate* isolate,
ExtraICState extra_state);
......@@ -493,9 +477,6 @@ class CompareIC : public IC {
// Helper function for computing the condition for a compare operation.
static Condition ComputeCondition(Token::Value op);
// Factory method for getting an uninitialized compare stub.
static Handle<Code> GetUninitialized(Isolate* isolate, Token::Value op);
private:
static bool HasInlinedSmiCode(Address address);
......
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