| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 #include "vm/ast_printer.h" | 8 #include "vm/ast_printer.h" |
| 9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
| 10 #include "vm/code_index_table.h" | 10 #include "vm/code_index_table.h" |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 OS::Print("}\n"); | 175 OS::Print("}\n"); |
| 176 OS::Print("PC Descriptors for function '%s' {\n", function_fullname); | 176 OS::Print("PC Descriptors for function '%s' {\n", function_fullname); |
| 177 OS::Print("(pc, kind, id, try-index, token-index)\n"); | 177 OS::Print("(pc, kind, id, try-index, token-index)\n"); |
| 178 const PcDescriptors& descriptors = | 178 const PcDescriptors& descriptors = |
| 179 PcDescriptors::Handle(code.pc_descriptors()); | 179 PcDescriptors::Handle(code.pc_descriptors()); |
| 180 OS::Print("%s", descriptors.ToCString()); | 180 OS::Print("%s", descriptors.ToCString()); |
| 181 OS::Print("}\n"); | 181 OS::Print("}\n"); |
| 182 OS::Print("Variable Descriptors for function '%s' {\n", function_fullname); | 182 OS::Print("Variable Descriptors for function '%s' {\n", function_fullname); |
| 183 const LocalVarDescriptors& var_descriptors = | 183 const LocalVarDescriptors& var_descriptors = |
| 184 LocalVarDescriptors::Handle(code.var_descriptors()); | 184 LocalVarDescriptors::Handle(code.var_descriptors()); |
| 185 intptr_t var_desc_length = var_descriptors.Length(); | 185 intptr_t var_desc_length = |
| 186 var_descriptors.IsNull() ? 0 : var_descriptors.Length(); |
| 186 String& var_name = String::Handle(); | 187 String& var_name = String::Handle(); |
| 187 for (intptr_t i = 0; i < var_desc_length; i++) { | 188 for (intptr_t i = 0; i < var_desc_length; i++) { |
| 188 var_name = var_descriptors.GetName(i); | 189 var_name = var_descriptors.GetName(i); |
| 189 intptr_t scope_id, begin_pos, end_pos; | 190 intptr_t scope_id, begin_pos, end_pos; |
| 190 var_descriptors.GetScopeInfo(i, &scope_id, &begin_pos, &end_pos); | 191 var_descriptors.GetScopeInfo(i, &scope_id, &begin_pos, &end_pos); |
| 191 intptr_t slot = var_descriptors.GetSlotIndex(i); | 192 intptr_t slot = var_descriptors.GetSlotIndex(i); |
| 192 OS::Print(" var %s scope %ld (valid %d-%d) offset %ld\n", | 193 OS::Print(" var %s scope %ld (valid %d-%d) offset %ld\n", |
| 193 var_name.ToCString(), scope_id, begin_pos, end_pos, slot); | 194 var_name.ToCString(), scope_id, begin_pos, end_pos, slot); |
| 194 } | 195 } |
| 195 OS::Print("}\n"); | 196 OS::Print("}\n"); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 kNoArgumentNames)); | 280 kNoArgumentNames)); |
| 280 if (result.IsUnhandledException()) { | 281 if (result.IsUnhandledException()) { |
| 281 // TODO(srdjan): implement proper exit from compiler. | 282 // TODO(srdjan): implement proper exit from compiler. |
| 282 UNIMPLEMENTED(); | 283 UNIMPLEMENTED(); |
| 283 } | 284 } |
| 284 return result.raw(); | 285 return result.raw(); |
| 285 } | 286 } |
| 286 | 287 |
| 287 | 288 |
| 288 } // namespace dart | 289 } // namespace dart |
| OLD | NEW |