| 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 1635 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1646   Label* false_label = chunk_->GetAssemblyLabel(false_block); | 1646   Label* false_label = chunk_->GetAssemblyLabel(false_block); | 
| 1647 | 1647 | 
| 1648   __ test(input, Immediate(kSmiTagMask)); | 1648   __ test(input, Immediate(kSmiTagMask)); | 
| 1649   __ j(zero, false_label); | 1649   __ j(zero, false_label); | 
| 1650 | 1650 | 
| 1651   __ CmpObjectType(input, TestType(instr->hydrogen()), temp); | 1651   __ CmpObjectType(input, TestType(instr->hydrogen()), temp); | 
| 1652   EmitBranch(true_block, false_block, BranchCondition(instr->hydrogen())); | 1652   EmitBranch(true_block, false_block, BranchCondition(instr->hydrogen())); | 
| 1653 } | 1653 } | 
| 1654 | 1654 | 
| 1655 | 1655 | 
|  | 1656 void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) { | 
|  | 1657   Register input = ToRegister(instr->InputAt(0)); | 
|  | 1658   Register result = ToRegister(instr->result()); | 
|  | 1659 | 
|  | 1660   if (FLAG_debug_code) { | 
|  | 1661     __ AbortIfNotString(input); | 
|  | 1662   } | 
|  | 1663 | 
|  | 1664   __ mov(result, FieldOperand(input, String::kHashFieldOffset)); | 
|  | 1665   __ IndexFromHash(result, result); | 
|  | 1666 } | 
|  | 1667 | 
|  | 1668 | 
| 1656 void LCodeGen::DoHasCachedArrayIndex(LHasCachedArrayIndex* instr) { | 1669 void LCodeGen::DoHasCachedArrayIndex(LHasCachedArrayIndex* instr) { | 
| 1657   Register input = ToRegister(instr->InputAt(0)); | 1670   Register input = ToRegister(instr->InputAt(0)); | 
| 1658   Register result = ToRegister(instr->result()); | 1671   Register result = ToRegister(instr->result()); | 
| 1659 | 1672 | 
| 1660   ASSERT(instr->hydrogen()->value()->representation().IsTagged()); | 1673   ASSERT(instr->hydrogen()->value()->representation().IsTagged()); | 
| 1661   __ mov(result, Factory::true_value()); | 1674   __ mov(result, Factory::true_value()); | 
| 1662   __ test(FieldOperand(input, String::kHashFieldOffset), | 1675   __ test(FieldOperand(input, String::kHashFieldOffset), | 
| 1663           Immediate(String::kContainsCachedArrayIndexMask)); | 1676           Immediate(String::kContainsCachedArrayIndexMask)); | 
| 1664   NearLabel done; | 1677   NearLabel done; | 
| 1665   __ j(not_zero, &done); | 1678   __ j(zero, &done); | 
| 1666   __ mov(result, Factory::false_value()); | 1679   __ mov(result, Factory::false_value()); | 
| 1667   __ bind(&done); | 1680   __ bind(&done); | 
| 1668 } | 1681 } | 
| 1669 | 1682 | 
| 1670 | 1683 | 
| 1671 void LCodeGen::DoHasCachedArrayIndexAndBranch( | 1684 void LCodeGen::DoHasCachedArrayIndexAndBranch( | 
| 1672     LHasCachedArrayIndexAndBranch* instr) { | 1685     LHasCachedArrayIndexAndBranch* instr) { | 
| 1673   Register input = ToRegister(instr->InputAt(0)); | 1686   Register input = ToRegister(instr->InputAt(0)); | 
| 1674 | 1687 | 
| 1675   int true_block = chunk_->LookupDestination(instr->true_block_id()); | 1688   int true_block = chunk_->LookupDestination(instr->true_block_id()); | 
| 1676   int false_block = chunk_->LookupDestination(instr->false_block_id()); | 1689   int false_block = chunk_->LookupDestination(instr->false_block_id()); | 
| 1677 | 1690 | 
| 1678   __ test(FieldOperand(input, String::kHashFieldOffset), | 1691   __ test(FieldOperand(input, String::kHashFieldOffset), | 
| 1679           Immediate(String::kContainsCachedArrayIndexMask)); | 1692           Immediate(String::kContainsCachedArrayIndexMask)); | 
| 1680   EmitBranch(true_block, false_block, not_equal); | 1693   EmitBranch(true_block, false_block, equal); | 
| 1681 } | 1694 } | 
| 1682 | 1695 | 
| 1683 | 1696 | 
| 1684 // Branches to a label or falls through with the answer in the z flag.  Trashes | 1697 // Branches to a label or falls through with the answer in the z flag.  Trashes | 
| 1685 // the temp registers, but not the input.  Only input and temp2 may alias. | 1698 // the temp registers, but not the input.  Only input and temp2 may alias. | 
| 1686 void LCodeGen::EmitClassOfTest(Label* is_true, | 1699 void LCodeGen::EmitClassOfTest(Label* is_true, | 
| 1687                                Label* is_false, | 1700                                Label* is_false, | 
| 1688                                Handle<String>class_name, | 1701                                Handle<String>class_name, | 
| 1689                                Register input, | 1702                                Register input, | 
| 1690                                Register temp, | 1703                                Register temp, | 
| (...skipping 2180 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 3871   ASSERT(osr_pc_offset_ == -1); | 3884   ASSERT(osr_pc_offset_ == -1); | 
| 3872   osr_pc_offset_ = masm()->pc_offset(); | 3885   osr_pc_offset_ = masm()->pc_offset(); | 
| 3873 } | 3886 } | 
| 3874 | 3887 | 
| 3875 | 3888 | 
| 3876 #undef __ | 3889 #undef __ | 
| 3877 | 3890 | 
| 3878 } }  // namespace v8::internal | 3891 } }  // namespace v8::internal | 
| 3879 | 3892 | 
| 3880 #endif  // V8_TARGET_ARCH_IA32 | 3893 #endif  // V8_TARGET_ARCH_IA32 | 
| OLD | NEW | 
|---|