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 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
969 intptr_t osr_id) { | 969 intptr_t osr_id) { |
970 LongJumpScope jump; | 970 LongJumpScope jump; |
971 if (setjmp(*jump.Set()) == 0) { | 971 if (setjmp(*jump.Set()) == 0) { |
972 Thread* const thread = Thread::Current(); | 972 Thread* const thread = Thread::Current(); |
973 Isolate* const isolate = thread->isolate(); | 973 Isolate* const isolate = thread->isolate(); |
974 StackZone stack_zone(isolate); | 974 StackZone stack_zone(isolate); |
975 Zone* const zone = stack_zone.GetZone(); | 975 Zone* const zone = stack_zone.GetZone(); |
976 TIMERSCOPE(isolate, time_compilation); | 976 TIMERSCOPE(isolate, time_compilation); |
977 Timer per_compile_timer(FLAG_trace_compiler, "Compilation time"); | 977 Timer per_compile_timer(FLAG_trace_compiler, "Compilation time"); |
978 per_compile_timer.Start(); | 978 per_compile_timer.Start(); |
| 979 |
| 980 // Restore unoptimized code if needed. |
| 981 if (optimized) { |
| 982 Compiler::EnsureUnoptimizedCode(Thread::Current(), function); |
| 983 } |
| 984 |
979 ParsedFunction* parsed_function = new(zone) ParsedFunction( | 985 ParsedFunction* parsed_function = new(zone) ParsedFunction( |
980 thread, Function::ZoneHandle(zone, function.raw())); | 986 thread, Function::ZoneHandle(zone, function.raw())); |
981 if (FLAG_trace_compiler) { | 987 if (FLAG_trace_compiler) { |
982 ISL_Print("Compiling %s%sfunction: '%s' @ token %" Pd ", size %" Pd "\n", | 988 ISL_Print("Compiling %s%sfunction: '%s' @ token %" Pd ", size %" Pd "\n", |
983 (osr_id == Isolate::kNoDeoptId ? "" : "osr "), | 989 (osr_id == Isolate::kNoDeoptId ? "" : "osr "), |
984 (optimized ? "optimized " : ""), | 990 (optimized ? "optimized " : ""), |
985 function.ToFullyQualifiedCString(), | 991 function.ToFullyQualifiedCString(), |
986 function.token_pos(), | 992 function.token_pos(), |
987 (function.end_token_pos() - function.token_pos())); | 993 (function.end_token_pos() - function.token_pos())); |
988 } | 994 } |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1269 const Object& result = | 1275 const Object& result = |
1270 PassiveObject::Handle(isolate->object_store()->sticky_error()); | 1276 PassiveObject::Handle(isolate->object_store()->sticky_error()); |
1271 isolate->object_store()->clear_sticky_error(); | 1277 isolate->object_store()->clear_sticky_error(); |
1272 return result.raw(); | 1278 return result.raw(); |
1273 } | 1279 } |
1274 UNREACHABLE(); | 1280 UNREACHABLE(); |
1275 return Object::null(); | 1281 return Object::null(); |
1276 } | 1282 } |
1277 | 1283 |
1278 } // namespace dart | 1284 } // namespace dart |
OLD | NEW |