OLD | NEW |
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_DEBUG_DEBUG_SCOPES_H_ | 5 #ifndef V8_DEBUG_DEBUG_SCOPES_H_ |
6 #define V8_DEBUG_DEBUG_SCOPES_H_ | 6 #define V8_DEBUG_DEBUG_SCOPES_H_ |
7 | 7 |
8 #include "src/debug/debug-frames.h" | 8 #include "src/debug/debug-frames.h" |
9 #include "src/frames.h" | 9 #include "src/frames.h" |
10 | 10 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 : scope_info(info), start_position(start), end_position(end) {} | 86 : scope_info(info), start_position(start), end_position(end) {} |
87 explicit ExtendedScopeInfo(Handle<ScopeInfo> info) | 87 explicit ExtendedScopeInfo(Handle<ScopeInfo> info) |
88 : scope_info(info), start_position(-1), end_position(-1) {} | 88 : scope_info(info), start_position(-1), end_position(-1) {} |
89 Handle<ScopeInfo> scope_info; | 89 Handle<ScopeInfo> scope_info; |
90 int start_position; | 90 int start_position; |
91 int end_position; | 91 int end_position; |
92 bool is_hidden() { return start_position == -1 && end_position == -1; } | 92 bool is_hidden() { return start_position == -1 && end_position == -1; } |
93 }; | 93 }; |
94 | 94 |
95 Isolate* isolate_; | 95 Isolate* isolate_; |
96 FrameInspector* const frame_inspector_ = nullptr; | 96 FrameInspector* const frame_inspector_; |
97 Handle<JSGeneratorObject> generator_; | |
98 Handle<Context> context_; | 97 Handle<Context> context_; |
99 List<ExtendedScopeInfo> nested_scope_chain_; | 98 List<ExtendedScopeInfo> nested_scope_chain_; |
100 Handle<StringSet> non_locals_; | 99 Handle<StringSet> non_locals_; |
101 bool seen_script_scope_; | 100 bool seen_script_scope_; |
102 | 101 |
103 inline JavaScriptFrame* GetFrame() { | 102 inline JavaScriptFrame* GetFrame() { |
104 return frame_inspector_->GetArgumentsFrame(); | 103 return frame_inspector_->GetArgumentsFrame(); |
105 } | 104 } |
106 | 105 |
107 Handle<Context> GetContext(); | 106 inline Handle<JSFunction> GetFunction() { |
108 Handle<JSFunction> GetFunction(); | 107 return frame_inspector_->GetFunction(); |
109 int GetSourcePosition(); | 108 } |
110 | |
111 void MaterializeStackLocals(Handle<JSObject> local_scope, | |
112 Handle<ScopeInfo> scope_info); | |
113 | |
114 void TryParseAndRetrieveScopes(ScopeIterator::Option option); | |
115 | 109 |
116 void RetrieveScopeChain(DeclarationScope* scope); | 110 void RetrieveScopeChain(DeclarationScope* scope); |
117 | 111 |
118 void CollectNonLocals(ParseInfo* info, DeclarationScope* scope); | 112 void CollectNonLocals(ParseInfo* info, DeclarationScope* scope); |
119 | 113 |
120 void UnwrapEvaluationContext(); | 114 void UnwrapEvaluationContext(); |
121 | 115 |
122 MUST_USE_RESULT MaybeHandle<JSObject> MaterializeScriptScope(); | 116 MUST_USE_RESULT MaybeHandle<JSObject> MaterializeScriptScope(); |
123 MUST_USE_RESULT MaybeHandle<JSObject> MaterializeLocalScope(); | 117 MUST_USE_RESULT MaybeHandle<JSObject> MaterializeLocalScope(); |
124 MUST_USE_RESULT MaybeHandle<JSObject> MaterializeModuleScope(); | 118 MUST_USE_RESULT MaybeHandle<JSObject> MaterializeModuleScope(); |
125 Handle<JSObject> MaterializeClosure(); | 119 Handle<JSObject> MaterializeClosure(); |
126 Handle<JSObject> MaterializeCatchScope(); | 120 Handle<JSObject> MaterializeCatchScope(); |
127 Handle<JSObject> MaterializeInnerScope(); | 121 Handle<JSObject> MaterializeInnerScope(); |
128 Handle<JSObject> WithContextExtension(); | 122 Handle<JSObject> WithContextExtension(); |
129 | 123 |
130 bool SetLocalVariableValue(Handle<String> variable_name, | 124 bool SetLocalVariableValue(Handle<String> variable_name, |
131 Handle<Object> new_value); | 125 Handle<Object> new_value); |
132 bool SetInnerScopeVariableValue(Handle<String> variable_name, | 126 bool SetInnerScopeVariableValue(Handle<String> variable_name, |
133 Handle<Object> new_value); | 127 Handle<Object> new_value); |
134 bool SetClosureVariableValue(Handle<String> variable_name, | 128 bool SetClosureVariableValue(Handle<String> variable_name, |
135 Handle<Object> new_value); | 129 Handle<Object> new_value); |
136 bool SetScriptVariableValue(Handle<String> variable_name, | 130 bool SetScriptVariableValue(Handle<String> variable_name, |
137 Handle<Object> new_value); | 131 Handle<Object> new_value); |
138 bool SetCatchVariableValue(Handle<String> variable_name, | 132 bool SetCatchVariableValue(Handle<String> variable_name, |
139 Handle<Object> new_value); | 133 Handle<Object> new_value); |
140 | 134 |
141 // Helper functions. | 135 // Helper functions. |
142 bool SetParameterValue(Handle<ScopeInfo> scope_info, | 136 bool SetParameterValue(Handle<ScopeInfo> scope_info, JavaScriptFrame* frame, |
143 Handle<String> parameter_name, | 137 Handle<String> parameter_name, |
144 Handle<Object> new_value); | 138 Handle<Object> new_value); |
145 bool SetStackVariableValue(Handle<ScopeInfo> scope_info, | 139 bool SetStackVariableValue(Handle<ScopeInfo> scope_info, |
146 Handle<String> variable_name, | 140 Handle<String> variable_name, |
147 Handle<Object> new_value); | 141 Handle<Object> new_value); |
148 bool SetContextVariableValue(Handle<ScopeInfo> scope_info, | 142 bool SetContextVariableValue(Handle<ScopeInfo> scope_info, |
149 Handle<Context> context, | 143 Handle<Context> context, |
150 Handle<String> variable_name, | 144 Handle<String> variable_name, |
151 Handle<Object> new_value); | 145 Handle<Object> new_value); |
152 | 146 |
(...skipping 14 matching lines...) Expand all Loading... |
167 void GetNestedScopeChain(Isolate* isolate, Scope* scope, | 161 void GetNestedScopeChain(Isolate* isolate, Scope* scope, |
168 int statement_position); | 162 int statement_position); |
169 | 163 |
170 DISALLOW_IMPLICIT_CONSTRUCTORS(ScopeIterator); | 164 DISALLOW_IMPLICIT_CONSTRUCTORS(ScopeIterator); |
171 }; | 165 }; |
172 | 166 |
173 } // namespace internal | 167 } // namespace internal |
174 } // namespace v8 | 168 } // namespace v8 |
175 | 169 |
176 #endif // V8_DEBUG_DEBUG_SCOPES_H_ | 170 #endif // V8_DEBUG_DEBUG_SCOPES_H_ |
OLD | NEW |