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

Unified Diff: src/elements.cc

Issue 1716833002: [runtime] Speed up C++ version of ArrayPush (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: add TODO for Toon's comment Created 4 years, 10 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 | « src/debug/liveedit.cc ('k') | src/objects.h » ('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 e6d3f84f9ce8eec80bec76695220f6ff392c2787..4e8f7b2741ffa7cdd2df3cde075805f35ef0e3fa 100644
--- a/src/elements.cc
+++ b/src/elements.cc
@@ -705,7 +705,10 @@ class ElementsAccessorBase : public ElementsAccessor {
array->initialize_elements();
} else if (length <= capacity) {
if (array->HasFastSmiOrObjectElements()) {
- backing_store = JSObject::EnsureWritableFastElements(array);
+ JSObject::EnsureWritableFastElements(array);
+ if (array->elements() != *backing_store) {
+ backing_store = handle(array->elements(), isolate);
+ }
}
if (2 * length <= capacity) {
// If more than half the elements won't be used, trim the array.
« no previous file with comments | « src/debug/liveedit.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698