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

Unified Diff: src/objects.cc

Issue 2041963003: [elements] Precisely estimate elements size for large-object limits (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: add missing method on string wrapper Created 4 years, 1 month 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 aa4186f7e7500a8bf2bda11e18134c7998facc1e..a6c48d263b33280832abd9672e3940322c4604ad 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -8499,8 +8499,9 @@ bool JSObject::HasEnumerableElements() {
int length = object->IsJSArray()
? Smi::cast(JSArray::cast(object)->length())->value()
: elements->length();
+ Isolate* isolate = GetIsolate();
for (int i = 0; i < length; i++) {
- if (!elements->is_the_hole(i)) return true;
+ if (!elements->is_the_hole(isolate, i)) return true;
}
return false;
}
@@ -16070,12 +16071,13 @@ bool JSArray::WouldChangeReadOnlyLength(Handle<JSArray> array,
template <typename BackingStore>
static int FastHoleyElementsUsage(JSObject* object, BackingStore* store) {
+ Isolate* isolate = store->GetIsolate();
int limit = object->IsJSArray()
? Smi::cast(JSArray::cast(object)->length())->value()
: store->length();
int used = 0;
for (int i = 0; i < limit; ++i) {
- if (!store->is_the_hole(i)) ++used;
+ if (!store->is_the_hole(isolate, i)) ++used;
}
return used;
}
« 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