OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/globals.h" // Needed here to get TARGET_ARCH_XXX. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_XXX. |
6 | 6 |
7 #include "vm/flow_graph_compiler.h" | 7 #include "vm/flow_graph_compiler.h" |
8 | 8 |
9 #include "vm/bit_vector.h" | 9 #include "vm/bit_vector.h" |
10 #include "vm/cha.h" | 10 #include "vm/cha.h" |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 #if defined(DEBUG) && !defined(TARGET_ARCH_DBC) | 529 #if defined(DEBUG) && !defined(TARGET_ARCH_DBC) |
530 if (!is_optimizing()) { | 530 if (!is_optimizing()) { |
531 FrameStateClear(); | 531 FrameStateClear(); |
532 } | 532 } |
533 #endif | 533 #endif |
534 | 534 |
535 LoopInfoComment(assembler(), *entry, *loop_headers); | 535 LoopInfoComment(assembler(), *entry, *loop_headers); |
536 | 536 |
537 entry->set_offset(assembler()->CodeSize()); | 537 entry->set_offset(assembler()->CodeSize()); |
538 BeginCodeSourceRange(); | 538 BeginCodeSourceRange(); |
| 539 ASSERT(pending_deoptimization_env_ == NULL); |
| 540 pending_deoptimization_env_ = entry->env(); |
539 entry->EmitNativeCode(this); | 541 entry->EmitNativeCode(this); |
| 542 pending_deoptimization_env_ = NULL; |
540 EndCodeSourceRange(entry->token_pos()); | 543 EndCodeSourceRange(entry->token_pos()); |
541 // Compile all successors until an exit, branch, or a block entry. | 544 // Compile all successors until an exit, branch, or a block entry. |
542 for (ForwardInstructionIterator it(entry); !it.Done(); it.Advance()) { | 545 for (ForwardInstructionIterator it(entry); !it.Done(); it.Advance()) { |
543 Instruction* instr = it.Current(); | 546 Instruction* instr = it.Current(); |
544 // Compose intervals. | 547 // Compose intervals. |
545 if (instr->has_inlining_id() && is_optimizing()) { | 548 if (instr->has_inlining_id() && is_optimizing()) { |
546 if (prev_inlining_id != instr->inlining_id()) { | 549 if (prev_inlining_id != instr->inlining_id()) { |
547 intervals.Add( | 550 intervals.Add( |
548 IntervalStruct(prev_offset, prev_inlining_pos, prev_inlining_id)); | 551 IntervalStruct(prev_offset, prev_inlining_pos, prev_inlining_id)); |
549 prev_offset = assembler()->CodeSize(); | 552 prev_offset = assembler()->CodeSize(); |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
798 } | 801 } |
799 | 802 |
800 | 803 |
801 void FlowGraphCompiler::AddStubCallTarget(const Code& code) { | 804 void FlowGraphCompiler::AddStubCallTarget(const Code& code) { |
802 ASSERT(code.IsZoneHandle()); | 805 ASSERT(code.IsZoneHandle()); |
803 static_calls_target_table_.Add( | 806 static_calls_target_table_.Add( |
804 new(zone()) StaticCallsStruct(assembler()->CodeSize(), NULL, &code)); | 807 new(zone()) StaticCallsStruct(assembler()->CodeSize(), NULL, &code)); |
805 } | 808 } |
806 | 809 |
807 | 810 |
808 void FlowGraphCompiler::AddDeoptIndexAtCall(intptr_t deopt_id, | 811 void FlowGraphCompiler::AddDeoptIndexAtCall(intptr_t deopt_id) { |
809 TokenPosition token_pos) { | |
810 ASSERT(is_optimizing()); | 812 ASSERT(is_optimizing()); |
811 ASSERT(!intrinsic_mode()); | 813 ASSERT(!intrinsic_mode()); |
812 CompilerDeoptInfo* info = | 814 CompilerDeoptInfo* info = |
813 new(zone()) CompilerDeoptInfo(deopt_id, | 815 new(zone()) CompilerDeoptInfo(deopt_id, |
814 ICData::kDeoptAtCall, | 816 ICData::kDeoptAtCall, |
815 0, // No flags. | 817 0, // No flags. |
816 pending_deoptimization_env_); | 818 pending_deoptimization_env_); |
817 info->set_pc_offset(assembler()->CodeSize()); | 819 info->set_pc_offset(assembler()->CodeSize()); |
818 deopt_infos_.Add(info); | 820 deopt_infos_.Add(info); |
819 } | 821 } |
(...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2002 | 2004 |
2003 | 2005 |
2004 void FlowGraphCompiler::FrameStateClear() { | 2006 void FlowGraphCompiler::FrameStateClear() { |
2005 ASSERT(!is_optimizing()); | 2007 ASSERT(!is_optimizing()); |
2006 frame_state_.TruncateTo(0); | 2008 frame_state_.TruncateTo(0); |
2007 } | 2009 } |
2008 #endif // defined(DEBUG) && !defined(TARGET_ARCH_DBC) | 2010 #endif // defined(DEBUG) && !defined(TARGET_ARCH_DBC) |
2009 | 2011 |
2010 | 2012 |
2011 } // namespace dart | 2013 } // namespace dart |
OLD | NEW |