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 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 | 367 |
368 | 368 |
369 void Precompiler::ProcessFunction(const Function& function) { | 369 void Precompiler::ProcessFunction(const Function& function) { |
370 if (!function.HasCode()) { | 370 if (!function.HasCode()) { |
371 function_count_++; | 371 function_count_++; |
372 | 372 |
373 if (FLAG_trace_precompiler) { | 373 if (FLAG_trace_precompiler) { |
374 THR_Print("Precompiling %" Pd " %s (%" Pd ", %s)\n", | 374 THR_Print("Precompiling %" Pd " %s (%" Pd ", %s)\n", |
375 function_count_, | 375 function_count_, |
376 function.ToLibNamePrefixedQualifiedCString(), | 376 function.ToLibNamePrefixedQualifiedCString(), |
377 function.token_pos(), | 377 function.token_pos().value(), |
378 Function::KindToCString(function.kind())); | 378 Function::KindToCString(function.kind())); |
379 } | 379 } |
380 | 380 |
381 ASSERT(!function.is_abstract()); | 381 ASSERT(!function.is_abstract()); |
382 ASSERT(!function.IsRedirectingFactory()); | 382 ASSERT(!function.IsRedirectingFactory()); |
383 | 383 |
384 error_ = Compiler::CompileFunction(thread_, function); | 384 error_ = Compiler::CompileFunction(thread_, function); |
385 if (!error_.IsNull()) { | 385 if (!error_.IsNull()) { |
386 Jump(error_); | 386 Jump(error_); |
387 } | 387 } |
388 } else { | 388 } else { |
389 if (FLAG_trace_precompiler) { | 389 if (FLAG_trace_precompiler) { |
390 // This function was compiled from somewhere other than Precompiler, | 390 // This function was compiled from somewhere other than Precompiler, |
391 // such as const constructors compiled by the parser. | 391 // such as const constructors compiled by the parser. |
392 THR_Print("Already has code: %s (%" Pd ", %s)\n", | 392 THR_Print("Already has code: %s (%" Pd ", %s)\n", |
393 function.ToLibNamePrefixedQualifiedCString(), | 393 function.ToLibNamePrefixedQualifiedCString(), |
394 function.token_pos(), | 394 function.token_pos().value(), |
395 Function::KindToCString(function.kind())); | 395 Function::KindToCString(function.kind())); |
396 } | 396 } |
397 } | 397 } |
398 | 398 |
399 ASSERT(function.HasCode()); | 399 ASSERT(function.HasCode()); |
400 AddCalleesOf(function); | 400 AddCalleesOf(function); |
401 } | 401 } |
402 | 402 |
403 | 403 |
404 void Precompiler::AddCalleesOf(const Function& function) { | 404 void Precompiler::AddCalleesOf(const Function& function) { |
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1204 cls = it.GetNextClass(); | 1204 cls = it.GetNextClass(); |
1205 if (cls.IsDynamicClass()) { | 1205 if (cls.IsDynamicClass()) { |
1206 continue; // class 'dynamic' is in the read-only VM isolate. | 1206 continue; // class 'dynamic' is in the read-only VM isolate. |
1207 } | 1207 } |
1208 cls.set_is_allocated(false); | 1208 cls.set_is_allocated(false); |
1209 } | 1209 } |
1210 } | 1210 } |
1211 } | 1211 } |
1212 | 1212 |
1213 } // namespace dart | 1213 } // namespace dart |
OLD | NEW |