OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 ASSERT(instr->IsLdrLiteralX()); | 582 ASSERT(instr->IsLdrLiteralX()); |
583 return candidate; | 583 return candidate; |
584 } | 584 } |
585 | 585 |
586 | 586 |
587 Address Assembler::return_address_from_call_start(Address pc) { | 587 Address Assembler::return_address_from_call_start(Address pc) { |
588 // The call, generated by MacroAssembler::Call, is one of two possible | 588 // The call, generated by MacroAssembler::Call, is one of two possible |
589 // sequences: | 589 // sequences: |
590 // | 590 // |
591 // Without relocation: | 591 // Without relocation: |
592 // movz ip0, #(target & 0x000000000000ffff) | 592 // movz temp, #(target & 0x000000000000ffff) |
593 // movk ip0, #(target & 0x00000000ffff0000) | 593 // movk temp, #(target & 0x00000000ffff0000) |
594 // movk ip0, #(target & 0x0000ffff00000000) | 594 // movk temp, #(target & 0x0000ffff00000000) |
595 // movk ip0, #(target & 0xffff000000000000) | 595 // blr temp |
596 // blr ip0 | |
597 // | 596 // |
598 // With relocation: | 597 // With relocation: |
599 // ldr ip0, =target | 598 // ldr temp, =target |
600 // blr ip0 | 599 // blr temp |
601 // | 600 // |
602 // The return address is immediately after the blr instruction in both cases, | 601 // The return address is immediately after the blr instruction in both cases, |
603 // so it can be found by adding the call size to the address at the start of | 602 // so it can be found by adding the call size to the address at the start of |
604 // the call sequence. | 603 // the call sequence. |
605 STATIC_ASSERT(Assembler::kCallSizeWithoutRelocation == 5 * kInstructionSize); | 604 STATIC_ASSERT(Assembler::kCallSizeWithoutRelocation == 4 * kInstructionSize); |
606 STATIC_ASSERT(Assembler::kCallSizeWithRelocation == 2 * kInstructionSize); | 605 STATIC_ASSERT(Assembler::kCallSizeWithRelocation == 2 * kInstructionSize); |
607 | 606 |
608 Instruction* instr = reinterpret_cast<Instruction*>(pc); | 607 Instruction* instr = reinterpret_cast<Instruction*>(pc); |
609 if (instr->IsMovz()) { | 608 if (instr->IsMovz()) { |
610 // Verify the instruction sequence. | 609 // Verify the instruction sequence. |
611 ASSERT(instr->following(1)->IsMovk()); | 610 ASSERT(instr->following(1)->IsMovk()); |
612 ASSERT(instr->following(2)->IsMovk()); | 611 ASSERT(instr->following(2)->IsMovk()); |
613 ASSERT(instr->following(3)->IsMovk()); | 612 ASSERT(instr->following(3)->IsBranchAndLinkToRegister()); |
614 ASSERT(instr->following(4)->IsBranchAndLinkToRegister()); | |
615 return pc + Assembler::kCallSizeWithoutRelocation; | 613 return pc + Assembler::kCallSizeWithoutRelocation; |
616 } else { | 614 } else { |
617 // Verify the instruction sequence. | 615 // Verify the instruction sequence. |
618 ASSERT(instr->IsLdrLiteralX()); | 616 ASSERT(instr->IsLdrLiteralX()); |
619 ASSERT(instr->following(1)->IsBranchAndLinkToRegister()); | 617 ASSERT(instr->following(1)->IsBranchAndLinkToRegister()); |
620 return pc + Assembler::kCallSizeWithRelocation; | 618 return pc + Assembler::kCallSizeWithRelocation; |
621 } | 619 } |
622 } | 620 } |
623 | 621 |
624 | 622 |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1222 | 1220 |
1223 | 1221 |
1224 void Assembler::ClearRecordedAstId() { | 1222 void Assembler::ClearRecordedAstId() { |
1225 recorded_ast_id_ = TypeFeedbackId::None(); | 1223 recorded_ast_id_ = TypeFeedbackId::None(); |
1226 } | 1224 } |
1227 | 1225 |
1228 | 1226 |
1229 } } // namespace v8::internal | 1227 } } // namespace v8::internal |
1230 | 1228 |
1231 #endif // V8_ARM64_ASSEMBLER_ARM64_INL_H_ | 1229 #endif // V8_ARM64_ASSEMBLER_ARM64_INL_H_ |
OLD | NEW |