OLD | NEW |
---|---|
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1749 InstanceType from = hydrogen()->from(); | 1749 InstanceType from = hydrogen()->from(); |
1750 InstanceType to = hydrogen()->to(); | 1750 InstanceType to = hydrogen()->to(); |
1751 if (from == to) return eq; | 1751 if (from == to) return eq; |
1752 if (to == LAST_TYPE) return hs; | 1752 if (to == LAST_TYPE) return hs; |
1753 if (from == FIRST_TYPE) return ls; | 1753 if (from == FIRST_TYPE) return ls; |
1754 UNREACHABLE(); | 1754 UNREACHABLE(); |
1755 return eq; | 1755 return eq; |
1756 } | 1756 } |
1757 | 1757 |
1758 | 1758 |
1759 static InstanceType TestType(HHasInstanceType* instr) { | |
1760 InstanceType from = instr->from(); | |
1761 InstanceType to = instr->to(); | |
1762 if (from == FIRST_TYPE) return to; | |
1763 ASSERT(from == to || to == LAST_TYPE); | |
1764 return from; | |
1765 } | |
1766 | |
1767 | |
1768 static Condition BranchCondition(HHasInstanceType* instr) { | |
1769 InstanceType from = instr->from(); | |
1770 InstanceType to = instr->to(); | |
1771 if (from == to) return eq; | |
1772 if (to == LAST_TYPE) return hs; | |
1773 if (from == FIRST_TYPE) return ls; | |
1774 UNREACHABLE(); | |
1775 return eq; | |
1776 } | |
1777 | |
1778 | |
1759 void LCodeGen::DoHasInstanceType(LHasInstanceType* instr) { | 1779 void LCodeGen::DoHasInstanceType(LHasInstanceType* instr) { |
1760 Abort("DoHasInstanceType unimplemented."); | 1780 Register input = ToRegister(instr->input()); |
1781 Register result = ToRegister(instr->result()); | |
1782 | |
1783 ASSERT(instr->hydrogen()->value()->representation().IsTagged()); | |
1784 __ tst(input, Operand(kSmiTagMask)); | |
1785 Label done, is_false; | |
Søren Thygesen Gjesse
2011/01/19 12:55:00
done currently not used.
| |
1786 __ b(eq, &is_false); | |
Søren Thygesen Gjesse
2011/01/19 12:55:00
There is a JumpIfSmi in ARM macro assembler.
But,
| |
1787 __ CompareObjectType(input, result, result, TestType(instr->hydrogen())); | |
1788 Condition cond = BranchCondition(instr->hydrogen()); | |
1789 __ LoadRoot(result, Heap::kTrueValueRootIndex, cond); | |
1790 __ LoadRoot(result, Heap::kFalseValueRootIndex, NegateCondition(cond)); | |
1761 } | 1791 } |
1762 | 1792 |
1763 | 1793 |
1764 void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) { | 1794 void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) { |
1765 Register scratch = scratch0(); | 1795 Register scratch = scratch0(); |
1766 Register input = ToRegister(instr->input()); | 1796 Register input = ToRegister(instr->input()); |
1767 | 1797 |
1768 int true_block = chunk_->LookupDestination(instr->true_block_id()); | 1798 int true_block = chunk_->LookupDestination(instr->true_block_id()); |
1769 int false_block = chunk_->LookupDestination(instr->false_block_id()); | 1799 int false_block = chunk_->LookupDestination(instr->false_block_id()); |
1770 | 1800 |
(...skipping 1449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3220 | 3250 |
3221 | 3251 |
3222 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { | 3252 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { |
3223 Abort("DoOsrEntry unimplemented."); | 3253 Abort("DoOsrEntry unimplemented."); |
3224 } | 3254 } |
3225 | 3255 |
3226 | 3256 |
3227 #undef __ | 3257 #undef __ |
3228 | 3258 |
3229 } } // namespace v8::internal | 3259 } } // namespace v8::internal |
OLD | NEW |