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_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
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 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 // type check runtime call is the checked value. | 735 // type check runtime call is the checked value. |
736 __ Drop(6); | 736 __ Drop(6); |
737 __ popl(EAX); | 737 __ popl(EAX); |
738 | 738 |
739 __ Bind(&is_assignable); | 739 __ Bind(&is_assignable); |
740 __ popl(EDX); // Remove pushed instantiator type arguments. | 740 __ popl(EDX); // Remove pushed instantiator type arguments. |
741 __ popl(ECX); // Remove pushed instantiator. | 741 __ popl(ECX); // Remove pushed instantiator. |
742 } | 742 } |
743 | 743 |
744 | 744 |
745 void FlowGraphCompiler::EmitInstructionPrologue(Instruction* instr) { | |
746 if (!is_optimizing()) { | |
747 if (FLAG_enable_type_checks && instr->IsAssertAssignable()) { | |
748 AssertAssignableInstr* assert = instr->AsAssertAssignable(); | |
749 AddCurrentDescriptor(PcDescriptors::kDeopt, | |
750 assert->deopt_id(), | |
751 assert->token_pos()); | |
752 } else if (instr->IsGuardField() || | |
753 instr->CanBecomeDeoptimizationTarget()) { | |
754 AddCurrentDescriptor(PcDescriptors::kDeopt, | |
755 instr->deopt_id(), | |
756 Scanner::kDummyTokenIndex); | |
757 } | |
758 AllocateRegistersLocally(instr); | |
759 } else if (instr->MayThrow() && | |
760 (CurrentTryIndex() != CatchClauseNode::kInvalidTryIndex)) { | |
761 // Optimized try-block: Sync locals to fixed stack locations. | |
762 EmitTrySync(instr, CurrentTryIndex()); | |
763 } | |
764 } | |
765 | |
766 | |
767 void FlowGraphCompiler::EmitTrySyncMove(intptr_t dest_offset, | 745 void FlowGraphCompiler::EmitTrySyncMove(intptr_t dest_offset, |
768 Location loc, | 746 Location loc, |
769 bool* push_emitted) { | 747 bool* push_emitted) { |
770 const Address dest(EBP, dest_offset); | 748 const Address dest(EBP, dest_offset); |
771 if (loc.IsConstant()) { | 749 if (loc.IsConstant()) { |
772 if (!*push_emitted) { | 750 if (!*push_emitted) { |
773 __ pushl(EAX); | 751 __ pushl(EAX); |
774 *push_emitted = true; | 752 *push_emitted = true; |
775 } | 753 } |
776 __ LoadObject(EAX, loc.constant()); | 754 __ LoadObject(EAX, loc.constant()); |
(...skipping 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1922 __ movups(reg, Address(ESP, 0)); | 1900 __ movups(reg, Address(ESP, 0)); |
1923 __ addl(ESP, Immediate(kFpuRegisterSize)); | 1901 __ addl(ESP, Immediate(kFpuRegisterSize)); |
1924 } | 1902 } |
1925 | 1903 |
1926 | 1904 |
1927 #undef __ | 1905 #undef __ |
1928 | 1906 |
1929 } // namespace dart | 1907 } // namespace dart |
1930 | 1908 |
1931 #endif // defined TARGET_ARCH_IA32 | 1909 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |