Commit 779bb1b1 authored by Jeremy Roman's avatar Jeremy Roman Committed by Commit Bot

[snapshot] Make the API external reference table const.

Chromium side: https://chromium-review.googlesource.com/c/chromium/src/+/639552

Bug: chromium:759831
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I1b217c4fa4c930733dcfab982879bf41936a3a83
Reviewed-on: https://chromium-review.googlesource.com/639551
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47683}
parent 5e284d9a
......@@ -6830,7 +6830,7 @@ class V8_EXPORT Isolate {
* deserialization. This array and its content must stay valid for the
* entire lifetime of the isolate.
*/
intptr_t* external_references;
const intptr_t* external_references;
/**
* Whether calling Atomics.wait (a function that may block) is allowed in
......@@ -8175,7 +8175,7 @@ class V8_EXPORT SnapshotCreator {
* \param external_references a null-terminated array of external references
* that must be equivalent to CreateParams::external_references.
*/
SnapshotCreator(intptr_t* external_references = nullptr,
SnapshotCreator(const intptr_t* external_references = nullptr,
StartupData* existing_blob = nullptr);
~SnapshotCreator();
......
......@@ -563,7 +563,7 @@ struct SnapshotCreatorData {
} // namespace
SnapshotCreator::SnapshotCreator(intptr_t* external_references,
SnapshotCreator::SnapshotCreator(const intptr_t* external_references,
StartupData* existing_snapshot) {
i::Isolate* internal_isolate = new i::Isolate(true);
Isolate* isolate = reinterpret_cast<Isolate*>(internal_isolate);
......
......@@ -430,7 +430,7 @@ typedef std::vector<HeapObject*> DebugObjectCache;
V(DebugObjectCache*, string_stream_debug_object_cache, nullptr) \
V(Object*, string_stream_current_security_token, nullptr) \
V(ExternalReferenceTable*, external_reference_table, nullptr) \
V(intptr_t*, api_external_references, nullptr) \
V(const intptr_t*, api_external_references, nullptr) \
V(AddressToIndexHashMap*, external_reference_map, nullptr) \
V(HeapObjectToIndexHashMap*, root_index_map, nullptr) \
V(int, pending_microtask_count, 0) \
......
......@@ -33,7 +33,7 @@ ExternalReferenceEncoder::ExternalReferenceEncoder(Isolate* isolate) {
DCHECK(map_->Get(addr).IsJust());
}
// Add external references provided by the embedder.
intptr_t* api_references = isolate->api_external_references();
const intptr_t* api_references = isolate->api_external_references();
if (api_references == nullptr) return;
for (uint32_t i = 0; api_references[i] != 0; ++i) {
Address addr = reinterpret_cast<Address>(api_references[i]);
......
......@@ -48,7 +48,7 @@ class ExternalReferenceEncoder {
#ifdef DEBUG
std::vector<int> count_;
intptr_t* api_references_;
const intptr_t* api_references_;
#endif // DEBUG
DISALLOW_COPY_AND_ASSIGN(ExternalReferenceEncoder);
......
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