Index: src/gdb-jit.cc |
diff --git a/src/gdb-jit.cc b/src/gdb-jit.cc |
index d08f2fe41862dda46f6107e9e2eecd576a3a7cc4..fce98b0fa40ca1fa2939a023d47767b8aa256206 100644 |
--- a/src/gdb-jit.cc |
+++ b/src/gdb-jit.cc |
@@ -500,10 +500,10 @@ void ELFSection::PopulateHeader(Writer::Slot<ELFSection::Header> header, |
#if defined(__MACH_O) |
class MachO BASE_EMBEDDED { |
public: |
- MachO() : sections_(6) { } |
+ explicit MachO(Zone* zone) : zone_(zone), sections_(6, zone) { } |
uint32_t AddSection(MachOSection* section) { |
- sections_.Add(section); |
+ sections_.Add(section, zone_); |
return sections_.length() - 1; |
} |
@@ -620,7 +620,7 @@ class MachO BASE_EMBEDDED { |
cmd->filesize = w->position() - (uintptr_t)cmd->fileoff; |
} |
- |
+ Zone* zone_; |
ZoneList<MachOSection*> sections_; |
}; |
#endif // defined(__MACH_O) |
@@ -1793,9 +1793,9 @@ static void CreateDWARFSections(CodeDescription* desc, |
Zone* zone, |
DebugObject* obj) { |
if (desc->IsLineInfoAvailable()) { |
- obj->AddSection(new(zone) DebugInfoSection(desc), zone); |
- obj->AddSection(new(zone) DebugAbbrevSection(desc), zone); |
- obj->AddSection(new(zone) DebugLineSection(desc), zone); |
+ obj->AddSection(new(zone) DebugInfoSection(desc)); |
+ obj->AddSection(new(zone) DebugAbbrevSection(desc)); |
+ obj->AddSection(new(zone) DebugLineSection(desc)); |
} |
#ifdef V8_TARGET_ARCH_X64 |
obj->AddSection(new(zone) UnwindInfoSection(desc), zone); |
@@ -1919,14 +1919,14 @@ static void UnregisterCodeEntry(JITCodeEntry* entry) { |
static JITCodeEntry* CreateELFObject(CodeDescription* desc, Zone* zone) { |
ZoneScope zone_scope(zone, DELETE_ON_EXIT); |
#ifdef __MACH_O |
- MachO mach_o; |
+ MachO mach_o(zone); |
Writer w(&mach_o); |
- mach_o.AddSection(new MachOTextSection(kCodeAlignment, |
- desc->CodeStart(), |
- desc->CodeSize())); |
+ mach_o.AddSection(new(zone) MachOTextSection(kCodeAlignment, |
+ desc->CodeStart(), |
+ desc->CodeSize())); |
- CreateDWARFSections(desc, &mach_o); |
+ CreateDWARFSections(desc, zone, &mach_o); |
mach_o.Write(&w, desc->CodeStart(), desc->CodeSize()); |
#else |
@@ -2062,7 +2062,7 @@ void GDBJITInterface::AddCode(const char* name, |
if (!FLAG_gdbjit) return; |
ScopedLock lock(mutex.Pointer()); |
- AssertNoAllocation no_gc; |
+ DisallowHeapAllocation no_gc; |
HashMap::Entry* e = GetEntries()->Lookup(code, HashForCodeObject(code), true); |
if (e->value != NULL && !IsLineInfoTagged(e->value)) return; |