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 #include "vm/ast_printer.h" | 8 #include "vm/ast_printer.h" |
9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
10 #include "vm/code_patcher.h" | 10 #include "vm/code_patcher.h" |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 isolate); | 219 isolate); |
220 graph_compiler.CompileGraph(); | 220 graph_compiler.CompileGraph(); |
221 } | 221 } |
222 { | 222 { |
223 TimerScope timer(FLAG_compiler_stats, | 223 TimerScope timer(FLAG_compiler_stats, |
224 &CompilerStats::codefinalizer_timer, | 224 &CompilerStats::codefinalizer_timer, |
225 isolate); | 225 isolate); |
226 const Function& function = parsed_function.function(); | 226 const Function& function = parsed_function.function(); |
227 const Code& code = Code::Handle(Code::FinalizeCode(function, &assembler)); | 227 const Code& code = Code::Handle(Code::FinalizeCode(function, &assembler)); |
228 code.set_is_optimized(optimized); | 228 code.set_is_optimized(optimized); |
229 if (optimized && use_ssa) { | |
230 code.set_spill_slot_count(graph_compiler.StackSize()); | |
231 } | |
232 graph_compiler.FinalizePcDescriptors(code); | 229 graph_compiler.FinalizePcDescriptors(code); |
233 graph_compiler.FinalizeDeoptInfo(code); | 230 graph_compiler.FinalizeDeoptInfo(code); |
234 graph_compiler.FinalizeStackmaps(code); | 231 graph_compiler.FinalizeStackmaps(code); |
235 graph_compiler.FinalizeVarDescriptors(code); | 232 graph_compiler.FinalizeVarDescriptors(code); |
236 graph_compiler.FinalizeExceptionHandlers(code); | 233 graph_compiler.FinalizeExceptionHandlers(code); |
237 graph_compiler.FinalizeComments(code); | 234 graph_compiler.FinalizeComments(code); |
238 if (optimized) { | 235 if (optimized) { |
239 function.SetCode(code); | 236 function.SetCode(code); |
240 CodePatcher::PatchEntry(Code::Handle(function.unoptimized_code())); | 237 CodePatcher::PatchEntry(Code::Handle(function.unoptimized_code())); |
241 if (FLAG_trace_compiler) { | 238 if (FLAG_trace_compiler) { |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 result = isolate->object_store()->sticky_error(); | 538 result = isolate->object_store()->sticky_error(); |
542 isolate->object_store()->clear_sticky_error(); | 539 isolate->object_store()->clear_sticky_error(); |
543 isolate->set_long_jump_base(base); | 540 isolate->set_long_jump_base(base); |
544 return result.raw(); | 541 return result.raw(); |
545 } | 542 } |
546 UNREACHABLE(); | 543 UNREACHABLE(); |
547 return Object::null(); | 544 return Object::null(); |
548 } | 545 } |
549 | 546 |
550 } // namespace dart | 547 } // namespace dart |
OLD | NEW |