Skip to content

Commit 95c9305

Browse files
committed
V8: Upgrade to 3.13.7.4
1 parent 3570f20 commit 95c9305

21 files changed

+301
-135
lines changed

deps/v8/build/common.gypi

+7-2
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
[ 'v8_use_arm_eabi_hardfloat=="true"', {
153153
'defines': [
154154
'USE_EABI_HARDFLOAT=1',
155-
'CAN_USE_VFP_INSTRUCTIONS',
155+
'CAN_USE_VFP3_INSTRUCTIONS',
156156
],
157157
'target_conditions': [
158158
['_toolset=="target"', {
@@ -259,6 +259,7 @@
259259
'WIN32',
260260
],
261261
'msvs_configuration_attributes': {
262+
'OutputDirectory': '<(DEPTH)\\build\\$(ConfigurationName)',
262263
'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
263264
'CharacterSet': '1',
264265
},
@@ -343,7 +344,7 @@
343344
},
344345
'conditions': [
345346
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd"', {
346-
'cflags': [ '-Wno-unused-parameter',
347+
'cflags': [ '-Wall', '<(werror)', '-W', '-Wno-unused-parameter',
347348
'-Wnon-virtual-dtor', '-Woverloaded-virtual' ],
348349
}],
349350
['OS=="android"', {
@@ -366,6 +367,10 @@
366367
'conditions': [
367368
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" \
368369
or OS=="android"', {
370+
'cflags!': [
371+
'-O2',
372+
'-Os',
373+
],
369374
'cflags': [
370375
'-fdata-sections',
371376
'-ffunction-sections',

deps/v8/src/compiler.cc

+7-3
Original file line numberDiff line numberDiff line change
@@ -746,8 +746,10 @@ static void InstallCodeCommon(CompilationInfo* info) {
746746

747747
static void InsertCodeIntoOptimizedCodeMap(CompilationInfo* info) {
748748
Handle<Code> code = info->code();
749-
Handle<JSFunction> function = info->closure();
750-
if (FLAG_cache_optimized_code && code->kind() == Code::OPTIMIZED_FUNCTION) {
749+
if (FLAG_cache_optimized_code &&
750+
info->osr_ast_id().IsNone() &&
751+
code->kind() == Code::OPTIMIZED_FUNCTION) {
752+
Handle<JSFunction> function = info->closure();
751753
Handle<SharedFunctionInfo> shared(function->shared());
752754
Handle<FixedArray> literals(function->literals());
753755
Handle<Context> native_context(function->context()->native_context());
@@ -758,7 +760,9 @@ static void InsertCodeIntoOptimizedCodeMap(CompilationInfo* info) {
758760

759761

760762
static bool InstallCodeFromOptimizedCodeMap(CompilationInfo* info) {
761-
if (FLAG_cache_optimized_code && info->IsOptimizing()) {
763+
if (FLAG_cache_optimized_code &&
764+
info->osr_ast_id().IsNone() &&
765+
info->IsOptimizing()) {
762766
Handle<SharedFunctionInfo> shared = info->shared_info();
763767
Handle<JSFunction> function = info->closure();
764768
ASSERT(!function.is_null());

deps/v8/src/gdb-jit.cc

+57-71
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,11 @@
3131

3232
#include "bootstrapper.h"
3333
#include "compiler.h"
34-
#include "frames.h"
35-
#include "frames-inl.h"
3634
#include "global-handles.h"
3735
#include "messages.h"
38-
#include "natives.h"
3936
#include "platform.h"
40-
#include "scopes.h"
37+
#include "natives.h"
38+
#include "scopeinfo.h"
4139

4240
namespace v8 {
4341
namespace internal {
@@ -196,7 +194,7 @@ class DebugSectionBase : public ZoneObject {
196194

197195
virtual void WriteBody(Writer::Slot<THeader> header, Writer* writer) {
198196
uintptr_t start = writer->position();
199-
if (WriteBodyInternal(writer)) {
197+
if (WriteBody(writer)) {
200198
uintptr_t end = writer->position();
201199
header->offset = start;
202200
#if defined(__MACH_O)
@@ -206,7 +204,7 @@ class DebugSectionBase : public ZoneObject {
206204
}
207205
}
208206

209-
virtual bool WriteBodyInternal(Writer* writer) {
207+
virtual bool WriteBody(Writer* writer) {
210208
return false;
211209
}
212210

@@ -342,14 +340,14 @@ class ELFSection : public DebugSectionBase<ELFSectionHeader> {
342340

343341
virtual void WriteBody(Writer::Slot<Header> header, Writer* w) {
344342
uintptr_t start = w->position();
345-
if (WriteBodyInternal(w)) {
343+
if (WriteBody(w)) {
346344
uintptr_t end = w->position();
347345
header->offset = start;
348346
header->size = end - start;
349347
}
350348
}
351349

352-
virtual bool WriteBodyInternal(Writer* w) {
350+
virtual bool WriteBody(Writer* w) {
353351
return false;
354352
}
355353

@@ -629,9 +627,9 @@ class MachO BASE_EMBEDDED {
629627
#if defined(__ELF)
630628
class ELF BASE_EMBEDDED {
631629
public:
632-
ELF(Zone* zone) : sections_(6, zone) {
633-
sections_.Add(new(zone) ELFSection("", ELFSection::TYPE_NULL, 0), zone);
634-
sections_.Add(new(zone) StringTable(".shstrtab"), zone);
630+
ELF() : sections_(6) {
631+
sections_.Add(new ELFSection("", ELFSection::TYPE_NULL, 0));
632+
sections_.Add(new StringTable(".shstrtab"));
635633
}
636634

637635
void Write(Writer* w) {
@@ -644,8 +642,8 @@ class ELF BASE_EMBEDDED {
644642
return sections_[index];
645643
}
646644

647-
uint32_t AddSection(ELFSection* section, Zone* zone) {
648-
sections_.Add(section, zone);
645+
uint32_t AddSection(ELFSection* section) {
646+
sections_.Add(section);
649647
section->set_index(sections_.length() - 1);
650648
return sections_.length() - 1;
651649
}
@@ -677,7 +675,7 @@ class ELF BASE_EMBEDDED {
677675
{ 0x7f, 'E', 'L', 'F', 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0};
678676
#elif defined(V8_TARGET_ARCH_X64)
679677
const uint8_t ident[16] =
680-
{ 0x7f, 'E', 'L', 'F', 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0};
678+
{ 0x7f, 'E', 'L', 'F', 2, 1, 1, 0, 0, 0 , 0, 0, 0, 0, 0, 0};
681679
#else
682680
#error Unsupported target architecture.
683681
#endif
@@ -854,10 +852,10 @@ class ELFSymbol BASE_EMBEDDED {
854852

855853
class ELFSymbolTable : public ELFSection {
856854
public:
857-
ELFSymbolTable(const char* name, Zone* zone)
855+
explicit ELFSymbolTable(const char* name)
858856
: ELFSection(name, TYPE_SYMTAB, sizeof(uintptr_t)),
859-
locals_(1, zone),
860-
globals_(1, zone) {
857+
locals_(1),
858+
globals_(1) {
861859
}
862860

863861
virtual void WriteBody(Writer::Slot<Header> header, Writer* w) {
@@ -885,11 +883,11 @@ class ELFSymbolTable : public ELFSection {
885883
strtab->DetachWriter();
886884
}
887885

888-
void Add(const ELFSymbol& symbol, Zone* zone) {
886+
void Add(const ELFSymbol& symbol) {
889887
if (symbol.binding() == ELFSymbol::BIND_LOCAL) {
890-
locals_.Add(symbol, zone);
888+
locals_.Add(symbol);
891889
} else {
892-
globals_.Add(symbol, zone);
890+
globals_.Add(symbol);
893891
}
894892
}
895893

@@ -1021,29 +1019,26 @@ class CodeDescription BASE_EMBEDDED {
10211019
static void CreateSymbolsTable(CodeDescription* desc,
10221020
ELF* elf,
10231021
int text_section_index) {
1024-
Zone* zone = desc->info()->zone();
1025-
ELFSymbolTable* symtab = new(zone) ELFSymbolTable(".symtab", zone);
1026-
StringTable* strtab = new(zone) StringTable(".strtab");
1022+
ELFSymbolTable* symtab = new ELFSymbolTable(".symtab");
1023+
StringTable* strtab = new StringTable(".strtab");
10271024

10281025
// Symbol table should be followed by the linked string table.
1029-
elf->AddSection(symtab, zone);
1030-
elf->AddSection(strtab, zone);
1026+
elf->AddSection(symtab);
1027+
elf->AddSection(strtab);
10311028

10321029
symtab->Add(ELFSymbol("V8 Code",
10331030
0,
10341031
0,
10351032
ELFSymbol::BIND_LOCAL,
10361033
ELFSymbol::TYPE_FILE,
1037-
ELFSection::INDEX_ABSOLUTE),
1038-
zone);
1034+
ELFSection::INDEX_ABSOLUTE));
10391035

10401036
symtab->Add(ELFSymbol(desc->name(),
10411037
0,
10421038
desc->CodeSize(),
10431039
ELFSymbol::BIND_GLOBAL,
10441040
ELFSymbol::TYPE_FUNC,
1045-
text_section_index),
1046-
zone);
1041+
text_section_index));
10471042
}
10481043
#endif // defined(__ELF)
10491044

@@ -1079,7 +1074,7 @@ class DebugInfoSection : public DebugSection {
10791074
DW_ATE_SIGNED = 0x5
10801075
};
10811076

1082-
bool WriteBodyInternal(Writer* w) {
1077+
bool WriteBody(Writer* w) {
10831078
uintptr_t cu_start = w->position();
10841079
Writer::Slot<uint32_t> size = w->CreateSlotHere<uint32_t>();
10851080
uintptr_t start = w->position();
@@ -1099,7 +1094,8 @@ class DebugInfoSection : public DebugSection {
10991094
w->WriteString("v8value");
11001095

11011096
if (desc_->IsInfoAvailable()) {
1102-
Scope* scope = desc_->info()->scope();
1097+
CompilationInfo* info = desc_->info();
1098+
ScopeInfo<FreeStoreAllocationPolicy> scope_info(info->scope());
11031099
w->WriteULEB128(2);
11041100
w->WriteString(desc_->name());
11051101
w->Write<intptr_t>(desc_->CodeStart());
@@ -1110,27 +1106,23 @@ class DebugInfoSection : public DebugSection {
11101106
w->Write<uint8_t>(DW_OP_reg5); // The frame pointer's here on ia32
11111107
#elif defined(V8_TARGET_ARCH_X64)
11121108
w->Write<uint8_t>(DW_OP_reg6); // and here on x64.
1113-
#elif defined(V8_TARGET_ARCH_ARM)
1114-
UNIMPLEMENTED();
1115-
#elif defined(V8_TARGET_ARCH_MIPS)
1116-
UNIMPLEMENTED();
11171109
#else
11181110
#error Unsupported target architecture.
11191111
#endif
11201112
fb_block_size.set(static_cast<uint32_t>(w->position() - fb_block_start));
11211113

1122-
int params = scope->num_parameters();
1123-
int slots = scope->num_stack_slots();
1124-
int context_slots = scope->ContextLocalCount();
1114+
int params = scope_info.number_of_parameters();
1115+
int slots = scope_info.number_of_stack_slots();
1116+
int context_slots = scope_info.number_of_context_slots();
11251117
// The real slot ID is internal_slots + context_slot_id.
11261118
int internal_slots = Context::MIN_CONTEXT_SLOTS;
1127-
int locals = scope->StackLocalCount();
1119+
int locals = scope_info.LocalCount();
11281120
int current_abbreviation = 4;
11291121

11301122
for (int param = 0; param < params; ++param) {
11311123
w->WriteULEB128(current_abbreviation++);
11321124
w->WriteString(
1133-
*scope->parameter(param)->name()->ToCString(DISALLOW_NULLS));
1125+
*scope_info.ParameterName(param)->ToCString(DISALLOW_NULLS));
11341126
w->Write<uint32_t>(ty_offset);
11351127
Writer::Slot<uint32_t> block_size = w->CreateSlotHere<uint32_t>();
11361128
uintptr_t block_start = w->position();
@@ -1156,7 +1148,7 @@ class DebugInfoSection : public DebugSection {
11561148
ASSERT(Context::CLOSURE_INDEX == 0);
11571149
ASSERT(Context::PREVIOUS_INDEX == 1);
11581150
ASSERT(Context::EXTENSION_INDEX == 2);
1159-
ASSERT(Context::GLOBAL_OBJECT_INDEX == 3);
1151+
ASSERT(Context::GLOBAL_INDEX == 3);
11601152
w->WriteULEB128(current_abbreviation++);
11611153
w->WriteString(".closure");
11621154
w->WriteULEB128(current_abbreviation++);
@@ -1175,13 +1167,10 @@ class DebugInfoSection : public DebugSection {
11751167
w->WriteString(builder.Finalize());
11761168
}
11771169

1178-
ZoneList<Variable*> stack_locals(locals, scope->zone());
1179-
ZoneList<Variable*> context_locals(context_slots, scope->zone());
1180-
scope->CollectStackAndContextLocals(&stack_locals, &context_locals);
11811170
for (int local = 0; local < locals; ++local) {
11821171
w->WriteULEB128(current_abbreviation++);
11831172
w->WriteString(
1184-
*stack_locals[local]->name()->ToCString(DISALLOW_NULLS));
1173+
*scope_info.LocalName(local)->ToCString(DISALLOW_NULLS));
11851174
w->Write<uint32_t>(ty_offset);
11861175
Writer::Slot<uint32_t> block_size = w->CreateSlotHere<uint32_t>();
11871176
uintptr_t block_start = w->position();
@@ -1298,7 +1287,7 @@ class DebugAbbrevSection : public DebugSection {
12981287
w->WriteULEB128(0);
12991288
}
13001289

1301-
bool WriteBodyInternal(Writer* w) {
1290+
bool WriteBody(Writer* w) {
13021291
int current_abbreviation = 1;
13031292
bool extra_info = desc_->IsInfoAvailable();
13041293
ASSERT(desc_->IsLineInfoAvailable());
@@ -1317,13 +1306,14 @@ class DebugAbbrevSection : public DebugSection {
13171306
w->WriteULEB128(0);
13181307

13191308
if (extra_info) {
1320-
Scope* scope = desc_->info()->scope();
1321-
int params = scope->num_parameters();
1322-
int slots = scope->num_stack_slots();
1323-
int context_slots = scope->ContextLocalCount();
1309+
CompilationInfo* info = desc_->info();
1310+
ScopeInfo<FreeStoreAllocationPolicy> scope_info(info->scope());
1311+
int params = scope_info.number_of_parameters();
1312+
int slots = scope_info.number_of_stack_slots();
1313+
int context_slots = scope_info.number_of_context_slots();
13241314
// The real slot ID is internal_slots + context_slot_id.
13251315
int internal_slots = Context::MIN_CONTEXT_SLOTS;
1326-
int locals = scope->StackLocalCount();
1316+
int locals = scope_info.LocalCount();
13271317
int total_children =
13281318
params + slots + context_slots + internal_slots + locals + 2;
13291319

@@ -1428,7 +1418,7 @@ class DebugLineSection : public DebugSection {
14281418
DW_LNE_DEFINE_FILE = 3
14291419
};
14301420

1431-
bool WriteBodyInternal(Writer* w) {
1421+
bool WriteBody(Writer* w) {
14321422
// Write prologue.
14331423
Writer::Slot<uint32_t> total_length = w->CreateSlotHere<uint32_t>();
14341424
uintptr_t start = w->position();
@@ -1568,7 +1558,7 @@ class DebugLineSection : public DebugSection {
15681558
class UnwindInfoSection : public DebugSection {
15691559
public:
15701560
explicit UnwindInfoSection(CodeDescription* desc);
1571-
virtual bool WriteBodyInternal(Writer* w);
1561+
virtual bool WriteBody(Writer* w);
15721562

15731563
int WriteCIE(Writer* w);
15741564
void WriteFDE(Writer* w, int);
@@ -1780,7 +1770,7 @@ void UnwindInfoSection::WriteFDEStateAfterRBPPop(Writer* w) {
17801770
}
17811771

17821772

1783-
bool UnwindInfoSection::WriteBodyInternal(Writer* w) {
1773+
bool UnwindInfoSection::WriteBody(Writer* w) {
17841774
uint32_t cie_position = WriteCIE(w);
17851775
WriteFDE(w, cie_position);
17861776
return true;
@@ -1790,14 +1780,13 @@ bool UnwindInfoSection::WriteBodyInternal(Writer* w) {
17901780
#endif // V8_TARGET_ARCH_X64
17911781

17921782
static void CreateDWARFSections(CodeDescription* desc, DebugObject* obj) {
1793-
Zone* zone = desc->info()->zone();
17941783
if (desc->IsLineInfoAvailable()) {
1795-
obj->AddSection(new(zone) DebugInfoSection(desc), zone);
1796-
obj->AddSection(new(zone) DebugAbbrevSection(desc), zone);
1797-
obj->AddSection(new(zone) DebugLineSection(desc), zone);
1784+
obj->AddSection(new DebugInfoSection(desc));
1785+
obj->AddSection(new DebugAbbrevSection(desc));
1786+
obj->AddSection(new DebugLineSection(desc));
17981787
}
17991788
#ifdef V8_TARGET_ARCH_X64
1800-
obj->AddSection(new(zone) UnwindInfoSection(desc), zone);
1789+
obj->AddSection(new UnwindInfoSection(desc));
18011790
#endif
18021791
}
18031792

@@ -1916,8 +1905,7 @@ static void UnregisterCodeEntry(JITCodeEntry* entry) {
19161905

19171906

19181907
static JITCodeEntry* CreateELFObject(CodeDescription* desc) {
1919-
Zone* zone = desc->info()->zone();
1920-
ZoneScope zone_scope(zone, DELETE_ON_EXIT);
1908+
ZoneScope zone_scope(Isolate::Current(), DELETE_ON_EXIT);
19211909
#ifdef __MACH_O
19221910
MachO mach_o;
19231911
Writer w(&mach_o);
@@ -1930,19 +1918,17 @@ static JITCodeEntry* CreateELFObject(CodeDescription* desc) {
19301918

19311919
mach_o.Write(&w, desc->CodeStart(), desc->CodeSize());
19321920
#else
1933-
ELF elf(zone);
1921+
ELF elf;
19341922
Writer w(&elf);
19351923

19361924
int text_section_index = elf.AddSection(
1937-
new(zone) FullHeaderELFSection(
1938-
".text",
1939-
ELFSection::TYPE_NOBITS,
1940-
kCodeAlignment,
1941-
desc->CodeStart(),
1942-
0,
1943-
desc->CodeSize(),
1944-
ELFSection::FLAG_ALLOC | ELFSection::FLAG_EXEC),
1945-
zone);
1925+
new FullHeaderELFSection(".text",
1926+
ELFSection::TYPE_NOBITS,
1927+
kCodeAlignment,
1928+
desc->CodeStart(),
1929+
0,
1930+
desc->CodeSize(),
1931+
ELFSection::FLAG_ALLOC | ELFSection::FLAG_EXEC));
19461932

19471933
CreateSymbolsTable(desc, &elf, text_section_index);
19481934

0 commit comments

Comments
 (0)