| 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 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 StackZone zone(isolate); | 741 StackZone zone(isolate); |
| 742 LongJumpScope jump; | 742 LongJumpScope jump; |
| 743 // Make sure unoptimized code is not collected while we are compiling. | 743 // Make sure unoptimized code is not collected while we are compiling. |
| 744 const Code& unoptimized_code = Code::ZoneHandle(function.unoptimized_code()); | 744 const Code& unoptimized_code = Code::ZoneHandle(function.unoptimized_code()); |
| 745 // Skips parsing if we need to only install unoptimized code. | 745 // Skips parsing if we need to only install unoptimized code. |
| 746 if (!optimized && !unoptimized_code.IsNull()) { | 746 if (!optimized && !unoptimized_code.IsNull()) { |
| 747 InstallUnoptimizedCode(function); | 747 InstallUnoptimizedCode(function); |
| 748 return Error::null(); | 748 return Error::null(); |
| 749 } | 749 } |
| 750 if (setjmp(*jump.Set()) == 0) { | 750 if (setjmp(*jump.Set()) == 0) { |
| 751 TIMERSCOPE(time_compilation); | 751 TIMERSCOPE(isolate, time_compilation); |
| 752 Timer per_compile_timer(FLAG_trace_compiler, "Compilation time"); | 752 Timer per_compile_timer(FLAG_trace_compiler, "Compilation time"); |
| 753 per_compile_timer.Start(); | 753 per_compile_timer.Start(); |
| 754 ParsedFunction* parsed_function = | 754 ParsedFunction* parsed_function = |
| 755 new ParsedFunction(Function::ZoneHandle(function.raw())); | 755 new ParsedFunction(Function::ZoneHandle(function.raw())); |
| 756 if (FLAG_trace_compiler) { | 756 if (FLAG_trace_compiler) { |
| 757 OS::Print("Compiling %s%sfunction: '%s' @ token %" Pd ", size %" Pd "\n", | 757 OS::Print("Compiling %s%sfunction: '%s' @ token %" Pd ", size %" Pd "\n", |
| 758 (osr_id == Isolate::kNoDeoptId ? "" : "osr "), | 758 (osr_id == Isolate::kNoDeoptId ? "" : "osr "), |
| 759 (optimized ? "optimized " : ""), | 759 (optimized ? "optimized " : ""), |
| 760 function.ToFullyQualifiedCString(), | 760 function.ToFullyQualifiedCString(), |
| 761 function.token_pos(), | 761 function.token_pos(), |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 945 const Object& result = | 945 const Object& result = |
| 946 Object::Handle(isolate->object_store()->sticky_error()); | 946 Object::Handle(isolate->object_store()->sticky_error()); |
| 947 isolate->object_store()->clear_sticky_error(); | 947 isolate->object_store()->clear_sticky_error(); |
| 948 return result.raw(); | 948 return result.raw(); |
| 949 } | 949 } |
| 950 UNREACHABLE(); | 950 UNREACHABLE(); |
| 951 return Object::null(); | 951 return Object::null(); |
| 952 } | 952 } |
| 953 | 953 |
| 954 } // namespace dart | 954 } // namespace dart |
| OLD | NEW |