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 |r0|. Jump to the |miss| label | 102 // index into the dictionary in |r0|. 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 __ mov(r1, FieldOperand(elements, kCapacityOffset)); | 118 __ mov(r1, FieldOperand(elements, kCapacityOffset)); |
116 __ shr(r1, kSmiTagSize); // convert smi to int | 119 __ shr(r1, kSmiTagSize); // convert smi to int |
117 __ dec(r1); | 120 __ dec(r1); |
118 | 121 |
119 // Generate an unrolled loop that performs a few probes before | 122 // Generate an unrolled loop that performs a few probes before |
120 // giving up. Measurements done on Gmail indicate that 2 probes | 123 // giving up. Measurements done on Gmail indicate that 2 probes |
(...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1201 | 1204 |
1202 void KeyedCallIC::GenerateNormal(MacroAssembler* masm, int argc) { | 1205 void KeyedCallIC::GenerateNormal(MacroAssembler* masm, int argc) { |
1203 // ----------- S t a t e ------------- | 1206 // ----------- S t a t e ------------- |
1204 // -- ecx : name | 1207 // -- ecx : name |
1205 // -- esp[0] : return address | 1208 // -- esp[0] : return address |
1206 // -- esp[(argc - n) * 4] : arg[n] (zero-based) | 1209 // -- esp[(argc - n) * 4] : arg[n] (zero-based) |
1207 // -- ... | 1210 // -- ... |
1208 // -- esp[(argc + 1) * 4] : receiver | 1211 // -- esp[(argc + 1) * 4] : receiver |
1209 // ----------------------------------- | 1212 // ----------------------------------- |
1210 | 1213 |
| 1214 // Check if the name is a string. |
| 1215 Label miss; |
| 1216 __ test(ecx, Immediate(kSmiTagMask)); |
| 1217 __ j(zero, &miss); |
| 1218 Condition cond = masm->IsObjectStringType(ecx, eax, eax); |
| 1219 __ j(NegateCondition(cond), &miss); |
1211 GenerateCallNormal(masm, argc); | 1220 GenerateCallNormal(masm, argc); |
| 1221 __ bind(&miss); |
1212 GenerateMiss(masm, argc); | 1222 GenerateMiss(masm, argc); |
1213 } | 1223 } |
1214 | 1224 |
1215 | 1225 |
1216 void KeyedCallIC::GenerateMiss(MacroAssembler* masm, int argc) { | 1226 void KeyedCallIC::GenerateMiss(MacroAssembler* masm, int argc) { |
1217 // ----------- S t a t e ------------- | 1227 // ----------- S t a t e ------------- |
1218 // -- ecx : name | 1228 // -- ecx : name |
1219 // -- esp[0] : return address | 1229 // -- esp[0] : return address |
1220 // -- esp[(argc - n) * 4] : arg[n] (zero-based) | 1230 // -- esp[(argc - n) * 4] : arg[n] (zero-based) |
1221 // -- ... | 1231 // -- ... |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1771 Condition cc = *jmp_address == Assembler::kJncShortOpcode | 1781 Condition cc = *jmp_address == Assembler::kJncShortOpcode |
1772 ? not_zero | 1782 ? not_zero |
1773 : zero; | 1783 : zero; |
1774 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 1784 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
1775 } | 1785 } |
1776 | 1786 |
1777 | 1787 |
1778 } } // namespace v8::internal | 1788 } } // namespace v8::internal |
1779 | 1789 |
1780 #endif // V8_TARGET_ARCH_IA32 | 1790 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |