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

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

Issue 1514413002: [Interpreter] Generate valid FrameStates in the Bytecode Graph Builder. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_materialize_sf
Patch Set: Add checks that environment doesn't change after state nodes are attached Created 5 years 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/code-generator.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.h" 8 #include "src/handles.h"
9 #include "src/utils.h" 9 #include "src/utils.h"
10 10
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 OutputFrameStateCombine(Kind kind, size_t parameter) 69 OutputFrameStateCombine(Kind kind, size_t parameter)
70 : kind_(kind), parameter_(parameter) {} 70 : kind_(kind), parameter_(parameter) {}
71 71
72 Kind const kind_; 72 Kind const kind_;
73 size_t const parameter_; 73 size_t const parameter_;
74 }; 74 };
75 75
76 76
77 // The type of stack frame that a FrameState node represents. 77 // The type of stack frame that a FrameState node represents.
78 enum class FrameStateType { 78 enum class FrameStateType {
79 kJavaScriptFunction, // Represents an unoptimized JavaScriptFrame. 79 kJavaScriptFunction, // Represents an unoptimized JavaScriptFrame.
80 kArgumentsAdaptor, // Represents an ArgumentsAdaptorFrame. 80 kInterpretedFunction, // Represents an InterpretedFrame.
81 kConstructStub // Represents a ConstructStubFrame. 81 kArgumentsAdaptor, // Represents an ArgumentsAdaptorFrame.
82 kConstructStub // Represents a ConstructStubFrame.
82 }; 83 };
83 84
84 85
85 enum ContextCallingMode { 86 enum ContextCallingMode {
86 CALL_MAINTAINS_NATIVE_CONTEXT, 87 CALL_MAINTAINS_NATIVE_CONTEXT,
87 CALL_CHANGES_NATIVE_CONTEXT 88 CALL_CHANGES_NATIVE_CONTEXT
88 }; 89 };
89 90
90 91
91 class FrameStateFunctionInfo { 92 class FrameStateFunctionInfo {
92 public: 93 public:
93 FrameStateFunctionInfo(FrameStateType type, int parameter_count, 94 FrameStateFunctionInfo(FrameStateType type, int parameter_count,
94 int local_count, 95 int local_count,
95 Handle<SharedFunctionInfo> shared_info, 96 Handle<SharedFunctionInfo> shared_info,
96 ContextCallingMode context_calling_mode) 97 ContextCallingMode context_calling_mode)
97 : type_(type), 98 : type_(type),
98 parameter_count_(parameter_count), 99 parameter_count_(parameter_count),
99 local_count_(local_count), 100 local_count_(local_count),
100 shared_info_(shared_info), 101 shared_info_(shared_info),
101 context_calling_mode_(context_calling_mode) {} 102 context_calling_mode_(context_calling_mode) {}
102 103
103 int local_count() const { return local_count_; } 104 int local_count() const { return local_count_; }
104 int parameter_count() const { return parameter_count_; } 105 int parameter_count() const { return parameter_count_; }
105 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; } 106 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; }
106 FrameStateType type() const { return type_; } 107 FrameStateType type() const { return type_; }
107 ContextCallingMode context_calling_mode() const { 108 ContextCallingMode context_calling_mode() const {
108 return context_calling_mode_; 109 return context_calling_mode_;
109 } 110 }
110 111
112 static bool IsJSFunctionType(FrameStateType type) {
113 return type == FrameStateType::kJavaScriptFunction ||
114 type == FrameStateType::kInterpretedFunction;
115 }
116
111 private: 117 private:
112 FrameStateType const type_; 118 FrameStateType const type_;
113 int const parameter_count_; 119 int const parameter_count_;
114 int const local_count_; 120 int const local_count_;
115 Handle<SharedFunctionInfo> const shared_info_; 121 Handle<SharedFunctionInfo> const shared_info_;
116 ContextCallingMode context_calling_mode_; 122 ContextCallingMode context_calling_mode_;
117 }; 123 };
118 124
119 125
120 class FrameStateInfo final { 126 class FrameStateInfo final {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 static const int kFrameStateContextInput = 3; 168 static const int kFrameStateContextInput = 3;
163 static const int kFrameStateFunctionInput = 4; 169 static const int kFrameStateFunctionInput = 4;
164 static const int kFrameStateOuterStateInput = 5; 170 static const int kFrameStateOuterStateInput = 5;
165 static const int kFrameStateInputCount = kFrameStateOuterStateInput + 1; 171 static const int kFrameStateInputCount = kFrameStateOuterStateInput + 1;
166 172
167 } // namespace compiler 173 } // namespace compiler
168 } // namespace internal 174 } // namespace internal
169 } // namespace v8 175 } // namespace v8
170 176
171 #endif // V8_COMPILER_FRAME_STATES_H_ 177 #endif // V8_COMPILER_FRAME_STATES_H_
OLDNEW
« no previous file with comments | « src/compiler/code-generator.cc ('k') | src/compiler/frame-states.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698