Commit d6b3b7e6 authored by ishell's avatar ishell Committed by Commit bot

[ic] Remove --new-load-global-ic switch.

BUG=chromium:576312
LOG=Y

Review-Url: https://codereview.chromium.org/2062343002
Cr-Commit-Position: refs/heads/master@{#37030}
parent 47fb39e4
......@@ -446,9 +446,6 @@ void LoadICTFStub::GenerateAssembly(CodeStubAssembler* assembler) const {
void LoadGlobalICTrampolineStub::GenerateAssembly(
CodeStubAssembler* assembler) const {
if (!FLAG_new_load_global_ic) {
return LoadICTrampolineTFStub::GenerateAssembly(assembler);
}
typedef compiler::Node Node;
Node* name = assembler->Parameter(0);
......@@ -461,9 +458,6 @@ void LoadGlobalICTrampolineStub::GenerateAssembly(
}
void LoadGlobalICStub::GenerateAssembly(CodeStubAssembler* assembler) const {
if (!FLAG_new_load_global_ic) {
return LoadICTFStub::GenerateAssembly(assembler);
}
typedef compiler::Node Node;
Node* name = assembler->Parameter(0);
......
......@@ -2359,24 +2359,24 @@ class LoadICTrampolineTFStub : public TurboFanCodeStub {
DEFINE_CODE_STUB(LoadICTrampolineTF, TurboFanCodeStub);
};
class LoadGlobalICTrampolineStub : public LoadICTrampolineTFStub {
class LoadGlobalICTrampolineStub : public TurboFanCodeStub {
public:
explicit LoadGlobalICTrampolineStub(Isolate* isolate,
const LoadICState& state)
: LoadICTrampolineTFStub(isolate, state) {}
: TurboFanCodeStub(isolate) {
minor_key_ = state.GetExtraICState();
}
void GenerateAssembly(CodeStubAssembler* assembler) const override;
Code::Kind GetCodeKind() const override { return Code::LOAD_GLOBAL_IC; }
// DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadGlobal);
CallInterfaceDescriptor GetCallInterfaceDescriptor() const override {
if (!FLAG_new_load_global_ic) {
return LoadICTrampolineTFStub::GetCallInterfaceDescriptor();
}
return LoadGlobalDescriptor(isolate());
ExtraICState GetExtraICState() const final {
return static_cast<ExtraICState>(minor_key_);
}
DEFINE_CODE_STUB(LoadGlobalICTrampoline, LoadICTrampolineTFStub);
DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadGlobal);
DEFINE_CODE_STUB(LoadGlobalICTrampoline, TurboFanCodeStub);
};
class KeyedLoadICTrampolineStub : public LoadICTrampolineStub {
......@@ -2490,23 +2490,23 @@ class LoadICTFStub : public TurboFanCodeStub {
DEFINE_CODE_STUB(LoadICTF, TurboFanCodeStub);
};
class LoadGlobalICStub : public LoadICTFStub {
class LoadGlobalICStub : public TurboFanCodeStub {
public:
explicit LoadGlobalICStub(Isolate* isolate, const LoadICState& state)
: LoadICTFStub(isolate, state) {}
: TurboFanCodeStub(isolate) {
minor_key_ = state.GetExtraICState();
}
void GenerateAssembly(CodeStubAssembler* assembler) const override;
Code::Kind GetCodeKind() const override { return Code::LOAD_GLOBAL_IC; }
// DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadGlobalWithVector);
CallInterfaceDescriptor GetCallInterfaceDescriptor() const override {
if (!FLAG_new_load_global_ic) {
return LoadICTFStub::GetCallInterfaceDescriptor();
}
return LoadGlobalWithVectorDescriptor(isolate());
ExtraICState GetExtraICState() const final {
return static_cast<ExtraICState>(minor_key_);
}
DEFINE_CODE_STUB(LoadGlobalIC, LoadICTFStub);
DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadGlobalWithVector);
DEFINE_CODE_STUB(LoadGlobalIC, TurboFanCodeStub);
};
class KeyedLoadICStub : public PlatformCodeStub {
......
......@@ -770,8 +770,6 @@ DEFINE_BOOL(use_idle_notification, true,
DEFINE_BOOL(use_ic, true, "use inline caching")
DEFINE_BOOL(trace_ic, false, "trace inline cache state transitions")
DEFINE_BOOL(tf_load_ic_stub, true, "use TF LoadIC stub")
DEFINE_BOOL_READONLY(new_load_global_ic, true,
"use shortcut-style load global IC")
// macro-assembler-ia32.cc
DEFINE_BOOL(native_code_counters, false,
......
......@@ -467,11 +467,7 @@ void LoadIC::Clear(Isolate* isolate, Code* host, LoadICNexus* nexus) {
void LoadGlobalIC::Clear(Isolate* isolate, Code* host,
LoadGlobalICNexus* nexus) {
if (IsCleared(nexus)) return;
if (FLAG_new_load_global_ic) {
nexus->ConfigureUninitialized();
} else {
nexus->ConfigurePremonomorphic();
}
nexus->ConfigureUninitialized();
OnTypeFeedbackChanged(isolate, host);
}
......@@ -553,11 +549,7 @@ void IC::ConfigureVectorState(Handle<Name> name, Handle<Map> map,
nexus->ConfigureMonomorphic(map, handler);
} else if (kind() == Code::LOAD_GLOBAL_IC) {
LoadGlobalICNexus* nexus = casted_nexus<LoadGlobalICNexus>();
if (FLAG_new_load_global_ic) {
nexus->ConfigureHandlerMode(handler);
} else {
nexus->ConfigureMonomorphic(map, handler);
}
nexus->ConfigureHandlerMode(handler);
} else if (kind() == Code::KEYED_LOAD_IC) {
KeyedLoadICNexus* nexus = casted_nexus<KeyedLoadICNexus>();
nexus->ConfigureMonomorphic(name, map, handler);
......@@ -922,8 +914,7 @@ bool IsCompatibleReceiver(LookupIterator* lookup, Handle<Map> receiver_map) {
void LoadIC::UpdateCaches(LookupIterator* lookup) {
if (state() == UNINITIALIZED &&
(!FLAG_new_load_global_ic || kind() != Code::LOAD_GLOBAL_IC)) {
if (state() == UNINITIALIZED && kind() != Code::LOAD_GLOBAL_IC) {
// This is the first time we execute this inline cache. Set the target to
// the pre monomorphic stub to delay setting the monomorphic state.
ConfigureVectorState(PREMONOMORPHIC, Handle<Object>());
......@@ -945,7 +936,7 @@ void LoadIC::UpdateCaches(LookupIterator* lookup) {
code = slow_stub();
}
} else {
if (FLAG_new_load_global_ic && kind() == Code::LOAD_GLOBAL_IC &&
if (kind() == Code::LOAD_GLOBAL_IC &&
lookup->state() == LookupIterator::DATA &&
lookup->GetHolder<Object>()->IsJSGlobalObject()) {
#if DEBUG
......
......@@ -186,8 +186,7 @@ Handle<TypeFeedbackVector> TypeFeedbackVector::New(
int entry_size = TypeFeedbackMetadata::GetSlotSize(kind);
Object* value;
if (FLAG_new_load_global_ic &&
kind == FeedbackVectorSlotKind::LOAD_GLOBAL_IC) {
if (kind == FeedbackVectorSlotKind::LOAD_GLOBAL_IC) {
value = *factory->empty_weak_cell();
} else {
value = *uninitialized_sentinel;
......@@ -463,29 +462,10 @@ InlineCacheState LoadGlobalICNexus::StateFromFeedback() const {
Isolate* isolate = GetIsolate();
Object* feedback = GetFeedback();
if (FLAG_new_load_global_ic) {
Object* extra = GetFeedbackExtra();
if (!WeakCell::cast(feedback)->cleared() ||
extra != *TypeFeedbackVector::UninitializedSentinel(isolate)) {
return MONOMORPHIC;
}
} else {
if (feedback == *TypeFeedbackVector::UninitializedSentinel(isolate)) {
return UNINITIALIZED;
} else if (feedback == *TypeFeedbackVector::MegamorphicSentinel(isolate)) {
return MEGAMORPHIC;
} else if (feedback ==
*TypeFeedbackVector::PremonomorphicSentinel(isolate)) {
return PREMONOMORPHIC;
} else if (feedback->IsFixedArray()) {
// Determine state purely by our structure, don't check if the maps are
// cleared.
return POLYMORPHIC;
} else if (feedback->IsWeakCell()) {
// Don't check if the map is cleared.
return MONOMORPHIC;
}
Object* extra = GetFeedbackExtra();
if (!WeakCell::cast(feedback)->cleared() ||
extra != *TypeFeedbackVector::UninitializedSentinel(isolate)) {
return MONOMORPHIC;
}
return UNINITIALIZED;
}
......@@ -635,13 +615,6 @@ void LoadICNexus::ConfigureMonomorphic(Handle<Map> receiver_map,
SetFeedbackExtra(*handler);
}
void LoadGlobalICNexus::ConfigureMonomorphic(Handle<Map> receiver_map,
Handle<Code> handler) {
Handle<WeakCell> cell = Map::WeakCellForMap(receiver_map);
SetFeedback(*cell);
SetFeedbackExtra(*handler);
}
void LoadGlobalICNexus::ConfigureUninitialized() {
Isolate* isolate = GetIsolate();
SetFeedback(isolate->heap()->empty_weak_cell(), SKIP_WRITE_BARRIER);
......
......@@ -478,10 +478,6 @@ class LoadGlobalICNexus : public FeedbackNexus {
void ConfigureMegamorphic() override { UNREACHABLE(); }
void Clear(Code* host);
// TODO(ishell): remove LoadIC-style mode support.
void ConfigureMonomorphic(Handle<Map> receiver_map, Handle<Code> handler);
// PropertyCell shortcut mode.
void ConfigureUninitialized() override;
void ConfigurePropertyCellMode(Handle<PropertyCell> cell);
void ConfigureHandlerMode(Handle<Code> handler);
......
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