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