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

Unified Diff: src/runtime/runtime-array.cc

Issue 2244983004: [elements, turbofan] Implement simple GrowElements (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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/objects.cc ('K') | « src/objects.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-array.cc
diff --git a/src/runtime/runtime-array.cc b/src/runtime/runtime-array.cc
index 3c5e817de9a5e124c7a58827a771b76a3d2b1c36..eee6a8664eb996db6c42749268037fe7053c0118 100644
--- a/src/runtime/runtime-array.cc
+++ b/src/runtime/runtime-array.cc
@@ -374,15 +374,10 @@ RUNTIME_FUNCTION(Runtime_GrowArrayElements) {
uint32_t index = static_cast<uint32_t>(key);
if (index >= capacity) {
- if (object->map()->is_prototype_map() ||
- object->WouldConvertToSlowElements(index)) {
- // We don't want to allow operations that cause lazy deopt. Return a Smi
- // as a signal that optimized code should eagerly deoptimize.
+ uint32_t new_capacity = JSObject::NewElementsCapacity(index + 1);
+ if (!object->GetElementsAccessor()->GrowCapacity(object, new_capacity)) {
return Smi::FromInt(0);
}
-
- uint32_t new_capacity = JSObject::NewElementsCapacity(index + 1);
- object->GetElementsAccessor()->GrowCapacityAndConvert(object, new_capacity);
}
// On success, return the fixed array elements.
« src/objects.cc ('K') | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698