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 1668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1679 __ lw(scratch, FieldMemOperand(reg, HeapObject::kMapOffset)); | 1679 __ lw(scratch, FieldMemOperand(reg, HeapObject::kMapOffset)); |
1680 __ lbu(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset)); | 1680 __ lbu(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset)); |
1681 __ And(scratch, scratch, 1 << Map::kIsUndetectable); | 1681 __ And(scratch, scratch, 1 << Map::kIsUndetectable); |
1682 EmitBranch(true_block, false_block, ne, scratch, Operand(zero_reg)); | 1682 EmitBranch(true_block, false_block, ne, scratch, Operand(zero_reg)); |
1683 } | 1683 } |
1684 } | 1684 } |
1685 | 1685 |
1686 | 1686 |
1687 Condition LCodeGen::EmitIsObject(Register input, | 1687 Condition LCodeGen::EmitIsObject(Register input, |
1688 Register temp1, | 1688 Register temp1, |
| 1689 Register temp2, |
1689 Label* is_not_object, | 1690 Label* is_not_object, |
1690 Label* is_object) { | 1691 Label* is_object) { |
1691 Register temp2 = scratch0(); | |
1692 __ JumpIfSmi(input, is_not_object); | 1692 __ JumpIfSmi(input, is_not_object); |
1693 | 1693 |
1694 __ LoadRoot(temp2, Heap::kNullValueRootIndex); | 1694 __ LoadRoot(temp2, Heap::kNullValueRootIndex); |
1695 __ Branch(is_object, eq, input, Operand(temp2)); | 1695 __ Branch(is_object, eq, input, Operand(temp2)); |
1696 | 1696 |
1697 // Load map. | 1697 // Load map. |
1698 __ lw(temp1, FieldMemOperand(input, HeapObject::kMapOffset)); | 1698 __ lw(temp1, FieldMemOperand(input, HeapObject::kMapOffset)); |
1699 // Undetectable objects behave like undefined. | 1699 // Undetectable objects behave like undefined. |
1700 __ lbu(temp2, FieldMemOperand(temp1, Map::kBitFieldOffset)); | 1700 __ lbu(temp2, FieldMemOperand(temp1, Map::kBitFieldOffset)); |
1701 __ And(temp2, temp2, Operand(1 << Map::kIsUndetectable)); | 1701 __ And(temp2, temp2, Operand(1 << Map::kIsUndetectable)); |
(...skipping 12 matching lines...) Expand all Loading... |
1714 Register reg = ToRegister(instr->InputAt(0)); | 1714 Register reg = ToRegister(instr->InputAt(0)); |
1715 Register temp1 = ToRegister(instr->TempAt(0)); | 1715 Register temp1 = ToRegister(instr->TempAt(0)); |
1716 Register temp2 = scratch0(); | 1716 Register temp2 = scratch0(); |
1717 | 1717 |
1718 int true_block = chunk_->LookupDestination(instr->true_block_id()); | 1718 int true_block = chunk_->LookupDestination(instr->true_block_id()); |
1719 int false_block = chunk_->LookupDestination(instr->false_block_id()); | 1719 int false_block = chunk_->LookupDestination(instr->false_block_id()); |
1720 Label* true_label = chunk_->GetAssemblyLabel(true_block); | 1720 Label* true_label = chunk_->GetAssemblyLabel(true_block); |
1721 Label* false_label = chunk_->GetAssemblyLabel(false_block); | 1721 Label* false_label = chunk_->GetAssemblyLabel(false_block); |
1722 | 1722 |
1723 Condition true_cond = | 1723 Condition true_cond = |
1724 EmitIsObject(reg, temp1, false_label, true_label); | 1724 EmitIsObject(reg, temp1, temp2, false_label, true_label); |
1725 | 1725 |
1726 EmitBranch(true_block, false_block, true_cond, temp2, | 1726 EmitBranch(true_block, false_block, true_cond, temp2, |
1727 Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE)); | 1727 Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE)); |
1728 } | 1728 } |
1729 | 1729 |
1730 | 1730 |
1731 void LCodeGen::DoIsSmiAndBranch(LIsSmiAndBranch* instr) { | 1731 void LCodeGen::DoIsSmiAndBranch(LIsSmiAndBranch* instr) { |
1732 int true_block = chunk_->LookupDestination(instr->true_block_id()); | 1732 int true_block = chunk_->LookupDestination(instr->true_block_id()); |
1733 int false_block = chunk_->LookupDestination(instr->false_block_id()); | 1733 int false_block = chunk_->LookupDestination(instr->false_block_id()); |
1734 | 1734 |
(...skipping 2887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4622 ASSERT(!environment->HasBeenRegistered()); | 4622 ASSERT(!environment->HasBeenRegistered()); |
4623 RegisterEnvironmentForDeoptimization(environment); | 4623 RegisterEnvironmentForDeoptimization(environment); |
4624 ASSERT(osr_pc_offset_ == -1); | 4624 ASSERT(osr_pc_offset_ == -1); |
4625 osr_pc_offset_ = masm()->pc_offset(); | 4625 osr_pc_offset_ = masm()->pc_offset(); |
4626 } | 4626 } |
4627 | 4627 |
4628 | 4628 |
4629 #undef __ | 4629 #undef __ |
4630 | 4630 |
4631 } } // namespace v8::internal | 4631 } } // namespace v8::internal |
OLD | NEW |