Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/perry-runtime/src/array/element_shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -838,12 +838,12 @@ pub extern "C" fn js_array_element_shape_check(
// those two — and only those two — are anchored. The other four stay
// unanchored and dead-strippable until something emits a call to them.
#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_ARRAY_ENSURE_ELEMENT_SHAPE: extern "C" fn(*mut ArrayHeader) -> i32 =
js_array_ensure_element_shape;

#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_ARRAY_ENSURE_ELEMENT_SHAPE_ORDINARY: extern "C" fn(*mut ArrayHeader) -> i32 =
js_array_ensure_element_shape_ordinary;

Expand Down
8 changes: 4 additions & 4 deletions crates/perry-runtime/src/array/fill_extend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,23 +240,23 @@ pub extern "C" fn js_array_fill_f64_iota_len_extend(arr: *mut ArrayHeader) -> *m
}

#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_ARRAY_FILL_F64_CONST_EXTEND: extern "C" fn(
*mut ArrayHeader,
u32,
f64,
) -> *mut ArrayHeader = js_array_fill_f64_const_extend;
#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_ARRAY_FILL_F64_IOTA_EXTEND: extern "C" fn(*mut ArrayHeader, u32) -> *mut ArrayHeader =
js_array_fill_f64_iota_extend;
#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_ARRAY_FILL_F64_CONST_LEN_EXTEND: extern "C" fn(
*mut ArrayHeader,
f64,
) -> *mut ArrayHeader = js_array_fill_f64_const_len_extend;
#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_ARRAY_FILL_F64_IOTA_LEN_EXTEND: extern "C" fn(*mut ArrayHeader) -> *mut ArrayHeader =
js_array_fill_f64_iota_len_extend;
6 changes: 3 additions & 3 deletions crates/perry-runtime/src/array/from_concat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ pub extern "C" fn js_array_from_value(boxed: f64) -> *mut ArrayHeader {
}

#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_ARRAY_FROM_VALUE: extern "C" fn(f64) -> *mut ArrayHeader = js_array_from_value;

/// `Array.from(source, mapFn, thisArg)` — the mapped form. Throws for nullish
Expand All @@ -182,7 +182,7 @@ pub extern "C" fn js_array_from_mapped(
}

#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_ARRAY_FROM_MAPPED: extern "C" fn(f64, f64, f64) -> *mut ArrayHeader =
js_array_from_mapped;

Expand Down Expand Up @@ -301,7 +301,7 @@ pub extern "C" fn js_array_concat_variadic(
}

#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_ARRAY_CONCAT_VARIADIC: extern "C" fn(
*const ArrayHeader,
*const f64,
Expand Down
12 changes: 6 additions & 6 deletions crates/perry-runtime/src/array/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,7 @@ fn clamp_index(v: f64, len: i64) -> i64 {
// (codegen-only reference) compile path (see #3320 — `#[no_mangle]` alone is
// not enough once the bitcode is re-linked).
#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_ARRAYLIKE_CB: [extern "C" fn(f64, f64, f64) -> f64; 9] = [
js_arraylike_forEach,
js_arraylike_map,
Expand All @@ -1327,24 +1327,24 @@ static KEEP_ARRAYLIKE_CB: [extern "C" fn(f64, f64, f64) -> f64; 9] = [
js_arraylike_findLastIndex,
];
#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_ARRAYLIKE_REDUCE: [extern "C" fn(f64, f64, i32, f64) -> f64; 2] =
[js_arraylike_reduce, js_arraylike_reduceRight];
#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_ARRAYLIKE_SEARCH: [extern "C" fn(f64, f64, f64, i32) -> f64; 3] = [
js_arraylike_indexOf,
js_arraylike_lastIndexOf,
js_arraylike_includes,
];
#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_ARRAYLIKE_AT: extern "C" fn(f64, f64) -> f64 = js_arraylike_at;
#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_ARRAYLIKE_JOIN: extern "C" fn(f64, f64) -> f64 = js_arraylike_join;
#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_ARRAYLIKE_SLICE: extern "C" fn(f64, f64, i32, f64, i32) -> f64 = js_arraylike_slice;

/// A receiver that reached a dense `ArrayHeader` entry point but is actually
Expand Down
4 changes: 2 additions & 2 deletions crates/perry-runtime/src/array/generic_object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,9 +482,9 @@ pub extern "C" fn js_arraylike_splice(recv: f64, args_ptr: *const f64, count: i3
}

#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_ARRAYLIKE_SORT: extern "C" fn(f64, f64) -> f64 = js_arraylike_sort;
#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_ARRAYLIKE_VARIADIC: [extern "C" fn(f64, *const f64, i32) -> f64; 2] =
[js_arraylike_concat, js_arraylike_splice];
16 changes: 8 additions & 8 deletions crates/perry-runtime/src/array/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ pub extern "C" fn js_tagged_template_get_or_init(
}

#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_TAGGED_TEMPLATE_GET_OR_INIT: extern "C" fn(
u64,
*mut ArrayHeader,
Expand Down Expand Up @@ -1646,31 +1646,31 @@ pub extern "C" fn js_array_is_numeric_f64_layout(arr: *const ArrayHeader) -> i32
// These raw numeric-array helpers are called from generated code, so release/LTO
// builds may otherwise internalize and strip the `#[no_mangle]` exports.
#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_JS_ARRAY_NUMERIC_VALUE_TO_RAW_F64: extern "C" fn(f64) -> f64 =
js_array_numeric_value_to_raw_f64;
#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_JS_ARRAY_MARK_NUMERIC_F64_LAYOUT: extern "C" fn(*mut ArrayHeader) -> i32 =
js_array_mark_numeric_f64_layout;
#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_JS_ARRAY_CLEAR_NUMERIC_LAYOUT: extern "C" fn(*mut ArrayHeader) =
js_array_clear_numeric_layout;
#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_JS_ARRAY_NOTE_NUMERIC_WRITE: extern "C" fn(*mut ArrayHeader, u64) =
js_array_note_numeric_write;
#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_JS_ARRAY_DECLARE_ALL_POINTER_ELEMENTS: extern "C" fn(*mut ArrayHeader) =
js_array_declare_all_pointer_elements;
#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_JS_ARRAY_IS_NUMERIC_F64_LAYOUT: extern "C" fn(*const ArrayHeader) -> i32 =
js_array_is_numeric_f64_layout;
#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_JS_ARRAY_REFRESH_LOCAL_HEAD: extern "C" fn(f64) -> f64 = js_array_refresh_local_head;

/// Calculate the byte size for an array with N elements capacity
Expand Down
2 changes: 1 addition & 1 deletion crates/perry-runtime/src/array/immutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,6 @@ pub extern "C" fn js_arraylike_copy_within(
}

#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_ARRAYLIKE_COPY_WITHIN: extern "C" fn(f64, f64, f64, i32, f64) -> f64 =
js_arraylike_copy_within;
6 changes: 3 additions & 3 deletions crates/perry-runtime/src/array/indexing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ pub(crate) fn array_get_property_by_key(
/// `#[no_mangle]` C export AND survive dead-stripping even when no Rust caller
/// keeps it referenced — mirroring the neighbouring `js_array_push`.
#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_ARRAY_LENGTH: extern "C" fn(*const ArrayHeader) -> u32 = js_array_length;

#[no_mangle]
Expand Down Expand Up @@ -745,11 +745,11 @@ pub extern "C" fn js_array_numeric_set_f64_unboxed(
// These raw numeric-array helpers are called from generated code, so release/LTO
// builds may otherwise internalize and strip the `#[no_mangle]` exports.
#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_JS_ARRAY_NUMERIC_GET_F64_UNBOXED: extern "C" fn(*mut ArrayHeader, u32) -> f64 =
js_array_numeric_get_f64_unboxed;
#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_JS_ARRAY_NUMERIC_SET_F64_UNBOXED: extern "C" fn(*mut ArrayHeader, u32, f64) -> i32 =
js_array_numeric_set_f64_unboxed;

Expand Down
6 changes: 3 additions & 3 deletions crates/perry-runtime/src/array/iter_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1387,7 +1387,7 @@ pub extern "C" fn js_array_to_locale_string(
}

#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_ARRAY_TO_LOCALE_STRING: extern "C" fn(
*const ArrayHeader,
f64,
Expand Down Expand Up @@ -1518,7 +1518,7 @@ pub extern "C" fn js_validate_array_callback(cb_boxed: f64) -> i64 {
}

#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_VALIDATE_ARRAY_CALLBACK: extern "C" fn(f64) -> i64 = js_validate_array_callback;

/// Validate a `map` callback (#4091). Identical to
Expand All @@ -1542,6 +1542,6 @@ pub extern "C" fn js_validate_array_map_callback(arr: i64, cb_boxed: f64) -> i64
}

#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_VALIDATE_ARRAY_MAP_CALLBACK: extern "C" fn(i64, f64) -> i64 =
js_validate_array_map_callback;
2 changes: 1 addition & 1 deletion crates/perry-runtime/src/array/join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ pub extern "C" fn js_array_join_value(
// Codegen lowers `arr.join(sep)` to this symbol. Keep it alive through the
// auto-optimize whole-program-bitcode link.
#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_ARRAY_JOIN_VALUE: extern "C" fn(*const ArrayHeader, f64) -> *mut StringHeader =
js_array_join_value;

Expand Down
6 changes: 3 additions & 3 deletions crates/perry-runtime/src/array/numeric_range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ pub extern "C" fn js_array_numeric_range_add_len(receiver: f64, start: f64, delt
}

#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_ARRAY_NUMERIC_RANGE_ADD: extern "C" fn(f64, f64, f64, f64) -> i64 =
js_array_numeric_range_add;
#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_ARRAY_NUMERIC_RANGE_ADD_LEN: extern "C" fn(f64, f64, f64) -> i64 =
js_array_numeric_range_add_len;

Expand Down Expand Up @@ -242,6 +242,6 @@ pub unsafe extern "C" fn js_array_fill_range_strided_tagged(
}

#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_ARRAY_FILL_RANGE_STRIDED_TAGGED: unsafe extern "C" fn(f64, f64, f64, f64, u64) -> i64 =
js_array_fill_range_strided_tagged;
6 changes: 3 additions & 3 deletions crates/perry-runtime/src/array/push_pop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ pub extern "C" fn js_array_push_u31_with_length(
}

#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_JS_ARRAY_PUSH_U31_WITH_LENGTH: extern "C" fn(
*mut ArrayHeader,
u32,
Expand Down Expand Up @@ -1000,7 +1000,7 @@ pub extern "C" fn js_array_numeric_push_f64_unboxed(
// This raw numeric-array helper is called from generated code, so release/LTO
// builds may otherwise internalize and strip the `#[no_mangle]` export.
#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_JS_ARRAY_NUMERIC_PUSH_F64_UNBOXED: extern "C" fn(
*mut ArrayHeader,
f64,
Expand Down Expand Up @@ -1882,6 +1882,6 @@ fn unshift_array_spec_path(arr: *mut ArrayHeader, items: &[f64]) -> *mut ArrayHe
}

#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_UNSHIFT_VARIADIC: extern "C" fn(*mut ArrayHeader, *const f64, u32) -> *mut ArrayHeader =
js_array_unshift_variadic;
2 changes: 1 addition & 1 deletion crates/perry-runtime/src/array/sort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ pub extern "C" fn js_validate_array_comparator(cmp_boxed: f64) -> i64 {
}

#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_VALIDATE_ARRAY_COMPARATOR: extern "C" fn(f64) -> i64 = js_validate_array_comparator;

#[cold]
Expand Down
6 changes: 3 additions & 3 deletions crates/perry-runtime/src/array/subclass_loop_guard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -663,17 +663,17 @@ fn revalidate_admitted_subclass_live(
}

#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_JS_PACKED_ARRAYLIKE_LOOP_GUARD: extern "C" fn(f64, f64, i32, *mut u64) -> i32 =
js_packed_arraylike_loop_guard;

#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_JS_PACKED_ARRAYLIKE_LOOP_GUARD_LIVE: extern "C" fn(f64, f64, i32, *mut u64) -> i64 =
js_packed_arraylike_loop_guard_live;

#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_JS_PACKED_ARRAYLIKE_LOOP_REVALIDATE_LIVE: extern "C" fn(
f64,
f64,
Expand Down
2 changes: 1 addition & 1 deletion crates/perry-runtime/src/array/subclass_packed_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ pub extern "C" fn js_packed_arraylike_index_get(
crate::value::js_dyn_index_get(receiver, index)
}
#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_JS_PACKED_ARRAYLIKE_INDEX_GET: extern "C" fn(
f64,
f64,
Expand Down
2 changes: 1 addition & 1 deletion crates/perry-runtime/src/bigint/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ pub extern "C" fn js_bigint_from_i128_parts(lo: u64, hi: i64) -> *mut BigIntHead
}

#[cfg(feature = "keepalive-anchors")]
#[used]
#[used(compiler)]
static KEEP_JS_BIGINT_FROM_I128_PARTS: extern "C" fn(u64, i64) -> *mut BigIntHeader =
js_bigint_from_i128_parts;

Expand Down
Loading
Loading