| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/disassembler.h" | 5 #include "vm/disassembler.h" |
| 6 | 6 |
| 7 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. | 7 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
| 8 #if defined(TARGET_ARCH_IA32) | 8 #if defined(TARGET_ARCH_IA32) |
| 9 #include "platform/utils.h" | 9 #include "platform/utils.h" |
| 10 #include "vm/allocation.h" | 10 #include "vm/allocation.h" |
| 11 #include "vm/code_index_table.h" | 11 #include "vm/code_index_table.h" |
| 12 #include "vm/heap.h" | 12 #include "vm/heap.h" |
| 13 #include "vm/os.h" | 13 #include "vm/os.h" |
| 14 #include "vm/stack_frame.h" | |
| 15 #include "vm/stub_code.h" | 14 #include "vm/stub_code.h" |
| 16 | 15 |
| 17 namespace dart { | 16 namespace dart { |
| 18 | 17 |
| 19 // Tables used for decoding of x86 instructions. | 18 // Tables used for decoding of x86 instructions. |
| 20 enum OperandOrder { | 19 enum OperandOrder { |
| 21 UNSET_OP_ORDER = 0, | 20 UNSET_OP_ORDER = 0, |
| 22 REG_OPER_OP_ORDER, | 21 REG_OPER_OP_ORDER, |
| 23 OPER_REG_OP_ORDER | 22 OPER_REG_OP_ORDER |
| 24 }; | 23 }; |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 Print(obj.ToCString()); | 419 Print(obj.ToCString()); |
| 421 Print("'"); | 420 Print("'"); |
| 422 } else { | 421 } else { |
| 423 // 'addr' is not an object, but probably a code address. | 422 // 'addr' is not an object, but probably a code address. |
| 424 const char* name_of_stub = StubCode::NameOfStub(addr); | 423 const char* name_of_stub = StubCode::NameOfStub(addr); |
| 425 if (name_of_stub != NULL) { | 424 if (name_of_stub != NULL) { |
| 426 Print(" [stub: "); | 425 Print(" [stub: "); |
| 427 Print(name_of_stub); | 426 Print(name_of_stub); |
| 428 Print("]"); | 427 Print("]"); |
| 429 } else { | 428 } else { |
| 430 // Print only if jumping to entry point. | 429 CodeIndexTable* code_index_table = Isolate::Current()->code_index_table(); |
| 431 const Code& code = Code::Handle( | 430 if (code_index_table != NULL) { |
| 432 StackFrame::LookupCode(Isolate::Current(), addr)); | 431 // Print only if jumping to entry point. |
| 433 if (!code.IsNull() && (code.EntryPoint() == addr)) { | 432 const Code& code = Code::Handle( |
| 434 const Function& function = Function::Handle(code.function()); | 433 code_index_table->LookupCode(addr)); |
| 435 const char* name_of_function = function.ToFullyQualifiedCString(); | 434 if (!code.IsNull() && (code.EntryPoint() == addr)) { |
| 436 Print(" ["); | 435 const Function& function = Function::Handle(code.function()); |
| 437 Print(name_of_function); | 436 const char* name_of_function = function.ToFullyQualifiedCString(); |
| 438 Print("]"); | 437 Print(" ["); |
| 438 Print(name_of_function); |
| 439 Print("]"); |
| 440 } |
| 439 } | 441 } |
| 440 } | 442 } |
| 441 } | 443 } |
| 442 } | 444 } |
| 443 | 445 |
| 444 | 446 |
| 445 int X86Decoder::PrintRightOperandHelper(uint8_t* modrmp, | 447 int X86Decoder::PrintRightOperandHelper(uint8_t* modrmp, |
| 446 RegisterNamePrinter register_printer) { | 448 RegisterNamePrinter register_printer) { |
| 447 int mod, regop, rm; | 449 int mod, regop, rm; |
| 448 GetModRm(*modrmp, &mod, ®op, &rm); | 450 GetModRm(*modrmp, &mod, ®op, &rm); |
| (...skipping 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1594 human_buffer, | 1596 human_buffer, |
| 1595 sizeof(human_buffer), | 1597 sizeof(human_buffer), |
| 1596 pc); | 1598 pc); |
| 1597 pc += instruction_length; | 1599 pc += instruction_length; |
| 1598 } | 1600 } |
| 1599 } | 1601 } |
| 1600 | 1602 |
| 1601 } // namespace dart | 1603 } // namespace dart |
| 1602 | 1604 |
| 1603 #endif // defined TARGET_ARCH_IA32 | 1605 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |