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

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

Issue 8510005: Simplify StringCharCodeAt in non-crankshaft codegen. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
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 | Annotate | Revision Log
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 1709 matching lines...) Expand 10 before | Expand all | Expand 10 after
1720 GenerateDirectLoadGlobalFunctionPrototype(masm(), 1720 GenerateDirectLoadGlobalFunctionPrototype(masm(),
1721 Context::STRING_FUNCTION_INDEX, 1721 Context::STRING_FUNCTION_INDEX,
1722 r0, 1722 r0,
1723 &miss); 1723 &miss);
1724 ASSERT(!object.is_identical_to(holder)); 1724 ASSERT(!object.is_identical_to(holder));
1725 CheckPrototypes(Handle<JSObject>(JSObject::cast(object->GetPrototype())), 1725 CheckPrototypes(Handle<JSObject>(JSObject::cast(object->GetPrototype())),
1726 r0, holder, r1, r3, r4, name, &miss); 1726 r0, holder, r1, r3, r4, name, &miss);
1727 1727
1728 Register receiver = r1; 1728 Register receiver = r1;
1729 Register index = r4; 1729 Register index = r4;
1730 Register scratch = r3;
1731 Register result = r0; 1730 Register result = r0;
1732 __ ldr(receiver, MemOperand(sp, argc * kPointerSize)); 1731 __ ldr(receiver, MemOperand(sp, argc * kPointerSize));
1733 if (argc > 0) { 1732 if (argc > 0) {
1734 __ ldr(index, MemOperand(sp, (argc - 1) * kPointerSize)); 1733 __ ldr(index, MemOperand(sp, (argc - 1) * kPointerSize));
1735 } else { 1734 } else {
1736 __ LoadRoot(index, Heap::kUndefinedValueRootIndex); 1735 __ LoadRoot(index, Heap::kUndefinedValueRootIndex);
1737 } 1736 }
1738 1737
1739 StringCharCodeAtGenerator generator(receiver, 1738 StringCharCodeAtGenerator generator(receiver,
1740 index, 1739 index,
1741 scratch,
1742 result, 1740 result,
1743 &miss, // When not a string. 1741 &miss, // When not a string.
1744 &miss, // When not a number. 1742 &miss, // When not a number.
1745 index_out_of_range_label, 1743 index_out_of_range_label,
1746 STRING_INDEX_IS_NUMBER); 1744 STRING_INDEX_IS_NUMBER);
1747 generator.GenerateFast(masm()); 1745 generator.GenerateFast(masm());
1748 __ Drop(argc + 1); 1746 __ Drop(argc + 1);
1749 __ Ret(); 1747 __ Ret();
1750 1748
1751 StubRuntimeCallHelper call_helper; 1749 StubRuntimeCallHelper call_helper;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
1802 GenerateDirectLoadGlobalFunctionPrototype(masm(), 1800 GenerateDirectLoadGlobalFunctionPrototype(masm(),
1803 Context::STRING_FUNCTION_INDEX, 1801 Context::STRING_FUNCTION_INDEX,
1804 r0, 1802 r0,
1805 &miss); 1803 &miss);
1806 ASSERT(!object.is_identical_to(holder)); 1804 ASSERT(!object.is_identical_to(holder));
1807 CheckPrototypes(Handle<JSObject>(JSObject::cast(object->GetPrototype())), 1805 CheckPrototypes(Handle<JSObject>(JSObject::cast(object->GetPrototype())),
1808 r0, holder, r1, r3, r4, name, &miss); 1806 r0, holder, r1, r3, r4, name, &miss);
1809 1807
1810 Register receiver = r0; 1808 Register receiver = r0;
1811 Register index = r4; 1809 Register index = r4;
1812 Register scratch1 = r1; 1810 Register scratch = r3;
1813 Register scratch2 = r3;
1814 Register result = r0; 1811 Register result = r0;
1815 __ ldr(receiver, MemOperand(sp, argc * kPointerSize)); 1812 __ ldr(receiver, MemOperand(sp, argc * kPointerSize));
1816 if (argc > 0) { 1813 if (argc > 0) {
1817 __ ldr(index, MemOperand(sp, (argc - 1) * kPointerSize)); 1814 __ ldr(index, MemOperand(sp, (argc - 1) * kPointerSize));
1818 } else { 1815 } else {
1819 __ LoadRoot(index, Heap::kUndefinedValueRootIndex); 1816 __ LoadRoot(index, Heap::kUndefinedValueRootIndex);
1820 } 1817 }
1821 1818
1822 StringCharAtGenerator generator(receiver, 1819 StringCharAtGenerator generator(receiver,
1823 index, 1820 index,
1824 scratch1, 1821 scratch,
1825 scratch2,
1826 result, 1822 result,
1827 &miss, // When not a string. 1823 &miss, // When not a string.
1828 &miss, // When not a number. 1824 &miss, // When not a number.
1829 index_out_of_range_label, 1825 index_out_of_range_label,
1830 STRING_INDEX_IS_NUMBER); 1826 STRING_INDEX_IS_NUMBER);
1831 generator.GenerateFast(masm()); 1827 generator.GenerateFast(masm());
1832 __ Drop(argc + 1); 1828 __ Drop(argc + 1);
1833 __ Ret(); 1829 __ Ret();
1834 1830
1835 StubRuntimeCallHelper call_helper; 1831 StubRuntimeCallHelper call_helper;
(...skipping 2402 matching lines...) Expand 10 before | Expand all | Expand 10 after
4238 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); 4234 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss();
4239 __ Jump(ic_miss, RelocInfo::CODE_TARGET); 4235 __ Jump(ic_miss, RelocInfo::CODE_TARGET);
4240 } 4236 }
4241 4237
4242 4238
4243 #undef __ 4239 #undef __
4244 4240
4245 } } // namespace v8::internal 4241 } } // namespace v8::internal
4246 4242
4247 #endif // V8_TARGET_ARCH_ARM 4243 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/code-stubs.h » ('j') | src/ia32/code-stubs-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698