| 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/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 4512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4523 compiler->SetNeedsStacktrace(catch_try_index()); | 4523 compiler->SetNeedsStacktrace(catch_try_index()); |
| 4524 compiler->GenerateCallRuntime(token_pos(), | 4524 compiler->GenerateCallRuntime(token_pos(), |
| 4525 deopt_id(), | 4525 deopt_id(), |
| 4526 kReThrowRuntimeEntry, | 4526 kReThrowRuntimeEntry, |
| 4527 2, | 4527 2, |
| 4528 locs()); | 4528 locs()); |
| 4529 __ int3(); | 4529 __ int3(); |
| 4530 } | 4530 } |
| 4531 | 4531 |
| 4532 | 4532 |
| 4533 void GraphEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4534 if (!compiler->CanFallThroughTo(normal_entry())) { |
| 4535 __ jmp(compiler->GetJumpLabel(normal_entry())); |
| 4536 } |
| 4537 } |
| 4538 |
| 4539 |
| 4533 void TargetEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4540 void TargetEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4534 __ Bind(compiler->GetJumpLabel(this)); | 4541 __ Bind(compiler->GetJumpLabel(this)); |
| 4535 if (!compiler->is_optimizing()) { | 4542 if (!compiler->is_optimizing()) { |
| 4536 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, | 4543 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, |
| 4537 deopt_id_, | 4544 deopt_id_, |
| 4538 Scanner::kDummyTokenIndex); | 4545 Scanner::kDummyTokenIndex); |
| 4539 // Add an edge counter. | 4546 // Add an edge counter. |
| 4540 const Array& counter = Array::ZoneHandle(Array::New(1, Heap::kOld)); | 4547 const Array& counter = Array::ZoneHandle(Array::New(1, Heap::kOld)); |
| 4541 counter.SetAt(0, Smi::Handle(Smi::New(0))); | 4548 counter.SetAt(0, Smi::Handle(Smi::New(0))); |
| 4542 Label done; | 4549 Label done; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4598 __ jmp(compiler->GetJumpLabel(true_successor())); | 4605 __ jmp(compiler->GetJumpLabel(true_successor())); |
| 4599 } else if (!value && !compiler->CanFallThroughTo(false_successor())) { | 4606 } else if (!value && !compiler->CanFallThroughTo(false_successor())) { |
| 4600 __ jmp(compiler->GetJumpLabel(false_successor())); | 4607 __ jmp(compiler->GetJumpLabel(false_successor())); |
| 4601 } | 4608 } |
| 4602 } | 4609 } |
| 4603 | 4610 |
| 4604 | 4611 |
| 4605 void ControlInstruction::EmitBranchOnCondition(FlowGraphCompiler* compiler, | 4612 void ControlInstruction::EmitBranchOnCondition(FlowGraphCompiler* compiler, |
| 4606 Condition true_condition) { | 4613 Condition true_condition) { |
| 4607 if (compiler->CanFallThroughTo(false_successor())) { | 4614 if (compiler->CanFallThroughTo(false_successor())) { |
| 4608 // If the next block is the false successor we will fall through to it. | 4615 // If the next block is the false successor, fall through to it. |
| 4609 __ j(true_condition, compiler->GetJumpLabel(true_successor())); | 4616 __ j(true_condition, compiler->GetJumpLabel(true_successor())); |
| 4610 } else { | 4617 } else { |
| 4611 // If the next block is the true successor we negate comparison and fall | 4618 // If the next block is not the false successor, branch to it. |
| 4612 // through to it. | |
| 4613 Condition false_condition = NegateCondition(true_condition); | 4619 Condition false_condition = NegateCondition(true_condition); |
| 4614 __ j(false_condition, compiler->GetJumpLabel(false_successor())); | 4620 __ j(false_condition, compiler->GetJumpLabel(false_successor())); |
| 4615 | 4621 |
| 4616 // Fall through or jump to the true successor. | 4622 // Fall through or jump to the true successor. |
| 4617 if (!compiler->CanFallThroughTo(true_successor())) { | 4623 if (!compiler->CanFallThroughTo(true_successor())) { |
| 4618 __ jmp(compiler->GetJumpLabel(true_successor())); | 4624 __ jmp(compiler->GetJumpLabel(true_successor())); |
| 4619 } | 4625 } |
| 4620 } | 4626 } |
| 4621 } | 4627 } |
| 4622 | 4628 |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4830 PcDescriptors::kOther, | 4836 PcDescriptors::kOther, |
| 4831 locs()); | 4837 locs()); |
| 4832 __ Drop(2); // Discard type arguments and receiver. | 4838 __ Drop(2); // Discard type arguments and receiver. |
| 4833 } | 4839 } |
| 4834 | 4840 |
| 4835 } // namespace dart | 4841 } // namespace dart |
| 4836 | 4842 |
| 4837 #undef __ | 4843 #undef __ |
| 4838 | 4844 |
| 4839 #endif // defined TARGET_ARCH_X64 | 4845 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |