Skip to content

Commit 23e3b6f

Browse files
nickieV8 LUCI CQ
authored andcommitted
[api] Remove deprecated API
This CL removes and cleans up some API that has been marked as deprecated since M122 or earlier. Bug: chromium:1454114 Change-Id: Iaaf313da2217505f5f40d72619021fc509b7f312 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5345409 Commit-Queue: Nikolaos Papaspyrou <[email protected]> Reviewed-by: Michael Lippautz <[email protected]> Cr-Commit-Position: refs/heads/main@{#92674}
1 parent 8372e2c commit 23e3b6f

5 files changed

Lines changed: 2 additions & 109 deletions

File tree

include/v8-context.h

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -181,27 +181,8 @@ class V8_EXPORT Context : public Data {
181181
* also be considered for freezing should be added to the children_out
182182
* parameter. Returns true if the operation completed successfully.
183183
*/
184-
V8_DEPRECATED("Please use the version that takes a LocalVector&")
185184
virtual bool FreezeEmbedderObjectAndGetChildren(
186-
Local<Object> obj, std::vector<Local<Object>>& children_out) {
187-
// TODO(chromium:1454114): This method is temporarily defined in order to
188-
// smoothen the transition to the version that follows.
189-
return true;
190-
}
191-
virtual bool FreezeEmbedderObjectAndGetChildren(
192-
Local<Object> obj, LocalVector<Object>& children_out) {
193-
// TODO(chromium:1454114): This method is temporarily defined and
194-
// calls the previous version, soon to be deprecated, in order to
195-
// smoothen the transition. When deprecation is completed, this
196-
// will become an abstract method.
197-
std::vector<Local<Object>> children;
198-
START_ALLOW_USE_DEPRECATED()
199-
// Temporarily use the old callback.
200-
bool result = FreezeEmbedderObjectAndGetChildren(obj, children);
201-
END_ALLOW_USE_DEPRECATED()
202-
children_out.insert(children_out.end(), children.begin(), children.end());
203-
return result;
204-
}
185+
Local<Object> obj, LocalVector<Object>& children_out) = 0;
205186
};
206187

207188
/**

include/v8-script.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,6 @@ class V8_EXPORT Module : public Data {
291291
* module_name is used solely for logging/debugging and doesn't affect module
292292
* behavior.
293293
*/
294-
V8_DEPRECATED("Please use the version that takes a MemorySpan")
295-
static Local<Module> CreateSyntheticModule(
296-
Isolate* isolate, Local<String> module_name,
297-
const std::vector<Local<String>>& export_names,
298-
SyntheticModuleEvaluationSteps evaluation_steps);
299294
static Local<Module> CreateSyntheticModule(
300295
Isolate* isolate, Local<String> module_name,
301296
const MemorySpan<const Local<String>>& export_names,
@@ -311,17 +306,6 @@ class V8_EXPORT Module : public Data {
311306
V8_WARN_UNUSED_RESULT Maybe<bool> SetSyntheticModuleExport(
312307
Isolate* isolate, Local<String> export_name, Local<Value> export_value);
313308

314-
/**
315-
* Search the modules requested directly or indirectly by the module for
316-
* any top-level await that has not yet resolved. If there is any, the
317-
* returned vector contains a tuple of the unresolved module and a message
318-
* with the pending top-level await.
319-
* An embedder may call this before exiting to improve error messages.
320-
*/
321-
V8_DEPRECATED("Please use GetStalledTopLevelAwaitMessages")
322-
std::vector<std::tuple<Local<Module>, Local<Message>>>
323-
GetStalledTopLevelAwaitMessage(Isolate* isolate);
324-
325309
/**
326310
* Search the modules requested directly or indirectly by the module for
327311
* any top-level await that has not yet resolved. If there is any, the

include/v8-statistics.h

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -61,33 +61,8 @@ class V8_EXPORT MeasureMemoryDelegate {
6161
*/
6262
virtual bool ShouldMeasure(Local<Context> context) = 0;
6363

64-
/**
65-
* This function is called when memory measurement finishes.
66-
*
67-
* \param context_sizes_in_bytes a vector of (context, size) pairs that
68-
* includes each context for which ShouldMeasure returned true and that
69-
* was not garbage collected while the memory measurement was in progress.
70-
*
71-
* \param unattributed_size_in_bytes total size of objects that were not
72-
* attributed to any context (i.e. are likely shared objects).
73-
*/
74-
V8_DEPRECATED("Please use the version that takes a result struct")
75-
virtual void MeasurementComplete(
76-
const std::vector<std::pair<Local<Context>, size_t>>&
77-
context_sizes_in_bytes,
78-
size_t unattributed_size_in_bytes) {}
79-
8064
/** Holds the result of a memory measurement request. */
8165
struct Result {
82-
/**
83-
* A vector of (context, size) pairs that includes each context for
84-
* which ShouldMeasure returned true and that was not garbage collected
85-
* while the memory measurement was in progress.
86-
*/
87-
V8_DEPRECATED("Please use contexts and sizes_in_bytes")
88-
const std::vector<std::pair<Local<Context>, size_t>>&
89-
context_sizes_in_bytes;
90-
9166
/**
9267
* Two spans of equal length: the first includes each context for which
9368
* ShouldMeasure returned true and that was not garbage collected while

src/api/api.cc

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2451,16 +2451,6 @@ MaybeLocal<Value> Module::Evaluate(Local<Context> context) {
24512451
RETURN_ESCAPED(result);
24522452
}
24532453

2454-
Local<Module> Module::CreateSyntheticModule(
2455-
Isolate* v8_isolate, Local<String> module_name,
2456-
const std::vector<Local<String>>& export_names,
2457-
v8::Module::SyntheticModuleEvaluationSteps evaluation_steps) {
2458-
return CreateSyntheticModule(
2459-
v8_isolate, module_name,
2460-
MemorySpan<const Local<String>>(export_names.begin(), export_names.end()),
2461-
evaluation_steps);
2462-
}
2463-
24642454
Local<Module> Module::CreateSyntheticModule(
24652455
Isolate* v8_isolate, Local<String> module_name,
24662456
const MemorySpan<const Local<String>>& export_names,
@@ -2501,33 +2491,6 @@ Maybe<bool> Module::SetSyntheticModuleExport(Isolate* v8_isolate,
25012491
return Just(true);
25022492
}
25032493

2504-
std::vector<std::tuple<Local<Module>, Local<Message>>>
2505-
Module::GetStalledTopLevelAwaitMessage(Isolate* isolate) {
2506-
auto i_isolate = reinterpret_cast<i::Isolate*>(isolate);
2507-
auto self = Utils::OpenDirectHandle(this);
2508-
Utils::ApiCheck(i::IsSourceTextModule(*self),
2509-
"v8::Module::GetStalledTopLevelAwaitMessage",
2510-
"v8::Module::GetStalledTopLevelAwaitMessage must only be "
2511-
"called on a SourceTextModule");
2512-
std::vector<
2513-
std::tuple<i::Handle<i::SourceTextModule>, i::Handle<i::JSMessageObject>>>
2514-
stalled_awaits = i::DirectHandle<i::SourceTextModule>::cast(self)
2515-
->GetStalledTopLevelAwaitMessages(i_isolate);
2516-
2517-
std::vector<std::tuple<Local<Module>, Local<Message>>> result;
2518-
size_t stalled_awaits_count = stalled_awaits.size();
2519-
if (stalled_awaits_count == 0) {
2520-
return result;
2521-
}
2522-
result.reserve(stalled_awaits_count);
2523-
for (size_t i = 0; i < stalled_awaits_count; ++i) {
2524-
auto [module, message] = stalled_awaits[i];
2525-
result.push_back(std::make_tuple(ToApiHandle<Module>(module),
2526-
ToApiHandle<Message>(message)));
2527-
}
2528-
return result;
2529-
}
2530-
25312494
std::pair<LocalVector<Module>, LocalVector<Message>>
25322495
Module::GetStalledTopLevelAwaitMessages(Isolate* isolate) {
25332496
auto i_isolate = reinterpret_cast<i::Isolate*>(isolate);

src/heap/memory-measurement.cc

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,6 @@ void MemoryMeasurement::ReportResults() {
342342
v8::LocalVector<v8::Context> contexts(
343343
reinterpret_cast<v8::Isolate*>(isolate_));
344344
std::vector<size_t> size_in_bytes;
345-
// TODO(chromium:1454114): The vector of pairs will be removed when
346-
// deprecation is complete.
347-
std::vector<std::pair<v8::Local<v8::Context>, size_t>> sizes;
348345
DCHECK_EQ(request.sizes.size(),
349346
static_cast<size_t>(request.contexts->length()));
350347
for (int i = 0; i < request.contexts->length(); i++) {
@@ -356,20 +353,13 @@ void MemoryMeasurement::ReportResults() {
356353
direct_handle(raw_context, isolate_), isolate_);
357354
contexts.push_back(context);
358355
size_in_bytes.push_back(request.sizes[i]);
359-
sizes.emplace_back(context, request.sizes[i]);
360356
}
361-
// Temporarily call both old and new callbacks.
362-
START_ALLOW_USE_DEPRECATED()
363-
request.delegate->MeasurementComplete(sizes, request.shared);
364357
request.delegate->MeasurementComplete(
365-
{sizes, // TODO(chromium:1454114): This will be removed when
366-
// deprecation is complete.
367-
{contexts.begin(), contexts.end()},
358+
{{contexts.begin(), contexts.end()},
368359
{size_in_bytes.begin(), size_in_bytes.end()},
369360
request.shared,
370361
request.wasm_code,
371362
request.wasm_metadata});
372-
END_ALLOW_USE_DEPRECATED()
373363
isolate_->counters()->measure_memory_delay_ms()->AddSample(
374364
static_cast<int>(request.timer.Elapsed().InMilliseconds()));
375365
}

0 commit comments

Comments
 (0)