summaryrefslogtreecommitdiff
path: root/deps/v8/src/ic/stub-cache.cc
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2018-09-07 17:07:13 +0200
committerMichaël Zasso <targos@protonmail.com>2018-09-07 20:59:13 +0200
commit586db2414a338e1bf6eaf6e672a3adc7ce309f6a (patch)
tree139fa972aef648481ddee22a3a85b99707d28df5 /deps/v8/src/ic/stub-cache.cc
parent12ed7c94e5160aa6d38e3d2cb2a73dae0a6f9342 (diff)
downloadnode-new-586db2414a338e1bf6eaf6e672a3adc7ce309f6a.tar.gz
deps: update V8 to 6.9.427.22
PR-URL: https://github.com/nodejs/node/pull/21983 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'deps/v8/src/ic/stub-cache.cc')
-rw-r--r--deps/v8/src/ic/stub-cache.cc25
1 files changed, 14 insertions, 11 deletions
diff --git a/deps/v8/src/ic/stub-cache.cc b/deps/v8/src/ic/stub-cache.cc
index a9cafd6648..4958726a22 100644
--- a/deps/v8/src/ic/stub-cache.cc
+++ b/deps/v8/src/ic/stub-cache.cc
@@ -58,31 +58,32 @@ int StubCache::SecondaryOffset(Name* name, int seed) {
namespace {
bool CommonStubCacheChecks(StubCache* stub_cache, Name* name, Map* map,
- Object* handler) {
+ MaybeObject* handler) {
// Validate that the name and handler do not move on scavenge, and that we
// can use identity checks instead of structural equality checks.
- DCHECK(!name->GetHeap()->InNewSpace(name));
- DCHECK(!name->GetHeap()->InNewSpace(handler));
+ DCHECK(!Heap::InNewSpace(name));
+ DCHECK(!Heap::InNewSpace(handler));
DCHECK(name->IsUniqueName());
DCHECK(name->HasHashCode());
- if (handler) DCHECK(IC::IsHandler(MaybeObject::FromObject(handler), true));
+ if (handler) DCHECK(IC::IsHandler(handler));
return true;
}
} // namespace
#endif
-Object* StubCache::Set(Name* name, Map* map, Object* handler) {
+MaybeObject* StubCache::Set(Name* name, Map* map, MaybeObject* handler) {
DCHECK(CommonStubCacheChecks(this, name, map, handler));
// Compute the primary entry.
int primary_offset = PrimaryOffset(name, map);
Entry* primary = entry(primary_, primary_offset);
- Object* old_handler = primary->value;
+ MaybeObject* old_handler = primary->value;
// If the primary entry has useful data in it, we retire it to the
// secondary cache before overwriting it.
- if (old_handler != isolate_->builtins()->builtin(Builtins::kIllegal)) {
+ if (old_handler != MaybeObject::FromObject(
+ isolate_->builtins()->builtin(Builtins::kIllegal))) {
Map* old_map = primary->map;
int seed = PrimaryOffset(primary->key, old_map);
int secondary_offset = SecondaryOffset(primary->key, seed);
@@ -98,7 +99,7 @@ Object* StubCache::Set(Name* name, Map* map, Object* handler) {
return handler;
}
-Object* StubCache::Get(Name* name, Map* map) {
+MaybeObject* StubCache::Get(Name* name, Map* map) {
DCHECK(CommonStubCacheChecks(this, name, map, nullptr));
int primary_offset = PrimaryOffset(name, map);
Entry* primary = entry(primary_, primary_offset);
@@ -115,14 +116,16 @@ Object* StubCache::Get(Name* name, Map* map) {
void StubCache::Clear() {
- Code* empty = isolate_->builtins()->builtin(Builtins::kIllegal);
+ MaybeObject* empty = MaybeObject::FromObject(
+ isolate_->builtins()->builtin(Builtins::kIllegal));
+ Name* empty_string = ReadOnlyRoots(isolate()).empty_string();
for (int i = 0; i < kPrimaryTableSize; i++) {
- primary_[i].key = isolate()->heap()->empty_string();
+ primary_[i].key = empty_string;
primary_[i].map = nullptr;
primary_[i].value = empty;
}
for (int j = 0; j < kSecondaryTableSize; j++) {
- secondary_[j].key = isolate()->heap()->empty_string();
+ secondary_[j].key = empty_string;
secondary_[j].map = nullptr;
secondary_[j].value = empty;
}