| 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 1426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1437 } | 1437 } |
| 1438 return Error::null(); | 1438 return Error::null(); |
| 1439 } | 1439 } |
| 1440 | 1440 |
| 1441 | 1441 |
| 1442 RawError* Compiler::CompileOptimizedFunction(Thread* thread, | 1442 RawError* Compiler::CompileOptimizedFunction(Thread* thread, |
| 1443 const Function& function, | 1443 const Function& function, |
| 1444 intptr_t osr_id) { | 1444 intptr_t osr_id) { |
| 1445 NOT_IN_PRODUCT( | 1445 NOT_IN_PRODUCT( |
| 1446 VMTagScope tagScope(thread, VMTag::kCompileOptimizedTagId); | 1446 VMTagScope tagScope(thread, VMTag::kCompileOptimizedTagId); |
| 1447 const char* event_name = IsBackgroundCompilation() | 1447 const char* event_name; |
| 1448 ? "BackgroundCompileOptimizedFunction" | 1448 if (osr_id != kNoOSRDeoptId) { |
| 1449 : "CompileOptimizedFunction"; | 1449 event_name = "CompileFunctionOptimizedOSR"; |
| 1450 } else if (IsBackgroundCompilation()) { |
| 1451 event_name = "CompileFunctionOptimizedBackground"; |
| 1452 } else { |
| 1453 event_name = "CompileFunctionOptimized"; |
| 1454 } |
| 1450 TIMELINE_FUNCTION_COMPILATION_DURATION(thread, event_name, function); | 1455 TIMELINE_FUNCTION_COMPILATION_DURATION(thread, event_name, function); |
| 1451 ) // !PRODUCT | 1456 ) // !PRODUCT |
| 1452 | 1457 |
| 1453 // Optimization must happen in non-mutator/Dart thread if background | 1458 // Optimization must happen in non-mutator/Dart thread if background |
| 1454 // compilation is on. OSR compilation still occurs in the main thread. | 1459 // compilation is on. OSR compilation still occurs in the main thread. |
| 1455 ASSERT((osr_id != kNoOSRDeoptId) || !FLAG_background_compilation || | 1460 ASSERT((osr_id != kNoOSRDeoptId) || !FLAG_background_compilation || |
| 1456 !thread->IsMutatorThread()); | 1461 !thread->IsMutatorThread()); |
| 1457 CompilationPipeline* pipeline = | 1462 CompilationPipeline* pipeline = |
| 1458 CompilationPipeline::New(thread->zone(), function); | 1463 CompilationPipeline::New(thread->zone(), function); |
| 1459 return CompileFunctionHelper(pipeline, | 1464 return CompileFunctionHelper(pipeline, |
| (...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2103 } | 2108 } |
| 2104 | 2109 |
| 2105 | 2110 |
| 2106 void BackgroundCompiler::EnsureInit(Thread* thread) { | 2111 void BackgroundCompiler::EnsureInit(Thread* thread) { |
| 2107 UNREACHABLE(); | 2112 UNREACHABLE(); |
| 2108 } | 2113 } |
| 2109 | 2114 |
| 2110 #endif // DART_PRECOMPILED_RUNTIME | 2115 #endif // DART_PRECOMPILED_RUNTIME |
| 2111 | 2116 |
| 2112 } // namespace dart | 2117 } // namespace dart |
| OLD | NEW |