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

Unified 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, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/arm/deoptimizer-arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/assembler-arm.cc
diff --git a/src/arm/assembler-arm.cc b/src/arm/assembler-arm.cc
index da8e4327ce6588560ca2325ce68fd0df66e0079a..4ad0d706ebff29a3706a34e605ad732e9b128ed9 100644
--- a/src/arm/assembler-arm.cc
+++ b/src/arm/assembler-arm.cc
@@ -848,6 +848,19 @@ void Assembler::target_at_put(int pos, int target_pos) {
// Load the position of the label relative to the generated code object
// pointer in a register.
+ // The existing code must be a single 24-bit label chain link, followed by
+ // nops encoding the destination register. See mov_label_offset.
+
+ // Extract the destination register from the first nop instructions.
+ Register dst =
+ Register::from_code(Instruction::RmValue(instr_at(pos + kInstrSize)));
+ // In addition to the 24-bit label chain link, we expect to find one nop for
+ // ARMv7 and above, or two nops for ARMv6. See mov_label_offset.
+ DCHECK(IsNop(instr_at(pos + kInstrSize), dst.code()));
+ if (!CpuFeatures::IsSupported(ARMv7)) {
+ DCHECK(IsNop(instr_at(pos + 2 * kInstrSize), dst.code()));
+ }
+
// Here are the instructions we need to emit:
// For ARMv7: target24 => target16_1:target16_0
// movw dst, #target16_0
@@ -857,10 +870,6 @@ void Assembler::target_at_put(int pos, int target_pos) {
// orr dst, dst, #target8_1 << 8
// orr dst, dst, #target8_2 << 16
- // We extract the destination register from the emitted nop instruction.
- Register dst = Register::from_code(
- Instruction::RmValue(instr_at(pos + kInstrSize)));
- DCHECK(IsNop(instr_at(pos + kInstrSize), dst.code()));
uint32_t target24 = target_pos + (Code::kHeaderSize - kHeapObjectTag);
DCHECK(is_uint24(target24));
if (is_uint8(target24)) {
« 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