OLD | NEW |
1 // Copyright 2007-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 12 matching lines...) Expand all Loading... |
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #include <assert.h> | 28 #include <assert.h> |
29 #include <stdio.h> | 29 #include <stdio.h> |
30 #include <stdarg.h> | 30 #include <stdarg.h> |
31 | 31 |
32 #include "v8.h" | 32 #include "v8.h" |
| 33 |
| 34 #if defined(V8_TARGET_ARCH_IA32) |
| 35 |
33 #include "disasm.h" | 36 #include "disasm.h" |
34 | 37 |
35 namespace disasm { | 38 namespace disasm { |
36 | 39 |
37 enum OperandOrder { | 40 enum OperandOrder { |
38 UNSET_OP_ORDER = 0, | 41 UNSET_OP_ORDER = 0, |
39 REG_OPER_OP_ORDER, | 42 REG_OPER_OP_ORDER, |
40 OPER_REG_OP_ORDER | 43 OPER_REG_OP_ORDER |
41 }; | 44 }; |
42 | 45 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 {0xF4, "hlt", UNSET_OP_ORDER}, | 86 {0xF4, "hlt", UNSET_OP_ORDER}, |
84 {0xCC, "int3", UNSET_OP_ORDER}, | 87 {0xCC, "int3", UNSET_OP_ORDER}, |
85 {0x60, "pushad", UNSET_OP_ORDER}, | 88 {0x60, "pushad", UNSET_OP_ORDER}, |
86 {0x61, "popad", UNSET_OP_ORDER}, | 89 {0x61, "popad", UNSET_OP_ORDER}, |
87 {0x9C, "pushfd", UNSET_OP_ORDER}, | 90 {0x9C, "pushfd", UNSET_OP_ORDER}, |
88 {0x9D, "popfd", UNSET_OP_ORDER}, | 91 {0x9D, "popfd", UNSET_OP_ORDER}, |
89 {0x9E, "sahf", UNSET_OP_ORDER}, | 92 {0x9E, "sahf", UNSET_OP_ORDER}, |
90 {0x99, "cdq", UNSET_OP_ORDER}, | 93 {0x99, "cdq", UNSET_OP_ORDER}, |
91 {0x9B, "fwait", UNSET_OP_ORDER}, | 94 {0x9B, "fwait", UNSET_OP_ORDER}, |
92 {0xFC, "cld", UNSET_OP_ORDER}, | 95 {0xFC, "cld", UNSET_OP_ORDER}, |
| 96 {0xAB, "stos", UNSET_OP_ORDER}, |
93 {-1, "", UNSET_OP_ORDER} | 97 {-1, "", UNSET_OP_ORDER} |
94 }; | 98 }; |
95 | 99 |
96 | 100 |
97 static ByteMnemonic call_jump_instr[] = { | 101 static ByteMnemonic call_jump_instr[] = { |
98 {0xE8, "call", UNSET_OP_ORDER}, | 102 {0xE8, "call", UNSET_OP_ORDER}, |
99 {0xE9, "jmp", UNSET_OP_ORDER}, | 103 {0xE9, "jmp", UNSET_OP_ORDER}, |
100 {-1, "", UNSET_OP_ORDER} | 104 {-1, "", UNSET_OP_ORDER} |
101 }; | 105 }; |
102 | 106 |
(...skipping 1328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1431 } | 1435 } |
1432 for (int i = 6 - (pc - prev_pc); i >= 0; i--) { | 1436 for (int i = 6 - (pc - prev_pc); i >= 0; i--) { |
1433 fprintf(f, " "); | 1437 fprintf(f, " "); |
1434 } | 1438 } |
1435 fprintf(f, " %s\n", buffer.start()); | 1439 fprintf(f, " %s\n", buffer.start()); |
1436 } | 1440 } |
1437 } | 1441 } |
1438 | 1442 |
1439 | 1443 |
1440 } // namespace disasm | 1444 } // namespace disasm |
| 1445 |
| 1446 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |