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_MIPS. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. |
6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
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 1539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1550 | 1550 |
1551 void FlowGraphCompiler::EmitTestAndCallLoadCid() { | 1551 void FlowGraphCompiler::EmitTestAndCallLoadCid() { |
1552 __ LoadClassId(T2, T0); | 1552 __ LoadClassId(T2, T0); |
1553 } | 1553 } |
1554 | 1554 |
1555 | 1555 |
1556 int FlowGraphCompiler::EmitTestAndCallCheckCid(Label* next_label, | 1556 int FlowGraphCompiler::EmitTestAndCallCheckCid(Label* next_label, |
1557 const CidRange& range, | 1557 const CidRange& range, |
1558 int bias) { | 1558 int bias) { |
1559 intptr_t cid_start = range.cid_start; | 1559 intptr_t cid_start = range.cid_start; |
1560 intptr_t cid_end = range.cid_end; | |
1561 if (range.IsSingleCid()) { | 1560 if (range.IsSingleCid()) { |
1562 __ BranchNotEqual(T2, Immediate(cid_start - bias), next_label); | 1561 __ BranchNotEqual(T2, Immediate(cid_start - bias), next_label); |
1563 } else { | 1562 } else { |
1564 __ AddImmediate(T2, T2, bias - cid_start); | 1563 __ AddImmediate(T2, T2, bias - cid_start); |
1565 bias = cid_start; | 1564 bias = cid_start; |
1566 // TODO(erikcorry): We should use sltiu instead of the temporary TMP if | 1565 // TODO(erikcorry): We should use sltiu instead of the temporary TMP if |
1567 // the range is small enough. | 1566 // the range is small enough. |
1568 __ LoadImmediate(TMP, cid_end - cid_end); | 1567 __ LoadImmediate(TMP, range.Extent()); |
kustermann
2017/05/19 07:59:42
end - end :)
| |
1569 // Reverse comparison so we get 1 if biased cid > tmp ie cid is out of | 1568 // Reverse comparison so we get 1 if biased cid > tmp ie cid is out of |
1570 // range. | 1569 // range. |
1571 __ sltu(TMP, TMP, T2); | 1570 __ sltu(TMP, TMP, T2); |
1572 __ bne(TMP, ZR, next_label); | 1571 __ bne(TMP, ZR, next_label); |
1573 } | 1572 } |
1574 return bias; | 1573 return bias; |
1575 } | 1574 } |
1576 | 1575 |
1577 | 1576 |
1578 #undef __ | 1577 #undef __ |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1811 __ AddImmediate(SP, kDoubleSize); | 1810 __ AddImmediate(SP, kDoubleSize); |
1812 } | 1811 } |
1813 | 1812 |
1814 | 1813 |
1815 #undef __ | 1814 #undef __ |
1816 | 1815 |
1817 | 1816 |
1818 } // namespace dart | 1817 } // namespace dart |
1819 | 1818 |
1820 #endif // defined TARGET_ARCH_MIPS | 1819 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |