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

Side by Side Diff: src/builtins.cc

Issue 1307743011: Adding GetMoreGeneralElementsKind in elements-kind.h (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix? Created 5 years, 3 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 | « no previous file | src/elements-kind.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/builtins.h" 5 #include "src/builtins.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/api-natives.h" 8 #include "src/api-natives.h"
9 #include "src/arguments.h" 9 #include "src/arguments.h"
10 #include "src/base/once.h" 10 #include "src/base/once.h"
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 DCHECK(result_len >= 0); 643 DCHECK(result_len >= 0);
644 644
645 if (result_len > FixedDoubleArray::kMaxLength) { 645 if (result_len > FixedDoubleArray::kMaxLength) {
646 AllowHeapAllocation allow_allocation; 646 AllowHeapAllocation allow_allocation;
647 return CallJsIntrinsic(isolate, isolate->array_concat(), args); 647 return CallJsIntrinsic(isolate, isolate->array_concat(), args);
648 } 648 }
649 649
650 ElementsKind arg_kind = JSArray::cast(arg)->map()->elements_kind(); 650 ElementsKind arg_kind = JSArray::cast(arg)->map()->elements_kind();
651 has_double = has_double || IsFastDoubleElementsKind(arg_kind); 651 has_double = has_double || IsFastDoubleElementsKind(arg_kind);
652 is_holey = is_holey || IsFastHoleyElementsKind(arg_kind); 652 is_holey = is_holey || IsFastHoleyElementsKind(arg_kind);
653 if (IsMoreGeneralElementsKindTransition(elements_kind, arg_kind)) { 653 elements_kind = GetMoreGeneralElementsKind(elements_kind, arg_kind);
654 elements_kind = arg_kind;
655 }
656 } 654 }
657 if (is_holey) elements_kind = GetHoleyElementsKind(elements_kind); 655 if (is_holey) elements_kind = GetHoleyElementsKind(elements_kind);
658 } 656 }
659 657
660 // If a double array is concatted into a fast elements array, the fast 658 // If a double array is concatted into a fast elements array, the fast
661 // elements array needs to be initialized to contain proper holes, since 659 // elements array needs to be initialized to contain proper holes, since
662 // boxing doubles may cause incremental marking. 660 // boxing doubles may cause incremental marking.
663 ArrayStorageAllocationMode mode = 661 ArrayStorageAllocationMode mode =
664 has_double && IsFastObjectElementsKind(elements_kind) 662 has_double && IsFastObjectElementsKind(elements_kind)
665 ? INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE : DONT_INITIALIZE_ARRAY_ELEMENTS; 663 ? INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE : DONT_INITIALIZE_ARRAY_ELEMENTS;
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
1313 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) 1311 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C)
1314 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) 1312 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A)
1315 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) 1313 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H)
1316 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) 1314 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A)
1317 #undef DEFINE_BUILTIN_ACCESSOR_C 1315 #undef DEFINE_BUILTIN_ACCESSOR_C
1318 #undef DEFINE_BUILTIN_ACCESSOR_A 1316 #undef DEFINE_BUILTIN_ACCESSOR_A
1319 1317
1320 1318
1321 } // namespace internal 1319 } // namespace internal
1322 } // namespace v8 1320 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/elements-kind.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698