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

Side by Side Diff: src/x64/assembler-x64.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
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 are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // 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 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after
1167 // Mark address of the ExitJSFrame code. 1167 // Mark address of the ExitJSFrame code.
1168 void RecordJSReturn(); 1168 void RecordJSReturn();
1169 1169
1170 // Mark address of a debug break slot. 1170 // Mark address of a debug break slot.
1171 void RecordDebugBreakSlot(); 1171 void RecordDebugBreakSlot();
1172 1172
1173 // Record a comment relocation entry that can be used by a disassembler. 1173 // Record a comment relocation entry that can be used by a disassembler.
1174 // Use --debug_code to enable. 1174 // Use --debug_code to enable.
1175 void RecordComment(const char* msg); 1175 void RecordComment(const char* msg);
1176 1176
1177 void RecordPosition(int pos); 1177 int pc_offset() const { return static_cast<int>(pc_ - buffer_); }
1178 void RecordStatementPosition(int pos);
1179 bool WriteRecordedPositions();
1180 1178
1181 int pc_offset() const { return static_cast<int>(pc_ - buffer_); } 1179 PositionsRecorder* positions_recorder() { return &positions_recorder_; }
1182 int current_statement_position() const { return current_statement_position_; }
1183 int current_position() const { return current_position_; }
1184 1180
1185 // Check if there is less than kGap bytes available in the buffer. 1181 // Check if there is less than kGap bytes available in the buffer.
1186 // If this is the case, we need to grow the buffer before emitting 1182 // If this is the case, we need to grow the buffer before emitting
1187 // an instruction or relocation information. 1183 // an instruction or relocation information.
1188 inline bool buffer_overflow() const { 1184 inline bool buffer_overflow() const {
1189 return pc_ >= reloc_info_writer.pos() - kGap; 1185 return pc_ >= reloc_info_writer.pos() - kGap;
1190 } 1186 }
1191 1187
1192 // Get the number of bytes available in the buffer. 1188 // Get the number of bytes available in the buffer.
1193 inline int available_space() const { 1189 inline int available_space() const {
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
1397 static byte* spare_buffer_; 1393 static byte* spare_buffer_;
1398 1394
1399 // code generation 1395 // code generation
1400 byte* pc_; // the program counter; moves forward 1396 byte* pc_; // the program counter; moves forward
1401 RelocInfoWriter reloc_info_writer; 1397 RelocInfoWriter reloc_info_writer;
1402 1398
1403 List< Handle<Code> > code_targets_; 1399 List< Handle<Code> > code_targets_;
1404 // push-pop elimination 1400 // push-pop elimination
1405 byte* last_pc_; 1401 byte* last_pc_;
1406 1402
1407 // source position information 1403 PositionsRecorder positions_recorder_;
1408 int current_statement_position_; 1404 friend class PositionsRecorder;
1409 int current_position_;
1410 int written_statement_position_;
1411 int written_position_;
1412 }; 1405 };
1413 1406
1414 1407
1415 // Helper class that ensures that there is enough space for generating 1408 // Helper class that ensures that there is enough space for generating
1416 // instructions and relocation information. The constructor makes 1409 // instructions and relocation information. The constructor makes
1417 // sure that there is enough space and (in debug mode) the destructor 1410 // sure that there is enough space and (in debug mode) the destructor
1418 // checks that we did not generate too much. 1411 // checks that we did not generate too much.
1419 class EnsureSpace BASE_EMBEDDED { 1412 class EnsureSpace BASE_EMBEDDED {
1420 public: 1413 public:
1421 explicit EnsureSpace(Assembler* assembler) : assembler_(assembler) { 1414 explicit EnsureSpace(Assembler* assembler) : assembler_(assembler) {
(...skipping 13 matching lines...) Expand all
1435 private: 1428 private:
1436 Assembler* assembler_; 1429 Assembler* assembler_;
1437 #ifdef DEBUG 1430 #ifdef DEBUG
1438 int space_before_; 1431 int space_before_;
1439 #endif 1432 #endif
1440 }; 1433 };
1441 1434
1442 } } // namespace v8::internal 1435 } } // namespace v8::internal
1443 1436
1444 #endif // V8_X64_ASSEMBLER_X64_H_ 1437 #endif // V8_X64_ASSEMBLER_X64_H_
OLDNEW
« src/assembler.h ('K') | « src/jump-target-light.cc ('k') | src/x64/assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698