OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/dart_entry.h" | 9 #include "vm/dart_entry.h" |
10 #include "vm/debugger.h" | 10 #include "vm/debugger.h" |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 } | 462 } |
463 assembler()->Bind(&next_test); | 463 assembler()->Bind(&next_test); |
464 } | 464 } |
465 assembler()->Bind(&match_found); | 465 assembler()->Bind(&match_found); |
466 if (done != NULL) { | 466 if (done != NULL) { |
467 assembler()->jmp(done); | 467 assembler()->jmp(done); |
468 } | 468 } |
469 } | 469 } |
470 | 470 |
471 | 471 |
| 472 void FlowGraphCompiler::EmitDoubleCompareBranch(Condition true_condition, |
| 473 XmmRegister left, |
| 474 XmmRegister right, |
| 475 BranchInstr* branch) { |
| 476 ASSERT(branch != NULL); |
| 477 assembler()->comisd(left, right); |
| 478 BlockEntryInstr* nan_result = branch->is_negated() ? |
| 479 branch->true_successor() : branch->false_successor(); |
| 480 assembler()->j(PARITY_EVEN, GetBlockLabel(nan_result)); |
| 481 branch->EmitBranchOnCondition(this, true_condition); |
| 482 } |
| 483 |
| 484 |
472 | 485 |
| 486 void FlowGraphCompiler::EmitDoubleCompareBool(Condition true_condition, |
| 487 XmmRegister left, |
| 488 XmmRegister right, |
| 489 Register result) { |
| 490 assembler()->comisd(left, right); |
| 491 Label is_false, is_true, done; |
| 492 assembler()->j(PARITY_EVEN, &is_false, Assembler::kNearJump); // NaN false; |
| 493 assembler()->j(true_condition, &is_true, Assembler::kNearJump); |
| 494 assembler()->Bind(&is_false); |
| 495 assembler()->LoadObject(result, bool_false()); |
| 496 assembler()->jmp(&done); |
| 497 assembler()->Bind(&is_true); |
| 498 assembler()->LoadObject(result, bool_true()); |
| 499 assembler()->Bind(&done); |
| 500 } |
473 | 501 |
474 | 502 |
475 Register FrameRegisterAllocator::AllocateFreeRegister(bool* blocked_registers) { | 503 Register FrameRegisterAllocator::AllocateFreeRegister(bool* blocked_registers) { |
476 for (intptr_t regno = 0; regno < kNumberOfCpuRegisters; regno++) { | 504 for (intptr_t regno = 0; regno < kNumberOfCpuRegisters; regno++) { |
477 if (!blocked_registers[regno] && (registers_[regno] == NULL)) { | 505 if (!blocked_registers[regno] && (registers_[regno] == NULL)) { |
478 blocked_registers[regno] = true; | 506 blocked_registers[regno] = true; |
479 return static_cast<Register>(regno); | 507 return static_cast<Register>(regno); |
480 } | 508 } |
481 } | 509 } |
482 return SpillFirst(); | 510 return SpillFirst(); |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 return; | 792 return; |
765 } | 793 } |
766 } | 794 } |
767 | 795 |
768 // This move is not blocked. | 796 // This move is not blocked. |
769 EmitMove(index); | 797 EmitMove(index); |
770 } | 798 } |
771 | 799 |
772 | 800 |
773 } // namespace dart | 801 } // namespace dart |
OLD | NEW |