[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:
parent
818769db41
commit
15b290363b
@ -95,24 +95,6 @@ Register PropertyHandlerCompiler::Frontend(Handle<Name> name) {
|
|||||||
return reg;
|
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<Code> NamedLoadHandlerCompiler::CompileLoadCallback(
|
||||||
Handle<Name> name, const CallOptimization& call_optimization,
|
Handle<Name> name, const CallOptimization& call_optimization,
|
||||||
int accessor_index, Handle<Code> slow_stub) {
|
int accessor_index, Handle<Code> slow_stub) {
|
||||||
|
@ -129,10 +129,6 @@ class NamedLoadHandlerCompiler : public PropertyHandlerCompiler {
|
|||||||
|
|
||||||
virtual ~NamedLoadHandlerCompiler() {}
|
virtual ~NamedLoadHandlerCompiler() {}
|
||||||
|
|
||||||
Handle<Code> CompileLoadCallback(Handle<Name> name,
|
|
||||||
Handle<AccessorInfo> callback,
|
|
||||||
Handle<Code> slow_stub);
|
|
||||||
|
|
||||||
Handle<Code> CompileLoadCallback(Handle<Name> name,
|
Handle<Code> CompileLoadCallback(Handle<Name> name,
|
||||||
const CallOptimization& call_optimization,
|
const CallOptimization& call_optimization,
|
||||||
int accessor_index, Handle<Code> slow_stub);
|
int accessor_index, Handle<Code> slow_stub);
|
||||||
|
64
src/ic/ic.cc
64
src/ic/ic.cc
@ -1374,11 +1374,8 @@ Handle<Object> LoadIC::GetMapIndependentHandler(LookupIterator* lookup) {
|
|||||||
TRACE_HANDLER_STATS(isolate(), LoadIC_LoadApiGetterDH);
|
TRACE_HANDLER_STATS(isolate(), LoadIC_LoadApiGetterDH);
|
||||||
return smi_handler;
|
return smi_handler;
|
||||||
}
|
}
|
||||||
if (!IsLoadGlobalIC()) {
|
TRACE_HANDLER_STATS(isolate(), LoadIC_LoadApiGetterFromPrototypeDH);
|
||||||
TRACE_HANDLER_STATS(isolate(), LoadIC_LoadApiGetterFromPrototypeDH);
|
return LoadFromPrototype(map, holder, lookup->name(), smi_handler);
|
||||||
return LoadFromPrototype(map, holder, lookup->name(), smi_handler);
|
|
||||||
}
|
|
||||||
break; // Custom-compiled handler.
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TRACE_HANDLER_STATS(isolate(), LoadIC_SlowStub);
|
TRACE_HANDLER_STATS(isolate(), LoadIC_SlowStub);
|
||||||
@ -1463,45 +1460,30 @@ Handle<Object> LoadIC::CompileHandler(LookupIterator* lookup,
|
|||||||
|
|
||||||
DCHECK(IsCompatibleReceiver(lookup, map));
|
DCHECK(IsCompatibleReceiver(lookup, map));
|
||||||
Handle<Object> accessors = lookup->GetAccessors();
|
Handle<Object> accessors = lookup->GetAccessors();
|
||||||
if (accessors->IsAccessorPair()) {
|
DCHECK(accessors->IsAccessorPair());
|
||||||
if (lookup->TryLookupCachedProperty()) {
|
if (lookup->TryLookupCachedProperty()) {
|
||||||
DCHECK_EQ(LookupIterator::DATA, lookup->state());
|
DCHECK_EQ(LookupIterator::DATA, lookup->state());
|
||||||
return ComputeHandler(lookup);
|
return ComputeHandler(lookup);
|
||||||
}
|
}
|
||||||
DCHECK(holder->HasFastProperties());
|
DCHECK(holder->HasFastProperties());
|
||||||
DCHECK(!GetHostFunction()->shared()->HasDebugInfo());
|
DCHECK(!GetHostFunction()->shared()->HasDebugInfo());
|
||||||
Handle<Object> getter(Handle<AccessorPair>::cast(accessors)->getter(),
|
Handle<Object> getter(Handle<AccessorPair>::cast(accessors)->getter(),
|
||||||
isolate());
|
isolate());
|
||||||
CallOptimization call_optimization(getter);
|
CallOptimization call_optimization(getter);
|
||||||
NamedLoadHandlerCompiler compiler(isolate(), map, holder, cache_holder);
|
NamedLoadHandlerCompiler compiler(isolate(), map, holder, cache_holder);
|
||||||
if (call_optimization.is_simple_api_call()) {
|
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());
|
|
||||||
TRACE_HANDLER_STATS(isolate(), LoadIC_LoadCallback);
|
TRACE_HANDLER_STATS(isolate(), LoadIC_LoadCallback);
|
||||||
NamedLoadHandlerCompiler compiler(isolate(), map, holder, cache_holder);
|
int index = lookup->GetAccessorIndex();
|
||||||
Handle<Code> code =
|
Handle<Code> code = compiler.CompileLoadCallback(
|
||||||
compiler.CompileLoadCallback(lookup->name(), info, slow_stub());
|
lookup->name(), call_optimization, index, slow_stub());
|
||||||
return code;
|
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: {
|
case LookupIterator::DATA: {
|
||||||
|
Loading…
Reference in New Issue
Block a user