Chromium Code Reviews| 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 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 1356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1367 // Use --code-comments to enable. | 1367 // Use --code-comments to enable. |
| 1368 void RecordComment(const char* msg, bool force = false); | 1368 void RecordComment(const char* msg, bool force = false); |
| 1369 | 1369 |
| 1370 // Writes a single word of data in the code stream. | 1370 // Writes a single word of data in the code stream. |
| 1371 // Used for inline tables, e.g., jump-tables. | 1371 // Used for inline tables, e.g., jump-tables. |
| 1372 void db(uint8_t data); | 1372 void db(uint8_t data); |
| 1373 void dd(uint32_t data); | 1373 void dd(uint32_t data); |
| 1374 | 1374 |
| 1375 int pc_offset() const { return static_cast<int>(pc_ - buffer_); } | 1375 int pc_offset() const { return static_cast<int>(pc_ - buffer_); } |
| 1376 | 1376 |
| 1377 // Used for patching the code stream while it is being emitted. | |
| 1378 inline byte get_opcode(int offset) { | |
|
Lasse Reichstein
2011/06/07 14:02:53
Rename to get_byte/set_byte. Or read_byte/patch_by
Erik Corry
2011/06/08 10:38:55
No, but it makes the call site clearer.
Lasse Reichstein
2011/06/08 10:58:46
I don't see us using get_opcode anywhere. Just rem
Lasse Reichstein
2011/06/08 10:58:46
The call site can make its own local functions by
Erik Corry
2011/06/08 11:27:11
I now use set_byte_at and pc_offset instead.
Erik Corry
2011/06/08 11:27:11
It was used in an assert
| |
| 1379 ASSERT(offset < 0); | |
| 1380 ASSERT(pc_ + offset >= buffer_); | |
| 1381 return pc_[offset]; | |
| 1382 } | |
| 1383 inline void set_opcode(int offset, byte opcode) { | |
| 1384 ASSERT(offset < 0); | |
| 1385 ASSERT(pc_ + offset >= buffer_); | |
| 1386 pc_[offset] = opcode; | |
| 1387 } | |
| 1388 | |
| 1377 PositionsRecorder* positions_recorder() { return &positions_recorder_; } | 1389 PositionsRecorder* positions_recorder() { return &positions_recorder_; } |
| 1378 | 1390 |
| 1379 // Check if there is less than kGap bytes available in the buffer. | 1391 // Check if there is less than kGap bytes available in the buffer. |
| 1380 // If this is the case, we need to grow the buffer before emitting | 1392 // If this is the case, we need to grow the buffer before emitting |
| 1381 // an instruction or relocation information. | 1393 // an instruction or relocation information. |
| 1382 inline bool buffer_overflow() const { | 1394 inline bool buffer_overflow() const { |
| 1383 return pc_ >= reloc_info_writer.pos() - kGap; | 1395 return pc_ >= reloc_info_writer.pos() - kGap; |
| 1384 } | 1396 } |
| 1385 | 1397 |
| 1386 // Get the number of bytes available in the buffer. | 1398 // Get the number of bytes available in the buffer. |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1630 private: | 1642 private: |
| 1631 Assembler* assembler_; | 1643 Assembler* assembler_; |
| 1632 #ifdef DEBUG | 1644 #ifdef DEBUG |
| 1633 int space_before_; | 1645 int space_before_; |
| 1634 #endif | 1646 #endif |
| 1635 }; | 1647 }; |
| 1636 | 1648 |
| 1637 } } // namespace v8::internal | 1649 } } // namespace v8::internal |
| 1638 | 1650 |
| 1639 #endif // V8_X64_ASSEMBLER_X64_H_ | 1651 #endif // V8_X64_ASSEMBLER_X64_H_ |
| OLD | NEW |