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

Side by Side Diff: src/a64/assembler-a64-inl.h

Issue 157683003: A64: Check that branch targets are reachable. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 return 0; 877 return 0;
878 } 878 }
879 879
880 880
881 Instr Assembler::Cond(Condition cond) { 881 Instr Assembler::Cond(Condition cond) {
882 return cond << Condition_offset; 882 return cond << Condition_offset;
883 } 883 }
884 884
885 885
886 Instr Assembler::ImmPCRelAddress(int imm21) { 886 Instr Assembler::ImmPCRelAddress(int imm21) {
887 ASSERT(is_int21(imm21)); 887 CHECK(is_int21(imm21));
888 Instr imm = static_cast<Instr>(truncate_to_int21(imm21)); 888 Instr imm = static_cast<Instr>(truncate_to_int21(imm21));
889 Instr immhi = (imm >> ImmPCRelLo_width) << ImmPCRelHi_offset; 889 Instr immhi = (imm >> ImmPCRelLo_width) << ImmPCRelHi_offset;
890 Instr immlo = imm << ImmPCRelLo_offset; 890 Instr immlo = imm << ImmPCRelLo_offset;
891 return (immhi & ImmPCRelHi_mask) | (immlo & ImmPCRelLo_mask); 891 return (immhi & ImmPCRelHi_mask) | (immlo & ImmPCRelLo_mask);
892 } 892 }
893 893
894 894
895 Instr Assembler::ImmUncondBranch(int imm26) { 895 Instr Assembler::ImmUncondBranch(int imm26) {
896 ASSERT(is_int26(imm26)); 896 CHECK(is_int26(imm26));
897 return truncate_to_int26(imm26) << ImmUncondBranch_offset; 897 return truncate_to_int26(imm26) << ImmUncondBranch_offset;
898 } 898 }
899 899
900 900
901 Instr Assembler::ImmCondBranch(int imm19) { 901 Instr Assembler::ImmCondBranch(int imm19) {
902 ASSERT(is_int19(imm19)); 902 CHECK(is_int19(imm19));
903 return truncate_to_int19(imm19) << ImmCondBranch_offset; 903 return truncate_to_int19(imm19) << ImmCondBranch_offset;
904 } 904 }
905 905
906 906
907 Instr Assembler::ImmCmpBranch(int imm19) { 907 Instr Assembler::ImmCmpBranch(int imm19) {
908 ASSERT(is_int19(imm19)); 908 CHECK(is_int19(imm19));
909 return truncate_to_int19(imm19) << ImmCmpBranch_offset; 909 return truncate_to_int19(imm19) << ImmCmpBranch_offset;
910 } 910 }
911 911
912 912
913 Instr Assembler::ImmTestBranch(int imm14) { 913 Instr Assembler::ImmTestBranch(int imm14) {
914 ASSERT(is_int14(imm14)); 914 CHECK(is_int14(imm14));
915 return truncate_to_int14(imm14) << ImmTestBranch_offset; 915 return truncate_to_int14(imm14) << ImmTestBranch_offset;
916 } 916 }
917 917
918 918
919 Instr Assembler::ImmTestBranchBit(unsigned bit_pos) { 919 Instr Assembler::ImmTestBranchBit(unsigned bit_pos) {
920 ASSERT(is_uint6(bit_pos)); 920 ASSERT(is_uint6(bit_pos));
921 // Subtract five from the shift offset, as we need bit 5 from bit_pos. 921 // Subtract five from the shift offset, as we need bit 5 from bit_pos.
922 unsigned b5 = bit_pos << (ImmTestBranchBit5_offset - 5); 922 unsigned b5 = bit_pos << (ImmTestBranchBit5_offset - 5);
923 unsigned b40 = bit_pos << ImmTestBranchBit40_offset; 923 unsigned b40 = bit_pos << ImmTestBranchBit40_offset;
924 b5 &= ImmTestBranchBit5_mask; 924 b5 &= ImmTestBranchBit5_mask;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
971 Instr Assembler::ImmRotate(unsigned immr, unsigned reg_size) { 971 Instr Assembler::ImmRotate(unsigned immr, unsigned reg_size) {
972 ASSERT((reg_size == kWRegSize) || (reg_size == kXRegSize)); 972 ASSERT((reg_size == kWRegSize) || (reg_size == kXRegSize));
973 ASSERT(((reg_size == kXRegSize) && is_uint6(immr)) || 973 ASSERT(((reg_size == kXRegSize) && is_uint6(immr)) ||
974 ((reg_size == kWRegSize) && is_uint5(immr))); 974 ((reg_size == kWRegSize) && is_uint5(immr)));
975 USE(reg_size); 975 USE(reg_size);
976 return immr << ImmRotate_offset; 976 return immr << ImmRotate_offset;
977 } 977 }
978 978
979 979
980 Instr Assembler::ImmLLiteral(int imm19) { 980 Instr Assembler::ImmLLiteral(int imm19) {
981 ASSERT(is_int19(imm19)); 981 CHECK(is_int19(imm19));
982 return truncate_to_int19(imm19) << ImmLLiteral_offset; 982 return truncate_to_int19(imm19) << ImmLLiteral_offset;
983 } 983 }
984 984
985 985
986 Instr Assembler::BitN(unsigned bitn, unsigned reg_size) { 986 Instr Assembler::BitN(unsigned bitn, unsigned reg_size) {
987 ASSERT((reg_size == kWRegSize) || (reg_size == kXRegSize)); 987 ASSERT((reg_size == kWRegSize) || (reg_size == kXRegSize));
988 ASSERT((reg_size == kXRegSize) || (bitn == 0)); 988 ASSERT((reg_size == kXRegSize) || (bitn == 0));
989 USE(reg_size); 989 USE(reg_size);
990 return bitn << BitN_offset; 990 return bitn << BitN_offset;
991 } 991 }
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
1138 1138
1139 1139
1140 void Assembler::ClearRecordedAstId() { 1140 void Assembler::ClearRecordedAstId() {
1141 recorded_ast_id_ = TypeFeedbackId::None(); 1141 recorded_ast_id_ = TypeFeedbackId::None();
1142 } 1142 }
1143 1143
1144 1144
1145 } } // namespace v8::internal 1145 } } // namespace v8::internal
1146 1146
1147 #endif // V8_A64_ASSEMBLER_A64_INL_H_ 1147 #endif // V8_A64_ASSEMBLER_A64_INL_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698