Inline Declaration::IsInlineable into crankshaft

Those virtual methods shouldn't live on the AST since they are crankshaft specific, and can easily be checked inline.

BUG=

Review-Url: https://codereview.chromium.org/2125933004
Cr-Commit-Position: refs/heads/master@{#37572}
This commit is contained in:
verwaest 2016-07-07 01:28:27 -07:00 committed by Commit bot
parent d3aefe8cc3
commit b3f827c8e4
3 changed files with 2 additions and 15 deletions

View File

@ -712,18 +712,6 @@ bool CompareOperation::IsLiteralCompareNull(Expression** expr) {
}
// ----------------------------------------------------------------------------
// Inlining support
bool Declaration::IsInlineable() const {
return proxy()->var()->IsStackAllocated();
}
bool FunctionDeclaration::IsInlineable() const {
return false;
}
// ----------------------------------------------------------------------------
// Recording of type feedback

View File

@ -512,7 +512,6 @@ class Declaration : public AstNode {
VariableMode mode() const { return mode_; }
Scope* scope() const { return scope_; }
virtual InitializationFlag initialization() const = 0;
virtual bool IsInlineable() const;
protected:
Declaration(Zone* zone, VariableProxy* proxy, VariableMode mode, Scope* scope,
@ -554,7 +553,6 @@ class FunctionDeclaration final : public Declaration {
InitializationFlag initialization() const override {
return kCreatedInitialized;
}
bool IsInlineable() const override;
protected:
FunctionDeclaration(Zone* zone,

View File

@ -8426,7 +8426,8 @@ bool HOptimizedGraphBuilder::TryInline(Handle<JSFunction> target,
ZoneList<Declaration*>* decls = target_info.scope()->declarations();
int decl_count = decls->length();
for (int i = 0; i < decl_count; ++i) {
if (!decls->at(i)->IsInlineable()) {
if (decls->at(i)->IsFunctionDeclaration() ||
!decls->at(i)->proxy()->var()->IsStackAllocated()) {
TraceInline(target, caller, "target has non-trivial declaration");
return false;
}