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 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 // Get field offset and check that it is an in-object property. | 447 // Get field offset and check that it is an in-object property. |
448 // edx : receiver | 448 // edx : receiver |
449 // ebx : receiver's map | 449 // ebx : receiver's map |
450 // eax : key | 450 // eax : key |
451 // ecx : lookup cache index | 451 // ecx : lookup cache index |
452 ExternalReference cache_field_offsets | 452 ExternalReference cache_field_offsets |
453 = ExternalReference::keyed_lookup_cache_field_offsets(); | 453 = ExternalReference::keyed_lookup_cache_field_offsets(); |
454 __ mov(edi, | 454 __ mov(edi, |
455 Operand::StaticArray(ecx, times_pointer_size, cache_field_offsets)); | 455 Operand::StaticArray(ecx, times_pointer_size, cache_field_offsets)); |
456 __ movzx_b(ecx, FieldOperand(ebx, Map::kInObjectPropertiesOffset)); | 456 __ movzx_b(ecx, FieldOperand(ebx, Map::kInObjectPropertiesOffset)); |
457 __ cmp(edi, Operand(ecx)); | 457 __ sub(edi, Operand(ecx)); |
458 __ j(above_equal, &slow); | 458 __ j(above_equal, &slow); |
459 | 459 |
460 // Load in-object property. | 460 // Load in-object property. |
461 __ sub(edi, Operand(ecx)); | |
462 __ movzx_b(ecx, FieldOperand(ebx, Map::kInstanceSizeOffset)); | 461 __ movzx_b(ecx, FieldOperand(ebx, Map::kInstanceSizeOffset)); |
463 __ add(ecx, Operand(edi)); | 462 __ add(ecx, Operand(edi)); |
464 __ mov(eax, FieldOperand(edx, ecx, times_pointer_size, 0)); | 463 __ mov(eax, FieldOperand(edx, ecx, times_pointer_size, 0)); |
465 __ IncrementCounter(&Counters::keyed_load_generic_lookup_cache, 1); | 464 __ IncrementCounter(&Counters::keyed_load_generic_lookup_cache, 1); |
466 __ ret(0); | 465 __ ret(0); |
467 | 466 |
468 // Do a quick inline probe of the receiver's dictionary, if it | 467 // Do a quick inline probe of the receiver's dictionary, if it |
469 // exists. | 468 // exists. |
470 __ bind(&probe_dictionary); | 469 __ bind(&probe_dictionary); |
471 GenerateDictionaryLoad(masm, | 470 GenerateDictionaryLoad(masm, |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 __ ret(0); | 682 __ ret(0); |
684 } | 683 } |
685 | 684 |
686 // If we fail allocation of the HeapNumber, we still have a value on | 685 // If we fail allocation of the HeapNumber, we still have a value on |
687 // top of the FPU stack. Remove it. | 686 // top of the FPU stack. Remove it. |
688 __ bind(&failed_allocation); | 687 __ bind(&failed_allocation); |
689 __ ffree(); | 688 __ ffree(); |
690 __ fincstp(); | 689 __ fincstp(); |
691 // Fall through to slow case. | 690 // Fall through to slow case. |
692 | 691 |
693 // Slow case: Load key and receiver from stack and jump to runtime. | 692 // Slow case: Jump to runtime. |
694 __ bind(&slow); | 693 __ bind(&slow); |
695 __ IncrementCounter(&Counters::keyed_load_external_array_slow, 1); | 694 __ IncrementCounter(&Counters::keyed_load_external_array_slow, 1); |
696 GenerateRuntimeGetProperty(masm); | 695 GenerateRuntimeGetProperty(masm); |
697 } | 696 } |
698 | 697 |
699 | 698 |
700 void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { | 699 void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { |
701 // ----------- S t a t e ------------- | 700 // ----------- S t a t e ------------- |
702 // -- eax : key | 701 // -- eax : key |
703 // -- edx : receiver | 702 // -- edx : receiver |
(...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1618 ExternalReference ref = ExternalReference(IC_Utility(kKeyedStoreIC_Miss)); | 1617 ExternalReference ref = ExternalReference(IC_Utility(kKeyedStoreIC_Miss)); |
1619 __ TailCallExternalReference(ref, 3, 1); | 1618 __ TailCallExternalReference(ref, 3, 1); |
1620 } | 1619 } |
1621 | 1620 |
1622 #undef __ | 1621 #undef __ |
1623 | 1622 |
1624 | 1623 |
1625 } } // namespace v8::internal | 1624 } } // namespace v8::internal |
1626 | 1625 |
1627 #endif // V8_TARGET_ARCH_IA32 | 1626 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |