| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 59 |
| 60 // Simple accessors. | 60 // Simple accessors. |
| 61 int block_id() const { return block_id_; } | 61 int block_id() const { return block_id_; } |
| 62 void set_block_id(int id) { block_id_ = id; } | 62 void set_block_id(int id) { block_id_ = id; } |
| 63 HGraph* graph() const { return graph_; } | 63 HGraph* graph() const { return graph_; } |
| 64 Isolate* isolate() const; | 64 Isolate* isolate() const; |
| 65 const ZoneList<HPhi*>* phis() const { return &phis_; } | 65 const ZoneList<HPhi*>* phis() const { return &phis_; } |
| 66 HInstruction* first() const { return first_; } | 66 HInstruction* first() const { return first_; } |
| 67 HInstruction* last() const { return last_; } | 67 HInstruction* last() const { return last_; } |
| 68 void set_last(HInstruction* instr) { last_ = instr; } | 68 void set_last(HInstruction* instr) { last_ = instr; } |
| 69 HInstruction* GetLastInstruction(); |
| 69 HControlInstruction* end() const { return end_; } | 70 HControlInstruction* end() const { return end_; } |
| 70 HLoopInformation* loop_information() const { return loop_information_; } | 71 HLoopInformation* loop_information() const { return loop_information_; } |
| 71 const ZoneList<HBasicBlock*>* predecessors() const { return &predecessors_; } | 72 const ZoneList<HBasicBlock*>* predecessors() const { return &predecessors_; } |
| 72 bool HasPredecessor() const { return predecessors_.length() > 0; } | 73 bool HasPredecessor() const { return predecessors_.length() > 0; } |
| 73 const ZoneList<HBasicBlock*>* dominated_blocks() const { | 74 const ZoneList<HBasicBlock*>* dominated_blocks() const { |
| 74 return &dominated_blocks_; | 75 return &dominated_blocks_; |
| 75 } | 76 } |
| 76 const ZoneList<int>* deleted_phis() const { | 77 const ZoneList<int>* deleted_phis() const { |
| 77 return &deleted_phis_; | 78 return &deleted_phis_; |
| 78 } | 79 } |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 HEnvironment* start_environment() const { return start_environment_; } | 277 HEnvironment* start_environment() const { return start_environment_; } |
| 277 | 278 |
| 278 void FinalizeUniqueValueIds(); | 279 void FinalizeUniqueValueIds(); |
| 279 void InitializeInferredTypes(); | 280 void InitializeInferredTypes(); |
| 280 void InsertTypeConversions(); | 281 void InsertTypeConversions(); |
| 281 void MergeRemovableSimulates(); | 282 void MergeRemovableSimulates(); |
| 282 void InsertRepresentationChanges(); | 283 void InsertRepresentationChanges(); |
| 283 void MarkDeoptimizeOnUndefined(); | 284 void MarkDeoptimizeOnUndefined(); |
| 284 void ComputeMinusZeroChecks(); | 285 void ComputeMinusZeroChecks(); |
| 285 void ComputeSafeUint32Operations(); | 286 void ComputeSafeUint32Operations(); |
| 286 void GlobalValueNumbering(); | |
| 287 bool ProcessArgumentsObject(); | 287 bool ProcessArgumentsObject(); |
| 288 void EliminateRedundantPhis(); | 288 void EliminateRedundantPhis(); |
| 289 void Canonicalize(); | 289 void Canonicalize(); |
| 290 void OrderBlocks(); | 290 void OrderBlocks(); |
| 291 void AssignDominators(); | 291 void AssignDominators(); |
| 292 void SetupInformativeDefinitions(); | 292 void SetupInformativeDefinitions(); |
| 293 void EliminateRedundantBoundsChecks(); | 293 void EliminateRedundantBoundsChecks(); |
| 294 void DehoistSimpleArrayIndexComputations(); | 294 void DehoistSimpleArrayIndexComputations(); |
| 295 void RestoreActualValues(); | 295 void RestoreActualValues(); |
| 296 void DeadCodeElimination(const char *phase_name); | 296 void DeadCodeElimination(const char *phase_name); |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 if (uint32_instructions_ == NULL) { | 420 if (uint32_instructions_ == NULL) { |
| 421 uint32_instructions_ = new(zone()) ZoneList<HInstruction*>(4, zone()); | 421 uint32_instructions_ = new(zone()) ZoneList<HInstruction*>(4, zone()); |
| 422 } | 422 } |
| 423 uint32_instructions_->Add(instr, zone()); | 423 uint32_instructions_->Add(instr, zone()); |
| 424 } | 424 } |
| 425 | 425 |
| 426 private: | 426 private: |
| 427 HConstant* GetConstant(SetOncePointer<HConstant>* pointer, | 427 HConstant* GetConstant(SetOncePointer<HConstant>* pointer, |
| 428 int32_t integer_value); | 428 int32_t integer_value); |
| 429 | 429 |
| 430 template<class Phase> |
| 431 void Run() { Phase phase(this); phase.Run(); } |
| 432 |
| 430 void MarkLive(HValue* ref, HValue* instr, ZoneList<HValue*>* worklist); | 433 void MarkLive(HValue* ref, HValue* instr, ZoneList<HValue*>* worklist); |
| 431 void MarkLiveInstructions(); | 434 void MarkLiveInstructions(); |
| 432 void RemoveDeadInstructions(); | 435 void RemoveDeadInstructions(); |
| 433 void MarkAsDeoptimizingRecursively(HBasicBlock* block); | 436 void MarkAsDeoptimizingRecursively(HBasicBlock* block); |
| 434 void NullifyUnreachableInstructions(); | 437 void NullifyUnreachableInstructions(); |
| 435 void InsertTypeConversions(HInstruction* instr); | 438 void InsertTypeConversions(HInstruction* instr); |
| 436 void PropagateMinusZeroChecks(HValue* value, BitVector* visited); | 439 void PropagateMinusZeroChecks(HValue* value, BitVector* visited); |
| 437 void RecursivelyMarkPhiDeoptimizeOnUndefined(HPhi* phi); | 440 void RecursivelyMarkPhiDeoptimizeOnUndefined(HPhi* phi); |
| 438 void InsertRepresentationChangeForUse(HValue* value, | 441 void InsertRepresentationChangeForUse(HValue* value, |
| 439 HValue* use_value, | 442 HValue* use_value, |
| (...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1004 void DecrementInNoSideEffectsScope() { | 1007 void DecrementInNoSideEffectsScope() { |
| 1005 no_side_effects_scope_count_--; | 1008 no_side_effects_scope_count_--; |
| 1006 } | 1009 } |
| 1007 | 1010 |
| 1008 protected: | 1011 protected: |
| 1009 virtual bool BuildGraph() = 0; | 1012 virtual bool BuildGraph() = 0; |
| 1010 | 1013 |
| 1011 HBasicBlock* CreateBasicBlock(HEnvironment* env); | 1014 HBasicBlock* CreateBasicBlock(HEnvironment* env); |
| 1012 HBasicBlock* CreateLoopHeaderBlock(); | 1015 HBasicBlock* CreateLoopHeaderBlock(); |
| 1013 | 1016 |
| 1014 HValue* BuildCheckNonSmi(HValue* object); | 1017 HValue* BuildCheckHeapObject(HValue* object); |
| 1015 HValue* BuildCheckMap(HValue* obj, Handle<Map> map); | 1018 HValue* BuildCheckMap(HValue* obj, Handle<Map> map); |
| 1016 | 1019 |
| 1017 // Building common constructs | 1020 // Building common constructs |
| 1018 HInstruction* BuildExternalArrayElementAccess( | 1021 HInstruction* BuildExternalArrayElementAccess( |
| 1019 HValue* external_elements, | 1022 HValue* external_elements, |
| 1020 HValue* checked_key, | 1023 HValue* checked_key, |
| 1021 HValue* val, | 1024 HValue* val, |
| 1022 HValue* dependency, | 1025 HValue* dependency, |
| 1023 ElementsKind elements_kind, | 1026 ElementsKind elements_kind, |
| 1024 bool is_store); | 1027 bool is_store); |
| (...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1616 HBasicBlock* false_block); | 1619 HBasicBlock* false_block); |
| 1617 | 1620 |
| 1618 // Visit an argument subexpression and emit a push to the outgoing arguments. | 1621 // Visit an argument subexpression and emit a push to the outgoing arguments. |
| 1619 void VisitArgument(Expression* expr); | 1622 void VisitArgument(Expression* expr); |
| 1620 | 1623 |
| 1621 void VisitArgumentList(ZoneList<Expression*>* arguments); | 1624 void VisitArgumentList(ZoneList<Expression*>* arguments); |
| 1622 | 1625 |
| 1623 // Visit a list of expressions from left to right, each in a value context. | 1626 // Visit a list of expressions from left to right, each in a value context. |
| 1624 void VisitExpressions(ZoneList<Expression*>* exprs); | 1627 void VisitExpressions(ZoneList<Expression*>* exprs); |
| 1625 | 1628 |
| 1626 void AddPhi(HPhi* phi); | |
| 1627 | |
| 1628 void PushAndAdd(HInstruction* instr); | 1629 void PushAndAdd(HInstruction* instr); |
| 1629 | 1630 |
| 1630 // Remove the arguments from the bailout environment and emit instructions | 1631 // Remove the arguments from the bailout environment and emit instructions |
| 1631 // to push them as outgoing parameters. | 1632 // to push them as outgoing parameters. |
| 1632 template <class Instruction> HInstruction* PreProcessCall(Instruction* call); | 1633 template <class Instruction> HInstruction* PreProcessCall(Instruction* call); |
| 1633 | 1634 |
| 1634 static Representation ToRepresentation(TypeInfo info); | 1635 static Representation ToRepresentation(TypeInfo info); |
| 1635 static Representation ToRepresentation(Handle<Type> type); | 1636 static Representation ToRepresentation(Handle<Type> type); |
| 1636 | 1637 |
| 1637 void SetUpScope(Scope* scope); | 1638 void SetUpScope(Scope* scope); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 1662 int arguments_count, | 1663 int arguments_count, |
| 1663 HValue* implicit_return_value, | 1664 HValue* implicit_return_value, |
| 1664 BailoutId ast_id, | 1665 BailoutId ast_id, |
| 1665 BailoutId return_id, | 1666 BailoutId return_id, |
| 1666 InliningKind inlining_kind); | 1667 InliningKind inlining_kind); |
| 1667 | 1668 |
| 1668 bool TryInlineCall(Call* expr, bool drop_extra = false); | 1669 bool TryInlineCall(Call* expr, bool drop_extra = false); |
| 1669 bool TryInlineConstruct(CallNew* expr, HValue* implicit_return_value); | 1670 bool TryInlineConstruct(CallNew* expr, HValue* implicit_return_value); |
| 1670 bool TryInlineGetter(Handle<JSFunction> getter, Property* prop); | 1671 bool TryInlineGetter(Handle<JSFunction> getter, Property* prop); |
| 1671 bool TryInlineSetter(Handle<JSFunction> setter, | 1672 bool TryInlineSetter(Handle<JSFunction> setter, |
| 1672 Assignment* assignment, | 1673 BailoutId id, |
| 1674 BailoutId assignment_id, |
| 1673 HValue* implicit_return_value); | 1675 HValue* implicit_return_value); |
| 1674 bool TryInlineApply(Handle<JSFunction> function, | 1676 bool TryInlineApply(Handle<JSFunction> function, |
| 1675 Call* expr, | 1677 Call* expr, |
| 1676 int arguments_count); | 1678 int arguments_count); |
| 1677 bool TryInlineBuiltinMethodCall(Call* expr, | 1679 bool TryInlineBuiltinMethodCall(Call* expr, |
| 1678 HValue* receiver, | 1680 HValue* receiver, |
| 1679 Handle<Map> receiver_map, | 1681 Handle<Map> receiver_map, |
| 1680 CheckType check_type); | 1682 CheckType check_type); |
| 1681 bool TryInlineBuiltinFunctionCall(Call* expr, bool drop_extra); | 1683 bool TryInlineBuiltinFunctionCall(Call* expr, bool drop_extra); |
| 1682 | 1684 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 1695 void HandlePropertyAssignment(Assignment* expr); | 1697 void HandlePropertyAssignment(Assignment* expr); |
| 1696 void HandleCompoundAssignment(Assignment* expr); | 1698 void HandleCompoundAssignment(Assignment* expr); |
| 1697 void HandlePolymorphicLoadNamedField(Property* expr, | 1699 void HandlePolymorphicLoadNamedField(Property* expr, |
| 1698 HValue* object, | 1700 HValue* object, |
| 1699 SmallMapList* types, | 1701 SmallMapList* types, |
| 1700 Handle<String> name); | 1702 Handle<String> name); |
| 1701 HInstruction* TryLoadPolymorphicAsMonomorphic(Property* expr, | 1703 HInstruction* TryLoadPolymorphicAsMonomorphic(Property* expr, |
| 1702 HValue* object, | 1704 HValue* object, |
| 1703 SmallMapList* types, | 1705 SmallMapList* types, |
| 1704 Handle<String> name); | 1706 Handle<String> name); |
| 1705 void HandlePolymorphicStoreNamedField(Assignment* expr, | 1707 void HandlePolymorphicStoreNamedField(BailoutId id, |
| 1708 int position, |
| 1709 BailoutId assignment_id, |
| 1706 HValue* object, | 1710 HValue* object, |
| 1707 HValue* value, | 1711 HValue* value, |
| 1708 SmallMapList* types, | 1712 SmallMapList* types, |
| 1709 Handle<String> name); | 1713 Handle<String> name); |
| 1710 bool TryStorePolymorphicAsMonomorphic(Assignment* expr, | 1714 bool TryStorePolymorphicAsMonomorphic(int position, |
| 1715 BailoutId assignment_id, |
| 1711 HValue* object, | 1716 HValue* object, |
| 1712 HValue* value, | 1717 HValue* value, |
| 1713 SmallMapList* types, | 1718 SmallMapList* types, |
| 1714 Handle<String> name); | 1719 Handle<String> name); |
| 1715 void HandlePolymorphicCallNamed(Call* expr, | 1720 void HandlePolymorphicCallNamed(Call* expr, |
| 1716 HValue* receiver, | 1721 HValue* receiver, |
| 1717 SmallMapList* types, | 1722 SmallMapList* types, |
| 1718 Handle<String> name); | 1723 Handle<String> name); |
| 1719 void HandleLiteralCompareTypeof(CompareOperation* expr, | 1724 void HandleLiteralCompareTypeof(CompareOperation* expr, |
| 1720 HTypeof* typeof_expr, | 1725 HTypeof* typeof_expr, |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1776 HInstruction* BuildLoadNamedMonomorphic(HValue* object, | 1781 HInstruction* BuildLoadNamedMonomorphic(HValue* object, |
| 1777 Handle<String> name, | 1782 Handle<String> name, |
| 1778 Property* expr, | 1783 Property* expr, |
| 1779 Handle<Map> map); | 1784 Handle<Map> map); |
| 1780 | 1785 |
| 1781 void AddCheckMap(HValue* object, Handle<Map> map); | 1786 void AddCheckMap(HValue* object, Handle<Map> map); |
| 1782 | 1787 |
| 1783 void AddCheckMapsWithTransitions(HValue* object, | 1788 void AddCheckMapsWithTransitions(HValue* object, |
| 1784 Handle<Map> map); | 1789 Handle<Map> map); |
| 1785 | 1790 |
| 1791 void BuildStoreNamed(Expression* expression, |
| 1792 BailoutId id, |
| 1793 int position, |
| 1794 BailoutId assignment_id, |
| 1795 Property* prop, |
| 1796 HValue* object, |
| 1797 HValue* value); |
| 1798 |
| 1786 HInstruction* BuildStoreNamedField(HValue* object, | 1799 HInstruction* BuildStoreNamedField(HValue* object, |
| 1787 Handle<String> name, | 1800 Handle<String> name, |
| 1788 HValue* value, | 1801 HValue* value, |
| 1789 Handle<Map> map, | 1802 Handle<Map> map, |
| 1790 LookupResult* lookup); | 1803 LookupResult* lookup); |
| 1791 HInstruction* BuildStoreNamedGeneric(HValue* object, | 1804 HInstruction* BuildStoreNamedGeneric(HValue* object, |
| 1792 Handle<String> name, | 1805 Handle<String> name, |
| 1793 HValue* value); | 1806 HValue* value); |
| 1794 HInstruction* BuildCallSetter(HValue* object, | 1807 HInstruction* BuildCallSetter(HValue* object, |
| 1795 HValue* value, | 1808 HValue* value, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1810 | 1823 |
| 1811 HInstruction* BuildFastLiteral(HValue* context, | 1824 HInstruction* BuildFastLiteral(HValue* context, |
| 1812 Handle<JSObject> boilerplate_object, | 1825 Handle<JSObject> boilerplate_object, |
| 1813 Handle<JSObject> original_boilerplate_object, | 1826 Handle<JSObject> original_boilerplate_object, |
| 1814 int data_size, | 1827 int data_size, |
| 1815 int pointer_size, | 1828 int pointer_size, |
| 1816 AllocationSiteMode mode); | 1829 AllocationSiteMode mode); |
| 1817 | 1830 |
| 1818 void BuildEmitDeepCopy(Handle<JSObject> boilerplat_object, | 1831 void BuildEmitDeepCopy(Handle<JSObject> boilerplat_object, |
| 1819 Handle<JSObject> object, | 1832 Handle<JSObject> object, |
| 1820 HInstruction* result, | 1833 HInstruction* target, |
| 1821 int* offset, | 1834 int* offset, |
| 1835 HInstruction* data_target, |
| 1836 int* data_offset, |
| 1822 AllocationSiteMode mode); | 1837 AllocationSiteMode mode); |
| 1823 | 1838 |
| 1824 MUST_USE_RESULT HValue* BuildEmitObjectHeader( | 1839 MUST_USE_RESULT HValue* BuildEmitObjectHeader( |
| 1825 Handle<JSObject> boilerplat_object, | 1840 Handle<JSObject> boilerplat_object, |
| 1826 HInstruction* target, | 1841 HInstruction* target, |
| 1842 HInstruction* data_target, |
| 1827 int object_offset, | 1843 int object_offset, |
| 1828 int elements_offset, | 1844 int elements_offset, |
| 1829 int elements_size); | 1845 int elements_size); |
| 1830 | 1846 |
| 1831 void BuildEmitInObjectProperties(Handle<JSObject> boilerplate_object, | 1847 void BuildEmitInObjectProperties(Handle<JSObject> boilerplate_object, |
| 1832 Handle<JSObject> original_boilerplate_object, | 1848 Handle<JSObject> original_boilerplate_object, |
| 1833 HValue* object_properties, | 1849 HValue* object_properties, |
| 1834 HInstruction* target, | 1850 HInstruction* target, |
| 1835 int* offset); | 1851 int* offset, |
| 1852 HInstruction* data_target, |
| 1853 int* data_offset); |
| 1836 | 1854 |
| 1837 void BuildEmitElements(Handle<FixedArrayBase> elements, | 1855 void BuildEmitElements(Handle<FixedArrayBase> elements, |
| 1838 Handle<FixedArrayBase> original_elements, | 1856 Handle<FixedArrayBase> original_elements, |
| 1839 ElementsKind kind, | 1857 ElementsKind kind, |
| 1840 HValue* object_elements, | 1858 HValue* object_elements, |
| 1841 HInstruction* target, | 1859 HInstruction* target, |
| 1842 int* offset); | 1860 int* offset, |
| 1861 HInstruction* data_target, |
| 1862 int* data_offset); |
| 1843 | 1863 |
| 1844 void BuildEmitFixedDoubleArray(Handle<FixedArrayBase> elements, | 1864 void BuildEmitFixedDoubleArray(Handle<FixedArrayBase> elements, |
| 1845 ElementsKind kind, | 1865 ElementsKind kind, |
| 1846 HValue* object_elements); | 1866 HValue* object_elements); |
| 1847 | 1867 |
| 1848 void BuildEmitFixedArray(Handle<FixedArrayBase> elements, | 1868 void BuildEmitFixedArray(Handle<FixedArrayBase> elements, |
| 1849 Handle<FixedArrayBase> original_elements, | 1869 Handle<FixedArrayBase> original_elements, |
| 1850 ElementsKind kind, | 1870 ElementsKind kind, |
| 1851 HValue* object_elements, | 1871 HValue* object_elements, |
| 1852 HInstruction* target, | 1872 HInstruction* target, |
| 1853 int* offset); | 1873 int* offset, |
| 1874 HInstruction* data_target, |
| 1875 int* data_offset); |
| 1854 | 1876 |
| 1855 void AddCheckPrototypeMaps(Handle<JSObject> holder, | 1877 void AddCheckPrototypeMaps(Handle<JSObject> holder, |
| 1856 Handle<Map> receiver_map); | 1878 Handle<Map> receiver_map); |
| 1857 | 1879 |
| 1858 void AddCheckConstantFunction(Handle<JSObject> holder, | 1880 void AddCheckConstantFunction(Handle<JSObject> holder, |
| 1859 HValue* receiver, | 1881 HValue* receiver, |
| 1860 Handle<Map> receiver_map); | 1882 Handle<Map> receiver_map); |
| 1861 | 1883 |
| 1862 bool MatchRotateRight(HValue* left, | 1884 bool MatchRotateRight(HValue* left, |
| 1863 HValue* right, | 1885 HValue* right, |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1903 optimize_graph_(0), | 1925 optimize_graph_(0), |
| 1904 generate_code_(0), | 1926 generate_code_(0), |
| 1905 total_size_(0), | 1927 total_size_(0), |
| 1906 full_code_gen_(0), | 1928 full_code_gen_(0), |
| 1907 source_size_(0) { } | 1929 source_size_(0) { } |
| 1908 | 1930 |
| 1909 void Initialize(CompilationInfo* info); | 1931 void Initialize(CompilationInfo* info); |
| 1910 void Print(); | 1932 void Print(); |
| 1911 void SaveTiming(const char* name, int64_t ticks, unsigned size); | 1933 void SaveTiming(const char* name, int64_t ticks, unsigned size); |
| 1912 | 1934 |
| 1935 void IncrementFullCodeGen(int64_t full_code_gen) { |
| 1936 full_code_gen_ += full_code_gen; |
| 1937 } |
| 1938 |
| 1913 void IncrementSubtotals(int64_t create_graph, | 1939 void IncrementSubtotals(int64_t create_graph, |
| 1914 int64_t optimize_graph, | 1940 int64_t optimize_graph, |
| 1915 int64_t generate_code) { | 1941 int64_t generate_code) { |
| 1916 create_graph_ += create_graph; | 1942 create_graph_ += create_graph; |
| 1917 optimize_graph_ += optimize_graph; | 1943 optimize_graph_ += optimize_graph; |
| 1918 generate_code_ += generate_code; | 1944 generate_code_ += generate_code; |
| 1919 } | 1945 } |
| 1920 | 1946 |
| 1921 private: | 1947 private: |
| 1922 List<int64_t> timing_; | 1948 List<int64_t> timing_; |
| 1923 List<const char*> names_; | 1949 List<const char*> names_; |
| 1924 List<unsigned> sizes_; | 1950 List<unsigned> sizes_; |
| 1925 int64_t create_graph_; | 1951 int64_t create_graph_; |
| 1926 int64_t optimize_graph_; | 1952 int64_t optimize_graph_; |
| 1927 int64_t generate_code_; | 1953 int64_t generate_code_; |
| 1928 unsigned total_size_; | 1954 unsigned total_size_; |
| 1929 int64_t full_code_gen_; | 1955 int64_t full_code_gen_; |
| 1930 double source_size_; | 1956 double source_size_; |
| 1931 }; | 1957 }; |
| 1932 | 1958 |
| 1933 | 1959 |
| 1934 class HPhase BASE_EMBEDDED { | 1960 class HPhase : public CompilationPhase { |
| 1935 public: | 1961 public: |
| 1936 static const char* const kFullCodeGen; | 1962 HPhase(const char* name, HGraph* graph) |
| 1937 | 1963 : CompilationPhase(name, graph->info()), |
| 1938 HPhase(const char* name, Isolate* isolate, Zone* zone); | 1964 graph_(graph) { } |
| 1939 HPhase(const char* name, HGraph* graph); | |
| 1940 HPhase(const char* name, LChunk* chunk); | |
| 1941 HPhase(const char* name, LAllocator* allocator); | |
| 1942 ~HPhase(); | 1965 ~HPhase(); |
| 1943 | 1966 |
| 1967 protected: |
| 1968 HGraph* graph() const { return graph_; } |
| 1969 |
| 1944 private: | 1970 private: |
| 1945 void Init(Isolate* isolate, | 1971 HGraph* graph_; |
| 1946 const char* name, | |
| 1947 Zone* zone, | |
| 1948 HGraph* graph, | |
| 1949 LChunk* chunk, | |
| 1950 LAllocator* allocator); | |
| 1951 | 1972 |
| 1952 Isolate* isolate_; | 1973 DISALLOW_COPY_AND_ASSIGN(HPhase); |
| 1953 const char* name_; | |
| 1954 Zone* zone_; | |
| 1955 HGraph* graph_; | |
| 1956 LChunk* chunk_; | |
| 1957 LAllocator* allocator_; | |
| 1958 int64_t start_ticks_; | |
| 1959 unsigned start_allocation_size_; | |
| 1960 }; | 1974 }; |
| 1961 | 1975 |
| 1962 | 1976 |
| 1963 class HTracer: public Malloced { | 1977 class HTracer: public Malloced { |
| 1964 public: | 1978 public: |
| 1965 explicit HTracer(int isolate_id) | 1979 explicit HTracer(int isolate_id) |
| 1966 : trace_(&string_allocator_), indent_(0) { | 1980 : trace_(&string_allocator_), indent_(0) { |
| 1967 OS::SNPrintF(filename_, | 1981 OS::SNPrintF(filename_, |
| 1968 "hydrogen-%d-%d.cfg", | 1982 "hydrogen-%d-%d.cfg", |
| 1969 OS::GetCurrentProcessId(), | 1983 OS::GetCurrentProcessId(), |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2038 EmbeddedVector<char, 64> filename_; | 2052 EmbeddedVector<char, 64> filename_; |
| 2039 HeapStringAllocator string_allocator_; | 2053 HeapStringAllocator string_allocator_; |
| 2040 StringStream trace_; | 2054 StringStream trace_; |
| 2041 int indent_; | 2055 int indent_; |
| 2042 }; | 2056 }; |
| 2043 | 2057 |
| 2044 | 2058 |
| 2045 } } // namespace v8::internal | 2059 } } // namespace v8::internal |
| 2046 | 2060 |
| 2047 #endif // V8_HYDROGEN_H_ | 2061 #endif // V8_HYDROGEN_H_ |
| OLD | NEW |