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

Unified Diff: src/runtime/runtime.cc

Issue 702243003: Basic array capacity feedback via allocation sites. Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Update. Created 6 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/runtime/runtime.h ('k') | test/mjsunit/array-constructor-feedback.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime.cc
diff --git a/src/runtime/runtime.cc b/src/runtime/runtime.cc
index 837f689c223d88d71e84316aff6a8668ccac2638..74004105b38d739647fca7a105fe8ad0ca523955 100644
--- a/src/runtime/runtime.cc
+++ b/src/runtime/runtime.cc
@@ -108,6 +108,14 @@ RUNTIME_FUNCTION(Runtime_InternalSetPrototype) {
}
+RUNTIME_FUNCTION(Runtime_GetElementsCapacity) {
+ HandleScope scope(isolate);
+ DCHECK(args.length() == 1);
+ CONVERT_ARG_HANDLE_CHECKED(JSArray, obj, 0);
+ return Smi::FromInt(obj->elements()->length());
+}
+
+
RUNTIME_FUNCTION(Runtime_SetPrototype) {
HandleScope scope(isolate);
DCHECK(args.length() == 2);
« no previous file with comments | « src/runtime/runtime.h ('k') | test/mjsunit/array-constructor-feedback.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698