From: yangguo@chromium.org Date: Tue, 25 Mar 2014 09:38:48 +0000 (+0000) Subject: Fix issues when changing FLAG_concurrent_recompilation after init. X-Git-Tag: upstream/4.7.83~10030 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=793d4cb0b676b489f27a4277674547859baa1e01;p=platform%2Fupstream%2Fv8.git Fix issues when changing FLAG_concurrent_recompilation after init. R=jarin@chromium.org BUG=356053 LOG=N Review URL: https://codereview.chromium.org/210363005 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20228 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/heap.cc b/src/heap.cc index 16b21ea..e3f3f75 100644 --- a/src/heap.cc +++ b/src/heap.cc @@ -154,7 +154,6 @@ Heap::Heap() configured_(false), external_string_table_(this), chunks_queued_for_free_(NULL), - relocation_mutex_(NULL), gc_callbacks_depth_(0) { // Allow build-time customization of the max semispace size. Building // V8 with snapshots and a non-default max semispace size is much @@ -6595,8 +6594,6 @@ bool Heap::SetUp() { mark_compact_collector()->SetUp(); - if (FLAG_concurrent_recompilation) relocation_mutex_ = new Mutex; - return true; } @@ -6738,9 +6735,6 @@ void Heap::TearDown() { incremental_marking()->TearDown(); isolate_->memory_allocator()->TearDown(); - - delete relocation_mutex_; - relocation_mutex_ = NULL; } diff --git a/src/heap.h b/src/heap.h index f6cd3eb..931972b 100644 --- a/src/heap.h +++ b/src/heap.h @@ -1906,16 +1906,12 @@ class Heap { class RelocationLock { public: explicit RelocationLock(Heap* heap) : heap_(heap) { - if (FLAG_concurrent_recompilation) { - heap_->relocation_mutex_->Lock(); - } + heap_->relocation_mutex_.Lock(); } ~RelocationLock() { - if (FLAG_concurrent_recompilation) { - heap_->relocation_mutex_->Unlock(); - } + heap_->relocation_mutex_.Unlock(); } private: @@ -2518,7 +2514,7 @@ class Heap { MemoryChunk* chunks_queued_for_free_; - Mutex* relocation_mutex_; + Mutex relocation_mutex_; int gc_callbacks_depth_; diff --git a/src/runtime.cc b/src/runtime.cc index d7eada1..4309dbd 100644 --- a/src/runtime.cc +++ b/src/runtime.cc @@ -8701,6 +8701,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetOptimizationStatus) { RUNTIME_FUNCTION(MaybeObject*, Runtime_UnblockConcurrentRecompilation) { RUNTIME_ASSERT(FLAG_block_concurrent_recompilation); + RUNTIME_ASSERT(isolate->concurrent_recompilation_enabled()); isolate->optimizing_compiler_thread()->Unblock(); return isolate->heap()->undefined_value(); } diff --git a/test/mjsunit/regress/regress-356053.js b/test/mjsunit/regress/regress-356053.js new file mode 100644 index 0000000..8f0dbdd --- /dev/null +++ b/test/mjsunit/regress/regress-356053.js @@ -0,0 +1,9 @@ +// Copyright 2014 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Flags: --noconcurrent-recompilation --expose-gc --allow-natives-syntax + +%SetFlags("--concurrent-recompilation --block-concurrent-recompilation"); +gc(); +try { %UnblockConcurrentRecompilation(); } catch (e) { }