Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(384)

Side by Side Diff: src/crankshaft/hydrogen-instructions.h

Issue 1782743003: [crankshaft] Support inlining of function calls in tail position (in ES6 sense). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@tco-crank-4
Patch Set: ppc, s390 and x87 ports Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/crankshaft/hydrogen.cc ('k') | src/crankshaft/ia32/lithium-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ 5 #ifndef V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_
6 #define V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ 6 #define V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_
7 7
8 #include <cstring> 8 #include <cstring>
9 #include <iosfwd> 9 #include <iosfwd>
10 10
(...skipping 1930 matching lines...) Expand 10 before | Expand all | Expand 10 after
1941 class HConstant; 1941 class HConstant;
1942 1942
1943 1943
1944 class HEnterInlined final : public HTemplateInstruction<0> { 1944 class HEnterInlined final : public HTemplateInstruction<0> {
1945 public: 1945 public:
1946 static HEnterInlined* New(Isolate* isolate, Zone* zone, HValue* context, 1946 static HEnterInlined* New(Isolate* isolate, Zone* zone, HValue* context,
1947 BailoutId return_id, Handle<JSFunction> closure, 1947 BailoutId return_id, Handle<JSFunction> closure,
1948 HConstant* closure_context, int arguments_count, 1948 HConstant* closure_context, int arguments_count,
1949 FunctionLiteral* function, 1949 FunctionLiteral* function,
1950 InliningKind inlining_kind, Variable* arguments_var, 1950 InliningKind inlining_kind, Variable* arguments_var,
1951 HArgumentsObject* arguments_object) { 1951 HArgumentsObject* arguments_object,
1952 return new (zone) HEnterInlined(return_id, closure, closure_context, 1952 TailCallMode syntactic_tail_call_mode) {
1953 arguments_count, function, inlining_kind, 1953 return new (zone)
1954 arguments_var, arguments_object, zone); 1954 HEnterInlined(return_id, closure, closure_context, arguments_count,
1955 function, inlining_kind, arguments_var, arguments_object,
1956 syntactic_tail_call_mode, zone);
1955 } 1957 }
1956 1958
1957 void RegisterReturnTarget(HBasicBlock* return_target, Zone* zone); 1959 void RegisterReturnTarget(HBasicBlock* return_target, Zone* zone);
1958 ZoneList<HBasicBlock*>* return_targets() { return &return_targets_; } 1960 ZoneList<HBasicBlock*>* return_targets() { return &return_targets_; }
1959 1961
1960 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT 1962 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT
1961 1963
1962 Handle<SharedFunctionInfo> shared() const { return shared_; } 1964 Handle<SharedFunctionInfo> shared() const { return shared_; }
1963 Handle<JSFunction> closure() const { return closure_; } 1965 Handle<JSFunction> closure() const { return closure_; }
1964 HConstant* closure_context() const { return closure_context_; } 1966 HConstant* closure_context() const { return closure_context_; }
1965 int arguments_count() const { return arguments_count_; } 1967 int arguments_count() const { return arguments_count_; }
1966 bool arguments_pushed() const { return arguments_pushed_; } 1968 bool arguments_pushed() const { return arguments_pushed_; }
1967 void set_arguments_pushed() { arguments_pushed_ = true; } 1969 void set_arguments_pushed() { arguments_pushed_ = true; }
1968 FunctionLiteral* function() const { return function_; } 1970 FunctionLiteral* function() const { return function_; }
1969 InliningKind inlining_kind() const { return inlining_kind_; } 1971 InliningKind inlining_kind() const { return inlining_kind_; }
1972 TailCallMode syntactic_tail_call_mode() const {
1973 return syntactic_tail_call_mode_;
1974 }
1970 BailoutId ReturnId() const { return return_id_; } 1975 BailoutId ReturnId() const { return return_id_; }
1971 int inlining_id() const { return inlining_id_; } 1976 int inlining_id() const { return inlining_id_; }
1972 void set_inlining_id(int inlining_id) { inlining_id_ = inlining_id; } 1977 void set_inlining_id(int inlining_id) { inlining_id_ = inlining_id; }
1973 1978
1974 Representation RequiredInputRepresentation(int index) override { 1979 Representation RequiredInputRepresentation(int index) override {
1975 return Representation::None(); 1980 return Representation::None();
1976 } 1981 }
1977 1982
1978 Variable* arguments_var() { return arguments_var_; } 1983 Variable* arguments_var() { return arguments_var_; }
1979 HArgumentsObject* arguments_object() { return arguments_object_; } 1984 HArgumentsObject* arguments_object() { return arguments_object_; }
1980 1985
1981 DECLARE_CONCRETE_INSTRUCTION(EnterInlined) 1986 DECLARE_CONCRETE_INSTRUCTION(EnterInlined)
1982 1987
1983 private: 1988 private:
1984 HEnterInlined(BailoutId return_id, Handle<JSFunction> closure, 1989 HEnterInlined(BailoutId return_id, Handle<JSFunction> closure,
1985 HConstant* closure_context, int arguments_count, 1990 HConstant* closure_context, int arguments_count,
1986 FunctionLiteral* function, InliningKind inlining_kind, 1991 FunctionLiteral* function, InliningKind inlining_kind,
1987 Variable* arguments_var, HArgumentsObject* arguments_object, 1992 Variable* arguments_var, HArgumentsObject* arguments_object,
1988 Zone* zone) 1993 TailCallMode syntactic_tail_call_mode, Zone* zone)
1989 : return_id_(return_id), 1994 : return_id_(return_id),
1990 shared_(handle(closure->shared())), 1995 shared_(handle(closure->shared())),
1991 closure_(closure), 1996 closure_(closure),
1992 closure_context_(closure_context), 1997 closure_context_(closure_context),
1993 arguments_count_(arguments_count), 1998 arguments_count_(arguments_count),
1994 arguments_pushed_(false), 1999 arguments_pushed_(false),
1995 function_(function), 2000 function_(function),
1996 inlining_kind_(inlining_kind), 2001 inlining_kind_(inlining_kind),
2002 syntactic_tail_call_mode_(syntactic_tail_call_mode),
1997 inlining_id_(0), 2003 inlining_id_(0),
1998 arguments_var_(arguments_var), 2004 arguments_var_(arguments_var),
1999 arguments_object_(arguments_object), 2005 arguments_object_(arguments_object),
2000 return_targets_(2, zone) {} 2006 return_targets_(2, zone) {}
2001 2007
2002 BailoutId return_id_; 2008 BailoutId return_id_;
2003 Handle<SharedFunctionInfo> shared_; 2009 Handle<SharedFunctionInfo> shared_;
2004 Handle<JSFunction> closure_; 2010 Handle<JSFunction> closure_;
2005 HConstant* closure_context_; 2011 HConstant* closure_context_;
2006 int arguments_count_; 2012 int arguments_count_;
2007 bool arguments_pushed_; 2013 bool arguments_pushed_;
2008 FunctionLiteral* function_; 2014 FunctionLiteral* function_;
2009 InliningKind inlining_kind_; 2015 InliningKind inlining_kind_;
2016 TailCallMode syntactic_tail_call_mode_;
2010 int inlining_id_; 2017 int inlining_id_;
2011 Variable* arguments_var_; 2018 Variable* arguments_var_;
2012 HArgumentsObject* arguments_object_; 2019 HArgumentsObject* arguments_object_;
2013 ZoneList<HBasicBlock*> return_targets_; 2020 ZoneList<HBasicBlock*> return_targets_;
2014 }; 2021 };
2015 2022
2016 2023
2017 class HLeaveInlined final : public HTemplateInstruction<0> { 2024 class HLeaveInlined final : public HTemplateInstruction<0> {
2018 public: 2025 public:
2019 HLeaveInlined(HEnterInlined* entry, 2026 HLeaveInlined(HEnterInlined* entry,
(...skipping 5571 matching lines...) Expand 10 before | Expand all | Expand 10 after
7591 7598
7592 7599
7593 7600
7594 #undef DECLARE_INSTRUCTION 7601 #undef DECLARE_INSTRUCTION
7595 #undef DECLARE_CONCRETE_INSTRUCTION 7602 #undef DECLARE_CONCRETE_INSTRUCTION
7596 7603
7597 } // namespace internal 7604 } // namespace internal
7598 } // namespace v8 7605 } // namespace v8
7599 7606
7600 #endif // V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ 7607 #endif // V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/crankshaft/hydrogen.cc ('k') | src/crankshaft/ia32/lithium-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698