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

Side by Side Diff: src/mips/stub-cache-mips.cc

Issue 8506024: MIPS: Simplify StringCharCodeAt in non-crankshaft codegen. (Closed)
Patch Set: Created 9 years, 1 month 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 | « src/mips/lithium-codegen-mips.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 1733 matching lines...) Expand 10 before | Expand all | Expand 10 after
1744 GenerateDirectLoadGlobalFunctionPrototype(masm(), 1744 GenerateDirectLoadGlobalFunctionPrototype(masm(),
1745 Context::STRING_FUNCTION_INDEX, 1745 Context::STRING_FUNCTION_INDEX,
1746 v0, 1746 v0,
1747 &miss); 1747 &miss);
1748 ASSERT(!object.is_identical_to(holder)); 1748 ASSERT(!object.is_identical_to(holder));
1749 CheckPrototypes(Handle<JSObject>(JSObject::cast(object->GetPrototype())), 1749 CheckPrototypes(Handle<JSObject>(JSObject::cast(object->GetPrototype())),
1750 v0, holder, a1, a3, t0, name, &miss); 1750 v0, holder, a1, a3, t0, name, &miss);
1751 1751
1752 Register receiver = a1; 1752 Register receiver = a1;
1753 Register index = t1; 1753 Register index = t1;
1754 Register scratch = a3;
1755 Register result = v0; 1754 Register result = v0;
1756 __ lw(receiver, MemOperand(sp, argc * kPointerSize)); 1755 __ lw(receiver, MemOperand(sp, argc * kPointerSize));
1757 if (argc > 0) { 1756 if (argc > 0) {
1758 __ lw(index, MemOperand(sp, (argc - 1) * kPointerSize)); 1757 __ lw(index, MemOperand(sp, (argc - 1) * kPointerSize));
1759 } else { 1758 } else {
1760 __ LoadRoot(index, Heap::kUndefinedValueRootIndex); 1759 __ LoadRoot(index, Heap::kUndefinedValueRootIndex);
1761 } 1760 }
1762 1761
1763 StringCharCodeAtGenerator generator(receiver, 1762 StringCharCodeAtGenerator generator(receiver,
1764 index, 1763 index,
1765 scratch,
1766 result, 1764 result,
1767 &miss, // When not a string. 1765 &miss, // When not a string.
1768 &miss, // When not a number. 1766 &miss, // When not a number.
1769 index_out_of_range_label, 1767 index_out_of_range_label,
1770 STRING_INDEX_IS_NUMBER); 1768 STRING_INDEX_IS_NUMBER);
1771 generator.GenerateFast(masm()); 1769 generator.GenerateFast(masm());
1772 __ Drop(argc + 1); 1770 __ Drop(argc + 1);
1773 __ Ret(); 1771 __ Ret();
1774 1772
1775 StubRuntimeCallHelper call_helper; 1773 StubRuntimeCallHelper call_helper;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
1826 GenerateDirectLoadGlobalFunctionPrototype(masm(), 1824 GenerateDirectLoadGlobalFunctionPrototype(masm(),
1827 Context::STRING_FUNCTION_INDEX, 1825 Context::STRING_FUNCTION_INDEX,
1828 v0, 1826 v0,
1829 &miss); 1827 &miss);
1830 ASSERT(!object.is_identical_to(holder)); 1828 ASSERT(!object.is_identical_to(holder));
1831 CheckPrototypes(Handle<JSObject>(JSObject::cast(object->GetPrototype())), 1829 CheckPrototypes(Handle<JSObject>(JSObject::cast(object->GetPrototype())),
1832 v0, holder, a1, a3, t0, name, &miss); 1830 v0, holder, a1, a3, t0, name, &miss);
1833 1831
1834 Register receiver = v0; 1832 Register receiver = v0;
1835 Register index = t1; 1833 Register index = t1;
1836 Register scratch1 = a1; 1834 Register scratch = a3;
1837 Register scratch2 = a3;
1838 Register result = v0; 1835 Register result = v0;
1839 __ lw(receiver, MemOperand(sp, argc * kPointerSize)); 1836 __ lw(receiver, MemOperand(sp, argc * kPointerSize));
1840 if (argc > 0) { 1837 if (argc > 0) {
1841 __ lw(index, MemOperand(sp, (argc - 1) * kPointerSize)); 1838 __ lw(index, MemOperand(sp, (argc - 1) * kPointerSize));
1842 } else { 1839 } else {
1843 __ LoadRoot(index, Heap::kUndefinedValueRootIndex); 1840 __ LoadRoot(index, Heap::kUndefinedValueRootIndex);
1844 } 1841 }
1845 1842
1846 StringCharAtGenerator generator(receiver, 1843 StringCharAtGenerator generator(receiver,
1847 index, 1844 index,
1848 scratch1, 1845 scratch,
1849 scratch2,
1850 result, 1846 result,
1851 &miss, // When not a string. 1847 &miss, // When not a string.
1852 &miss, // When not a number. 1848 &miss, // When not a number.
1853 index_out_of_range_label, 1849 index_out_of_range_label,
1854 STRING_INDEX_IS_NUMBER); 1850 STRING_INDEX_IS_NUMBER);
1855 generator.GenerateFast(masm()); 1851 generator.GenerateFast(masm());
1856 __ Drop(argc + 1); 1852 __ Drop(argc + 1);
1857 __ Ret(); 1853 __ Ret();
1858 1854
1859 StubRuntimeCallHelper call_helper; 1855 StubRuntimeCallHelper call_helper;
(...skipping 2457 matching lines...) Expand 10 before | Expand all | Expand 10 after
4317 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); 4313 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss();
4318 __ Jump(ic_miss, RelocInfo::CODE_TARGET); 4314 __ Jump(ic_miss, RelocInfo::CODE_TARGET);
4319 } 4315 }
4320 4316
4321 4317
4322 #undef __ 4318 #undef __
4323 4319
4324 } } // namespace v8::internal 4320 } } // namespace v8::internal
4325 4321
4326 #endif // V8_TARGET_ARCH_MIPS 4322 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698