Index: runtime/vm/disassembler.cc |
diff --git a/runtime/vm/disassembler.cc b/runtime/vm/disassembler.cc |
index abf9c849878565f65752d0e021618e306fbcfbce..dbd7eaa3cca0d7b945f3f4a5e72f2be53df49645 100644 |
--- a/runtime/vm/disassembler.cc |
+++ b/runtime/vm/disassembler.cc |
@@ -105,6 +105,7 @@ void Disassembler::Disassemble(uword start, |
uword end, |
DisassemblyFormatter* formatter, |
const Code& code) { |
+ NoSafepointScope no_safepoint; |
const Code::Comments& comments = |
code.IsNull() ? Code::Comments::New(0) : code.comments(); |
ASSERT(formatter != NULL); |
@@ -165,6 +166,13 @@ void Disassembler::Disassemble(uword start, |
void Disassembler::DisassembleCodeHelper( |
const char* function_fullname, const Code& code, bool optimized) { |
+ LocalVarDescriptors& var_descriptors = LocalVarDescriptors::Handle(); |
+ if (FLAG_print_variable_descriptors) { |
+ // This flag is not on by default, and for debugging purposes only. |
+ // Since this may allocate, do it outside the NoSafepointScope. |
+ var_descriptors = code.GetLocalVarDescriptors(); |
+ } |
+ NoSafepointScope no_safepoint; |
THR_Print("Code for %sfunction '%s' {\n", |
optimized ? "optimized " : "", |
function_fullname); |
@@ -232,8 +240,6 @@ void Disassembler::DisassembleCodeHelper( |
if (FLAG_print_variable_descriptors) { |
THR_Print("Variable Descriptors for function '%s' {\n", |
function_fullname); |
- const LocalVarDescriptors& var_descriptors = |
- LocalVarDescriptors::Handle(code.GetLocalVarDescriptors()); |
intptr_t var_desc_length = |
var_descriptors.IsNull() ? 0 : var_descriptors.Length(); |
String& var_name = String::Handle(); |
@@ -283,10 +289,9 @@ void Disassembler::DisassembleCodeHelper( |
Class& cls = Class::Handle(); |
cls ^= code.owner(); |
if (cls.IsNull()) { |
- const String& code_name = String::Handle(code.Name()); |
THR_Print(" 0x%" Px ": %s, %p\n", |
start + offset.Value(), |
- code_name.ToCString(), |
+ code.Name(), |
code.raw()); |
} else { |
THR_Print(" 0x%" Px ": allocation stub for %s, %p\n", |