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

Unified Diff: src/elements.cc

Issue 2173653003: [elements] Omit fast path in PrependElementIndices (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: avoid slow join in repro Created 4 years, 5 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 | « no previous file | test/mjsunit/regress/regress-crbug-630561.js » ('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 dd0b542c36299bba8992f9c7708fa4ab18e4122c..69a11ae132d9ef797a5fc25b60a67eda9d825a65 100644
--- a/src/elements.cc
+++ b/src/elements.cc
@@ -1041,25 +1041,13 @@ class ElementsAccessorBase : public ElementsAccessor {
combined_keys, &nof_indices);
if (needs_sorting) {
- SortIndices(combined_keys, nof_indices, SKIP_WRITE_BARRIER);
- uint32_t array_length = 0;
+ SortIndices(combined_keys, nof_indices);
// Indices from dictionary elements should only be converted after
// sorting.
- if (convert == GetKeysConversion::kConvertToString) {
Jakob Kummerow 2016/07/22 14:02:52 I think you wanted to keep this line.
- for (uint32_t i = 0; i < nof_indices; i++) {
- Handle<Object> index_string = isolate->factory()->Uint32ToString(
- combined_keys->get(i)->Number());
- combined_keys->set(i, *index_string);
- }
- } else if (!(object->IsJSArray() &&
- JSArray::cast(*object)->length()->ToArrayLength(
- &array_length) &&
- array_length <= Smi::kMaxValue)) {
- // Since we use std::sort above, the GC will no longer know where the
- // HeapNumbers are. For Arrays with valid Smi length, we are sure to
- // have no HeapNumber indices and thus we can skip this step.
- FIXED_ARRAY_ELEMENTS_WRITE_BARRIER(isolate->heap(), *combined_keys, 0,
- nof_indices);
+ for (uint32_t i = 0; i < nof_indices; i++) {
+ Handle<Object> index_string =
+ isolate->factory()->Uint32ToString(combined_keys->get(i)->Number());
+ combined_keys->set(i, *index_string);
}
}
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-630561.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698