Index: src/gdb-jit.cc |
diff --git a/src/gdb-jit.cc b/src/gdb-jit.cc |
index c8dbf5d67e6a9b2e1fce48ecaf1e51464fe52de0..bf8ac19fb86aa27afc3eb78ddddf50d8d876cd72 100644 |
--- a/src/gdb-jit.cc |
+++ b/src/gdb-jit.cc |
@@ -1445,11 +1445,16 @@ static void AddUnwindInfo(CodeDescription *desc) { |
} |
+Mutex* GDBJITInterface::mutex_ = OS::CreateMutex(); |
+ |
+ |
void GDBJITInterface::AddCode(const char* name, |
Code* code, |
GDBJITInterface::CodeTag tag, |
Script* script) { |
if (!FLAG_gdbjit) return; |
+ |
+ ScopedLock lock(mutex_); |
AssertNoAllocation no_gc; |
HashMap::Entry* e = GetEntries()->Lookup(code, HashForCodeObject(code), true); |
@@ -1518,6 +1523,7 @@ void GDBJITInterface::AddCode(GDBJITInterface::CodeTag tag, Code* code) { |
void GDBJITInterface::RemoveCode(Code* code) { |
if (!FLAG_gdbjit) return; |
+ ScopedLock lock(mutex_); |
HashMap::Entry* e = GetEntries()->Lookup(code, |
HashForCodeObject(code), |
false); |
@@ -1537,6 +1543,7 @@ void GDBJITInterface::RemoveCode(Code* code) { |
void GDBJITInterface::RegisterDetailedLineInfo(Code* code, |
GDBJITLineInfo* line_info) { |
+ ScopedLock lock(mutex_); |
ASSERT(!IsLineInfoTagged(line_info)); |
HashMap::Entry* e = GetEntries()->Lookup(code, HashForCodeObject(code), true); |
ASSERT(e->value == NULL); |