Commit 793d4cb0 authored by yangguo@chromium.org's avatar yangguo@chromium.org

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
parent 1ad4e2cc
...@@ -154,7 +154,6 @@ Heap::Heap() ...@@ -154,7 +154,6 @@ Heap::Heap()
configured_(false), configured_(false),
external_string_table_(this), external_string_table_(this),
chunks_queued_for_free_(NULL), chunks_queued_for_free_(NULL),
relocation_mutex_(NULL),
gc_callbacks_depth_(0) { gc_callbacks_depth_(0) {
// Allow build-time customization of the max semispace size. Building // Allow build-time customization of the max semispace size. Building
// V8 with snapshots and a non-default max semispace size is much // V8 with snapshots and a non-default max semispace size is much
...@@ -6595,8 +6594,6 @@ bool Heap::SetUp() { ...@@ -6595,8 +6594,6 @@ bool Heap::SetUp() {
mark_compact_collector()->SetUp(); mark_compact_collector()->SetUp();
if (FLAG_concurrent_recompilation) relocation_mutex_ = new Mutex;
return true; return true;
} }
...@@ -6738,9 +6735,6 @@ void Heap::TearDown() { ...@@ -6738,9 +6735,6 @@ void Heap::TearDown() {
incremental_marking()->TearDown(); incremental_marking()->TearDown();
isolate_->memory_allocator()->TearDown(); isolate_->memory_allocator()->TearDown();
delete relocation_mutex_;
relocation_mutex_ = NULL;
} }
......
...@@ -1906,16 +1906,12 @@ class Heap { ...@@ -1906,16 +1906,12 @@ class Heap {
class RelocationLock { class RelocationLock {
public: public:
explicit RelocationLock(Heap* heap) : heap_(heap) { explicit RelocationLock(Heap* heap) : heap_(heap) {
if (FLAG_concurrent_recompilation) { heap_->relocation_mutex_.Lock();
heap_->relocation_mutex_->Lock();
}
} }
~RelocationLock() { ~RelocationLock() {
if (FLAG_concurrent_recompilation) { heap_->relocation_mutex_.Unlock();
heap_->relocation_mutex_->Unlock();
}
} }
private: private:
...@@ -2518,7 +2514,7 @@ class Heap { ...@@ -2518,7 +2514,7 @@ class Heap {
MemoryChunk* chunks_queued_for_free_; MemoryChunk* chunks_queued_for_free_;
Mutex* relocation_mutex_; Mutex relocation_mutex_;
int gc_callbacks_depth_; int gc_callbacks_depth_;
......
...@@ -8701,6 +8701,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetOptimizationStatus) { ...@@ -8701,6 +8701,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetOptimizationStatus) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_UnblockConcurrentRecompilation) { RUNTIME_FUNCTION(MaybeObject*, Runtime_UnblockConcurrentRecompilation) {
RUNTIME_ASSERT(FLAG_block_concurrent_recompilation); RUNTIME_ASSERT(FLAG_block_concurrent_recompilation);
RUNTIME_ASSERT(isolate->concurrent_recompilation_enabled());
isolate->optimizing_compiler_thread()->Unblock(); isolate->optimizing_compiler_thread()->Unblock();
return isolate->heap()->undefined_value(); return isolate->heap()->undefined_value();
} }
......
// 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) { }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment