| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <assert.h> | 5 #include <assert.h> |
| 6 #include <stdio.h> | 6 #include <stdio.h> |
| 7 #include <stdarg.h> | 7 #include <stdarg.h> |
| 8 | 8 |
| 9 #include "src/v8.h" | 9 #include "src/v8.h" |
| 10 | 10 |
| (...skipping 1627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1638 | 1638 |
| 1639 int instr_len = data - instr; | 1639 int instr_len = data - instr; |
| 1640 if (instr_len == 0) { | 1640 if (instr_len == 0) { |
| 1641 printf("%02x", *data); | 1641 printf("%02x", *data); |
| 1642 } | 1642 } |
| 1643 ASSERT(instr_len > 0); // Ensure progress. | 1643 ASSERT(instr_len > 0); // Ensure progress. |
| 1644 | 1644 |
| 1645 int outp = 0; | 1645 int outp = 0; |
| 1646 // Instruction bytes. | 1646 // Instruction bytes. |
| 1647 for (byte* bp = instr; bp < data; bp++) { | 1647 for (byte* bp = instr; bp < data; bp++) { |
| 1648 outp += v8::internal:::SNPrintF(out_buffer + outp, "%02x", *bp); | 1648 outp += v8::internal::SNPrintF(out_buffer + outp, "%02x", *bp); |
| 1649 } | 1649 } |
| 1650 for (int i = 6 - instr_len; i >= 0; i--) { | 1650 for (int i = 6 - instr_len; i >= 0; i--) { |
| 1651 outp += v8::internal::SNPrintF(out_buffer + outp, " "); | 1651 outp += v8::internal::SNPrintF(out_buffer + outp, " "); |
| 1652 } | 1652 } |
| 1653 | 1653 |
| 1654 outp += v8::internal::SNPrintF(out_buffer + outp, " %s", tmp_buffer_.start()); | 1654 outp += v8::internal::SNPrintF(out_buffer + outp, " %s", tmp_buffer_.start()); |
| 1655 return instr_len; | 1655 return instr_len; |
| 1656 } // NOLINT (function is too long) | 1656 } // NOLINT (function is too long) |
| 1657 | 1657 |
| 1658 | 1658 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1748 fprintf(f, " "); | 1748 fprintf(f, " "); |
| 1749 } | 1749 } |
| 1750 fprintf(f, " %s\n", buffer.start()); | 1750 fprintf(f, " %s\n", buffer.start()); |
| 1751 } | 1751 } |
| 1752 } | 1752 } |
| 1753 | 1753 |
| 1754 | 1754 |
| 1755 } // namespace disasm | 1755 } // namespace disasm |
| 1756 | 1756 |
| 1757 #endif // V8_TARGET_ARCH_X87 | 1757 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |