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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 ScopeIterator(Isolate* isolate, FrameInspector* frame_inspector, | 44 ScopeIterator(Isolate* isolate, FrameInspector* frame_inspector, |
45 Option options = DEFAULT); | 45 Option options = DEFAULT); |
46 | 46 |
47 ScopeIterator(Isolate* isolate, Handle<JSFunction> function); | 47 ScopeIterator(Isolate* isolate, Handle<JSFunction> function); |
48 ScopeIterator(Isolate* isolate, Handle<JSGeneratorObject> generator); | 48 ScopeIterator(Isolate* isolate, Handle<JSGeneratorObject> generator); |
49 | 49 |
50 MUST_USE_RESULT MaybeHandle<JSObject> MaterializeScopeDetails(); | 50 MUST_USE_RESULT MaybeHandle<JSObject> MaterializeScopeDetails(); |
51 | 51 |
52 // More scopes? | 52 // More scopes? |
53 bool Done() { | 53 bool Done() { return context_.is_null(); } |
54 DCHECK(!failed_); | |
55 return context_.is_null(); | |
56 } | |
57 | |
58 bool Failed() { return failed_; } | |
59 | 54 |
60 // Move to the next scope. | 55 // Move to the next scope. |
61 void Next(); | 56 void Next(); |
62 | 57 |
63 // Return the type of the current scope. | 58 // Return the type of the current scope. |
64 ScopeType Type(); | 59 ScopeType Type(); |
65 | 60 |
66 // Return the JavaScript object with the content of the current scope. | 61 // Return the JavaScript object with the content of the current scope. |
67 MaybeHandle<JSObject> ScopeObject(); | 62 MaybeHandle<JSObject> ScopeObject(); |
68 | 63 |
(...skipping 27 matching lines...) Expand all Loading... |
96 int end_position; | 91 int end_position; |
97 bool is_hidden() { return start_position == -1 && end_position == -1; } | 92 bool is_hidden() { return start_position == -1 && end_position == -1; } |
98 }; | 93 }; |
99 | 94 |
100 Isolate* isolate_; | 95 Isolate* isolate_; |
101 FrameInspector* const frame_inspector_; | 96 FrameInspector* const frame_inspector_; |
102 Handle<Context> context_; | 97 Handle<Context> context_; |
103 List<ExtendedScopeInfo> nested_scope_chain_; | 98 List<ExtendedScopeInfo> nested_scope_chain_; |
104 Handle<StringSet> non_locals_; | 99 Handle<StringSet> non_locals_; |
105 bool seen_script_scope_; | 100 bool seen_script_scope_; |
106 bool failed_; | |
107 | 101 |
108 inline JavaScriptFrame* GetFrame() { | 102 inline JavaScriptFrame* GetFrame() { |
109 return frame_inspector_->GetArgumentsFrame(); | 103 return frame_inspector_->GetArgumentsFrame(); |
110 } | 104 } |
111 | 105 |
112 inline Handle<JSFunction> GetFunction() { | 106 inline Handle<JSFunction> GetFunction() { |
113 return frame_inspector_->GetFunction(); | 107 return frame_inspector_->GetFunction(); |
114 } | 108 } |
115 | 109 |
116 void RetrieveScopeChain(DeclarationScope* scope); | 110 void RetrieveScopeChain(DeclarationScope* scope); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |