Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(374)

Side by Side Diff: runtime/vm/flow_graph_compiler_ia32.cc

Issue 62133002: Cleanup of branch code generation (no change in functionality). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: rebased Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/flow_graph_compiler_arm.cc ('k') | runtime/vm/flow_graph_compiler_mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after
1597 __ Drop(argument_count); 1597 __ Drop(argument_count);
1598 if (!is_last_check) { 1598 if (!is_last_check) {
1599 assembler()->jmp(&match_found); 1599 assembler()->jmp(&match_found);
1600 } 1600 }
1601 assembler()->Bind(&next_test); 1601 assembler()->Bind(&next_test);
1602 } 1602 }
1603 assembler()->Bind(&match_found); 1603 assembler()->Bind(&match_found);
1604 } 1604 }
1605 1605
1606 1606
1607 void FlowGraphCompiler::EmitDoubleCompareBranch(Condition true_condition,
1608 FpuRegister left,
1609 FpuRegister right,
1610 BranchInstr* branch) {
1611 ASSERT(branch != NULL);
1612 assembler()->comisd(left, right);
1613 BlockEntryInstr* nan_result = (true_condition == NOT_EQUAL) ?
1614 branch->true_successor() : branch->false_successor();
1615 assembler()->j(PARITY_EVEN, GetJumpLabel(nan_result));
1616 branch->EmitBranchOnCondition(this, true_condition);
1617 }
1618
1619
1620
1621 void FlowGraphCompiler::EmitDoubleCompareBool(Condition true_condition,
1622 FpuRegister left,
1623 FpuRegister right,
1624 Register result) {
1625 assembler()->comisd(left, right);
1626 Label is_false, is_true, done;
1627 // x == NaN -> false, x != NaN -> true.
1628 Label* nan_label = (true_condition == NOT_EQUAL) ? &is_true : &is_false;
1629 assembler()->j(PARITY_EVEN, nan_label, Assembler::kNearJump);
1630 assembler()->j(true_condition, &is_true, Assembler::kNearJump);
1631 assembler()->Bind(&is_false);
1632 assembler()->LoadObject(result, Bool::False());
1633 assembler()->jmp(&done);
1634 assembler()->Bind(&is_true);
1635 assembler()->LoadObject(result, Bool::True());
1636 assembler()->Bind(&done);
1637 }
1638
1639
1640 FieldAddress FlowGraphCompiler::ElementAddressForIntIndex(intptr_t cid, 1607 FieldAddress FlowGraphCompiler::ElementAddressForIntIndex(intptr_t cid,
1641 intptr_t index_scale, 1608 intptr_t index_scale,
1642 Register array, 1609 Register array,
1643 intptr_t index) { 1610 intptr_t index) {
1644 const int64_t disp = 1611 const int64_t disp =
1645 static_cast<int64_t>(index) * index_scale + DataOffsetFor(cid); 1612 static_cast<int64_t>(index) * index_scale + DataOffsetFor(cid);
1646 ASSERT(Utils::IsInt(32, disp)); 1613 ASSERT(Utils::IsInt(32, disp));
1647 return FieldAddress(array, static_cast<int32_t>(disp)); 1614 return FieldAddress(array, static_cast<int32_t>(disp));
1648 } 1615 }
1649 1616
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
1911 __ movups(reg, Address(ESP, 0)); 1878 __ movups(reg, Address(ESP, 0));
1912 __ addl(ESP, Immediate(kFpuRegisterSize)); 1879 __ addl(ESP, Immediate(kFpuRegisterSize));
1913 } 1880 }
1914 1881
1915 1882
1916 #undef __ 1883 #undef __
1917 1884
1918 } // namespace dart 1885 } // namespace dart
1919 1886
1920 #endif // defined TARGET_ARCH_IA32 1887 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_arm.cc ('k') | runtime/vm/flow_graph_compiler_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698