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_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
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 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1470 void FlowGraphCompiler::EmitTestAndCallLoadCid() { | 1470 void FlowGraphCompiler::EmitTestAndCallLoadCid() { |
1471 __ LoadClassId(RDI, RAX); | 1471 __ LoadClassId(RDI, RAX); |
1472 } | 1472 } |
1473 | 1473 |
1474 | 1474 |
1475 int FlowGraphCompiler::EmitTestAndCallCheckCid(Label* next_label, | 1475 int FlowGraphCompiler::EmitTestAndCallCheckCid(Label* next_label, |
1476 const CidRange& range, | 1476 const CidRange& range, |
1477 int bias) { | 1477 int bias) { |
1478 intptr_t cid_start = range.cid_start; | 1478 intptr_t cid_start = range.cid_start; |
1479 intptr_t cid_end = range.cid_end; | 1479 intptr_t cid_end = range.cid_end; |
1480 if (cid_start == cid_end) { | 1480 if (range.IsSingleCid()) { |
1481 __ cmpl(RDI, Immediate(cid_start - bias)); | 1481 __ cmpl(RDI, Immediate(cid_start - bias)); |
1482 __ j(NOT_EQUAL, next_label); | 1482 __ j(NOT_EQUAL, next_label); |
1483 } else { | 1483 } else { |
1484 __ addl(RDI, Immediate(bias - cid_start)); | 1484 __ addl(RDI, Immediate(bias - cid_start)); |
1485 bias = cid_start; | 1485 bias = cid_start; |
1486 __ cmpl(RDI, Immediate(cid_end - cid_start)); | 1486 __ cmpl(RDI, Immediate(range.Extent())); |
1487 __ j(ABOVE, next_label); // Unsigned higher. | 1487 __ j(ABOVE, next_label); // Unsigned higher. |
1488 } | 1488 } |
1489 return bias; | 1489 return bias; |
1490 } | 1490 } |
1491 | 1491 |
1492 | 1492 |
1493 #undef __ | 1493 #undef __ |
1494 #define __ compiler_->assembler()-> | 1494 #define __ compiler_->assembler()-> |
1495 | 1495 |
1496 | 1496 |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1720 __ movups(reg, Address(RSP, 0)); | 1720 __ movups(reg, Address(RSP, 0)); |
1721 __ AddImmediate(RSP, Immediate(kFpuRegisterSize)); | 1721 __ AddImmediate(RSP, Immediate(kFpuRegisterSize)); |
1722 } | 1722 } |
1723 | 1723 |
1724 | 1724 |
1725 #undef __ | 1725 #undef __ |
1726 | 1726 |
1727 } // namespace dart | 1727 } // namespace dart |
1728 | 1728 |
1729 #endif // defined TARGET_ARCH_X64 | 1729 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |