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 1344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1355 *StubCode::CallStaticFunction_entry(), | 1355 *StubCode::CallStaticFunction_entry(), |
1356 RawPcDescriptors::kOther, locs, function); | 1356 RawPcDescriptors::kOther, locs, function); |
1357 __ Drop(argument_count); | 1357 __ Drop(argument_count); |
1358 } | 1358 } |
1359 | 1359 |
1360 | 1360 |
1361 Condition FlowGraphCompiler::EmitEqualityRegConstCompare( | 1361 Condition FlowGraphCompiler::EmitEqualityRegConstCompare( |
1362 Register reg, | 1362 Register reg, |
1363 const Object& obj, | 1363 const Object& obj, |
1364 bool needs_number_check, | 1364 bool needs_number_check, |
1365 TokenPosition token_pos) { | 1365 TokenPosition token_pos, |
| 1366 intptr_t deopt_id) { |
1366 __ Comment("EqualityRegConstCompare"); | 1367 __ Comment("EqualityRegConstCompare"); |
1367 ASSERT(!needs_number_check || | 1368 ASSERT(!needs_number_check || |
1368 (!obj.IsMint() && !obj.IsDouble() && !obj.IsBigint())); | 1369 (!obj.IsMint() && !obj.IsDouble() && !obj.IsBigint())); |
1369 if (needs_number_check) { | 1370 if (needs_number_check) { |
1370 ASSERT(!obj.IsMint() && !obj.IsDouble() && !obj.IsBigint()); | 1371 ASSERT(!obj.IsMint() && !obj.IsDouble() && !obj.IsBigint()); |
1371 __ addiu(SP, SP, Immediate(-2 * kWordSize)); | 1372 __ addiu(SP, SP, Immediate(-2 * kWordSize)); |
1372 __ sw(reg, Address(SP, 1 * kWordSize)); | 1373 __ sw(reg, Address(SP, 1 * kWordSize)); |
1373 __ LoadObject(TMP, obj); | 1374 __ LoadObject(TMP, obj); |
1374 __ sw(TMP, Address(SP, 0 * kWordSize)); | 1375 __ sw(TMP, Address(SP, 0 * kWordSize)); |
1375 if (is_optimizing()) { | 1376 if (is_optimizing()) { |
1376 __ BranchLinkPatchable( | 1377 __ BranchLinkPatchable( |
1377 *StubCode::OptimizedIdenticalWithNumberCheck_entry()); | 1378 *StubCode::OptimizedIdenticalWithNumberCheck_entry()); |
1378 } else { | 1379 } else { |
1379 __ BranchLinkPatchable( | 1380 __ BranchLinkPatchable( |
1380 *StubCode::UnoptimizedIdenticalWithNumberCheck_entry()); | 1381 *StubCode::UnoptimizedIdenticalWithNumberCheck_entry()); |
1381 } | 1382 } |
1382 if (token_pos.IsReal()) { | 1383 AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall, deopt_id, token_pos); |
1383 AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall, Thread::kNoDeoptId, | |
1384 token_pos); | |
1385 } | |
1386 __ Comment("EqualityRegConstCompare return"); | 1384 __ Comment("EqualityRegConstCompare return"); |
1387 // Stub returns result in CMPRES1 (if it is 0, then reg and obj are equal). | 1385 // Stub returns result in CMPRES1 (if it is 0, then reg and obj are equal). |
1388 __ lw(reg, Address(SP, 1 * kWordSize)); // Restore 'reg'. | 1386 __ lw(reg, Address(SP, 1 * kWordSize)); // Restore 'reg'. |
1389 __ addiu(SP, SP, Immediate(2 * kWordSize)); // Discard constant. | 1387 __ addiu(SP, SP, Immediate(2 * kWordSize)); // Discard constant. |
1390 return Condition(CMPRES1, ZR, EQ); | 1388 return Condition(CMPRES1, ZR, EQ); |
1391 } else { | 1389 } else { |
1392 int16_t imm = 0; | 1390 int16_t imm = 0; |
1393 const Register obj_reg = __ LoadConditionOperand(CMPRES1, obj, &imm); | 1391 const Register obj_reg = __ LoadConditionOperand(CMPRES1, obj, &imm); |
1394 return Condition(reg, obj_reg, EQ, imm); | 1392 return Condition(reg, obj_reg, EQ, imm); |
1395 } | 1393 } |
1396 } | 1394 } |
1397 | 1395 |
1398 | 1396 |
1399 Condition FlowGraphCompiler::EmitEqualityRegRegCompare( | 1397 Condition FlowGraphCompiler::EmitEqualityRegRegCompare(Register left, |
1400 Register left, | 1398 Register right, |
1401 Register right, | 1399 bool needs_number_check, |
1402 bool needs_number_check, | 1400 TokenPosition token_pos, |
1403 TokenPosition token_pos) { | 1401 intptr_t deopt_id) { |
1404 __ Comment("EqualityRegRegCompare"); | 1402 __ Comment("EqualityRegRegCompare"); |
1405 if (needs_number_check) { | 1403 if (needs_number_check) { |
1406 __ addiu(SP, SP, Immediate(-2 * kWordSize)); | 1404 __ addiu(SP, SP, Immediate(-2 * kWordSize)); |
1407 __ sw(left, Address(SP, 1 * kWordSize)); | 1405 __ sw(left, Address(SP, 1 * kWordSize)); |
1408 __ sw(right, Address(SP, 0 * kWordSize)); | 1406 __ sw(right, Address(SP, 0 * kWordSize)); |
1409 if (is_optimizing()) { | 1407 if (is_optimizing()) { |
1410 __ BranchLinkPatchable( | 1408 __ BranchLinkPatchable( |
1411 *StubCode::OptimizedIdenticalWithNumberCheck_entry()); | 1409 *StubCode::OptimizedIdenticalWithNumberCheck_entry()); |
1412 } else { | 1410 } else { |
1413 __ BranchLinkPatchable( | 1411 __ BranchLinkPatchable( |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1810 __ AddImmediate(SP, kDoubleSize); | 1808 __ AddImmediate(SP, kDoubleSize); |
1811 } | 1809 } |
1812 | 1810 |
1813 | 1811 |
1814 #undef __ | 1812 #undef __ |
1815 | 1813 |
1816 | 1814 |
1817 } // namespace dart | 1815 } // namespace dart |
1818 | 1816 |
1819 #endif // defined TARGET_ARCH_MIPS | 1817 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |