From 59a7bdd6e293ea82ecf8c7e5599eacc8381710d8 Mon Sep 17 00:00:00 2001 From: "yangguo@chromium.org" Date: Tue, 28 Feb 2012 12:59:00 +0000 Subject: [PATCH] Add code kind check before preparing for OSR. BUG=v8:1900, 115073 Review URL: https://chromiumcodereview.appspot.com/9495005 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10858 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/runtime-profiler.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/runtime-profiler.cc b/src/runtime-profiler.cc index 8bd59d1de2..70586aa06b 100644 --- a/src/runtime-profiler.cc +++ b/src/runtime-profiler.cc @@ -257,7 +257,8 @@ void RuntimeProfiler::OptimizeNow() { } } - if (function->IsMarkedForLazyRecompilation()) { + if (function->IsMarkedForLazyRecompilation() && + function->shared()->code()->kind() == Code::FUNCTION) { Code* unoptimized = function->shared()->code(); int nesting = unoptimized->allow_osr_at_loop_nesting_level(); if (nesting == 0) AttemptOnStackReplacement(function);