#include "src/compiler/node-properties.h"
#include "src/compiler/operator-properties.h"
#include "src/full-codegen/full-codegen.h"
+#include "src/isolate-inl.h"
#include "src/parser.h"
#include "src/rewriter.h"
#include "src/scopes.h"
CompilationInfo info(&parse_info);
if (info_->is_deoptimization_enabled()) info.MarkAsDeoptimizationEnabled();
- if (!Compiler::ParseAndAnalyze(info.parse_info())) return NoChange();
- if (!Compiler::EnsureDeoptimizationSupport(&info)) return NoChange();
+ if (!Compiler::ParseAndAnalyze(info.parse_info())) {
+ TRACE("Not inlining %s into %s because parsing failed\n",
+ function->shared()->DebugName()->ToCString().get(),
+ info_->shared_info()->DebugName()->ToCString().get());
+ if (info_->isolate()->has_pending_exception()) {
+ info_->isolate()->clear_pending_exception();
+ }
+ return NoChange();
+ }
+
+ if (!Compiler::EnsureDeoptimizationSupport(&info)) {
+ TRACE("Not inlining %s into %s because deoptimization support failed\n",
+ function->shared()->DebugName()->ToCString().get(),
+ info_->shared_info()->DebugName()->ToCString().get());
+ return NoChange();
+ }
if (info.scope()->arguments() != NULL && is_sloppy(info.language_mode())) {
// For now do not inline functions that use their arguments array.
--- /dev/null
+// Copyright 2015 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --stack-size=100 --allow-natives-syntax
+
+function module() {
+ "use asm";
+ var abs = Math.abs;
+ function f() {
+ return +abs();
+ }
+ return { f:f };
+}
+
+function run_close_to_stack_limit(f) {
+ try {
+ run_close_to_stack_limit(f);
+ f();
+ } catch(e) {
+ }
+}
+
+var boom = module().f;
+%OptimizeFunctionOnNextCall(boom)
+run_close_to_stack_limit(boom);