Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(709)

Side by Side Diff: src/arm/assembler-arm.cc

Issue 2021343002: [arm] Fix test failures on old architectures. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/arm/deoptimizer-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions 5 // modification, are permitted provided that the following conditions
6 // are met: 6 // are met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 841
842 842
843 void Assembler::target_at_put(int pos, int target_pos) { 843 void Assembler::target_at_put(int pos, int target_pos) {
844 Instr instr = instr_at(pos); 844 Instr instr = instr_at(pos);
845 if (is_uint24(instr)) { 845 if (is_uint24(instr)) {
846 DCHECK(target_pos == pos || target_pos >= 0); 846 DCHECK(target_pos == pos || target_pos >= 0);
847 // Emitted link to a label, not part of a branch. 847 // Emitted link to a label, not part of a branch.
848 // Load the position of the label relative to the generated code object 848 // Load the position of the label relative to the generated code object
849 // pointer in a register. 849 // pointer in a register.
850 850
851 // The existing code must be a single 24-bit label chain link, followed by
852 // nops encoding the destination register. See mov_label_offset.
853
854 // Extract the destination register from the first nop instructions.
855 Register dst =
856 Register::from_code(Instruction::RmValue(instr_at(pos + kInstrSize)));
857 // In addition to the 24-bit label chain link, we expect to find one nop for
858 // ARMv7 and above, or two nops for ARMv6. See mov_label_offset.
859 DCHECK(IsNop(instr_at(pos + kInstrSize), dst.code()));
860 if (!CpuFeatures::IsSupported(ARMv7)) {
861 DCHECK(IsNop(instr_at(pos + 2 * kInstrSize), dst.code()));
862 }
863
851 // Here are the instructions we need to emit: 864 // Here are the instructions we need to emit:
852 // For ARMv7: target24 => target16_1:target16_0 865 // For ARMv7: target24 => target16_1:target16_0
853 // movw dst, #target16_0 866 // movw dst, #target16_0
854 // movt dst, #target16_1 867 // movt dst, #target16_1
855 // For ARMv6: target24 => target8_2:target8_1:target8_0 868 // For ARMv6: target24 => target8_2:target8_1:target8_0
856 // mov dst, #target8_0 869 // mov dst, #target8_0
857 // orr dst, dst, #target8_1 << 8 870 // orr dst, dst, #target8_1 << 8
858 // orr dst, dst, #target8_2 << 16 871 // orr dst, dst, #target8_2 << 16
859 872
860 // We extract the destination register from the emitted nop instruction.
861 Register dst = Register::from_code(
862 Instruction::RmValue(instr_at(pos + kInstrSize)));
863 DCHECK(IsNop(instr_at(pos + kInstrSize), dst.code()));
864 uint32_t target24 = target_pos + (Code::kHeaderSize - kHeapObjectTag); 873 uint32_t target24 = target_pos + (Code::kHeaderSize - kHeapObjectTag);
865 DCHECK(is_uint24(target24)); 874 DCHECK(is_uint24(target24));
866 if (is_uint8(target24)) { 875 if (is_uint8(target24)) {
867 // If the target fits in a byte then only patch with a mov 876 // If the target fits in a byte then only patch with a mov
868 // instruction. 877 // instruction.
869 CodePatcher patcher(isolate(), reinterpret_cast<byte*>(buffer_ + pos), 1, 878 CodePatcher patcher(isolate(), reinterpret_cast<byte*>(buffer_ + pos), 1,
870 CodePatcher::DONT_FLUSH); 879 CodePatcher::DONT_FLUSH);
871 patcher.masm()->mov(dst, Operand(target24)); 880 patcher.masm()->mov(dst, Operand(target24));
872 } else { 881 } else {
873 uint16_t target16_0 = target24 & kImm16Mask; 882 uint16_t target16_0 = target24 & kImm16Mask;
(...skipping 3417 matching lines...) Expand 10 before | Expand all | Expand 10 after
4291 DCHECK(is_uint12(offset)); 4300 DCHECK(is_uint12(offset));
4292 instr_at_put(pc, SetLdrRegisterImmediateOffset(instr, offset)); 4301 instr_at_put(pc, SetLdrRegisterImmediateOffset(instr, offset));
4293 } 4302 }
4294 } 4303 }
4295 4304
4296 4305
4297 } // namespace internal 4306 } // namespace internal
4298 } // namespace v8 4307 } // namespace v8
4299 4308
4300 #endif // V8_TARGET_ARCH_ARM 4309 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm/deoptimizer-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698