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

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

Issue 15692005: Fix a bug in optimized ARM code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 months 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 "lib/error.h" 10 #include "lib/error.h"
(...skipping 1635 matching lines...) Expand 10 before | Expand all | Expand 10 after
1646 assembler()->j(true_condition, &is_true, Assembler::kNearJump); 1646 assembler()->j(true_condition, &is_true, Assembler::kNearJump);
1647 assembler()->Bind(&is_false); 1647 assembler()->Bind(&is_false);
1648 assembler()->LoadObject(result, Bool::False()); 1648 assembler()->LoadObject(result, Bool::False());
1649 assembler()->jmp(&done); 1649 assembler()->jmp(&done);
1650 assembler()->Bind(&is_true); 1650 assembler()->Bind(&is_true);
1651 assembler()->LoadObject(result, Bool::True()); 1651 assembler()->LoadObject(result, Bool::True());
1652 assembler()->Bind(&done); 1652 assembler()->Bind(&done);
1653 } 1653 }
1654 1654
1655 1655
1656 Condition FlowGraphCompiler::FlipCondition(Condition condition) {
1657 switch (condition) {
1658 case EQUAL: return EQUAL;
1659 case NOT_EQUAL: return NOT_EQUAL;
1660 case LESS: return GREATER;
1661 case LESS_EQUAL: return GREATER_EQUAL;
1662 case GREATER: return LESS;
1663 case GREATER_EQUAL: return LESS_EQUAL;
1664 case BELOW: return ABOVE;
1665 case BELOW_EQUAL: return ABOVE_EQUAL;
1666 case ABOVE: return BELOW;
1667 case ABOVE_EQUAL: return BELOW_EQUAL;
1668 default:
1669 UNIMPLEMENTED();
1670 return EQUAL;
1671 }
1672 }
1673
1674
1675 bool FlowGraphCompiler::EvaluateCondition(Condition condition,
1676 intptr_t left,
1677 intptr_t right) {
1678 const uintptr_t unsigned_left = static_cast<uintptr_t>(left);
1679 const uintptr_t unsigned_right = static_cast<uintptr_t>(right);
1680 switch (condition) {
1681 case EQUAL: return left == right;
1682 case NOT_EQUAL: return left != right;
1683 case LESS: return left < right;
1684 case LESS_EQUAL: return left <= right;
1685 case GREATER: return left > right;
1686 case GREATER_EQUAL: return left >= right;
1687 case BELOW: return unsigned_left < unsigned_right;
1688 case BELOW_EQUAL: return unsigned_left <= unsigned_right;
1689 case ABOVE: return unsigned_left > unsigned_right;
1690 case ABOVE_EQUAL: return unsigned_left >= unsigned_right;
1691 default:
1692 UNIMPLEMENTED();
1693 return false;
1694 }
1695 }
1696
1697
1698 FieldAddress FlowGraphCompiler::ElementAddressForIntIndex(intptr_t cid, 1656 FieldAddress FlowGraphCompiler::ElementAddressForIntIndex(intptr_t cid,
1699 intptr_t index_scale, 1657 intptr_t index_scale,
1700 Register array, 1658 Register array,
1701 intptr_t index) { 1659 intptr_t index) {
1702 const int64_t disp = 1660 const int64_t disp =
1703 static_cast<int64_t>(index) * index_scale + DataOffsetFor(cid); 1661 static_cast<int64_t>(index) * index_scale + DataOffsetFor(cid);
1704 ASSERT(Utils::IsInt(32, disp)); 1662 ASSERT(Utils::IsInt(32, disp));
1705 return FieldAddress(array, static_cast<int32_t>(disp)); 1663 return FieldAddress(array, static_cast<int32_t>(disp));
1706 } 1664 }
1707 1665
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
1958 __ movups(reg, Address(ESP, 0)); 1916 __ movups(reg, Address(ESP, 0));
1959 __ addl(ESP, Immediate(kFpuRegisterSize)); 1917 __ addl(ESP, Immediate(kFpuRegisterSize));
1960 } 1918 }
1961 1919
1962 1920
1963 #undef __ 1921 #undef __
1964 1922
1965 } // namespace dart 1923 } // namespace dart
1966 1924
1967 #endif // defined TARGET_ARCH_IA32 1925 #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