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

Side by Side Diff: src/ia32/stub-cache-ia32.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 1606 matching lines...) Expand 10 before | Expand all | Expand 10 after
1617 GenerateDirectLoadGlobalFunctionPrototype(masm(), 1617 GenerateDirectLoadGlobalFunctionPrototype(masm(),
1618 Context::STRING_FUNCTION_INDEX, 1618 Context::STRING_FUNCTION_INDEX,
1619 eax, 1619 eax,
1620 &miss); 1620 &miss);
1621 ASSERT(!object.is_identical_to(holder)); 1621 ASSERT(!object.is_identical_to(holder));
1622 CheckPrototypes(Handle<JSObject>(JSObject::cast(object->GetPrototype())), 1622 CheckPrototypes(Handle<JSObject>(JSObject::cast(object->GetPrototype())),
1623 eax, holder, ebx, edx, edi, name, &miss); 1623 eax, holder, ebx, edx, edi, name, &miss);
1624 1624
1625 Register receiver = ebx; 1625 Register receiver = ebx;
1626 Register index = edi; 1626 Register index = edi;
1627 Register scratch = edx;
1628 Register result = eax; 1627 Register result = eax;
1629 __ mov(receiver, Operand(esp, (argc + 1) * kPointerSize)); 1628 __ mov(receiver, Operand(esp, (argc + 1) * kPointerSize));
1630 if (argc > 0) { 1629 if (argc > 0) {
1631 __ mov(index, Operand(esp, (argc - 0) * kPointerSize)); 1630 __ mov(index, Operand(esp, (argc - 0) * kPointerSize));
1632 } else { 1631 } else {
1633 __ Set(index, Immediate(factory()->undefined_value())); 1632 __ Set(index, Immediate(factory()->undefined_value()));
1634 } 1633 }
1635 1634
1636 StringCharCodeAtGenerator generator(receiver, 1635 StringCharCodeAtGenerator generator(receiver,
1637 index, 1636 index,
1638 scratch,
1639 result, 1637 result,
1640 &miss, // When not a string. 1638 &miss, // When not a string.
1641 &miss, // When not a number. 1639 &miss, // When not a number.
1642 index_out_of_range_label, 1640 index_out_of_range_label,
1643 STRING_INDEX_IS_NUMBER); 1641 STRING_INDEX_IS_NUMBER);
1644 generator.GenerateFast(masm()); 1642 generator.GenerateFast(masm());
1645 __ ret((argc + 1) * kPointerSize); 1643 __ ret((argc + 1) * kPointerSize);
1646 1644
1647 StubRuntimeCallHelper call_helper; 1645 StubRuntimeCallHelper call_helper;
1648 generator.GenerateSlow(masm(), call_helper); 1646 generator.GenerateSlow(masm(), call_helper);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
1702 GenerateDirectLoadGlobalFunctionPrototype(masm(), 1700 GenerateDirectLoadGlobalFunctionPrototype(masm(),
1703 Context::STRING_FUNCTION_INDEX, 1701 Context::STRING_FUNCTION_INDEX,
1704 eax, 1702 eax,
1705 &miss); 1703 &miss);
1706 ASSERT(!object.is_identical_to(holder)); 1704 ASSERT(!object.is_identical_to(holder));
1707 CheckPrototypes(Handle<JSObject>(JSObject::cast(object->GetPrototype())), 1705 CheckPrototypes(Handle<JSObject>(JSObject::cast(object->GetPrototype())),
1708 eax, holder, ebx, edx, edi, name, &miss); 1706 eax, holder, ebx, edx, edi, name, &miss);
1709 1707
1710 Register receiver = eax; 1708 Register receiver = eax;
1711 Register index = edi; 1709 Register index = edi;
1712 Register scratch1 = ebx; 1710 Register scratch = edx;
1713 Register scratch2 = edx;
1714 Register result = eax; 1711 Register result = eax;
1715 __ mov(receiver, Operand(esp, (argc + 1) * kPointerSize)); 1712 __ mov(receiver, Operand(esp, (argc + 1) * kPointerSize));
1716 if (argc > 0) { 1713 if (argc > 0) {
1717 __ mov(index, Operand(esp, (argc - 0) * kPointerSize)); 1714 __ mov(index, Operand(esp, (argc - 0) * kPointerSize));
1718 } else { 1715 } else {
1719 __ Set(index, Immediate(factory()->undefined_value())); 1716 __ Set(index, Immediate(factory()->undefined_value()));
1720 } 1717 }
1721 1718
1722 StringCharAtGenerator generator(receiver, 1719 StringCharAtGenerator generator(receiver,
1723 index, 1720 index,
1724 scratch1, 1721 scratch,
1725 scratch2,
1726 result, 1722 result,
1727 &miss, // When not a string. 1723 &miss, // When not a string.
1728 &miss, // When not a number. 1724 &miss, // When not a number.
1729 index_out_of_range_label, 1725 index_out_of_range_label,
1730 STRING_INDEX_IS_NUMBER); 1726 STRING_INDEX_IS_NUMBER);
1731 generator.GenerateFast(masm()); 1727 generator.GenerateFast(masm());
1732 __ ret((argc + 1) * kPointerSize); 1728 __ ret((argc + 1) * kPointerSize);
1733 1729
1734 StubRuntimeCallHelper call_helper; 1730 StubRuntimeCallHelper call_helper;
1735 generator.GenerateSlow(masm(), call_helper); 1731 generator.GenerateSlow(masm(), call_helper);
(...skipping 2115 matching lines...) Expand 10 before | Expand all | Expand 10 after
3851 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); 3847 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss();
3852 __ jmp(ic_miss, RelocInfo::CODE_TARGET); 3848 __ jmp(ic_miss, RelocInfo::CODE_TARGET);
3853 } 3849 }
3854 3850
3855 3851
3856 #undef __ 3852 #undef __
3857 3853
3858 } } // namespace v8::internal 3854 } } // namespace v8::internal
3859 3855
3860 #endif // V8_TARGET_ARCH_IA32 3856 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698