[heap] Fix DCHECK in SetReadAndWritable to allow non-space MemoryChunks.

Bug: chromium:774108,v8:6792
Change-Id: I2bf361cab6da5e57302fb83d384b5f7e8e847c9a
Reviewed-on: https://chromium-review.googlesource.com/738145
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Hannes Payer <hpayer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48972}
This commit is contained in:
Hannes Payer 2017-10-26 14:41:27 +02:00 committed by Commit Bot
parent fdf6c2b134
commit 872accb4df

View File

@ -557,7 +557,10 @@ void MemoryChunk::SetReadAndExecutable() {
void MemoryChunk::SetReadAndWritable() {
DCHECK(IsFlagSet(MemoryChunk::IS_EXECUTABLE));
DCHECK(owner()->identity() == CODE_SPACE || owner()->identity() == LO_SPACE);
// TODO(hpayer): owner() can only be null if we use the MemoryChunk outside
// of spaces. We actually should not do that and we should untangle this.
DCHECK(owner() == nullptr || owner()->identity() == CODE_SPACE ||
owner()->identity() == LO_SPACE);
// Incrementing the write_unprotect_counter_ and changing the page
// protection mode has to be atomic.
base::LockGuard<base::Mutex> guard(page_protection_change_mutex_);