[ic] Remove dead accessor info support from LoadIC::CompileHandler

BUG=

Change-Id: Ib7d6f1c8cc20f4170607d4f595756a534e3eceb8
Reviewed-on: https://chromium-review.googlesource.com/452382
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43770}
This commit is contained in:
Toon Verwaest 2017-03-14 10:23:36 +01:00 committed by Commit Bot
parent 818769db41
commit 15b290363b
3 changed files with 23 additions and 63 deletions

View File

@ -95,24 +95,6 @@ Register PropertyHandlerCompiler::Frontend(Handle<Name> name) {
return reg;
}
Handle<Code> NamedLoadHandlerCompiler::CompileLoadCallback(
Handle<Name> name, Handle<AccessorInfo> callback, Handle<Code> slow_stub) {
if (V8_UNLIKELY(FLAG_runtime_stats)) {
GenerateTailCall(masm(), slow_stub);
}
Register reg = Frontend(name);
DCHECK(receiver().is(ApiGetterDescriptor::ReceiverRegister()));
__ Move(ApiGetterDescriptor::HolderRegister(), reg);
// The callback is alive if this instruction is executed,
// so the weak cell is not cleared and points to data.
Handle<WeakCell> cell = isolate()->factory()->NewWeakCell(callback);
__ GetWeakValue(ApiGetterDescriptor::CallbackRegister(), cell);
CallApiGetterStub stub(isolate());
__ TailCallStub(&stub);
return GetCode(kind(), name);
}
Handle<Code> NamedLoadHandlerCompiler::CompileLoadCallback(
Handle<Name> name, const CallOptimization& call_optimization,
int accessor_index, Handle<Code> slow_stub) {

View File

@ -129,10 +129,6 @@ class NamedLoadHandlerCompiler : public PropertyHandlerCompiler {
virtual ~NamedLoadHandlerCompiler() {}
Handle<Code> CompileLoadCallback(Handle<Name> name,
Handle<AccessorInfo> callback,
Handle<Code> slow_stub);
Handle<Code> CompileLoadCallback(Handle<Name> name,
const CallOptimization& call_optimization,
int accessor_index, Handle<Code> slow_stub);

View File

@ -1374,11 +1374,8 @@ Handle<Object> LoadIC::GetMapIndependentHandler(LookupIterator* lookup) {
TRACE_HANDLER_STATS(isolate(), LoadIC_LoadApiGetterDH);
return smi_handler;
}
if (!IsLoadGlobalIC()) {
TRACE_HANDLER_STATS(isolate(), LoadIC_LoadApiGetterFromPrototypeDH);
return LoadFromPrototype(map, holder, lookup->name(), smi_handler);
}
break; // Custom-compiled handler.
TRACE_HANDLER_STATS(isolate(), LoadIC_LoadApiGetterFromPrototypeDH);
return LoadFromPrototype(map, holder, lookup->name(), smi_handler);
}
}
TRACE_HANDLER_STATS(isolate(), LoadIC_SlowStub);
@ -1463,45 +1460,30 @@ Handle<Object> LoadIC::CompileHandler(LookupIterator* lookup,
DCHECK(IsCompatibleReceiver(lookup, map));
Handle<Object> accessors = lookup->GetAccessors();
if (accessors->IsAccessorPair()) {
if (lookup->TryLookupCachedProperty()) {
DCHECK_EQ(LookupIterator::DATA, lookup->state());
return ComputeHandler(lookup);
}
DCHECK(holder->HasFastProperties());
DCHECK(!GetHostFunction()->shared()->HasDebugInfo());
Handle<Object> getter(Handle<AccessorPair>::cast(accessors)->getter(),
isolate());
CallOptimization call_optimization(getter);
NamedLoadHandlerCompiler compiler(isolate(), map, holder, cache_holder);
if (call_optimization.is_simple_api_call()) {
TRACE_HANDLER_STATS(isolate(), LoadIC_LoadCallback);
int index = lookup->GetAccessorIndex();
Handle<Code> code = compiler.CompileLoadCallback(
lookup->name(), call_optimization, index, slow_stub());
return code;
}
TRACE_HANDLER_STATS(isolate(), LoadIC_LoadViaGetter);
int expected_arguments = Handle<JSFunction>::cast(getter)
->shared()
->internal_formal_parameter_count();
return compiler.CompileLoadViaGetter(
lookup->name(), lookup->GetAccessorIndex(), expected_arguments);
} else {
DCHECK(accessors->IsAccessorInfo());
Handle<AccessorInfo> info = Handle<AccessorInfo>::cast(accessors);
DCHECK(v8::ToCData<Address>(info->getter()) != nullptr);
DCHECK(AccessorInfo::IsCompatibleReceiverMap(isolate(), info, map));
DCHECK(holder->HasFastProperties());
DCHECK(!receiver_is_holder);
DCHECK(!info->is_sloppy() || receiver->IsJSReceiver());
DCHECK(accessors->IsAccessorPair());
if (lookup->TryLookupCachedProperty()) {
DCHECK_EQ(LookupIterator::DATA, lookup->state());
return ComputeHandler(lookup);
}
DCHECK(holder->HasFastProperties());
DCHECK(!GetHostFunction()->shared()->HasDebugInfo());
Handle<Object> getter(Handle<AccessorPair>::cast(accessors)->getter(),
isolate());
CallOptimization call_optimization(getter);
NamedLoadHandlerCompiler compiler(isolate(), map, holder, cache_holder);
if (call_optimization.is_simple_api_call()) {
TRACE_HANDLER_STATS(isolate(), LoadIC_LoadCallback);
NamedLoadHandlerCompiler compiler(isolate(), map, holder, cache_holder);
Handle<Code> code =
compiler.CompileLoadCallback(lookup->name(), info, slow_stub());
int index = lookup->GetAccessorIndex();
Handle<Code> code = compiler.CompileLoadCallback(
lookup->name(), call_optimization, index, slow_stub());
return code;
}
UNREACHABLE();
TRACE_HANDLER_STATS(isolate(), LoadIC_LoadViaGetter);
int expected_arguments = Handle<JSFunction>::cast(getter)
->shared()
->internal_formal_parameter_count();
return compiler.CompileLoadViaGetter(
lookup->name(), lookup->GetAccessorIndex(), expected_arguments);
}
case LookupIterator::DATA: {