OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 7052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7063 Label* miss, | 7063 Label* miss, |
7064 Label* done, | 7064 Label* done, |
7065 Register receiver, | 7065 Register receiver, |
7066 Register properties, | 7066 Register properties, |
7067 Handle<String> name, | 7067 Handle<String> name, |
7068 Register scratch0) { | 7068 Register scratch0) { |
7069 // If names of slots in range from 1 to kProbes - 1 for the hash value are | 7069 // If names of slots in range from 1 to kProbes - 1 for the hash value are |
7070 // not equal to the name and kProbes-th slot is not used (its name is the | 7070 // not equal to the name and kProbes-th slot is not used (its name is the |
7071 // undefined value), it guarantees the hash table doesn't contain the | 7071 // undefined value), it guarantees the hash table doesn't contain the |
7072 // property. It's true even if some slots represent deleted properties | 7072 // property. It's true even if some slots represent deleted properties |
7073 // (their names are the null value). | 7073 // (their names are the hole value). |
7074 for (int i = 0; i < kInlinedProbes; i++) { | 7074 for (int i = 0; i < kInlinedProbes; i++) { |
7075 // scratch0 points to properties hash. | 7075 // scratch0 points to properties hash. |
7076 // Compute the masked index: (hash + i + i * i) & mask. | 7076 // Compute the masked index: (hash + i + i * i) & mask. |
7077 Register index = scratch0; | 7077 Register index = scratch0; |
7078 // Capacity is smi 2^n. | 7078 // Capacity is smi 2^n. |
7079 __ lw(index, FieldMemOperand(properties, kCapacityOffset)); | 7079 __ lw(index, FieldMemOperand(properties, kCapacityOffset)); |
7080 __ Subu(index, index, Operand(1)); | 7080 __ Subu(index, index, Operand(1)); |
7081 __ And(index, index, Operand( | 7081 __ And(index, index, Operand( |
7082 Smi::FromInt(name->Hash() + StringDictionary::GetProbeOffset(i)))); | 7082 Smi::FromInt(name->Hash() + StringDictionary::GetProbeOffset(i)))); |
7083 | 7083 |
7084 // Scale the index by multiplying by the entry size. | 7084 // Scale the index by multiplying by the entry size. |
7085 ASSERT(StringDictionary::kEntrySize == 3); | 7085 ASSERT(StringDictionary::kEntrySize == 3); |
7086 __ sll(at, index, 1); | 7086 __ sll(at, index, 1); |
7087 __ Addu(index, index, at); | 7087 __ Addu(index, index, at); |
7088 | 7088 |
7089 Register entity_name = scratch0; | 7089 Register entity_name = scratch0; |
7090 // Having undefined at this place means the name is not contained. | 7090 // Having undefined at this place means the name is not contained. |
7091 ASSERT_EQ(kSmiTagSize, 1); | 7091 ASSERT_EQ(kSmiTagSize, 1); |
7092 Register tmp = properties; | 7092 Register tmp = properties; |
7093 __ sll(scratch0, index, 1); | 7093 __ sll(scratch0, index, 1); |
7094 __ Addu(tmp, properties, scratch0); | 7094 __ Addu(tmp, properties, scratch0); |
7095 __ lw(entity_name, FieldMemOperand(tmp, kElementsStartOffset)); | 7095 __ lw(entity_name, FieldMemOperand(tmp, kElementsStartOffset)); |
7096 | 7096 |
7097 ASSERT(!tmp.is(entity_name)); | 7097 ASSERT(!tmp.is(entity_name)); |
7098 __ LoadRoot(tmp, Heap::kUndefinedValueRootIndex); | 7098 __ LoadRoot(tmp, Heap::kUndefinedValueRootIndex); |
7099 __ Branch(done, eq, entity_name, Operand(tmp)); | 7099 __ Branch(done, eq, entity_name, Operand(tmp)); |
7100 | 7100 |
7101 if (i != kInlinedProbes - 1) { | 7101 if (i != kInlinedProbes - 1) { |
| 7102 // Load the hole ready for use below: |
| 7103 __ LoadRoot(tmp, Heap::kTheHoleValueRootIndex); |
| 7104 |
7102 // Stop if found the property. | 7105 // Stop if found the property. |
7103 __ Branch(miss, eq, entity_name, Operand(Handle<String>(name))); | 7106 __ Branch(miss, eq, entity_name, Operand(Handle<String>(name))); |
7104 | 7107 |
| 7108 Label the_hole; |
| 7109 __ Branch(&the_hole, eq, entity_name, Operand(tmp)); |
| 7110 |
7105 // Check if the entry name is not a symbol. | 7111 // Check if the entry name is not a symbol. |
7106 __ lw(entity_name, FieldMemOperand(entity_name, HeapObject::kMapOffset)); | 7112 __ lw(entity_name, FieldMemOperand(entity_name, HeapObject::kMapOffset)); |
7107 __ lbu(entity_name, | 7113 __ lbu(entity_name, |
7108 FieldMemOperand(entity_name, Map::kInstanceTypeOffset)); | 7114 FieldMemOperand(entity_name, Map::kInstanceTypeOffset)); |
7109 __ And(scratch0, entity_name, Operand(kIsSymbolMask)); | 7115 __ And(scratch0, entity_name, Operand(kIsSymbolMask)); |
7110 __ Branch(miss, eq, scratch0, Operand(zero_reg)); | 7116 __ Branch(miss, eq, scratch0, Operand(zero_reg)); |
7111 | 7117 |
| 7118 __ bind(&the_hole); |
| 7119 |
7112 // Restore the properties. | 7120 // Restore the properties. |
7113 __ lw(properties, | 7121 __ lw(properties, |
7114 FieldMemOperand(receiver, JSObject::kPropertiesOffset)); | 7122 FieldMemOperand(receiver, JSObject::kPropertiesOffset)); |
7115 } | 7123 } |
7116 } | 7124 } |
7117 | 7125 |
7118 const int spill_mask = | 7126 const int spill_mask = |
7119 (ra.bit() | t2.bit() | t1.bit() | t0.bit() | a3.bit() | | 7127 (ra.bit() | t2.bit() | t1.bit() | t0.bit() | a3.bit() | |
7120 a2.bit() | a1.bit() | a0.bit() | v0.bit()); | 7128 a2.bit() | a1.bit() | a0.bit() | v0.bit()); |
7121 | 7129 |
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7644 __ Ret(USE_DELAY_SLOT); | 7652 __ Ret(USE_DELAY_SLOT); |
7645 __ mov(v0, a0); | 7653 __ mov(v0, a0); |
7646 } | 7654 } |
7647 | 7655 |
7648 | 7656 |
7649 #undef __ | 7657 #undef __ |
7650 | 7658 |
7651 } } // namespace v8::internal | 7659 } } // namespace v8::internal |
7652 | 7660 |
7653 #endif // V8_TARGET_ARCH_MIPS | 7661 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |