Skip to content

Commit 0000654

Browse files
committed
deps: patch V8 to 10.2.154.4
Refs: v8/v8@10.2.154.2...10.2.154.4 PR-URL: #43067 Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
1 parent 5eff7b4 commit 0000654

File tree

12 files changed

+59
-678
lines changed

12 files changed

+59
-678
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 10
1212
#define V8_MINOR_VERSION 2
1313
#define V8_BUILD_NUMBER 154
14-
#define V8_PATCH_LEVEL 2
14+
#define V8_PATCH_LEVEL 4
1515

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

deps/v8/src/ast/ast.cc

-22
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,6 @@ bool Expression::IsNullLiteral() const {
103103
return IsLiteral() && AsLiteral()->type() == Literal::kNull;
104104
}
105105

106-
bool Expression::IsBooleanLiteral() const {
107-
return IsLiteral() && AsLiteral()->type() == Literal::kBoolean;
108-
}
109-
110106
bool Expression::IsTheHoleLiteral() const {
111107
return IsLiteral() && AsLiteral()->type() == Literal::kTheHole;
112108
}
@@ -896,24 +892,6 @@ static bool IsVoidOfLiteral(Expression* expr) {
896892
maybe_unary->expression()->IsLiteral();
897893
}
898894

899-
static bool MatchLiteralStrictCompareBoolean(Expression* left, Token::Value op,
900-
Expression* right,
901-
Expression** expr,
902-
Literal** literal) {
903-
if (left->IsBooleanLiteral() && op == Token::EQ_STRICT) {
904-
*expr = right;
905-
*literal = left->AsLiteral();
906-
return true;
907-
}
908-
return false;
909-
}
910-
911-
bool CompareOperation::IsLiteralStrictCompareBoolean(Expression** expr,
912-
Literal** literal) {
913-
return MatchLiteralStrictCompareBoolean(left_, op(), right_, expr, literal) ||
914-
MatchLiteralStrictCompareBoolean(right_, op(), left_, expr, literal);
915-
}
916-
917895
// Check for the pattern: void <literal> equals <expression> or
918896
// undefined equals <expression>
919897
static bool MatchLiteralCompareUndefined(Expression* left, Token::Value op,

deps/v8/src/ast/ast.h

-8
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,6 @@ class Expression : public AstNode {
236236
// True iff the expression is the null literal.
237237
bool IsNullLiteral() const;
238238

239-
bool IsBooleanLiteral() const;
240-
241239
// True iff the expression is the hole literal.
242240
bool IsTheHoleLiteral() const;
243241

@@ -957,11 +955,6 @@ class Literal final : public Expression {
957955
return Smi::FromInt(smi_);
958956
}
959957

960-
bool AsBooleanLiteral() const {
961-
DCHECK_EQ(kBoolean, type());
962-
return boolean_;
963-
}
964-
965958
// Returns true if literal represents a Number.
966959
bool IsNumber() const { return type() == kHeapNumber || type() == kSmi; }
967960
double AsNumber() const {
@@ -1970,7 +1963,6 @@ class CompareOperation final : public Expression {
19701963

19711964
// Match special cases.
19721965
bool IsLiteralCompareTypeof(Expression** expr, Literal** literal);
1973-
bool IsLiteralStrictCompareBoolean(Expression** expr, Literal** literal);
19741966
bool IsLiteralCompareUndefined(Expression** expr);
19751967
bool IsLiteralCompareNull(Expression** expr);
19761968

deps/v8/src/compiler/bytecode-graph-builder.cc

+6-10
Original file line numberDiff line numberDiff line change
@@ -3977,31 +3977,27 @@ void BytecodeGraphBuilder::BuildJumpIfNotEqual(Node* comperand) {
39773977
}
39783978

39793979
void BytecodeGraphBuilder::BuildJumpIfFalse() {
3980-
Node* accumulator = environment()->LookupAccumulator();
3981-
Node* condition = NewNode(simplified()->ReferenceEqual(), accumulator,
3982-
jsgraph()->FalseConstant());
3983-
NewBranch(condition, BranchHint::kNone);
3980+
NewBranch(environment()->LookupAccumulator(), BranchHint::kNone);
39843981
{
39853982
SubEnvironment sub_environment(this);
3986-
NewIfTrue();
3983+
NewIfFalse();
39873984
environment()->BindAccumulator(jsgraph()->FalseConstant());
39883985
MergeIntoSuccessorEnvironment(bytecode_iterator().GetJumpTargetOffset());
39893986
}
3990-
NewIfFalse();
3987+
NewIfTrue();
3988+
environment()->BindAccumulator(jsgraph()->TrueConstant());
39913989
}
39923990

39933991
void BytecodeGraphBuilder::BuildJumpIfTrue() {
3994-
Node* accumulator = environment()->LookupAccumulator();
3995-
Node* condition = NewNode(simplified()->ReferenceEqual(), accumulator,
3996-
jsgraph()->TrueConstant());
3997-
NewBranch(condition, BranchHint::kNone);
3992+
NewBranch(environment()->LookupAccumulator(), BranchHint::kNone);
39983993
{
39993994
SubEnvironment sub_environment(this);
40003995
NewIfTrue();
40013996
environment()->BindAccumulator(jsgraph()->TrueConstant());
40023997
MergeIntoSuccessorEnvironment(bytecode_iterator().GetJumpTargetOffset());
40033998
}
40043999
NewIfFalse();
4000+
environment()->BindAccumulator(jsgraph()->FalseConstant());
40054001
}
40064002

40074003
void BytecodeGraphBuilder::BuildJumpIfToBooleanTrue() {

deps/v8/src/compiler/wasm-compiler.cc

+48-69
Original file line numberDiff line numberDiff line change
@@ -8554,16 +8554,10 @@ class LinkageLocationAllocator {
85548554
// must be offset to just before the param slots, using this |slot_offset_|.
85558555
int slot_offset_;
85568556
};
8557-
} // namespace
85588557

8559-
// General code uses the above configuration data.
8560-
CallDescriptor* GetWasmCallDescriptor(Zone* zone, const wasm::FunctionSig* fsig,
8561-
WasmCallKind call_kind,
8562-
bool need_frame_state) {
8563-
// The extra here is to accomodate the instance object as first parameter
8564-
// and, when specified, the additional callable.
8565-
bool extra_callable_param =
8566-
call_kind == kWasmImportWrapper || call_kind == kWasmCapiFunction;
8558+
LocationSignature* BuildLocations(Zone* zone, const wasm::FunctionSig* fsig,
8559+
bool extra_callable_param,
8560+
int* parameter_slots, int* return_slots) {
85678561
int extra_params = extra_callable_param ? 2 : 1;
85688562
LocationSignature::Builder locations(zone, fsig->return_count(),
85698563
fsig->parameter_count() + extra_params);
@@ -8606,19 +8600,37 @@ CallDescriptor* GetWasmCallDescriptor(Zone* zone, const wasm::FunctionSig* fsig,
86068600
kJSFunctionRegister.code(), MachineType::TaggedPointer()));
86078601
}
86088602

8609-
int parameter_slots = AddArgumentPaddingSlots(params.NumStackSlots());
8603+
*parameter_slots = AddArgumentPaddingSlots(params.NumStackSlots());
86108604

86118605
// Add return location(s).
86128606
LinkageLocationAllocator rets(wasm::kGpReturnRegisters,
8613-
wasm::kFpReturnRegisters, parameter_slots);
8607+
wasm::kFpReturnRegisters, *parameter_slots);
86148608

8615-
const int return_count = static_cast<int>(locations.return_count_);
8616-
for (int i = 0; i < return_count; i++) {
8609+
const size_t return_count = locations.return_count_;
8610+
for (size_t i = 0; i < return_count; i++) {
86178611
MachineRepresentation ret = fsig->GetReturn(i).machine_representation();
86188612
locations.AddReturn(rets.Next(ret));
86198613
}
86208614

8621-
int return_slots = rets.NumStackSlots();
8615+
*return_slots = rets.NumStackSlots();
8616+
8617+
return locations.Build();
8618+
}
8619+
} // namespace
8620+
8621+
// General code uses the above configuration data.
8622+
CallDescriptor* GetWasmCallDescriptor(Zone* zone, const wasm::FunctionSig* fsig,
8623+
WasmCallKind call_kind,
8624+
bool need_frame_state) {
8625+
// The extra here is to accomodate the instance object as first parameter
8626+
// and, when specified, the additional callable.
8627+
bool extra_callable_param =
8628+
call_kind == kWasmImportWrapper || call_kind == kWasmCapiFunction;
8629+
8630+
int parameter_slots;
8631+
int return_slots;
8632+
LocationSignature* location_sig = BuildLocations(
8633+
zone, fsig, extra_callable_param, &parameter_slots, &return_slots);
86228634

86238635
const RegList kCalleeSaveRegisters;
86248636
const DoubleRegList kCalleeSaveFPRegisters;
@@ -8644,7 +8656,7 @@ CallDescriptor* GetWasmCallDescriptor(Zone* zone, const wasm::FunctionSig* fsig,
86448656
descriptor_kind, // kind
86458657
target_type, // target MachineType
86468658
target_loc, // target location
8647-
locations.Build(), // location_sig
8659+
location_sig, // location_sig
86488660
parameter_slots, // parameter slot count
86498661
compiler::Operator::kNoProperties, // properties
86508662
kCalleeSaveRegisters, // callee-saved registers
@@ -8695,78 +8707,45 @@ const wasm::FunctionSig* ReplaceTypeInSig(Zone* zone,
86958707
CallDescriptor* ReplaceTypeInCallDescriptorWith(
86968708
Zone* zone, const CallDescriptor* call_descriptor, size_t num_replacements,
86978709
wasm::ValueType input_type, wasm::ValueType output_type) {
8698-
size_t parameter_count = call_descriptor->ParameterCount();
8699-
size_t return_count = call_descriptor->ReturnCount();
8700-
for (size_t i = 0; i < call_descriptor->ParameterCount(); i++) {
8701-
if (call_descriptor->GetParameterType(i) == input_type.machine_type()) {
8702-
parameter_count += num_replacements - 1;
8710+
if (call_descriptor->wasm_sig() == nullptr) {
8711+
// This happens for builtins calls. They need no replacements anyway.
8712+
#if DEBUG
8713+
for (size_t i = 0; i < call_descriptor->ParameterCount(); i++) {
8714+
DCHECK_NE(call_descriptor->GetParameterType(i),
8715+
input_type.machine_type());
87038716
}
8704-
}
8705-
for (size_t i = 0; i < call_descriptor->ReturnCount(); i++) {
8706-
if (call_descriptor->GetReturnType(i) == input_type.machine_type()) {
8707-
return_count += num_replacements - 1;
8717+
for (size_t i = 0; i < call_descriptor->ReturnCount(); i++) {
8718+
DCHECK_NE(call_descriptor->GetReturnType(i), input_type.machine_type());
87088719
}
8720+
#endif
8721+
return const_cast<CallDescriptor*>(call_descriptor);
87098722
}
8710-
if (parameter_count == call_descriptor->ParameterCount() &&
8711-
return_count == call_descriptor->ReturnCount()) {
8723+
const wasm::FunctionSig* sig =
8724+
ReplaceTypeInSig(zone, call_descriptor->wasm_sig(), input_type,
8725+
output_type, num_replacements);
8726+
// If {ReplaceTypeInSig} took the early fast path, there's nothing to do.
8727+
if (sig == call_descriptor->wasm_sig()) {
87128728
return const_cast<CallDescriptor*>(call_descriptor);
87138729
}
87148730

8715-
LocationSignature::Builder locations(zone, return_count, parameter_count);
8716-
87178731
// The last parameter may be the special callable parameter. In that case we
87188732
// have to preserve it as the last parameter, i.e. we allocate it in the new
87198733
// location signature again in the same register.
8720-
bool has_callable_param =
8734+
bool extra_callable_param =
87218735
(call_descriptor->GetInputLocation(call_descriptor->InputCount() - 1) ==
87228736
LinkageLocation::ForRegister(kJSFunctionRegister.code(),
87238737
MachineType::TaggedPointer()));
8724-
LinkageLocationAllocator params(
8725-
wasm::kGpParamRegisters, wasm::kFpParamRegisters, 0 /* no slot offset */);
8726-
8727-
for (size_t i = 0;
8728-
i < call_descriptor->ParameterCount() - (has_callable_param ? 1 : 0);
8729-
i++) {
8730-
if (call_descriptor->GetParameterType(i) == input_type.machine_type()) {
8731-
for (size_t j = 0; j < num_replacements; j++) {
8732-
locations.AddParam(params.Next(output_type.machine_representation()));
8733-
}
8734-
} else {
8735-
locations.AddParam(
8736-
params.Next(call_descriptor->GetParameterType(i).representation()));
8737-
}
8738-
}
8739-
if (has_callable_param) {
8740-
locations.AddParam(LinkageLocation::ForRegister(
8741-
kJSFunctionRegister.code(), MachineType::TaggedPointer()));
8742-
}
8743-
8744-
int parameter_slots = AddArgumentPaddingSlots(params.NumStackSlots());
8745-
8746-
LinkageLocationAllocator rets(wasm::kGpReturnRegisters,
8747-
wasm::kFpReturnRegisters, parameter_slots);
8748-
8749-
for (size_t i = 0; i < call_descriptor->ReturnCount(); i++) {
8750-
if (call_descriptor->GetReturnType(i) == input_type.machine_type()) {
8751-
for (size_t j = 0; j < num_replacements; j++) {
8752-
locations.AddReturn(rets.Next(output_type.machine_representation()));
8753-
}
8754-
} else {
8755-
locations.AddReturn(
8756-
rets.Next(call_descriptor->GetReturnType(i).representation()));
8757-
}
8758-
}
8759-
8760-
int return_slots = rets.NumStackSlots();
87618738

8762-
auto sig = ReplaceTypeInSig(zone, call_descriptor->wasm_sig(), input_type,
8763-
output_type, num_replacements);
8739+
int parameter_slots;
8740+
int return_slots;
8741+
LocationSignature* location_sig = BuildLocations(
8742+
zone, sig, extra_callable_param, &parameter_slots, &return_slots);
87648743

87658744
return zone->New<CallDescriptor>( // --
87668745
call_descriptor->kind(), // kind
87678746
call_descriptor->GetInputType(0), // target MachineType
87688747
call_descriptor->GetInputLocation(0), // target location
8769-
locations.Build(), // location_sig
8748+
location_sig, // location_sig
87708749
parameter_slots, // parameter slot count
87718750
call_descriptor->properties(), // properties
87728751
call_descriptor->CalleeSavedRegisters(), // callee-saved registers

deps/v8/src/interpreter/bytecode-generator.cc

-28
Original file line numberDiff line numberDiff line change
@@ -6157,29 +6157,6 @@ void BytecodeGenerator::BuildLiteralCompareNil(
61576157
}
61586158
}
61596159

6160-
void BytecodeGenerator::BuildLiteralStrictCompareBoolean(Literal* literal) {
6161-
DCHECK(literal->IsBooleanLiteral());
6162-
if (execution_result()->IsTest()) {
6163-
TestResultScope* test_result = execution_result()->AsTest();
6164-
if (literal->AsBooleanLiteral()) {
6165-
builder()->JumpIfTrue(ToBooleanMode::kAlreadyBoolean,
6166-
test_result->NewThenLabel());
6167-
} else {
6168-
builder()->JumpIfFalse(ToBooleanMode::kAlreadyBoolean,
6169-
test_result->NewThenLabel());
6170-
}
6171-
if (test_result->fallthrough() != TestFallthrough::kElse) {
6172-
builder()->Jump(test_result->NewElseLabel());
6173-
}
6174-
test_result->SetResultConsumedByTest();
6175-
} else {
6176-
Register result = register_allocator()->NewRegister();
6177-
builder()->StoreAccumulatorInRegister(result);
6178-
builder()->LoadBoolean(literal->AsBooleanLiteral());
6179-
builder()->CompareReference(result);
6180-
}
6181-
}
6182-
61836160
void BytecodeGenerator::VisitCompareOperation(CompareOperation* expr) {
61846161
Expression* sub_expr;
61856162
Literal* literal;
@@ -6195,11 +6172,6 @@ void BytecodeGenerator::VisitCompareOperation(CompareOperation* expr) {
61956172
} else {
61966173
builder()->CompareTypeOf(literal_flag);
61976174
}
6198-
} else if (expr->IsLiteralStrictCompareBoolean(&sub_expr, &literal)) {
6199-
DCHECK(expr->op() == Token::EQ_STRICT);
6200-
VisitForAccumulatorValue(sub_expr);
6201-
builder()->SetExpressionPosition(expr);
6202-
BuildLiteralStrictCompareBoolean(literal);
62036175
} else if (expr->IsLiteralCompareUndefined(&sub_expr)) {
62046176
VisitForAccumulatorValue(sub_expr);
62056177
builder()->SetExpressionPosition(expr);

deps/v8/src/interpreter/bytecode-generator.h

-1
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,6 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> {
263263
LookupHoistingMode lookup_hoisting_mode = LookupHoistingMode::kNormal);
264264
void BuildLiteralCompareNil(Token::Value compare_op,
265265
BytecodeArrayBuilder::NilValue nil);
266-
void BuildLiteralStrictCompareBoolean(Literal* literal);
267266
void BuildReturn(int source_position);
268267
void BuildAsyncReturn(int source_position);
269268
void BuildAsyncGeneratorReturn();

deps/v8/src/interpreter/interpreter-generator.cc

+4
Original file line numberDiff line numberDiff line change
@@ -1915,6 +1915,7 @@ IGNITION_HANDLER(JumpConstant, InterpreterAssembler) {
19151915
// will misbehave if passed arbitrary input values.
19161916
IGNITION_HANDLER(JumpIfTrue, InterpreterAssembler) {
19171917
TNode<Object> accumulator = GetAccumulator();
1918+
CSA_DCHECK(this, IsBoolean(CAST(accumulator)));
19181919
JumpIfTaggedEqual(accumulator, TrueConstant(), 0);
19191920
}
19201921

@@ -1925,6 +1926,7 @@ IGNITION_HANDLER(JumpIfTrue, InterpreterAssembler) {
19251926
// and will misbehave if passed arbitrary input values.
19261927
IGNITION_HANDLER(JumpIfTrueConstant, InterpreterAssembler) {
19271928
TNode<Object> accumulator = GetAccumulator();
1929+
CSA_DCHECK(this, IsBoolean(CAST(accumulator)));
19281930
JumpIfTaggedEqualConstant(accumulator, TrueConstant(), 0);
19291931
}
19301932

@@ -1935,6 +1937,7 @@ IGNITION_HANDLER(JumpIfTrueConstant, InterpreterAssembler) {
19351937
// will misbehave if passed arbitrary input values.
19361938
IGNITION_HANDLER(JumpIfFalse, InterpreterAssembler) {
19371939
TNode<Object> accumulator = GetAccumulator();
1940+
CSA_DCHECK(this, IsBoolean(CAST(accumulator)));
19381941
JumpIfTaggedEqual(accumulator, FalseConstant(), 0);
19391942
}
19401943

@@ -1945,6 +1948,7 @@ IGNITION_HANDLER(JumpIfFalse, InterpreterAssembler) {
19451948
// and will misbehave if passed arbitrary input values.
19461949
IGNITION_HANDLER(JumpIfFalseConstant, InterpreterAssembler) {
19471950
TNode<Object> accumulator = GetAccumulator();
1951+
CSA_DCHECK(this, IsBoolean(CAST(accumulator)));
19481952
JumpIfTaggedEqualConstant(accumulator, FalseConstant(), 0);
19491953
}
19501954

0 commit comments

Comments
 (0)