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

Side by Side Diff: src/arm/full-codegen-arm.cc

Issue 257563004: Unify and simplify the FastCloneShallowArrayStub (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 6 years, 7 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/arm/code-stubs-arm.cc ('k') | src/arm64/code-stubs-arm64.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 1803 matching lines...) Expand 10 before | Expand all | Expand 10 after
1814 if (has_fast_elements && !FLAG_allocation_site_pretenuring) { 1814 if (has_fast_elements && !FLAG_allocation_site_pretenuring) {
1815 // If the only customer of allocation sites is transitioning, then 1815 // If the only customer of allocation sites is transitioning, then
1816 // we can turn it off if we don't have anywhere else to transition to. 1816 // we can turn it off if we don't have anywhere else to transition to.
1817 allocation_site_mode = DONT_TRACK_ALLOCATION_SITE; 1817 allocation_site_mode = DONT_TRACK_ALLOCATION_SITE;
1818 } 1818 }
1819 1819
1820 __ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); 1820 __ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
1821 __ ldr(r3, FieldMemOperand(r3, JSFunction::kLiteralsOffset)); 1821 __ ldr(r3, FieldMemOperand(r3, JSFunction::kLiteralsOffset));
1822 __ mov(r2, Operand(Smi::FromInt(expr->literal_index()))); 1822 __ mov(r2, Operand(Smi::FromInt(expr->literal_index())));
1823 __ mov(r1, Operand(constant_elements)); 1823 __ mov(r1, Operand(constant_elements));
1824 if (has_fast_elements && constant_elements_values->map() == 1824 if (expr->depth() > 1) {
1825 isolate()->heap()->fixed_cow_array_map()) {
1826 FastCloneShallowArrayStub stub(
1827 isolate(),
1828 FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS,
1829 allocation_site_mode,
1830 length);
1831 __ CallStub(&stub);
1832 __ IncrementCounter(
1833 isolate()->counters()->cow_arrays_created_stub(), 1, r1, r2);
1834 } else if (expr->depth() > 1 || Serializer::enabled() ||
1835 length > FastCloneShallowArrayStub::kMaximumClonedLength) {
1836 __ mov(r0, Operand(Smi::FromInt(flags))); 1825 __ mov(r0, Operand(Smi::FromInt(flags)));
1837 __ Push(r3, r2, r1, r0); 1826 __ Push(r3, r2, r1, r0);
1838 __ CallRuntime(Runtime::kHiddenCreateArrayLiteral, 4); 1827 __ CallRuntime(Runtime::kHiddenCreateArrayLiteral, 4);
1839 } else { 1828 } else {
1840 ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) || 1829 FastCloneShallowArrayStub stub(isolate(), allocation_site_mode);
1841 FLAG_smi_only_arrays);
1842 FastCloneShallowArrayStub::Mode mode =
1843 FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS;
1844
1845 if (has_fast_elements) {
1846 mode = FastCloneShallowArrayStub::CLONE_ELEMENTS;
1847 }
1848
1849 FastCloneShallowArrayStub stub(isolate(), mode, allocation_site_mode,
1850 length);
1851 __ CallStub(&stub); 1830 __ CallStub(&stub);
1852 } 1831 }
1853 1832
1854 bool result_saved = false; // Is the result saved to the stack? 1833 bool result_saved = false; // Is the result saved to the stack?
1855 1834
1856 // Emit code to evaluate all the non-constant subexpressions and to store 1835 // Emit code to evaluate all the non-constant subexpressions and to store
1857 // them into the newly cloned array. 1836 // them into the newly cloned array.
1858 for (int i = 0; i < length; i++) { 1837 for (int i = 0; i < length; i++) {
1859 Expression* subexpr = subexprs->at(i); 1838 Expression* subexpr = subexprs->at(i);
1860 // If the subexpression is a literal or a simple materialized literal it 1839 // If the subexpression is a literal or a simple materialized literal it
(...skipping 3075 matching lines...) Expand 10 before | Expand all | Expand 10 after
4936 4915
4937 ASSERT(interrupt_address == 4916 ASSERT(interrupt_address ==
4938 isolate->builtins()->OsrAfterStackCheck()->entry()); 4917 isolate->builtins()->OsrAfterStackCheck()->entry());
4939 return OSR_AFTER_STACK_CHECK; 4918 return OSR_AFTER_STACK_CHECK;
4940 } 4919 }
4941 4920
4942 4921
4943 } } // namespace v8::internal 4922 } } // namespace v8::internal
4944 4923
4945 #endif // V8_TARGET_ARCH_ARM 4924 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/arm64/code-stubs-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698