OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_CRANKSHAFT_HYDROGEN_H_ | 5 #ifndef V8_CRANKSHAFT_HYDROGEN_H_ |
6 #define V8_CRANKSHAFT_HYDROGEN_H_ | 6 #define V8_CRANKSHAFT_HYDROGEN_H_ |
7 | 7 |
8 #include "src/accessors.h" | 8 #include "src/accessors.h" |
9 #include "src/allocation.h" | 9 #include "src/allocation.h" |
10 #include "src/ast/ast-type-bounds.h" | 10 #include "src/ast/ast-type-bounds.h" |
(...skipping 2253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2264 | 2264 |
2265 void VisitDelete(UnaryOperation* expr); | 2265 void VisitDelete(UnaryOperation* expr); |
2266 void VisitVoid(UnaryOperation* expr); | 2266 void VisitVoid(UnaryOperation* expr); |
2267 void VisitTypeof(UnaryOperation* expr); | 2267 void VisitTypeof(UnaryOperation* expr); |
2268 void VisitNot(UnaryOperation* expr); | 2268 void VisitNot(UnaryOperation* expr); |
2269 | 2269 |
2270 void VisitComma(BinaryOperation* expr); | 2270 void VisitComma(BinaryOperation* expr); |
2271 void VisitLogicalExpression(BinaryOperation* expr); | 2271 void VisitLogicalExpression(BinaryOperation* expr); |
2272 void VisitArithmeticExpression(BinaryOperation* expr); | 2272 void VisitArithmeticExpression(BinaryOperation* expr); |
2273 | 2273 |
2274 void VisitLoopBody(IterationStatement* stmt, | 2274 template <class IterationStatement> |
2275 HBasicBlock* loop_entry); | 2275 void VisitLoopBody(IterationStatement* stmt, HBasicBlock* loop_entry); |
2276 | 2276 |
2277 void BuildForInBody(ForInStatement* stmt, Variable* each_var, | 2277 void BuildForInBody(ForInStatement* stmt, Variable* each_var, |
2278 HValue* enumerable); | 2278 HValue* enumerable); |
2279 | 2279 |
2280 // Create a back edge in the flow graph. body_exit is the predecessor | 2280 // Create a back edge in the flow graph. body_exit is the predecessor |
2281 // block and loop_entry is the successor block. loop_successor is the | 2281 // block and loop_entry is the successor block. loop_successor is the |
2282 // block where control flow exits the loop normally (e.g., via failure of | 2282 // block where control flow exits the loop normally (e.g., via failure of |
2283 // the condition) and break_block is the block where control flow breaks | 2283 // the condition) and break_block is the block where control flow breaks |
2284 // from the loop. All blocks except loop_entry can be NULL. The return | 2284 // from the loop. All blocks except loop_entry can be NULL. The return |
2285 // value is the new successor block which is the join of loop_successor | 2285 // value is the new successor block which is the join of loop_successor |
2286 // and break_block, or NULL. | 2286 // and break_block, or NULL. |
2287 HBasicBlock* CreateLoop(IterationStatement* statement, | 2287 HBasicBlock* CreateLoop(IterationStatement* statement, |
2288 HBasicBlock* loop_entry, | 2288 HBasicBlock* loop_entry, |
2289 HBasicBlock* body_exit, | 2289 HBasicBlock* body_exit, |
2290 HBasicBlock* loop_successor, | 2290 HBasicBlock* loop_successor, |
2291 HBasicBlock* break_block); | 2291 HBasicBlock* break_block); |
2292 | 2292 |
2293 // Build a loop entry | 2293 // Build a loop entry |
2294 HBasicBlock* BuildLoopEntry(); | 2294 HBasicBlock* BuildLoopEntry(); |
2295 | 2295 |
2296 // Builds a loop entry respectful of OSR requirements | 2296 // Builds a loop entry respectful of OSR requirements |
2297 HBasicBlock* BuildLoopEntry(IterationStatement* statement); | 2297 HBasicBlock* BuildLoopEntry(IterationStatement* statement); |
2298 | 2298 |
| 2299 template <class IterationStatement> |
2299 HBasicBlock* JoinContinue(IterationStatement* statement, | 2300 HBasicBlock* JoinContinue(IterationStatement* statement, |
2300 HBasicBlock* exit_block, | 2301 HBasicBlock* exit_block, |
2301 HBasicBlock* continue_block); | 2302 HBasicBlock* continue_block); |
2302 | 2303 |
2303 HValue* Top() const { return environment()->Top(); } | 2304 HValue* Top() const { return environment()->Top(); } |
2304 void Drop(int n) { environment()->Drop(n); } | 2305 void Drop(int n) { environment()->Drop(n); } |
2305 void Bind(Variable* var, HValue* value) { environment()->Bind(var, value); } | 2306 void Bind(Variable* var, HValue* value) { environment()->Bind(var, value); } |
2306 bool IsEligibleForEnvironmentLivenessAnalysis(Variable* var, | 2307 bool IsEligibleForEnvironmentLivenessAnalysis(Variable* var, |
2307 int index, | 2308 int index, |
2308 HEnvironment* env) { | 2309 HEnvironment* env) { |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2678 Handle<Map> transition_; | 2679 Handle<Map> transition_; |
2679 int number_; | 2680 int number_; |
2680 PropertyDetails details_; | 2681 PropertyDetails details_; |
2681 }; | 2682 }; |
2682 | 2683 |
2683 HValue* BuildMonomorphicAccess(PropertyAccessInfo* info, HValue* object, | 2684 HValue* BuildMonomorphicAccess(PropertyAccessInfo* info, HValue* object, |
2684 HValue* checked_object, HValue* value, | 2685 HValue* checked_object, HValue* value, |
2685 BailoutId ast_id, BailoutId return_id, | 2686 BailoutId ast_id, BailoutId return_id, |
2686 bool can_inline_accessor = true); | 2687 bool can_inline_accessor = true); |
2687 | 2688 |
| 2689 template <class Expression> |
2688 HValue* BuildNamedAccess(PropertyAccessType access, BailoutId ast_id, | 2690 HValue* BuildNamedAccess(PropertyAccessType access, BailoutId ast_id, |
2689 BailoutId reutrn_id, Expression* expr, | 2691 BailoutId reutrn_id, Expression* expr, |
2690 FeedbackVectorSlot slot, HValue* object, | 2692 FeedbackVectorSlot slot, HValue* object, |
2691 Handle<Name> name, HValue* value, | 2693 Handle<Name> name, HValue* value, |
2692 bool is_uninitialized = false); | 2694 bool is_uninitialized = false); |
2693 | 2695 |
2694 void HandlePolymorphicCallNamed(Call* expr, | 2696 void HandlePolymorphicCallNamed(Call* expr, |
2695 HValue* receiver, | 2697 HValue* receiver, |
2696 SmallMapList* types, | 2698 SmallMapList* types, |
2697 Handle<String> name); | 2699 Handle<String> name); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2740 HValue* dependency, | 2742 HValue* dependency, |
2741 Handle<Map> map, | 2743 Handle<Map> map, |
2742 PropertyAccessType access_type, | 2744 PropertyAccessType access_type, |
2743 KeyedAccessStoreMode store_mode); | 2745 KeyedAccessStoreMode store_mode); |
2744 | 2746 |
2745 HValue* HandlePolymorphicElementAccess( | 2747 HValue* HandlePolymorphicElementAccess( |
2746 Expression* expr, FeedbackVectorSlot slot, HValue* object, HValue* key, | 2748 Expression* expr, FeedbackVectorSlot slot, HValue* object, HValue* key, |
2747 HValue* val, SmallMapList* maps, PropertyAccessType access_type, | 2749 HValue* val, SmallMapList* maps, PropertyAccessType access_type, |
2748 KeyedAccessStoreMode store_mode, bool* has_side_effects); | 2750 KeyedAccessStoreMode store_mode, bool* has_side_effects); |
2749 | 2751 |
| 2752 template <class Expression> |
2750 HValue* HandleKeyedElementAccess(HValue* obj, HValue* key, HValue* val, | 2753 HValue* HandleKeyedElementAccess(HValue* obj, HValue* key, HValue* val, |
2751 Expression* expr, FeedbackVectorSlot slot, | 2754 Expression* expr, FeedbackVectorSlot slot, |
2752 BailoutId ast_id, BailoutId return_id, | 2755 BailoutId ast_id, BailoutId return_id, |
2753 PropertyAccessType access_type, | 2756 PropertyAccessType access_type, |
2754 bool* has_side_effects); | 2757 bool* has_side_effects); |
2755 | 2758 |
2756 HInstruction* BuildNamedGeneric(PropertyAccessType access, Expression* expr, | 2759 HInstruction* BuildNamedGeneric(PropertyAccessType access, Expression* expr, |
2757 FeedbackVectorSlot slot, HValue* object, | 2760 FeedbackVectorSlot slot, HValue* object, |
2758 Handle<Name> name, HValue* value, | 2761 Handle<Name> name, HValue* value, |
2759 bool is_uninitialized = false); | 2762 bool is_uninitialized = false); |
2760 | 2763 |
2761 HCheckMaps* AddCheckMap(HValue* object, Handle<Map> map); | 2764 HCheckMaps* AddCheckMap(HValue* object, Handle<Map> map); |
2762 | 2765 |
2763 void BuildLoad(Property* property, | 2766 void BuildLoad(Property* property, |
2764 BailoutId ast_id); | 2767 BailoutId ast_id); |
2765 void PushLoad(Property* property, | 2768 void PushLoad(Property* property, |
2766 HValue* object, | 2769 HValue* object, |
2767 HValue* key); | 2770 HValue* key); |
2768 | 2771 |
| 2772 template <class Expression> |
2769 void BuildStoreForEffect(Expression* expression, Property* prop, | 2773 void BuildStoreForEffect(Expression* expression, Property* prop, |
2770 FeedbackVectorSlot slot, BailoutId ast_id, | 2774 FeedbackVectorSlot slot, BailoutId ast_id, |
2771 BailoutId return_id, HValue* object, HValue* key, | 2775 BailoutId return_id, HValue* object, HValue* key, |
2772 HValue* value); | 2776 HValue* value); |
2773 | 2777 |
| 2778 template <class Expression> |
2774 void BuildStore(Expression* expression, Property* prop, | 2779 void BuildStore(Expression* expression, Property* prop, |
2775 FeedbackVectorSlot slot, BailoutId ast_id, | 2780 FeedbackVectorSlot slot, BailoutId ast_id, |
2776 BailoutId return_id, bool is_uninitialized = false); | 2781 BailoutId return_id, bool is_uninitialized = false); |
2777 | 2782 |
2778 HInstruction* BuildLoadNamedField(PropertyAccessInfo* info, | 2783 HInstruction* BuildLoadNamedField(PropertyAccessInfo* info, |
2779 HValue* checked_object); | 2784 HValue* checked_object); |
2780 HInstruction* BuildStoreNamedField(PropertyAccessInfo* info, | 2785 HInstruction* BuildStoreNamedField(PropertyAccessInfo* info, |
2781 HValue* checked_object, | 2786 HValue* checked_object, |
2782 HValue* value); | 2787 HValue* value); |
2783 | 2788 |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3042 } | 3047 } |
3043 | 3048 |
3044 private: | 3049 private: |
3045 HOptimizedGraphBuilder* builder_; | 3050 HOptimizedGraphBuilder* builder_; |
3046 }; | 3051 }; |
3047 | 3052 |
3048 } // namespace internal | 3053 } // namespace internal |
3049 } // namespace v8 | 3054 } // namespace v8 |
3050 | 3055 |
3051 #endif // V8_CRANKSHAFT_HYDROGEN_H_ | 3056 #endif // V8_CRANKSHAFT_HYDROGEN_H_ |
OLD | NEW |