OLD | NEW |
---|---|
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
205 StubCompiler::GenerateLoadMiss(masm, Code::LOAD_IC); | 205 StubCompiler::GenerateLoadMiss(masm, Code::LOAD_IC); |
206 } | 206 } |
207 | 207 |
208 | 208 |
209 void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) { | 209 void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) { |
210 // ----------- S t a t e ------------- | 210 // ----------- S t a t e ------------- |
211 // -- esp[0] : return address | 211 // -- esp[0] : return address |
212 // -- esp[4] : name | 212 // -- esp[4] : name |
213 // -- esp[8] : receiver | 213 // -- esp[8] : receiver |
214 // ----------------------------------- | 214 // ----------------------------------- |
215 Label slow, fast, check_string; | 215 Label slow, fast, check_string, slow_string; |
Kasper Lund
2008/10/10 09:32:06
The slow_string label doesn't appear to be used?
| |
216 | 216 |
217 __ mov(eax, (Operand(esp, kPointerSize))); | 217 __ mov(eax, (Operand(esp, kPointerSize))); |
218 __ mov(ecx, (Operand(esp, 2 * kPointerSize))); | 218 __ mov(ecx, (Operand(esp, 2 * kPointerSize))); |
219 | 219 |
220 // Check that the object isn't a smi. | 220 // Check that the object isn't a smi. |
221 __ test(ecx, Immediate(kSmiTagMask)); | 221 __ test(ecx, Immediate(kSmiTagMask)); |
222 __ j(zero, &slow, not_taken); | 222 __ j(zero, &slow, not_taken); |
223 // Check that the object is some kind of JS object EXCEPT JS Value type. | 223 // Check that the object is some kind of JS object EXCEPT JS Value type. |
224 // In the case that the object is a value-wrapper object, | 224 // In the case that the object is a value-wrapper object, |
225 // we enter the runtime system to make sure that indexing | 225 // we enter the runtime system to make sure that indexing |
(...skipping 12 matching lines...) Expand all Loading... | |
238 // Check that the object is in fast mode (not dictionary). | 238 // Check that the object is in fast mode (not dictionary). |
239 __ cmp(FieldOperand(ecx, HeapObject::kMapOffset), | 239 __ cmp(FieldOperand(ecx, HeapObject::kMapOffset), |
240 Immediate(Factory::hash_table_map())); | 240 Immediate(Factory::hash_table_map())); |
241 __ j(equal, &slow, not_taken); | 241 __ j(equal, &slow, not_taken); |
242 // Check that the key (index) is within bounds. | 242 // Check that the key (index) is within bounds. |
243 __ cmp(eax, FieldOperand(ecx, Array::kLengthOffset)); | 243 __ cmp(eax, FieldOperand(ecx, Array::kLengthOffset)); |
244 __ j(below, &fast, taken); | 244 __ j(below, &fast, taken); |
245 // Slow case: Load name and receiver from stack and jump to runtime. | 245 // Slow case: Load name and receiver from stack and jump to runtime. |
246 __ bind(&slow); | 246 __ bind(&slow); |
247 __ IncrementCounter(&Counters::keyed_load_generic_slow, 1); | 247 __ IncrementCounter(&Counters::keyed_load_generic_slow, 1); |
248 KeyedLoadIC::Generate(masm, ExternalReference(Runtime::kGetProperty)); | 248 KeyedLoadIC::Generate(masm, ExternalReference(Runtime::kKeyedGetProperty)); |
Kasper Lund
2008/10/10 09:32:06
Maybe you should port this change to ARM right awa
| |
249 // Check if the key is a symbol that is not an array index. | 249 // Check if the key is a symbol that is not an array index. |
250 __ bind(&check_string); | 250 __ bind(&check_string); |
251 __ mov(ebx, FieldOperand(eax, HeapObject::kMapOffset)); | 251 __ mov(ebx, FieldOperand(eax, HeapObject::kMapOffset)); |
252 __ movzx_b(ebx, FieldOperand(ebx, Map::kInstanceTypeOffset)); | 252 __ movzx_b(ebx, FieldOperand(ebx, Map::kInstanceTypeOffset)); |
253 __ test(ebx, Immediate(kIsSymbolMask)); | 253 __ test(ebx, Immediate(kIsSymbolMask)); |
254 __ j(zero, &slow, not_taken); | 254 __ j(zero, &slow, not_taken); |
255 __ mov(ebx, FieldOperand(eax, String::kLengthOffset)); | 255 __ mov(ebx, FieldOperand(eax, String::kLengthOffset)); |
256 __ test(ebx, Immediate(String::kIsArrayIndexMask)); | 256 __ test(ebx, Immediate(String::kIsArrayIndexMask)); |
257 __ j(not_zero, &slow, not_taken); | 257 __ j(not_zero, &slow, not_taken); |
258 // Probe the dictionary leaving result in ecx. | 258 // Probe the dictionary leaving result in ecx. |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
769 | 769 |
770 // Do tail-call to runtime routine. | 770 // Do tail-call to runtime routine. |
771 __ TailCallRuntime( | 771 __ TailCallRuntime( |
772 ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3); | 772 ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3); |
773 } | 773 } |
774 | 774 |
775 #undef __ | 775 #undef __ |
776 | 776 |
777 | 777 |
778 } } // namespace v8::internal | 778 } } // namespace v8::internal |
OLD | NEW |