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

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

Issue 1254573002: Version 4.4.63.24 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@4.4
Patch Set: Created 5 years, 5 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 | « src/arm/assembler-arm.h ('k') | src/arm/assembler-arm-inl.h » ('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 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after
1291 1291
1292 // Post-indexed addressing requires W == 1; different than in addrmod2/3. 1292 // Post-indexed addressing requires W == 1; different than in addrmod2/3.
1293 if ((am & P) == 0) 1293 if ((am & P) == 0)
1294 am |= W; 1294 am |= W;
1295 1295
1296 DCHECK(offset_8 >= 0); // no masking needed 1296 DCHECK(offset_8 >= 0); // no masking needed
1297 emit(instr | am | x.rn_.code()*B16 | crd.code()*B12 | offset_8); 1297 emit(instr | am | x.rn_.code()*B16 | crd.code()*B12 | offset_8);
1298 } 1298 }
1299 1299
1300 1300
1301 int Assembler::branch_offset(Label* L, bool jump_elimination_allowed) { 1301 int Assembler::branch_offset(Label* L) {
1302 int target_pos; 1302 int target_pos;
1303 if (L->is_bound()) { 1303 if (L->is_bound()) {
1304 target_pos = L->pos(); 1304 target_pos = L->pos();
1305 } else { 1305 } else {
1306 if (L->is_linked()) { 1306 if (L->is_linked()) {
1307 // Point to previous instruction that uses the link. 1307 // Point to previous instruction that uses the link.
1308 target_pos = L->pos(); 1308 target_pos = L->pos();
1309 } else { 1309 } else {
1310 // First entry of the link chain points to itself. 1310 // First entry of the link chain points to itself.
1311 target_pos = pc_offset(); 1311 target_pos = pc_offset();
1312 } 1312 }
1313 L->link_to(pc_offset()); 1313 L->link_to(pc_offset());
1314 } 1314 }
1315 1315
1316 // Block the emission of the constant pool, since the branch instruction must 1316 // Block the emission of the constant pool, since the branch instruction must
1317 // be emitted at the pc offset recorded by the label. 1317 // be emitted at the pc offset recorded by the label.
1318 BlockConstPoolFor(1); 1318 if (!is_const_pool_blocked()) BlockConstPoolFor(1);
1319
1319 return target_pos - (pc_offset() + kPcLoadDelta); 1320 return target_pos - (pc_offset() + kPcLoadDelta);
1320 } 1321 }
1321 1322
1322 1323
1323 // Branch instructions. 1324 // Branch instructions.
1324 void Assembler::b(int branch_offset, Condition cond) { 1325 void Assembler::b(int branch_offset, Condition cond) {
1325 DCHECK((branch_offset & 3) == 0); 1326 DCHECK((branch_offset & 3) == 0);
1326 int imm24 = branch_offset >> 2; 1327 int imm24 = branch_offset >> 2;
1327 CHECK(is_int24(imm24)); 1328 CHECK(is_int24(imm24));
1328 emit(cond | B27 | B25 | (imm24 & kImm24Mask)); 1329 emit(cond | B27 | B25 | (imm24 & kImm24Mask));
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1360 } 1361 }
1361 1362
1362 1363
1363 void Assembler::bx(Register target, Condition cond) { // v5 and above, plus v4t 1364 void Assembler::bx(Register target, Condition cond) { // v5 and above, plus v4t
1364 positions_recorder()->WriteRecordedPositions(); 1365 positions_recorder()->WriteRecordedPositions();
1365 DCHECK(!target.is(pc)); // use of pc is actually allowed, but discouraged 1366 DCHECK(!target.is(pc)); // use of pc is actually allowed, but discouraged
1366 emit(cond | B24 | B21 | 15*B16 | 15*B12 | 15*B8 | BX | target.code()); 1367 emit(cond | B24 | B21 | 15*B16 | 15*B12 | 15*B8 | BX | target.code());
1367 } 1368 }
1368 1369
1369 1370
1371 void Assembler::b(Label* L, Condition cond) {
1372 CheckBuffer();
1373 b(branch_offset(L), cond);
1374 }
1375
1376
1377 void Assembler::bl(Label* L, Condition cond) {
1378 CheckBuffer();
1379 bl(branch_offset(L), cond);
1380 }
1381
1382
1383 void Assembler::blx(Label* L) {
1384 CheckBuffer();
1385 blx(branch_offset(L));
1386 }
1387
1388
1370 // Data-processing instructions. 1389 // Data-processing instructions.
1371 1390
1372 void Assembler::and_(Register dst, Register src1, const Operand& src2, 1391 void Assembler::and_(Register dst, Register src1, const Operand& src2,
1373 SBit s, Condition cond) { 1392 SBit s, Condition cond) {
1374 addrmod1(cond | AND | s, src1, dst, src2); 1393 addrmod1(cond | AND | s, src1, dst, src2);
1375 } 1394 }
1376 1395
1377 1396
1378 void Assembler::eor(Register dst, Register src1, const Operand& src2, 1397 void Assembler::eor(Register dst, Register src1, const Operand& src2,
1379 SBit s, Condition cond) { 1398 SBit s, Condition cond) {
(...skipping 2732 matching lines...) Expand 10 before | Expand all | Expand 10 after
4112 assm->instr_at_put( 4131 assm->instr_at_put(
4113 rinfo.pc(), Assembler::SetLdrRegisterImmediateOffset(instr, offset)); 4132 rinfo.pc(), Assembler::SetLdrRegisterImmediateOffset(instr, offset));
4114 } 4133 }
4115 } 4134 }
4116 } 4135 }
4117 4136
4118 4137
4119 } } // namespace v8::internal 4138 } } // namespace v8::internal
4120 4139
4121 #endif // V8_TARGET_ARCH_ARM 4140 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/assembler-arm.h ('k') | src/arm/assembler-arm-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698