Index: src/gdb-jit.cc |
diff --git a/src/gdb-jit.cc b/src/gdb-jit.cc |
index 4192222f90e426d99cb8524279613123eda5b90a..d3cd44707c59150aaf261e519abb792b43d64f54 100644 |
--- a/src/gdb-jit.cc |
+++ b/src/gdb-jit.cc |
@@ -33,6 +33,7 @@ |
#include "compiler.h" |
#include "global-handles.h" |
#include "messages.h" |
+#include "platform.h" |
#include "natives.h" |
#include "scopeinfo.h" |
@@ -2035,7 +2036,7 @@ static void AddUnwindInfo(CodeDescription* desc) { |
} |
-Mutex* GDBJITInterface::mutex_ = OS::CreateMutex(); |
+static LazyMutex mutex = LAZY_MUTEX_INITIALIZER; |
void GDBJITInterface::AddCode(const char* name, |
@@ -2045,7 +2046,7 @@ void GDBJITInterface::AddCode(const char* name, |
CompilationInfo* info) { |
if (!FLAG_gdbjit) return; |
- ScopedLock lock(mutex_); |
+ ScopedLock lock(mutex.Pointer()); |
AssertNoAllocation no_gc; |
HashMap::Entry* e = GetEntries()->Lookup(code, HashForCodeObject(code), true); |
@@ -2126,7 +2127,7 @@ void GDBJITInterface::AddCode(GDBJITInterface::CodeTag tag, Code* code) { |
void GDBJITInterface::RemoveCode(Code* code) { |
if (!FLAG_gdbjit) return; |
- ScopedLock lock(mutex_); |
+ ScopedLock lock(mutex.Pointer()); |
HashMap::Entry* e = GetEntries()->Lookup(code, |
HashForCodeObject(code), |
false); |
@@ -2146,7 +2147,7 @@ void GDBJITInterface::RemoveCode(Code* code) { |
void GDBJITInterface::RegisterDetailedLineInfo(Code* code, |
GDBJITLineInfo* line_info) { |
- ScopedLock lock(mutex_); |
+ ScopedLock lock(mutex.Pointer()); |
ASSERT(!IsLineInfoTagged(line_info)); |
HashMap::Entry* e = GetEntries()->Lookup(code, HashForCodeObject(code), true); |
ASSERT(e->value == NULL); |