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

Side by Side Diff: src/builtins.cc

Issue 9358018: Fix elements transition bug related to array.concat. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: added test Created 8 years, 10 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 | test/mjsunit/regress/regress-smi-only-concat.js » ('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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after
971 const int kHalfOfMaxInt = 1 << (kBitsPerInt - 2); 971 const int kHalfOfMaxInt = 1 << (kBitsPerInt - 2);
972 STATIC_ASSERT(FixedArray::kMaxLength < kHalfOfMaxInt); 972 STATIC_ASSERT(FixedArray::kMaxLength < kHalfOfMaxInt);
973 USE(kHalfOfMaxInt); 973 USE(kHalfOfMaxInt);
974 result_len += len; 974 result_len += len;
975 ASSERT(result_len >= 0); 975 ASSERT(result_len >= 0);
976 976
977 if (result_len > FixedArray::kMaxLength) { 977 if (result_len > FixedArray::kMaxLength) {
978 return CallJsBuiltin(isolate, "ArrayConcat", args); 978 return CallJsBuiltin(isolate, "ArrayConcat", args);
979 } 979 }
980 980
981 if (!JSArray::cast(arg)->HasFastElements()) { 981 if (!JSArray::cast(arg)->HasFastSmiOnlyElements()) {
982 elements_kind = FAST_ELEMENTS; 982 elements_kind = FAST_ELEMENTS;
983 } 983 }
984 } 984 }
985 985
986 // Allocate result. 986 // Allocate result.
987 JSArray* result_array; 987 JSArray* result_array;
988 MaybeObject* maybe_array = 988 MaybeObject* maybe_array =
989 heap->AllocateJSArrayAndStorage(elements_kind, 989 heap->AllocateJSArrayAndStorage(elements_kind,
990 result_len, 990 result_len,
991 result_len); 991 result_len);
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after
1756 return Handle<Code>(code_address); \ 1756 return Handle<Code>(code_address); \
1757 } 1757 }
1758 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) 1758 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C)
1759 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) 1759 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A)
1760 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) 1760 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A)
1761 #undef DEFINE_BUILTIN_ACCESSOR_C 1761 #undef DEFINE_BUILTIN_ACCESSOR_C
1762 #undef DEFINE_BUILTIN_ACCESSOR_A 1762 #undef DEFINE_BUILTIN_ACCESSOR_A
1763 1763
1764 1764
1765 } } // namespace v8::internal 1765 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-smi-only-concat.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698