OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 // |done| label if a property with the given name is found leaving the | 101 // |done| label if a property with the given name is found leaving the |
102 // index into the dictionary in |r1|. Jump to the |miss| label | 102 // index into the dictionary in |r1|. Jump to the |miss| label |
103 // otherwise. | 103 // otherwise. |
104 static void GenerateStringDictionaryProbes(MacroAssembler* masm, | 104 static void GenerateStringDictionaryProbes(MacroAssembler* masm, |
105 Label* miss, | 105 Label* miss, |
106 Label* done, | 106 Label* done, |
107 Register elements, | 107 Register elements, |
108 Register name, | 108 Register name, |
109 Register r0, | 109 Register r0, |
110 Register r1) { | 110 Register r1) { |
| 111 // Assert that name contains a string. |
| 112 if (FLAG_debug_code) __ AbortIfNotString(name); |
| 113 |
111 // Compute the capacity mask. | 114 // Compute the capacity mask. |
112 const int kCapacityOffset = | 115 const int kCapacityOffset = |
113 StringDictionary::kHeaderSize + | 116 StringDictionary::kHeaderSize + |
114 StringDictionary::kCapacityIndex * kPointerSize; | 117 StringDictionary::kCapacityIndex * kPointerSize; |
115 __ SmiToInteger32(r0, FieldOperand(elements, kCapacityOffset)); | 118 __ SmiToInteger32(r0, FieldOperand(elements, kCapacityOffset)); |
116 __ decl(r0); | 119 __ decl(r0); |
117 | 120 |
118 // Generate an unrolled loop that performs a few probes before | 121 // Generate an unrolled loop that performs a few probes before |
119 // giving up. Measurements done on Gmail indicate that 2 probes | 122 // giving up. Measurements done on Gmail indicate that 2 probes |
120 // cover ~93% of loads from dictionaries. | 123 // cover ~93% of loads from dictionaries. |
(...skipping 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1580 // ----------- S t a t e ------------- | 1583 // ----------- S t a t e ------------- |
1581 // rcx : function name | 1584 // rcx : function name |
1582 // rsp[0] : return address | 1585 // rsp[0] : return address |
1583 // rsp[8] : argument argc | 1586 // rsp[8] : argument argc |
1584 // rsp[16] : argument argc - 1 | 1587 // rsp[16] : argument argc - 1 |
1585 // ... | 1588 // ... |
1586 // rsp[argc * 8] : argument 1 | 1589 // rsp[argc * 8] : argument 1 |
1587 // rsp[(argc + 1) * 8] : argument 0 = receiver | 1590 // rsp[(argc + 1) * 8] : argument 0 = receiver |
1588 // ----------------------------------- | 1591 // ----------------------------------- |
1589 | 1592 |
| 1593 // Check if the name is a string. |
| 1594 Label miss; |
| 1595 __ JumpIfSmi(rcx, &miss); |
| 1596 Condition cond = masm->IsObjectStringType(rcx, rax, rax); |
| 1597 __ j(NegateCondition(cond), &miss); |
1590 GenerateCallNormal(masm, argc); | 1598 GenerateCallNormal(masm, argc); |
| 1599 __ bind(&miss); |
1591 GenerateMiss(masm, argc); | 1600 GenerateMiss(masm, argc); |
1592 } | 1601 } |
1593 | 1602 |
1594 | 1603 |
1595 // The offset from the inlined patch site to the start of the inlined | 1604 // The offset from the inlined patch site to the start of the inlined |
1596 // load instruction. | 1605 // load instruction. |
1597 const int LoadIC::kOffsetToLoadInstruction = 20; | 1606 const int LoadIC::kOffsetToLoadInstruction = 20; |
1598 | 1607 |
1599 | 1608 |
1600 void LoadIC::GenerateMiss(MacroAssembler* masm) { | 1609 void LoadIC::GenerateMiss(MacroAssembler* masm) { |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1898 GenerateMiss(masm); | 1907 GenerateMiss(masm); |
1899 } | 1908 } |
1900 | 1909 |
1901 | 1910 |
1902 #undef __ | 1911 #undef __ |
1903 | 1912 |
1904 | 1913 |
1905 } } // namespace v8::internal | 1914 } } // namespace v8::internal |
1906 | 1915 |
1907 #endif // V8_TARGET_ARCH_X64 | 1916 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |