Reviewers: Mads Ager,
Description:
Don't flush code when the script is an extension.
This change disallows flushing of code when the script is not of the
normal type. This change also sets the flush_code flag to true as default.
Please review this at http://codereview.chromium.org/2827011/show
SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/
Affected files:
M src/flag-definitions.h
M src/heap.cc
Index: src/flag-definitions.h
===================================================================
--- src/flag-definitions.h (revision 4861)
+++ src/flag-definitions.h (working copy)
@@ -191,7 +191,7 @@
"print more details following each garbage collection")
DEFINE_bool(collect_maps, true,
"garbage collect maps from which no objects can be reached")
-DEFINE_bool(flush_code, false,
+DEFINE_bool(flush_code, true,
"flush code that we expect not to use again before full gc")
// v8.cc
Index: src/heap.cc
===================================================================
--- src/heap.cc (revision 4861)
+++ src/heap.cc (working copy)
@@ -2231,6 +2231,10 @@
// If this is a full script wrapped in a function we do no flush the
code.
if (function_info->is_toplevel()) return;
+ // Only allow normal scripts to be flushed, extensions should not be
flushed.
+ Script* script = Script::cast(function_info->script();
+ if (script->type() != Smi::FromInt(Script::TYPE_NORMAL)) return;
+
// If this function is in the compilation cache we do not flush the code.
if (CompilationCache::HasFunction(function_info)) return;
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev