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/compiler.h" | 5 #include "vm/compiler.h" |
6 | 6 |
7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
8 | 8 |
9 #include "vm/ast_printer.h" | 9 #include "vm/ast_printer.h" |
10 #include "vm/block_scheduler.h" | 10 #include "vm/block_scheduler.h" |
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 function_fullname); | 701 function_fullname); |
702 const LocalVarDescriptors& var_descriptors = | 702 const LocalVarDescriptors& var_descriptors = |
703 LocalVarDescriptors::Handle(code.var_descriptors()); | 703 LocalVarDescriptors::Handle(code.var_descriptors()); |
704 intptr_t var_desc_length = | 704 intptr_t var_desc_length = |
705 var_descriptors.IsNull() ? 0 : var_descriptors.Length(); | 705 var_descriptors.IsNull() ? 0 : var_descriptors.Length(); |
706 String& var_name = String::Handle(); | 706 String& var_name = String::Handle(); |
707 for (intptr_t i = 0; i < var_desc_length; i++) { | 707 for (intptr_t i = 0; i < var_desc_length; i++) { |
708 var_name = var_descriptors.GetName(i); | 708 var_name = var_descriptors.GetName(i); |
709 RawLocalVarDescriptors::VarInfo var_info; | 709 RawLocalVarDescriptors::VarInfo var_info; |
710 var_descriptors.GetInfo(i, &var_info); | 710 var_descriptors.GetInfo(i, &var_info); |
711 if (var_info.kind == RawLocalVarDescriptors::kSavedEntryContext) { | 711 const int8_t kind = |
712 OS::Print(" saved caller's CTX reg offset %" Pd "\n", var_info.index); | 712 RawLocalVarDescriptors::KindBits::decode(var_info.index_kind); |
713 } else if (var_info.kind == RawLocalVarDescriptors::kSavedCurrentContext) { | 713 if (kind == RawLocalVarDescriptors::kSavedEntryContext) { |
714 OS::Print(" saved current CTX reg offset %" Pd "\n", var_info.index); | 714 OS::Print(" saved caller's CTX reg offset %d\n", |
| 715 RawLocalVarDescriptors::IndexBits::decode(var_info.index_kind)); |
| 716 } else if (kind == RawLocalVarDescriptors::kSavedCurrentContext) { |
| 717 OS::Print(" saved current CTX reg offset %d\n", |
| 718 RawLocalVarDescriptors::IndexBits::decode(var_info.index_kind)); |
715 } else { | 719 } else { |
716 if (var_info.kind == RawLocalVarDescriptors::kContextLevel) { | 720 if (kind == RawLocalVarDescriptors::kContextLevel) { |
717 OS::Print(" context level %" Pd " scope %d", | 721 OS::Print(" context level %d scope %d", |
718 var_info.index, var_info.scope_id); | 722 RawLocalVarDescriptors::IndexBits::decode(var_info.index_kind), |
719 } else if (var_info.kind == RawLocalVarDescriptors::kStackVar) { | 723 var_info.scope_id); |
720 OS::Print(" stack var '%s' offset %" Pd "", | 724 } else if (kind == RawLocalVarDescriptors::kStackVar) { |
721 var_name.ToCString(), var_info.index); | 725 OS::Print(" stack var '%s' offset %d", |
| 726 var_name.ToCString(), |
| 727 RawLocalVarDescriptors::IndexBits::decode(var_info.index_kind)); |
722 } else { | 728 } else { |
723 ASSERT(var_info.kind == RawLocalVarDescriptors::kContextVar); | 729 ASSERT(kind == RawLocalVarDescriptors::kContextVar); |
724 OS::Print(" context var '%s' level %d offset %" Pd "", | 730 OS::Print(" context var '%s' level %d offset %d", |
725 var_name.ToCString(), var_info.scope_id, var_info.index); | 731 var_name.ToCString(), var_info.scope_id, |
| 732 RawLocalVarDescriptors::IndexBits::decode(var_info.index_kind)); |
726 } | 733 } |
727 OS::Print(" (valid %" Pd "-%" Pd ")\n", | 734 OS::Print(" (valid %d-%d)\n", var_info.begin_pos, var_info.end_pos); |
728 var_info.begin_pos, var_info.end_pos); | |
729 } | 735 } |
730 } | 736 } |
731 OS::Print("}\n"); | 737 OS::Print("}\n"); |
732 | 738 |
733 OS::Print("Exception Handlers for function '%s' {\n", function_fullname); | 739 OS::Print("Exception Handlers for function '%s' {\n", function_fullname); |
734 const ExceptionHandlers& handlers = | 740 const ExceptionHandlers& handlers = |
735 ExceptionHandlers::Handle(code.exception_handlers()); | 741 ExceptionHandlers::Handle(code.exception_handlers()); |
736 OS::Print("%s}\n", handlers.ToCString()); | 742 OS::Print("%s}\n", handlers.ToCString()); |
737 | 743 |
738 { | 744 { |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
969 const Object& result = | 975 const Object& result = |
970 Object::Handle(isolate->object_store()->sticky_error()); | 976 Object::Handle(isolate->object_store()->sticky_error()); |
971 isolate->object_store()->clear_sticky_error(); | 977 isolate->object_store()->clear_sticky_error(); |
972 return result.raw(); | 978 return result.raw(); |
973 } | 979 } |
974 UNREACHABLE(); | 980 UNREACHABLE(); |
975 return Object::null(); | 981 return Object::null(); |
976 } | 982 } |
977 | 983 |
978 } // namespace dart | 984 } // namespace dart |
OLD | NEW |