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

Side by Side Diff: src/compiler/frame-states.h

Issue 1191243003: [turbofan] Factor out the function specific part from the frame state operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Tweaks Created 5 years, 6 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/compiler/common-operator.cc ('k') | src/compiler/frame-states.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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_COMPILER_FRAME_STATES_H_ 5 #ifndef V8_COMPILER_FRAME_STATES_H_
6 #define V8_COMPILER_FRAME_STATES_H_ 6 #define V8_COMPILER_FRAME_STATES_H_
7 7
8 #include "src/handles-inl.h" 8 #include "src/handles-inl.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 private: 63 private:
64 OutputFrameStateCombine(Kind kind, size_t parameter) 64 OutputFrameStateCombine(Kind kind, size_t parameter)
65 : kind_(kind), parameter_(parameter) {} 65 : kind_(kind), parameter_(parameter) {}
66 66
67 Kind const kind_; 67 Kind const kind_;
68 size_t const parameter_; 68 size_t const parameter_;
69 }; 69 };
70 70
71 71
72 // The type of stack frame that a FrameState node represents. 72 // The type of stack frame that a FrameState node represents.
73 enum FrameStateType { 73 enum class FrameStateType {
74 JS_FRAME, // Represents an unoptimized JavaScriptFrame. 74 kJavaScriptFunction, // Represents an unoptimized JavaScriptFrame.
75 ARGUMENTS_ADAPTOR // Represents an ArgumentsAdaptorFrame. 75 kArgumentsAdaptor // Represents an ArgumentsAdaptorFrame.
76 }; 76 };
77 77
78 78
79 class FrameStateCallInfo final { 79 class FrameStateFunctionInfo {
80 public: 80 public:
81 FrameStateCallInfo(FrameStateType type, BailoutId bailout_id, 81 FrameStateFunctionInfo(FrameStateType type, int parameter_count,
82 OutputFrameStateCombine state_combine, 82 int local_count,
83 MaybeHandle<SharedFunctionInfo> shared_info) 83 Handle<SharedFunctionInfo> shared_info)
84 : type_(type), 84 : type_(type),
85 bailout_id_(bailout_id), 85 parameter_count_(parameter_count),
86 frame_state_combine_(state_combine), 86 local_count_(local_count),
87 shared_info_(shared_info) {} 87 shared_info_(shared_info) {}
88 88
89 int local_count() const { return local_count_; }
90 int parameter_count() const { return parameter_count_; }
91 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; }
89 FrameStateType type() const { return type_; } 92 FrameStateType type() const { return type_; }
90 BailoutId bailout_id() const { return bailout_id_; }
91 OutputFrameStateCombine state_combine() const { return frame_state_combine_; }
92 MaybeHandle<SharedFunctionInfo> shared_info() const { return shared_info_; }
93 93
94 private: 94 private:
95 FrameStateType const type_; 95 FrameStateType const type_;
96 int const parameter_count_;
97 int const local_count_;
98 Handle<SharedFunctionInfo> const shared_info_;
99 };
100
101
102 class FrameStateInfo final {
103 public:
104 FrameStateInfo(BailoutId bailout_id, OutputFrameStateCombine state_combine,
105 const FrameStateFunctionInfo* info)
106 : bailout_id_(bailout_id),
107 frame_state_combine_(state_combine),
108 info_(info) {}
109
110 FrameStateType type() const {
111 return info_ == nullptr ? FrameStateType::kJavaScriptFunction
112 : info_->type();
113 }
114 BailoutId bailout_id() const { return bailout_id_; }
115 OutputFrameStateCombine state_combine() const { return frame_state_combine_; }
116 MaybeHandle<SharedFunctionInfo> shared_info() const {
117 return info_ == nullptr ? MaybeHandle<SharedFunctionInfo>()
118 : info_->shared_info();
119 }
120 int parameter_count() const {
121 return info_ == nullptr ? 0 : info_->parameter_count();
122 }
123 int local_count() const {
124 return info_ == nullptr ? 0 : info_->local_count();
125 }
126 const FrameStateFunctionInfo* function_info() const { return info_; }
127
128 private:
96 BailoutId const bailout_id_; 129 BailoutId const bailout_id_;
97 OutputFrameStateCombine const frame_state_combine_; 130 OutputFrameStateCombine const frame_state_combine_;
98 MaybeHandle<SharedFunctionInfo> const shared_info_; 131 const FrameStateFunctionInfo* const info_;
99 }; 132 };
100 133
101 bool operator==(FrameStateCallInfo const&, FrameStateCallInfo const&); 134 bool operator==(FrameStateInfo const&, FrameStateInfo const&);
102 bool operator!=(FrameStateCallInfo const&, FrameStateCallInfo const&); 135 bool operator!=(FrameStateInfo const&, FrameStateInfo const&);
103 136
104 size_t hash_value(FrameStateCallInfo const&); 137 size_t hash_value(FrameStateInfo const&);
105 138
106 std::ostream& operator<<(std::ostream&, FrameStateCallInfo const&); 139 std::ostream& operator<<(std::ostream&, FrameStateInfo const&);
107 140
108 static const int kFrameStateParametersInput = 0; 141 static const int kFrameStateParametersInput = 0;
109 static const int kFrameStateLocalsInput = 1; 142 static const int kFrameStateLocalsInput = 1;
110 static const int kFrameStateStackInput = 2; 143 static const int kFrameStateStackInput = 2;
111 static const int kFrameStateContextInput = 3; 144 static const int kFrameStateContextInput = 3;
112 static const int kFrameStateFunctionInput = 4; 145 static const int kFrameStateFunctionInput = 4;
113 static const int kFrameStateOuterStateInput = 5; 146 static const int kFrameStateOuterStateInput = 5;
114 static const int kFrameStateInputCount = kFrameStateOuterStateInput + 1; 147 static const int kFrameStateInputCount = kFrameStateOuterStateInput + 1;
115 148
116 } // namespace compiler 149 } // namespace compiler
117 } // namespace internal 150 } // namespace internal
118 } // namespace v8 151 } // namespace v8
119 152
120 #endif // V8_COMPILER_FRAME_STATES_H_ 153 #endif // V8_COMPILER_FRAME_STATES_H_
OLDNEW
« no previous file with comments | « src/compiler/common-operator.cc ('k') | src/compiler/frame-states.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698