Reviewers: Hannes Payer,

Description:
Fix bug when optimized code map is evicted.

This makes sure that both, the shared function info and it's optimized
code map get revisited when the code map is evicted from the flusher.
It also turns preservation of optimized code maps on again.

[email protected]
TEST=mjsunit/debug-set-variable-value

Please review this at https://codereview.chromium.org/14703009/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/flag-definitions.h
  M src/mark-compact.cc


Index: src/flag-definitions.h
diff --git a/src/flag-definitions.h b/src/flag-definitions.h
index 5c7c6460074c424cb0f62716eb3009abd93b8ec9..4004c0d2c2d5f131f667e8a7b5fe715dbbde06f9 100644
--- a/src/flag-definitions.h
+++ b/src/flag-definitions.h
@@ -268,7 +268,7 @@ 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,
+DEFINE_bool(flush_optimized_code_cache, false,
             "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")
Index: src/mark-compact.cc
diff --git a/src/mark-compact.cc b/src/mark-compact.cc
index 29d86161819a5ec8aad048c52ebcd7fc3a5fcf4a..a44450e2952b58e9275a568cfe79d18862b03cec 100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -1177,10 +1177,12 @@ void CodeFlusher::EvictCandidate(JSFunction* function) {


void CodeFlusher::EvictOptimizedCodeMap(SharedFunctionInfo* code_map_holder) {
-  ASSERT(!FixedArray::cast(code_map_holder->optimized_code_map())->
-         get(SharedFunctionInfo::kNextMapIndex)->IsUndefined());
+  FixedArray* code_map =
+      FixedArray::cast(code_map_holder->optimized_code_map());
+  ASSERT(!code_map->get(SharedFunctionInfo::kNextMapIndex)->IsUndefined());

   // Make sure previous flushing decisions are revisited.
+  isolate_->heap()->incremental_marking()->RecordWrites(code_map);
   isolate_->heap()->incremental_marking()->RecordWrites(code_map_holder);

   SharedFunctionInfo* holder = optimized_code_map_holder_head_;


--
--
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.


Reply via email to