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

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

Issue 2072963003: Simplify AssemblerPositionsRecorder. (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
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 1543 matching lines...) Expand 10 before | Expand all | Expand 10 after
1554 1554
1555 1555
1556 void Assembler::bind(Label* L) { 1556 void Assembler::bind(Label* L) {
1557 EnsureSpace ensure_space(this); 1557 EnsureSpace ensure_space(this);
1558 DCHECK(!L->is_bound()); // label can only be bound once 1558 DCHECK(!L->is_bound()); // label can only be bound once
1559 bind_to(L, pc_offset()); 1559 bind_to(L, pc_offset());
1560 } 1560 }
1561 1561
1562 1562
1563 void Assembler::call(Label* L) { 1563 void Assembler::call(Label* L) {
1564 positions_recorder()->WriteRecordedPositions();
1565 EnsureSpace ensure_space(this); 1564 EnsureSpace ensure_space(this);
1566 if (L->is_bound()) { 1565 if (L->is_bound()) {
1567 const int long_size = 5; 1566 const int long_size = 5;
1568 int offs = L->pos() - pc_offset(); 1567 int offs = L->pos() - pc_offset();
1569 DCHECK(offs <= 0); 1568 DCHECK(offs <= 0);
1570 // 1110 1000 #32-bit disp. 1569 // 1110 1000 #32-bit disp.
1571 EMIT(0xE8); 1570 EMIT(0xE8);
1572 emit(offs - long_size); 1571 emit(offs - long_size);
1573 } else { 1572 } else {
1574 // 1110 1000 #32-bit disp. 1573 // 1110 1000 #32-bit disp.
1575 EMIT(0xE8); 1574 EMIT(0xE8);
1576 emit_disp(L, Displacement::OTHER); 1575 emit_disp(L, Displacement::OTHER);
1577 } 1576 }
1578 } 1577 }
1579 1578
1580 1579
1581 void Assembler::call(byte* entry, RelocInfo::Mode rmode) { 1580 void Assembler::call(byte* entry, RelocInfo::Mode rmode) {
1582 positions_recorder()->WriteRecordedPositions();
1583 EnsureSpace ensure_space(this); 1581 EnsureSpace ensure_space(this);
1584 DCHECK(!RelocInfo::IsCodeTarget(rmode)); 1582 DCHECK(!RelocInfo::IsCodeTarget(rmode));
1585 EMIT(0xE8); 1583 EMIT(0xE8);
1586 if (RelocInfo::IsRuntimeEntry(rmode)) { 1584 if (RelocInfo::IsRuntimeEntry(rmode)) {
1587 emit(reinterpret_cast<uint32_t>(entry), rmode); 1585 emit(reinterpret_cast<uint32_t>(entry), rmode);
1588 } else { 1586 } else {
1589 emit(entry - (pc_ + sizeof(int32_t)), rmode); 1587 emit(entry - (pc_ + sizeof(int32_t)), rmode);
1590 } 1588 }
1591 } 1589 }
1592 1590
1593 1591
1594 int Assembler::CallSize(const Operand& adr) { 1592 int Assembler::CallSize(const Operand& adr) {
1595 // Call size is 1 (opcode) + adr.len_ (operand). 1593 // Call size is 1 (opcode) + adr.len_ (operand).
1596 return 1 + adr.len_; 1594 return 1 + adr.len_;
1597 } 1595 }
1598 1596
1599 1597
1600 void Assembler::call(const Operand& adr) { 1598 void Assembler::call(const Operand& adr) {
1601 positions_recorder()->WriteRecordedPositions();
1602 EnsureSpace ensure_space(this); 1599 EnsureSpace ensure_space(this);
1603 EMIT(0xFF); 1600 EMIT(0xFF);
1604 emit_operand(edx, adr); 1601 emit_operand(edx, adr);
1605 } 1602 }
1606 1603
1607 1604
1608 int Assembler::CallSize(Handle<Code> code, RelocInfo::Mode rmode) { 1605 int Assembler::CallSize(Handle<Code> code, RelocInfo::Mode rmode) {
1609 return 1 /* EMIT */ + sizeof(uint32_t) /* emit */; 1606 return 1 /* EMIT */ + sizeof(uint32_t) /* emit */;
1610 } 1607 }
1611 1608
1612 1609
1613 void Assembler::call(Handle<Code> code, 1610 void Assembler::call(Handle<Code> code,
1614 RelocInfo::Mode rmode, 1611 RelocInfo::Mode rmode,
1615 TypeFeedbackId ast_id) { 1612 TypeFeedbackId ast_id) {
1616 positions_recorder()->WriteRecordedPositions();
1617 EnsureSpace ensure_space(this); 1613 EnsureSpace ensure_space(this);
1618 DCHECK(RelocInfo::IsCodeTarget(rmode) 1614 DCHECK(RelocInfo::IsCodeTarget(rmode)
1619 || rmode == RelocInfo::CODE_AGE_SEQUENCE); 1615 || rmode == RelocInfo::CODE_AGE_SEQUENCE);
1620 EMIT(0xE8); 1616 EMIT(0xE8);
1621 emit(code, rmode, ast_id); 1617 emit(code, rmode, ast_id);
1622 } 1618 }
1623 1619
1624 1620
1625 void Assembler::jmp(Label* L, Label::Distance distance) { 1621 void Assembler::jmp(Label* L, Label::Distance distance) {
1626 EnsureSpace ensure_space(this); 1622 EnsureSpace ensure_space(this);
(...skipping 1479 matching lines...) Expand 10 before | Expand all | Expand 10 after
3106 fflush(coverage_log); 3102 fflush(coverage_log);
3107 } 3103 }
3108 } 3104 }
3109 3105
3110 #endif 3106 #endif
3111 3107
3112 } // namespace internal 3108 } // namespace internal
3113 } // namespace v8 3109 } // namespace v8
3114 3110
3115 #endif // V8_TARGET_ARCH_IA32 3111 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698