Index: src/hydrogen.h |
diff --git a/src/hydrogen.h b/src/hydrogen.h |
index 74c19037dcfff752f0ee1e44692753801cd81c3d..4cfddd7123f830b96a6c5763d01bff62d17815cb 100644 |
--- a/src/hydrogen.h |
+++ b/src/hydrogen.h |
@@ -2321,8 +2321,16 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor { |
void EnsureArgumentsArePushedForAccess(); |
bool TryArgumentsAccess(Property* expr); |
- // Try to optimize fun.apply(receiver, arguments) pattern. |
- bool TryCallApply(Call* expr); |
+ // Shared code for .call and .apply optimizations. |
+ void HandleIndirectCall(Call* expr, |
+ HValue* function, |
+ int arguments_count, |
+ int drop_extra); |
+ // Try to optimize indirect calls such as fun.apply(receiver, arguments) |
+ // or fun.call(...). |
+ bool TryIndirectCall(Call* expr); |
+ void BuildFunctionApply(Call* expr); |
+ void BuildFunctionCall(Call* expr); |
bool TryHandleArrayCall(Call* expr, HValue* function); |
bool TryHandleArrayCallNew(CallNew* expr, HValue* function); |
@@ -2358,12 +2366,14 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor { |
BailoutId id, |
BailoutId assignment_id, |
HValue* implicit_return_value); |
- bool TryInlineApply(Handle<JSFunction> function, |
- Call* expr, |
- int arguments_count); |
+ bool TryInlineIndirectCall(Handle<JSFunction> function, |
+ Call* expr, |
+ int arguments_count); |
bool TryInlineBuiltinMethodCall(Call* expr, |
- HValue* receiver, |
- Handle<Map> receiver_map); |
+ Handle<JSFunction> function, |
+ Handle<Map> receiver_map, |
+ int args_count_no_receiver, |
+ int drop_extra = 0); |
bool TryInlineBuiltinFunctionCall(Call* expr); |
enum ApiCallType { |
kCallApiFunction, |