OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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/precompiler.h" | 5 #include "vm/precompiler.h" |
6 | 6 |
7 #include "vm/cha.h" | 7 #include "vm/cha.h" |
8 #include "vm/code_patcher.h" | 8 #include "vm/code_patcher.h" |
9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
10 #include "vm/hash_table.h" | 10 #include "vm/hash_table.h" |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 CheckForNewDynamicFunctions(); | 377 CheckForNewDynamicFunctions(); |
378 } | 378 } |
379 } | 379 } |
380 | 380 |
381 | 381 |
382 void Precompiler::ProcessFunction(const Function& function) { | 382 void Precompiler::ProcessFunction(const Function& function) { |
383 if (!function.HasCode()) { | 383 if (!function.HasCode()) { |
384 function_count_++; | 384 function_count_++; |
385 | 385 |
386 if (FLAG_trace_precompiler) { | 386 if (FLAG_trace_precompiler) { |
387 THR_Print("Precompiling %" Pd " %s (%" Pd ", %s)\n", | 387 THR_Print("Precompiling %" Pd " %s (%s, %s)\n", |
388 function_count_, | 388 function_count_, |
389 function.ToLibNamePrefixedQualifiedCString(), | 389 function.ToLibNamePrefixedQualifiedCString(), |
390 function.token_pos(), | 390 function.token_pos().ToCString(), |
391 Function::KindToCString(function.kind())); | 391 Function::KindToCString(function.kind())); |
392 } | 392 } |
393 | 393 |
394 ASSERT(!function.is_abstract()); | 394 ASSERT(!function.is_abstract()); |
395 ASSERT(!function.IsRedirectingFactory()); | 395 ASSERT(!function.IsRedirectingFactory()); |
396 | 396 |
397 error_ = Compiler::CompileFunction(thread_, function); | 397 error_ = Compiler::CompileFunction(thread_, function); |
398 if (!error_.IsNull()) { | 398 if (!error_.IsNull()) { |
399 Jump(error_); | 399 Jump(error_); |
400 } | 400 } |
401 } else { | 401 } else { |
402 if (FLAG_trace_precompiler) { | 402 if (FLAG_trace_precompiler) { |
403 // This function was compiled from somewhere other than Precompiler, | 403 // This function was compiled from somewhere other than Precompiler, |
404 // such as const constructors compiled by the parser. | 404 // such as const constructors compiled by the parser. |
405 THR_Print("Already has code: %s (%" Pd ", %s)\n", | 405 THR_Print("Already has code: %s (%s, %s)\n", |
406 function.ToLibNamePrefixedQualifiedCString(), | 406 function.ToLibNamePrefixedQualifiedCString(), |
407 function.token_pos(), | 407 function.token_pos().ToCString(), |
408 Function::KindToCString(function.kind())); | 408 Function::KindToCString(function.kind())); |
409 } | 409 } |
410 } | 410 } |
411 | 411 |
412 ASSERT(function.HasCode()); | 412 ASSERT(function.HasCode()); |
413 AddCalleesOf(function); | 413 AddCalleesOf(function); |
414 } | 414 } |
415 | 415 |
416 | 416 |
417 void Precompiler::AddCalleesOf(const Function& function) { | 417 void Precompiler::AddCalleesOf(const Function& function) { |
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1266 cls = it.GetNextClass(); | 1266 cls = it.GetNextClass(); |
1267 if (cls.IsDynamicClass()) { | 1267 if (cls.IsDynamicClass()) { |
1268 continue; // class 'dynamic' is in the read-only VM isolate. | 1268 continue; // class 'dynamic' is in the read-only VM isolate. |
1269 } | 1269 } |
1270 cls.set_is_allocated(false); | 1270 cls.set_is_allocated(false); |
1271 } | 1271 } |
1272 } | 1272 } |
1273 } | 1273 } |
1274 | 1274 |
1275 } // namespace dart | 1275 } // namespace dart |
OLD | NEW |