Chromium Code Reviews| 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_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
| 6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
| 7 | 7 |
| 8 #include "vm/flow_graph_compiler.h" | 8 #include "vm/flow_graph_compiler.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 1390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1401 token_pos); | 1401 token_pos); |
| 1402 // Stub returns result in flags (result of a cmpl, we need ZF computed). | 1402 // Stub returns result in flags (result of a cmpl, we need ZF computed). |
| 1403 __ Pop(right); | 1403 __ Pop(right); |
| 1404 __ Pop(left); | 1404 __ Pop(left); |
| 1405 } else { | 1405 } else { |
| 1406 __ cmp(left, ShifterOperand(right)); | 1406 __ cmp(left, ShifterOperand(right)); |
| 1407 } | 1407 } |
| 1408 } | 1408 } |
| 1409 | 1409 |
| 1410 | 1410 |
| 1411 // Implement equality spec: if any of the arguments is null do identity check. | |
| 1412 // Fallthrough calls super equality. | |
| 1411 void FlowGraphCompiler::EmitSuperEqualityCallPrologue(Register result, | 1413 void FlowGraphCompiler::EmitSuperEqualityCallPrologue(Register result, |
| 1412 Label* skip_call) { | 1414 Label* skip_call) { |
| 1413 UNIMPLEMENTED(); | 1415 Label check_identity, fall_through; |
| 1416 __ LoadImmediate(IP, reinterpret_cast<intptr_t>(Object::null())); | |
| 1417 __ ldr(result, Address(SP, 0 * kWordSize)); | |
| 1418 __ cmp(result, ShifterOperand(IP)); | |
| 1419 __ mov(IP, ShifterOperand(result), EQ); | |
| 1420 __ ldr(result, Address(SP, 1 * kWordSize)); | |
| 1421 __ b(&check_identity, EQ); | |
| 1422 __ cmp(result, ShifterOperand(IP)); | |
| 1423 __ b(&fall_through, NE); | |
|
zra
2013/05/30 23:17:35
The code is a bit dense up to here. A comment or t
regis
2013/05/31 00:37:04
:-)
Done and simplified a bit.
It will be easier f
| |
| 1424 | |
| 1425 __ ldr(IP, Address(SP, 0 * kWordSize)); | |
| 1426 __ Bind(&check_identity); | |
| 1427 __ cmp(result, ShifterOperand(IP)); | |
| 1428 __ LoadObject(result, Bool::True(), EQ); | |
| 1429 __ LoadObject(result, Bool::False(), NE); | |
| 1430 __ Drop(2); | |
| 1431 __ b(skip_call); | |
| 1432 __ Bind(&fall_through); | |
| 1414 } | 1433 } |
| 1415 | 1434 |
| 1416 | 1435 |
| 1417 void FlowGraphCompiler::SaveLiveRegisters(LocationSummary* locs) { | 1436 void FlowGraphCompiler::SaveLiveRegisters(LocationSummary* locs) { |
| 1418 // TODO(vegorov): consider saving only caller save (volatile) registers. | 1437 // TODO(vegorov): consider saving only caller save (volatile) registers. |
| 1419 const intptr_t fpu_regs_count = locs->live_registers()->fpu_regs_count(); | 1438 const intptr_t fpu_regs_count = locs->live_registers()->fpu_regs_count(); |
| 1420 if (fpu_regs_count > 0) { | 1439 if (fpu_regs_count > 0) { |
| 1421 __ AddImmediate(SP, -(fpu_regs_count * kFpuRegisterSize)); | 1440 __ AddImmediate(SP, -(fpu_regs_count * kFpuRegisterSize)); |
| 1422 // Store fpu registers with the lowest register number at the lowest | 1441 // Store fpu registers with the lowest register number at the lowest |
| 1423 // address. | 1442 // address. |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1512 assembler()->Bind(&next_test); | 1531 assembler()->Bind(&next_test); |
| 1513 } | 1532 } |
| 1514 assembler()->Bind(&match_found); | 1533 assembler()->Bind(&match_found); |
| 1515 } | 1534 } |
| 1516 | 1535 |
| 1517 | 1536 |
| 1518 void FlowGraphCompiler::EmitDoubleCompareBranch(Condition true_condition, | 1537 void FlowGraphCompiler::EmitDoubleCompareBranch(Condition true_condition, |
| 1519 FpuRegister left, | 1538 FpuRegister left, |
| 1520 FpuRegister right, | 1539 FpuRegister right, |
| 1521 BranchInstr* branch) { | 1540 BranchInstr* branch) { |
| 1522 UNIMPLEMENTED(); | 1541 ASSERT(branch != NULL); |
| 1542 assembler()->vcmpd(left, right); | |
| 1543 assembler()->vmstat(); | |
| 1544 BlockEntryInstr* nan_result = (true_condition == NE) ? | |
|
zra
2013/05/30 23:17:35
I'm not familiar with the spec here, but I thought
regis
2013/05/31 00:37:04
In your example, the negation is outside of this i
| |
| 1545 branch->true_successor() : branch->false_successor(); | |
| 1546 assembler()->b(GetJumpLabel(nan_result), VS); | |
| 1547 branch->EmitBranchOnCondition(this, true_condition); | |
| 1523 } | 1548 } |
| 1524 | 1549 |
| 1525 | 1550 |
| 1526 void FlowGraphCompiler::EmitDoubleCompareBool(Condition true_condition, | 1551 void FlowGraphCompiler::EmitDoubleCompareBool(Condition true_condition, |
| 1527 FpuRegister left, | 1552 FpuRegister left, |
| 1528 FpuRegister right, | 1553 FpuRegister right, |
| 1529 Register result) { | 1554 Register result) { |
| 1530 UNIMPLEMENTED(); | 1555 assembler()->vcmpd(left, right); |
| 1556 assembler()->vmstat(); | |
| 1557 assembler()->LoadObject(result, Bool::False()); | |
| 1558 Label done; | |
| 1559 assembler()->b(&done, VS); // NaN -> false. | |
| 1560 assembler()->LoadObject(result, Bool::True(), true_condition); | |
| 1561 assembler()->Bind(&done); | |
| 1531 } | 1562 } |
| 1532 | 1563 |
| 1533 | 1564 |
| 1534 // Do not impelement or use this function. | 1565 // Do not impelement or use this function. |
| 1535 FieldAddress FlowGraphCompiler::ElementAddressForIntIndex(intptr_t cid, | 1566 FieldAddress FlowGraphCompiler::ElementAddressForIntIndex(intptr_t cid, |
| 1536 intptr_t index_scale, | 1567 intptr_t index_scale, |
| 1537 Register array, | 1568 Register array, |
| 1538 intptr_t index) { | 1569 intptr_t index) { |
| 1539 UNREACHABLE(); | 1570 UNREACHABLE(); |
| 1540 return FieldAddress(array, index); | 1571 return FieldAddress(array, index); |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1751 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { | 1782 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { |
| 1752 __ vldrd(reg, Address(SP, kDoubleSize, Address::PostIndex)); | 1783 __ vldrd(reg, Address(SP, kDoubleSize, Address::PostIndex)); |
| 1753 } | 1784 } |
| 1754 | 1785 |
| 1755 | 1786 |
| 1756 #undef __ | 1787 #undef __ |
| 1757 | 1788 |
| 1758 } // namespace dart | 1789 } // namespace dart |
| 1759 | 1790 |
| 1760 #endif // defined TARGET_ARCH_ARM | 1791 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |