| 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 1706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1717 Register input = ToRegister(instr->InputAt(0)); | 1717 Register input = ToRegister(instr->InputAt(0)); |
| 1718 is_smi = masm()->CheckSmi(input); | 1718 is_smi = masm()->CheckSmi(input); |
| 1719 } else { | 1719 } else { |
| 1720 Operand input = ToOperand(instr->InputAt(0)); | 1720 Operand input = ToOperand(instr->InputAt(0)); |
| 1721 is_smi = masm()->CheckSmi(input); | 1721 is_smi = masm()->CheckSmi(input); |
| 1722 } | 1722 } |
| 1723 EmitBranch(true_block, false_block, is_smi); | 1723 EmitBranch(true_block, false_block, is_smi); |
| 1724 } | 1724 } |
| 1725 | 1725 |
| 1726 | 1726 |
| 1727 void LCodeGen::DoIsUndetectable(LIsUndetectable* instr) { |
| 1728 Register input = ToRegister(instr->InputAt(0)); |
| 1729 Register result = ToRegister(instr->result()); |
| 1730 |
| 1731 ASSERT(instr->hydrogen()->value()->representation().IsTagged()); |
| 1732 Label false_label, done; |
| 1733 __ JumpIfSmi(input, &false_label); |
| 1734 __ movq(result, FieldOperand(input, HeapObject::kMapOffset)); |
| 1735 __ testb(FieldOperand(result, Map::kBitFieldOffset), |
| 1736 Immediate(1 << Map::kIsUndetectable)); |
| 1737 __ j(zero, &false_label); |
| 1738 __ LoadRoot(result, Heap::kTrueValueRootIndex); |
| 1739 __ jmp(&done); |
| 1740 __ bind(&false_label); |
| 1741 __ LoadRoot(result, Heap::kFalseValueRootIndex); |
| 1742 __ bind(&done); |
| 1743 } |
| 1744 |
| 1745 |
| 1746 void LCodeGen::DoIsUndetectableAndBranch(LIsUndetectableAndBranch* instr) { |
| 1747 Register input = ToRegister(instr->InputAt(0)); |
| 1748 Register temp = ToRegister(instr->TempAt(0)); |
| 1749 |
| 1750 int true_block = chunk_->LookupDestination(instr->true_block_id()); |
| 1751 int false_block = chunk_->LookupDestination(instr->false_block_id()); |
| 1752 |
| 1753 __ JumpIfSmi(input, chunk_->GetAssemblyLabel(false_block)); |
| 1754 __ movq(temp, FieldOperand(input, HeapObject::kMapOffset)); |
| 1755 __ testb(FieldOperand(temp, Map::kBitFieldOffset), |
| 1756 Immediate(1 << Map::kIsUndetectable)); |
| 1757 EmitBranch(true_block, false_block, not_zero); |
| 1758 } |
| 1759 |
| 1760 |
| 1727 static InstanceType TestType(HHasInstanceType* instr) { | 1761 static InstanceType TestType(HHasInstanceType* instr) { |
| 1728 InstanceType from = instr->from(); | 1762 InstanceType from = instr->from(); |
| 1729 InstanceType to = instr->to(); | 1763 InstanceType to = instr->to(); |
| 1730 if (from == FIRST_TYPE) return to; | 1764 if (from == FIRST_TYPE) return to; |
| 1731 ASSERT(from == to || to == LAST_TYPE); | 1765 ASSERT(from == to || to == LAST_TYPE); |
| 1732 return from; | 1766 return from; |
| 1733 } | 1767 } |
| 1734 | 1768 |
| 1735 | 1769 |
| 1736 static Condition BranchCondition(HHasInstanceType* instr) { | 1770 static Condition BranchCondition(HHasInstanceType* instr) { |
| (...skipping 2385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4122 RegisterEnvironmentForDeoptimization(environment); | 4156 RegisterEnvironmentForDeoptimization(environment); |
| 4123 ASSERT(osr_pc_offset_ == -1); | 4157 ASSERT(osr_pc_offset_ == -1); |
| 4124 osr_pc_offset_ = masm()->pc_offset(); | 4158 osr_pc_offset_ = masm()->pc_offset(); |
| 4125 } | 4159 } |
| 4126 | 4160 |
| 4127 #undef __ | 4161 #undef __ |
| 4128 | 4162 |
| 4129 } } // namespace v8::internal | 4163 } } // namespace v8::internal |
| 4130 | 4164 |
| 4131 #endif // V8_TARGET_ARCH_X64 | 4165 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |