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

Unified Diff: src/builtins.cc

Issue 11416238: Move CopyElements to the accessor of the target. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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 | « no previous file | src/elements.h » ('j') | src/elements.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins.cc
diff --git a/src/builtins.cc b/src/builtins.cc
index d9f8d15411ad91be9dd141cfe9d4534eeb9782ea..fb5fd1b706dd2906884e20a5a4484249a517a468 100644
--- a/src/builtins.cc
+++ b/src/builtins.cc
@@ -1220,13 +1220,14 @@ BUILTIN(ArrayConcat) {
int j = 0;
FixedArrayBase* storage = result_array->elements();
+ ElementsAccessor* accessor = ElementsAccessor::ForKind(elements_kind);
for (int i = 0; i < n_arguments; i++) {
JSArray* array = JSArray::cast(args[i]);
int len = Smi::cast(array->length())->value();
+ ElementsKind origin_kind = array->GetElementsKind();
Michael Starzinger 2012/11/29 09:39:32 Use "from_kind" as name for consistency.
Toon Verwaest 2012/11/29 14:04:40 Done.
if (len > 0) {
- ElementsAccessor* accessor = array->GetElementsAccessor();
MaybeObject* maybe_failure =
- accessor->CopyElements(array, 0, storage, elements_kind, j, len);
+ accessor->CopyElements(array, 0, storage, origin_kind, j, len);
if (maybe_failure->IsFailure()) return maybe_failure;
j += len;
}
« no previous file with comments | « no previous file | src/elements.h » ('j') | src/elements.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698