Skip to content

Commit 8d16f0d

Browse files
rayw000targos
authored andcommitted
deps: V8: cherry-pick 422dc378a1da
Original commit message: [deserialization] Remove unnecessarily limit on buffer size 1. Now there is no serializer/deserializer-specific buffer size limit. 2. Update AUTHORS Ref: #40059 Change-Id: Iad4c6d8f68a91ef21d3c404fb7945949e69ad9e2 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3170411 Reviewed-by: Jakob Kummerow <[email protected]> Reviewed-by: Clemens Backes <[email protected]> Commit-Queue: Jakob Kummerow <[email protected]> Cr-Commit-Position: refs/heads/main@{#77084} Refs: v8/v8@422dc37 PR-URL: #40450 Fixes: #40059 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 6e39e0e commit 8d16f0d

File tree

4 files changed

+18
-39
lines changed

4 files changed

+18
-39
lines changed

common.gypi

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
# Reset this number to 0 on major V8 upgrades.
3838
# Increment by one for each non-official patch applied to deps/v8.
39-
'v8_embedder_string': '-node.12',
39+
'v8_embedder_string': '-node.13',
4040

4141
##### V8 defaults for Node.js #####
4242

deps/v8/AUTHORS

+14-13
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,12 @@ Alexis Campailla <[email protected]>
5757
Allan Sandfeld Jensen <[email protected]>
5858
5959
Andreas Anyuru <[email protected]>
60-
Andrew Paprocki <[email protected]>
6160
Andrei Kashcha <[email protected]>
61+
Andrew Paprocki <[email protected]>
6262
Anna Henningsen <[email protected]>
6363
Antoine du Hamel <[email protected]>
6464
Anton Bikineev <[email protected]>
6565
Bangfu Tao <[email protected]>
66-
Daniel Shelton <[email protected]>
6766
6867
Ben Newman <[email protected]>
6968
Ben Noordhuis <[email protected]>
@@ -74,18 +73,19 @@ Brice Dobry <[email protected]>
7473
Burcu Dogan <[email protected]>
7574
Caitlin Potter <[email protected]>
7675
Chao Wang <[email protected]>
77-
Craig Schlenter <[email protected]>
7876
Charles Kerr <[email protected]>
7977
Chengzhong Wu <[email protected]>
8078
Choongwoo Han <[email protected]>
8179
Chris Nardi <[email protected]>
8280
Christopher A. Taylor <[email protected]>
8381
Colin Ihrig <[email protected]>
8482
83+
Craig Schlenter <[email protected]>
8584
Daniel Andersson <[email protected]>
8685
Daniel Bevenius <[email protected]>
8786
Daniel Dromboski <[email protected]>
8887
Daniel James <[email protected]>
88+
Daniel Shelton <[email protected]>
8989
Darshan Sen <[email protected]>
9090
David Carlier <[email protected]>
9191
David Manouchehri <[email protected]>
@@ -120,13 +120,13 @@ Ingvar Stepanyan <[email protected]>
120120
Ioseb Dzmanashvili <[email protected]>
121121
Isiah Meadows <[email protected]>
122122
Jaime Bernardo <[email protected]>
123-
Jan de Mooij <[email protected]>
123+
James M Snell <[email protected]>
124+
James Pike <[email protected]>
124125
Jan Krems <[email protected]>
126+
Jan de Mooij <[email protected]>
125127
Janusz Majnert <[email protected]>
126-
Jay Freeman <[email protected]>
127-
James Pike <[email protected]>
128-
James M Snell <[email protected]>
129128
Javad Amiri <[email protected]>
129+
Jay Freeman <[email protected]>
130130
Jesper van den Ende <[email protected]>
131131
132132
Jianghua Yang <[email protected]>
@@ -136,8 +136,8 @@ Joel Stanley <[email protected]>
136136
Johan Bergström <[email protected]>
137137
Jonathan Liu <[email protected]>
138138
Julien Brianceau <[email protected]>
139-
Junha Park <[email protected]>
140139
JunHo Seo <[email protected]>
140+
Junha Park <[email protected]>
141141
Junming Huang <[email protected]>
142142
Kang-Hao (Kenny) Lu <[email protected]>
143143
Karl Skomski <[email protected]>
@@ -181,20 +181,21 @@ Oleksandr Chekhovskyi <[email protected]>
181181
Oliver Dunk <[email protected]>
182182
Paolo Giarrusso <[email protected]>
183183
Patrick Gansterer <[email protected]>
184+
Paul Lind <[email protected]>
185+
Pavel Medvedev <[email protected]>
184186
185187
186188
Peng-Yu Chen <[email protected]>
187189
Peter Rybin <[email protected]>
188190
Peter Varga <[email protected]>
189191
Peter Wong <[email protected]>
190-
Paul Lind <[email protected]>
191-
Pavel Medvedev <[email protected]>
192192
193193
Qingyan Li <[email protected]>
194194
Qiuyi Zhang <[email protected]>
195195
Rafal Krypa <[email protected]>
196196
Raul Tambre <[email protected]>
197197
Ray Glover <[email protected]>
198+
198199
Refael Ackermann <[email protected]>
199200
Rene Rebe <[email protected]>
200201
Reza Yazdani <[email protected]>
@@ -219,11 +220,13 @@ Stefan Penner <[email protected]>
219220
Stephan Hartmann <[email protected]>
220221
Stephen Belanger <[email protected]>
221222
Sylvestre Ledru <[email protected]>
223+
Takeshi Yoneda <[email protected]>
222224
Taketoshi Aono <[email protected]>
223225
Tao Liqiang <[email protected]>
224226
Teddy Katz <[email protected]>
225227
Thomas Young <[email protected]>
226228
Tiancheng "Timothy" Gu <[email protected]>
229+
Tianping Yang <[email protected]>
227230
Timo Teräs <[email protected]>
228231
Tobias Burnus <[email protected]>
229232
Tobias Nießen <[email protected]>
@@ -248,13 +251,11 @@ Yi Wang <[email protected]>
248251
Yong Wang <[email protected]>
249252
Youfeng Hao <[email protected]>
250253
251-
Yusif Khudhur <[email protected]>
252254
Yuri Iozzelli <[email protected]>
255+
Yusif Khudhur <[email protected]>
253256
Zac Hansen <[email protected]>
254257
Zeynep Cankara <[email protected]>
255258
Zhao Jiazhong <[email protected]>
256259
Zheng Liu <[email protected]>
257260
Zhongping Wang <[email protected]>
258261
柳荣一 <[email protected]>
259-
Tianping Yang <[email protected]>
260-
Takeshi Yoneda <[email protected]>

deps/v8/src/api/api.cc

+2-24
Original file line numberDiff line numberDiff line change
@@ -3362,7 +3362,6 @@ struct ValueDeserializer::PrivateData {
33623362
: isolate(i), deserializer(i, data, delegate) {}
33633363
i::Isolate* isolate;
33643364
i::ValueDeserializer deserializer;
3365-
bool has_aborted = false;
33663365
bool supports_legacy_wire_format = false;
33673366
};
33683367

@@ -3372,16 +3371,8 @@ ValueDeserializer::ValueDeserializer(Isolate* isolate, const uint8_t* data,
33723371

33733372
ValueDeserializer::ValueDeserializer(Isolate* isolate, const uint8_t* data,
33743373
size_t size, Delegate* delegate) {
3375-
if (base::IsValueInRangeForNumericType<int>(size)) {
3376-
private_ = new PrivateData(
3377-
reinterpret_cast<i::Isolate*>(isolate),
3378-
base::Vector<const uint8_t>(data, static_cast<int>(size)), delegate);
3379-
} else {
3380-
private_ =
3381-
new PrivateData(reinterpret_cast<i::Isolate*>(isolate),
3382-
base::Vector<const uint8_t>(nullptr, 0), nullptr);
3383-
private_->has_aborted = true;
3384-
}
3374+
private_ = new PrivateData(reinterpret_cast<i::Isolate*>(isolate),
3375+
base::Vector<const uint8_t>(data, size), delegate);
33853376
}
33863377

33873378
ValueDeserializer::~ValueDeserializer() { delete private_; }
@@ -3391,15 +3382,6 @@ Maybe<bool> ValueDeserializer::ReadHeader(Local<Context> context) {
33913382
ENTER_V8_NO_SCRIPT(isolate, context, ValueDeserializer, ReadHeader,
33923383
Nothing<bool>(), i::HandleScope);
33933384

3394-
// We could have aborted during the constructor.
3395-
// If so, ReadHeader is where we report it.
3396-
if (private_->has_aborted) {
3397-
isolate->Throw(*isolate->factory()->NewError(
3398-
i::MessageTemplate::kDataCloneDeserializationError));
3399-
has_pending_exception = true;
3400-
RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool);
3401-
}
3402-
34033385
bool read_header = false;
34043386
has_pending_exception = !private_->deserializer.ReadHeader().To(&read_header);
34053387
RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool);
@@ -3423,12 +3405,10 @@ void ValueDeserializer::SetSupportsLegacyWireFormat(
34233405
}
34243406

34253407
uint32_t ValueDeserializer::GetWireFormatVersion() const {
3426-
CHECK(!private_->has_aborted);
34273408
return private_->deserializer.GetWireFormatVersion();
34283409
}
34293410

34303411
MaybeLocal<Value> ValueDeserializer::ReadValue(Local<Context> context) {
3431-
CHECK(!private_->has_aborted);
34323412
PREPARE_FOR_EXECUTION(context, ValueDeserializer, ReadValue, Value);
34333413
i::MaybeHandle<i::Object> result;
34343414
if (GetWireFormatVersion() > 0) {
@@ -3445,14 +3425,12 @@ MaybeLocal<Value> ValueDeserializer::ReadValue(Local<Context> context) {
34453425

34463426
void ValueDeserializer::TransferArrayBuffer(uint32_t transfer_id,
34473427
Local<ArrayBuffer> array_buffer) {
3448-
CHECK(!private_->has_aborted);
34493428
private_->deserializer.TransferArrayBuffer(transfer_id,
34503429
Utils::OpenHandle(*array_buffer));
34513430
}
34523431

34533432
void ValueDeserializer::TransferSharedArrayBuffer(
34543433
uint32_t transfer_id, Local<SharedArrayBuffer> shared_array_buffer) {
3455-
CHECK(!private_->has_aborted);
34563434
private_->deserializer.TransferArrayBuffer(
34573435
transfer_id, Utils::OpenHandle(*shared_array_buffer));
34583436
}

deps/v8/src/objects/value-serializer.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,7 @@ ValueDeserializer::ValueDeserializer(Isolate* isolate,
11191119
: isolate_(isolate),
11201120
delegate_(delegate),
11211121
position_(data.begin()),
1122-
end_(data.begin() + data.length()),
1122+
end_(data.end()),
11231123
id_map_(isolate->global_handles()->Create(
11241124
ReadOnlyRoots(isolate_).empty_fixed_array())) {}
11251125

0 commit comments

Comments
 (0)