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 1746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1757 Label map_check_; | 1757 Label map_check_; |
1758 }; | 1758 }; |
1759 | 1759 |
1760 DeferredInstanceOfKnownGlobal* deferred; | 1760 DeferredInstanceOfKnownGlobal* deferred; |
1761 deferred = new DeferredInstanceOfKnownGlobal(this, instr); | 1761 deferred = new DeferredInstanceOfKnownGlobal(this, instr); |
1762 | 1762 |
1763 Label done, false_result; | 1763 Label done, false_result; |
1764 Register object = ToRegister(instr->InputAt(0)); | 1764 Register object = ToRegister(instr->InputAt(0)); |
1765 Register temp = ToRegister(instr->TempAt(0)); | 1765 Register temp = ToRegister(instr->TempAt(0)); |
1766 | 1766 |
1767 // A Smi is not instance of anything. | 1767 // A Smi is not an instance of anything. |
1768 __ test(object, Immediate(kSmiTagMask)); | 1768 __ test(object, Immediate(kSmiTagMask)); |
1769 __ j(zero, &false_result, not_taken); | 1769 __ j(zero, &false_result, not_taken); |
1770 | 1770 |
1771 // This is the inlined call site instanceof cache. The two occourences of the | 1771 // This is the inlined call site instanceof cache. The two occurences of the |
1772 // hole value will be patched to the last map/result pair generated by the | 1772 // hole value will be patched to the last map/result pair generated by the |
1773 // instanceof stub. | 1773 // instanceof stub. |
1774 NearLabel cache_miss; | 1774 NearLabel cache_miss; |
1775 Register map = ToRegister(instr->TempAt(0)); | 1775 Register map = ToRegister(instr->TempAt(0)); |
1776 __ mov(map, FieldOperand(object, HeapObject::kMapOffset)); | 1776 __ mov(map, FieldOperand(object, HeapObject::kMapOffset)); |
1777 __ bind(deferred->map_check()); // Label for calculating code patching. | 1777 __ bind(deferred->map_check()); // Label for calculating code patching. |
1778 __ cmp(map, Factory::the_hole_value()); // Patched to cached map. | 1778 __ cmp(map, Factory::the_hole_value()); // Patched to cached map. |
1779 __ j(not_equal, &cache_miss, not_taken); | 1779 __ j(not_equal, &cache_miss, not_taken); |
1780 __ mov(eax, Factory::the_hole_value()); // Patched to either true or false. | 1780 __ mov(eax, Factory::the_hole_value()); // Patched to either true or false. |
1781 __ jmp(&done); | 1781 __ jmp(&done); |
1782 | 1782 |
1783 // The inlined call site cache did not match. Check null and string before | 1783 // The inlined call site cache did not match. Check for null and string |
1784 // calling the deferred code. | 1784 // before calling the deferred code. |
1785 __ bind(&cache_miss); | 1785 __ bind(&cache_miss); |
1786 // Null is not instance of anything. | 1786 // Null is not an instance of anything. |
1787 __ cmp(object, Factory::null_value()); | 1787 __ cmp(object, Factory::null_value()); |
1788 __ j(equal, &false_result); | 1788 __ j(equal, &false_result); |
1789 | 1789 |
1790 // String values are not instances of anything. | 1790 // String values are not instances of anything. |
1791 Condition is_string = masm_->IsObjectStringType(object, temp, temp); | 1791 Condition is_string = masm_->IsObjectStringType(object, temp, temp); |
1792 __ j(is_string, &false_result); | 1792 __ j(is_string, &false_result); |
1793 | 1793 |
1794 // Go to the deferred code. | 1794 // Go to the deferred code. |
1795 __ jmp(deferred->entry()); | 1795 __ jmp(deferred->entry()); |
1796 | 1796 |
(...skipping 1970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3767 ASSERT(osr_pc_offset_ == -1); | 3767 ASSERT(osr_pc_offset_ == -1); |
3768 osr_pc_offset_ = masm()->pc_offset(); | 3768 osr_pc_offset_ = masm()->pc_offset(); |
3769 } | 3769 } |
3770 | 3770 |
3771 | 3771 |
3772 #undef __ | 3772 #undef __ |
3773 | 3773 |
3774 } } // namespace v8::internal | 3774 } } // namespace v8::internal |
3775 | 3775 |
3776 #endif // V8_TARGET_ARCH_IA32 | 3776 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |