Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1244)

Unified Diff: src/objects.cc

Issue 2079823002: [stubs] Implementing CodeStubAssembler::GetOwnProperty(). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixing TryHasOwnProperty and addressing comments Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index a5da88a0b3b2e0b5e44b17e0918d17655ea38e09..0336441f8d5812e38d082e5a013a8b1a7127dd8e 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -16164,8 +16164,7 @@ int NameDictionaryBase<Derived, Shape>::FindEntry(Handle<Name> key) {
uint32_t count = 1;
Isolate* isolate = this->GetIsolate();
while (true) {
- int index = Derived::EntryToIndex(entry);
- Object* element = this->get(index);
+ Object* element = this->KeyAt(entry);
if (element->IsUndefined(isolate)) break; // Empty entry.
if (*key == element) return entry;
DCHECK(element->IsTheHole(isolate) || element->IsUniqueName());
@@ -16261,11 +16260,11 @@ void HashTable<Derived, Shape, Key>::Rehash(Key key) {
// are placed correctly. Other elements might need to be moved.
done = true;
for (uint32_t current = 0; current < capacity; current++) {
- Object* current_key = get(EntryToIndex(current));
+ Object* current_key = KeyAt(current);
if (IsKey(isolate, current_key)) {
uint32_t target = EntryForProbe(key, current_key, probe, current);
if (current == target) continue;
- Object* target_key = get(EntryToIndex(target));
+ Object* target_key = KeyAt(target);
if (!IsKey(target_key) ||
EntryForProbe(key, target_key, probe, target) != target) {
// Put the current element into the correct position.
@@ -16284,8 +16283,8 @@ void HashTable<Derived, Shape, Key>::Rehash(Key key) {
Object* the_hole = isolate->heap()->the_hole_value();
Object* undefined = isolate->heap()->undefined_value();
for (uint32_t current = 0; current < capacity; current++) {
- if (get(EntryToIndex(current)) == the_hole) {
- set(EntryToIndex(current), undefined);
+ if (KeyAt(current) == the_hole) {
+ set(EntryToIndex(current) + Derived::kEntryKeyIndex, undefined);
}
}
SetNumberOfDeletedElements(0);
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698