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

Unified Diff: src/objects.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/elements.cc ('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 5c1e9aa653684776f9a1cf4d307b941f8dbacc35..4ca3fead1782def067a3f38d354dc2791547ebff 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -14505,8 +14505,8 @@ int JSObject::GetFastElementsUsage() {
case FAST_SMI_ELEMENTS:
case FAST_DOUBLE_ELEMENTS:
case FAST_ELEMENTS:
- // Only JSArray have packed elements.
- return Smi::cast(JSArray::cast(this)->length())->value();
+ return IsJSArray() ? Smi::cast(JSArray::cast(this)->length())->value()
+ : store->length();
case FAST_SLOPPY_ARGUMENTS_ELEMENTS:
store = FixedArray::cast(FixedArray::cast(store)->get(1));
// Fall through.
« no previous file with comments | « src/elements.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698