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

Side by Side Diff: src/x64/assembler-x64.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/s390/macro-assembler-s390.cc ('k') | src/x87/assembler-x87.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/x64/assembler-x64.h" 5 #include "src/x64/assembler-x64.h"
6 6
7 #include <cstring> 7 #include <cstring>
8 8
9 #if V8_TARGET_ARCH_X64 9 #if V8_TARGET_ARCH_X64
10 10
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 void Assembler::bsfq(Register dst, const Operand& src) { 826 void Assembler::bsfq(Register dst, const Operand& src) {
827 EnsureSpace ensure_space(this); 827 EnsureSpace ensure_space(this);
828 emit_rex_64(dst, src); 828 emit_rex_64(dst, src);
829 emit(0x0F); 829 emit(0x0F);
830 emit(0xBC); 830 emit(0xBC);
831 emit_operand(dst, src); 831 emit_operand(dst, src);
832 } 832 }
833 833
834 834
835 void Assembler::call(Label* L) { 835 void Assembler::call(Label* L) {
836 positions_recorder()->WriteRecordedPositions();
837 EnsureSpace ensure_space(this); 836 EnsureSpace ensure_space(this);
838 // 1110 1000 #32-bit disp. 837 // 1110 1000 #32-bit disp.
839 emit(0xE8); 838 emit(0xE8);
840 if (L->is_bound()) { 839 if (L->is_bound()) {
841 int offset = L->pos() - pc_offset() - sizeof(int32_t); 840 int offset = L->pos() - pc_offset() - sizeof(int32_t);
842 DCHECK(offset <= 0); 841 DCHECK(offset <= 0);
843 emitl(offset); 842 emitl(offset);
844 } else if (L->is_linked()) { 843 } else if (L->is_linked()) {
845 emitl(L->pos()); 844 emitl(L->pos());
846 L->link_to(pc_offset() - sizeof(int32_t)); 845 L->link_to(pc_offset() - sizeof(int32_t));
847 } else { 846 } else {
848 DCHECK(L->is_unused()); 847 DCHECK(L->is_unused());
849 int32_t current = pc_offset(); 848 int32_t current = pc_offset();
850 emitl(current); 849 emitl(current);
851 L->link_to(current); 850 L->link_to(current);
852 } 851 }
853 } 852 }
854 853
855 854
856 void Assembler::call(Address entry, RelocInfo::Mode rmode) { 855 void Assembler::call(Address entry, RelocInfo::Mode rmode) {
857 DCHECK(RelocInfo::IsRuntimeEntry(rmode)); 856 DCHECK(RelocInfo::IsRuntimeEntry(rmode));
858 positions_recorder()->WriteRecordedPositions();
859 EnsureSpace ensure_space(this); 857 EnsureSpace ensure_space(this);
860 // 1110 1000 #32-bit disp. 858 // 1110 1000 #32-bit disp.
861 emit(0xE8); 859 emit(0xE8);
862 emit_runtime_entry(entry, rmode); 860 emit_runtime_entry(entry, rmode);
863 } 861 }
864 862
865 863
866 void Assembler::call(Handle<Code> target, 864 void Assembler::call(Handle<Code> target,
867 RelocInfo::Mode rmode, 865 RelocInfo::Mode rmode,
868 TypeFeedbackId ast_id) { 866 TypeFeedbackId ast_id) {
869 positions_recorder()->WriteRecordedPositions();
870 EnsureSpace ensure_space(this); 867 EnsureSpace ensure_space(this);
871 // 1110 1000 #32-bit disp. 868 // 1110 1000 #32-bit disp.
872 emit(0xE8); 869 emit(0xE8);
873 emit_code_target(target, rmode, ast_id); 870 emit_code_target(target, rmode, ast_id);
874 } 871 }
875 872
876 873
877 void Assembler::call(Register adr) { 874 void Assembler::call(Register adr) {
878 positions_recorder()->WriteRecordedPositions();
879 EnsureSpace ensure_space(this); 875 EnsureSpace ensure_space(this);
880 // Opcode: FF /2 r64. 876 // Opcode: FF /2 r64.
881 emit_optional_rex_32(adr); 877 emit_optional_rex_32(adr);
882 emit(0xFF); 878 emit(0xFF);
883 emit_modrm(0x2, adr); 879 emit_modrm(0x2, adr);
884 } 880 }
885 881
886 882
887 void Assembler::call(const Operand& op) { 883 void Assembler::call(const Operand& op) {
888 positions_recorder()->WriteRecordedPositions();
889 EnsureSpace ensure_space(this); 884 EnsureSpace ensure_space(this);
890 // Opcode: FF /2 m64. 885 // Opcode: FF /2 m64.
891 emit_optional_rex_32(op); 886 emit_optional_rex_32(op);
892 emit(0xFF); 887 emit(0xFF);
893 emit_operand(0x2, op); 888 emit_operand(0x2, op);
894 } 889 }
895 890
896 891
897 // Calls directly to the given address using a relative offset. 892 // Calls directly to the given address using a relative offset.
898 // Should only ever be used in Code objects for calls within the 893 // Should only ever be used in Code objects for calls within the
899 // same Code object. Should not be used when generating new code (use labels), 894 // same Code object. Should not be used when generating new code (use labels),
900 // but only when patching existing code. 895 // but only when patching existing code.
901 void Assembler::call(Address target) { 896 void Assembler::call(Address target) {
902 positions_recorder()->WriteRecordedPositions();
903 EnsureSpace ensure_space(this); 897 EnsureSpace ensure_space(this);
904 // 1110 1000 #32-bit disp. 898 // 1110 1000 #32-bit disp.
905 emit(0xE8); 899 emit(0xE8);
906 Address source = pc_ + 4; 900 Address source = pc_ + 4;
907 intptr_t displacement = target - source; 901 intptr_t displacement = target - source;
908 DCHECK(is_int32(displacement)); 902 DCHECK(is_int32(displacement));
909 emitl(static_cast<int32_t>(displacement)); 903 emitl(static_cast<int32_t>(displacement));
910 } 904 }
911 905
912 906
(...skipping 3660 matching lines...) Expand 10 before | Expand all | Expand 10 after
4573 4567
4574 bool RelocInfo::IsInConstantPool() { 4568 bool RelocInfo::IsInConstantPool() {
4575 return false; 4569 return false;
4576 } 4570 }
4577 4571
4578 4572
4579 } // namespace internal 4573 } // namespace internal
4580 } // namespace v8 4574 } // namespace v8
4581 4575
4582 #endif // V8_TARGET_ARCH_X64 4576 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/s390/macro-assembler-s390.cc ('k') | src/x87/assembler-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698