[api] Advance deprecation

Marking V8_DEPRECATE_SOON from versions <= v9.1 as V8_DEPRECATED.

Drive-by-fix:
- list_deprecated.py handles non-committed deprecations

Bug: v8:11165
Change-Id: I432e401d9d8d131d423c6a58ff9694abce87cef7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3085275
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76213}
This commit is contained in:
Camillo Bruni 2021-08-10 16:06:40 +02:00 committed by V8 LUCI CQ
parent 2e076e2b15
commit 8e945ced4d
2 changed files with 16 additions and 12 deletions

View File

@ -1441,7 +1441,7 @@ class ScriptOriginOptions {
*/
class ScriptOrigin {
public:
V8_DEPRECATE_SOON("Use constructor with primitive C++ types")
V8_DEPRECATED("Use constructor with primitive C++ types")
V8_INLINE explicit ScriptOrigin(
Local<Value> resource_name, Local<Integer> resource_line_offset,
Local<Integer> resource_column_offset,
@ -1452,7 +1452,7 @@ class ScriptOrigin {
Local<Boolean> is_wasm = Local<Boolean>(),
Local<Boolean> is_module = Local<Boolean>(),
Local<PrimitiveArray> host_defined_options = Local<PrimitiveArray>());
V8_DEPRECATE_SOON("Use constructor that takes an isolate")
V8_DEPRECATED("Use constructor that takes an isolate")
V8_INLINE explicit ScriptOrigin(
Local<Value> resource_name, int resource_line_offset = 0,
int resource_column_offset = 0,
@ -1471,11 +1471,11 @@ class ScriptOrigin {
Local<PrimitiveArray> host_defined_options = Local<PrimitiveArray>());
V8_INLINE Local<Value> ResourceName() const;
V8_DEPRECATE_SOON("Use getter with primitvie C++ types.")
V8_DEPRECATED("Use getter with primitvie C++ types.")
V8_INLINE Local<Integer> ResourceLineOffset() const;
V8_DEPRECATE_SOON("Use getter with primitvie C++ types.")
V8_DEPRECATED("Use getter with primitvie C++ types.")
V8_INLINE Local<Integer> ResourceColumnOffset() const;
V8_DEPRECATE_SOON("Use getter with primitvie C++ types.")
V8_DEPRECATED("Use getter with primitvie C++ types.")
V8_INLINE Local<Integer> ScriptID() const;
V8_INLINE int LineOffset() const;
V8_INLINE int ColumnOffset() const;
@ -1627,14 +1627,14 @@ class V8_EXPORT Module : public Data {
/**
* Returns the number of modules requested by this module.
*/
V8_DEPRECATE_SOON("Use Module::GetModuleRequests() and FixedArray::Length().")
V8_DEPRECATED("Use Module::GetModuleRequests() and FixedArray::Length().")
int GetModuleRequestsLength() const;
/**
* Returns the ith module specifier in this module.
* i must be < GetModuleRequestsLength() and >= 0.
*/
V8_DEPRECATE_SOON(
V8_DEPRECATED(
"Use Module::GetModuleRequests() and ModuleRequest::GetSpecifier().")
Local<String> GetModuleRequest(int i) const;
@ -1642,7 +1642,7 @@ class V8_EXPORT Module : public Data {
* Returns the source location (line number and column number) of the ith
* module specifier's first occurrence in this module.
*/
V8_DEPRECATE_SOON(
V8_DEPRECATED(
"Use Module::GetModuleRequests(), ModuleRequest::GetSourceOffset(), and "
"Module::SourceOffsetToLocation().")
Location GetModuleRequestLocation(int i) const;
@ -1663,7 +1663,7 @@ class V8_EXPORT Module : public Data {
*/
int GetIdentityHash() const;
using ResolveCallback V8_DEPRECATE_SOON("Use ResolveModuleCallback") =
using ResolveCallback V8_DEPRECATED("Use ResolveModuleCallback") =
MaybeLocal<Module> (*)(Local<Context> context, Local<String> specifier,
Local<Module> referrer);
using ResolveModuleCallback = MaybeLocal<Module> (*)(
@ -1677,7 +1677,7 @@ class V8_EXPORT Module : public Data {
* instantiation. (In the case where the callback throws an exception, that
* exception is propagated.)
*/
V8_DEPRECATE_SOON(
V8_DEPRECATED(
"Use the version of InstantiateModule that takes a ResolveModuleCallback "
"parameter")
V8_WARN_UNUSED_RESULT Maybe<bool> InstantiateModule(Local<Context> context,
@ -4314,11 +4314,13 @@ class V8_EXPORT Object : public Value {
/**
* Returns the context in which the object was created.
*/
// TODO(chromium:1166077): Mark as deprecate once users are updated.
V8_DEPRECATE_SOON("Use MaybeLocal<Context> GetCreationContext()")
Local<Context> CreationContext();
MaybeLocal<Context> GetCreationContext();
/** Same as above, but works for Persistents */
// TODO(chromium:1166077): Mark as deprecate once users are updated.
V8_DEPRECATE_SOON(
"Use MaybeLocal<Context> GetCreationContext(const "
"PersistentBase<Object>& object)")
@ -7329,7 +7331,7 @@ using CallCompletedCallback = void (*)(Isolate*);
* fails (e.g. due to stack overflow), the embedder must propagate
* that exception by returning an empty MaybeLocal.
*/
using HostImportModuleDynamicallyCallback V8_DEPRECATE_SOON(
using HostImportModuleDynamicallyCallback V8_DEPRECATED(
"Use HostImportModuleDynamicallyWithImportAssertionsCallback instead") =
MaybeLocal<Promise> (*)(Local<Context> context,
Local<ScriptOrModule> referrer,
@ -8715,7 +8717,7 @@ class V8_EXPORT Isolate {
* This specifies the callback called by the upcoming dynamic
* import() language feature to load modules.
*/
V8_DEPRECATE_SOON(
V8_DEPRECATED(
"Use the version of SetHostImportModuleDynamicallyCallback that takes a "
"HostImportModuleDynamicallyWithImportAssertionsCallback instead")
void SetHostImportModuleDynamicallyCallback(

View File

@ -22,6 +22,8 @@ RE_VERSION_MINOR = re.compile(r".*V8_MINOR_VERSION ([0-9]+)")
def extract_version(hash):
if hash in VERSION_CACHE:
return VERSION_CACHE[hash]
if hash == '0000000000000000000000000000000000000000':
return 'HEAD'
result = subprocess.check_output(
['git', 'show', f"{hash}:include/v8-version.h"], encoding='UTF-8')
major = RE_VERSION_MAJOR.search(result).group(1)