deps: patch V8 to 12.4.254.21 · nodejs/node@1b84964 · GitHub
Skip to content

Commit 1b84964

Browse files
nodejs-github-bottargos
authored andcommitted
deps: patch V8 to 12.4.254.21
Refs: v8/v8@12.4.254.20...12.4.254.21 PR-URL: #53470 Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 6acadeb commit 1b84964

4 files changed

Lines changed: 69 additions & 6 deletions

File tree

deps/v8/.gitignore

Lines changed: 1 addition & 0 deletions

deps/v8/include/v8-version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define V8_MAJOR_VERSION 12
1212
#define V8_MINOR_VERSION 4
1313
#define V8_BUILD_NUMBER 254
14-
#define V8_PATCH_LEVEL 20
14+
#define V8_PATCH_LEVEL 21
1515

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

deps/v8/tools/builtins-pgo/download_profiles.py

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"""
1212

1313
import argparse
14+
import contextlib
1415
import os
1516
import pathlib
1617
import re
@@ -79,6 +80,12 @@ def parse_args(cmd_args):
7980
default=DEPOT_TOOLS_DEFAULT_PATH,
8081
)
8182

83+
parser.add_argument(
84+
'--force',
85+
help=('force download, overwriting existing profiles'),
86+
action='store_true',
87+
)
88+
8289
return parser.parse_args(cmd_args)
8390

8491

@@ -109,14 +116,45 @@ def retrieve_version(args):
109116
return version
110117

111118

119+
def download_profiles(version_path, requested_version, args):
120+
if args.force:
121+
return True
122+
123+
if not version_path.is_file():
124+
return True
125+
126+
with open(version_path) as version_file:
127+
profiles_version = version_file.read()
128+
129+
if profiles_version != requested_version:
130+
return True
131+
132+
print('Profiles already downloaded, use --force to overwrite.')
133+
return False
134+
135+
136+
@contextlib.contextmanager
137+
def ensure_profiles(version, args):
138+
version_path = PGO_PROFILE_DIR / 'profiles_version'
139+
require_profiles = download_profiles(version_path, version, args)
140+
yield require_profiles
141+
if require_profiles:
142+
with open(version_path, 'w') as version_file:
143+
version_file.write(version)
144+
145+
112146
def perform_action(version, args):
113147
path = f'{PGO_PROFILE_BUCKET}/by-version/{version}'
114148

115149
if args.action == 'download':
116-
cmd = ['cp', '-R', f'gs://{path}/*.profile', str(PGO_PROFILE_DIR)]
117-
failure_hint = f'https://storage.googleapis.com/{path} does not exist.'
118-
call_gsutil(cmd, failure_hint)
119-
return
150+
with ensure_profiles(version, args) as require_profiles:
151+
if not require_profiles:
152+
return
153+
154+
cmd = ['cp', '-R', f'gs://{path}/*.profile', str(PGO_PROFILE_DIR)]
155+
failure_hint = f'https://storage.googleapis.com/{path} does not exist.'
156+
call_gsutil(cmd, failure_hint)
157+
return
120158

121159
if args.action == 'validate':
122160
meta_json = f'{path}/meta.json'

deps/v8/tools/builtins-pgo/download_profiles_test.py

Lines changed: 25 additions & 1 deletion

0 commit comments

Comments
 (0)