| 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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 } | 290 } |
| 291 | 291 |
| 292 Thread* const thread = Thread::Current(); | 292 Thread* const thread = Thread::Current(); |
| 293 Isolate* const isolate = thread->isolate(); | 293 Isolate* const isolate = thread->isolate(); |
| 294 // We remember all the classes that are being compiled in these lists. This | 294 // We remember all the classes that are being compiled in these lists. This |
| 295 // also allows us to reset the marked_for_parsing state in case we see an | 295 // also allows us to reset the marked_for_parsing state in case we see an |
| 296 // error. | 296 // error. |
| 297 VMTagScope tagScope(thread, VMTag::kCompileClassTagId); | 297 VMTagScope tagScope(thread, VMTag::kCompileClassTagId); |
| 298 Class& parse_class = Class::Handle(isolate); | 298 Class& parse_class = Class::Handle(isolate); |
| 299 const GrowableObjectArray& parse_list = | 299 const GrowableObjectArray& parse_list = |
| 300 GrowableObjectArray::Handle(isolate, GrowableObjectArray::New(4)); | 300 GrowableObjectArray::Handle(thread->zone(), GrowableObjectArray::New(4)); |
| 301 const GrowableObjectArray& patch_list = | 301 const GrowableObjectArray& patch_list = |
| 302 GrowableObjectArray::Handle(isolate, GrowableObjectArray::New(4)); | 302 GrowableObjectArray::Handle(thread->zone(), GrowableObjectArray::New(4)); |
| 303 | 303 |
| 304 // Parse the class and all the interfaces it implements and super classes. | 304 // Parse the class and all the interfaces it implements and super classes. |
| 305 LongJumpScope jump; | 305 LongJumpScope jump; |
| 306 if (setjmp(*jump.Set()) == 0) { | 306 if (setjmp(*jump.Set()) == 0) { |
| 307 StackZone zone(thread); | 307 StackZone zone(thread); |
| 308 if (FLAG_trace_compiler) { | 308 if (FLAG_trace_compiler) { |
| 309 ISL_Print("Compiling Class %s '%s'\n", "", cls.ToCString()); | 309 ISL_Print("Compiling Class %s '%s'\n", "", cls.ToCString()); |
| 310 } | 310 } |
| 311 | 311 |
| 312 // Add the primary class which needs to be parsed to the parse list. | 312 // Add the primary class which needs to be parsed to the parse list. |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 bool optimized, | 388 bool optimized, |
| 389 intptr_t osr_id) { | 389 intptr_t osr_id) { |
| 390 const Function& function = parsed_function->function(); | 390 const Function& function = parsed_function->function(); |
| 391 if (optimized && !function.IsOptimizable()) { | 391 if (optimized && !function.IsOptimizable()) { |
| 392 return false; | 392 return false; |
| 393 } | 393 } |
| 394 bool is_compiled = false; | 394 bool is_compiled = false; |
| 395 Thread* const thread = Thread::Current(); | 395 Thread* const thread = Thread::Current(); |
| 396 Zone* const zone = thread->zone(); | 396 Zone* const zone = thread->zone(); |
| 397 Isolate* const isolate = thread->isolate(); | 397 Isolate* const isolate = thread->isolate(); |
| 398 CSTAT_TIMER_SCOPE(isolate, codegen_timer); | 398 CSTAT_TIMER_SCOPE(thread, codegen_timer); |
| 399 HANDLESCOPE(thread); | 399 HANDLESCOPE(thread); |
| 400 | 400 |
| 401 // We may reattempt compilation if the function needs to be assembled using | 401 // We may reattempt compilation if the function needs to be assembled using |
| 402 // far branches on ARM and MIPS. In the else branch of the setjmp call, | 402 // far branches on ARM and MIPS. In the else branch of the setjmp call, |
| 403 // done is set to false, and use_far_branches is set to true if there is a | 403 // done is set to false, and use_far_branches is set to true if there is a |
| 404 // longjmp from the ARM or MIPS assemblers. In all other paths through this | 404 // longjmp from the ARM or MIPS assemblers. In all other paths through this |
| 405 // while loop, done is set to true. use_far_branches is always false on ia32 | 405 // while loop, done is set to true. use_far_branches is always false on ia32 |
| 406 // and x64. | 406 // and x64. |
| 407 bool done = false; | 407 bool done = false; |
| 408 // volatile because the variable may be clobbered by a longjmp. | 408 // volatile because the variable may be clobbered by a longjmp. |
| 409 volatile bool use_far_branches = false; | 409 volatile bool use_far_branches = false; |
| 410 while (!done) { | 410 while (!done) { |
| 411 const intptr_t prev_deopt_id = isolate->deopt_id(); | 411 const intptr_t prev_deopt_id = isolate->deopt_id(); |
| 412 isolate->set_deopt_id(0); | 412 isolate->set_deopt_id(0); |
| 413 LongJumpScope jump; | 413 LongJumpScope jump; |
| 414 if (setjmp(*jump.Set()) == 0) { | 414 if (setjmp(*jump.Set()) == 0) { |
| 415 FlowGraph* flow_graph = NULL; | 415 FlowGraph* flow_graph = NULL; |
| 416 | 416 |
| 417 // Class hierarchy analysis is registered with the isolate in the | 417 // Class hierarchy analysis is registered with the isolate in the |
| 418 // constructor and unregisters itself upon destruction. | 418 // constructor and unregisters itself upon destruction. |
| 419 CHA cha(thread); | 419 CHA cha(thread); |
| 420 | 420 |
| 421 // TimerScope needs an isolate to be properly terminated in case of a | 421 // TimerScope needs an isolate to be properly terminated in case of a |
| 422 // LongJump. | 422 // LongJump. |
| 423 { | 423 { |
| 424 CSTAT_TIMER_SCOPE(isolate, graphbuilder_timer); | 424 CSTAT_TIMER_SCOPE(thread, graphbuilder_timer); |
| 425 ZoneGrowableArray<const ICData*>* ic_data_array = | 425 ZoneGrowableArray<const ICData*>* ic_data_array = |
| 426 new(zone) ZoneGrowableArray<const ICData*>(); | 426 new(zone) ZoneGrowableArray<const ICData*>(); |
| 427 if (optimized) { | 427 if (optimized) { |
| 428 // Extract type feedback before the graph is built, as the graph | 428 // Extract type feedback before the graph is built, as the graph |
| 429 // builder uses it to attach it to nodes. | 429 // builder uses it to attach it to nodes. |
| 430 ASSERT(function.deoptimization_counter() < | 430 ASSERT(function.deoptimization_counter() < |
| 431 FLAG_deoptimization_counter_threshold); | 431 FLAG_deoptimization_counter_threshold); |
| 432 function.RestoreICDataMap(ic_data_array); | 432 function.RestoreICDataMap(ic_data_array); |
| 433 if (FLAG_print_ic_data_map) { | 433 if (FLAG_print_ic_data_map) { |
| 434 for (intptr_t i = 0; i < ic_data_array->length(); i++) { | 434 for (intptr_t i = 0; i < ic_data_array->length(); i++) { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 460 } | 460 } |
| 461 | 461 |
| 462 BlockScheduler block_scheduler(flow_graph); | 462 BlockScheduler block_scheduler(flow_graph); |
| 463 const bool reorder_blocks = | 463 const bool reorder_blocks = |
| 464 FlowGraph::ShouldReorderBlocks(function, optimized); | 464 FlowGraph::ShouldReorderBlocks(function, optimized); |
| 465 if (reorder_blocks) { | 465 if (reorder_blocks) { |
| 466 block_scheduler.AssignEdgeWeights(); | 466 block_scheduler.AssignEdgeWeights(); |
| 467 } | 467 } |
| 468 | 468 |
| 469 if (optimized) { | 469 if (optimized) { |
| 470 CSTAT_TIMER_SCOPE(isolate, ssa_timer); | 470 CSTAT_TIMER_SCOPE(thread, ssa_timer); |
| 471 // Transform to SSA (virtual register 0 and no inlining arguments). | 471 // Transform to SSA (virtual register 0 and no inlining arguments). |
| 472 flow_graph->ComputeSSA(0, NULL); | 472 flow_graph->ComputeSSA(0, NULL); |
| 473 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 473 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 474 if (print_flow_graph) { | 474 if (print_flow_graph) { |
| 475 FlowGraphPrinter::PrintGraph("After SSA", flow_graph); | 475 FlowGraphPrinter::PrintGraph("After SSA", flow_graph); |
| 476 } | 476 } |
| 477 } | 477 } |
| 478 | 478 |
| 479 // Maps inline_id_to_function[inline_id] -> function. Top scope | 479 // Maps inline_id_to_function[inline_id] -> function. Top scope |
| 480 // function has inline_id 0. The map is populated by the inliner. | 480 // function has inline_id 0. The map is populated by the inliner. |
| 481 GrowableArray<const Function*> inline_id_to_function; | 481 GrowableArray<const Function*> inline_id_to_function; |
| 482 // For a given inlining-id(index) specifies the caller's inlining-id. | 482 // For a given inlining-id(index) specifies the caller's inlining-id. |
| 483 GrowableArray<intptr_t> caller_inline_id; | 483 GrowableArray<intptr_t> caller_inline_id; |
| 484 // Collect all instance fields that are loaded in the graph and | 484 // Collect all instance fields that are loaded in the graph and |
| 485 // have non-generic type feedback attached to them that can | 485 // have non-generic type feedback attached to them that can |
| 486 // potentially affect optimizations. | 486 // potentially affect optimizations. |
| 487 if (optimized) { | 487 if (optimized) { |
| 488 inline_id_to_function.Add(&function); | 488 inline_id_to_function.Add(&function); |
| 489 // Top scope function has no caller (-1). | 489 // Top scope function has no caller (-1). |
| 490 caller_inline_id.Add(-1); | 490 caller_inline_id.Add(-1); |
| 491 CSTAT_TIMER_SCOPE(isolate, graphoptimizer_timer); | 491 CSTAT_TIMER_SCOPE(thread, graphoptimizer_timer); |
| 492 | 492 |
| 493 FlowGraphOptimizer optimizer(flow_graph); | 493 FlowGraphOptimizer optimizer(flow_graph); |
| 494 if (Compiler::always_optimize()) { | 494 if (Compiler::always_optimize()) { |
| 495 optimizer.PopulateWithICData(); | 495 optimizer.PopulateWithICData(); |
| 496 } | 496 } |
| 497 optimizer.ApplyICData(); | 497 optimizer.ApplyICData(); |
| 498 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 498 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 499 | 499 |
| 500 // Optimize (a << b) & c patterns, merge operations. | 500 // Optimize (a << b) & c patterns, merge operations. |
| 501 // Run early in order to have more opportunity to optimize left shifts. | 501 // Run early in order to have more opportunity to optimize left shifts. |
| 502 optimizer.TryOptimizePatterns(); | 502 optimizer.TryOptimizePatterns(); |
| 503 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 503 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 504 | 504 |
| 505 FlowGraphInliner::SetInliningId(flow_graph, 0); | 505 FlowGraphInliner::SetInliningId(flow_graph, 0); |
| 506 | 506 |
| 507 // Inlining (mutates the flow graph) | 507 // Inlining (mutates the flow graph) |
| 508 if (FLAG_use_inlining) { | 508 if (FLAG_use_inlining) { |
| 509 CSTAT_TIMER_SCOPE(isolate, graphinliner_timer); | 509 CSTAT_TIMER_SCOPE(thread, graphinliner_timer); |
| 510 // Propagate types to create more inlining opportunities. | 510 // Propagate types to create more inlining opportunities. |
| 511 FlowGraphTypePropagator::Propagate(flow_graph); | 511 FlowGraphTypePropagator::Propagate(flow_graph); |
| 512 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 512 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 513 | 513 |
| 514 // Use propagated class-ids to create more inlining opportunities. | 514 // Use propagated class-ids to create more inlining opportunities. |
| 515 optimizer.ApplyClassIds(); | 515 optimizer.ApplyClassIds(); |
| 516 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 516 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 517 | 517 |
| 518 FlowGraphInliner inliner(flow_graph, | 518 FlowGraphInliner inliner(flow_graph, |
| 519 &inline_id_to_function, | 519 &inline_id_to_function, |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 } | 713 } |
| 714 } | 714 } |
| 715 | 715 |
| 716 ASSERT(inline_id_to_function.length() == caller_inline_id.length()); | 716 ASSERT(inline_id_to_function.length() == caller_inline_id.length()); |
| 717 Assembler assembler(use_far_branches); | 717 Assembler assembler(use_far_branches); |
| 718 FlowGraphCompiler graph_compiler(&assembler, flow_graph, | 718 FlowGraphCompiler graph_compiler(&assembler, flow_graph, |
| 719 *parsed_function, optimized, | 719 *parsed_function, optimized, |
| 720 inline_id_to_function, | 720 inline_id_to_function, |
| 721 caller_inline_id); | 721 caller_inline_id); |
| 722 { | 722 { |
| 723 CSTAT_TIMER_SCOPE(isolate, graphcompiler_timer); | 723 CSTAT_TIMER_SCOPE(thread, graphcompiler_timer); |
| 724 graph_compiler.CompileGraph(); | 724 graph_compiler.CompileGraph(); |
| 725 pipeline->FinalizeCompilation(); | 725 pipeline->FinalizeCompilation(); |
| 726 } | 726 } |
| 727 { | 727 { |
| 728 CSTAT_TIMER_SCOPE(isolate, codefinalizer_timer); | 728 CSTAT_TIMER_SCOPE(thread, codefinalizer_timer); |
| 729 // CreateDeoptInfo uses the object pool and needs to be done before | 729 // CreateDeoptInfo uses the object pool and needs to be done before |
| 730 // FinalizeCode. | 730 // FinalizeCode. |
| 731 const Array& deopt_info_array = | 731 const Array& deopt_info_array = |
| 732 Array::Handle(isolate, graph_compiler.CreateDeoptInfo(&assembler)); | 732 Array::Handle(zone, graph_compiler.CreateDeoptInfo(&assembler)); |
| 733 INC_STAT(isolate, total_code_size, | 733 INC_STAT(isolate, total_code_size, |
| 734 deopt_info_array.Length() * sizeof(uword)); | 734 deopt_info_array.Length() * sizeof(uword)); |
| 735 const Code& code = Code::Handle( | 735 const Code& code = Code::Handle( |
| 736 Code::FinalizeCode(function, &assembler, optimized)); | 736 Code::FinalizeCode(function, &assembler, optimized)); |
| 737 code.set_is_optimized(optimized); | 737 code.set_is_optimized(optimized); |
| 738 | 738 |
| 739 const Array& intervals = graph_compiler.inlined_code_intervals(); | 739 const Array& intervals = graph_compiler.inlined_code_intervals(); |
| 740 INC_STAT(isolate, total_code_size, | 740 INC_STAT(isolate, total_code_size, |
| 741 intervals.Length() * sizeof(uword)); | 741 intervals.Length() * sizeof(uword)); |
| 742 code.SetInlinedIntervals(intervals); | 742 code.SetInlinedIntervals(intervals); |
| 743 | 743 |
| 744 const Array& inlined_id_array = | 744 const Array& inlined_id_array = |
| 745 Array::Handle(isolate, graph_compiler.InliningIdToFunction()); | 745 Array::Handle(zone, graph_compiler.InliningIdToFunction()); |
| 746 INC_STAT(isolate, total_code_size, | 746 INC_STAT(isolate, total_code_size, |
| 747 inlined_id_array.Length() * sizeof(uword)); | 747 inlined_id_array.Length() * sizeof(uword)); |
| 748 code.SetInlinedIdToFunction(inlined_id_array); | 748 code.SetInlinedIdToFunction(inlined_id_array); |
| 749 | 749 |
| 750 const Array& caller_inlining_id_map_array = | 750 const Array& caller_inlining_id_map_array = |
| 751 Array::Handle(isolate, graph_compiler.CallerInliningIdMap()); | 751 Array::Handle(zone, graph_compiler.CallerInliningIdMap()); |
| 752 INC_STAT(isolate, total_code_size, | 752 INC_STAT(isolate, total_code_size, |
| 753 caller_inlining_id_map_array.Length() * sizeof(uword)); | 753 caller_inlining_id_map_array.Length() * sizeof(uword)); |
| 754 code.SetInlinedCallerIdMap(caller_inlining_id_map_array); | 754 code.SetInlinedCallerIdMap(caller_inlining_id_map_array); |
| 755 | 755 |
| 756 graph_compiler.FinalizePcDescriptors(code); | 756 graph_compiler.FinalizePcDescriptors(code); |
| 757 code.set_deopt_info_array(deopt_info_array); | 757 code.set_deopt_info_array(deopt_info_array); |
| 758 | 758 |
| 759 graph_compiler.FinalizeStackmaps(code); | 759 graph_compiler.FinalizeStackmaps(code); |
| 760 graph_compiler.FinalizeVarDescriptors(code); | 760 graph_compiler.FinalizeVarDescriptors(code); |
| 761 graph_compiler.FinalizeExceptionHandlers(code); | 761 graph_compiler.FinalizeExceptionHandlers(code); |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1017 // except if the function is marked as not optimizable. | 1017 // except if the function is marked as not optimizable. |
| 1018 ASSERT(!function.IsOptimizable() || | 1018 ASSERT(!function.IsOptimizable() || |
| 1019 !Compiler::always_optimize() || optimized); | 1019 !Compiler::always_optimize() || optimized); |
| 1020 ASSERT(Compiler::allow_recompilation() || !function.HasCode()); | 1020 ASSERT(Compiler::allow_recompilation() || !function.HasCode()); |
| 1021 LongJumpScope jump; | 1021 LongJumpScope jump; |
| 1022 if (setjmp(*jump.Set()) == 0) { | 1022 if (setjmp(*jump.Set()) == 0) { |
| 1023 Thread* const thread = Thread::Current(); | 1023 Thread* const thread = Thread::Current(); |
| 1024 Isolate* const isolate = thread->isolate(); | 1024 Isolate* const isolate = thread->isolate(); |
| 1025 StackZone stack_zone(thread); | 1025 StackZone stack_zone(thread); |
| 1026 Zone* const zone = stack_zone.GetZone(); | 1026 Zone* const zone = stack_zone.GetZone(); |
| 1027 TIMERSCOPE(isolate, time_compilation); | 1027 TIMERSCOPE(thread, time_compilation); |
| 1028 Timer per_compile_timer(FLAG_trace_compiler, "Compilation time"); | 1028 Timer per_compile_timer(FLAG_trace_compiler, "Compilation time"); |
| 1029 per_compile_timer.Start(); | 1029 per_compile_timer.Start(); |
| 1030 | 1030 |
| 1031 // Restore unoptimized code if needed. | 1031 // Restore unoptimized code if needed. |
| 1032 if (optimized) { | 1032 if (optimized) { |
| 1033 if (!Compiler::always_optimize()) { | 1033 if (!Compiler::always_optimize()) { |
| 1034 const Error& error = Error::Handle( | 1034 const Error& error = Error::Handle( |
| 1035 zone, Compiler::EnsureUnoptimizedCode(Thread::Current(), function)); | 1035 zone, Compiler::EnsureUnoptimizedCode(Thread::Current(), function)); |
| 1036 if (!error.IsNull()) { | 1036 if (!error.IsNull()) { |
| 1037 return error.raw(); | 1037 return error.raw(); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1113 } | 1113 } |
| 1114 UNREACHABLE(); | 1114 UNREACHABLE(); |
| 1115 return Error::null(); | 1115 return Error::null(); |
| 1116 } | 1116 } |
| 1117 | 1117 |
| 1118 | 1118 |
| 1119 RawError* Compiler::CompileFunction(Thread* thread, | 1119 RawError* Compiler::CompileFunction(Thread* thread, |
| 1120 const Function& function) { | 1120 const Function& function) { |
| 1121 Isolate* isolate = thread->isolate(); | 1121 Isolate* isolate = thread->isolate(); |
| 1122 VMTagScope tagScope(thread, VMTag::kCompileUnoptimizedTagId); | 1122 VMTagScope tagScope(thread, VMTag::kCompileUnoptimizedTagId); |
| 1123 TIMELINE_FUNCTION_COMPILATION_DURATION(isolate, "Function", function); | 1123 TIMELINE_FUNCTION_COMPILATION_DURATION(thread, "Function", function); |
| 1124 | 1124 |
| 1125 if (!isolate->compilation_allowed()) { | 1125 if (!isolate->compilation_allowed()) { |
| 1126 FATAL3("Precompilation missed function %s (%" Pd ", %s)\n", | 1126 FATAL3("Precompilation missed function %s (%" Pd ", %s)\n", |
| 1127 function.ToLibNamePrefixedQualifiedCString(), | 1127 function.ToLibNamePrefixedQualifiedCString(), |
| 1128 function.token_pos(), | 1128 function.token_pos(), |
| 1129 Function::KindToCString(function.kind())); | 1129 Function::KindToCString(function.kind())); |
| 1130 } | 1130 } |
| 1131 | 1131 |
| 1132 CompilationPipeline* pipeline = | 1132 CompilationPipeline* pipeline = |
| 1133 CompilationPipeline::New(thread->zone(), function); | 1133 CompilationPipeline::New(thread->zone(), function); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1166 if (FLAG_trace_compiler) { | 1166 if (FLAG_trace_compiler) { |
| 1167 ISL_Print("Ensure unoptimized code for %s\n", function.ToCString()); | 1167 ISL_Print("Ensure unoptimized code for %s\n", function.ToCString()); |
| 1168 } | 1168 } |
| 1169 return Error::null(); | 1169 return Error::null(); |
| 1170 } | 1170 } |
| 1171 | 1171 |
| 1172 | 1172 |
| 1173 RawError* Compiler::CompileOptimizedFunction(Thread* thread, | 1173 RawError* Compiler::CompileOptimizedFunction(Thread* thread, |
| 1174 const Function& function, | 1174 const Function& function, |
| 1175 intptr_t osr_id) { | 1175 intptr_t osr_id) { |
| 1176 Isolate* isolate = thread->isolate(); | |
| 1177 VMTagScope tagScope(thread, VMTag::kCompileOptimizedTagId); | 1176 VMTagScope tagScope(thread, VMTag::kCompileOptimizedTagId); |
| 1178 TIMELINE_FUNCTION_COMPILATION_DURATION(isolate, | 1177 TIMELINE_FUNCTION_COMPILATION_DURATION(thread, |
| 1179 "OptimizedFunction", function); | 1178 "OptimizedFunction", function); |
| 1180 | 1179 |
| 1181 CompilationPipeline* pipeline = | 1180 CompilationPipeline* pipeline = |
| 1182 CompilationPipeline::New(thread->zone(), function); | 1181 CompilationPipeline::New(thread->zone(), function); |
| 1183 return CompileFunctionHelper(pipeline, function, true, osr_id); | 1182 return CompileFunctionHelper(pipeline, function, true, osr_id); |
| 1184 } | 1183 } |
| 1185 | 1184 |
| 1186 | 1185 |
| 1187 // This is only used from unit tests. | 1186 // This is only used from unit tests. |
| 1188 RawError* Compiler::CompileParsedFunction( | 1187 RawError* Compiler::CompileParsedFunction( |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1349 } | 1348 } |
| 1350 // Invoke the function to evaluate the expression. | 1349 // Invoke the function to evaluate the expression. |
| 1351 const Object& result = PassiveObject::Handle( | 1350 const Object& result = PassiveObject::Handle( |
| 1352 DartEntry::InvokeFunction(initializer, Object::empty_array())); | 1351 DartEntry::InvokeFunction(initializer, Object::empty_array())); |
| 1353 return result.raw(); | 1352 return result.raw(); |
| 1354 } else { | 1353 } else { |
| 1355 Thread* const thread = Thread::Current(); | 1354 Thread* const thread = Thread::Current(); |
| 1356 Isolate* const isolate = thread->isolate(); | 1355 Isolate* const isolate = thread->isolate(); |
| 1357 StackZone zone(thread); | 1356 StackZone zone(thread); |
| 1358 const Error& error = | 1357 const Error& error = |
| 1359 Error::Handle(isolate, isolate->object_store()->sticky_error()); | 1358 Error::Handle(thread->zone(), isolate->object_store()->sticky_error()); |
| 1360 isolate->object_store()->clear_sticky_error(); | 1359 isolate->object_store()->clear_sticky_error(); |
| 1361 return error.raw(); | 1360 return error.raw(); |
| 1362 } | 1361 } |
| 1363 UNREACHABLE(); | 1362 UNREACHABLE(); |
| 1364 return Object::null(); | 1363 return Object::null(); |
| 1365 } | 1364 } |
| 1366 | 1365 |
| 1367 | 1366 |
| 1368 | 1367 |
| 1369 RawObject* Compiler::ExecuteOnce(SequenceNode* fragment) { | 1368 RawObject* Compiler::ExecuteOnce(SequenceNode* fragment) { |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1426 const Object& result = | 1425 const Object& result = |
| 1427 PassiveObject::Handle(isolate->object_store()->sticky_error()); | 1426 PassiveObject::Handle(isolate->object_store()->sticky_error()); |
| 1428 isolate->object_store()->clear_sticky_error(); | 1427 isolate->object_store()->clear_sticky_error(); |
| 1429 return result.raw(); | 1428 return result.raw(); |
| 1430 } | 1429 } |
| 1431 UNREACHABLE(); | 1430 UNREACHABLE(); |
| 1432 return Object::null(); | 1431 return Object::null(); |
| 1433 } | 1432 } |
| 1434 | 1433 |
| 1435 } // namespace dart | 1434 } // namespace dart |
| OLD | NEW |