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

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: 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/full-codegen/full-codegen.cc ('k') | src/mips/assembler-mips.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 1513 matching lines...) Expand 10 before | Expand all | Expand 10 after
1524 1524
1525 1525
1526 void Assembler::bind(Label* L) { 1526 void Assembler::bind(Label* L) {
1527 EnsureSpace ensure_space(this); 1527 EnsureSpace ensure_space(this);
1528 DCHECK(!L->is_bound()); // label can only be bound once 1528 DCHECK(!L->is_bound()); // label can only be bound once
1529 bind_to(L, pc_offset()); 1529 bind_to(L, pc_offset());
1530 } 1530 }
1531 1531
1532 1532
1533 void Assembler::call(Label* L) { 1533 void Assembler::call(Label* L) {
1534 positions_recorder()->WriteRecordedPositions();
1535 EnsureSpace ensure_space(this); 1534 EnsureSpace ensure_space(this);
1536 if (L->is_bound()) { 1535 if (L->is_bound()) {
1537 const int long_size = 5; 1536 const int long_size = 5;
1538 int offs = L->pos() - pc_offset(); 1537 int offs = L->pos() - pc_offset();
1539 DCHECK(offs <= 0); 1538 DCHECK(offs <= 0);
1540 // 1110 1000 #32-bit disp. 1539 // 1110 1000 #32-bit disp.
1541 EMIT(0xE8); 1540 EMIT(0xE8);
1542 emit(offs - long_size); 1541 emit(offs - long_size);
1543 } else { 1542 } else {
1544 // 1110 1000 #32-bit disp. 1543 // 1110 1000 #32-bit disp.
1545 EMIT(0xE8); 1544 EMIT(0xE8);
1546 emit_disp(L, Displacement::OTHER); 1545 emit_disp(L, Displacement::OTHER);
1547 } 1546 }
1548 } 1547 }
1549 1548
1550 1549
1551 void Assembler::call(byte* entry, RelocInfo::Mode rmode) { 1550 void Assembler::call(byte* entry, RelocInfo::Mode rmode) {
1552 positions_recorder()->WriteRecordedPositions();
1553 EnsureSpace ensure_space(this); 1551 EnsureSpace ensure_space(this);
1554 DCHECK(!RelocInfo::IsCodeTarget(rmode)); 1552 DCHECK(!RelocInfo::IsCodeTarget(rmode));
1555 EMIT(0xE8); 1553 EMIT(0xE8);
1556 if (RelocInfo::IsRuntimeEntry(rmode)) { 1554 if (RelocInfo::IsRuntimeEntry(rmode)) {
1557 emit(reinterpret_cast<uint32_t>(entry), rmode); 1555 emit(reinterpret_cast<uint32_t>(entry), rmode);
1558 } else { 1556 } else {
1559 emit(entry - (pc_ + sizeof(int32_t)), rmode); 1557 emit(entry - (pc_ + sizeof(int32_t)), rmode);
1560 } 1558 }
1561 } 1559 }
1562 1560
1563 1561
1564 int Assembler::CallSize(const Operand& adr) { 1562 int Assembler::CallSize(const Operand& adr) {
1565 // Call size is 1 (opcode) + adr.len_ (operand). 1563 // Call size is 1 (opcode) + adr.len_ (operand).
1566 return 1 + adr.len_; 1564 return 1 + adr.len_;
1567 } 1565 }
1568 1566
1569 1567
1570 void Assembler::call(const Operand& adr) { 1568 void Assembler::call(const Operand& adr) {
1571 positions_recorder()->WriteRecordedPositions();
1572 EnsureSpace ensure_space(this); 1569 EnsureSpace ensure_space(this);
1573 EMIT(0xFF); 1570 EMIT(0xFF);
1574 emit_operand(edx, adr); 1571 emit_operand(edx, adr);
1575 } 1572 }
1576 1573
1577 1574
1578 int Assembler::CallSize(Handle<Code> code, RelocInfo::Mode rmode) { 1575 int Assembler::CallSize(Handle<Code> code, RelocInfo::Mode rmode) {
1579 return 1 /* EMIT */ + sizeof(uint32_t) /* emit */; 1576 return 1 /* EMIT */ + sizeof(uint32_t) /* emit */;
1580 } 1577 }
1581 1578
1582 1579
1583 void Assembler::call(Handle<Code> code, 1580 void Assembler::call(Handle<Code> code,
1584 RelocInfo::Mode rmode, 1581 RelocInfo::Mode rmode,
1585 TypeFeedbackId ast_id) { 1582 TypeFeedbackId ast_id) {
1586 positions_recorder()->WriteRecordedPositions();
1587 EnsureSpace ensure_space(this); 1583 EnsureSpace ensure_space(this);
1588 DCHECK(RelocInfo::IsCodeTarget(rmode) 1584 DCHECK(RelocInfo::IsCodeTarget(rmode)
1589 || rmode == RelocInfo::CODE_AGE_SEQUENCE); 1585 || rmode == RelocInfo::CODE_AGE_SEQUENCE);
1590 EMIT(0xE8); 1586 EMIT(0xE8);
1591 emit(code, rmode, ast_id); 1587 emit(code, rmode, ast_id);
1592 } 1588 }
1593 1589
1594 1590
1595 void Assembler::jmp(Label* L, Label::Distance distance) { 1591 void Assembler::jmp(Label* L, Label::Distance distance) {
1596 EnsureSpace ensure_space(this); 1592 EnsureSpace ensure_space(this);
(...skipping 1479 matching lines...) Expand 10 before | Expand all | Expand 10 after
3076 fflush(coverage_log); 3072 fflush(coverage_log);
3077 } 3073 }
3078 } 3074 }
3079 3075
3080 #endif 3076 #endif
3081 3077
3082 } // namespace internal 3078 } // namespace internal
3083 } // namespace v8 3079 } // namespace v8
3084 3080
3085 #endif // V8_TARGET_ARCH_IA32 3081 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/full-codegen/full-codegen.cc ('k') | src/mips/assembler-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698