[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/1245741
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56241}
This commit is contained in:
Peter Marshall 2018-09-26 13:25:24 +02:00 committed by Commit Bot
parent 6d86857cd4
commit 5fb5509786
2 changed files with 10 additions and 1 deletions

View File

@ -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

View File

@ -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()),