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 950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
961 | 961 |
962 return code_marker; | 962 return code_marker; |
963 } | 963 } |
964 | 964 |
965 | 965 |
966 bool LoadIC::PatchInlinedLoad(Address address, Object* map, int offset) { | 966 bool LoadIC::PatchInlinedLoad(Address address, Object* map, int offset) { |
967 if (V8::UseCrankshaft()) return false; | 967 if (V8::UseCrankshaft()) return false; |
968 | 968 |
969 // Find the end of the inlined code for handling the load if this is an | 969 // Find the end of the inlined code for handling the load if this is an |
970 // inlined IC call site. | 970 // inlined IC call site. |
971 Address inline_end_address; | 971 Address inline_end_address = 0; |
972 if (InlinedICSiteMarker(address, &inline_end_address) | 972 if (InlinedICSiteMarker(address, &inline_end_address) |
973 != Assembler::PROPERTY_ACCESS_INLINED) { | 973 != Assembler::PROPERTY_ACCESS_INLINED) { |
974 return false; | 974 return false; |
975 } | 975 } |
976 | 976 |
977 // Patch the offset of the property load instruction (ldr r0, [r1, #+XXX]). | 977 // Patch the offset of the property load instruction (ldr r0, [r1, #+XXX]). |
978 // The immediate must be representable in 12 bits. | 978 // The immediate must be representable in 12 bits. |
979 ASSERT((JSObject::kMaxInstanceSize - JSObject::kHeaderSize) < (1 << 12)); | 979 ASSERT((JSObject::kMaxInstanceSize - JSObject::kHeaderSize) < (1 << 12)); |
980 Address ldr_property_instr_address = | 980 Address ldr_property_instr_address = |
981 inline_end_address - Assembler::kInstrSize; | 981 inline_end_address - Assembler::kInstrSize; |
(...skipping 19 matching lines...) Expand all Loading... |
1001 return true; | 1001 return true; |
1002 } | 1002 } |
1003 | 1003 |
1004 | 1004 |
1005 bool LoadIC::PatchInlinedContextualLoad(Address address, | 1005 bool LoadIC::PatchInlinedContextualLoad(Address address, |
1006 Object* map, | 1006 Object* map, |
1007 Object* cell, | 1007 Object* cell, |
1008 bool is_dont_delete) { | 1008 bool is_dont_delete) { |
1009 // Find the end of the inlined code for handling the contextual load if | 1009 // Find the end of the inlined code for handling the contextual load if |
1010 // this is inlined IC call site. | 1010 // this is inlined IC call site. |
1011 Address inline_end_address; | 1011 Address inline_end_address = 0; |
1012 int marker = InlinedICSiteMarker(address, &inline_end_address); | 1012 int marker = InlinedICSiteMarker(address, &inline_end_address); |
1013 if (!((marker == Assembler::PROPERTY_ACCESS_INLINED_CONTEXT) || | 1013 if (!((marker == Assembler::PROPERTY_ACCESS_INLINED_CONTEXT) || |
1014 (marker == Assembler::PROPERTY_ACCESS_INLINED_CONTEXT_DONT_DELETE))) { | 1014 (marker == Assembler::PROPERTY_ACCESS_INLINED_CONTEXT_DONT_DELETE))) { |
1015 return false; | 1015 return false; |
1016 } | 1016 } |
1017 // On ARM we don't rely on the is_dont_delete argument as the hint is already | 1017 // On ARM we don't rely on the is_dont_delete argument as the hint is already |
1018 // embedded in the code marker. | 1018 // embedded in the code marker. |
1019 bool marker_is_dont_delete = | 1019 bool marker_is_dont_delete = |
1020 marker == Assembler::PROPERTY_ACCESS_INLINED_CONTEXT_DONT_DELETE; | 1020 marker == Assembler::PROPERTY_ACCESS_INLINED_CONTEXT_DONT_DELETE; |
1021 | 1021 |
(...skipping 20 matching lines...) Expand all Loading... |
1042 | 1042 |
1043 return true; | 1043 return true; |
1044 } | 1044 } |
1045 | 1045 |
1046 | 1046 |
1047 bool StoreIC::PatchInlinedStore(Address address, Object* map, int offset) { | 1047 bool StoreIC::PatchInlinedStore(Address address, Object* map, int offset) { |
1048 if (V8::UseCrankshaft()) return false; | 1048 if (V8::UseCrankshaft()) return false; |
1049 | 1049 |
1050 // Find the end of the inlined code for the store if there is an | 1050 // Find the end of the inlined code for the store if there is an |
1051 // inlined version of the store. | 1051 // inlined version of the store. |
1052 Address inline_end_address; | 1052 Address inline_end_address = 0; |
1053 if (InlinedICSiteMarker(address, &inline_end_address) | 1053 if (InlinedICSiteMarker(address, &inline_end_address) |
1054 != Assembler::PROPERTY_ACCESS_INLINED) { | 1054 != Assembler::PROPERTY_ACCESS_INLINED) { |
1055 return false; | 1055 return false; |
1056 } | 1056 } |
1057 | 1057 |
1058 // Compute the address of the map load instruction. | 1058 // Compute the address of the map load instruction. |
1059 Address ldr_map_instr_address = | 1059 Address ldr_map_instr_address = |
1060 inline_end_address - | 1060 inline_end_address - |
1061 (CodeGenerator::GetInlinedNamedStoreInstructionsAfterPatch() * | 1061 (CodeGenerator::GetInlinedNamedStoreInstructionsAfterPatch() * |
1062 Assembler::kInstrSize); | 1062 Assembler::kInstrSize); |
(...skipping 29 matching lines...) Expand all Loading... |
1092 Assembler::set_target_address_at(ldr_map_instr_address, | 1092 Assembler::set_target_address_at(ldr_map_instr_address, |
1093 reinterpret_cast<Address>(map)); | 1093 reinterpret_cast<Address>(map)); |
1094 | 1094 |
1095 return true; | 1095 return true; |
1096 } | 1096 } |
1097 | 1097 |
1098 | 1098 |
1099 bool KeyedLoadIC::PatchInlinedLoad(Address address, Object* map) { | 1099 bool KeyedLoadIC::PatchInlinedLoad(Address address, Object* map) { |
1100 if (V8::UseCrankshaft()) return false; | 1100 if (V8::UseCrankshaft()) return false; |
1101 | 1101 |
1102 Address inline_end_address; | 1102 Address inline_end_address = 0; |
1103 if (InlinedICSiteMarker(address, &inline_end_address) | 1103 if (InlinedICSiteMarker(address, &inline_end_address) |
1104 != Assembler::PROPERTY_ACCESS_INLINED) { | 1104 != Assembler::PROPERTY_ACCESS_INLINED) { |
1105 return false; | 1105 return false; |
1106 } | 1106 } |
1107 | 1107 |
1108 // Patch the map check. | 1108 // Patch the map check. |
1109 Address ldr_map_instr_address = | 1109 Address ldr_map_instr_address = |
1110 inline_end_address - | 1110 inline_end_address - |
1111 (CodeGenerator::GetInlinedKeyedLoadInstructionsAfterPatch() * | 1111 (CodeGenerator::GetInlinedKeyedLoadInstructionsAfterPatch() * |
1112 Assembler::kInstrSize); | 1112 Assembler::kInstrSize); |
1113 Assembler::set_target_address_at(ldr_map_instr_address, | 1113 Assembler::set_target_address_at(ldr_map_instr_address, |
1114 reinterpret_cast<Address>(map)); | 1114 reinterpret_cast<Address>(map)); |
1115 return true; | 1115 return true; |
1116 } | 1116 } |
1117 | 1117 |
1118 | 1118 |
1119 bool KeyedStoreIC::PatchInlinedStore(Address address, Object* map) { | 1119 bool KeyedStoreIC::PatchInlinedStore(Address address, Object* map) { |
1120 if (V8::UseCrankshaft()) return false; | 1120 if (V8::UseCrankshaft()) return false; |
1121 | 1121 |
1122 // Find the end of the inlined code for handling the store if this is an | 1122 // Find the end of the inlined code for handling the store if this is an |
1123 // inlined IC call site. | 1123 // inlined IC call site. |
1124 Address inline_end_address; | 1124 Address inline_end_address = 0; |
1125 if (InlinedICSiteMarker(address, &inline_end_address) | 1125 if (InlinedICSiteMarker(address, &inline_end_address) |
1126 != Assembler::PROPERTY_ACCESS_INLINED) { | 1126 != Assembler::PROPERTY_ACCESS_INLINED) { |
1127 return false; | 1127 return false; |
1128 } | 1128 } |
1129 | 1129 |
1130 // Patch the map check. | 1130 // Patch the map check. |
1131 Address ldr_map_instr_address = | 1131 Address ldr_map_instr_address = |
1132 inline_end_address - | 1132 inline_end_address - |
1133 (CodeGenerator::kInlinedKeyedStoreInstructionsAfterPatch * | 1133 (CodeGenerator::kInlinedKeyedStoreInstructionsAfterPatch * |
1134 Assembler::kInstrSize); | 1134 Assembler::kInstrSize); |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1784 Register reg = Assembler::GetRn(instr_at_patch); | 1784 Register reg = Assembler::GetRn(instr_at_patch); |
1785 patcher.masm()->tst(reg, Operand(kSmiTagMask)); | 1785 patcher.masm()->tst(reg, Operand(kSmiTagMask)); |
1786 patcher.EmitCondition(eq); | 1786 patcher.EmitCondition(eq); |
1787 } | 1787 } |
1788 } | 1788 } |
1789 | 1789 |
1790 | 1790 |
1791 } } // namespace v8::internal | 1791 } } // namespace v8::internal |
1792 | 1792 |
1793 #endif // V8_TARGET_ARCH_ARM | 1793 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |