| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 | 158 |
| 159 | 159 |
| 160 // Compile a function. Should call only if the function has not been compiled. | 160 // Compile a function. Should call only if the function has not been compiled. |
| 161 // Arg0: function object. | 161 // Arg0: function object. |
| 162 DEFINE_RUNTIME_ENTRY(CompileFunction, 1) { | 162 DEFINE_RUNTIME_ENTRY(CompileFunction, 1) { |
| 163 const Function& function = Function::CheckedHandle(arguments.ArgAt(0)); | 163 const Function& function = Function::CheckedHandle(arguments.ArgAt(0)); |
| 164 ASSERT(!function.HasCode()); | 164 ASSERT(!function.HasCode()); |
| 165 const Error& error = | 165 const Error& error = |
| 166 Error::Handle(Compiler::CompileFunction(thread, function)); | 166 Error::Handle(Compiler::CompileFunction(thread, function)); |
| 167 if (!error.IsNull()) { | 167 if (!error.IsNull()) { |
| 168 if (error.IsLanguageError()) { |
| 169 Exceptions::ThrowCompileTimeError(LanguageError::Cast(error)); |
| 170 UNREACHABLE(); |
| 171 } |
| 168 Exceptions::PropagateError(error); | 172 Exceptions::PropagateError(error); |
| 169 } | 173 } |
| 170 } | 174 } |
| 171 | 175 |
| 172 | 176 |
| 173 bool Compiler::CanOptimizeFunction(Thread* thread, const Function& function) { | 177 bool Compiler::CanOptimizeFunction(Thread* thread, const Function& function) { |
| 174 if (FLAG_support_debugger) { | 178 if (FLAG_support_debugger) { |
| 175 Isolate* isolate = thread->isolate(); | 179 Isolate* isolate = thread->isolate(); |
| 176 if (isolate->debugger()->IsStepping() || | 180 if (isolate->debugger()->IsStepping() || |
| 177 isolate->debugger()->HasBreakpoint(function, thread->zone())) { | 181 isolate->debugger()->HasBreakpoint(function, thread->zone())) { |
| (...skipping 1992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2170 | 2174 |
| 2171 | 2175 |
| 2172 bool BackgroundCompiler::IsDisabled() { | 2176 bool BackgroundCompiler::IsDisabled() { |
| 2173 UNREACHABLE(); | 2177 UNREACHABLE(); |
| 2174 return true; | 2178 return true; |
| 2175 } | 2179 } |
| 2176 | 2180 |
| 2177 #endif // DART_PRECOMPILED_RUNTIME | 2181 #endif // DART_PRECOMPILED_RUNTIME |
| 2178 | 2182 |
| 2179 } // namespace dart | 2183 } // namespace dart |
| OLD | NEW |