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

Side by Side Diff: src/x87/assembler-x87.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 | « src/x64/assembler-x64.cc ('k') | no next file » | 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 1396 matching lines...) Expand 10 before | Expand all | Expand 10 after
1407 1407
1408 1408
1409 void Assembler::bind(Label* L) { 1409 void Assembler::bind(Label* L) {
1410 EnsureSpace ensure_space(this); 1410 EnsureSpace ensure_space(this);
1411 DCHECK(!L->is_bound()); // label can only be bound once 1411 DCHECK(!L->is_bound()); // label can only be bound once
1412 bind_to(L, pc_offset()); 1412 bind_to(L, pc_offset());
1413 } 1413 }
1414 1414
1415 1415
1416 void Assembler::call(Label* L) { 1416 void Assembler::call(Label* L) {
1417 positions_recorder()->WriteRecordedPositions();
1418 EnsureSpace ensure_space(this); 1417 EnsureSpace ensure_space(this);
1419 if (L->is_bound()) { 1418 if (L->is_bound()) {
1420 const int long_size = 5; 1419 const int long_size = 5;
1421 int offs = L->pos() - pc_offset(); 1420 int offs = L->pos() - pc_offset();
1422 DCHECK(offs <= 0); 1421 DCHECK(offs <= 0);
1423 // 1110 1000 #32-bit disp. 1422 // 1110 1000 #32-bit disp.
1424 EMIT(0xE8); 1423 EMIT(0xE8);
1425 emit(offs - long_size); 1424 emit(offs - long_size);
1426 } else { 1425 } else {
1427 // 1110 1000 #32-bit disp. 1426 // 1110 1000 #32-bit disp.
1428 EMIT(0xE8); 1427 EMIT(0xE8);
1429 emit_disp(L, Displacement::OTHER); 1428 emit_disp(L, Displacement::OTHER);
1430 } 1429 }
1431 } 1430 }
1432 1431
1433 1432
1434 void Assembler::call(byte* entry, RelocInfo::Mode rmode) { 1433 void Assembler::call(byte* entry, RelocInfo::Mode rmode) {
1435 positions_recorder()->WriteRecordedPositions();
1436 EnsureSpace ensure_space(this); 1434 EnsureSpace ensure_space(this);
1437 DCHECK(!RelocInfo::IsCodeTarget(rmode)); 1435 DCHECK(!RelocInfo::IsCodeTarget(rmode));
1438 EMIT(0xE8); 1436 EMIT(0xE8);
1439 if (RelocInfo::IsRuntimeEntry(rmode)) { 1437 if (RelocInfo::IsRuntimeEntry(rmode)) {
1440 emit(reinterpret_cast<uint32_t>(entry), rmode); 1438 emit(reinterpret_cast<uint32_t>(entry), rmode);
1441 } else { 1439 } else {
1442 emit(entry - (pc_ + sizeof(int32_t)), rmode); 1440 emit(entry - (pc_ + sizeof(int32_t)), rmode);
1443 } 1441 }
1444 } 1442 }
1445 1443
1446 1444
1447 int Assembler::CallSize(const Operand& adr) { 1445 int Assembler::CallSize(const Operand& adr) {
1448 // Call size is 1 (opcode) + adr.len_ (operand). 1446 // Call size is 1 (opcode) + adr.len_ (operand).
1449 return 1 + adr.len_; 1447 return 1 + adr.len_;
1450 } 1448 }
1451 1449
1452 1450
1453 void Assembler::call(const Operand& adr) { 1451 void Assembler::call(const Operand& adr) {
1454 positions_recorder()->WriteRecordedPositions();
1455 EnsureSpace ensure_space(this); 1452 EnsureSpace ensure_space(this);
1456 EMIT(0xFF); 1453 EMIT(0xFF);
1457 emit_operand(edx, adr); 1454 emit_operand(edx, adr);
1458 } 1455 }
1459 1456
1460 1457
1461 int Assembler::CallSize(Handle<Code> code, RelocInfo::Mode rmode) { 1458 int Assembler::CallSize(Handle<Code> code, RelocInfo::Mode rmode) {
1462 return 1 /* EMIT */ + sizeof(uint32_t) /* emit */; 1459 return 1 /* EMIT */ + sizeof(uint32_t) /* emit */;
1463 } 1460 }
1464 1461
1465 1462
1466 void Assembler::call(Handle<Code> code, 1463 void Assembler::call(Handle<Code> code,
1467 RelocInfo::Mode rmode, 1464 RelocInfo::Mode rmode,
1468 TypeFeedbackId ast_id) { 1465 TypeFeedbackId ast_id) {
1469 positions_recorder()->WriteRecordedPositions();
1470 EnsureSpace ensure_space(this); 1466 EnsureSpace ensure_space(this);
1471 DCHECK(RelocInfo::IsCodeTarget(rmode) 1467 DCHECK(RelocInfo::IsCodeTarget(rmode)
1472 || rmode == RelocInfo::CODE_AGE_SEQUENCE); 1468 || rmode == RelocInfo::CODE_AGE_SEQUENCE);
1473 EMIT(0xE8); 1469 EMIT(0xE8);
1474 emit(code, rmode, ast_id); 1470 emit(code, rmode, ast_id);
1475 } 1471 }
1476 1472
1477 1473
1478 void Assembler::jmp(Label* L, Label::Distance distance) { 1474 void Assembler::jmp(Label* L, Label::Distance distance) {
1479 EnsureSpace ensure_space(this); 1475 EnsureSpace ensure_space(this);
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after
2247 fflush(coverage_log); 2243 fflush(coverage_log);
2248 } 2244 }
2249 } 2245 }
2250 2246
2251 #endif 2247 #endif
2252 2248
2253 } // namespace internal 2249 } // namespace internal
2254 } // namespace v8 2250 } // namespace v8
2255 2251
2256 #endif // V8_TARGET_ARCH_X87 2252 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/x64/assembler-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698