Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(479)

Unified Diff: runtime/vm/disassembler.cc

Issue 2133443002: Don't print variable descriptors by default when printing disassembly. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: add test coverage for the new flag Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/flag_list.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/disassembler.cc
diff --git a/runtime/vm/disassembler.cc b/runtime/vm/disassembler.cc
index eef90c38ca007b43e667e1b399b015331dd1f852..d1ff765dfe1a76c726cc981367ef4f318dd60b30 100644
--- a/runtime/vm/disassembler.cc
+++ b/runtime/vm/disassembler.cc
@@ -250,37 +250,39 @@ void Disassembler::DisassembleCodeHelper(
}
THR_Print("}\n");
- 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();
- for (intptr_t i = 0; i < var_desc_length; i++) {
- var_name = var_descriptors.GetName(i);
- RawLocalVarDescriptors::VarInfo var_info;
- var_descriptors.GetInfo(i, &var_info);
- const int8_t kind = var_info.kind();
- if (kind == RawLocalVarDescriptors::kSavedCurrentContext) {
- THR_Print(" saved current CTX reg offset %d\n", var_info.index());
- } else {
- if (kind == RawLocalVarDescriptors::kContextLevel) {
- THR_Print(" context level %d scope %d", var_info.index(),
- var_info.scope_id);
- } else if (kind == RawLocalVarDescriptors::kStackVar) {
- THR_Print(" stack var '%s' offset %d",
- var_name.ToCString(), var_info.index());
+ 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();
+ for (intptr_t i = 0; i < var_desc_length; i++) {
+ var_name = var_descriptors.GetName(i);
+ RawLocalVarDescriptors::VarInfo var_info;
+ var_descriptors.GetInfo(i, &var_info);
+ const int8_t kind = var_info.kind();
+ if (kind == RawLocalVarDescriptors::kSavedCurrentContext) {
+ THR_Print(" saved current CTX reg offset %d\n", var_info.index());
} else {
- ASSERT(kind == RawLocalVarDescriptors::kContextVar);
- THR_Print(" context var '%s' level %d offset %d",
- var_name.ToCString(), var_info.scope_id, var_info.index());
+ if (kind == RawLocalVarDescriptors::kContextLevel) {
+ THR_Print(" context level %d scope %d", var_info.index(),
+ var_info.scope_id);
+ } else if (kind == RawLocalVarDescriptors::kStackVar) {
+ THR_Print(" stack var '%s' offset %d",
+ var_name.ToCString(), var_info.index());
+ } else {
+ ASSERT(kind == RawLocalVarDescriptors::kContextVar);
+ THR_Print(" context var '%s' level %d offset %d",
+ var_name.ToCString(), var_info.scope_id, var_info.index());
+ }
+ THR_Print(" (valid %s-%s)\n", var_info.begin_pos.ToCString(),
+ var_info.end_pos.ToCString());
}
- THR_Print(" (valid %s-%s)\n", var_info.begin_pos.ToCString(),
- var_info.end_pos.ToCString());
}
+ THR_Print("}\n");
}
- THR_Print("}\n");
THR_Print("Exception Handlers for function '%s' {\n", function_fullname);
const ExceptionHandlers& handlers =
« no previous file with comments | « no previous file | runtime/vm/flag_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698