Skip to content

Commit

Permalink
deps: update V8 to 4.4.63.26
Browse files Browse the repository at this point in the history
Includes cherry-picks for:
 * JitCodeEvent patch: https://crrev.com/f7969b1d5a55e66237221a463daf422ac7611788
 * argparse patch: https://crrev.com/44bc918458481d60b08d5566f0f31a79e39b85d7

PR-URL: #2220
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
  • Loading branch information
targos authored and rvagg committed Aug 4, 2015
1 parent 2965442 commit 3d3c687
Show file tree
Hide file tree
Showing 40 changed files with 1,102 additions and 238 deletions.
2 changes: 1 addition & 1 deletion deps/v8/include/v8-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 4
#define V8_MINOR_VERSION 4
#define V8_BUILD_NUMBER 63
#define V8_PATCH_LEVEL 12
#define V8_PATCH_LEVEL 26

// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
Expand Down
4 changes: 3 additions & 1 deletion deps/v8/src/api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -345,12 +345,14 @@ StartupData V8::CreateSnapshotDataBlob(const char* custom_source) {
base::ElapsedTimer timer;
timer.Start();
Isolate::Scope isolate_scope(isolate);
internal_isolate->set_creating_default_snapshot(true);
internal_isolate->Init(NULL);
Persistent<Context> context;
i::Snapshot::Metadata metadata;
{
HandleScope handle_scope(isolate);
Handle<Context> new_context = Context::New(isolate);
internal_isolate->set_creating_default_snapshot(false);
context.Reset(isolate, new_context);
if (custom_source != NULL) {
metadata.set_embeds_script(true);
Expand Down Expand Up @@ -379,7 +381,7 @@ StartupData V8::CreateSnapshotDataBlob(const char* custom_source) {
i::SnapshotByteSink context_sink;
i::PartialSerializer context_ser(internal_isolate, &ser, &context_sink);
context_ser.Serialize(&raw_context);
ser.SerializeWeakReferences();
ser.SerializeWeakReferencesAndDeferred();

result = i::Snapshot::CreateSnapshotBlob(ser, context_ser, metadata);
}
Expand Down
4 changes: 1 addition & 3 deletions deps/v8/src/arm/assembler-arm-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -432,9 +432,7 @@ void Assembler::CheckBuffer() {
if (buffer_space() <= kGap) {
GrowBuffer();
}
if (pc_offset() >= next_buffer_check_) {
CheckConstPool(false, true);
}
MaybeCheckConstPool();
}


Expand Down
23 changes: 21 additions & 2 deletions deps/v8/src/arm/assembler-arm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1298,7 +1298,7 @@ void Assembler::addrmod5(Instr instr, CRegister crd, const MemOperand& x) {
}


int Assembler::branch_offset(Label* L, bool jump_elimination_allowed) {
int Assembler::branch_offset(Label* L) {
int target_pos;
if (L->is_bound()) {
target_pos = L->pos();
Expand All @@ -1315,7 +1315,8 @@ int Assembler::branch_offset(Label* L, bool jump_elimination_allowed) {

// Block the emission of the constant pool, since the branch instruction must
// be emitted at the pc offset recorded by the label.
BlockConstPoolFor(1);
if (!is_const_pool_blocked()) BlockConstPoolFor(1);

return target_pos - (pc_offset() + kPcLoadDelta);
}

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


void Assembler::b(Label* L, Condition cond) {
CheckBuffer();
b(branch_offset(L), cond);
}


void Assembler::bl(Label* L, Condition cond) {
CheckBuffer();
bl(branch_offset(L), cond);
}


void Assembler::blx(Label* L) {
CheckBuffer();
blx(branch_offset(L));
}


// Data-processing instructions.

void Assembler::and_(Register dst, Register src1, const Operand& src2,
Expand Down
20 changes: 12 additions & 8 deletions deps/v8/src/arm/assembler-arm.h
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ class Assembler : public AssemblerBase {
// Returns the branch offset to the given label from the current code position
// Links the label to the current position if it is still unbound
// Manages the jump elimination optimization if the second parameter is true.
int branch_offset(Label* L, bool jump_elimination_allowed);
int branch_offset(Label* L);

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

// Convenience branch instructions using labels
void b(Label* L, Condition cond = al) {
b(branch_offset(L, cond == al), cond);
}
void b(Condition cond, Label* L) { b(branch_offset(L, cond == al), cond); }
void bl(Label* L, Condition cond = al) { bl(branch_offset(L, false), cond); }
void bl(Condition cond, Label* L) { bl(branch_offset(L, false), cond); }
void blx(Label* L) { blx(branch_offset(L, false)); } // v5 and above
void b(Label* L, Condition cond = al);
void b(Condition cond, Label* L) { b(L, cond); }
void bl(Label* L, Condition cond = al);
void bl(Condition cond, Label* L) { bl(L, cond); }
void blx(Label* L); // v5 and above

// Data-processing instructions

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

void MaybeCheckConstPool() {
if (pc_offset() >= next_buffer_check_) {
CheckConstPool(false, true);
}
}

// Allocate a constant pool of the correct size for the generated code.
Handle<ConstantPoolArray> NewConstantPool(Isolate* isolate);

Expand Down
32 changes: 9 additions & 23 deletions deps/v8/src/arm64/code-stubs-arm64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2286,27 +2286,16 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
Register last_match_info_elements = x21;
Register code_object = x22;

// TODO(jbramley): Is it necessary to preserve these? I don't think ARM does.
CPURegList used_callee_saved_registers(subject,
regexp_data,
last_match_info_elements,
code_object);
__ PushCPURegList(used_callee_saved_registers);

// Stack frame.
// jssp[0] : x19
// jssp[8] : x20
// jssp[16]: x21
// jssp[24]: x22
// jssp[32]: last_match_info (JSArray)
// jssp[40]: previous index
// jssp[48]: subject string
// jssp[56]: JSRegExp object

const int kLastMatchInfoOffset = 4 * kPointerSize;
const int kPreviousIndexOffset = 5 * kPointerSize;
const int kSubjectOffset = 6 * kPointerSize;
const int kJSRegExpOffset = 7 * kPointerSize;
// jssp[00]: last_match_info (JSArray)
// jssp[08]: previous index
// jssp[16]: subject string
// jssp[24]: JSRegExp object

const int kLastMatchInfoOffset = 0 * kPointerSize;
const int kPreviousIndexOffset = 1 * kPointerSize;
const int kSubjectOffset = 2 * kPointerSize;
const int kJSRegExpOffset = 3 * kPointerSize;

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

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

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

__ Bind(&runtime);
__ PopCPURegList(used_callee_saved_registers);
__ TailCallRuntime(Runtime::kRegExpExec, 4, 1);

// Deferred code for string handling.
Expand Down
1 change: 1 addition & 0 deletions deps/v8/src/bootstrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2813,6 +2813,7 @@ void Genesis::TransferNamedProperties(Handle<JSObject> from,
if (value->IsPropertyCell()) {
value = handle(PropertyCell::cast(*value)->value(), isolate());
}
if (value->IsTheHole()) continue;
PropertyDetails details = properties->DetailsAt(i);
DCHECK_EQ(kData, details.kind());
JSObject::AddProperty(to, key, value, details.attributes());
Expand Down
2 changes: 2 additions & 0 deletions deps/v8/src/compiler/arm/code-generator-arm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,8 @@ void CodeGenerator::AssembleDeconstructActivationRecord() {
void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
ArmOperandConverter i(this, instr);

masm()->MaybeCheckConstPool();

switch (ArchOpcodeField::decode(instr->opcode())) {
case kArchCallCodeObject: {
EnsureSpaceForLazyDeopt();
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/flag-definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ DEFINE_IMPLICATION(es_staging, harmony)
#define HARMONY_STAGED(V) \
V(harmony_rest_parameters, "harmony rest parameters") \
V(harmony_spreadcalls, "harmony spread-calls") \
V(harmony_tostring, "harmony toString") \
V(harmony_tostring, "harmony toString")

// Features that are shipping (turned on by default, but internal flag remains).
#define HARMONY_SHIPPING(V) \
Expand Down
5 changes: 4 additions & 1 deletion deps/v8/src/hydrogen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5219,9 +5219,12 @@ void HOptimizedGraphBuilder::BuildForInBody(ForInStatement* stmt,
HValue* function = AddLoadJSBuiltin(Builtins::FILTER_KEY);
Add<HPushArguments>(enumerable, key);
key = Add<HInvokeFunction>(function, 2);
Push(key);
Add<HSimulate>(stmt->FilterId());
key = Pop();
Bind(each_var, key);
Add<HSimulate>(stmt->AssignmentId());
Add<HCheckHeapObject>(key);
Add<HSimulate>(stmt->AssignmentId());
}

BreakAndContinueInfo break_info(stmt, scope(), 5);
Expand Down
48 changes: 43 additions & 5 deletions deps/v8/src/ic/ic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,39 @@ void LoadIC::UpdateCaches(LookupIterator* lookup) {
code = slow_stub();
}
} else {
code = ComputeHandler(lookup);
if (lookup->state() == LookupIterator::ACCESSOR) {
Handle<Object> accessors = lookup->GetAccessors();
Handle<Map> map = receiver_map();
if (accessors->IsExecutableAccessorInfo()) {
Handle<ExecutableAccessorInfo> info =
Handle<ExecutableAccessorInfo>::cast(accessors);
if ((v8::ToCData<Address>(info->getter()) != 0) &&
!ExecutableAccessorInfo::IsCompatibleReceiverMap(isolate(), info,
map)) {
TRACE_GENERIC_IC(isolate(), "LoadIC", "incompatible receiver type");
code = slow_stub();
}
} else if (accessors->IsAccessorPair()) {
Handle<Object> getter(Handle<AccessorPair>::cast(accessors)->getter(),
isolate());
Handle<JSObject> holder = lookup->GetHolder<JSObject>();
Handle<Object> receiver = lookup->GetReceiver();
if (getter->IsJSFunction() && holder->HasFastProperties()) {
Handle<JSFunction> function = Handle<JSFunction>::cast(getter);
if (receiver->IsJSObject() || function->IsBuiltin() ||
!is_sloppy(function->shared()->language_mode())) {
CallOptimization call_optimization(function);
if (call_optimization.is_simple_api_call() &&
!call_optimization.IsCompatibleReceiver(receiver, holder)) {
TRACE_GENERIC_IC(isolate(), "LoadIC",
"incompatible receiver type");
code = slow_stub();
}
}
}
}
}
if (code.is_null()) code = ComputeHandler(lookup);
}

PatchCache(lookup->name(), code);
Expand Down Expand Up @@ -1242,6 +1274,8 @@ Handle<Code> LoadIC::CompileHandler(LookupIterator* lookup,
if (v8::ToCData<Address>(info->getter()) == 0) break;
if (!ExecutableAccessorInfo::IsCompatibleReceiverMap(isolate(), info,
map)) {
// This case should be already handled in LoadIC::UpdateCaches.
UNREACHABLE();
break;
}
if (!holder->HasFastProperties()) break;
Expand All @@ -1262,10 +1296,14 @@ Handle<Code> LoadIC::CompileHandler(LookupIterator* lookup,
}
CallOptimization call_optimization(function);
NamedLoadHandlerCompiler compiler(isolate(), map, holder, cache_holder);
if (call_optimization.is_simple_api_call() &&
call_optimization.IsCompatibleReceiver(receiver, holder)) {
return compiler.CompileLoadCallback(lookup->name(), call_optimization,
lookup->GetAccessorIndex());
if (call_optimization.is_simple_api_call()) {
if (call_optimization.IsCompatibleReceiver(receiver, holder)) {
return compiler.CompileLoadCallback(
lookup->name(), call_optimization, lookup->GetAccessorIndex());
} else {
// This case should be already handled in LoadIC::UpdateCaches.
UNREACHABLE();
}
}
int expected_arguments =
function->shared()->internal_formal_parameter_count();
Expand Down
1 change: 1 addition & 0 deletions deps/v8/src/isolate.h
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ typedef List<HeapObject*> DebugObjectCache;
V(uint32_t, per_isolate_assert_data, 0xFFFFFFFFu) \
V(PromiseRejectCallback, promise_reject_callback, NULL) \
V(const v8::StartupData*, snapshot_blob, NULL) \
V(bool, creating_default_snapshot, false) \
ISOLATE_INIT_SIMULATOR_LIST(V)

#define THREAD_LOCAL_TOP_ACCESSOR(type, name) \
Expand Down
4 changes: 2 additions & 2 deletions deps/v8/src/mips/assembler-mips-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -500,8 +500,8 @@ void Assembler::CheckBuffer() {
}


void Assembler::CheckTrampolinePoolQuick() {
if (pc_offset() >= next_buffer_check_) {
void Assembler::CheckTrampolinePoolQuick(int extra_instructions) {
if (pc_offset() >= next_buffer_check_ - extra_instructions * kInstrSize) {
CheckTrampolinePool();
}
}
Expand Down
4 changes: 3 additions & 1 deletion deps/v8/src/mips/assembler-mips.cc
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ void Assembler::bind_to(Label* L, int pos) {
trampoline_pos = get_trampoline_entry(fixup_pos);
CHECK(trampoline_pos != kInvalidSlotPos);
}
DCHECK((trampoline_pos - fixup_pos) <= kMaxBranchOffset);
CHECK((trampoline_pos - fixup_pos) <= kMaxBranchOffset);
target_at_put(fixup_pos, trampoline_pos, false);
fixup_pos = trampoline_pos;
dist = pos - fixup_pos;
Expand Down Expand Up @@ -1415,6 +1415,7 @@ void Assembler::jal(int32_t target) {


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


void Assembler::BlockTrampolinePoolFor(int instructions) {
CheckTrampolinePoolQuick(instructions);
BlockTrampolinePoolBefore(pc_offset() + instructions * kInstrSize);
}

Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/mips/assembler-mips.h
Original file line number Diff line number Diff line change
Expand Up @@ -1253,7 +1253,7 @@ class Assembler : public AssemblerBase {
inline void CheckBuffer();
void GrowBuffer();
inline void emit(Instr x);
inline void CheckTrampolinePoolQuick();
inline void CheckTrampolinePoolQuick(int extra_instructions = 0);

// Instruction generation.
// We have 3 different kind of encoding layout on MIPS.
Expand Down
4 changes: 2 additions & 2 deletions deps/v8/src/mips/code-stubs-mips.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4028,8 +4028,8 @@ void DirectCEntryStub::GenerateCall(MacroAssembler* masm,
intptr_t loc =
reinterpret_cast<intptr_t>(GetCode().location());
__ Move(t9, target);
__ li(ra, Operand(loc, RelocInfo::CODE_TARGET), CONSTANT_SIZE);
__ Call(ra);
__ li(at, Operand(loc, RelocInfo::CODE_TARGET), CONSTANT_SIZE);
__ Call(at);
}


Expand Down
4 changes: 2 additions & 2 deletions deps/v8/src/mips64/assembler-mips64-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,8 @@ void Assembler::CheckBuffer() {
}


void Assembler::CheckTrampolinePoolQuick() {
if (pc_offset() >= next_buffer_check_) {
void Assembler::CheckTrampolinePoolQuick(int extra_instructions) {
if (pc_offset() >= next_buffer_check_ - extra_instructions * kInstrSize) {
CheckTrampolinePool();
}
}
Expand Down
4 changes: 3 additions & 1 deletion deps/v8/src/mips64/assembler-mips64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ void Assembler::bind_to(Label* L, int pos) {
trampoline_pos = get_trampoline_entry(fixup_pos);
CHECK(trampoline_pos != kInvalidSlotPos);
}
DCHECK((trampoline_pos - fixup_pos) <= kMaxBranchOffset);
CHECK((trampoline_pos - fixup_pos) <= kMaxBranchOffset);
target_at_put(fixup_pos, trampoline_pos, false);
fixup_pos = trampoline_pos;
dist = pos - fixup_pos;
Expand Down Expand Up @@ -1396,6 +1396,7 @@ void Assembler::jal(int64_t target) {


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


void Assembler::BlockTrampolinePoolFor(int instructions) {
CheckTrampolinePoolQuick(instructions);
BlockTrampolinePoolBefore(pc_offset() + instructions * kInstrSize);
}

Expand Down
Loading

0 comments on commit 3d3c687

Please sign in to comment.