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_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
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 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 // type check runtime call is the checked value. | 717 // type check runtime call is the checked value. |
718 __ Drop(6); | 718 __ Drop(6); |
719 __ popq(RAX); | 719 __ popq(RAX); |
720 | 720 |
721 __ Bind(&is_assignable); | 721 __ Bind(&is_assignable); |
722 __ popq(RDX); // Remove pushed instantiator type arguments. | 722 __ popq(RDX); // Remove pushed instantiator type arguments. |
723 __ popq(RCX); // Remove pushed instantiator. | 723 __ popq(RCX); // Remove pushed instantiator. |
724 } | 724 } |
725 | 725 |
726 | 726 |
727 void FlowGraphCompiler::EmitInstructionPrologue(Instruction* instr) { | |
728 if (!is_optimizing()) { | |
729 if (FLAG_enable_type_checks && instr->IsAssertAssignable()) { | |
730 AssertAssignableInstr* assert = instr->AsAssertAssignable(); | |
731 AddCurrentDescriptor(PcDescriptors::kDeopt, | |
732 assert->deopt_id(), | |
733 assert->token_pos()); | |
734 } else if (instr->IsGuardField() || | |
735 instr->CanBecomeDeoptimizationTarget()) { | |
736 AddCurrentDescriptor(PcDescriptors::kDeopt, | |
737 instr->deopt_id(), | |
738 Scanner::kDummyTokenIndex); | |
739 } | |
740 AllocateRegistersLocally(instr); | |
741 } else if (instr->MayThrow() && | |
742 (CurrentTryIndex() != CatchClauseNode::kInvalidTryIndex)) { | |
743 // Optimized try-block: Sync locals to fixed stack locations. | |
744 EmitTrySync(instr, CurrentTryIndex()); | |
745 } | |
746 } | |
747 | |
748 | |
749 void FlowGraphCompiler::EmitTrySyncMove(intptr_t dest_offset, | 727 void FlowGraphCompiler::EmitTrySyncMove(intptr_t dest_offset, |
750 Location loc, | 728 Location loc, |
751 bool* push_emitted) { | 729 bool* push_emitted) { |
752 const Address dest(RBP, dest_offset); | 730 const Address dest(RBP, dest_offset); |
753 if (loc.IsConstant()) { | 731 if (loc.IsConstant()) { |
754 if (!*push_emitted) { | 732 if (!*push_emitted) { |
755 __ pushq(RAX); | 733 __ pushq(RAX); |
756 *push_emitted = true; | 734 *push_emitted = true; |
757 } | 735 } |
758 __ LoadObject(RAX, loc.constant(), PP); | 736 __ LoadObject(RAX, loc.constant(), PP); |
(...skipping 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1935 __ movups(reg, Address(RSP, 0)); | 1913 __ movups(reg, Address(RSP, 0)); |
1936 __ addq(RSP, Immediate(kFpuRegisterSize)); | 1914 __ addq(RSP, Immediate(kFpuRegisterSize)); |
1937 } | 1915 } |
1938 | 1916 |
1939 | 1917 |
1940 #undef __ | 1918 #undef __ |
1941 | 1919 |
1942 } // namespace dart | 1920 } // namespace dart |
1943 | 1921 |
1944 #endif // defined TARGET_ARCH_X64 | 1922 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |