Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4ec5c44

Browse files
committedJul 27, 2015
deps: update v8 to 4.4.63.25
Includes cherry-picks for: * JitCodeEvent patch: https://crrev.com/f7969b1d5a55e66237221a463daf422ac7611788 * argparse patch: https://crrev.com/44bc918458481d60b08d5566f0f31a79e39b85d7
1 parent 235036e commit 4ec5c44

38 files changed

+1075
-237
lines changed
 

‎deps/v8/include/v8-version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define V8_MAJOR_VERSION 4
1212
#define V8_MINOR_VERSION 4
1313
#define V8_BUILD_NUMBER 63
14-
#define V8_PATCH_LEVEL 12
14+
#define V8_PATCH_LEVEL 25
1515

1616
// Use 1 for candidates and 0 otherwise.
1717
// (Boolean macro values are not supported by all preprocessors.)

‎deps/v8/src/api.cc

+3-1
Original file line numberDiff line numberDiff line change
@@ -345,12 +345,14 @@ StartupData V8::CreateSnapshotDataBlob(const char* custom_source) {
345345
base::ElapsedTimer timer;
346346
timer.Start();
347347
Isolate::Scope isolate_scope(isolate);
348+
internal_isolate->set_creating_default_snapshot(true);
348349
internal_isolate->Init(NULL);
349350
Persistent<Context> context;
350351
i::Snapshot::Metadata metadata;
351352
{
352353
HandleScope handle_scope(isolate);
353354
Handle<Context> new_context = Context::New(isolate);
355+
internal_isolate->set_creating_default_snapshot(false);
354356
context.Reset(isolate, new_context);
355357
if (custom_source != NULL) {
356358
metadata.set_embeds_script(true);
@@ -379,7 +381,7 @@ StartupData V8::CreateSnapshotDataBlob(const char* custom_source) {
379381
i::SnapshotByteSink context_sink;
380382
i::PartialSerializer context_ser(internal_isolate, &ser, &context_sink);
381383
context_ser.Serialize(&raw_context);
382-
ser.SerializeWeakReferences();
384+
ser.SerializeWeakReferencesAndDeferred();
383385

384386
result = i::Snapshot::CreateSnapshotBlob(ser, context_ser, metadata);
385387
}

‎deps/v8/src/arm/assembler-arm-inl.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -432,9 +432,7 @@ void Assembler::CheckBuffer() {
432432
if (buffer_space() <= kGap) {
433433
GrowBuffer();
434434
}
435-
if (pc_offset() >= next_buffer_check_) {
436-
CheckConstPool(false, true);
437-
}
435+
MaybeCheckConstPool();
438436
}
439437

440438

‎deps/v8/src/arm/assembler-arm.cc

+21-2
Original file line numberDiff line numberDiff line change
@@ -1298,7 +1298,7 @@ void Assembler::addrmod5(Instr instr, CRegister crd, const MemOperand& x) {
12981298
}
12991299

13001300

1301-
int Assembler::branch_offset(Label* L, bool jump_elimination_allowed) {
1301+
int Assembler::branch_offset(Label* L) {
13021302
int target_pos;
13031303
if (L->is_bound()) {
13041304
target_pos = L->pos();
@@ -1315,7 +1315,8 @@ int Assembler::branch_offset(Label* L, bool jump_elimination_allowed) {
13151315

13161316
// Block the emission of the constant pool, since the branch instruction must
13171317
// be emitted at the pc offset recorded by the label.
1318-
BlockConstPoolFor(1);
1318+
if (!is_const_pool_blocked()) BlockConstPoolFor(1);
1319+
13191320
return target_pos - (pc_offset() + kPcLoadDelta);
13201321
}
13211322

@@ -1367,6 +1368,24 @@ void Assembler::bx(Register target, Condition cond) { // v5 and above, plus v4t
13671368
}
13681369

13691370

1371+
void Assembler::b(Label* L, Condition cond) {
1372+
CheckBuffer();
1373+
b(branch_offset(L), cond);
1374+
}
1375+
1376+
1377+
void Assembler::bl(Label* L, Condition cond) {
1378+
CheckBuffer();
1379+
bl(branch_offset(L), cond);
1380+
}
1381+
1382+
1383+
void Assembler::blx(Label* L) {
1384+
CheckBuffer();
1385+
blx(branch_offset(L));
1386+
}
1387+
1388+
13701389
// Data-processing instructions.
13711390

13721391
void Assembler::and_(Register dst, Register src1, const Operand& src2,

‎deps/v8/src/arm/assembler-arm.h

+12-8
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ class Assembler : public AssemblerBase {
746746
// Returns the branch offset to the given label from the current code position
747747
// Links the label to the current position if it is still unbound
748748
// Manages the jump elimination optimization if the second parameter is true.
749-
int branch_offset(Label* L, bool jump_elimination_allowed);
749+
int branch_offset(Label* L);
750750

751751
// Returns true if the given pc address is the start of a constant pool load
752752
// instruction sequence.
@@ -852,13 +852,11 @@ class Assembler : public AssemblerBase {
852852
void bx(Register target, Condition cond = al); // v5 and above, plus v4t
853853

854854
// Convenience branch instructions using labels
855-
void b(Label* L, Condition cond = al) {
856-
b(branch_offset(L, cond == al), cond);
857-
}
858-
void b(Condition cond, Label* L) { b(branch_offset(L, cond == al), cond); }
859-
void bl(Label* L, Condition cond = al) { bl(branch_offset(L, false), cond); }
860-
void bl(Condition cond, Label* L) { bl(branch_offset(L, false), cond); }
861-
void blx(Label* L) { blx(branch_offset(L, false)); } // v5 and above
855+
void b(Label* L, Condition cond = al);
856+
void b(Condition cond, Label* L) { b(L, cond); }
857+
void bl(Label* L, Condition cond = al);
858+
void bl(Condition cond, Label* L) { bl(L, cond); }
859+
void blx(Label* L); // v5 and above
862860

863861
// Data-processing instructions
864862

@@ -1536,6 +1534,12 @@ class Assembler : public AssemblerBase {
15361534
// Check if is time to emit a constant pool.
15371535
void CheckConstPool(bool force_emit, bool require_jump);
15381536

1537+
void MaybeCheckConstPool() {
1538+
if (pc_offset() >= next_buffer_check_) {
1539+
CheckConstPool(false, true);
1540+
}
1541+
}
1542+
15391543
// Allocate a constant pool of the correct size for the generated code.
15401544
Handle<ConstantPoolArray> NewConstantPool(Isolate* isolate);
15411545

‎deps/v8/src/arm64/code-stubs-arm64.cc

+9-23
Original file line numberDiff line numberDiff line change
@@ -2286,27 +2286,16 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
22862286
Register last_match_info_elements = x21;
22872287
Register code_object = x22;
22882288

2289-
// TODO(jbramley): Is it necessary to preserve these? I don't think ARM does.
2290-
CPURegList used_callee_saved_registers(subject,
2291-
regexp_data,
2292-
last_match_info_elements,
2293-
code_object);
2294-
__ PushCPURegList(used_callee_saved_registers);
2295-
22962289
// Stack frame.
2297-
// jssp[0] : x19
2298-
// jssp[8] : x20
2299-
// jssp[16]: x21
2300-
// jssp[24]: x22
2301-
// jssp[32]: last_match_info (JSArray)
2302-
// jssp[40]: previous index
2303-
// jssp[48]: subject string
2304-
// jssp[56]: JSRegExp object
2305-
2306-
const int kLastMatchInfoOffset = 4 * kPointerSize;
2307-
const int kPreviousIndexOffset = 5 * kPointerSize;
2308-
const int kSubjectOffset = 6 * kPointerSize;
2309-
const int kJSRegExpOffset = 7 * kPointerSize;
2290+
// jssp[00]: last_match_info (JSArray)
2291+
// jssp[08]: previous index
2292+
// jssp[16]: subject string
2293+
// jssp[24]: JSRegExp object
2294+
2295+
const int kLastMatchInfoOffset = 0 * kPointerSize;
2296+
const int kPreviousIndexOffset = 1 * kPointerSize;
2297+
const int kSubjectOffset = 2 * kPointerSize;
2298+
const int kJSRegExpOffset = 3 * kPointerSize;
23102299

23112300
// Ensure that a RegExp stack is allocated.
23122301
ExternalReference address_of_regexp_stack_memory_address =
@@ -2673,7 +2662,6 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
26732662

26742663
// Return last match info.
26752664
__ Peek(x0, kLastMatchInfoOffset);
2676-
__ PopCPURegList(used_callee_saved_registers);
26772665
// Drop the 4 arguments of the stub from the stack.
26782666
__ Drop(4);
26792667
__ Ret();
@@ -2696,13 +2684,11 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
26962684

26972685
__ Bind(&failure);
26982686
__ Mov(x0, Operand(isolate()->factory()->null_value()));
2699-
__ PopCPURegList(used_callee_saved_registers);
27002687
// Drop the 4 arguments of the stub from the stack.
27012688
__ Drop(4);
27022689
__ Ret();
27032690

27042691
__ Bind(&runtime);
2705-
__ PopCPURegList(used_callee_saved_registers);
27062692
__ TailCallRuntime(Runtime::kRegExpExec, 4, 1);
27072693

27082694
// Deferred code for string handling.

‎deps/v8/src/bootstrapper.cc

+1
Original file line numberDiff line numberDiff line change
@@ -2813,6 +2813,7 @@ void Genesis::TransferNamedProperties(Handle<JSObject> from,
28132813
if (value->IsPropertyCell()) {
28142814
value = handle(PropertyCell::cast(*value)->value(), isolate());
28152815
}
2816+
if (value->IsTheHole()) continue;
28162817
PropertyDetails details = properties->DetailsAt(i);
28172818
DCHECK_EQ(kData, details.kind());
28182819
JSObject::AddProperty(to, key, value, details.attributes());

‎deps/v8/src/compiler/arm/code-generator-arm.cc

+2
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,8 @@ void CodeGenerator::AssembleDeconstructActivationRecord() {
316316
void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
317317
ArmOperandConverter i(this, instr);
318318

319+
masm()->MaybeCheckConstPool();
320+
319321
switch (ArchOpcodeField::decode(instr->opcode())) {
320322
case kArchCallCodeObject: {
321323
EnsureSpaceForLazyDeopt();

‎deps/v8/src/flag-definitions.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ DEFINE_IMPLICATION(es_staging, harmony)
199199
#define HARMONY_STAGED(V) \
200200
V(harmony_rest_parameters, "harmony rest parameters") \
201201
V(harmony_spreadcalls, "harmony spread-calls") \
202-
V(harmony_tostring, "harmony toString") \
202+
V(harmony_tostring, "harmony toString")
203203

204204
// Features that are shipping (turned on by default, but internal flag remains).
205205
#define HARMONY_SHIPPING(V) \

‎deps/v8/src/ic/ic.cc

+43-5
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,39 @@ void LoadIC::UpdateCaches(LookupIterator* lookup) {
11121112
code = slow_stub();
11131113
}
11141114
} else {
1115-
code = ComputeHandler(lookup);
1115+
if (lookup->state() == LookupIterator::ACCESSOR) {
1116+
Handle<Object> accessors = lookup->GetAccessors();
1117+
Handle<Map> map = receiver_map();
1118+
if (accessors->IsExecutableAccessorInfo()) {
1119+
Handle<ExecutableAccessorInfo> info =
1120+
Handle<ExecutableAccessorInfo>::cast(accessors);
1121+
if ((v8::ToCData<Address>(info->getter()) != 0) &&
1122+
!ExecutableAccessorInfo::IsCompatibleReceiverMap(isolate(), info,
1123+
map)) {
1124+
TRACE_GENERIC_IC(isolate(), "LoadIC", "incompatible receiver type");
1125+
code = slow_stub();
1126+
}
1127+
} else if (accessors->IsAccessorPair()) {
1128+
Handle<Object> getter(Handle<AccessorPair>::cast(accessors)->getter(),
1129+
isolate());
1130+
Handle<JSObject> holder = lookup->GetHolder<JSObject>();
1131+
Handle<Object> receiver = lookup->GetReceiver();
1132+
if (getter->IsJSFunction() && holder->HasFastProperties()) {
1133+
Handle<JSFunction> function = Handle<JSFunction>::cast(getter);
1134+
if (receiver->IsJSObject() || function->IsBuiltin() ||
1135+
!is_sloppy(function->shared()->language_mode())) {
1136+
CallOptimization call_optimization(function);
1137+
if (call_optimization.is_simple_api_call() &&
1138+
!call_optimization.IsCompatibleReceiver(receiver, holder)) {
1139+
TRACE_GENERIC_IC(isolate(), "LoadIC",
1140+
"incompatible receiver type");
1141+
code = slow_stub();
1142+
}
1143+
}
1144+
}
1145+
}
1146+
}
1147+
if (code.is_null()) code = ComputeHandler(lookup);
11161148
}
11171149

11181150
PatchCache(lookup->name(), code);
@@ -1242,6 +1274,8 @@ Handle<Code> LoadIC::CompileHandler(LookupIterator* lookup,
12421274
if (v8::ToCData<Address>(info->getter()) == 0) break;
12431275
if (!ExecutableAccessorInfo::IsCompatibleReceiverMap(isolate(), info,
12441276
map)) {
1277+
// This case should be already handled in LoadIC::UpdateCaches.
1278+
UNREACHABLE();
12451279
break;
12461280
}
12471281
if (!holder->HasFastProperties()) break;
@@ -1262,10 +1296,14 @@ Handle<Code> LoadIC::CompileHandler(LookupIterator* lookup,
12621296
}
12631297
CallOptimization call_optimization(function);
12641298
NamedLoadHandlerCompiler compiler(isolate(), map, holder, cache_holder);
1265-
if (call_optimization.is_simple_api_call() &&
1266-
call_optimization.IsCompatibleReceiver(receiver, holder)) {
1267-
return compiler.CompileLoadCallback(lookup->name(), call_optimization,
1268-
lookup->GetAccessorIndex());
1299+
if (call_optimization.is_simple_api_call()) {
1300+
if (call_optimization.IsCompatibleReceiver(receiver, holder)) {
1301+
return compiler.CompileLoadCallback(
1302+
lookup->name(), call_optimization, lookup->GetAccessorIndex());
1303+
} else {
1304+
// This case should be already handled in LoadIC::UpdateCaches.
1305+
UNREACHABLE();
1306+
}
12691307
}
12701308
int expected_arguments =
12711309
function->shared()->internal_formal_parameter_count();

‎deps/v8/src/isolate.h

+1
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ typedef List<HeapObject*> DebugObjectCache;
389389
V(uint32_t, per_isolate_assert_data, 0xFFFFFFFFu) \
390390
V(PromiseRejectCallback, promise_reject_callback, NULL) \
391391
V(const v8::StartupData*, snapshot_blob, NULL) \
392+
V(bool, creating_default_snapshot, false) \
392393
ISOLATE_INIT_SIMULATOR_LIST(V)
393394

394395
#define THREAD_LOCAL_TOP_ACCESSOR(type, name) \

‎deps/v8/src/mips/assembler-mips-inl.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -500,8 +500,8 @@ void Assembler::CheckBuffer() {
500500
}
501501

502502

503-
void Assembler::CheckTrampolinePoolQuick() {
504-
if (pc_offset() >= next_buffer_check_) {
503+
void Assembler::CheckTrampolinePoolQuick(int extra_instructions) {
504+
if (pc_offset() >= next_buffer_check_ - extra_instructions * kInstrSize) {
505505
CheckTrampolinePool();
506506
}
507507
}

‎deps/v8/src/mips/assembler-mips.cc

+3-1
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ void Assembler::bind_to(Label* L, int pos) {
795795
trampoline_pos = get_trampoline_entry(fixup_pos);
796796
CHECK(trampoline_pos != kInvalidSlotPos);
797797
}
798-
DCHECK((trampoline_pos - fixup_pos) <= kMaxBranchOffset);
798+
CHECK((trampoline_pos - fixup_pos) <= kMaxBranchOffset);
799799
target_at_put(fixup_pos, trampoline_pos, false);
800800
fixup_pos = trampoline_pos;
801801
dist = pos - fixup_pos;
@@ -1415,6 +1415,7 @@ void Assembler::jal(int32_t target) {
14151415

14161416

14171417
void Assembler::jalr(Register rs, Register rd) {
1418+
DCHECK(rs.code() != rd.code());
14181419
BlockTrampolinePoolScope block_trampoline_pool(this);
14191420
positions_recorder()->WriteRecordedPositions();
14201421
GenInstrRegister(SPECIAL, rs, zero_reg, rd, 0, JALR);
@@ -2633,6 +2634,7 @@ void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
26332634

26342635

26352636
void Assembler::BlockTrampolinePoolFor(int instructions) {
2637+
CheckTrampolinePoolQuick(instructions);
26362638
BlockTrampolinePoolBefore(pc_offset() + instructions * kInstrSize);
26372639
}
26382640

‎deps/v8/src/mips/assembler-mips.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1253,7 +1253,7 @@ class Assembler : public AssemblerBase {
12531253
inline void CheckBuffer();
12541254
void GrowBuffer();
12551255
inline void emit(Instr x);
1256-
inline void CheckTrampolinePoolQuick();
1256+
inline void CheckTrampolinePoolQuick(int extra_instructions = 0);
12571257

12581258
// Instruction generation.
12591259
// We have 3 different kind of encoding layout on MIPS.

‎deps/v8/src/mips/code-stubs-mips.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -4028,8 +4028,8 @@ void DirectCEntryStub::GenerateCall(MacroAssembler* masm,
40284028
intptr_t loc =
40294029
reinterpret_cast<intptr_t>(GetCode().location());
40304030
__ Move(t9, target);
4031-
__ li(ra, Operand(loc, RelocInfo::CODE_TARGET), CONSTANT_SIZE);
4032-
__ Call(ra);
4031+
__ li(at, Operand(loc, RelocInfo::CODE_TARGET), CONSTANT_SIZE);
4032+
__ Call(at);
40334033
}
40344034

40354035

‎deps/v8/src/mips64/assembler-mips64-inl.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -504,8 +504,8 @@ void Assembler::CheckBuffer() {
504504
}
505505

506506

507-
void Assembler::CheckTrampolinePoolQuick() {
508-
if (pc_offset() >= next_buffer_check_) {
507+
void Assembler::CheckTrampolinePoolQuick(int extra_instructions) {
508+
if (pc_offset() >= next_buffer_check_ - extra_instructions * kInstrSize) {
509509
CheckTrampolinePool();
510510
}
511511
}

‎deps/v8/src/mips64/assembler-mips64.cc

+3-1
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ void Assembler::bind_to(Label* L, int pos) {
780780
trampoline_pos = get_trampoline_entry(fixup_pos);
781781
CHECK(trampoline_pos != kInvalidSlotPos);
782782
}
783-
DCHECK((trampoline_pos - fixup_pos) <= kMaxBranchOffset);
783+
CHECK((trampoline_pos - fixup_pos) <= kMaxBranchOffset);
784784
target_at_put(fixup_pos, trampoline_pos, false);
785785
fixup_pos = trampoline_pos;
786786
dist = pos - fixup_pos;
@@ -1396,6 +1396,7 @@ void Assembler::jal(int64_t target) {
13961396

13971397

13981398
void Assembler::jalr(Register rs, Register rd) {
1399+
DCHECK(rs.code() != rd.code());
13991400
BlockTrampolinePoolScope block_trampoline_pool(this);
14001401
positions_recorder()->WriteRecordedPositions();
14011402
GenInstrRegister(SPECIAL, rs, zero_reg, rd, 0, JALR);
@@ -2809,6 +2810,7 @@ void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
28092810

28102811

28112812
void Assembler::BlockTrampolinePoolFor(int instructions) {
2813+
CheckTrampolinePoolQuick(instructions);
28122814
BlockTrampolinePoolBefore(pc_offset() + instructions * kInstrSize);
28132815
}
28142816

‎deps/v8/src/mips64/assembler-mips64.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1288,7 +1288,7 @@ class Assembler : public AssemblerBase {
12881288
void GrowBuffer();
12891289
inline void emit(Instr x);
12901290
inline void emit(uint64_t x);
1291-
inline void CheckTrampolinePoolQuick();
1291+
inline void CheckTrampolinePoolQuick(int extra_instructions = 0);
12921292

12931293
// Instruction generation.
12941294
// We have 3 different kind of encoding layout on MIPS.

0 commit comments

Comments
 (0)
Please sign in to comment.