diff options
author | isaacs <i@izs.me> | 2012-10-23 11:48:55 -0700 |
---|---|---|
committer | isaacs <i@izs.me> | 2012-10-23 11:48:55 -0700 |
commit | 95c9305874f2bcfd1df89a583c1f80a60a7fab54 (patch) | |
tree | 1a034a4c03bbe7198f09b71915180a21326cf5de /deps/v8/src/gdb-jit.cc | |
parent | 3570f2097f20e8ab9495995cc117c4fa5dc52ddd (diff) | |
download | android-node-v8-95c9305874f2bcfd1df89a583c1f80a60a7fab54.tar.gz android-node-v8-95c9305874f2bcfd1df89a583c1f80a60a7fab54.tar.bz2 android-node-v8-95c9305874f2bcfd1df89a583c1f80a60a7fab54.zip |
V8: Upgrade to 3.13.7.4
Diffstat (limited to 'deps/v8/src/gdb-jit.cc')
-rw-r--r-- | deps/v8/src/gdb-jit.cc | 128 |
1 files changed, 57 insertions, 71 deletions
diff --git a/deps/v8/src/gdb-jit.cc b/deps/v8/src/gdb-jit.cc index dde6bbdaad..d3cd44707c 100644 --- a/deps/v8/src/gdb-jit.cc +++ b/deps/v8/src/gdb-jit.cc @@ -31,13 +31,11 @@ #include "bootstrapper.h" #include "compiler.h" -#include "frames.h" -#include "frames-inl.h" #include "global-handles.h" #include "messages.h" -#include "natives.h" #include "platform.h" -#include "scopes.h" +#include "natives.h" +#include "scopeinfo.h" namespace v8 { namespace internal { @@ -196,7 +194,7 @@ class DebugSectionBase : public ZoneObject { virtual void WriteBody(Writer::Slot<THeader> header, Writer* writer) { uintptr_t start = writer->position(); - if (WriteBodyInternal(writer)) { + if (WriteBody(writer)) { uintptr_t end = writer->position(); header->offset = start; #if defined(__MACH_O) @@ -206,7 +204,7 @@ class DebugSectionBase : public ZoneObject { } } - virtual bool WriteBodyInternal(Writer* writer) { + virtual bool WriteBody(Writer* writer) { return false; } @@ -342,14 +340,14 @@ class ELFSection : public DebugSectionBase<ELFSectionHeader> { virtual void WriteBody(Writer::Slot<Header> header, Writer* w) { uintptr_t start = w->position(); - if (WriteBodyInternal(w)) { + if (WriteBody(w)) { uintptr_t end = w->position(); header->offset = start; header->size = end - start; } } - virtual bool WriteBodyInternal(Writer* w) { + virtual bool WriteBody(Writer* w) { return false; } @@ -629,9 +627,9 @@ class MachO BASE_EMBEDDED { #if defined(__ELF) class ELF BASE_EMBEDDED { public: - ELF(Zone* zone) : sections_(6, zone) { - sections_.Add(new(zone) ELFSection("", ELFSection::TYPE_NULL, 0), zone); - sections_.Add(new(zone) StringTable(".shstrtab"), zone); + ELF() : sections_(6) { + sections_.Add(new ELFSection("", ELFSection::TYPE_NULL, 0)); + sections_.Add(new StringTable(".shstrtab")); } void Write(Writer* w) { @@ -644,8 +642,8 @@ class ELF BASE_EMBEDDED { return sections_[index]; } - uint32_t AddSection(ELFSection* section, Zone* zone) { - sections_.Add(section, zone); + uint32_t AddSection(ELFSection* section) { + sections_.Add(section); section->set_index(sections_.length() - 1); return sections_.length() - 1; } @@ -677,7 +675,7 @@ class ELF BASE_EMBEDDED { { 0x7f, 'E', 'L', 'F', 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}; #elif defined(V8_TARGET_ARCH_X64) const uint8_t ident[16] = - { 0x7f, 'E', 'L', 'F', 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + { 0x7f, 'E', 'L', 'F', 2, 1, 1, 0, 0, 0 , 0, 0, 0, 0, 0, 0}; #else #error Unsupported target architecture. #endif @@ -854,10 +852,10 @@ class ELFSymbol BASE_EMBEDDED { class ELFSymbolTable : public ELFSection { public: - ELFSymbolTable(const char* name, Zone* zone) + explicit ELFSymbolTable(const char* name) : ELFSection(name, TYPE_SYMTAB, sizeof(uintptr_t)), - locals_(1, zone), - globals_(1, zone) { + locals_(1), + globals_(1) { } virtual void WriteBody(Writer::Slot<Header> header, Writer* w) { @@ -885,11 +883,11 @@ class ELFSymbolTable : public ELFSection { strtab->DetachWriter(); } - void Add(const ELFSymbol& symbol, Zone* zone) { + void Add(const ELFSymbol& symbol) { if (symbol.binding() == ELFSymbol::BIND_LOCAL) { - locals_.Add(symbol, zone); + locals_.Add(symbol); } else { - globals_.Add(symbol, zone); + globals_.Add(symbol); } } @@ -1021,29 +1019,26 @@ class CodeDescription BASE_EMBEDDED { static void CreateSymbolsTable(CodeDescription* desc, ELF* elf, int text_section_index) { - Zone* zone = desc->info()->zone(); - ELFSymbolTable* symtab = new(zone) ELFSymbolTable(".symtab", zone); - StringTable* strtab = new(zone) StringTable(".strtab"); + ELFSymbolTable* symtab = new ELFSymbolTable(".symtab"); + StringTable* strtab = new StringTable(".strtab"); // Symbol table should be followed by the linked string table. - elf->AddSection(symtab, zone); - elf->AddSection(strtab, zone); + elf->AddSection(symtab); + elf->AddSection(strtab); symtab->Add(ELFSymbol("V8 Code", 0, 0, ELFSymbol::BIND_LOCAL, ELFSymbol::TYPE_FILE, - ELFSection::INDEX_ABSOLUTE), - zone); + ELFSection::INDEX_ABSOLUTE)); symtab->Add(ELFSymbol(desc->name(), 0, desc->CodeSize(), ELFSymbol::BIND_GLOBAL, ELFSymbol::TYPE_FUNC, - text_section_index), - zone); + text_section_index)); } #endif // defined(__ELF) @@ -1079,7 +1074,7 @@ class DebugInfoSection : public DebugSection { DW_ATE_SIGNED = 0x5 }; - bool WriteBodyInternal(Writer* w) { + bool WriteBody(Writer* w) { uintptr_t cu_start = w->position(); Writer::Slot<uint32_t> size = w->CreateSlotHere<uint32_t>(); uintptr_t start = w->position(); @@ -1099,7 +1094,8 @@ class DebugInfoSection : public DebugSection { w->WriteString("v8value"); if (desc_->IsInfoAvailable()) { - Scope* scope = desc_->info()->scope(); + CompilationInfo* info = desc_->info(); + ScopeInfo<FreeStoreAllocationPolicy> scope_info(info->scope()); w->WriteULEB128(2); w->WriteString(desc_->name()); w->Write<intptr_t>(desc_->CodeStart()); @@ -1110,27 +1106,23 @@ class DebugInfoSection : public DebugSection { w->Write<uint8_t>(DW_OP_reg5); // The frame pointer's here on ia32 #elif defined(V8_TARGET_ARCH_X64) w->Write<uint8_t>(DW_OP_reg6); // and here on x64. -#elif defined(V8_TARGET_ARCH_ARM) - UNIMPLEMENTED(); -#elif defined(V8_TARGET_ARCH_MIPS) - UNIMPLEMENTED(); #else #error Unsupported target architecture. #endif fb_block_size.set(static_cast<uint32_t>(w->position() - fb_block_start)); - int params = scope->num_parameters(); - int slots = scope->num_stack_slots(); - int context_slots = scope->ContextLocalCount(); + int params = scope_info.number_of_parameters(); + int slots = scope_info.number_of_stack_slots(); + int context_slots = scope_info.number_of_context_slots(); // The real slot ID is internal_slots + context_slot_id. int internal_slots = Context::MIN_CONTEXT_SLOTS; - int locals = scope->StackLocalCount(); + int locals = scope_info.LocalCount(); int current_abbreviation = 4; for (int param = 0; param < params; ++param) { w->WriteULEB128(current_abbreviation++); w->WriteString( - *scope->parameter(param)->name()->ToCString(DISALLOW_NULLS)); + *scope_info.ParameterName(param)->ToCString(DISALLOW_NULLS)); w->Write<uint32_t>(ty_offset); Writer::Slot<uint32_t> block_size = w->CreateSlotHere<uint32_t>(); uintptr_t block_start = w->position(); @@ -1156,7 +1148,7 @@ class DebugInfoSection : public DebugSection { ASSERT(Context::CLOSURE_INDEX == 0); ASSERT(Context::PREVIOUS_INDEX == 1); ASSERT(Context::EXTENSION_INDEX == 2); - ASSERT(Context::GLOBAL_OBJECT_INDEX == 3); + ASSERT(Context::GLOBAL_INDEX == 3); w->WriteULEB128(current_abbreviation++); w->WriteString(".closure"); w->WriteULEB128(current_abbreviation++); @@ -1175,13 +1167,10 @@ class DebugInfoSection : public DebugSection { w->WriteString(builder.Finalize()); } - ZoneList<Variable*> stack_locals(locals, scope->zone()); - ZoneList<Variable*> context_locals(context_slots, scope->zone()); - scope->CollectStackAndContextLocals(&stack_locals, &context_locals); for (int local = 0; local < locals; ++local) { w->WriteULEB128(current_abbreviation++); w->WriteString( - *stack_locals[local]->name()->ToCString(DISALLOW_NULLS)); + *scope_info.LocalName(local)->ToCString(DISALLOW_NULLS)); w->Write<uint32_t>(ty_offset); Writer::Slot<uint32_t> block_size = w->CreateSlotHere<uint32_t>(); uintptr_t block_start = w->position(); @@ -1298,7 +1287,7 @@ class DebugAbbrevSection : public DebugSection { w->WriteULEB128(0); } - bool WriteBodyInternal(Writer* w) { + bool WriteBody(Writer* w) { int current_abbreviation = 1; bool extra_info = desc_->IsInfoAvailable(); ASSERT(desc_->IsLineInfoAvailable()); @@ -1317,13 +1306,14 @@ class DebugAbbrevSection : public DebugSection { w->WriteULEB128(0); if (extra_info) { - Scope* scope = desc_->info()->scope(); - int params = scope->num_parameters(); - int slots = scope->num_stack_slots(); - int context_slots = scope->ContextLocalCount(); + CompilationInfo* info = desc_->info(); + ScopeInfo<FreeStoreAllocationPolicy> scope_info(info->scope()); + int params = scope_info.number_of_parameters(); + int slots = scope_info.number_of_stack_slots(); + int context_slots = scope_info.number_of_context_slots(); // The real slot ID is internal_slots + context_slot_id. int internal_slots = Context::MIN_CONTEXT_SLOTS; - int locals = scope->StackLocalCount(); + int locals = scope_info.LocalCount(); int total_children = params + slots + context_slots + internal_slots + locals + 2; @@ -1428,7 +1418,7 @@ class DebugLineSection : public DebugSection { DW_LNE_DEFINE_FILE = 3 }; - bool WriteBodyInternal(Writer* w) { + bool WriteBody(Writer* w) { // Write prologue. Writer::Slot<uint32_t> total_length = w->CreateSlotHere<uint32_t>(); uintptr_t start = w->position(); @@ -1568,7 +1558,7 @@ class DebugLineSection : public DebugSection { class UnwindInfoSection : public DebugSection { public: explicit UnwindInfoSection(CodeDescription* desc); - virtual bool WriteBodyInternal(Writer* w); + virtual bool WriteBody(Writer* w); int WriteCIE(Writer* w); void WriteFDE(Writer* w, int); @@ -1780,7 +1770,7 @@ void UnwindInfoSection::WriteFDEStateAfterRBPPop(Writer* w) { } -bool UnwindInfoSection::WriteBodyInternal(Writer* w) { +bool UnwindInfoSection::WriteBody(Writer* w) { uint32_t cie_position = WriteCIE(w); WriteFDE(w, cie_position); return true; @@ -1790,14 +1780,13 @@ bool UnwindInfoSection::WriteBodyInternal(Writer* w) { #endif // V8_TARGET_ARCH_X64 static void CreateDWARFSections(CodeDescription* desc, DebugObject* obj) { - Zone* zone = desc->info()->zone(); 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 DebugInfoSection(desc)); + obj->AddSection(new DebugAbbrevSection(desc)); + obj->AddSection(new DebugLineSection(desc)); } #ifdef V8_TARGET_ARCH_X64 - obj->AddSection(new(zone) UnwindInfoSection(desc), zone); + obj->AddSection(new UnwindInfoSection(desc)); #endif } @@ -1916,8 +1905,7 @@ static void UnregisterCodeEntry(JITCodeEntry* entry) { static JITCodeEntry* CreateELFObject(CodeDescription* desc) { - Zone* zone = desc->info()->zone(); - ZoneScope zone_scope(zone, DELETE_ON_EXIT); + ZoneScope zone_scope(Isolate::Current(), DELETE_ON_EXIT); #ifdef __MACH_O MachO mach_o; Writer w(&mach_o); @@ -1930,19 +1918,17 @@ static JITCodeEntry* CreateELFObject(CodeDescription* desc) { mach_o.Write(&w, desc->CodeStart(), desc->CodeSize()); #else - ELF elf(zone); + ELF elf; Writer w(&elf); int text_section_index = elf.AddSection( - new(zone) FullHeaderELFSection( - ".text", - ELFSection::TYPE_NOBITS, - kCodeAlignment, - desc->CodeStart(), - 0, - desc->CodeSize(), - ELFSection::FLAG_ALLOC | ELFSection::FLAG_EXEC), - zone); + new FullHeaderELFSection(".text", + ELFSection::TYPE_NOBITS, + kCodeAlignment, + desc->CodeStart(), + 0, + desc->CodeSize(), + ELFSection::FLAG_ALLOC | ELFSection::FLAG_EXEC)); CreateSymbolsTable(desc, &elf, text_section_index); |