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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/common-operator.cc ('k') | src/compiler/frame-states.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/frame-states.h
diff --git a/src/compiler/frame-states.h b/src/compiler/frame-states.h
index 20cb6427e76ce2369795f3c4a88f484f7ab89881..42c41f910733ddc0bceacad40a6bdd2f88a9345b 100644
--- a/src/compiler/frame-states.h
+++ b/src/compiler/frame-states.h
@@ -70,40 +70,73 @@ class OutputFrameStateCombine {
// The type of stack frame that a FrameState node represents.
-enum FrameStateType {
- JS_FRAME, // Represents an unoptimized JavaScriptFrame.
- ARGUMENTS_ADAPTOR // Represents an ArgumentsAdaptorFrame.
+enum class FrameStateType {
+ kJavaScriptFunction, // Represents an unoptimized JavaScriptFrame.
+ kArgumentsAdaptor // Represents an ArgumentsAdaptorFrame.
};
-class FrameStateCallInfo final {
+class FrameStateFunctionInfo {
public:
- FrameStateCallInfo(FrameStateType type, BailoutId bailout_id,
- OutputFrameStateCombine state_combine,
- MaybeHandle<SharedFunctionInfo> shared_info)
+ FrameStateFunctionInfo(FrameStateType type, int parameter_count,
+ int local_count,
+ Handle<SharedFunctionInfo> shared_info)
: type_(type),
- bailout_id_(bailout_id),
- frame_state_combine_(state_combine),
+ parameter_count_(parameter_count),
+ local_count_(local_count),
shared_info_(shared_info) {}
+ int local_count() const { return local_count_; }
+ int parameter_count() const { return parameter_count_; }
+ Handle<SharedFunctionInfo> shared_info() const { return shared_info_; }
FrameStateType type() const { return type_; }
+
+ private:
+ FrameStateType const type_;
+ int const parameter_count_;
+ int const local_count_;
+ Handle<SharedFunctionInfo> const shared_info_;
+};
+
+
+class FrameStateInfo final {
+ public:
+ FrameStateInfo(BailoutId bailout_id, OutputFrameStateCombine state_combine,
+ const FrameStateFunctionInfo* info)
+ : bailout_id_(bailout_id),
+ frame_state_combine_(state_combine),
+ info_(info) {}
+
+ FrameStateType type() const {
+ return info_ == nullptr ? FrameStateType::kJavaScriptFunction
+ : info_->type();
+ }
BailoutId bailout_id() const { return bailout_id_; }
OutputFrameStateCombine state_combine() const { return frame_state_combine_; }
- MaybeHandle<SharedFunctionInfo> shared_info() const { return shared_info_; }
+ MaybeHandle<SharedFunctionInfo> shared_info() const {
+ return info_ == nullptr ? MaybeHandle<SharedFunctionInfo>()
+ : info_->shared_info();
+ }
+ int parameter_count() const {
+ return info_ == nullptr ? 0 : info_->parameter_count();
+ }
+ int local_count() const {
+ return info_ == nullptr ? 0 : info_->local_count();
+ }
+ const FrameStateFunctionInfo* function_info() const { return info_; }
private:
- FrameStateType const type_;
BailoutId const bailout_id_;
OutputFrameStateCombine const frame_state_combine_;
- MaybeHandle<SharedFunctionInfo> const shared_info_;
+ const FrameStateFunctionInfo* const info_;
};
-bool operator==(FrameStateCallInfo const&, FrameStateCallInfo const&);
-bool operator!=(FrameStateCallInfo const&, FrameStateCallInfo const&);
+bool operator==(FrameStateInfo const&, FrameStateInfo const&);
+bool operator!=(FrameStateInfo const&, FrameStateInfo const&);
-size_t hash_value(FrameStateCallInfo const&);
+size_t hash_value(FrameStateInfo const&);
-std::ostream& operator<<(std::ostream&, FrameStateCallInfo const&);
+std::ostream& operator<<(std::ostream&, FrameStateInfo const&);
static const int kFrameStateParametersInput = 0;
static const int kFrameStateLocalsInput = 1;
« 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