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

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

Issue 799853003: Use proper ToLength() operation in %ArrayConcat() (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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/execution.cc ('k') | test/mjsunit/harmony/array-concat.js » ('j') | 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 1df42c424c33f9ee06112b0e80d241b3ca0390f4..77c522f78c4643ebe9cb12e5dab20ff63f8cd8e2 100644
--- a/src/runtime/runtime-array.cc
+++ b/src/runtime/runtime-array.cc
@@ -461,7 +461,10 @@ static bool IterateElements(Isolate* isolate, Handle<JSObject> receiver,
Handle<Object> key(isolate->heap()->length_string(), isolate);
ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, val,
Runtime::GetObjectProperty(isolate, receiver, key), false);
- // TODO(caitp): implement ToLength() abstract operation for C++
+ // TODO(caitp): ToLength(Get(receiver, "length")) should be a single op.
caitp (gmail) 2014/12/13 02:00:47 I'm not sure how big of a problem this is, but it
Dmitry Lomov (no reviews) 2014/12/13 10:42:48 You should handle simple cases in C++ here (e.g. w
+ ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, val,
+ Execution::ToLength(isolate, val), false);
+ // TODO(caitp): Support larger element indexes (up to 2^53-1).
val->ToUint32(&length);
}
« no previous file with comments | « src/execution.cc ('k') | test/mjsunit/harmony/array-concat.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698