| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 OS::Print(" %d : 0x%x '%s'\n", | 172 OS::Print(" %d : 0x%x '%s'\n", |
| 173 code.GetPointerOffsetAt(i), addr, obj.ToCString()); | 173 code.GetPointerOffsetAt(i), addr, obj.ToCString()); |
| 174 } | 174 } |
| 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); |
| 183 const LocalVarDescriptors& var_descriptors = |
| 184 LocalVarDescriptors::Handle(code.var_descriptors()); |
| 185 intptr_t var_desc_length = var_descriptors.Length(); |
| 186 String& var_name = String::Handle(); |
| 187 for (intptr_t i = 0; i < var_desc_length; i++) { |
| 188 var_name = var_descriptors.GetName(i); |
| 189 intptr_t scope_id, ignore; |
| 190 var_descriptors.GetScopeInfo(i, &scope_id, &ignore, &ignore); |
| 191 intptr_t slot = var_descriptors.GetSlotIndex(i); |
| 192 OS::Print(" var %s scope %ld offset %ld\n", |
| 193 var_name.ToCString(), scope_id, slot); |
| 194 } |
| 195 OS::Print("}\n"); |
| 182 OS::Print("Exception Handlers for function '%s' {\n", function_fullname); | 196 OS::Print("Exception Handlers for function '%s' {\n", function_fullname); |
| 183 const ExceptionHandlers& handlers = | 197 const ExceptionHandlers& handlers = |
| 184 ExceptionHandlers::Handle(code.exception_handlers()); | 198 ExceptionHandlers::Handle(code.exception_handlers()); |
| 185 OS::Print("%s", handlers.ToCString()); | 199 OS::Print("%s", handlers.ToCString()); |
| 186 OS::Print("}\n"); | 200 OS::Print("}\n"); |
| 187 } | 201 } |
| 188 } | 202 } |
| 189 | 203 |
| 190 | 204 |
| 191 void Compiler::CompileFunction(const Function& function) { | 205 void Compiler::CompileFunction(const Function& function) { |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 kNoArgumentNames)); | 279 kNoArgumentNames)); |
| 266 if (result.IsUnhandledException()) { | 280 if (result.IsUnhandledException()) { |
| 267 // TODO(srdjan): implement proper exit from compiler. | 281 // TODO(srdjan): implement proper exit from compiler. |
| 268 UNIMPLEMENTED(); | 282 UNIMPLEMENTED(); |
| 269 } | 283 } |
| 270 return result.raw(); | 284 return result.raw(); |
| 271 } | 285 } |
| 272 | 286 |
| 273 | 287 |
| 274 } // namespace dart | 288 } // namespace dart |
| OLD | NEW |