| 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 20 matching lines...) Expand all Loading... |
| 31 #include "hydrogen.h" | 31 #include "hydrogen.h" |
| 32 #include "lithium-allocator.h" | 32 #include "lithium-allocator.h" |
| 33 #include "lithium.h" | 33 #include "lithium.h" |
| 34 #include "safepoint-table.h" | 34 #include "safepoint-table.h" |
| 35 | 35 |
| 36 namespace v8 { | 36 namespace v8 { |
| 37 namespace internal { | 37 namespace internal { |
| 38 | 38 |
| 39 // Forward declarations. | 39 // Forward declarations. |
| 40 class LCodeGen; | 40 class LCodeGen; |
| 41 class LEnvironment; | |
| 42 class Translation; | |
| 43 | 41 |
| 44 | 42 |
| 45 // Type hierarchy: | 43 // Type hierarchy: |
| 46 // | 44 // |
| 47 // LInstruction | 45 // LInstruction |
| 48 // LAccessArgumentsAt | 46 // LAccessArgumentsAt |
| 49 // LArgumentsElements | 47 // LArgumentsElements |
| 50 // LArgumentsLength | 48 // LArgumentsLength |
| 51 // LBinaryOperation | 49 // LBinaryOperation |
| 52 // LAddI | 50 // LAddI |
| (...skipping 1699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1752 LOperand* double_register_spills_[DoubleRegister::kNumAllocatableRegisters]; | 1750 LOperand* double_register_spills_[DoubleRegister::kNumAllocatableRegisters]; |
| 1753 }; | 1751 }; |
| 1754 | 1752 |
| 1755 | 1753 |
| 1756 class LStackCheck: public LInstruction { | 1754 class LStackCheck: public LInstruction { |
| 1757 public: | 1755 public: |
| 1758 DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check") | 1756 DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check") |
| 1759 }; | 1757 }; |
| 1760 | 1758 |
| 1761 | 1759 |
| 1762 class LPointerMap: public ZoneObject { | |
| 1763 public: | |
| 1764 explicit LPointerMap(int position) | |
| 1765 : pointer_operands_(8), position_(position), lithium_position_(-1) { } | |
| 1766 | |
| 1767 const ZoneList<LOperand*>* operands() const { return &pointer_operands_; } | |
| 1768 int position() const { return position_; } | |
| 1769 int lithium_position() const { return lithium_position_; } | |
| 1770 | |
| 1771 void set_lithium_position(int pos) { | |
| 1772 ASSERT(lithium_position_ == -1); | |
| 1773 lithium_position_ = pos; | |
| 1774 } | |
| 1775 | |
| 1776 void RecordPointer(LOperand* op); | |
| 1777 void PrintTo(StringStream* stream) const; | |
| 1778 | |
| 1779 private: | |
| 1780 ZoneList<LOperand*> pointer_operands_; | |
| 1781 int position_; | |
| 1782 int lithium_position_; | |
| 1783 }; | |
| 1784 | |
| 1785 | |
| 1786 class LEnvironment: public ZoneObject { | |
| 1787 public: | |
| 1788 LEnvironment(Handle<JSFunction> closure, | |
| 1789 int ast_id, | |
| 1790 int parameter_count, | |
| 1791 int argument_count, | |
| 1792 int value_count, | |
| 1793 LEnvironment* outer) | |
| 1794 : closure_(closure), | |
| 1795 arguments_stack_height_(argument_count), | |
| 1796 deoptimization_index_(Safepoint::kNoDeoptimizationIndex), | |
| 1797 translation_index_(-1), | |
| 1798 ast_id_(ast_id), | |
| 1799 parameter_count_(parameter_count), | |
| 1800 values_(value_count), | |
| 1801 representations_(value_count), | |
| 1802 spilled_registers_(NULL), | |
| 1803 spilled_double_registers_(NULL), | |
| 1804 outer_(outer) { | |
| 1805 } | |
| 1806 | |
| 1807 Handle<JSFunction> closure() const { return closure_; } | |
| 1808 int arguments_stack_height() const { return arguments_stack_height_; } | |
| 1809 int deoptimization_index() const { return deoptimization_index_; } | |
| 1810 int translation_index() const { return translation_index_; } | |
| 1811 int ast_id() const { return ast_id_; } | |
| 1812 int parameter_count() const { return parameter_count_; } | |
| 1813 const ZoneList<LOperand*>* values() const { return &values_; } | |
| 1814 LEnvironment* outer() const { return outer_; } | |
| 1815 | |
| 1816 void AddValue(LOperand* operand, Representation representation) { | |
| 1817 values_.Add(operand); | |
| 1818 representations_.Add(representation); | |
| 1819 } | |
| 1820 | |
| 1821 bool HasTaggedValueAt(int index) const { | |
| 1822 return representations_[index].IsTagged(); | |
| 1823 } | |
| 1824 | |
| 1825 void Register(int deoptimization_index, int translation_index) { | |
| 1826 ASSERT(!HasBeenRegistered()); | |
| 1827 deoptimization_index_ = deoptimization_index; | |
| 1828 translation_index_ = translation_index; | |
| 1829 } | |
| 1830 bool HasBeenRegistered() const { | |
| 1831 return deoptimization_index_ != Safepoint::kNoDeoptimizationIndex; | |
| 1832 } | |
| 1833 | |
| 1834 void SetSpilledRegisters(LOperand** registers, | |
| 1835 LOperand** double_registers) { | |
| 1836 spilled_registers_ = registers; | |
| 1837 spilled_double_registers_ = double_registers; | |
| 1838 } | |
| 1839 | |
| 1840 // Emit frame translation commands for this environment. | |
| 1841 void WriteTranslation(LCodeGen* cgen, Translation* translation) const; | |
| 1842 | |
| 1843 void PrintTo(StringStream* stream) const; | |
| 1844 | |
| 1845 private: | |
| 1846 Handle<JSFunction> closure_; | |
| 1847 int arguments_stack_height_; | |
| 1848 int deoptimization_index_; | |
| 1849 int translation_index_; | |
| 1850 int ast_id_; | |
| 1851 int parameter_count_; | |
| 1852 ZoneList<LOperand*> values_; | |
| 1853 ZoneList<Representation> representations_; | |
| 1854 | |
| 1855 // Allocation index indexed arrays of spill slot operands for registers | |
| 1856 // that are also in spill slots at an OSR entry. NULL for environments | |
| 1857 // that do not correspond to an OSR entry. | |
| 1858 LOperand** spilled_registers_; | |
| 1859 LOperand** spilled_double_registers_; | |
| 1860 | |
| 1861 LEnvironment* outer_; | |
| 1862 }; | |
| 1863 | |
| 1864 class LChunkBuilder; | 1760 class LChunkBuilder; |
| 1865 class LChunk: public ZoneObject { | 1761 class LChunk: public ZoneObject { |
| 1866 public: | 1762 public: |
| 1867 explicit LChunk(HGraph* graph); | 1763 explicit LChunk(HGraph* graph); |
| 1868 | 1764 |
| 1869 int AddInstruction(LInstruction* instruction, HBasicBlock* block); | 1765 int AddInstruction(LInstruction* instruction, HBasicBlock* block); |
| 1870 LConstantOperand* DefineConstantOperand(HConstant* constant); | 1766 LConstantOperand* DefineConstantOperand(HConstant* constant); |
| 1871 Handle<Object> LookupLiteral(LConstantOperand* operand) const; | 1767 Handle<Object> LookupLiteral(LConstantOperand* operand) const; |
| 1872 Representation LookupLiteralRepresentation(LConstantOperand* operand) const; | 1768 Representation LookupLiteralRepresentation(LConstantOperand* operand) const; |
| 1873 | 1769 |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2053 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 1949 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
| 2054 }; | 1950 }; |
| 2055 | 1951 |
| 2056 #undef DECLARE_HYDROGEN_ACCESSOR | 1952 #undef DECLARE_HYDROGEN_ACCESSOR |
| 2057 #undef DECLARE_INSTRUCTION | 1953 #undef DECLARE_INSTRUCTION |
| 2058 #undef DECLARE_CONCRETE_INSTRUCTION | 1954 #undef DECLARE_CONCRETE_INSTRUCTION |
| 2059 | 1955 |
| 2060 } } // namespace v8::internal | 1956 } } // namespace v8::internal |
| 2061 | 1957 |
| 2062 #endif // V8_ARM_LITHIUM_ARM_H_ | 1958 #endif // V8_ARM_LITHIUM_ARM_H_ |
| OLD | NEW |