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 1684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1695 Operand input = ToOperand(instr->InputAt(0)); | 1695 Operand input = ToOperand(instr->InputAt(0)); |
1696 | 1696 |
1697 int true_block = chunk_->LookupDestination(instr->true_block_id()); | 1697 int true_block = chunk_->LookupDestination(instr->true_block_id()); |
1698 int false_block = chunk_->LookupDestination(instr->false_block_id()); | 1698 int false_block = chunk_->LookupDestination(instr->false_block_id()); |
1699 | 1699 |
1700 __ test(input, Immediate(kSmiTagMask)); | 1700 __ test(input, Immediate(kSmiTagMask)); |
1701 EmitBranch(true_block, false_block, zero); | 1701 EmitBranch(true_block, false_block, zero); |
1702 } | 1702 } |
1703 | 1703 |
1704 | 1704 |
| 1705 void LCodeGen::DoIsUndetectable(LIsUndetectable* instr) { |
| 1706 Register input = ToRegister(instr->InputAt(0)); |
| 1707 Register result = ToRegister(instr->result()); |
| 1708 |
| 1709 ASSERT(instr->hydrogen()->value()->representation().IsTagged()); |
| 1710 Label false_label, done; |
| 1711 STATIC_ASSERT(kSmiTag == 0); |
| 1712 __ test(input, Immediate(kSmiTagMask)); |
| 1713 __ j(zero, &false_label, Label::kNear); |
| 1714 __ mov(result, FieldOperand(input, HeapObject::kMapOffset)); |
| 1715 __ test_b(FieldOperand(result, Map::kBitFieldOffset), |
| 1716 1 << Map::kIsUndetectable); |
| 1717 __ j(zero, &false_label, Label::kNear); |
| 1718 __ mov(result, factory()->true_value()); |
| 1719 __ jmp(&done); |
| 1720 __ bind(&false_label); |
| 1721 __ mov(result, factory()->false_value()); |
| 1722 __ bind(&done); |
| 1723 } |
| 1724 |
| 1725 |
| 1726 void LCodeGen::DoIsUndetectableAndBranch(LIsUndetectableAndBranch* instr) { |
| 1727 Register input = ToRegister(instr->InputAt(0)); |
| 1728 Register temp = ToRegister(instr->TempAt(0)); |
| 1729 |
| 1730 int true_block = chunk_->LookupDestination(instr->true_block_id()); |
| 1731 int false_block = chunk_->LookupDestination(instr->false_block_id()); |
| 1732 |
| 1733 STATIC_ASSERT(kSmiTag == 0); |
| 1734 __ test(input, Immediate(kSmiTagMask)); |
| 1735 __ j(zero, chunk_->GetAssemblyLabel(false_block)); |
| 1736 __ mov(temp, FieldOperand(input, HeapObject::kMapOffset)); |
| 1737 __ test_b(FieldOperand(temp, Map::kBitFieldOffset), |
| 1738 1 << Map::kIsUndetectable); |
| 1739 EmitBranch(true_block, false_block, not_zero); |
| 1740 } |
| 1741 |
| 1742 |
1705 static InstanceType TestType(HHasInstanceType* instr) { | 1743 static InstanceType TestType(HHasInstanceType* instr) { |
1706 InstanceType from = instr->from(); | 1744 InstanceType from = instr->from(); |
1707 InstanceType to = instr->to(); | 1745 InstanceType to = instr->to(); |
1708 if (from == FIRST_TYPE) return to; | 1746 if (from == FIRST_TYPE) return to; |
1709 ASSERT(from == to || to == LAST_TYPE); | 1747 ASSERT(from == to || to == LAST_TYPE); |
1710 return from; | 1748 return from; |
1711 } | 1749 } |
1712 | 1750 |
1713 | 1751 |
1714 static Condition BranchCondition(HHasInstanceType* instr) { | 1752 static Condition BranchCondition(HHasInstanceType* instr) { |
(...skipping 2605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4320 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); | 4358 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
4321 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); | 4359 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); |
4322 } | 4360 } |
4323 | 4361 |
4324 | 4362 |
4325 #undef __ | 4363 #undef __ |
4326 | 4364 |
4327 } } // namespace v8::internal | 4365 } } // namespace v8::internal |
4328 | 4366 |
4329 #endif // V8_TARGET_ARCH_IA32 | 4367 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |