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

Unified Diff: src/elements.cc

Issue 1433133003: [runtime] Make elements backing store for arguments non-holey. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix another case. Created 5 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/bootstrapper.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/elements.cc
diff --git a/src/elements.cc b/src/elements.cc
index 715ecfb60a5fd5deb1d967449f8b38aab7385036..0798918b89531226d1ca96cf29aed97b53e258de 100644
--- a/src/elements.cc
+++ b/src/elements.cc
@@ -942,8 +942,12 @@ class ElementsAccessorBase : public ElementsAccessor {
? index
: kMaxUInt32;
} else {
- Smi* smi_length = Smi::cast(JSArray::cast(holder)->length());
- uint32_t length = static_cast<uint32_t>(smi_length->value());
+ uint32_t length =
+ holder->IsJSArray()
+ ? static_cast<uint32_t>(
+ Smi::cast(JSArray::cast(holder)->length())->value())
+ : ElementsAccessorSubclass::GetCapacityImpl(holder,
+ backing_store);
return index < length ? index : kMaxUInt32;
}
}
« no previous file with comments | « src/bootstrapper.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698