Chromium Code Reviews| Index: src/hydrogen.h |
| diff --git a/src/hydrogen.h b/src/hydrogen.h |
| index 278a298435e56de0d7b0440d5d9e60e21f731349..fd4d2de10f3a002a45877be4405dc44527282bcf 100644 |
| --- a/src/hydrogen.h |
| +++ b/src/hydrogen.h |
| @@ -135,9 +135,7 @@ class HBasicBlock: public ZoneObject { |
| // Add the inlined function exit sequence, adding an HLeaveInlined |
| // instruction and updating the bailout environment. |
| - void AddLeaveInlined(HValue* return_value, |
| - HBasicBlock* target, |
| - FunctionState* state = NULL); |
| + void AddLeaveInlined(HValue* return_value, FunctionState* state); |
| // If a target block is tagged as an inline function return, all |
| // predecessors should contain the inlined exit sequence: |
| @@ -510,7 +508,7 @@ class HEnvironment: public ZoneObject { |
| FunctionLiteral* function, |
| HConstant* undefined, |
| CallKind call_kind, |
| - bool is_construct) const; |
| + InliningKind inlining_kind) const; |
| void AddIncomingEdge(HBasicBlock* block, HEnvironment* other); |
| @@ -703,26 +701,18 @@ class TestContext: public AstContext { |
| }; |
| -enum ReturnHandlingFlag { |
| - NORMAL_RETURN, |
| - DROP_EXTRA_ON_RETURN, |
| - CONSTRUCT_CALL_RETURN |
| -}; |
| - |
| - |
| class FunctionState { |
| public: |
| FunctionState(HGraphBuilder* owner, |
| CompilationInfo* info, |
| TypeFeedbackOracle* oracle, |
| - ReturnHandlingFlag return_handling); |
| + InliningKind inlining_kind); |
| ~FunctionState(); |
| CompilationInfo* compilation_info() { return compilation_info_; } |
| TypeFeedbackOracle* oracle() { return oracle_; } |
| AstContext* call_context() { return call_context_; } |
| - bool drop_extra() { return return_handling_ == DROP_EXTRA_ON_RETURN; } |
| - bool is_construct() { return return_handling_ == CONSTRUCT_CALL_RETURN; } |
| + InliningKind inlining_kind() const { return inlining_kind_; } |
| HBasicBlock* function_return() { return function_return_; } |
| TestContext* test_context() { return test_context_; } |
| void ClearInlinedTestContext() { |
| @@ -752,11 +742,7 @@ class FunctionState { |
| // inlined. NULL when not inlining. |
| AstContext* call_context_; |
| - // Indicate whether we have to perform special handling on return from |
| - // inlined functions. |
| - // - DROP_EXTRA_ON_RETURN: Drop an extra value from the environment. |
| - // - CONSTRUCT_CALL_RETURN: Either use allocated receiver or return value. |
| - ReturnHandlingFlag return_handling_; |
| + InliningKind inlining_kind_; |
|
Michael Starzinger
2012/08/08 15:01:29
Can we have a one-liner comment that says this spe
Sven Panne
2012/08/09 12:15:32
Done.
|
| // When inlining in an effect or value context, this is the return block. |
| // It is NULL otherwise. When inlining in a test context, there are a |
| @@ -1033,14 +1019,17 @@ class HGraphBuilder: public AstVisitor { |
| bool TryInline(CallKind call_kind, |
| Handle<JSFunction> target, |
| int arguments_count, |
| - HValue* receiver, |
| + HValue* implicit_return_value, |
| BailoutId ast_id, |
| BailoutId return_id, |
| - ReturnHandlingFlag return_handling); |
| + InliningKind inlining_kind); |
| bool TryInlineCall(Call* expr, bool drop_extra = false); |
| bool TryInlineConstruct(CallNew* expr, HValue* receiver); |
| bool TryInlineGetter(Handle<JSFunction> getter, Property* prop); |
| + bool TryInlineSetter(Handle<JSFunction> setter, |
| + Assignment* assignment, |
| + HValue* implicit_return_value); |
| bool TryInlineBuiltinMethodCall(Call* expr, |
| HValue* receiver, |
| Handle<Map> receiver_map, |