Commit 5fb55097 authored by Peter Marshall's avatar Peter Marshall Committed by Commit Bot

[API] Change GetCodeRange to match the style of GetEmbeddedCodeRange

Deprecate GetCodeRange(void** start, size_t* length_in_bytes) in favor
of a new signature MemoryRange GetCodeRange() which is consistent with
that of GetEmbeddedCodeRange.

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Ic5e244981422a2c75485c851ca768e54914cc539
Reviewed-on: https://chromium-review.googlesource.com/1245741Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56241}
parent 6d86857c
......@@ -8113,7 +8113,9 @@ class V8_EXPORT Isolate {
*
* https://code.google.com/p/v8/issues/detail?id=3598
*/
void GetCodeRange(void** start, size_t* length_in_bytes);
V8_DEPRECATE_SOON("Use MemoryRange GetCodeRange()",
void GetCodeRange(void** start, size_t* length_in_bytes));
MemoryRange GetCodeRange();
/**
* Returns a memory range containing the code for V8's embedded functions
......
......@@ -8718,6 +8718,13 @@ void Isolate::GetCodeRange(void** start, size_t* length_in_bytes) {
*length_in_bytes = code_range.size();
}
MemoryRange Isolate::GetCodeRange() {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
const base::AddressRegion& code_range =
isolate->heap()->memory_allocator()->code_range();
return {reinterpret_cast<void*>(code_range.begin()), code_range.size()};
}
MemoryRange Isolate::GetEmbeddedCodeRange() {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
return {reinterpret_cast<const void*>(isolate->embedded_blob()),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment