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 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
964 Zone* zone() const { return info_->zone(); } | 964 Zone* zone() const { return info_->zone(); } |
965 HGraph* graph() const { return graph_; } | 965 HGraph* graph() const { return graph_; } |
966 Isolate* isolate() const { return graph_->isolate(); } | 966 Isolate* isolate() const { return graph_->isolate(); } |
967 CompilationInfo* top_info() { return info_; } | 967 CompilationInfo* top_info() { return info_; } |
968 | 968 |
969 HGraph* CreateGraph(); | 969 HGraph* CreateGraph(); |
970 | 970 |
971 // Bailout environment manipulation. | 971 // Bailout environment manipulation. |
972 void Push(HValue* value) { environment()->Push(value); } | 972 void Push(HValue* value) { environment()->Push(value); } |
973 HValue* Pop() { return environment()->Pop(); } | 973 HValue* Pop() { return environment()->Pop(); } |
| 974 void PushAndAdd(HInstruction* instr); |
974 | 975 |
975 // Adding instructions. | 976 // Adding instructions. |
976 HInstruction* AddInstruction(HInstruction* instr); | 977 HInstruction* AddInstruction(HInstruction* instr); |
977 | 978 |
978 template<class I> | 979 template<class I> |
979 I* Add() { return static_cast<I*>(AddInstruction(new(zone()) I())); } | 980 I* Add() { return static_cast<I*>(AddInstruction(new(zone()) I())); } |
980 | 981 |
981 template<class I, class P1> | 982 template<class I, class P1> |
982 I* Add(P1 p1) { | 983 I* Add(P1 p1) { |
983 return static_cast<I*>(AddInstruction(new(zone()) I(p1))); | 984 return static_cast<I*>(AddInstruction(new(zone()) I(p1))); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1111 Representation representation = Representation::Tagged()); | 1112 Representation representation = Representation::Tagged()); |
1112 | 1113 |
1113 HStoreNamedField* AddStoreMapConstant(HValue *object, Handle<Map>); | 1114 HStoreNamedField* AddStoreMapConstant(HValue *object, Handle<Map>); |
1114 | 1115 |
1115 HLoadNamedField* AddLoadElements(HValue *object, HValue *typecheck = NULL); | 1116 HLoadNamedField* AddLoadElements(HValue *object, HValue *typecheck = NULL); |
1116 | 1117 |
1117 HLoadNamedField* AddLoadFixedArrayLength(HValue *object); | 1118 HLoadNamedField* AddLoadFixedArrayLength(HValue *object); |
1118 | 1119 |
1119 HValue* AddLoadJSBuiltin(Builtins::JavaScript builtin, HValue* context); | 1120 HValue* AddLoadJSBuiltin(Builtins::JavaScript builtin, HValue* context); |
1120 | 1121 |
| 1122 bool MatchRotateRight(HValue* left, |
| 1123 HValue* right, |
| 1124 HValue** operand, |
| 1125 HValue** shift_amount); |
| 1126 |
| 1127 HInstruction* BuildBinaryOperation(BinaryOperation* expr, |
| 1128 HValue* left, |
| 1129 HValue* right); |
| 1130 |
| 1131 HValue* ConstantToNumber(HValue* value); |
| 1132 |
1121 enum SoftDeoptimizeMode { | 1133 enum SoftDeoptimizeMode { |
1122 MUST_EMIT_SOFT_DEOPT, | 1134 MUST_EMIT_SOFT_DEOPT, |
1123 CAN_OMIT_SOFT_DEOPT | 1135 CAN_OMIT_SOFT_DEOPT |
1124 }; | 1136 }; |
1125 | 1137 |
1126 void AddSoftDeoptimize(SoftDeoptimizeMode mode = CAN_OMIT_SOFT_DEOPT); | 1138 void AddSoftDeoptimize(SoftDeoptimizeMode mode = CAN_OMIT_SOFT_DEOPT); |
1127 | 1139 |
1128 class IfBuilder { | 1140 class IfBuilder { |
1129 public: | 1141 public: |
1130 explicit IfBuilder(HGraphBuilder* builder, | 1142 explicit IfBuilder(HGraphBuilder* builder, |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1659 HBasicBlock* false_block); | 1671 HBasicBlock* false_block); |
1660 | 1672 |
1661 // Visit an argument subexpression and emit a push to the outgoing arguments. | 1673 // Visit an argument subexpression and emit a push to the outgoing arguments. |
1662 void VisitArgument(Expression* expr); | 1674 void VisitArgument(Expression* expr); |
1663 | 1675 |
1664 void VisitArgumentList(ZoneList<Expression*>* arguments); | 1676 void VisitArgumentList(ZoneList<Expression*>* arguments); |
1665 | 1677 |
1666 // Visit a list of expressions from left to right, each in a value context. | 1678 // Visit a list of expressions from left to right, each in a value context. |
1667 void VisitExpressions(ZoneList<Expression*>* exprs); | 1679 void VisitExpressions(ZoneList<Expression*>* exprs); |
1668 | 1680 |
1669 void PushAndAdd(HInstruction* instr); | |
1670 | |
1671 // Remove the arguments from the bailout environment and emit instructions | 1681 // Remove the arguments from the bailout environment and emit instructions |
1672 // to push them as outgoing parameters. | 1682 // to push them as outgoing parameters. |
1673 template <class Instruction> HInstruction* PreProcessCall(Instruction* call); | 1683 template <class Instruction> HInstruction* PreProcessCall(Instruction* call); |
1674 | 1684 |
1675 void SetUpScope(Scope* scope); | 1685 void SetUpScope(Scope* scope); |
1676 virtual void VisitStatements(ZoneList<Statement*>* statements); | 1686 virtual void VisitStatements(ZoneList<Statement*>* statements); |
1677 | 1687 |
1678 #define DECLARE_VISIT(type) virtual void Visit##type(type* node); | 1688 #define DECLARE_VISIT(type) virtual void Visit##type(type* node); |
1679 AST_NODE_LIST(DECLARE_VISIT) | 1689 AST_NODE_LIST(DECLARE_VISIT) |
1680 #undef DECLARE_VISIT | 1690 #undef DECLARE_VISIT |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1767 void HandleLiteralCompareTypeof(CompareOperation* expr, | 1777 void HandleLiteralCompareTypeof(CompareOperation* expr, |
1768 Expression* sub_expr, | 1778 Expression* sub_expr, |
1769 Handle<String> check); | 1779 Handle<String> check); |
1770 void HandleLiteralCompareNil(CompareOperation* expr, | 1780 void HandleLiteralCompareNil(CompareOperation* expr, |
1771 Expression* sub_expr, | 1781 Expression* sub_expr, |
1772 NilValue nil); | 1782 NilValue nil); |
1773 | 1783 |
1774 HInstruction* BuildStringCharCodeAt(HValue* context, | 1784 HInstruction* BuildStringCharCodeAt(HValue* context, |
1775 HValue* string, | 1785 HValue* string, |
1776 HValue* index); | 1786 HValue* index); |
1777 HInstruction* BuildBinaryOperation(BinaryOperation* expr, | |
1778 HValue* left, | |
1779 HValue* right); | |
1780 HInstruction* BuildIncrement(bool returns_original_input, | 1787 HInstruction* BuildIncrement(bool returns_original_input, |
1781 CountOperation* expr); | 1788 CountOperation* expr); |
1782 HInstruction* BuildLoadKeyedGeneric(HValue* object, | 1789 HInstruction* BuildLoadKeyedGeneric(HValue* object, |
1783 HValue* key); | 1790 HValue* key); |
1784 | 1791 |
1785 HInstruction* TryBuildConsolidatedElementLoad(HValue* object, | 1792 HInstruction* TryBuildConsolidatedElementLoad(HValue* object, |
1786 HValue* key, | 1793 HValue* key, |
1787 HValue* val, | 1794 HValue* val, |
1788 SmallMapList* maps); | 1795 SmallMapList* maps); |
1789 | 1796 |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1915 HInstruction* data_target, | 1922 HInstruction* data_target, |
1916 int* data_offset); | 1923 int* data_offset); |
1917 | 1924 |
1918 void AddCheckPrototypeMaps(Handle<JSObject> holder, | 1925 void AddCheckPrototypeMaps(Handle<JSObject> holder, |
1919 Handle<Map> receiver_map); | 1926 Handle<Map> receiver_map); |
1920 | 1927 |
1921 void AddCheckConstantFunction(Handle<JSObject> holder, | 1928 void AddCheckConstantFunction(Handle<JSObject> holder, |
1922 HValue* receiver, | 1929 HValue* receiver, |
1923 Handle<Map> receiver_map); | 1930 Handle<Map> receiver_map); |
1924 | 1931 |
1925 bool MatchRotateRight(HValue* left, | |
1926 HValue* right, | |
1927 HValue** operand, | |
1928 HValue** shift_amount); | |
1929 | |
1930 // The translation state of the currently-being-translated function. | 1932 // The translation state of the currently-being-translated function. |
1931 FunctionState* function_state_; | 1933 FunctionState* function_state_; |
1932 | 1934 |
1933 // The base of the function state stack. | 1935 // The base of the function state stack. |
1934 FunctionState initial_function_state_; | 1936 FunctionState initial_function_state_; |
1935 | 1937 |
1936 // Expression context of the currently visited subexpression. NULL when | 1938 // Expression context of the currently visited subexpression. NULL when |
1937 // visiting statements. | 1939 // visiting statements. |
1938 AstContext* ast_context_; | 1940 AstContext* ast_context_; |
1939 | 1941 |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2096 EmbeddedVector<char, 64> filename_; | 2098 EmbeddedVector<char, 64> filename_; |
2097 HeapStringAllocator string_allocator_; | 2099 HeapStringAllocator string_allocator_; |
2098 StringStream trace_; | 2100 StringStream trace_; |
2099 int indent_; | 2101 int indent_; |
2100 }; | 2102 }; |
2101 | 2103 |
2102 | 2104 |
2103 } } // namespace v8::internal | 2105 } } // namespace v8::internal |
2104 | 2106 |
2105 #endif // V8_HYDROGEN_H_ | 2107 #endif // V8_HYDROGEN_H_ |
OLD | NEW |