Commit b3f827c8 authored by verwaest's avatar verwaest Committed by Commit bot

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}
parent d3aefe8c
...@@ -712,18 +712,6 @@ bool CompareOperation::IsLiteralCompareNull(Expression** expr) { ...@@ -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 // Recording of type feedback
......
...@@ -512,7 +512,6 @@ class Declaration : public AstNode { ...@@ -512,7 +512,6 @@ class Declaration : public AstNode {
VariableMode mode() const { return mode_; } VariableMode mode() const { return mode_; }
Scope* scope() const { return scope_; } Scope* scope() const { return scope_; }
virtual InitializationFlag initialization() const = 0; virtual InitializationFlag initialization() const = 0;
virtual bool IsInlineable() const;
protected: protected:
Declaration(Zone* zone, VariableProxy* proxy, VariableMode mode, Scope* scope, Declaration(Zone* zone, VariableProxy* proxy, VariableMode mode, Scope* scope,
...@@ -554,7 +553,6 @@ class FunctionDeclaration final : public Declaration { ...@@ -554,7 +553,6 @@ class FunctionDeclaration final : public Declaration {
InitializationFlag initialization() const override { InitializationFlag initialization() const override {
return kCreatedInitialized; return kCreatedInitialized;
} }
bool IsInlineable() const override;
protected: protected:
FunctionDeclaration(Zone* zone, FunctionDeclaration(Zone* zone,
......
...@@ -8426,7 +8426,8 @@ bool HOptimizedGraphBuilder::TryInline(Handle<JSFunction> target, ...@@ -8426,7 +8426,8 @@ bool HOptimizedGraphBuilder::TryInline(Handle<JSFunction> target,
ZoneList<Declaration*>* decls = target_info.scope()->declarations(); ZoneList<Declaration*>* decls = target_info.scope()->declarations();
int decl_count = decls->length(); int decl_count = decls->length();
for (int i = 0; i < decl_count; ++i) { 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"); TraceInline(target, caller, "target has non-trivial declaration");
return false; return false;
} }
......
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