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_HYDROGEN_H_ | 5 #ifndef V8_HYDROGEN_H_ |
6 #define V8_HYDROGEN_H_ | 6 #define V8_HYDROGEN_H_ |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/accessors.h" | 10 #include "src/accessors.h" |
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 | 637 |
638 bool ExpressionStackIsEmpty() const; | 638 bool ExpressionStackIsEmpty() const; |
639 | 639 |
640 HValue* ExpressionStackAt(int index_from_top) const { | 640 HValue* ExpressionStackAt(int index_from_top) const { |
641 int index = length() - index_from_top - 1; | 641 int index = length() - index_from_top - 1; |
642 DCHECK(HasExpressionAt(index)); | 642 DCHECK(HasExpressionAt(index)); |
643 return values_[index]; | 643 return values_[index]; |
644 } | 644 } |
645 | 645 |
646 void SetExpressionStackAt(int index_from_top, HValue* value); | 646 void SetExpressionStackAt(int index_from_top, HValue* value); |
| 647 HValue* RemoveExpressionStackAt(int index_from_top); |
647 | 648 |
648 HEnvironment* Copy() const; | 649 HEnvironment* Copy() const; |
649 HEnvironment* CopyWithoutHistory() const; | 650 HEnvironment* CopyWithoutHistory() const; |
650 HEnvironment* CopyAsLoopHeader(HBasicBlock* block) const; | 651 HEnvironment* CopyAsLoopHeader(HBasicBlock* block) const; |
651 | 652 |
652 // Create an "inlined version" of this environment, where the original | 653 // Create an "inlined version" of this environment, where the original |
653 // environment is the outer environment but the top expression stack | 654 // environment is the outer environment but the top expression stack |
654 // elements are moved to an inner environment as parameters. | 655 // elements are moved to an inner environment as parameters. |
655 HEnvironment* CopyForInlining(Handle<JSFunction> target, | 656 HEnvironment* CopyForInlining(Handle<JSFunction> target, |
656 int arguments, | 657 int arguments, |
(...skipping 1648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2305 enum GlobalPropertyAccess { | 2306 enum GlobalPropertyAccess { |
2306 kUseCell, | 2307 kUseCell, |
2307 kUseGeneric | 2308 kUseGeneric |
2308 }; | 2309 }; |
2309 GlobalPropertyAccess LookupGlobalProperty(Variable* var, LookupIterator* it, | 2310 GlobalPropertyAccess LookupGlobalProperty(Variable* var, LookupIterator* it, |
2310 PropertyAccessType access_type); | 2311 PropertyAccessType access_type); |
2311 | 2312 |
2312 void EnsureArgumentsArePushedForAccess(); | 2313 void EnsureArgumentsArePushedForAccess(); |
2313 bool TryArgumentsAccess(Property* expr); | 2314 bool TryArgumentsAccess(Property* expr); |
2314 | 2315 |
2315 // Try to optimize fun.apply(receiver, arguments) pattern. | 2316 // Shared code for .call and .apply optimizations. |
2316 bool TryCallApply(Call* expr); | 2317 void HandleIndirectCall(Call* expr, HValue* function, int arguments_count); |
| 2318 // Try to optimize indirect calls such as fun.apply(receiver, arguments) |
| 2319 // or fun.call(...). |
| 2320 bool TryIndirectCall(Call* expr); |
| 2321 void BuildFunctionApply(Call* expr); |
| 2322 void BuildFunctionCall(Call* expr); |
2317 | 2323 |
2318 bool TryHandleArrayCall(Call* expr, HValue* function); | 2324 bool TryHandleArrayCall(Call* expr, HValue* function); |
2319 bool TryHandleArrayCallNew(CallNew* expr, HValue* function); | 2325 bool TryHandleArrayCallNew(CallNew* expr, HValue* function); |
2320 void BuildArrayCall(Expression* expr, int arguments_count, HValue* function, | 2326 void BuildArrayCall(Expression* expr, int arguments_count, HValue* function, |
2321 Handle<AllocationSite> cell); | 2327 Handle<AllocationSite> cell); |
2322 | 2328 |
2323 enum ArrayIndexOfMode { kFirstIndexOf, kLastIndexOf }; | 2329 enum ArrayIndexOfMode { kFirstIndexOf, kLastIndexOf }; |
2324 HValue* BuildArrayIndexOf(HValue* receiver, | 2330 HValue* BuildArrayIndexOf(HValue* receiver, |
2325 HValue* search_element, | 2331 HValue* search_element, |
2326 ElementsKind kind, | 2332 ElementsKind kind, |
(...skipping 15 matching lines...) Expand all Loading... |
2342 bool TryInlineConstruct(CallNew* expr, HValue* implicit_return_value); | 2348 bool TryInlineConstruct(CallNew* expr, HValue* implicit_return_value); |
2343 bool TryInlineGetter(Handle<JSFunction> getter, | 2349 bool TryInlineGetter(Handle<JSFunction> getter, |
2344 Handle<Map> receiver_map, | 2350 Handle<Map> receiver_map, |
2345 BailoutId ast_id, | 2351 BailoutId ast_id, |
2346 BailoutId return_id); | 2352 BailoutId return_id); |
2347 bool TryInlineSetter(Handle<JSFunction> setter, | 2353 bool TryInlineSetter(Handle<JSFunction> setter, |
2348 Handle<Map> receiver_map, | 2354 Handle<Map> receiver_map, |
2349 BailoutId id, | 2355 BailoutId id, |
2350 BailoutId assignment_id, | 2356 BailoutId assignment_id, |
2351 HValue* implicit_return_value); | 2357 HValue* implicit_return_value); |
2352 bool TryInlineApply(Handle<JSFunction> function, | 2358 bool TryInlineIndirectCall(Handle<JSFunction> function, Call* expr, |
2353 Call* expr, | 2359 int arguments_count); |
2354 int arguments_count); | 2360 bool TryInlineBuiltinMethodCall(Call* expr, Handle<JSFunction> function, |
2355 bool TryInlineBuiltinMethodCall(Call* expr, | 2361 Handle<Map> receiver_map, |
2356 HValue* receiver, | 2362 int args_count_no_receiver); |
2357 Handle<Map> receiver_map); | |
2358 bool TryInlineBuiltinFunctionCall(Call* expr); | 2363 bool TryInlineBuiltinFunctionCall(Call* expr); |
2359 enum ApiCallType { | 2364 enum ApiCallType { |
2360 kCallApiFunction, | 2365 kCallApiFunction, |
2361 kCallApiMethod, | 2366 kCallApiMethod, |
2362 kCallApiGetter, | 2367 kCallApiGetter, |
2363 kCallApiSetter | 2368 kCallApiSetter |
2364 }; | 2369 }; |
2365 bool TryInlineApiMethodCall(Call* expr, | 2370 bool TryInlineApiMethodCall(Call* expr, |
2366 HValue* receiver, | 2371 HValue* receiver, |
2367 SmallMapList* receiver_types); | 2372 SmallMapList* receiver_types); |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2905 } | 2910 } |
2906 | 2911 |
2907 private: | 2912 private: |
2908 HGraphBuilder* builder_; | 2913 HGraphBuilder* builder_; |
2909 }; | 2914 }; |
2910 | 2915 |
2911 | 2916 |
2912 } } // namespace v8::internal | 2917 } } // namespace v8::internal |
2913 | 2918 |
2914 #endif // V8_HYDROGEN_H_ | 2919 #endif // V8_HYDROGEN_H_ |
OLD | NEW |