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

Side by Side Diff: src/arm/assembler-arm.h

Issue 4469002: Improve positions recording for calls. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 10 years, 1 month 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 | src/arm/assembler-arm.cc » ('j') | src/arm/assembler-arm.cc » ('J')
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 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after
1110 // Mark address of the ExitJSFrame code. 1110 // Mark address of the ExitJSFrame code.
1111 void RecordJSReturn(); 1111 void RecordJSReturn();
1112 1112
1113 // Mark address of a debug break slot. 1113 // Mark address of a debug break slot.
1114 void RecordDebugBreakSlot(); 1114 void RecordDebugBreakSlot();
1115 1115
1116 // Record a comment relocation entry that can be used by a disassembler. 1116 // Record a comment relocation entry that can be used by a disassembler.
1117 // Use --debug_code to enable. 1117 // Use --debug_code to enable.
1118 void RecordComment(const char* msg); 1118 void RecordComment(const char* msg);
1119 1119
1120 void RecordPosition(int pos); 1120 int pc_offset() const { return pc_ - buffer_; }
1121 void RecordStatementPosition(int pos);
1122 bool WriteRecordedPositions();
1123 1121
1124 int pc_offset() const { return pc_ - buffer_; } 1122 PositionsRecorder* positions_recorder() { return &positions_recorder_; }
1125 int current_position() const { return current_position_; }
1126 int current_statement_position() const { return current_statement_position_; }
1127 1123
1128 bool can_peephole_optimize(int instructions) { 1124 bool can_peephole_optimize(int instructions) {
1129 if (!FLAG_peephole_optimization) return false; 1125 if (!FLAG_peephole_optimization) return false;
1130 if (last_bound_pos_ > pc_offset() - instructions * kInstrSize) return false; 1126 if (last_bound_pos_ > pc_offset() - instructions * kInstrSize) return false;
1131 return reloc_info_writer.last_pc() <= pc_ - instructions * kInstrSize; 1127 return reloc_info_writer.last_pc() <= pc_ - instructions * kInstrSize;
1132 } 1128 }
1133 1129
1134 // Read/patch instructions 1130 // Read/patch instructions
1135 static Instr instr_at(byte* pc) { return *reinterpret_cast<Instr*>(pc); } 1131 static Instr instr_at(byte* pc) { return *reinterpret_cast<Instr*>(pc); }
1136 static void instr_at_put(byte* pc, Instr instr) { 1132 static void instr_at_put(byte* pc, Instr instr) {
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
1252 // stored in a separate buffer until a constant pool is emitted. 1248 // stored in a separate buffer until a constant pool is emitted.
1253 // If every instruction in a long sequence is accessing the pool, we need one 1249 // If every instruction in a long sequence is accessing the pool, we need one
1254 // pending relocation entry per instruction. 1250 // pending relocation entry per instruction.
1255 static const int kMaxNumPRInfo = kMaxDistBetweenPools/kInstrSize; 1251 static const int kMaxNumPRInfo = kMaxDistBetweenPools/kInstrSize;
1256 RelocInfo prinfo_[kMaxNumPRInfo]; // the buffer of pending relocation info 1252 RelocInfo prinfo_[kMaxNumPRInfo]; // the buffer of pending relocation info
1257 int num_prinfo_; // number of pending reloc info entries in the buffer 1253 int num_prinfo_; // number of pending reloc info entries in the buffer
1258 1254
1259 // The bound position, before this we cannot do instruction elimination. 1255 // The bound position, before this we cannot do instruction elimination.
1260 int last_bound_pos_; 1256 int last_bound_pos_;
1261 1257
1262 // source position information
1263 int current_position_;
1264 int current_statement_position_;
1265 int written_position_;
1266 int written_statement_position_;
1267
1268 // Code emission 1258 // Code emission
1269 inline void CheckBuffer(); 1259 inline void CheckBuffer();
1270 void GrowBuffer(); 1260 void GrowBuffer();
1271 inline void emit(Instr x); 1261 inline void emit(Instr x);
1272 1262
1273 // Instruction generation 1263 // Instruction generation
1274 void addrmod1(Instr instr, Register rn, Register rd, const Operand& x); 1264 void addrmod1(Instr instr, Register rn, Register rd, const Operand& x);
1275 void addrmod2(Instr instr, Register rd, const MemOperand& x); 1265 void addrmod2(Instr instr, Register rd, const MemOperand& x);
1276 void addrmod3(Instr instr, Register rd, const MemOperand& x); 1266 void addrmod3(Instr instr, Register rd, const MemOperand& x);
1277 void addrmod4(Instr instr, Register rn, RegList rl); 1267 void addrmod4(Instr instr, Register rn, RegList rl);
1278 void addrmod5(Instr instr, CRegister crd, const MemOperand& x); 1268 void addrmod5(Instr instr, CRegister crd, const MemOperand& x);
1279 1269
1280 // Labels 1270 // Labels
1281 void print(Label* L); 1271 void print(Label* L);
1282 void bind_to(Label* L, int pos); 1272 void bind_to(Label* L, int pos);
1283 void link_to(Label* L, Label* appendix); 1273 void link_to(Label* L, Label* appendix);
1284 void next(Label* L); 1274 void next(Label* L);
1285 1275
1286 // Record reloc info for current pc_ 1276 // Record reloc info for current pc_
1287 void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data = 0); 1277 void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data = 0);
1288 1278
1289 friend class RegExpMacroAssemblerARM; 1279 friend class RegExpMacroAssemblerARM;
1290 friend class RelocInfo; 1280 friend class RelocInfo;
1291 friend class CodePatcher; 1281 friend class CodePatcher;
1292 friend class BlockConstPoolScope; 1282 friend class BlockConstPoolScope;
1283
1284 PositionsRecorder positions_recorder_;
1285 friend class PositionsRecorder;
1286 friend class EnsureSpace;
1293 }; 1287 };
1294 1288
1289
1290 class EnsureSpace BASE_EMBEDDED {
1291 public:
1292 EnsureSpace(Assembler* assembler) {
1293 assembler->CheckBuffer();
1294 }
1295 };
1296
1297
1295 } } // namespace v8::internal 1298 } } // namespace v8::internal
1296 1299
1297 #endif // V8_ARM_ASSEMBLER_ARM_H_ 1300 #endif // V8_ARM_ASSEMBLER_ARM_H_
OLDNEW
« no previous file with comments | « no previous file | src/arm/assembler-arm.cc » ('j') | src/arm/assembler-arm.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698