Reviewers: Hannes Payer,
Description:
Put preservation of optimized code map behind a flag.
[email protected]
Please review this at https://codereview.chromium.org/15119004/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/flag-definitions.h
M src/objects-visiting-inl.h
Index: src/flag-definitions.h
diff --git a/src/flag-definitions.h b/src/flag-definitions.h
index
98f1d1206429da55fe2524a6d5bf7944e63792c9..5c7c6460074c424cb0f62716eb3009abd93b8ec9
100644
--- a/src/flag-definitions.h
+++ b/src/flag-definitions.h
@@ -268,6 +268,8 @@ DEFINE_bool(lookup_sample_by_shared, true,
"info, not JSFunction itself")
DEFINE_bool(cache_optimized_code, true,
"cache optimized code for closures")
+DEFINE_bool(flush_optimized_code_cache, true,
+ "flushes the cache of optimized code for closures on every GC")
DEFINE_bool(inline_construct, true, "inline constructor calls")
DEFINE_bool(inline_arguments, true, "inline functions with arguments
object")
DEFINE_bool(inline_accessors, true, "inline JavaScript accessors")
Index: src/objects-visiting-inl.h
diff --git a/src/objects-visiting-inl.h b/src/objects-visiting-inl.h
index
d0a70c3fbf4d921422e9215605511738439e05c1..f83f00fd5d139574a9ccc2a3ab9ae09456794f0d
100644
--- a/src/objects-visiting-inl.h
+++ b/src/objects-visiting-inl.h
@@ -311,6 +311,12 @@ void
StaticMarkingVisitor<StaticVisitor>::VisitSharedFunctionInfo(
if (shared->ic_age() != heap->global_ic_age()) {
shared->ResetForNewContext(heap->global_ic_age());
}
+ if (FLAG_cache_optimized_code &&
+ FLAG_flush_optimized_code_cache &&
+ !shared->optimized_code_map()->IsSmi()) {
+ // Always flush the optimized code map if requested by flag.
+ shared->ClearOptimizedCodeMap();
+ }
MarkCompactCollector* collector = heap->mark_compact_collector();
if (collector->is_code_flushing_enabled()) {
if (FLAG_cache_optimized_code
&& !shared->optimized_code_map()->IsSmi()) {
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.