Reviewers: Kasper Lund, Description: Set optimizable to false on code object if shared function info says so.
Because we might throw away code when doing code flushing we need to set the optimizable flag to false in CompileLaze if this has been set on the shared function info. This is the only place where this can happen, since we always exchange the code with the laze compile stub when doing code flushing. The comment in AbortAndDisable actually states that this is already the case (and that comment should now be ok). Please review this at http://codereview.chromium.org/6685044/ SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/ Affected files: M src/compiler.cc Index: src/compiler.cc =================================================================== --- src/compiler.cc (revision 7153) +++ src/compiler.cc (working copy) @@ -612,6 +612,11 @@ } else { ASSERT(!info->code().is_null()); Handle<Code> code = info->code(); + // Set optimizable to false if this is disallowed by the shared + // function info, e.g., we might have flushed the code and must + // reset this bit when lazy compiling the code again. + if (shared->optimization_disabled()) code->set_optimizable(false); + Handle<JSFunction> function = info->closure(); RecordFunctionCompilation(Logger::LAZY_COMPILE_TAG, info, shared); @@ -648,7 +653,7 @@ ASSERT(shared->is_compiled()); shared->set_code_age(0); - if (V8::UseCrankshaft() && info->AllowOptimize()) { + if (info->AllowOptimize() && !shared->optimization_disabled()) { // If we're asked to always optimize, we compile the optimized // version of the function right away - unless the debugger is // active as it makes no sense to compile optimized code then. -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
