Skip to content

Commit 378c312

Browse files
authored
build: pin V8 v8-14.9.207.39-12 (#2125)
### Description Bottom of a stacked series that ports the iOS wrapper lifetime modes (NativeScript/ios#558, #559's config, #561, #563; #576's leak probe is redesigned in #2130) to Android. Not ported: #559's `rooted` mode (it reads retain counts, which Java does not have) and #578 (a native-setter fast path in the canary write handler; on Android a write to a Java field still goes through V8 after the handler declines). No PR in the series has performance numbers yet. This PR changes only the V8 pin, so the new binary can be validated, and reverted, on its own. `V8_RELEASE` moves from `v8-14.9.207.39-7` to `-12`. Same V8 version and the same Android patches (`v8_resurrecting_finalizers.patch`, the JS dispatch table reservation, the Android build patch), plus two fixes for named interceptors and a fast path for stores a masking interceptor declines: - **`-10`, NativeScript/v8-buildscripts#11** (`v8_nonmasking_own_lookup.patch`, crbug 585053531): an own-property lookup on an object with a `kNonMasking` interceptor could end on a prototype's interceptor (`Object.hasOwn` true for a prototype-only name, `delete` reaching the prototype). - **`-11`, NativeScript/v8-buildscripts#13** (`v8_create_data_property_interceptor.patch`, `v8_interceptor_define_descriptor.patch`): `JSObject::CreateDataProperty` (define-semantics class fields once warm, `v8::Object::CreateDataProperty`) bypassed named interceptors, and a definer received a plain data property with every attribute inverted. - **`-12`, NativeScript/v8-buildscripts#15** (`v8_declined_interceptor_store_fast_path.patch`): when a masking named interceptor declines a store and the receiver already has that name as an own data field, the store IC overwrites the field directly instead of going through `Runtime_StorePropertyPastInterceptor`. Behind `--store-ic-declined-interceptor-fast-path`, on by default. On a phone, an expando overwrite on a canary goes from 178 to 105 ns; adding a property, writes that end at a prototype accessor, and everything else are unchanged. The canary mode later in this stack puts a masking named interceptor (setter, deleter, definer) on wrapper templates, and needs both. Nothing on Android uses a named interceptor on an instance template today, so this PR alone changes no behaviour. `-8` and `-9` add only Apple TV and Mac Catalyst variants. ### Testing Full suite on an arm64 API 35 emulator with the `-11` arm64 libraries: 1773 specs, 0 failures. With the `-12` patch (the #15 CI arm64 library), at the top of this stack on `main` at a59e6ba: 1895 / 1895 / 1909 specs, 0 failures, in `canary`/`all`, `canary`/`extended` and `resurrecting`. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Chores** * Updated the V8 release from 14.9.207.39-11 to 14.9.207.39-12. * V8 installations now verify that each requested ABI matches the selected release and record the release for each installed ABI. Libraries and release stamps that do not match the selected release are removed during installation. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent a59e6ba commit 378c312

3 files changed

Lines changed: 25 additions & 5 deletions

File tree

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ package-lock.json
3939
/.v8-prebuilt/
4040
test-app/runtime/src/main/libs/*/libv8_monolith.a
4141
test-app/runtime/src/main/libs/.v8-release-stamp
42+
test-app/runtime/src/main/libs/*/.v8-release-stamp
4243
test-app/runtime/src/main/cpp/include/**
4344
!test-app/runtime/src/main/cpp/include/zip.h
4445
!test-app/runtime/src/main/cpp/include/zipconf.h

‎V8_RELEASE‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v8-14.9.207.39-7
1+
v8-14.9.207.39-12

‎download_v8.sh‎

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,20 @@ if [ -z "$RELEASE" ]; then
6767
fi
6868
[ ${#ABIS[@]} -gt 0 ] || ABIS=(arm64-v8a armeabi-v7a x86_64 x86)
6969

70-
# The stamp records which release was installed, not which ABIs were asked for,
71-
# so a previous --abi run must not satisfy a later request for the full set.
72-
# The installed files are the source of truth.
70+
# $STAMP records the release the shared headers came from; each ABI's library
71+
# has its own stamp, since an --abi run installs only some of them.
72+
ABI_STAMP_NAME=".v8-release-stamp"
73+
74+
abi_release() {
75+
local stamp="$LIBS_DIR/$1/$ABI_STAMP_NAME"
76+
[ -f "$LIBS_DIR/$1/libv8_monolith.a" ] && [ -f "$stamp" ] && cat "$stamp"
77+
}
78+
7379
installed() {
7480
[ -f "$STAMP" ] && [ "$(cat "$STAMP")" = "$RELEASE" ] || return 1
7581
[ -f "$CPP_DIR/include/v8.h" ] && [ -d "$CPP_DIR/v8_inspector/src" ] || return 1
7682
for abi in "${ABIS[@]}"; do
77-
[ -f "$LIBS_DIR/$abi/libv8_monolith.a" ] || return 1
83+
[ "$(abi_release "$abi")" = "$RELEASE" ] || return 1
7884
done
7985
}
8086

@@ -132,6 +138,19 @@ for ABI in "${ABIS[@]}"; do
132138
[ -f "$src" ] || { echo "Archive for $ABI has no libv8_monolith.a" >&2; exit 1; }
133139
mkdir -p "$LIBS_DIR/$ABI"
134140
cp "$src" "$LIBS_DIR/$ABI/libv8_monolith.a"
141+
echo "$RELEASE" > "$LIBS_DIR/$ABI/$ABI_STAMP_NAME"
142+
done
143+
144+
# An ABI this run did not install keeps another release's library, which must
145+
# not be linked against the headers installed below: remove it, so a build of
146+
# that ABI fails until it is installed for this release too.
147+
for dir in "$LIBS_DIR"/*/; do
148+
abi="$(basename "$dir")"
149+
[ -f "$dir/libv8_monolith.a" ] || continue
150+
if [ "$(abi_release "$abi")" != "$RELEASE" ]; then
151+
echo " removing $abi's library from another release; run with --abi $abi to install it"
152+
rm -f "$dir/libv8_monolith.a" "$dir/$ABI_STAMP_NAME"
153+
fi
135154
done
136155

137156
echo "Installing public headers"

0 commit comments

Comments
 (0)