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

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

Issue 2072963003: Simplify AssemblerPositionsRecorder. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: addressed comment 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/macro-assembler-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 1360 matching lines...) Expand 10 before | Expand all | Expand 10 after
1371 emit(cond | B27 | B25 | (imm24 & kImm24Mask)); 1371 emit(cond | B27 | B25 | (imm24 & kImm24Mask));
1372 1372
1373 if (cond == al) { 1373 if (cond == al) {
1374 // Dead code is a good location to emit the constant pool. 1374 // Dead code is a good location to emit the constant pool.
1375 CheckConstPool(false, false); 1375 CheckConstPool(false, false);
1376 } 1376 }
1377 } 1377 }
1378 1378
1379 1379
1380 void Assembler::bl(int branch_offset, Condition cond) { 1380 void Assembler::bl(int branch_offset, Condition cond) {
1381 positions_recorder()->WriteRecordedPositions();
1382 DCHECK((branch_offset & 3) == 0); 1381 DCHECK((branch_offset & 3) == 0);
1383 int imm24 = branch_offset >> 2; 1382 int imm24 = branch_offset >> 2;
1384 CHECK(is_int24(imm24)); 1383 CHECK(is_int24(imm24));
1385 emit(cond | B27 | B25 | B24 | (imm24 & kImm24Mask)); 1384 emit(cond | B27 | B25 | B24 | (imm24 & kImm24Mask));
1386 } 1385 }
1387 1386
1388 1387
1389 void Assembler::blx(int branch_offset) { // v5 and above 1388 void Assembler::blx(int branch_offset) { // v5 and above
1390 positions_recorder()->WriteRecordedPositions();
1391 DCHECK((branch_offset & 1) == 0); 1389 DCHECK((branch_offset & 1) == 0);
1392 int h = ((branch_offset & 2) >> 1)*B24; 1390 int h = ((branch_offset & 2) >> 1)*B24;
1393 int imm24 = branch_offset >> 2; 1391 int imm24 = branch_offset >> 2;
1394 CHECK(is_int24(imm24)); 1392 CHECK(is_int24(imm24));
1395 emit(kSpecialCondition | B27 | B25 | h | (imm24 & kImm24Mask)); 1393 emit(kSpecialCondition | B27 | B25 | h | (imm24 & kImm24Mask));
1396 } 1394 }
1397 1395
1398 1396
1399 void Assembler::blx(Register target, Condition cond) { // v5 and above 1397 void Assembler::blx(Register target, Condition cond) { // v5 and above
1400 positions_recorder()->WriteRecordedPositions();
1401 DCHECK(!target.is(pc)); 1398 DCHECK(!target.is(pc));
1402 emit(cond | B24 | B21 | 15*B16 | 15*B12 | 15*B8 | BLX | target.code()); 1399 emit(cond | B24 | B21 | 15*B16 | 15*B12 | 15*B8 | BLX | target.code());
1403 } 1400 }
1404 1401
1405 1402
1406 void Assembler::bx(Register target, Condition cond) { // v5 and above, plus v4t 1403 void Assembler::bx(Register target, Condition cond) { // v5 and above, plus v4t
1407 positions_recorder()->WriteRecordedPositions();
1408 DCHECK(!target.is(pc)); // use of pc is actually allowed, but discouraged 1404 DCHECK(!target.is(pc)); // use of pc is actually allowed, but discouraged
1409 emit(cond | B24 | B21 | 15*B16 | 15*B12 | 15*B8 | BX | target.code()); 1405 emit(cond | B24 | B21 | 15*B16 | 15*B12 | 15*B8 | BX | target.code());
1410 } 1406 }
1411 1407
1412 1408
1413 void Assembler::b(Label* L, Condition cond) { 1409 void Assembler::b(Label* L, Condition cond) {
1414 CheckBuffer(); 1410 CheckBuffer();
1415 b(branch_offset(L), cond); 1411 b(branch_offset(L), cond);
1416 } 1412 }
1417 1413
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
1505 } 1501 }
1506 1502
1507 1503
1508 void Assembler::orr(Register dst, Register src1, const Operand& src2, 1504 void Assembler::orr(Register dst, Register src1, const Operand& src2,
1509 SBit s, Condition cond) { 1505 SBit s, Condition cond) {
1510 addrmod1(cond | ORR | s, src1, dst, src2); 1506 addrmod1(cond | ORR | s, src1, dst, src2);
1511 } 1507 }
1512 1508
1513 1509
1514 void Assembler::mov(Register dst, const Operand& src, SBit s, Condition cond) { 1510 void Assembler::mov(Register dst, const Operand& src, SBit s, Condition cond) {
1515 if (dst.is(pc)) {
1516 positions_recorder()->WriteRecordedPositions();
1517 }
1518 // Don't allow nop instructions in the form mov rn, rn to be generated using 1511 // Don't allow nop instructions in the form mov rn, rn to be generated using
1519 // the mov instruction. They must be generated using nop(int/NopMarkerTypes) 1512 // the mov instruction. They must be generated using nop(int/NopMarkerTypes)
1520 // or MarkCode(int/NopMarkerTypes) pseudo instructions. 1513 // or MarkCode(int/NopMarkerTypes) pseudo instructions.
1521 DCHECK(!(src.is_reg() && src.rm().is(dst) && s == LeaveCC && cond == al)); 1514 DCHECK(!(src.is_reg() && src.rm().is(dst) && s == LeaveCC && cond == al));
1522 addrmod1(cond | MOV | s, r0, dst, src); 1515 addrmod1(cond | MOV | s, r0, dst, src);
1523 } 1516 }
1524 1517
1525 1518
1526 void Assembler::mov_label_offset(Register dst, Label* label) { 1519 void Assembler::mov_label_offset(Register dst, Label* label) {
1527 if (label->is_bound()) { 1520 if (label->is_bound()) {
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
1996 } else { 1989 } else {
1997 DCHECK(!src.rs_.is_valid() && src.shift_imm_ == 0); // only rm allowed 1990 DCHECK(!src.rs_.is_valid() && src.shift_imm_ == 0); // only rm allowed
1998 instr = src.rm_.code(); 1991 instr = src.rm_.code();
1999 } 1992 }
2000 emit(cond | instr | B24 | B21 | fields | 15*B12); 1993 emit(cond | instr | B24 | B21 | fields | 15*B12);
2001 } 1994 }
2002 1995
2003 1996
2004 // Load/Store instructions. 1997 // Load/Store instructions.
2005 void Assembler::ldr(Register dst, const MemOperand& src, Condition cond) { 1998 void Assembler::ldr(Register dst, const MemOperand& src, Condition cond) {
2006 if (dst.is(pc)) {
2007 positions_recorder()->WriteRecordedPositions();
2008 }
2009 addrmod2(cond | B26 | L, dst, src); 1999 addrmod2(cond | B26 | L, dst, src);
2010 } 2000 }
2011 2001
2012 2002
2013 void Assembler::str(Register src, const MemOperand& dst, Condition cond) { 2003 void Assembler::str(Register src, const MemOperand& dst, Condition cond) {
2014 addrmod2(cond | B26, src, dst); 2004 addrmod2(cond | B26, src, dst);
2015 } 2005 }
2016 2006
2017 2007
2018 void Assembler::ldrb(Register dst, const MemOperand& src, Condition cond) { 2008 void Assembler::ldrb(Register dst, const MemOperand& src, Condition cond) {
(...skipping 2245 matching lines...) Expand 10 before | Expand all | Expand 10 after
4264 DCHECK(is_uint12(offset)); 4254 DCHECK(is_uint12(offset));
4265 instr_at_put(pc, SetLdrRegisterImmediateOffset(instr, offset)); 4255 instr_at_put(pc, SetLdrRegisterImmediateOffset(instr, offset));
4266 } 4256 }
4267 } 4257 }
4268 4258
4269 4259
4270 } // namespace internal 4260 } // namespace internal
4271 } // namespace v8 4261 } // namespace v8
4272 4262
4273 #endif // V8_TARGET_ARCH_ARM 4263 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm/macro-assembler-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698