| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // | 2 // |
| 3 // Redistribution and use in source and binary forms, with or without | 3 // Redistribution and use in source and binary forms, with or without |
| 4 // modification, are permitted provided that the following conditions are | 4 // modification, are permitted provided that the following conditions are |
| 5 // met: | 5 // met: |
| 6 // | 6 // |
| 7 // * Redistributions of source code must retain the above copyright | 7 // * Redistributions of source code must retain the above copyright |
| 8 // notice, this list of conditions and the following disclaimer. | 8 // notice, this list of conditions and the following disclaimer. |
| 9 // * Redistributions in binary form must reproduce the above | 9 // * Redistributions in binary form must reproduce the above |
| 10 // copyright notice, this list of conditions and the following | 10 // copyright notice, this list of conditions and the following |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 | 153 |
| 154 | 154 |
| 155 bool RelocInfo::IsCodedSpecially() { | 155 bool RelocInfo::IsCodedSpecially() { |
| 156 // The deserializer needs to know whether a pointer is specially coded. Being | 156 // The deserializer needs to know whether a pointer is specially coded. Being |
| 157 // specially coded on A64 means that it is a movz/movk sequence. We don't | 157 // specially coded on A64 means that it is a movz/movk sequence. We don't |
| 158 // generate those for relocatable pointers. | 158 // generate those for relocatable pointers. |
| 159 return false; | 159 return false; |
| 160 } | 160 } |
| 161 | 161 |
| 162 | 162 |
| 163 bool RelocInfo::IsInConstantPool() { |
| 164 Instruction* instr = reinterpret_cast<Instruction*>(pc_); |
| 165 return instr->IsLdrLiteralX(); |
| 166 } |
| 167 |
| 168 |
| 163 void RelocInfo::PatchCode(byte* instructions, int instruction_count) { | 169 void RelocInfo::PatchCode(byte* instructions, int instruction_count) { |
| 164 // Patch the code at the current address with the supplied instructions. | 170 // Patch the code at the current address with the supplied instructions. |
| 165 Instr* pc = reinterpret_cast<Instr*>(pc_); | 171 Instr* pc = reinterpret_cast<Instr*>(pc_); |
| 166 Instr* instr = reinterpret_cast<Instr*>(instructions); | 172 Instr* instr = reinterpret_cast<Instr*>(instructions); |
| 167 for (int i = 0; i < instruction_count; i++) { | 173 for (int i = 0; i < instruction_count; i++) { |
| 168 *(pc + i) = *(instr + i); | 174 *(pc + i) = *(instr + i); |
| 169 } | 175 } |
| 170 | 176 |
| 171 // Indicate that code has changed. | 177 // Indicate that code has changed. |
| 172 CPU::FlushICache(pc_, instruction_count * kInstructionSize); | 178 CPU::FlushICache(pc_, instruction_count * kInstructionSize); |
| (...skipping 2424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2597 // code. | 2603 // code. |
| 2598 #ifdef ENABLE_DEBUGGER_SUPPORT | 2604 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 2599 RecordRelocInfo(RelocInfo::CONST_POOL, static_cast<intptr_t>(size)); | 2605 RecordRelocInfo(RelocInfo::CONST_POOL, static_cast<intptr_t>(size)); |
| 2600 #endif | 2606 #endif |
| 2601 } | 2607 } |
| 2602 | 2608 |
| 2603 | 2609 |
| 2604 } } // namespace v8::internal | 2610 } } // namespace v8::internal |
| 2605 | 2611 |
| 2606 #endif // V8_TARGET_ARCH_A64 | 2612 #endif // V8_TARGET_ARCH_A64 |
| OLD | NEW |