| 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 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 | 727 |
| 728 | 728 |
| 729 static RawError* CompileFunctionHelper(const Function& function, | 729 static RawError* CompileFunctionHelper(const Function& function, |
| 730 bool optimized, | 730 bool optimized, |
| 731 intptr_t osr_id) { | 731 intptr_t osr_id) { |
| 732 Isolate* isolate = Isolate::Current(); | 732 Isolate* isolate = Isolate::Current(); |
| 733 StackZone zone(isolate); | 733 StackZone zone(isolate); |
| 734 LongJump* base = isolate->long_jump_base(); | 734 LongJump* base = isolate->long_jump_base(); |
| 735 LongJump jump; | 735 LongJump jump; |
| 736 isolate->set_long_jump_base(&jump); | 736 isolate->set_long_jump_base(&jump); |
| 737 // Make sure unoptimized code is not collected while we are compiling. |
| 738 const Code& unoptimized_code = Code::ZoneHandle(function.unoptimized_code()); |
| 737 // Skips parsing if we need to only install unoptimized code. | 739 // Skips parsing if we need to only install unoptimized code. |
| 738 if (!optimized && !Code::Handle(function.unoptimized_code()).IsNull()) { | 740 if (!optimized && !unoptimized_code.IsNull()) { |
| 739 InstallUnoptimizedCode(function); | 741 InstallUnoptimizedCode(function); |
| 740 isolate->set_long_jump_base(base); | 742 isolate->set_long_jump_base(base); |
| 741 return Error::null(); | 743 return Error::null(); |
| 742 } | 744 } |
| 743 if (setjmp(*jump.Set()) == 0) { | 745 if (setjmp(*jump.Set()) == 0) { |
| 744 TIMERSCOPE(time_compilation); | 746 TIMERSCOPE(time_compilation); |
| 745 Timer per_compile_timer(FLAG_trace_compiler, "Compilation time"); | 747 Timer per_compile_timer(FLAG_trace_compiler, "Compilation time"); |
| 746 per_compile_timer.Start(); | 748 per_compile_timer.Start(); |
| 747 ParsedFunction* parsed_function = | 749 ParsedFunction* parsed_function = |
| 748 new ParsedFunction(Function::ZoneHandle(function.raw())); | 750 new ParsedFunction(Function::ZoneHandle(function.raw())); |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 946 Object::Handle(isolate->object_store()->sticky_error()); | 948 Object::Handle(isolate->object_store()->sticky_error()); |
| 947 isolate->object_store()->clear_sticky_error(); | 949 isolate->object_store()->clear_sticky_error(); |
| 948 isolate->set_long_jump_base(base); | 950 isolate->set_long_jump_base(base); |
| 949 return result.raw(); | 951 return result.raw(); |
| 950 } | 952 } |
| 951 UNREACHABLE(); | 953 UNREACHABLE(); |
| 952 return Object::null(); | 954 return Object::null(); |
| 953 } | 955 } |
| 954 | 956 |
| 955 } // namespace dart | 957 } // namespace dart |
| OLD | NEW |