| 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 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1435 __ sw(reg, Address(SP, 1 * kWordSize)); | 1435 __ sw(reg, Address(SP, 1 * kWordSize)); |
| 1436 __ LoadObject(TMP, obj); | 1436 __ LoadObject(TMP, obj); |
| 1437 __ sw(TMP, Address(SP, 0 * kWordSize)); | 1437 __ sw(TMP, Address(SP, 0 * kWordSize)); |
| 1438 if (is_optimizing()) { | 1438 if (is_optimizing()) { |
| 1439 __ BranchLinkPatchable( | 1439 __ BranchLinkPatchable( |
| 1440 &StubCode::OptimizedIdenticalWithNumberCheckLabel()); | 1440 &StubCode::OptimizedIdenticalWithNumberCheckLabel()); |
| 1441 } else { | 1441 } else { |
| 1442 __ BranchLinkPatchable( | 1442 __ BranchLinkPatchable( |
| 1443 &StubCode::UnoptimizedIdenticalWithNumberCheckLabel()); | 1443 &StubCode::UnoptimizedIdenticalWithNumberCheckLabel()); |
| 1444 } | 1444 } |
| 1445 AddCurrentDescriptor(PcDescriptors::kRuntimeCall, | 1445 if (token_pos != Scanner::kDummyTokenIndex) { |
| 1446 Isolate::kNoDeoptId, | 1446 AddCurrentDescriptor(PcDescriptors::kRuntimeCall, |
| 1447 token_pos); | 1447 Isolate::kNoDeoptId, |
| 1448 token_pos); |
| 1449 } |
| 1448 __ TraceSimMsg("EqualityRegConstCompare return"); | 1450 __ TraceSimMsg("EqualityRegConstCompare return"); |
| 1449 __ lw(reg, Address(SP, 1 * kWordSize)); // Restore 'reg'. | 1451 __ lw(reg, Address(SP, 1 * kWordSize)); // Restore 'reg'. |
| 1450 __ addiu(SP, SP, Immediate(2 * kWordSize)); // Discard constant. | 1452 __ addiu(SP, SP, Immediate(2 * kWordSize)); // Discard constant. |
| 1451 return; | 1453 return; |
| 1452 } | 1454 } |
| 1453 __ CompareObject(CMPRES1, CMPRES2, reg, obj); | 1455 __ CompareObject(CMPRES1, CMPRES2, reg, obj); |
| 1454 } | 1456 } |
| 1455 | 1457 |
| 1456 | 1458 |
| 1457 void FlowGraphCompiler::EmitEqualityRegRegCompare(Register left, | 1459 void FlowGraphCompiler::EmitEqualityRegRegCompare(Register left, |
| 1458 Register right, | 1460 Register right, |
| 1459 bool needs_number_check, | 1461 bool needs_number_check, |
| 1460 intptr_t token_pos) { | 1462 intptr_t token_pos) { |
| 1461 __ TraceSimMsg("EqualityRegRegCompare"); | 1463 __ TraceSimMsg("EqualityRegRegCompare"); |
| 1462 __ Comment("EqualityRegRegCompare"); | 1464 __ Comment("EqualityRegRegCompare"); |
| 1463 if (needs_number_check) { | 1465 if (needs_number_check) { |
| 1464 __ addiu(SP, SP, Immediate(-2 * kWordSize)); | 1466 __ addiu(SP, SP, Immediate(-2 * kWordSize)); |
| 1465 __ sw(left, Address(SP, 1 * kWordSize)); | 1467 __ sw(left, Address(SP, 1 * kWordSize)); |
| 1466 __ sw(right, Address(SP, 0 * kWordSize)); | 1468 __ sw(right, Address(SP, 0 * kWordSize)); |
| 1467 if (is_optimizing()) { | 1469 if (is_optimizing()) { |
| 1468 __ BranchLinkPatchable( | 1470 __ BranchLinkPatchable( |
| 1469 &StubCode::OptimizedIdenticalWithNumberCheckLabel()); | 1471 &StubCode::OptimizedIdenticalWithNumberCheckLabel()); |
| 1470 } else { | 1472 } else { |
| 1471 __ BranchLinkPatchable( | 1473 __ BranchLinkPatchable( |
| 1472 &StubCode::UnoptimizedIdenticalWithNumberCheckLabel()); | 1474 &StubCode::UnoptimizedIdenticalWithNumberCheckLabel()); |
| 1473 } | 1475 } |
| 1474 AddCurrentDescriptor(PcDescriptors::kRuntimeCall, | 1476 if (token_pos != Scanner::kDummyTokenIndex) { |
| 1475 Isolate::kNoDeoptId, | 1477 AddCurrentDescriptor(PcDescriptors::kRuntimeCall, |
| 1476 token_pos); | 1478 Isolate::kNoDeoptId, |
| 1479 token_pos); |
| 1480 } |
| 1477 __ TraceSimMsg("EqualityRegRegCompare return"); | 1481 __ TraceSimMsg("EqualityRegRegCompare return"); |
| 1478 // Stub returns result in CMPRES1. If it is 0, then left and right are | 1482 // Stub returns result in CMPRES1. If it is 0, then left and right are |
| 1479 // equal. | 1483 // equal. |
| 1480 __ lw(right, Address(SP, 0 * kWordSize)); | 1484 __ lw(right, Address(SP, 0 * kWordSize)); |
| 1481 __ lw(left, Address(SP, 1 * kWordSize)); | 1485 __ lw(left, Address(SP, 1 * kWordSize)); |
| 1482 __ addiu(SP, SP, Immediate(2 * kWordSize)); | 1486 __ addiu(SP, SP, Immediate(2 * kWordSize)); |
| 1483 } else { | 1487 } else { |
| 1484 __ slt(CMPRES1, left, right); | 1488 __ slt(CMPRES1, left, right); |
| 1485 __ slt(CMPRES2, right, left); | 1489 __ slt(CMPRES2, right, left); |
| 1486 } | 1490 } |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1869 __ AddImmediate(SP, kDoubleSize); | 1873 __ AddImmediate(SP, kDoubleSize); |
| 1870 } | 1874 } |
| 1871 | 1875 |
| 1872 | 1876 |
| 1873 #undef __ | 1877 #undef __ |
| 1874 | 1878 |
| 1875 | 1879 |
| 1876 } // namespace dart | 1880 } // namespace dart |
| 1877 | 1881 |
| 1878 #endif // defined TARGET_ARCH_MIPS | 1882 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |