OLD | NEW |
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 1582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1593 GenerateDirectLoadGlobalFunctionPrototype(masm(), | 1593 GenerateDirectLoadGlobalFunctionPrototype(masm(), |
1594 Context::STRING_FUNCTION_INDEX, | 1594 Context::STRING_FUNCTION_INDEX, |
1595 rax, | 1595 rax, |
1596 &miss); | 1596 &miss); |
1597 ASSERT(!object.is_identical_to(holder)); | 1597 ASSERT(!object.is_identical_to(holder)); |
1598 CheckPrototypes(Handle<JSObject>(JSObject::cast(object->GetPrototype())), | 1598 CheckPrototypes(Handle<JSObject>(JSObject::cast(object->GetPrototype())), |
1599 rax, holder, rbx, rdx, rdi, name, &miss); | 1599 rax, holder, rbx, rdx, rdi, name, &miss); |
1600 | 1600 |
1601 Register receiver = rbx; | 1601 Register receiver = rbx; |
1602 Register index = rdi; | 1602 Register index = rdi; |
1603 Register scratch = rdx; | |
1604 Register result = rax; | 1603 Register result = rax; |
1605 __ movq(receiver, Operand(rsp, (argc + 1) * kPointerSize)); | 1604 __ movq(receiver, Operand(rsp, (argc + 1) * kPointerSize)); |
1606 if (argc > 0) { | 1605 if (argc > 0) { |
1607 __ movq(index, Operand(rsp, (argc - 0) * kPointerSize)); | 1606 __ movq(index, Operand(rsp, (argc - 0) * kPointerSize)); |
1608 } else { | 1607 } else { |
1609 __ LoadRoot(index, Heap::kUndefinedValueRootIndex); | 1608 __ LoadRoot(index, Heap::kUndefinedValueRootIndex); |
1610 } | 1609 } |
1611 | 1610 |
1612 StringCharCodeAtGenerator generator(receiver, | 1611 StringCharCodeAtGenerator generator(receiver, |
1613 index, | 1612 index, |
1614 scratch, | |
1615 result, | 1613 result, |
1616 &miss, // When not a string. | 1614 &miss, // When not a string. |
1617 &miss, // When not a number. | 1615 &miss, // When not a number. |
1618 index_out_of_range_label, | 1616 index_out_of_range_label, |
1619 STRING_INDEX_IS_NUMBER); | 1617 STRING_INDEX_IS_NUMBER); |
1620 generator.GenerateFast(masm()); | 1618 generator.GenerateFast(masm()); |
1621 __ ret((argc + 1) * kPointerSize); | 1619 __ ret((argc + 1) * kPointerSize); |
1622 | 1620 |
1623 StubRuntimeCallHelper call_helper; | 1621 StubRuntimeCallHelper call_helper; |
1624 generator.GenerateSlow(masm(), call_helper); | 1622 generator.GenerateSlow(masm(), call_helper); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1673 GenerateDirectLoadGlobalFunctionPrototype(masm(), | 1671 GenerateDirectLoadGlobalFunctionPrototype(masm(), |
1674 Context::STRING_FUNCTION_INDEX, | 1672 Context::STRING_FUNCTION_INDEX, |
1675 rax, | 1673 rax, |
1676 &miss); | 1674 &miss); |
1677 ASSERT(!object.is_identical_to(holder)); | 1675 ASSERT(!object.is_identical_to(holder)); |
1678 CheckPrototypes(Handle<JSObject>(JSObject::cast(object->GetPrototype())), | 1676 CheckPrototypes(Handle<JSObject>(JSObject::cast(object->GetPrototype())), |
1679 rax, holder, rbx, rdx, rdi, name, &miss); | 1677 rax, holder, rbx, rdx, rdi, name, &miss); |
1680 | 1678 |
1681 Register receiver = rax; | 1679 Register receiver = rax; |
1682 Register index = rdi; | 1680 Register index = rdi; |
1683 Register scratch1 = rbx; | 1681 Register scratch = rdx; |
1684 Register scratch2 = rdx; | |
1685 Register result = rax; | 1682 Register result = rax; |
1686 __ movq(receiver, Operand(rsp, (argc + 1) * kPointerSize)); | 1683 __ movq(receiver, Operand(rsp, (argc + 1) * kPointerSize)); |
1687 if (argc > 0) { | 1684 if (argc > 0) { |
1688 __ movq(index, Operand(rsp, (argc - 0) * kPointerSize)); | 1685 __ movq(index, Operand(rsp, (argc - 0) * kPointerSize)); |
1689 } else { | 1686 } else { |
1690 __ LoadRoot(index, Heap::kUndefinedValueRootIndex); | 1687 __ LoadRoot(index, Heap::kUndefinedValueRootIndex); |
1691 } | 1688 } |
1692 | 1689 |
1693 StringCharAtGenerator generator(receiver, | 1690 StringCharAtGenerator generator(receiver, |
1694 index, | 1691 index, |
1695 scratch1, | 1692 scratch, |
1696 scratch2, | |
1697 result, | 1693 result, |
1698 &miss, // When not a string. | 1694 &miss, // When not a string. |
1699 &miss, // When not a number. | 1695 &miss, // When not a number. |
1700 index_out_of_range_label, | 1696 index_out_of_range_label, |
1701 STRING_INDEX_IS_NUMBER); | 1697 STRING_INDEX_IS_NUMBER); |
1702 generator.GenerateFast(masm()); | 1698 generator.GenerateFast(masm()); |
1703 __ ret((argc + 1) * kPointerSize); | 1699 __ ret((argc + 1) * kPointerSize); |
1704 | 1700 |
1705 StubRuntimeCallHelper call_helper; | 1701 StubRuntimeCallHelper call_helper; |
1706 generator.GenerateSlow(masm(), call_helper); | 1702 generator.GenerateSlow(masm(), call_helper); |
(...skipping 1911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3618 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); | 3614 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); |
3619 __ jmp(ic_miss, RelocInfo::CODE_TARGET); | 3615 __ jmp(ic_miss, RelocInfo::CODE_TARGET); |
3620 } | 3616 } |
3621 | 3617 |
3622 | 3618 |
3623 #undef __ | 3619 #undef __ |
3624 | 3620 |
3625 } } // namespace v8::internal | 3621 } } // namespace v8::internal |
3626 | 3622 |
3627 #endif // V8_TARGET_ARCH_X64 | 3623 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |