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

Fix windows compilation

Prior to this CL compilation fails with:

- 'error: offset of on non-standard-layout type' due to offsetof()
- 'Assertion failed: vector subscript out of range' due to the OOB vector subscripts

Change-Id: I8751fafd1058ca839de832267811f8f1f47c53fe
Reviewed-on: https://chromium-review.googlesource.com/c/1400404Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58616}
parent ae8f83fe
......@@ -2193,8 +2193,8 @@ void Heap::ExternalStringTable::IterateAll(RootVisitor* v) {
if (!old_space_strings_.empty()) {
v->VisitRootPointers(
Root::kExternalStringsTable, nullptr,
FullObjectSlot(&old_space_strings_[0]),
FullObjectSlot(&old_space_strings_[old_space_strings_.size()]));
FullObjectSlot(old_space_strings_.data()),
FullObjectSlot(old_space_strings_.data() + old_space_strings_.size()));
}
}
......@@ -2206,8 +2206,8 @@ void Heap::UpdateNewSpaceReferencesInExternalStringTable(
void Heap::ExternalStringTable::UpdateReferences(
Heap::ExternalStringTableUpdaterCallback updater_func) {
if (old_space_strings_.size() > 0) {
FullObjectSlot start(&old_space_strings_[0]);
FullObjectSlot end(&old_space_strings_[old_space_strings_.size()]);
FullObjectSlot start(old_space_strings_.data());
FullObjectSlot end(old_space_strings_.data() + old_space_strings_.size());
for (FullObjectSlot p = start; p < end; ++p)
p.store(updater_func(heap_, p));
}
......
......@@ -18,11 +18,11 @@ namespace v8 {
namespace internal {
const size_t MicrotaskQueue::kRingBufferOffset =
offsetof(MicrotaskQueue, ring_buffer_);
OFFSET_OF(MicrotaskQueue, ring_buffer_);
const size_t MicrotaskQueue::kCapacityOffset =
offsetof(MicrotaskQueue, capacity_);
const size_t MicrotaskQueue::kSizeOffset = offsetof(MicrotaskQueue, size_);
const size_t MicrotaskQueue::kStartOffset = offsetof(MicrotaskQueue, start_);
OFFSET_OF(MicrotaskQueue, capacity_);
const size_t MicrotaskQueue::kSizeOffset = OFFSET_OF(MicrotaskQueue, size_);
const size_t MicrotaskQueue::kStartOffset = OFFSET_OF(MicrotaskQueue, start_);
const intptr_t MicrotaskQueue::kMinimumCapacity = 8;
......
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