summaryrefslogtreecommitdiff
path: root/chromium/v8/src/utils
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-11-18 16:35:47 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-11-18 15:45:54 +0000
commit32f5a1c56531e4210bc4cf8d8c7825d66e081888 (patch)
treeeeeec6822f4d738d8454525233fd0e2e3a659e6d /chromium/v8/src/utils
parent99677208ff3b216fdfec551fbe548da5520cd6fb (diff)
downloadqtwebengine-chromium-32f5a1c56531e4210bc4cf8d8c7825d66e081888.tar.gz
BASELINE: Update Chromium to 87.0.4280.67
Change-Id: Ib157360be8c2ffb2c73125751a89f60e049c1d54 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/v8/src/utils')
-rw-r--r--chromium/v8/src/utils/identity-map.cc15
-rw-r--r--chromium/v8/src/utils/identity-map.h3
-rw-r--r--chromium/v8/src/utils/utils.h4
3 files changed, 16 insertions, 6 deletions
diff --git a/chromium/v8/src/utils/identity-map.cc b/chromium/v8/src/utils/identity-map.cc
index e940b043959..909c175007b 100644
--- a/chromium/v8/src/utils/identity-map.cc
+++ b/chromium/v8/src/utils/identity-map.cc
@@ -5,6 +5,7 @@
#include "src/utils/identity-map.h"
#include "src/base/functional.h"
+#include "src/base/logging.h"
#include "src/heap/heap.h"
#include "src/roots/roots-inl.h"
@@ -23,10 +24,12 @@ IdentityMapBase::~IdentityMapBase() {
void IdentityMapBase::Clear() {
if (keys_) {
DCHECK(!is_iterable());
- heap_->UnregisterStrongRoots(FullObjectSlot(keys_));
+ DCHECK_NOT_NULL(strong_roots_entry_);
+ heap_->UnregisterStrongRoots(strong_roots_entry_);
DeletePointerArray(reinterpret_cast<void**>(keys_), capacity_);
DeletePointerArray(values_, capacity_);
keys_ = nullptr;
+ strong_roots_entry_ = nullptr;
values_ = nullptr;
size_ = 0;
capacity_ = 0;
@@ -164,8 +167,8 @@ IdentityMapBase::RawEntry IdentityMapBase::GetEntry(Address key) {
values_ = NewPointerArray(capacity_);
memset(values_, 0, sizeof(void*) * capacity_);
- heap_->RegisterStrongRoots(FullObjectSlot(keys_),
- FullObjectSlot(keys_ + capacity_));
+ strong_roots_entry_ = heap_->RegisterStrongRoots(
+ FullObjectSlot(keys_), FullObjectSlot(keys_ + capacity_));
}
int index = LookupOrInsert(key);
return &values_[index];
@@ -284,9 +287,9 @@ void IdentityMapBase::Resize(int new_capacity) {
}
// Unregister old keys and register new keys.
- heap_->UnregisterStrongRoots(FullObjectSlot(old_keys));
- heap_->RegisterStrongRoots(FullObjectSlot(keys_),
- FullObjectSlot(keys_ + capacity_));
+ DCHECK_NOT_NULL(strong_roots_entry_);
+ heap_->UpdateStrongRoots(strong_roots_entry_, FullObjectSlot(keys_),
+ FullObjectSlot(keys_ + capacity_));
// Delete old storage;
DeletePointerArray(reinterpret_cast<void**>(old_keys), old_capacity);
diff --git a/chromium/v8/src/utils/identity-map.h b/chromium/v8/src/utils/identity-map.h
index a8d7b40bc2d..362a3decfa8 100644
--- a/chromium/v8/src/utils/identity-map.h
+++ b/chromium/v8/src/utils/identity-map.h
@@ -14,6 +14,7 @@ namespace internal {
// Forward declarations.
class Heap;
+class StrongRootsEntry;
// Base class of identity maps contains shared code for all template
// instantions.
@@ -38,6 +39,7 @@ class V8_EXPORT_PRIVATE IdentityMapBase {
capacity_(0),
mask_(0),
keys_(nullptr),
+ strong_roots_entry_(nullptr),
values_(nullptr),
is_iterable_(false) {}
virtual ~IdentityMapBase();
@@ -76,6 +78,7 @@ class V8_EXPORT_PRIVATE IdentityMapBase {
int capacity_;
int mask_;
Address* keys_;
+ StrongRootsEntry* strong_roots_entry_;
void** values_;
bool is_iterable_;
diff --git a/chromium/v8/src/utils/utils.h b/chromium/v8/src/utils/utils.h
index 2c7bb70bbd3..7ec0dd2c000 100644
--- a/chromium/v8/src/utils/utils.h
+++ b/chromium/v8/src/utils/utils.h
@@ -505,6 +505,10 @@ class FeedbackSlot {
V8_EXPORT_PRIVATE friend std::ostream& operator<<(std::ostream& os,
FeedbackSlot);
+ FeedbackSlot WithOffset(int offset) const {
+ return FeedbackSlot(id_ + offset);
+ }
+
private:
static const int kInvalidSlot = -1;