Skip to content

Commit

Permalink
deps: update V8 to 5.4.500.41
Browse files Browse the repository at this point in the history
PR-URL: #9412
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
  • Loading branch information
targos authored and MylesBorins committed Nov 11, 2016
1 parent 45df0ee commit 33bcd6f
Show file tree
Hide file tree
Showing 32 changed files with 357 additions and 111 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 5
#define V8_MINOR_VERSION 4
#define V8_BUILD_NUMBER 500
#define V8_PATCH_LEVEL 36
#define V8_PATCH_LEVEL 41

// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
Expand Down
1 change: 1 addition & 0 deletions deps/v8/src/bailout-reason.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ namespace internal {
V(kUnexpectedReturnFromThrow, "Unexpectedly returned from a throw") \
V(kUnsupportedSwitchStatement, "Unsupported switch statement") \
V(kUnsupportedTaggedImmediate, "Unsupported tagged immediate") \
V(kUnstableConstantTypeHeapObject, "Unstable constant-type heap object") \
V(kVariableResolvedToWithContext, "Variable resolved to with context") \
V(kWeShouldNotHaveAnEmptyLexicalContext, \
"We should not have an empty lexical context") \
Expand Down
7 changes: 7 additions & 0 deletions deps/v8/src/code-stubs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1160,6 +1160,8 @@ class FastNewClosureStub : public TurboFanCodeStub {

class FastNewFunctionContextStub final : public TurboFanCodeStub {
public:
static const int kMaximumSlots = 0x8000;

explicit FastNewFunctionContextStub(Isolate* isolate)
: TurboFanCodeStub(isolate) {}

Expand All @@ -1169,6 +1171,11 @@ class FastNewFunctionContextStub final : public TurboFanCodeStub {
compiler::Node* context);

private:
// FastNewFunctionContextStub can only allocate closures which fit in the
// new space.
STATIC_ASSERT(((kMaximumSlots + Context::MIN_CONTEXT_SLOTS) * kPointerSize +
FixedArray::kHeaderSize) < Page::kMaxRegularHeapObjectSize);

DEFINE_CALL_INTERFACE_DESCRIPTOR(FastNewFunctionContext);
DEFINE_TURBOFAN_CODE_STUB(FastNewFunctionContext, TurboFanCodeStub);
};
Expand Down
10 changes: 7 additions & 3 deletions deps/v8/src/compiler/js-generic-lowering.cc
Original file line number Diff line number Diff line change
Expand Up @@ -444,9 +444,13 @@ void JSGenericLowering::LowerJSCreateFunctionContext(Node* node) {
int const slot_count = OpParameter<int>(node->op());
CallDescriptor::Flags flags = FrameStateFlagForCall(node);

Callable callable = CodeFactory::FastNewFunctionContext(isolate());
node->InsertInput(zone(), 1, jsgraph()->Int32Constant(slot_count));
ReplaceWithStubCall(node, callable, flags);
if (slot_count <= FastNewFunctionContextStub::kMaximumSlots) {
Callable callable = CodeFactory::FastNewFunctionContext(isolate());
node->InsertInput(zone(), 1, jsgraph()->Int32Constant(slot_count));
ReplaceWithStubCall(node, callable, flags);
} else {
ReplaceWithRuntimeCall(node, Runtime::kNewFunctionContext);
}
}


Expand Down
9 changes: 7 additions & 2 deletions deps/v8/src/compiler/js-global-object-specialization.cc
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,18 @@ Reduction JSGlobalObjectSpecialization::ReduceJSStoreGlobal(Node* node) {
dependencies()->AssumePropertyCell(property_cell);
Type* property_cell_value_type;
if (property_cell_value->IsHeapObject()) {
// We cannot do anything if the {property_cell_value}s map is no
// longer stable.
Handle<Map> property_cell_value_map(
Handle<HeapObject>::cast(property_cell_value)->map(), isolate());
if (!property_cell_value_map->is_stable()) return NoChange();
dependencies()->AssumeMapStable(property_cell_value_map);

// Check that the {value} is a HeapObject.
value = effect = graph()->NewNode(simplified()->CheckTaggedPointer(),
value, effect, control);

// Check {value} map agains the {property_cell} map.
Handle<Map> property_cell_value_map(
Handle<HeapObject>::cast(property_cell_value)->map(), isolate());
effect = graph()->NewNode(
simplified()->CheckMaps(1), value,
jsgraph()->HeapConstant(property_cell_value_map), effect, control);
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/compiler/simplified-lowering.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2977,7 +2977,7 @@ Node* SimplifiedLowering::Float64Sign(Node* const node) {
graph()->NewNode(
common()->Select(MachineRepresentation::kFloat64),
graph()->NewNode(machine()->Float64LessThan(), zero, input), one,
zero));
input));
}

Node* SimplifiedLowering::Int32Abs(Node* const node) {
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/compiler/typer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1321,7 +1321,7 @@ Type* Typer::Visitor::JSCallFunctionTyper(Type* fun, Typer* t) {
case kMathTan:
return Type::Number();
case kMathSign:
return t->cache_.kMinusOneToOne;
return t->cache_.kMinusOneToOneOrMinusZeroOrNaN;
// Binary math functions.
case kMathAtan2:
case kMathPow:
Expand Down
16 changes: 11 additions & 5 deletions deps/v8/src/crankshaft/arm/lithium-codegen-arm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,17 @@ void LCodeGen::DoPrologue(LPrologue* instr) {
__ CallRuntime(Runtime::kNewScriptContext);
deopt_mode = Safepoint::kLazyDeopt;
} else {
FastNewFunctionContextStub stub(isolate());
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(), Operand(slots));
__ CallStub(&stub);
// Result of FastNewFunctionContextStub is always in new space.
need_write_barrier = false;
if (slots <= FastNewFunctionContextStub::kMaximumSlots) {
FastNewFunctionContextStub stub(isolate());
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(),
Operand(slots));
__ CallStub(&stub);
// Result of FastNewFunctionContextStub is always in new space.
need_write_barrier = false;
} else {
__ push(r1);
__ CallRuntime(Runtime::kNewFunctionContext);
}
}
RecordSafepoint(deopt_mode);

Expand Down
15 changes: 10 additions & 5 deletions deps/v8/src/crankshaft/arm64/lithium-codegen-arm64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -595,11 +595,16 @@ void LCodeGen::DoPrologue(LPrologue* instr) {
__ CallRuntime(Runtime::kNewScriptContext);
deopt_mode = Safepoint::kLazyDeopt;
} else {
FastNewFunctionContextStub stub(isolate());
__ Mov(FastNewFunctionContextDescriptor::SlotsRegister(), slots);
__ CallStub(&stub);
// Result of FastNewFunctionContextStub is always in new space.
need_write_barrier = false;
if (slots <= FastNewFunctionContextStub::kMaximumSlots) {
FastNewFunctionContextStub stub(isolate());
__ Mov(FastNewFunctionContextDescriptor::SlotsRegister(), slots);
__ CallStub(&stub);
// Result of FastNewFunctionContextStub is always in new space.
need_write_barrier = false;
} else {
__ Push(x1);
__ CallRuntime(Runtime::kNewFunctionContext);
}
}
RecordSafepoint(deopt_mode);
// Context is returned in x0. It replaces the context passed to us. It's
Expand Down
16 changes: 12 additions & 4 deletions deps/v8/src/crankshaft/hydrogen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6899,11 +6899,19 @@ void HOptimizedGraphBuilder::HandleGlobalVariableAssignment(
access = access.WithRepresentation(Representation::Smi());
break;
case PropertyCellConstantType::kStableMap: {
// The map may no longer be stable, deopt if it's ever different from
// what is currently there, which will allow for restablization.
Handle<Map> map(HeapObject::cast(cell->value())->map());
// First check that the previous value of the {cell} still has the
// map that we are about to check the new {value} for. If not, then
// the stable map assumption was invalidated and we cannot continue
// with the optimized code.
Handle<HeapObject> cell_value(HeapObject::cast(cell->value()));
Handle<Map> cell_value_map(cell_value->map());
if (!cell_value_map->is_stable()) {
return Bailout(kUnstableConstantTypeHeapObject);
}
top_info()->dependencies()->AssumeMapStable(cell_value_map);
// Now check that the new {value} is a HeapObject with the same map.
Add<HCheckHeapObject>(value);
value = Add<HCheckMaps>(value, map);
value = Add<HCheckMaps>(value, cell_value_map);
access = access.WithRepresentation(Representation::HeapObject());
break;
}
Expand Down
17 changes: 11 additions & 6 deletions deps/v8/src/crankshaft/ia32/lithium-codegen-ia32.cc
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,17 @@ void LCodeGen::DoPrologue(LPrologue* instr) {
__ CallRuntime(Runtime::kNewScriptContext);
deopt_mode = Safepoint::kLazyDeopt;
} else {
FastNewFunctionContextStub stub(isolate());
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(),
Immediate(slots));
__ CallStub(&stub);
// Result of FastNewFunctionContextStub is always in new space.
need_write_barrier = false;
if (slots <= FastNewFunctionContextStub::kMaximumSlots) {
FastNewFunctionContextStub stub(isolate());
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(),
Immediate(slots));
__ CallStub(&stub);
// Result of FastNewFunctionContextStub is always in new space.
need_write_barrier = false;
} else {
__ push(edi);
__ CallRuntime(Runtime::kNewFunctionContext);
}
}
RecordSafepoint(deopt_mode);

Expand Down
16 changes: 11 additions & 5 deletions deps/v8/src/crankshaft/mips/lithium-codegen-mips.cc
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,17 @@ void LCodeGen::DoPrologue(LPrologue* instr) {
__ CallRuntime(Runtime::kNewScriptContext);
deopt_mode = Safepoint::kLazyDeopt;
} else {
FastNewFunctionContextStub stub(isolate());
__ li(FastNewFunctionContextDescriptor::SlotsRegister(), Operand(slots));
__ CallStub(&stub);
// Result of FastNewFunctionContextStub is always in new space.
need_write_barrier = false;
if (slots <= FastNewFunctionContextStub::kMaximumSlots) {
FastNewFunctionContextStub stub(isolate());
__ li(FastNewFunctionContextDescriptor::SlotsRegister(),
Operand(slots));
__ CallStub(&stub);
// Result of FastNewFunctionContextStub is always in new space.
need_write_barrier = false;
} else {
__ push(a1);
__ CallRuntime(Runtime::kNewFunctionContext);
}
}
RecordSafepoint(deopt_mode);

Expand Down
16 changes: 11 additions & 5 deletions deps/v8/src/crankshaft/mips64/lithium-codegen-mips64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,17 @@ void LCodeGen::DoPrologue(LPrologue* instr) {
__ CallRuntime(Runtime::kNewScriptContext);
deopt_mode = Safepoint::kLazyDeopt;
} else {
FastNewFunctionContextStub stub(isolate());
__ li(FastNewFunctionContextDescriptor::SlotsRegister(), Operand(slots));
__ CallStub(&stub);
// Result of FastNewFunctionContextStub is always in new space.
need_write_barrier = false;
if (slots <= FastNewFunctionContextStub::kMaximumSlots) {
FastNewFunctionContextStub stub(isolate());
__ li(FastNewFunctionContextDescriptor::SlotsRegister(),
Operand(slots));
__ CallStub(&stub);
// Result of FastNewFunctionContextStub is always in new space.
need_write_barrier = false;
} else {
__ push(a1);
__ CallRuntime(Runtime::kNewFunctionContext);
}
}
RecordSafepoint(deopt_mode);

Expand Down
16 changes: 11 additions & 5 deletions deps/v8/src/crankshaft/ppc/lithium-codegen-ppc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,17 @@ void LCodeGen::DoPrologue(LPrologue* instr) {
__ CallRuntime(Runtime::kNewScriptContext);
deopt_mode = Safepoint::kLazyDeopt;
} else {
FastNewFunctionContextStub stub(isolate());
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(), Operand(slots));
__ CallStub(&stub);
// Result of FastNewFunctionContextStub is always in new space.
need_write_barrier = false;
if (slots <= FastNewFunctionContextStub::kMaximumSlots) {
FastNewFunctionContextStub stub(isolate());
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(),
Operand(slots));
__ CallStub(&stub);
// Result of FastNewFunctionContextStub is always in new space.
need_write_barrier = false;
} else {
__ push(r4);
__ CallRuntime(Runtime::kNewFunctionContext);
}
}
RecordSafepoint(deopt_mode);

Expand Down
16 changes: 11 additions & 5 deletions deps/v8/src/crankshaft/s390/lithium-codegen-s390.cc
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,17 @@ void LCodeGen::DoPrologue(LPrologue* instr) {
__ CallRuntime(Runtime::kNewScriptContext);
deopt_mode = Safepoint::kLazyDeopt;
} else {
FastNewFunctionContextStub stub(isolate());
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(), Operand(slots));
__ CallStub(&stub);
// Result of FastNewFunctionContextStub is always in new space.
need_write_barrier = false;
if (slots <= FastNewFunctionContextStub::kMaximumSlots) {
FastNewFunctionContextStub stub(isolate());
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(),
Operand(slots));
__ CallStub(&stub);
// Result of FastNewFunctionContextStub is always in new space.
need_write_barrier = false;
} else {
__ push(r3);
__ CallRuntime(Runtime::kNewFunctionContext);
}
}
RecordSafepoint(deopt_mode);

Expand Down
15 changes: 10 additions & 5 deletions deps/v8/src/crankshaft/x64/lithium-codegen-x64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,16 @@ void LCodeGen::DoPrologue(LPrologue* instr) {
__ CallRuntime(Runtime::kNewScriptContext);
deopt_mode = Safepoint::kLazyDeopt;
} else {
FastNewFunctionContextStub stub(isolate());
__ Set(FastNewFunctionContextDescriptor::SlotsRegister(), slots);
__ CallStub(&stub);
// Result of FastNewFunctionContextStub is always in new space.
need_write_barrier = false;
if (slots <= FastNewFunctionContextStub::kMaximumSlots) {
FastNewFunctionContextStub stub(isolate());
__ Set(FastNewFunctionContextDescriptor::SlotsRegister(), slots);
__ CallStub(&stub);
// Result of FastNewFunctionContextStub is always in new space.
need_write_barrier = false;
} else {
__ Push(rdi);
__ CallRuntime(Runtime::kNewFunctionContext);
}
}
RecordSafepoint(deopt_mode);

Expand Down
17 changes: 11 additions & 6 deletions deps/v8/src/crankshaft/x87/lithium-codegen-x87.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,17 @@ void LCodeGen::DoPrologue(LPrologue* instr) {
__ CallRuntime(Runtime::kNewScriptContext);
deopt_mode = Safepoint::kLazyDeopt;
} else {
FastNewFunctionContextStub stub(isolate());
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(),
Immediate(slots));
__ CallStub(&stub);
// Result of FastNewFunctionContextStub is always in new space.
need_write_barrier = false;
if (slots <= FastNewFunctionContextStub::kMaximumSlots) {
FastNewFunctionContextStub stub(isolate());
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(),
Immediate(slots));
__ CallStub(&stub);
// Result of FastNewFunctionContextStub is always in new space.
need_write_barrier = false;
} else {
__ push(edi);
__ CallRuntime(Runtime::kNewFunctionContext);
}
}
RecordSafepoint(deopt_mode);

Expand Down
16 changes: 11 additions & 5 deletions deps/v8/src/full-codegen/arm/full-codegen-arm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,17 @@ void FullCodeGenerator::Generate() {
if (info->scope()->new_target_var() != nullptr) {
__ push(r3); // Preserve new target.
}
FastNewFunctionContextStub stub(isolate());
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(), Operand(slots));
__ CallStub(&stub);
// Result of FastNewFunctionContextStub is always in new space.
need_write_barrier = false;
if (slots <= FastNewFunctionContextStub::kMaximumSlots) {
FastNewFunctionContextStub stub(isolate());
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(),
Operand(slots));
__ CallStub(&stub);
// Result of FastNewFunctionContextStub is always in new space.
need_write_barrier = false;
} else {
__ push(r1);
__ CallRuntime(Runtime::kNewFunctionContext);
}
if (info->scope()->new_target_var() != nullptr) {
__ pop(r3); // Preserve new target.
}
Expand Down
15 changes: 10 additions & 5 deletions deps/v8/src/full-codegen/arm64/full-codegen-arm64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,16 @@ void FullCodeGenerator::Generate() {
if (info->scope()->new_target_var() != nullptr) {
__ Push(x3); // Preserve new target.
}
FastNewFunctionContextStub stub(isolate());
__ Mov(FastNewFunctionContextDescriptor::SlotsRegister(), slots);
__ CallStub(&stub);
// Result of FastNewFunctionContextStub is always in new space.
need_write_barrier = false;
if (slots <= FastNewFunctionContextStub::kMaximumSlots) {
FastNewFunctionContextStub stub(isolate());
__ Mov(FastNewFunctionContextDescriptor::SlotsRegister(), slots);
__ CallStub(&stub);
// Result of FastNewFunctionContextStub is always in new space.
need_write_barrier = false;
} else {
__ Push(x1);
__ CallRuntime(Runtime::kNewFunctionContext);
}
if (info->scope()->new_target_var() != nullptr) {
__ Pop(x3); // Restore new target.
}
Expand Down
17 changes: 11 additions & 6 deletions deps/v8/src/full-codegen/ia32/full-codegen-ia32.cc
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,17 @@ void FullCodeGenerator::Generate() {
if (info->scope()->new_target_var() != nullptr) {
__ push(edx); // Preserve new target.
}
FastNewFunctionContextStub stub(isolate());
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(),
Immediate(slots));
__ CallStub(&stub);
// Result of FastNewFunctionContextStub is always in new space.
need_write_barrier = false;
if (slots <= FastNewFunctionContextStub::kMaximumSlots) {
FastNewFunctionContextStub stub(isolate());
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(),
Immediate(slots));
__ CallStub(&stub);
// Result of FastNewFunctionContextStub is always in new space.
need_write_barrier = false;
} else {
__ push(edi);
__ CallRuntime(Runtime::kNewFunctionContext);
}
if (info->scope()->new_target_var() != nullptr) {
__ pop(edx); // Restore new target.
}
Expand Down
Loading

0 comments on commit 33bcd6f

Please sign in to comment.