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

Side by Side Diff: src/ia32/builtins-ia32.cc

Issue 9235007: Handle single element array growth + transition in generic KeyedStoreIC (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: final version 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 | « src/contexts.h ('k') | src/ia32/ic-ia32.cc » ('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 876 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 static void AllocateEmptyJSArray(MacroAssembler* masm, 887 static void AllocateEmptyJSArray(MacroAssembler* masm,
888 Register array_function, 888 Register array_function,
889 Register result, 889 Register result,
890 Register scratch1, 890 Register scratch1,
891 Register scratch2, 891 Register scratch2,
892 Register scratch3, 892 Register scratch3,
893 Label* gc_required) { 893 Label* gc_required) {
894 const int initial_capacity = JSArray::kPreallocatedArrayElements; 894 const int initial_capacity = JSArray::kPreallocatedArrayElements;
895 STATIC_ASSERT(initial_capacity >= 0); 895 STATIC_ASSERT(initial_capacity >= 0);
896 896
897 __ LoadGlobalInitialConstructedArrayMap(array_function, scratch2, scratch1); 897 __ LoadInitialArrayMap(array_function, scratch2, scratch1);
898 898
899 // Allocate the JSArray object together with space for a fixed array with the 899 // Allocate the JSArray object together with space for a fixed array with the
900 // requested elements. 900 // requested elements.
901 int size = JSArray::kSize; 901 int size = JSArray::kSize;
902 if (initial_capacity > 0) { 902 if (initial_capacity > 0) {
903 size += FixedArray::SizeFor(initial_capacity); 903 size += FixedArray::SizeFor(initial_capacity);
904 } 904 }
905 __ AllocateInNewSpace(size, 905 __ AllocateInNewSpace(size,
906 result, 906 result,
907 scratch2, 907 scratch2,
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
990 Register result, 990 Register result,
991 Register elements_array, 991 Register elements_array,
992 Register elements_array_end, 992 Register elements_array_end,
993 Register scratch, 993 Register scratch,
994 bool fill_with_hole, 994 bool fill_with_hole,
995 Label* gc_required) { 995 Label* gc_required) {
996 ASSERT(scratch.is(edi)); // rep stos destination 996 ASSERT(scratch.is(edi)); // rep stos destination
997 ASSERT(!fill_with_hole || array_size.is(ecx)); // rep stos count 997 ASSERT(!fill_with_hole || array_size.is(ecx)); // rep stos count
998 ASSERT(!fill_with_hole || !result.is(eax)); // result is never eax 998 ASSERT(!fill_with_hole || !result.is(eax)); // result is never eax
999 999
1000 __ LoadGlobalInitialConstructedArrayMap(array_function, 1000 __ LoadInitialArrayMap(array_function, scratch, elements_array);
1001 scratch,
1002 elements_array);
1003 1001
1004 // Allocate the JSArray object together with space for a FixedArray with the 1002 // Allocate the JSArray object together with space for a FixedArray with the
1005 // requested elements. 1003 // requested elements.
1006 STATIC_ASSERT(kSmiTagSize == 1 && kSmiTag == 0); 1004 STATIC_ASSERT(kSmiTagSize == 1 && kSmiTag == 0);
1007 __ AllocateInNewSpace(JSArray::kSize + FixedArray::kHeaderSize, 1005 __ AllocateInNewSpace(JSArray::kSize + FixedArray::kHeaderSize,
1008 times_half_pointer_size, // array_size is a smi. 1006 times_half_pointer_size, // array_size is a smi.
1009 array_size, 1007 array_size,
1010 result, 1008 result,
1011 elements_array_end, 1009 elements_array_end,
1012 scratch, 1010 scratch,
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
1687 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); 1685 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR);
1688 generator.Generate(); 1686 generator.Generate();
1689 } 1687 }
1690 1688
1691 1689
1692 #undef __ 1690 #undef __
1693 } 1691 }
1694 } // namespace v8::internal 1692 } // namespace v8::internal
1695 1693
1696 #endif // V8_TARGET_ARCH_IA32 1694 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/contexts.h ('k') | src/ia32/ic-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698