| 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 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 726 __ pop(ebx); | 726 __ pop(ebx); |
| 727 __ push(eax); | 727 __ push(eax); |
| 728 __ push(ecx); | 728 __ push(ecx); |
| 729 __ push(ebx); | 729 __ push(ebx); |
| 730 | 730 |
| 731 // Perform tail call to the entry. | 731 // Perform tail call to the entry. |
| 732 __ TailCallRuntime(f, 2); | 732 __ TailCallRuntime(f, 2); |
| 733 } | 733 } |
| 734 | 734 |
| 735 | 735 |
| 736 void KeyedLoadIC::PatchInlinedMapCheck(Address address, Object* value) { |
| 737 static const byte kTestEaxByte = 0xA9; |
| 738 Address test_instruction_address = address + 4; // 4 = stub address |
| 739 // The keyed load has a fast inlined case if the IC call instruction |
| 740 // is immediately followed by a test instruction. |
| 741 if (*test_instruction_address == kTestEaxByte) { |
| 742 // Fetch the offset from the call instruction to the map cmp |
| 743 // instruction. This offset is stored in the last 4 bytes of the |
| 744 // 5 byte test instruction. |
| 745 Address offset_address = test_instruction_address + 1; |
| 746 int offset_value = *(reinterpret_cast<int*>(offset_address)); |
| 747 // Compute the map address. The operand-immediate compare |
| 748 // instruction is two bytes larger than a call instruction so we |
| 749 // add 2 to get to the map address. |
| 750 Address map_address = address + offset_value + 2; |
| 751 // patch the map check. |
| 752 (*(reinterpret_cast<Object**>(map_address))) = value; |
| 753 } |
| 754 } |
| 755 |
| 756 |
| 736 // Defined in ic.cc. | 757 // Defined in ic.cc. |
| 737 Object* KeyedLoadIC_Miss(Arguments args); | 758 Object* KeyedLoadIC_Miss(Arguments args); |
| 738 | 759 |
| 739 | 760 |
| 740 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { | 761 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { |
| 741 // ----------- S t a t e ------------- | 762 // ----------- S t a t e ------------- |
| 742 // -- esp[0] : return address | 763 // -- esp[0] : return address |
| 743 // -- esp[4] : name | 764 // -- esp[4] : name |
| 744 // -- esp[8] : receiver | 765 // -- esp[8] : receiver |
| 745 // ----------------------------------- | 766 // ----------------------------------- |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 868 | 889 |
| 869 // Do tail-call to runtime routine. | 890 // Do tail-call to runtime routine. |
| 870 __ TailCallRuntime( | 891 __ TailCallRuntime( |
| 871 ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3); | 892 ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3); |
| 872 } | 893 } |
| 873 | 894 |
| 874 #undef __ | 895 #undef __ |
| 875 | 896 |
| 876 | 897 |
| 877 } } // namespace v8::internal | 898 } } // namespace v8::internal |
| OLD | NEW |