Skip to content

Commit 33bcd6f

Browse files
targosMylesBorins
authored andcommitted
deps: update V8 to 5.4.500.41
PR-URL: #9412 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ali Ijaz Sheikh <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
1 parent 45df0ee commit 33bcd6f

32 files changed

+357
-111
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 5
1212
#define V8_MINOR_VERSION 4
1313
#define V8_BUILD_NUMBER 500
14-
#define V8_PATCH_LEVEL 36
14+
#define V8_PATCH_LEVEL 41
1515

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

deps/v8/src/bailout-reason.h

+1
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ namespace internal {
257257
V(kUnexpectedReturnFromThrow, "Unexpectedly returned from a throw") \
258258
V(kUnsupportedSwitchStatement, "Unsupported switch statement") \
259259
V(kUnsupportedTaggedImmediate, "Unsupported tagged immediate") \
260+
V(kUnstableConstantTypeHeapObject, "Unstable constant-type heap object") \
260261
V(kVariableResolvedToWithContext, "Variable resolved to with context") \
261262
V(kWeShouldNotHaveAnEmptyLexicalContext, \
262263
"We should not have an empty lexical context") \

deps/v8/src/code-stubs.h

+7
Original file line numberDiff line numberDiff line change
@@ -1160,6 +1160,8 @@ class FastNewClosureStub : public TurboFanCodeStub {
11601160

11611161
class FastNewFunctionContextStub final : public TurboFanCodeStub {
11621162
public:
1163+
static const int kMaximumSlots = 0x8000;
1164+
11631165
explicit FastNewFunctionContextStub(Isolate* isolate)
11641166
: TurboFanCodeStub(isolate) {}
11651167

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

11711173
private:
1174+
// FastNewFunctionContextStub can only allocate closures which fit in the
1175+
// new space.
1176+
STATIC_ASSERT(((kMaximumSlots + Context::MIN_CONTEXT_SLOTS) * kPointerSize +
1177+
FixedArray::kHeaderSize) < Page::kMaxRegularHeapObjectSize);
1178+
11721179
DEFINE_CALL_INTERFACE_DESCRIPTOR(FastNewFunctionContext);
11731180
DEFINE_TURBOFAN_CODE_STUB(FastNewFunctionContext, TurboFanCodeStub);
11741181
};

deps/v8/src/compiler/js-generic-lowering.cc

+7-3
Original file line numberDiff line numberDiff line change
@@ -444,9 +444,13 @@ void JSGenericLowering::LowerJSCreateFunctionContext(Node* node) {
444444
int const slot_count = OpParameter<int>(node->op());
445445
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
446446

447-
Callable callable = CodeFactory::FastNewFunctionContext(isolate());
448-
node->InsertInput(zone(), 1, jsgraph()->Int32Constant(slot_count));
449-
ReplaceWithStubCall(node, callable, flags);
447+
if (slot_count <= FastNewFunctionContextStub::kMaximumSlots) {
448+
Callable callable = CodeFactory::FastNewFunctionContext(isolate());
449+
node->InsertInput(zone(), 1, jsgraph()->Int32Constant(slot_count));
450+
ReplaceWithStubCall(node, callable, flags);
451+
} else {
452+
ReplaceWithRuntimeCall(node, Runtime::kNewFunctionContext);
453+
}
450454
}
451455

452456

deps/v8/src/compiler/js-global-object-specialization.cc

+7-2
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,18 @@ Reduction JSGlobalObjectSpecialization::ReduceJSStoreGlobal(Node* node) {
181181
dependencies()->AssumePropertyCell(property_cell);
182182
Type* property_cell_value_type;
183183
if (property_cell_value->IsHeapObject()) {
184+
// We cannot do anything if the {property_cell_value}s map is no
185+
// longer stable.
186+
Handle<Map> property_cell_value_map(
187+
Handle<HeapObject>::cast(property_cell_value)->map(), isolate());
188+
if (!property_cell_value_map->is_stable()) return NoChange();
189+
dependencies()->AssumeMapStable(property_cell_value_map);
190+
184191
// Check that the {value} is a HeapObject.
185192
value = effect = graph()->NewNode(simplified()->CheckTaggedPointer(),
186193
value, effect, control);
187194

188195
// Check {value} map agains the {property_cell} map.
189-
Handle<Map> property_cell_value_map(
190-
Handle<HeapObject>::cast(property_cell_value)->map(), isolate());
191196
effect = graph()->NewNode(
192197
simplified()->CheckMaps(1), value,
193198
jsgraph()->HeapConstant(property_cell_value_map), effect, control);

deps/v8/src/compiler/simplified-lowering.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -2977,7 +2977,7 @@ Node* SimplifiedLowering::Float64Sign(Node* const node) {
29772977
graph()->NewNode(
29782978
common()->Select(MachineRepresentation::kFloat64),
29792979
graph()->NewNode(machine()->Float64LessThan(), zero, input), one,
2980-
zero));
2980+
input));
29812981
}
29822982

29832983
Node* SimplifiedLowering::Int32Abs(Node* const node) {

deps/v8/src/compiler/typer.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1321,7 +1321,7 @@ Type* Typer::Visitor::JSCallFunctionTyper(Type* fun, Typer* t) {
13211321
case kMathTan:
13221322
return Type::Number();
13231323
case kMathSign:
1324-
return t->cache_.kMinusOneToOne;
1324+
return t->cache_.kMinusOneToOneOrMinusZeroOrNaN;
13251325
// Binary math functions.
13261326
case kMathAtan2:
13271327
case kMathPow:

deps/v8/src/crankshaft/arm/lithium-codegen-arm.cc

+11-5
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,17 @@ void LCodeGen::DoPrologue(LPrologue* instr) {
164164
__ CallRuntime(Runtime::kNewScriptContext);
165165
deopt_mode = Safepoint::kLazyDeopt;
166166
} else {
167-
FastNewFunctionContextStub stub(isolate());
168-
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(), Operand(slots));
169-
__ CallStub(&stub);
170-
// Result of FastNewFunctionContextStub is always in new space.
171-
need_write_barrier = false;
167+
if (slots <= FastNewFunctionContextStub::kMaximumSlots) {
168+
FastNewFunctionContextStub stub(isolate());
169+
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(),
170+
Operand(slots));
171+
__ CallStub(&stub);
172+
// Result of FastNewFunctionContextStub is always in new space.
173+
need_write_barrier = false;
174+
} else {
175+
__ push(r1);
176+
__ CallRuntime(Runtime::kNewFunctionContext);
177+
}
172178
}
173179
RecordSafepoint(deopt_mode);
174180

deps/v8/src/crankshaft/arm64/lithium-codegen-arm64.cc

+10-5
Original file line numberDiff line numberDiff line change
@@ -595,11 +595,16 @@ void LCodeGen::DoPrologue(LPrologue* instr) {
595595
__ CallRuntime(Runtime::kNewScriptContext);
596596
deopt_mode = Safepoint::kLazyDeopt;
597597
} else {
598-
FastNewFunctionContextStub stub(isolate());
599-
__ Mov(FastNewFunctionContextDescriptor::SlotsRegister(), slots);
600-
__ CallStub(&stub);
601-
// Result of FastNewFunctionContextStub is always in new space.
602-
need_write_barrier = false;
598+
if (slots <= FastNewFunctionContextStub::kMaximumSlots) {
599+
FastNewFunctionContextStub stub(isolate());
600+
__ Mov(FastNewFunctionContextDescriptor::SlotsRegister(), slots);
601+
__ CallStub(&stub);
602+
// Result of FastNewFunctionContextStub is always in new space.
603+
need_write_barrier = false;
604+
} else {
605+
__ Push(x1);
606+
__ CallRuntime(Runtime::kNewFunctionContext);
607+
}
603608
}
604609
RecordSafepoint(deopt_mode);
605610
// Context is returned in x0. It replaces the context passed to us. It's

deps/v8/src/crankshaft/hydrogen.cc

+12-4
Original file line numberDiff line numberDiff line change
@@ -6899,11 +6899,19 @@ void HOptimizedGraphBuilder::HandleGlobalVariableAssignment(
68996899
access = access.WithRepresentation(Representation::Smi());
69006900
break;
69016901
case PropertyCellConstantType::kStableMap: {
6902-
// The map may no longer be stable, deopt if it's ever different from
6903-
// what is currently there, which will allow for restablization.
6904-
Handle<Map> map(HeapObject::cast(cell->value())->map());
6902+
// First check that the previous value of the {cell} still has the
6903+
// map that we are about to check the new {value} for. If not, then
6904+
// the stable map assumption was invalidated and we cannot continue
6905+
// with the optimized code.
6906+
Handle<HeapObject> cell_value(HeapObject::cast(cell->value()));
6907+
Handle<Map> cell_value_map(cell_value->map());
6908+
if (!cell_value_map->is_stable()) {
6909+
return Bailout(kUnstableConstantTypeHeapObject);
6910+
}
6911+
top_info()->dependencies()->AssumeMapStable(cell_value_map);
6912+
// Now check that the new {value} is a HeapObject with the same map.
69056913
Add<HCheckHeapObject>(value);
6906-
value = Add<HCheckMaps>(value, map);
6914+
value = Add<HCheckMaps>(value, cell_value_map);
69076915
access = access.WithRepresentation(Representation::HeapObject());
69086916
break;
69096917
}

deps/v8/src/crankshaft/ia32/lithium-codegen-ia32.cc

+11-6
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,17 @@ void LCodeGen::DoPrologue(LPrologue* instr) {
176176
__ CallRuntime(Runtime::kNewScriptContext);
177177
deopt_mode = Safepoint::kLazyDeopt;
178178
} else {
179-
FastNewFunctionContextStub stub(isolate());
180-
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(),
181-
Immediate(slots));
182-
__ CallStub(&stub);
183-
// Result of FastNewFunctionContextStub is always in new space.
184-
need_write_barrier = false;
179+
if (slots <= FastNewFunctionContextStub::kMaximumSlots) {
180+
FastNewFunctionContextStub stub(isolate());
181+
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(),
182+
Immediate(slots));
183+
__ CallStub(&stub);
184+
// Result of FastNewFunctionContextStub is always in new space.
185+
need_write_barrier = false;
186+
} else {
187+
__ push(edi);
188+
__ CallRuntime(Runtime::kNewFunctionContext);
189+
}
185190
}
186191
RecordSafepoint(deopt_mode);
187192

deps/v8/src/crankshaft/mips/lithium-codegen-mips.cc

+11-5
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,17 @@ void LCodeGen::DoPrologue(LPrologue* instr) {
183183
__ CallRuntime(Runtime::kNewScriptContext);
184184
deopt_mode = Safepoint::kLazyDeopt;
185185
} else {
186-
FastNewFunctionContextStub stub(isolate());
187-
__ li(FastNewFunctionContextDescriptor::SlotsRegister(), Operand(slots));
188-
__ CallStub(&stub);
189-
// Result of FastNewFunctionContextStub is always in new space.
190-
need_write_barrier = false;
186+
if (slots <= FastNewFunctionContextStub::kMaximumSlots) {
187+
FastNewFunctionContextStub stub(isolate());
188+
__ li(FastNewFunctionContextDescriptor::SlotsRegister(),
189+
Operand(slots));
190+
__ CallStub(&stub);
191+
// Result of FastNewFunctionContextStub is always in new space.
192+
need_write_barrier = false;
193+
} else {
194+
__ push(a1);
195+
__ CallRuntime(Runtime::kNewFunctionContext);
196+
}
191197
}
192198
RecordSafepoint(deopt_mode);
193199

deps/v8/src/crankshaft/mips64/lithium-codegen-mips64.cc

+11-5
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,17 @@ void LCodeGen::DoPrologue(LPrologue* instr) {
159159
__ CallRuntime(Runtime::kNewScriptContext);
160160
deopt_mode = Safepoint::kLazyDeopt;
161161
} else {
162-
FastNewFunctionContextStub stub(isolate());
163-
__ li(FastNewFunctionContextDescriptor::SlotsRegister(), Operand(slots));
164-
__ CallStub(&stub);
165-
// Result of FastNewFunctionContextStub is always in new space.
166-
need_write_barrier = false;
162+
if (slots <= FastNewFunctionContextStub::kMaximumSlots) {
163+
FastNewFunctionContextStub stub(isolate());
164+
__ li(FastNewFunctionContextDescriptor::SlotsRegister(),
165+
Operand(slots));
166+
__ CallStub(&stub);
167+
// Result of FastNewFunctionContextStub is always in new space.
168+
need_write_barrier = false;
169+
} else {
170+
__ push(a1);
171+
__ CallRuntime(Runtime::kNewFunctionContext);
172+
}
167173
}
168174
RecordSafepoint(deopt_mode);
169175

deps/v8/src/crankshaft/ppc/lithium-codegen-ppc.cc

+11-5
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,17 @@ void LCodeGen::DoPrologue(LPrologue* instr) {
170170
__ CallRuntime(Runtime::kNewScriptContext);
171171
deopt_mode = Safepoint::kLazyDeopt;
172172
} else {
173-
FastNewFunctionContextStub stub(isolate());
174-
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(), Operand(slots));
175-
__ CallStub(&stub);
176-
// Result of FastNewFunctionContextStub is always in new space.
177-
need_write_barrier = false;
173+
if (slots <= FastNewFunctionContextStub::kMaximumSlots) {
174+
FastNewFunctionContextStub stub(isolate());
175+
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(),
176+
Operand(slots));
177+
__ CallStub(&stub);
178+
// Result of FastNewFunctionContextStub is always in new space.
179+
need_write_barrier = false;
180+
} else {
181+
__ push(r4);
182+
__ CallRuntime(Runtime::kNewFunctionContext);
183+
}
178184
}
179185
RecordSafepoint(deopt_mode);
180186

deps/v8/src/crankshaft/s390/lithium-codegen-s390.cc

+11-5
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,17 @@ void LCodeGen::DoPrologue(LPrologue* instr) {
160160
__ CallRuntime(Runtime::kNewScriptContext);
161161
deopt_mode = Safepoint::kLazyDeopt;
162162
} else {
163-
FastNewFunctionContextStub stub(isolate());
164-
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(), Operand(slots));
165-
__ CallStub(&stub);
166-
// Result of FastNewFunctionContextStub is always in new space.
167-
need_write_barrier = false;
163+
if (slots <= FastNewFunctionContextStub::kMaximumSlots) {
164+
FastNewFunctionContextStub stub(isolate());
165+
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(),
166+
Operand(slots));
167+
__ CallStub(&stub);
168+
// Result of FastNewFunctionContextStub is always in new space.
169+
need_write_barrier = false;
170+
} else {
171+
__ push(r3);
172+
__ CallRuntime(Runtime::kNewFunctionContext);
173+
}
168174
}
169175
RecordSafepoint(deopt_mode);
170176

deps/v8/src/crankshaft/x64/lithium-codegen-x64.cc

+10-5
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,16 @@ void LCodeGen::DoPrologue(LPrologue* instr) {
179179
__ CallRuntime(Runtime::kNewScriptContext);
180180
deopt_mode = Safepoint::kLazyDeopt;
181181
} else {
182-
FastNewFunctionContextStub stub(isolate());
183-
__ Set(FastNewFunctionContextDescriptor::SlotsRegister(), slots);
184-
__ CallStub(&stub);
185-
// Result of FastNewFunctionContextStub is always in new space.
186-
need_write_barrier = false;
182+
if (slots <= FastNewFunctionContextStub::kMaximumSlots) {
183+
FastNewFunctionContextStub stub(isolate());
184+
__ Set(FastNewFunctionContextDescriptor::SlotsRegister(), slots);
185+
__ CallStub(&stub);
186+
// Result of FastNewFunctionContextStub is always in new space.
187+
need_write_barrier = false;
188+
} else {
189+
__ Push(rdi);
190+
__ CallRuntime(Runtime::kNewFunctionContext);
191+
}
187192
}
188193
RecordSafepoint(deopt_mode);
189194

deps/v8/src/crankshaft/x87/lithium-codegen-x87.cc

+11-6
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,17 @@ void LCodeGen::DoPrologue(LPrologue* instr) {
146146
__ CallRuntime(Runtime::kNewScriptContext);
147147
deopt_mode = Safepoint::kLazyDeopt;
148148
} else {
149-
FastNewFunctionContextStub stub(isolate());
150-
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(),
151-
Immediate(slots));
152-
__ CallStub(&stub);
153-
// Result of FastNewFunctionContextStub is always in new space.
154-
need_write_barrier = false;
149+
if (slots <= FastNewFunctionContextStub::kMaximumSlots) {
150+
FastNewFunctionContextStub stub(isolate());
151+
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(),
152+
Immediate(slots));
153+
__ CallStub(&stub);
154+
// Result of FastNewFunctionContextStub is always in new space.
155+
need_write_barrier = false;
156+
} else {
157+
__ push(edi);
158+
__ CallRuntime(Runtime::kNewFunctionContext);
159+
}
155160
}
156161
RecordSafepoint(deopt_mode);
157162

deps/v8/src/full-codegen/arm/full-codegen-arm.cc

+11-5
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,17 @@ void FullCodeGenerator::Generate() {
184184
if (info->scope()->new_target_var() != nullptr) {
185185
__ push(r3); // Preserve new target.
186186
}
187-
FastNewFunctionContextStub stub(isolate());
188-
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(), Operand(slots));
189-
__ CallStub(&stub);
190-
// Result of FastNewFunctionContextStub is always in new space.
191-
need_write_barrier = false;
187+
if (slots <= FastNewFunctionContextStub::kMaximumSlots) {
188+
FastNewFunctionContextStub stub(isolate());
189+
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(),
190+
Operand(slots));
191+
__ CallStub(&stub);
192+
// Result of FastNewFunctionContextStub is always in new space.
193+
need_write_barrier = false;
194+
} else {
195+
__ push(r1);
196+
__ CallRuntime(Runtime::kNewFunctionContext);
197+
}
192198
if (info->scope()->new_target_var() != nullptr) {
193199
__ pop(r3); // Preserve new target.
194200
}

deps/v8/src/full-codegen/arm64/full-codegen-arm64.cc

+10-5
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,16 @@ void FullCodeGenerator::Generate() {
187187
if (info->scope()->new_target_var() != nullptr) {
188188
__ Push(x3); // Preserve new target.
189189
}
190-
FastNewFunctionContextStub stub(isolate());
191-
__ Mov(FastNewFunctionContextDescriptor::SlotsRegister(), slots);
192-
__ CallStub(&stub);
193-
// Result of FastNewFunctionContextStub is always in new space.
194-
need_write_barrier = false;
190+
if (slots <= FastNewFunctionContextStub::kMaximumSlots) {
191+
FastNewFunctionContextStub stub(isolate());
192+
__ Mov(FastNewFunctionContextDescriptor::SlotsRegister(), slots);
193+
__ CallStub(&stub);
194+
// Result of FastNewFunctionContextStub is always in new space.
195+
need_write_barrier = false;
196+
} else {
197+
__ Push(x1);
198+
__ CallRuntime(Runtime::kNewFunctionContext);
199+
}
195200
if (info->scope()->new_target_var() != nullptr) {
196201
__ Pop(x3); // Restore new target.
197202
}

deps/v8/src/full-codegen/ia32/full-codegen-ia32.cc

+11-6
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,17 @@ void FullCodeGenerator::Generate() {
176176
if (info->scope()->new_target_var() != nullptr) {
177177
__ push(edx); // Preserve new target.
178178
}
179-
FastNewFunctionContextStub stub(isolate());
180-
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(),
181-
Immediate(slots));
182-
__ CallStub(&stub);
183-
// Result of FastNewFunctionContextStub is always in new space.
184-
need_write_barrier = false;
179+
if (slots <= FastNewFunctionContextStub::kMaximumSlots) {
180+
FastNewFunctionContextStub stub(isolate());
181+
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(),
182+
Immediate(slots));
183+
__ CallStub(&stub);
184+
// Result of FastNewFunctionContextStub is always in new space.
185+
need_write_barrier = false;
186+
} else {
187+
__ push(edi);
188+
__ CallRuntime(Runtime::kNewFunctionContext);
189+
}
185190
if (info->scope()->new_target_var() != nullptr) {
186191
__ pop(edx); // Restore new target.
187192
}

0 commit comments

Comments
 (0)