Chromium Code Reviews| Index: runtime/vm/debugger.cc |
| =================================================================== |
| --- runtime/vm/debugger.cc (revision 37878) |
| +++ runtime/vm/debugger.cc (working copy) |
| @@ -447,7 +447,9 @@ |
| for (intptr_t cur_idx = 0; cur_idx < var_desc_len; cur_idx++) { |
| RawLocalVarDescriptors::VarInfo var_info; |
| var_descriptors_.GetInfo(cur_idx, &var_info); |
| - if ((var_info.kind == RawLocalVarDescriptors::kContextLevel) && |
| + const int8_t kind = |
| + RawLocalVarDescriptors::KindBits::decode(var_info.index_kind); |
|
Ivan Posva
2014/07/23 12:23:26
Wouldn't this read better if it was
const int8_t
zra
2014/08/20 22:13:56
Done and also added set_kind() and set_index()
|
| + if ((kind == RawLocalVarDescriptors::kContextLevel) && |
| (var_info.begin_pos <= activation_token_pos) && |
| (activation_token_pos < var_info.end_pos)) { |
| // This var_descriptors_ entry is a context scope which is in scope |
| @@ -455,7 +457,8 @@ |
| // the previous context scope. |
| if (innermost_begin_pos < var_info.begin_pos) { |
| innermost_begin_pos = var_info.begin_pos; |
| - context_level_ = var_info.index; |
| + context_level_ = |
| + RawLocalVarDescriptors::IndexBits::decode(var_info.index_kind); |
|
Ivan Posva
2014/07/23 12:23:27
ditto
zra
2014/08/20 22:13:56
Done.
|
| } |
| } |
| } |
| @@ -472,12 +475,15 @@ |
| for (intptr_t i = 0; i < var_desc_len; i++) { |
| RawLocalVarDescriptors::VarInfo var_info; |
| var_descriptors_.GetInfo(i, &var_info); |
| - if (var_info.kind == RawLocalVarDescriptors::kSavedEntryContext) { |
| + const int8_t kind = |
| + RawLocalVarDescriptors::KindBits::decode(var_info.index_kind); |
| + if (kind == RawLocalVarDescriptors::kSavedEntryContext) { |
| if (FLAG_trace_debugger_stacktrace) { |
| - OS::PrintErr("\tFound saved entry ctx at index %" Pd "\n", |
| - var_info.index); |
| + OS::PrintErr("\tFound saved entry ctx at index %d\n", |
| + RawLocalVarDescriptors::IndexBits::decode(var_info.index_kind)); |
| } |
| - return GetLocalContextVar(var_info.index); |
| + return GetLocalContextVar( |
| + RawLocalVarDescriptors::IndexBits::decode(var_info.index_kind)); |
| } |
| } |
| @@ -494,12 +500,15 @@ |
| for (intptr_t i = 0; i < var_desc_len; i++) { |
| RawLocalVarDescriptors::VarInfo var_info; |
| var_descriptors_.GetInfo(i, &var_info); |
| - if (var_info.kind == RawLocalVarDescriptors::kSavedCurrentContext) { |
| + const int8_t kind = |
| + RawLocalVarDescriptors::KindBits::decode(var_info.index_kind); |
| + if (kind == RawLocalVarDescriptors::kSavedCurrentContext) { |
| if (FLAG_trace_debugger_stacktrace) { |
| - OS::PrintErr("\tFound saved current ctx at index %" Pd "\n", |
| - var_info.index); |
| + OS::PrintErr("\tFound saved current ctx at index %d\n", |
| + RawLocalVarDescriptors::IndexBits::decode(var_info.index_kind)); |
| } |
| - return GetLocalContextVar(var_info.index); |
| + return GetLocalContextVar( |
| + RawLocalVarDescriptors::IndexBits::decode(var_info.index_kind)); |
| } |
| } |
| UNREACHABLE(); |
| @@ -603,13 +612,15 @@ |
| ASSERT(var_names.length() == desc_indices_.length()); |
| RawLocalVarDescriptors::VarInfo var_info; |
| var_descriptors_.GetInfo(cur_idx, &var_info); |
| - if ((var_info.kind != RawLocalVarDescriptors::kStackVar) && |
| - (var_info.kind != RawLocalVarDescriptors::kContextVar)) { |
| + const int8_t kind = |
| + RawLocalVarDescriptors::KindBits::decode(var_info.index_kind); |
| + if ((kind != RawLocalVarDescriptors::kStackVar) && |
| + (kind != RawLocalVarDescriptors::kContextVar)) { |
| continue; |
| } |
| if ((var_info.begin_pos <= activation_token_pos) && |
| (activation_token_pos <= var_info.end_pos)) { |
| - if ((var_info.kind == RawLocalVarDescriptors::kContextVar) && |
| + if ((kind == RawLocalVarDescriptors::kContextVar) && |
| (ContextLevel() < var_info.scope_id)) { |
| // The variable is textually in scope but the context level |
| // at the activation frame's PC is lower than the context |
| @@ -760,10 +771,13 @@ |
| ASSERT(end_pos != NULL); |
| *end_pos = var_info.end_pos; |
| ASSERT(value != NULL); |
| - if (var_info.kind == RawLocalVarDescriptors::kStackVar) { |
| - *value = GetLocalInstanceVar(var_info.index); |
| + const int8_t kind = |
| + RawLocalVarDescriptors::KindBits::decode(var_info.index_kind); |
| + if (kind == RawLocalVarDescriptors::kStackVar) { |
| + *value = GetLocalInstanceVar( |
| + RawLocalVarDescriptors::IndexBits::decode(var_info.index_kind)); |
| } else { |
| - ASSERT(var_info.kind == RawLocalVarDescriptors::kContextVar); |
| + ASSERT(kind == RawLocalVarDescriptors::kContextVar); |
| if (ctx_.IsNull()) { |
| // The context has been removed by the optimizing compiler. |
| // |
| @@ -778,7 +792,8 @@ |
| // The context level of the variable. |
| intptr_t var_ctx_level = var_info.scope_id; |
| intptr_t level_diff = frame_ctx_level - var_ctx_level; |
| - intptr_t ctx_slot = var_info.index; |
| + intptr_t ctx_slot = |
| + RawLocalVarDescriptors::IndexBits::decode(var_info.index_kind); |
| if (level_diff == 0) { |
| if ((ctx_slot < 0) || |
| (ctx_slot >= ctx_.num_variables())) { |