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 1421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1542 | 1545 |
1543 void KeyedCallIC::GenerateNormal(MacroAssembler* masm, int argc) { | 1546 void KeyedCallIC::GenerateNormal(MacroAssembler* masm, int argc) { |
1544 // ----------- S t a t e ------------- | 1547 // ----------- S t a t e ------------- |
1545 // -- ecx : name | 1548 // -- ecx : name |
1546 // -- esp[0] : return address | 1549 // -- esp[0] : return address |
1547 // -- esp[(argc - n) * 4] : arg[n] (zero-based) | 1550 // -- esp[(argc - n) * 4] : arg[n] (zero-based) |
1548 // -- ... | 1551 // -- ... |
1549 // -- esp[(argc + 1) * 4] : receiver | 1552 // -- esp[(argc + 1) * 4] : receiver |
1550 // ----------------------------------- | 1553 // ----------------------------------- |
1551 | 1554 |
| 1555 // Check if the name is a string. |
| 1556 Label miss; |
| 1557 __ test(ecx, Immediate(kSmiTagMask)); |
| 1558 __ j(zero, &miss); |
| 1559 Condition cond = masm->IsObjectStringType(ecx, eax, eax); |
| 1560 __ j(NegateCondition(cond), &miss); |
1552 GenerateCallNormal(masm, argc); | 1561 GenerateCallNormal(masm, argc); |
| 1562 __ bind(&miss); |
1553 GenerateMiss(masm, argc); | 1563 GenerateMiss(masm, argc); |
1554 } | 1564 } |
1555 | 1565 |
1556 | 1566 |
1557 void KeyedCallIC::GenerateMiss(MacroAssembler* masm, int argc) { | 1567 void KeyedCallIC::GenerateMiss(MacroAssembler* masm, int argc) { |
1558 // ----------- S t a t e ------------- | 1568 // ----------- S t a t e ------------- |
1559 // -- ecx : name | 1569 // -- ecx : name |
1560 // -- esp[0] : return address | 1570 // -- esp[0] : return address |
1561 // -- esp[(argc - n) * 4] : arg[n] (zero-based) | 1571 // -- esp[(argc - n) * 4] : arg[n] (zero-based) |
1562 // -- ... | 1572 // -- ... |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1999 ExternalReference ref = ExternalReference(IC_Utility(kKeyedStoreIC_Miss)); | 2009 ExternalReference ref = ExternalReference(IC_Utility(kKeyedStoreIC_Miss)); |
2000 __ TailCallExternalReference(ref, 3, 1); | 2010 __ TailCallExternalReference(ref, 3, 1); |
2001 } | 2011 } |
2002 | 2012 |
2003 #undef __ | 2013 #undef __ |
2004 | 2014 |
2005 | 2015 |
2006 } } // namespace v8::internal | 2016 } } // namespace v8::internal |
2007 | 2017 |
2008 #endif // V8_TARGET_ARCH_IA32 | 2018 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |