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

Unified Diff: src/objects.cc

Issue 1194943002: Inline SetLengthWithoutNormalize into its callers (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Only find last non-configurable element in dicts if it can be present Created 5 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
« src/elements.cc ('K') | « src/objects.h ('k') | no next file » | 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 6dda62f1acb9f3957682cca2195f4187b4da4329..1554a0970656eec5d19c29296132054142f2e24d 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -11934,6 +11934,9 @@ static bool GetOldValue(Isolate* isolate,
void JSArray::SetLength(Handle<JSArray> array, uint32_t new_length) {
// We should never end in here with a pixel or external array.
DCHECK(array->AllowsSetLength());
+ if (JSArray::SetLengthWouldNormalize(array->GetHeap(), new_length)) {
+ JSObject::NormalizeElements(array);
+ }
array->GetElementsAccessor()->SetLength(array, new_length);
}
« src/elements.cc ('K') | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698