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

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

Issue 16950004: Reduce the amount of full code generated to fill out array literals. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Feedback. Rebased. Created 7 years, 6 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/hydrogen.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 1818 matching lines...) Expand 10 before | Expand all | Expand 10 after
1829 Expression* subexpr = subexprs->at(i); 1829 Expression* subexpr = subexprs->at(i);
1830 // If the subexpression is a literal or a simple materialized literal it 1830 // If the subexpression is a literal or a simple materialized literal it
1831 // is already set in the cloned array. 1831 // is already set in the cloned array.
1832 if (subexpr->AsLiteral() != NULL || 1832 if (subexpr->AsLiteral() != NULL ||
1833 CompileTimeValue::IsCompileTimeValue(subexpr)) { 1833 CompileTimeValue::IsCompileTimeValue(subexpr)) {
1834 continue; 1834 continue;
1835 } 1835 }
1836 1836
1837 if (!result_saved) { 1837 if (!result_saved) {
1838 __ push(r0); 1838 __ push(r0);
1839 __ Push(Smi::FromInt(expr->literal_index()));
1839 result_saved = true; 1840 result_saved = true;
1840 } 1841 }
1841 VisitForAccumulatorValue(subexpr); 1842 VisitForAccumulatorValue(subexpr);
1842 1843
1843 if (IsFastObjectElementsKind(constant_elements_kind)) { 1844 if (IsFastObjectElementsKind(constant_elements_kind)) {
1844 int offset = FixedArray::kHeaderSize + (i * kPointerSize); 1845 int offset = FixedArray::kHeaderSize + (i * kPointerSize);
1845 __ ldr(r6, MemOperand(sp)); // Copy of array literal. 1846 __ ldr(r6, MemOperand(sp, kPointerSize)); // Copy of array literal.
1846 __ ldr(r1, FieldMemOperand(r6, JSObject::kElementsOffset)); 1847 __ ldr(r1, FieldMemOperand(r6, JSObject::kElementsOffset));
1847 __ str(result_register(), FieldMemOperand(r1, offset)); 1848 __ str(result_register(), FieldMemOperand(r1, offset));
1848 // Update the write barrier for the array store. 1849 // Update the write barrier for the array store.
1849 __ RecordWriteField(r1, offset, result_register(), r2, 1850 __ RecordWriteField(r1, offset, result_register(), r2,
1850 kLRHasBeenSaved, kDontSaveFPRegs, 1851 kLRHasBeenSaved, kDontSaveFPRegs,
1851 EMIT_REMEMBERED_SET, INLINE_SMI_CHECK); 1852 EMIT_REMEMBERED_SET, INLINE_SMI_CHECK);
1852 } else { 1853 } else {
1853 __ ldr(r1, MemOperand(sp)); // Copy of array literal.
1854 __ ldr(r2, FieldMemOperand(r1, JSObject::kMapOffset));
1855 __ mov(r3, Operand(Smi::FromInt(i))); 1854 __ mov(r3, Operand(Smi::FromInt(i)));
1856 __ mov(r4, Operand(Smi::FromInt(expr->literal_index())));
1857 StoreArrayLiteralElementStub stub; 1855 StoreArrayLiteralElementStub stub;
1858 __ CallStub(&stub); 1856 __ CallStub(&stub);
1859 } 1857 }
1860 1858
1861 PrepareForBailoutForId(expr->GetIdForElement(i), NO_REGISTERS); 1859 PrepareForBailoutForId(expr->GetIdForElement(i), NO_REGISTERS);
1862 } 1860 }
1863 1861
1864 if (result_saved) { 1862 if (result_saved) {
1863 __ pop(); // literal index
1865 context()->PlugTOS(); 1864 context()->PlugTOS();
1866 } else { 1865 } else {
1867 context()->Plug(r0); 1866 context()->Plug(r0);
1868 } 1867 }
1869 } 1868 }
1870 1869
1871 1870
1872 void FullCodeGenerator::VisitAssignment(Assignment* expr) { 1871 void FullCodeGenerator::VisitAssignment(Assignment* expr) {
1873 Comment cmnt(masm_, "[ Assignment"); 1872 Comment cmnt(masm_, "[ Assignment");
1874 // Invalid left-hand sides are rewritten to have a 'throw ReferenceError' 1873 // Invalid left-hand sides are rewritten to have a 'throw ReferenceError'
(...skipping 3019 matching lines...) Expand 10 before | Expand all | Expand 10 after
4894 *context_length = 0; 4893 *context_length = 0;
4895 return previous_; 4894 return previous_;
4896 } 4895 }
4897 4896
4898 4897
4899 #undef __ 4898 #undef __
4900 4899
4901 } } // namespace v8::internal 4900 } } // namespace v8::internal
4902 4901
4903 #endif // V8_TARGET_ARCH_ARM 4902 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698