Chromium Code Reviews| Index: src/crankshaft/hydrogen.h |
| diff --git a/src/crankshaft/hydrogen.h b/src/crankshaft/hydrogen.h |
| index 857484c0001bc125bf47f3094564f8f320f2e0a8..5047bdbe5914c9288ece96f5c604d6545be9c49b 100644 |
| --- a/src/crankshaft/hydrogen.h |
| +++ b/src/crankshaft/hydrogen.h |
| @@ -501,10 +501,10 @@ enum FrameType { |
| JS_GETTER, |
| JS_SETTER, |
| ARGUMENTS_ADAPTOR, |
| + TAIL_CALLER_FUNCTION, |
| STUB |
| }; |
| - |
| class HEnvironment final : public ZoneObject { |
| public: |
| HEnvironment(HEnvironment* outer, |
| @@ -613,15 +613,17 @@ class HEnvironment final : public ZoneObject { |
| // Create an "inlined version" of this environment, where the original |
| // environment is the outer environment but the top expression stack |
| // elements are moved to an inner environment as parameters. |
| - HEnvironment* CopyForInlining(Handle<JSFunction> target, |
| - int arguments, |
| - FunctionLiteral* function, |
| - HConstant* undefined, |
| - InliningKind inlining_kind) const; |
| + HEnvironment* CopyForInlining(Handle<JSFunction> target, int arguments, |
| + FunctionLiteral* function, HConstant* undefined, |
| + InliningKind inlining_kind, |
| + TailCallMode syntactic_tail_call_mode) const; |
| HEnvironment* DiscardInlined(bool drop_extra) { |
| HEnvironment* outer = outer_; |
| - while (outer->frame_type() != JS_FUNCTION) outer = outer->outer_; |
| + while (outer->frame_type() != JS_FUNCTION && |
| + outer->frame_type() != TAIL_CALLER_FUNCTION) { |
| + outer = outer->outer_; |
| + } |
| if (drop_extra) outer->Drop(1); |
| return outer; |
| } |
| @@ -680,6 +682,8 @@ class HEnvironment final : public ZoneObject { |
| FrameType frame_type, |
| int arguments) const; |
| + void MarkAsTailCaller(); |
|
Michael Starzinger
2016/03/21 14:06:50
nit: Let's add a short comment explaining the sema
Igor Sheludko
2016/03/22 14:08:37
Done. It looks like we can't drop outer environmen
|
| + |
| // True if index is included in the expression stack part of the environment. |
| bool HasExpressionAt(int index) const; |
| @@ -1278,6 +1282,26 @@ class HGraphBuilder { |
| return AddInstructionTyped(New<I>(p1, p2, p3, p4, p5, p6, p7, p8)); |
| } |
| + template <class I, class P1, class P2, class P3, class P4, class P5, class P6, |
| + class P7, class P8, class P9> |
| + I* New(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9) { |
| + return I::New(isolate(), zone(), context(), p1, p2, p3, p4, p5, p6, p7, p8, |
| + p9); |
| + } |
| + |
| + template <class I, class P1, class P2, class P3, class P4, class P5, class P6, |
| + class P7, class P8, class P9> |
| + HInstruction* AddUncasted(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, |
| + P8 p8, P9 p9) { |
| + return AddInstruction(NewUncasted<I>(p1, p2, p3, p4, p5, p6, p7, p8, p8)); |
| + } |
| + |
| + template <class I, class P1, class P2, class P3, class P4, class P5, class P6, |
| + class P7, class P8, class P9> |
| + I* Add(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9) { |
| + return AddInstructionTyped(New<I>(p1, p2, p3, p4, p5, p6, p7, p8, p9)); |
| + } |
| + |
| void AddSimulate(BailoutId id, RemovableSimulate removable = FIXED_SIMULATE); |
| // When initializing arrays, we'll unfold the loop if the number of elements |