| OLD | NEW |
| 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 940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 951 void RecordComment(const char* msg); | 951 void RecordComment(const char* msg); |
| 952 | 952 |
| 953 void RecordPosition(int pos); | 953 void RecordPosition(int pos); |
| 954 void RecordStatementPosition(int pos); | 954 void RecordStatementPosition(int pos); |
| 955 void WriteRecordedPositions(); | 955 void WriteRecordedPositions(); |
| 956 | 956 |
| 957 int pc_offset() const { return pc_ - buffer_; } | 957 int pc_offset() const { return pc_ - buffer_; } |
| 958 int current_position() const { return current_position_; } | 958 int current_position() const { return current_position_; } |
| 959 int current_statement_position() const { return current_statement_position_; } | 959 int current_statement_position() const { return current_statement_position_; } |
| 960 | 960 |
| 961 // Read/patch instructions |
| 962 static Instr instr_at(byte* pc) { return *reinterpret_cast<Instr*>(pc); } |
| 963 static void instr_at_put(byte* pc, Instr instr) { |
| 964 *reinterpret_cast<Instr*>(pc) = instr; |
| 965 } |
| 966 static bool IsB(Instr instr); |
| 967 static int GetBOffset(Instr instr); |
| 968 static bool IsLdrRegisterImmediate(Instr instr); |
| 969 static int GetLdrRegisterImmediateOffset(Instr instr); |
| 970 static Instr SetLdrRegisterImmediateOffset(Instr instr, int offset); |
| 971 |
| 961 protected: | 972 protected: |
| 962 int buffer_space() const { return reloc_info_writer.pos() - pc_; } | 973 int buffer_space() const { return reloc_info_writer.pos() - pc_; } |
| 963 | 974 |
| 964 // Read/patch instructions | 975 // Read/patch instructions |
| 965 static Instr instr_at(byte* pc) { return *reinterpret_cast<Instr*>(pc); } | |
| 966 void instr_at_put(byte* pc, Instr instr) { | |
| 967 *reinterpret_cast<Instr*>(pc) = instr; | |
| 968 } | |
| 969 Instr instr_at(int pos) { return *reinterpret_cast<Instr*>(buffer_ + pos); } | 976 Instr instr_at(int pos) { return *reinterpret_cast<Instr*>(buffer_ + pos); } |
| 970 void instr_at_put(int pos, Instr instr) { | 977 void instr_at_put(int pos, Instr instr) { |
| 971 *reinterpret_cast<Instr*>(buffer_ + pos) = instr; | 978 *reinterpret_cast<Instr*>(buffer_ + pos) = instr; |
| 972 } | 979 } |
| 973 | 980 |
| 974 // Decode branch instruction at pos and return branch target pos | 981 // Decode branch instruction at pos and return branch target pos |
| 975 int target_at(int pos); | 982 int target_at(int pos); |
| 976 | 983 |
| 977 // Patch branch instruction at pos to branch to given branch target pos | 984 // Patch branch instruction at pos to branch to given branch target pos |
| 978 void target_at_put(int pos, int target_pos); | 985 void target_at_put(int pos, int target_pos); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1087 | 1094 |
| 1088 friend class RegExpMacroAssemblerARM; | 1095 friend class RegExpMacroAssemblerARM; |
| 1089 friend class RelocInfo; | 1096 friend class RelocInfo; |
| 1090 friend class CodePatcher; | 1097 friend class CodePatcher; |
| 1091 friend class BlockConstPoolScope; | 1098 friend class BlockConstPoolScope; |
| 1092 }; | 1099 }; |
| 1093 | 1100 |
| 1094 } } // namespace v8::internal | 1101 } } // namespace v8::internal |
| 1095 | 1102 |
| 1096 #endif // V8_ARM_ASSEMBLER_ARM_H_ | 1103 #endif // V8_ARM_ASSEMBLER_ARM_H_ |
| OLD | NEW |