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

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

Issue 2891713002: Cleanup: Make CheckClassId instruction more general so it (Closed)
Patch Set: Feedback from Martin Created 3 years, 7 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
« no previous file with comments | « runtime/vm/flow_graph_compiler_ia32.cc ('k') | runtime/vm/flow_graph_compiler_x64.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_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 1540 matching lines...) Expand 10 before | Expand all | Expand 10 after
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; 1560 intptr_t cid_end = range.cid_end;
1561 if (cid_start == cid_end) { 1561 if (range.IsSingleCid()) {
1562 __ BranchNotEqual(T2, Immediate(cid_start - bias), next_label); 1562 __ BranchNotEqual(T2, Immediate(cid_start - bias), next_label);
1563 } else { 1563 } else {
1564 __ AddImmediate(T2, T2, bias - cid_start); 1564 __ AddImmediate(T2, T2, bias - cid_start);
1565 bias = cid_start; 1565 bias = cid_start;
1566 // TODO(erikcorry): We should use sltiu instead of the temporary TMP if 1566 // TODO(erikcorry): We should use sltiu instead of the temporary TMP if
1567 // the range is small enough. 1567 // the range is small enough.
1568 __ LoadImmediate(TMP, cid_end - cid_end); 1568 __ LoadImmediate(TMP, cid_end - cid_end);
1569 // Reverse comparison so we get 1 if biased cid > tmp ie cid is out of 1569 // Reverse comparison so we get 1 if biased cid > tmp ie cid is out of
1570 // range. 1570 // range.
1571 __ sltu(TMP, TMP, T2); 1571 __ sltu(TMP, TMP, T2);
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
1811 __ AddImmediate(SP, kDoubleSize); 1811 __ AddImmediate(SP, kDoubleSize);
1812 } 1812 }
1813 1813
1814 1814
1815 #undef __ 1815 #undef __
1816 1816
1817 1817
1818 } // namespace dart 1818 } // namespace dart
1819 1819
1820 #endif // defined TARGET_ARCH_MIPS 1820 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_ia32.cc ('k') | runtime/vm/flow_graph_compiler_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698