| 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 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 __ TailCallRuntime(f, 2); | 732 __ TailCallRuntime(f, 2); |
| 733 } | 733 } |
| 734 | 734 |
| 735 | 735 |
| 736 void KeyedLoadIC::PatchInlinedMapCheck(Address address, Object* value) { | 736 void KeyedLoadIC::PatchInlinedMapCheck(Address address, Object* value) { |
| 737 static const byte kTestEaxByte = 0xA9; | 737 static const byte kTestEaxByte = 0xA9; |
| 738 Address test_instruction_address = address + 4; // 4 = stub address | 738 Address test_instruction_address = address + 4; // 4 = stub address |
| 739 // The keyed load has a fast inlined case if the IC call instruction | 739 // The keyed load has a fast inlined case if the IC call instruction |
| 740 // is immediately followed by a test instruction. | 740 // is immediately followed by a test instruction. |
| 741 if (*test_instruction_address == kTestEaxByte) { | 741 if (*test_instruction_address == kTestEaxByte) { |
| 742 // Fetch the offset from the call instruction to the map cmp | 742 // Fetch the offset from the test instruction to the map cmp |
| 743 // instruction. This offset is stored in the last 4 bytes of the | 743 // instruction. This offset is stored in the last 4 bytes of the |
| 744 // 5 byte test instruction. | 744 // 5 byte test instruction. |
| 745 Address offset_address = test_instruction_address + 1; | 745 Address offset_address = test_instruction_address + 1; |
| 746 int offset_value = *(reinterpret_cast<int*>(offset_address)); | 746 int offset_value = *(reinterpret_cast<int*>(offset_address)); |
| 747 // Compute the map address. The operand-immediate compare | 747 // Compute the map address. The map address is in the last 4 |
| 748 // instruction is two bytes larger than a call instruction so we | 748 // bytes of the 7-byte operand-immediate compare instruction, so |
| 749 // add 2 to get to the map address. | 749 // we add 3 to the offset to get the map address. |
| 750 Address map_address = address + offset_value + 2; | 750 Address map_address = test_instruction_address + offset_value + 3; |
| 751 // patch the map check. | 751 // patch the map check. |
| 752 (*(reinterpret_cast<Object**>(map_address))) = value; | 752 (*(reinterpret_cast<Object**>(map_address))) = value; |
| 753 } | 753 } |
| 754 } | 754 } |
| 755 | 755 |
| 756 | 756 |
| 757 // Defined in ic.cc. | 757 // Defined in ic.cc. |
| 758 Object* KeyedLoadIC_Miss(Arguments args); | 758 Object* KeyedLoadIC_Miss(Arguments args); |
| 759 | 759 |
| 760 | 760 |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 889 | 889 |
| 890 // Do tail-call to runtime routine. | 890 // Do tail-call to runtime routine. |
| 891 __ TailCallRuntime( | 891 __ TailCallRuntime( |
| 892 ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3); | 892 ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3); |
| 893 } | 893 } |
| 894 | 894 |
| 895 #undef __ | 895 #undef __ |
| 896 | 896 |
| 897 | 897 |
| 898 } } // namespace v8::internal | 898 } } // namespace v8::internal |
| OLD | NEW |