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_MIPS. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. |
6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
7 | 7 |
8 #include "vm/flow_graph_compiler.h" | 8 #include "vm/flow_graph_compiler.h" |
9 | 9 |
10 #include "vm/ast_printer.h" | 10 #include "vm/ast_printer.h" |
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
737 __ addiu(SP, SP, Immediate(7 * kWordSize)); | 737 __ addiu(SP, SP, Immediate(7 * kWordSize)); |
738 | 738 |
739 __ Bind(&is_assignable); | 739 __ Bind(&is_assignable); |
740 // Restore instantiator and its type arguments. | 740 // Restore instantiator and its type arguments. |
741 __ lw(A1, Address(SP, 0 * kWordSize)); | 741 __ lw(A1, Address(SP, 0 * kWordSize)); |
742 __ lw(A2, Address(SP, 1 * kWordSize)); | 742 __ lw(A2, Address(SP, 1 * kWordSize)); |
743 __ addiu(SP, SP, Immediate(2 * kWordSize)); | 743 __ addiu(SP, SP, Immediate(2 * kWordSize)); |
744 } | 744 } |
745 | 745 |
746 | 746 |
747 void FlowGraphCompiler::EmitInstructionPrologue(Instruction* instr) { | |
748 if (!is_optimizing()) { | |
749 if (FLAG_enable_type_checks && instr->IsAssertAssignable()) { | |
750 AssertAssignableInstr* assert = instr->AsAssertAssignable(); | |
751 AddCurrentDescriptor(PcDescriptors::kDeopt, | |
752 assert->deopt_id(), | |
753 assert->token_pos()); | |
754 } else if (instr->IsGuardField() || | |
755 instr->CanBecomeDeoptimizationTarget()) { | |
756 AddCurrentDescriptor(PcDescriptors::kDeopt, | |
757 instr->deopt_id(), | |
758 Scanner::kDummyTokenIndex); | |
759 } | |
760 AllocateRegistersLocally(instr); | |
761 } else if (instr->MayThrow() && | |
762 (CurrentTryIndex() != CatchClauseNode::kInvalidTryIndex)) { | |
763 // Optimized try-block: Sync locals to fixed stack locations. | |
764 EmitTrySync(instr, CurrentTryIndex()); | |
765 } | |
766 } | |
767 | |
768 | |
769 void FlowGraphCompiler::EmitTrySyncMove(intptr_t dest_offset, | 747 void FlowGraphCompiler::EmitTrySyncMove(intptr_t dest_offset, |
770 Location loc, | 748 Location loc, |
771 bool* push_emitted) { | 749 bool* push_emitted) { |
772 if (loc.IsConstant()) { | 750 if (loc.IsConstant()) { |
773 if (!*push_emitted) { | 751 if (!*push_emitted) { |
774 __ Push(T0); | 752 __ Push(T0); |
775 *push_emitted = true; | 753 *push_emitted = true; |
776 } | 754 } |
777 __ LoadObject(T0, loc.constant()); | 755 __ LoadObject(T0, loc.constant()); |
778 __ StoreToOffset(T0, FP, dest_offset); | 756 __ StoreToOffset(T0, FP, dest_offset); |
(...skipping 1229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2008 __ AddImmediate(SP, kDoubleSize); | 1986 __ AddImmediate(SP, kDoubleSize); |
2009 } | 1987 } |
2010 | 1988 |
2011 | 1989 |
2012 #undef __ | 1990 #undef __ |
2013 | 1991 |
2014 | 1992 |
2015 } // namespace dart | 1993 } // namespace dart |
2016 | 1994 |
2017 #endif // defined TARGET_ARCH_MIPS | 1995 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |