Skip to content

Commit e2148d7

Browse files
committed
deps: patch V8 to 9.1.269.38
Refs: v8/v8@9.1.269.36...9.1.269.38 Fixes: #37553 PR-URL: #39196 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 6463adf commit e2148d7

File tree

5 files changed

+52
-20
lines changed

5 files changed

+52
-20
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 9
1212
#define V8_MINOR_VERSION 1
1313
#define V8_BUILD_NUMBER 269
14-
#define V8_PATCH_LEVEL 36
14+
#define V8_PATCH_LEVEL 38
1515

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

deps/v8/src/heap/heap.cc

+4
Original file line numberDiff line numberDiff line change
@@ -2129,6 +2129,10 @@ void Heap::CompleteSweepingYoung(GarbageCollector collector) {
21292129
array_buffer_sweeper()->EnsureFinished();
21302130
}
21312131

2132+
void Heap::EnsureSweepingCompleted() {
2133+
mark_compact_collector()->EnsureSweepingCompleted();
2134+
}
2135+
21322136
void Heap::UpdateCurrentEpoch(GarbageCollector collector) {
21332137
if (IsYoungGenerationCollector(collector)) {
21342138
epoch_young_ = next_epoch();

deps/v8/src/heap/heap.h

+2
Original file line numberDiff line numberDiff line change
@@ -1074,6 +1074,8 @@ class Heap {
10741074
void CompleteSweepingFull();
10751075
void CompleteSweepingYoung(GarbageCollector collector);
10761076

1077+
void EnsureSweepingCompleted();
1078+
10771079
IncrementalMarking* incremental_marking() {
10781080
return incremental_marking_.get();
10791081
}

deps/v8/src/json/json-parser.cc

+5
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,11 @@ Handle<Object> JsonParser<Char>::BuildJsonObject(
620620
DCHECK_EQ(mutable_double_address, end);
621621
}
622622
#endif
623+
// Before setting the length of mutable_double_buffer back to zero, we
624+
// must ensure that the sweeper is not running or has already swept the
625+
// object's page. Otherwise the GC can add the contents of
626+
// mutable_double_buffer to the free list.
627+
isolate()->heap()->EnsureSweepingCompleted();
623628
mutable_double_buffer->set_length(0);
624629
}
625630
}

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

+40-19
Original file line numberDiff line numberDiff line change
@@ -2318,28 +2318,49 @@ void WasmJs::InstallConditionalFeatures(Isolate* isolate,
23182318
Handle<JSGlobalObject> global = handle(context->global_object(), isolate);
23192319
MaybeHandle<Object> maybe_webassembly =
23202320
JSObject::GetProperty(isolate, global, "WebAssembly");
2321-
Handle<JSObject> webassembly =
2322-
Handle<JSObject>::cast(maybe_webassembly.ToHandleChecked());
2321+
Handle<Object> webassembly_obj;
2322+
if (!maybe_webassembly.ToHandle(&webassembly_obj)) {
2323+
// There is not {WebAssembly} object. We just return without adding the
2324+
// {Exception} constructor.
2325+
return;
2326+
}
2327+
if (!webassembly_obj->IsJSObject()) {
2328+
// The {WebAssembly} object is invalid. As we cannot add the {Exception}
2329+
// constructor, we just return.
2330+
return;
2331+
}
2332+
Handle<JSObject> webassembly = Handle<JSObject>::cast(webassembly_obj);
23232333
// Setup Exception
23242334
Handle<String> exception_name = v8_str(isolate, "Exception");
2325-
if (!JSObject::HasProperty(webassembly, exception_name).FromMaybe(true)) {
2326-
Handle<JSFunction> exception_constructor =
2327-
CreateFunc(isolate, exception_name, WebAssemblyException, true,
2328-
SideEffectType::kHasSideEffect);
2329-
exception_constructor->shared().set_length(1);
2330-
JSObject::AddProperty(isolate, webassembly, exception_name,
2331-
exception_constructor, DONT_ENUM);
2332-
// Install the constructor on the context.
2333-
context->set_wasm_exception_constructor(*exception_constructor);
2334-
SetDummyInstanceTemplate(isolate, exception_constructor);
2335-
JSFunction::EnsureHasInitialMap(exception_constructor);
2336-
Handle<JSObject> exception_proto(
2337-
JSObject::cast(exception_constructor->instance_prototype()), isolate);
2338-
Handle<Map> exception_map = isolate->factory()->NewMap(
2339-
i::WASM_EXCEPTION_OBJECT_TYPE, WasmExceptionObject::kHeaderSize);
2340-
JSFunction::SetInitialMap(isolate, exception_constructor, exception_map,
2341-
exception_proto);
2335+
2336+
if (JSObject::HasOwnProperty(webassembly, exception_name).FromMaybe(true)) {
2337+
// The {Exception} constructor already exists, there is nothing more to
2338+
// do.
2339+
return;
2340+
}
2341+
2342+
bool has_prototype = true;
2343+
Handle<JSFunction> exception_constructor =
2344+
CreateFunc(isolate, exception_name, WebAssemblyException, has_prototype,
2345+
SideEffectType::kHasNoSideEffect);
2346+
exception_constructor->shared().set_length(1);
2347+
auto result = Object::SetProperty(
2348+
isolate, webassembly, exception_name, exception_constructor,
2349+
StoreOrigin::kNamed, Just(ShouldThrow::kDontThrow));
2350+
if (result.is_null()) {
2351+
// Setting the {Exception} constructor failed. We just bail out.
2352+
return;
23422353
}
2354+
// Install the constructor on the context.
2355+
context->set_wasm_exception_constructor(*exception_constructor);
2356+
SetDummyInstanceTemplate(isolate, exception_constructor);
2357+
JSFunction::EnsureHasInitialMap(exception_constructor);
2358+
Handle<JSObject> exception_proto(
2359+
JSObject::cast(exception_constructor->instance_prototype()), isolate);
2360+
Handle<Map> exception_map = isolate->factory()->NewMap(
2361+
i::WASM_EXCEPTION_OBJECT_TYPE, WasmExceptionObject::kHeaderSize);
2362+
JSFunction::SetInitialMap(isolate, exception_constructor, exception_map,
2363+
exception_proto);
23432364
}
23442365
}
23452366
#undef ASSIGN

0 commit comments

Comments
 (0)