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 2303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2314 kUseCell, | 2314 kUseCell, |
2315 kUseGeneric | 2315 kUseGeneric |
2316 }; | 2316 }; |
2317 GlobalPropertyAccess LookupGlobalProperty(Variable* var, | 2317 GlobalPropertyAccess LookupGlobalProperty(Variable* var, |
2318 LookupResult* lookup, | 2318 LookupResult* lookup, |
2319 PropertyAccessType access_type); | 2319 PropertyAccessType access_type); |
2320 | 2320 |
2321 void EnsureArgumentsArePushedForAccess(); | 2321 void EnsureArgumentsArePushedForAccess(); |
2322 bool TryArgumentsAccess(Property* expr); | 2322 bool TryArgumentsAccess(Property* expr); |
2323 | 2323 |
2324 // Try to optimize fun.apply(receiver, arguments) pattern. | 2324 // Shared code for .call and .apply optimizations. |
2325 bool TryCallApply(Call* expr); | 2325 void HandleIndirectCall(Call* expr, HValue* function, int arguments_count); |
| 2326 // Try to optimize indirect calls such as fun.apply(receiver, arguments) |
| 2327 // or fun.call(...). |
| 2328 bool TryIndirectCall(Call* expr); |
| 2329 void BuildFunctionApply(Call* expr); |
| 2330 void BuildFunctionCall(Call* expr); |
2326 | 2331 |
2327 bool TryHandleArrayCall(Call* expr, HValue* function); | 2332 bool TryHandleArrayCall(Call* expr, HValue* function); |
2328 bool TryHandleArrayCallNew(CallNew* expr, HValue* function); | 2333 bool TryHandleArrayCallNew(CallNew* expr, HValue* function); |
2329 void BuildArrayCall(Expression* expr, int arguments_count, HValue* function, | 2334 void BuildArrayCall(Expression* expr, int arguments_count, HValue* function, |
2330 Handle<AllocationSite> cell); | 2335 Handle<AllocationSite> cell); |
2331 | 2336 |
2332 enum ArrayIndexOfMode { kFirstIndexOf, kLastIndexOf }; | 2337 enum ArrayIndexOfMode { kFirstIndexOf, kLastIndexOf }; |
2333 HValue* BuildArrayIndexOf(HValue* receiver, | 2338 HValue* BuildArrayIndexOf(HValue* receiver, |
2334 HValue* search_element, | 2339 HValue* search_element, |
2335 ElementsKind kind, | 2340 ElementsKind kind, |
(...skipping 15 matching lines...) Expand all Loading... |
2351 bool TryInlineConstruct(CallNew* expr, HValue* implicit_return_value); | 2356 bool TryInlineConstruct(CallNew* expr, HValue* implicit_return_value); |
2352 bool TryInlineGetter(Handle<JSFunction> getter, | 2357 bool TryInlineGetter(Handle<JSFunction> getter, |
2353 Handle<Map> receiver_map, | 2358 Handle<Map> receiver_map, |
2354 BailoutId ast_id, | 2359 BailoutId ast_id, |
2355 BailoutId return_id); | 2360 BailoutId return_id); |
2356 bool TryInlineSetter(Handle<JSFunction> setter, | 2361 bool TryInlineSetter(Handle<JSFunction> setter, |
2357 Handle<Map> receiver_map, | 2362 Handle<Map> receiver_map, |
2358 BailoutId id, | 2363 BailoutId id, |
2359 BailoutId assignment_id, | 2364 BailoutId assignment_id, |
2360 HValue* implicit_return_value); | 2365 HValue* implicit_return_value); |
2361 bool TryInlineApply(Handle<JSFunction> function, | 2366 bool TryInlineIndirectCall(Handle<JSFunction> function, |
2362 Call* expr, | 2367 Call* expr, |
2363 int arguments_count); | 2368 int arguments_count); |
2364 bool TryInlineBuiltinMethodCall(Call* expr, | 2369 bool TryInlineBuiltinMethodCall(Call* expr, |
2365 HValue* receiver, | 2370 Handle<JSFunction> function, |
2366 Handle<Map> receiver_map); | 2371 Handle<Map> receiver_map, |
| 2372 int args_count_no_receiver); |
2367 bool TryInlineBuiltinFunctionCall(Call* expr); | 2373 bool TryInlineBuiltinFunctionCall(Call* expr); |
2368 enum ApiCallType { | 2374 enum ApiCallType { |
2369 kCallApiFunction, | 2375 kCallApiFunction, |
2370 kCallApiMethod, | 2376 kCallApiMethod, |
2371 kCallApiGetter, | 2377 kCallApiGetter, |
2372 kCallApiSetter | 2378 kCallApiSetter |
2373 }; | 2379 }; |
2374 bool TryInlineApiMethodCall(Call* expr, | 2380 bool TryInlineApiMethodCall(Call* expr, |
2375 HValue* receiver, | 2381 HValue* receiver, |
2376 SmallMapList* receiver_types); | 2382 SmallMapList* receiver_types); |
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2894 } | 2900 } |
2895 | 2901 |
2896 private: | 2902 private: |
2897 HGraphBuilder* builder_; | 2903 HGraphBuilder* builder_; |
2898 }; | 2904 }; |
2899 | 2905 |
2900 | 2906 |
2901 } } // namespace v8::internal | 2907 } } // namespace v8::internal |
2902 | 2908 |
2903 #endif // V8_HYDROGEN_H_ | 2909 #endif // V8_HYDROGEN_H_ |
OLD | NEW |