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

Side by Side Diff: src/builtins.cc

Issue 597103003: ArrayConcat regression recover after r20312 (appeared on dromaeo benchmarks). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/elements.h » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/api.h" 7 #include "src/api.h"
8 #include "src/arguments.h" 8 #include "src/arguments.h"
9 #include "src/base/once.h" 9 #include "src/base/once.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after
980 isolate->factory()->NewJSArray(elements_kind, 980 isolate->factory()->NewJSArray(elements_kind,
981 result_len, 981 result_len,
982 result_len, 982 result_len,
983 mode); 983 mode);
984 if (result_len == 0) return *result_array; 984 if (result_len == 0) return *result_array;
985 985
986 int j = 0; 986 int j = 0;
987 Handle<FixedArrayBase> storage(result_array->elements(), isolate); 987 Handle<FixedArrayBase> storage(result_array->elements(), isolate);
988 ElementsAccessor* accessor = ElementsAccessor::ForKind(elements_kind); 988 ElementsAccessor* accessor = ElementsAccessor::ForKind(elements_kind);
989 for (int i = 0; i < n_arguments; i++) { 989 for (int i = 0; i < n_arguments; i++) {
990 // TODO(ishell): It is crucial to keep |array| as a raw pointer to avoid 990 // It is crucial to keep |array| in a raw pointer form to avoid performance
991 // performance degradation. Revisit this later. 991 // degradation.
992 JSArray* array = JSArray::cast(args[i]); 992 JSArray* array = JSArray::cast(args[i]);
993 int len = Smi::cast(array->length())->value(); 993 int len = Smi::cast(array->length())->value();
994 ElementsKind from_kind = array->GetElementsKind();
995 if (len > 0) { 994 if (len > 0) {
995 ElementsKind from_kind = array->GetElementsKind();
996 accessor->CopyElements(array, 0, from_kind, storage, j, len); 996 accessor->CopyElements(array, 0, from_kind, storage, j, len);
997 j += len; 997 j += len;
998 } 998 }
999 } 999 }
1000 1000
1001 DCHECK(j == result_len); 1001 DCHECK(j == result_len);
1002 1002
1003 return *result_array; 1003 return *result_array;
1004 } 1004 }
1005 1005
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
1650 } 1650 }
1651 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) 1651 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C)
1652 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) 1652 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A)
1653 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) 1653 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H)
1654 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) 1654 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A)
1655 #undef DEFINE_BUILTIN_ACCESSOR_C 1655 #undef DEFINE_BUILTIN_ACCESSOR_C
1656 #undef DEFINE_BUILTIN_ACCESSOR_A 1656 #undef DEFINE_BUILTIN_ACCESSOR_A
1657 1657
1658 1658
1659 } } // namespace v8::internal 1659 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/elements.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698