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

Side by Side Diff: src/runtime/runtime-array.cc

Issue 1124443004: New hydrogen instruction to reduce cost of growing an array on keyed stores. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « src/runtime/runtime.h ('k') | src/x64/interface-descriptors-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/messages.h" 8 #include "src/messages.h"
9 #include "src/runtime/runtime-utils.h" 9 #include "src/runtime/runtime-utils.h"
10 10
(...skipping 1223 matching lines...) Expand 10 before | Expand all | Expand 10 after
1234 !array->HasFixedTypedArrayElements() && 1234 !array->HasFixedTypedArrayElements() &&
1235 !array->IsJSGlobalProxy()); 1235 !array->IsJSGlobalProxy());
1236 JSObject::NormalizeElements(array); 1236 JSObject::NormalizeElements(array);
1237 return *array; 1237 return *array;
1238 } 1238 }
1239 1239
1240 1240
1241 // GrowArrayElements returns a sentinel Smi if the object was normalized. 1241 // GrowArrayElements returns a sentinel Smi if the object was normalized.
1242 RUNTIME_FUNCTION(Runtime_GrowArrayElements) { 1242 RUNTIME_FUNCTION(Runtime_GrowArrayElements) {
1243 HandleScope scope(isolate); 1243 HandleScope scope(isolate);
1244 DCHECK(args.length() == 3); 1244 DCHECK(args.length() == 2);
1245 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); 1245 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0);
1246 CONVERT_NUMBER_CHECKED(int, key, Int32, args[1]); 1246 CONVERT_NUMBER_CHECKED(int, key, Int32, args[1]);
1247 1247
1248 if (key < 0) { 1248 if (key < 0) {
1249 return object->elements(); 1249 return object->elements();
1250 } 1250 }
1251 1251
1252 uint32_t capacity = static_cast<uint32_t>(object->elements()->length()); 1252 uint32_t capacity = static_cast<uint32_t>(object->elements()->length());
1253 uint32_t index = static_cast<uint32_t>(key); 1253 uint32_t index = static_cast<uint32_t>(key);
1254 1254
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
1412 1412
1413 RUNTIME_FUNCTION(Runtime_FastOneByteArrayJoin) { 1413 RUNTIME_FUNCTION(Runtime_FastOneByteArrayJoin) {
1414 SealHandleScope shs(isolate); 1414 SealHandleScope shs(isolate);
1415 DCHECK(args.length() == 2); 1415 DCHECK(args.length() == 2);
1416 // Returning undefined means that this fast path fails and one has to resort 1416 // Returning undefined means that this fast path fails and one has to resort
1417 // to a slow path. 1417 // to a slow path.
1418 return isolate->heap()->undefined_value(); 1418 return isolate->heap()->undefined_value();
1419 } 1419 }
1420 } 1420 }
1421 } // namespace v8::internal 1421 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | src/x64/interface-descriptors-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698