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 |
11 #if V8_TARGET_ARCH_X64 | 11 #if V8_TARGET_ARCH_X64 |
12 | 12 |
| 13 #include "src/base/lazy-instance.h" |
13 #include "src/disasm.h" | 14 #include "src/disasm.h" |
14 #include "src/lazy-instance.h" | |
15 | 15 |
16 namespace disasm { | 16 namespace disasm { |
17 | 17 |
18 enum OperandType { | 18 enum OperandType { |
19 UNSET_OP_ORDER = 0, | 19 UNSET_OP_ORDER = 0, |
20 // Operand size decides between 16, 32 and 64 bit operands. | 20 // Operand size decides between 16, 32 and 64 bit operands. |
21 REG_OPER_OP_ORDER = 1, // Register destination, operand source. | 21 REG_OPER_OP_ORDER = 1, // Register destination, operand source. |
22 OPER_REG_OP_ORDER = 2, // Operand destination, register source. | 22 OPER_REG_OP_ORDER = 2, // Operand destination, register source. |
23 // Fixed 8-bit operands. | 23 // Fixed 8-bit operands. |
24 BYTE_SIZE_OPERAND_FLAG = 4, | 24 BYTE_SIZE_OPERAND_FLAG = 4, |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 void InstructionTable::AddJumpConditionalShort() { | 241 void InstructionTable::AddJumpConditionalShort() { |
242 for (byte b = 0x70; b <= 0x7F; b++) { | 242 for (byte b = 0x70; b <= 0x7F; b++) { |
243 InstructionDesc* id = &instructions_[b]; | 243 InstructionDesc* id = &instructions_[b]; |
244 ASSERT_EQ(NO_INSTR, id->type); // Information not already entered | 244 ASSERT_EQ(NO_INSTR, id->type); // Information not already entered |
245 id->mnem = NULL; // Computed depending on condition code. | 245 id->mnem = NULL; // Computed depending on condition code. |
246 id->type = JUMP_CONDITIONAL_SHORT_INSTR; | 246 id->type = JUMP_CONDITIONAL_SHORT_INSTR; |
247 } | 247 } |
248 } | 248 } |
249 | 249 |
250 | 250 |
251 static v8::internal::LazyInstance<InstructionTable>::type instruction_table = | 251 static v8::base::LazyInstance<InstructionTable>::type instruction_table = |
252 LAZY_INSTANCE_INITIALIZER; | 252 LAZY_INSTANCE_INITIALIZER; |
253 | 253 |
254 | 254 |
255 static InstructionDesc cmov_instructions[16] = { | 255 static InstructionDesc cmov_instructions[16] = { |
256 {"cmovo", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false}, | 256 {"cmovo", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false}, |
257 {"cmovno", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false}, | 257 {"cmovno", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false}, |
258 {"cmovc", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false}, | 258 {"cmovc", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false}, |
259 {"cmovnc", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false}, | 259 {"cmovnc", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false}, |
260 {"cmovz", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false}, | 260 {"cmovz", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false}, |
261 {"cmovnz", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false}, | 261 {"cmovnz", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false}, |
(...skipping 1641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1903 for (int i = 6 - static_cast<int>(pc - prev_pc); i >= 0; i--) { | 1903 for (int i = 6 - static_cast<int>(pc - prev_pc); i >= 0; i--) { |
1904 fprintf(f, " "); | 1904 fprintf(f, " "); |
1905 } | 1905 } |
1906 fprintf(f, " %s\n", buffer.start()); | 1906 fprintf(f, " %s\n", buffer.start()); |
1907 } | 1907 } |
1908 } | 1908 } |
1909 | 1909 |
1910 } // namespace disasm | 1910 } // namespace disasm |
1911 | 1911 |
1912 #endif // V8_TARGET_ARCH_X64 | 1912 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |