Commit c6368d29 authored by Jakob Gruber's avatar Jakob Gruber Committed by Commit Bot

[api] Add Isolate::GetEmbeddedCodeRange

... to expose the memory region containing embedded builtins. Similar
to `GetCodeRange`, which does the same for on-heap V8 Code objects.

Bug: v8:11001
Change-Id: I1aa3ae650f161cabb410c61dbb6d364908370f8f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2465461
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70470}
parent 82a8bfdf
......@@ -9367,6 +9367,12 @@ class V8_EXPORT Isolate {
*/
void GetCodeRange(void** start, size_t* length_in_bytes);
/**
* As GetCodeRange, but for embedded builtins (these live in a distinct
* memory region from other V8 Code objects).
*/
void GetEmbeddedCodeRange(const void** start, size_t* length_in_bytes);
/**
* Returns the JSEntryStubs necessary for use with the Unwinder API.
*/
......
......@@ -100,6 +100,7 @@
#include "src/regexp/regexp-utils.h"
#include "src/runtime/runtime.h"
#include "src/snapshot/code-serializer.h"
#include "src/snapshot/embedded/embedded-data.h"
#include "src/snapshot/snapshot.h"
#include "src/snapshot/startup-serializer.h" // For SerializedHandleChecker.
#include "src/strings/char-predicates-inl.h"
......@@ -9009,6 +9010,14 @@ void Isolate::GetCodeRange(void** start, size_t* length_in_bytes) {
*length_in_bytes = code_range.size();
}
void Isolate::GetEmbeddedCodeRange(const void** start,
size_t* length_in_bytes) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
i::EmbeddedData d = i::EmbeddedData::FromBlob(isolate);
*start = reinterpret_cast<const void*>(d.code());
*length_in_bytes = d.code_size();
}
JSEntryStubs Isolate::GetJSEntryStubs() {
JSEntryStubs entry_stubs;
......
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