also looking at this
fix(compat): stop describing ArrayList's layout, and read it instead
#876
5 files
+88
-42
| @@ -1888,11 +1888,11 @@ test "Function marking and relocation cover every managed field" { | ||
| 1888 | 1888 | var generator_constants = [_]Value{Value.obj(&old_objects[11])}; |
| 1889 | 1889 | var async_constants = [_]Value{Value.obj(&old_objects[12])}; |
| 1890 | 1890 | var plain_chunk = bytecode.Chunk.init(std.testing.allocator); |
| 1891 | plain_chunk.consts = .{ .items = &plain_constants, .capacity = plain_constants.len }; | |
| 1891 | plain_chunk.consts = .fromOwnedSlice(&plain_constants); | |
| 1892 | 1892 | var generator_chunk = bytecode.Chunk.init(std.testing.allocator); |
| 1893 | generator_chunk.consts = .{ .items = &generator_constants, .capacity = generator_constants.len }; | |
| 1893 | generator_chunk.consts = .fromOwnedSlice(&generator_constants); | |
| 1894 | 1894 | var async_chunk = bytecode.Chunk.init(std.testing.allocator); |
| 1895 | async_chunk.consts = .{ .items = &async_constants, .capacity = async_constants.len }; | |
| 1895 | async_chunk.consts = .fromOwnedSlice(&async_constants); | |
| 1896 | 1896 | var parent_frame_slots = [_]Value{Value.obj(&old_objects[13])}; |
| 1897 | 1897 | var parent_frame = vm.Frame{ .slots = &parent_frame_slots, .parent = null }; |
| 1898 | 1898 | var captured_frame_slots = [_]Value{Value.obj(&old_objects[14])}; |
| @@ -2092,8 +2092,8 @@ test "Promise relocation rewrites inline and overflow reaction graphs" { | ||
| 2092 | 2092 | .resolve = Value.obj(&old_objects[6]), |
| 2093 | 2093 | .reject = Value.obj(&old_objects[7]), |
| 2094 | 2094 | }, |
| 2095 | .on_fulfill = .{ .items = &fulfill_overflow, .capacity = fulfill_overflow.len }, | |
| 2096 | .on_reject = .{ .items = &reject_overflow, .capacity = reject_overflow.len }, | |
| 2095 | .on_fulfill = .fromOwnedSlice(&fulfill_overflow), | |
| 2096 | .on_reject = .fromOwnedSlice(&reject_overflow), | |
| 2097 | 2097 | }; |
| 2098 | 2098 | |
| 2099 | 2099 | const Plan = struct { |
| @@ -2353,7 +2353,7 @@ test "Generator and IteratorHelper marking and relocation cover every managed sl | ||
| 2353 | 2353 | .stack = .{ .items = &stack, .capacity = stack.len }, |
| 2354 | 2354 | .acc = Value.obj(&old_objects[2]), |
| 2355 | 2355 | .frame = &child_frame, |
| 2356 | .handlers = .{ .items = &handlers, .capacity = handlers.len }, | |
| 2356 | .handlers = .fromOwnedSlice(&handlers), | |
| 2357 | 2357 | }, |
| 2358 | 2358 | .env = &old_environment, |
| 2359 | 2359 | .this_value = Value.obj(&old_objects[5]), |
| @@ -2362,7 +2362,7 @@ test "Generator and IteratorHelper marking and relocation cover every managed sl | ||
| 2362 | 2362 | .import_meta_slot = &import_meta, |
| 2363 | 2363 | .result = &old_objects[9], |
| 2364 | 2364 | .async_parent_promise = &old_promise, |
| 2365 | .requests = .{ .items = &requests, .capacity = requests.len }, | |
| 2365 | .requests = .fromOwnedSlice(&requests), | |
| 2366 | 2366 | }; |
| 2367 | 2367 | var helper = value.IterHelper{ |
| 2368 | 2368 | .src = Value.obj(&old_objects[14]), |
| @@ -3395,9 +3395,9 @@ test "realm root relocation rewrites Context registries and embedder handles" { | ||
| 3395 | 3395 | context.next_ticks.items = saved_next_ticks; |
| 3396 | 3396 | context.next_ticks.head = saved_next_tick_head; |
| 3397 | 3397 | } |
| 3398 | context.microtasks.items = .{ .items = µtask_items, .capacity = microtask_items.len }; | |
| 3398 | context.microtasks.items = .fromOwnedSlice(µtask_items); | |
| 3399 | 3399 | context.microtasks.head = 0; |
| 3400 | context.next_ticks.items = .{ .items = &next_tick_items, .capacity = next_tick_items.len }; | |
| 3400 | context.next_ticks.items = .fromOwnedSlice(&next_tick_items); | |
| 3401 | 3401 | context.next_ticks.head = 0; |
| 3402 | 3402 | |
| 3403 | 3403 | var unhandled = [_]*promise.Promise{&old_promises[0]}; |
| @@ -3453,15 +3453,15 @@ test "realm root relocation rewrites Context registries and embedder handles" { | ||
| 3453 | 3453 | context.private_strong_roots = saved_strong_roots; |
| 3454 | 3454 | context.private_weak_roots = saved_weak_roots; |
| 3455 | 3455 | } |
| 3456 | context.unhandled_rejections = .{ .items = &unhandled, .capacity = unhandled.len }; | |
| 3457 | context.handled_rejections = .{ .items = &handled, .capacity = handled.len }; | |
| 3458 | context.async_waiters = .{ .items = &async_waiters, .capacity = async_waiters.len }; | |
| 3459 | context.timers = .{ .items = &timers, .capacity = timers.len }; | |
| 3460 | context.finalization_cleanup_jobs = .{ .items = &finalization_jobs, .capacity = finalization_jobs.len }; | |
| 3461 | context.c_api_class_prototypes = .{ .items = &prototypes, .capacity = prototypes.len }; | |
| 3462 | context.c_api_handles = .{ .items = &handles, .capacity = handles.len }; | |
| 3463 | context.private_strong_roots = .{ .items = &strong_roots, .capacity = strong_roots.len }; | |
| 3464 | context.private_weak_roots = .{ .items = &weak_roots, .capacity = weak_roots.len }; | |
| 3456 | context.unhandled_rejections = .fromOwnedSlice(&unhandled); | |
| 3457 | context.handled_rejections = .fromOwnedSlice(&handled); | |
| 3458 | context.async_waiters = .fromOwnedSlice(&async_waiters); | |
| 3459 | context.timers = .fromOwnedSlice(&timers); | |
| 3460 | context.finalization_cleanup_jobs = .fromOwnedSlice(&finalization_jobs); | |
| 3461 | context.c_api_class_prototypes = .fromOwnedSlice(&prototypes); | |
| 3462 | context.c_api_handles = .fromOwnedSlice(&handles); | |
| 3463 | context.private_strong_roots = .fromOwnedSlice(&strong_roots); | |
| 3464 | context.private_weak_roots = .fromOwnedSlice(&weak_roots); | |
| 3465 | 3465 | |
| 3466 | 3466 | const Plan = struct { |
| 3467 | 3467 | old_objects: *[18]Object, |
| @@ -4511,7 +4511,7 @@ test "precise heap realm registry traces relocates and retires one sibling exact | ||
| 4511 | 4511 | const saved_cleanup_jobs = sibling.finalization_cleanup_jobs; |
| 4512 | 4512 | defer sibling.finalization_cleanup_jobs = saved_cleanup_jobs; |
| 4513 | 4513 | var pending_cleanup = [_]*Object{&relocated_sibling_root}; |
| 4514 | sibling.finalization_cleanup_jobs = .{ .items = &pending_cleanup, .capacity = pending_cleanup.len }; | |
| 4514 | sibling.finalization_cleanup_jobs = .fromOwnedSlice(&pending_cleanup); | |
| 4515 | 4515 | try std.testing.expectError(error.RealmNotQuiescent, state.realms.retireQuiescent(sibling)); |
| 4516 | 4516 | sibling.finalization_cleanup_jobs = .empty; |
| 4517 | 4517 | try std.testing.expectError(error.OwnerCannotRetire, state.realms.retireQuiescent(owner)); |
| @@ -4700,7 +4700,7 @@ test "precise sibling realm shares one heap and retires only after cross-realm h | ||
| 4700 | 4700 | const moving_handle = try sibling.protectValue(moving_value); |
| 4701 | 4701 | const saved_cleanup_jobs = sibling.finalization_cleanup_jobs; |
| 4702 | 4702 | var pending_cleanup = [_]*Object{moving_handle.get().asObj()}; |
| 4703 | sibling.finalization_cleanup_jobs = .{ .items = &pending_cleanup, .capacity = pending_cleanup.len }; | |
| 4703 | sibling.finalization_cleanup_jobs = .fromOwnedSlice(&pending_cleanup); | |
| 4704 | 4704 | try std.testing.expectEqual(.unsupported, owner.compactGarbage().status); |
| 4705 | 4705 | sibling.finalization_cleanup_jobs = saved_cleanup_jobs; |
| 4706 | 4706 | const compaction = owner.compactGarbage(); |