| Index: src/hydrogen.cc
|
| diff --git a/src/hydrogen.cc b/src/hydrogen.cc
|
| index a27360a3fd868b428ccbe4d7388f083cb914a18a..b22accf2ed0817fc8e7eda2c1b7d600e654af01b 100644
|
| --- a/src/hydrogen.cc
|
| +++ b/src/hydrogen.cc
|
| @@ -4798,8 +4798,8 @@ bool HGraphBuilder::TryInline(Call* expr, bool drop_extra) {
|
|
|
| // Do a quick check on source code length to avoid parsing large
|
| // inlining candidates.
|
| - if ((FLAG_limit_inlining && target->shared()->SourceSize() > kMaxSourceSize)
|
| - || target->shared()->SourceSize() > kUnlimitedMaxSourceSize) {
|
| + if ((FLAG_limit_inlining && target_shared->SourceSize() > kMaxSourceSize)
|
| + || target_shared->SourceSize() > kUnlimitedMaxSourceSize) {
|
| TraceInline(target, caller, "target text too big");
|
| return false;
|
| }
|
| @@ -4809,6 +4809,10 @@ bool HGraphBuilder::TryInline(Call* expr, bool drop_extra) {
|
| TraceInline(target, caller, "target not inlineable");
|
| return false;
|
| }
|
| + if (target_shared->dont_inline() || target_shared->dont_crankshaft()) {
|
| + TraceInline(target, caller, "target contains unsupported syntax");
|
| + return false;
|
| + }
|
|
|
| #if !defined(V8_TARGET_ARCH_IA32)
|
| // Target must be able to use caller's context.
|
| @@ -4853,8 +4857,6 @@ bool HGraphBuilder::TryInline(Call* expr, bool drop_extra) {
|
| return false;
|
| }
|
|
|
| - int count_before = AstNode::Count();
|
| -
|
| // Parse and allocate variables.
|
| CompilationInfo target_info(target);
|
| if (!ParserApi::Parse(&target_info, kNoParsingFlags) ||
|
| @@ -4875,7 +4877,7 @@ bool HGraphBuilder::TryInline(Call* expr, bool drop_extra) {
|
| FunctionLiteral* function = target_info.function();
|
|
|
| // Count the number of AST nodes added by inlining this call.
|
| - int nodes_added = AstNode::Count() - count_before;
|
| + int nodes_added = function->AstNodeCount();
|
| if ((FLAG_limit_inlining && nodes_added > kMaxInlinedSize) ||
|
| nodes_added > kUnlimitedMaxInlinedSize) {
|
| TraceInline(target, caller, "target AST is too large");
|
| @@ -4897,13 +4899,6 @@ bool HGraphBuilder::TryInline(Call* expr, bool drop_extra) {
|
| return false;
|
| }
|
| }
|
| - // All statements in the body must be inlineable.
|
| - for (int i = 0, count = function->body()->length(); i < count; ++i) {
|
| - if (!function->body()->at(i)->IsInlineable()) {
|
| - TraceInline(target, caller, "target contains unsupported syntax");
|
| - return false;
|
| - }
|
| - }
|
|
|
| // Generate the deoptimization data for the unoptimized version of
|
| // the target function if we don't already have it.
|
|
|