Commit ec84e33c authored by Maya Lekova's avatar Maya Lekova Committed by V8 LUCI CQ

Revert "[wasm-gc] Allocate supertype arrays in old space"

This reverts commit 58531652.

Reason for revert: Breaks on gc stress variant - https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux%20-%20gc%20stress/36600/blamelist

Original change's description:
> [wasm-gc] Allocate supertype arrays in old space
>
> We fix an inconsistency where supertype arrays for wasm-gc object maps
> were not always allocated in old space. To do so we add an
> AllocationType argument to a couple of factory helpers.
>
> Bug: v8:7748
> Change-Id: I8b16032b8504c17e0f730cfc86e30b172645b67b
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3320455
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#78285}

Bug: v8:7748
Change-Id: I74cf52c4f4da8948134f00bcf5415e9c65e509eb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3322752
Auto-Submit: Maya Lekova <mslekova@chromium.org>
Owners-Override: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#78286}
parent 58531652
...@@ -1474,8 +1474,7 @@ Handle<WasmTypeInfo> Factory::NewWasmTypeInfo( ...@@ -1474,8 +1474,7 @@ Handle<WasmTypeInfo> Factory::NewWasmTypeInfo(
Handle<ArrayList> subtypes = ArrayList::New(isolate(), 0); Handle<ArrayList> subtypes = ArrayList::New(isolate(), 0);
Handle<FixedArray> supertypes; Handle<FixedArray> supertypes;
if (opt_parent.is_null()) { if (opt_parent.is_null()) {
supertypes = supertypes = NewFixedArray(wasm::kMinimumSupertypeArraySize);
NewFixedArray(wasm::kMinimumSupertypeArraySize, AllocationType::kOld);
for (int i = 0; i < supertypes->length(); i++) { for (int i = 0; i < supertypes->length(); i++) {
supertypes->set(i, *undefined_value()); supertypes->set(i, *undefined_value());
} }
...@@ -1490,7 +1489,7 @@ Handle<WasmTypeInfo> Factory::NewWasmTypeInfo( ...@@ -1490,7 +1489,7 @@ Handle<WasmTypeInfo> Factory::NewWasmTypeInfo(
if (last_defined_index == parent_supertypes->length() - 1) { if (last_defined_index == parent_supertypes->length() - 1) {
supertypes = CopyArrayAndGrow(parent_supertypes, 1, AllocationType::kOld); supertypes = CopyArrayAndGrow(parent_supertypes, 1, AllocationType::kOld);
} else { } else {
supertypes = CopyFixedArray(parent_supertypes, AllocationType::kOld); supertypes = CopyFixedArray(parent_supertypes);
} }
supertypes->set(last_defined_index + 1, *opt_parent); supertypes->set(last_defined_index + 1, *opt_parent);
} }
...@@ -1500,7 +1499,7 @@ Handle<WasmTypeInfo> Factory::NewWasmTypeInfo( ...@@ -1500,7 +1499,7 @@ Handle<WasmTypeInfo> Factory::NewWasmTypeInfo(
DisallowGarbageCollection no_gc; DisallowGarbageCollection no_gc;
result.AllocateExternalPointerEntries(isolate()); result.AllocateExternalPointerEntries(isolate());
result.set_foreign_address(isolate(), type_address); result.set_foreign_address(isolate(), type_address);
result.set_supertypes(*supertypes, SKIP_WRITE_BARRIER); result.set_supertypes(*supertypes);
result.set_subtypes(*subtypes); result.set_subtypes(*subtypes);
result.set_instance_size(instance_size_bytes); result.set_instance_size(instance_size_bytes);
result.set_instance(*instance); result.set_instance(*instance);
...@@ -1953,10 +1952,9 @@ inline void ZeroEmbedderFields(i::JSObject obj) { ...@@ -1953,10 +1952,9 @@ inline void ZeroEmbedderFields(i::JSObject obj) {
} // namespace } // namespace
template <typename T> template <typename T>
Handle<T> Factory::CopyArrayWithMap(Handle<T> src, Handle<Map> map, Handle<T> Factory::CopyArrayWithMap(Handle<T> src, Handle<Map> map) {
AllocationType allocation) {
int len = src->length(); int len = src->length();
HeapObject new_object = AllocateRawFixedArray(len, allocation); HeapObject new_object = AllocateRawFixedArray(len, AllocationType::kYoung);
DisallowGarbageCollection no_gc; DisallowGarbageCollection no_gc;
new_object.set_map_after_allocation(*map, SKIP_WRITE_BARRIER); new_object.set_map_after_allocation(*map, SKIP_WRITE_BARRIER);
T result = T::cast(new_object); T result = T::cast(new_object);
...@@ -2092,10 +2090,9 @@ Handle<FixedArray> Factory::CopyFixedArrayUpTo(Handle<FixedArray> array, ...@@ -2092,10 +2090,9 @@ Handle<FixedArray> Factory::CopyFixedArrayUpTo(Handle<FixedArray> array,
return handle(result, isolate()); return handle(result, isolate());
} }
Handle<FixedArray> Factory::CopyFixedArray(Handle<FixedArray> array, Handle<FixedArray> Factory::CopyFixedArray(Handle<FixedArray> array) {
AllocationType allocation) {
if (array->length() == 0) return array; if (array->length() == 0) return array;
return CopyArrayWithMap(array, handle(array->map(), isolate()), allocation); return CopyArrayWithMap(array, handle(array->map(), isolate()));
} }
Handle<FixedDoubleArray> Factory::CopyFixedDoubleArray( Handle<FixedDoubleArray> Factory::CopyFixedDoubleArray(
......
...@@ -484,9 +484,7 @@ class V8_EXPORT_PRIVATE Factory : public FactoryBase<Factory> { ...@@ -484,9 +484,7 @@ class V8_EXPORT_PRIVATE Factory : public FactoryBase<Factory> {
Handle<FixedArray> array, int new_len, Handle<FixedArray> array, int new_len,
AllocationType allocation = AllocationType::kYoung); AllocationType allocation = AllocationType::kYoung);
Handle<FixedArray> CopyFixedArray( Handle<FixedArray> CopyFixedArray(Handle<FixedArray> array);
Handle<FixedArray> array,
AllocationType allocation = AllocationType::kYoung);
Handle<FixedDoubleArray> CopyFixedDoubleArray(Handle<FixedDoubleArray> array); Handle<FixedDoubleArray> CopyFixedDoubleArray(Handle<FixedDoubleArray> array);
...@@ -1047,9 +1045,7 @@ class V8_EXPORT_PRIVATE Factory : public FactoryBase<Factory> { ...@@ -1047,9 +1045,7 @@ class V8_EXPORT_PRIVATE Factory : public FactoryBase<Factory> {
HeapObject New(Handle<Map> map, AllocationType allocation); HeapObject New(Handle<Map> map, AllocationType allocation);
template <typename T> template <typename T>
Handle<T> CopyArrayWithMap( Handle<T> CopyArrayWithMap(Handle<T> src, Handle<Map> map);
Handle<T> src, Handle<Map> map,
AllocationType allocation = AllocationType::kYoung);
template <typename T> template <typename T>
Handle<T> CopyArrayAndGrow(Handle<T> src, int grow_by, Handle<T> CopyArrayAndGrow(Handle<T> src, int grow_by,
AllocationType allocation); AllocationType allocation);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment