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 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1102 function.raw()); | 1102 function.raw()); |
1103 } | 1103 } |
1104 } | 1104 } |
1105 ) | 1105 ) |
1106 | 1106 |
1107 static RawError* CompileFunctionHelper(CompilationPipeline* pipeline, | 1107 static RawError* CompileFunctionHelper(CompilationPipeline* pipeline, |
1108 const Function& function, | 1108 const Function& function, |
1109 bool optimized, | 1109 bool optimized, |
1110 intptr_t osr_id) { | 1110 intptr_t osr_id) { |
1111 ASSERT(!FLAG_precompiled_mode); | 1111 ASSERT(!FLAG_precompiled_mode); |
1112 ASSERT(!optimized || function.was_compiled()); | |
1112 LongJumpScope jump; | 1113 LongJumpScope jump; |
1113 if (setjmp(*jump.Set()) == 0) { | 1114 if (setjmp(*jump.Set()) == 0) { |
1114 Thread* const thread = Thread::Current(); | 1115 Thread* const thread = Thread::Current(); |
1115 Isolate* const isolate = thread->isolate(); | 1116 Isolate* const isolate = thread->isolate(); |
1116 StackZone stack_zone(thread); | 1117 StackZone stack_zone(thread); |
1117 Zone* const zone = stack_zone.GetZone(); | 1118 Zone* const zone = stack_zone.GetZone(); |
1118 const bool trace_compiler = | 1119 const bool trace_compiler = |
1119 FLAG_trace_compiler || | 1120 FLAG_trace_compiler || |
1120 (FLAG_trace_optimizing_compiler && optimized); | 1121 (FLAG_trace_optimizing_compiler && optimized); |
1121 Timer per_compile_timer(trace_compiler, "Compilation time"); | 1122 Timer per_compile_timer(trace_compiler, "Compilation time"); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1158 if (isolate->IsTopLevelParsing() || | 1159 if (isolate->IsTopLevelParsing() || |
1159 (loading_invalidation_gen_at_start != | 1160 (loading_invalidation_gen_at_start != |
1160 isolate->loading_invalidation_gen())) { | 1161 isolate->loading_invalidation_gen())) { |
1161 // Loading occured while parsing. We need to abort here because state | 1162 // Loading occured while parsing. We need to abort here because state |
1162 // changed while compiling. | 1163 // changed while compiling. |
1163 Compiler::AbortBackgroundCompilation(Thread::kNoDeoptId); | 1164 Compiler::AbortBackgroundCompilation(Thread::kNoDeoptId); |
1164 } | 1165 } |
1165 } | 1166 } |
1166 | 1167 |
1167 const bool success = helper.Compile(pipeline); | 1168 const bool success = helper.Compile(pipeline); |
1168 if (!success) { | 1169 if (success) { |
1170 function.set_was_compiled(true); | |
siva
2016/04/05 20:20:42
Maybe clearly if you did
if (!optimized) {
funct
srdjan
2016/04/05 20:31:19
Done.
| |
1171 } else { | |
1169 if (optimized) { | 1172 if (optimized) { |
1170 if (Compiler::IsBackgroundCompilation()) { | 1173 if (Compiler::IsBackgroundCompilation()) { |
1171 // Try again later, background compilation may abort because of | 1174 // Try again later, background compilation may abort because of |
1172 // state change during compilation. | 1175 // state change during compilation. |
1173 if (FLAG_trace_compiler) { | 1176 if (FLAG_trace_compiler) { |
1174 THR_Print("Aborted background compilation: %s\n", | 1177 THR_Print("Aborted background compilation: %s\n", |
1175 function.ToFullyQualifiedCString()); | 1178 function.ToFullyQualifiedCString()); |
1176 } | 1179 } |
1177 return Error::null(); | 1180 return Error::null(); |
1178 } | 1181 } |
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1914 } | 1917 } |
1915 | 1918 |
1916 | 1919 |
1917 void BackgroundCompiler::EnsureInit(Thread* thread) { | 1920 void BackgroundCompiler::EnsureInit(Thread* thread) { |
1918 UNREACHABLE(); | 1921 UNREACHABLE(); |
1919 } | 1922 } |
1920 | 1923 |
1921 #endif // DART_PRECOMPILED_RUNTIME | 1924 #endif // DART_PRECOMPILED_RUNTIME |
1922 | 1925 |
1923 } // namespace dart | 1926 } // namespace dart |
OLD | NEW |