Commit ce311ed0 authored by hpayer's avatar hpayer Committed by Commit bot

Regularly check hash set addresses to verify memory integrity.

BUG=

Review URL: https://codereview.chromium.org/804603006

Cr-Commit-Position: refs/heads/master@{#26002}
parent 0959123e
......@@ -81,6 +81,9 @@ void StoreBuffer::SetUp() {
hash_sets_are_empty_ = false;
ClearFilteringHashSets();
heap_->isolate()->set_store_buffer_hash_set_1_address(hash_set_1_);
heap_->isolate()->set_store_buffer_hash_set_2_address(hash_set_2_);
}
......@@ -554,6 +557,9 @@ void StoreBuffer::IteratePointersToNewSpace(ObjectSlotCallback slot_callback,
void StoreBuffer::Compact() {
CHECK(hash_set_1_ == heap_->isolate()->store_buffer_hash_set_1_address());
CHECK(hash_set_2_ == heap_->isolate()->store_buffer_hash_set_2_address());
Address* top = reinterpret_cast<Address*>(heap_->store_buffer_top());
if (top == start_) return;
......
......@@ -1657,6 +1657,8 @@ Isolate::Isolate(bool enable_serializer)
// TODO(bmeurer) Initialized lazily because it depends on flags; can
// be fixed once the default isolate cleanup is done.
random_number_generator_(NULL),
store_buffer_hash_set_1_address_(NULL),
store_buffer_hash_set_2_address_(NULL),
serializer_enabled_(enable_serializer),
has_fatal_error_(false),
initialized_from_snapshot_(false),
......
......@@ -1118,6 +1118,24 @@ class Isolate {
int GetNextUniqueSharedFunctionInfoId() { return next_unique_sfi_id_++; }
#endif
void set_store_buffer_hash_set_1_address(
uintptr_t* store_buffer_hash_set_1_address) {
store_buffer_hash_set_1_address_ = store_buffer_hash_set_1_address;
}
uintptr_t* store_buffer_hash_set_1_address() {
return store_buffer_hash_set_1_address_;
}
void set_store_buffer_hash_set_2_address(
uintptr_t* store_buffer_hash_set_2_address) {
store_buffer_hash_set_2_address_ = store_buffer_hash_set_2_address;
}
uintptr_t* store_buffer_hash_set_2_address() {
return store_buffer_hash_set_2_address_;
}
private:
explicit Isolate(bool enable_serializer);
......@@ -1270,6 +1288,9 @@ class Isolate {
unibrow::Mapping<unibrow::Ecma262Canonicalize> interp_canonicalize_mapping_;
CallInterfaceDescriptorData* call_descriptor_data_;
base::RandomNumberGenerator* random_number_generator_;
// TODO(hpayer): Remove the following store buffer addresses.
uintptr_t* store_buffer_hash_set_1_address_;
uintptr_t* store_buffer_hash_set_2_address_;
// Whether the isolate has been created for snapshotting.
bool serializer_enabled_;
......
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