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 1393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1404 function.ToFullyQualifiedCString(), | 1404 function.ToFullyQualifiedCString(), |
1405 function.token_pos().ToCString(), | 1405 function.token_pos().ToCString(), |
1406 token_size); | 1406 token_size); |
1407 } | 1407 } |
1408 ParsedFunction* parsed_function = new(zone) ParsedFunction( | 1408 ParsedFunction* parsed_function = new(zone) ParsedFunction( |
1409 thread, Function::ZoneHandle(zone, function.raw())); | 1409 thread, Function::ZoneHandle(zone, function.raw())); |
1410 pipeline->ParseFunction(parsed_function); | 1410 pipeline->ParseFunction(parsed_function); |
1411 // For now we just walk thru the AST nodes and in DEBUG mode we print | 1411 // For now we just walk thru the AST nodes and in DEBUG mode we print |
1412 // them otherwise just skip through them, this will be need to be | 1412 // them otherwise just skip through them, this will be need to be |
1413 // wired to generate the IR format. | 1413 // wired to generate the IR format. |
| 1414 #if !defined(PRODUCT) |
1414 #if defined(DEBUG) | 1415 #if defined(DEBUG) |
1415 AstPrinter ast_printer(true); | 1416 AstPrinter ast_printer(true); |
1416 #else | 1417 #else |
1417 AstPrinter ast_printer(false); | 1418 AstPrinter ast_printer(false); |
1418 #endif // defined(DEBUG). | 1419 #endif // defined(DEBUG). |
1419 ast_printer.PrintFunctionNodes(*parsed_function); | 1420 ast_printer.PrintFunctionNodes(*parsed_function); |
| 1421 #endif // !defined(PRODUCT). |
1420 return Error::null(); | 1422 return Error::null(); |
1421 } else { | 1423 } else { |
1422 Thread* const thread = Thread::Current(); | 1424 Thread* const thread = Thread::Current(); |
1423 StackZone stack_zone(thread); | 1425 StackZone stack_zone(thread); |
1424 Error& error = Error::Handle(); | 1426 Error& error = Error::Handle(); |
1425 // We got an error during compilation or it is a bailout from background | 1427 // We got an error during compilation or it is a bailout from background |
1426 // compilation (e.g., during parsing with EnsureIsFinalized). | 1428 // compilation (e.g., during parsing with EnsureIsFinalized). |
1427 error = thread->sticky_error(); | 1429 error = thread->sticky_error(); |
1428 thread->clear_sticky_error(); | 1430 thread->clear_sticky_error(); |
1429 // Unoptimized compilation or precompilation may encounter compile-time | 1431 // Unoptimized compilation or precompilation may encounter compile-time |
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2309 | 2311 |
2310 | 2312 |
2311 bool BackgroundCompiler::IsDisabled() { | 2313 bool BackgroundCompiler::IsDisabled() { |
2312 UNREACHABLE(); | 2314 UNREACHABLE(); |
2313 return true; | 2315 return true; |
2314 } | 2316 } |
2315 | 2317 |
2316 #endif // DART_PRECOMPILED_RUNTIME | 2318 #endif // DART_PRECOMPILED_RUNTIME |
2317 | 2319 |
2318 } // namespace dart | 2320 } // namespace dart |
OLD | NEW |