Line data Source code
1 : // Copyright 2017 the V8 project authors. All rights reserved.
2 : // Use of this source code is governed by a BSD-style license that can be
3 : // found in the LICENSE file.
4 :
5 : #ifndef V8_DEBUG_DEBUG_SCOPE_ITERATOR_H_
6 : #define V8_DEBUG_DEBUG_SCOPE_ITERATOR_H_
7 :
8 : #include "src/debug/debug-frames.h"
9 : #include "src/debug/debug-interface.h"
10 : #include "src/debug/debug-scopes.h"
11 : #include "src/frames.h"
12 :
13 : namespace v8 {
14 : namespace internal {
15 :
16 250324 : class DebugScopeIterator final : public debug::ScopeIterator {
17 : public:
18 : DebugScopeIterator(Isolate* isolate, FrameInspector* frame_inspector);
19 : DebugScopeIterator(Isolate* isolate, Handle<JSFunction> function);
20 : DebugScopeIterator(Isolate* isolate, Handle<JSGeneratorObject> generator);
21 :
22 : bool Done() override;
23 : void Advance() override;
24 : ScopeType GetType() override;
25 : v8::Local<v8::Object> GetObject() override;
26 : v8::Local<v8::Function> GetFunction() override;
27 : debug::Location GetStartLocation() override;
28 : debug::Location GetEndLocation() override;
29 :
30 : bool SetVariableValue(v8::Local<v8::String> name,
31 : v8::Local<v8::Value> value) override;
32 :
33 : private:
34 : bool ShouldIgnore();
35 :
36 : v8::internal::ScopeIterator iterator_;
37 : };
38 :
39 570 : class DebugWasmScopeIterator final : public debug::ScopeIterator {
40 : public:
41 : DebugWasmScopeIterator(Isolate* isolate, StandardFrame* frame,
42 : int inlined_frame_index);
43 :
44 : bool Done() override;
45 : void Advance() override;
46 : ScopeType GetType() override;
47 : v8::Local<v8::Object> GetObject() override;
48 : v8::Local<v8::Function> GetFunction() override;
49 : debug::Location GetStartLocation() override;
50 : debug::Location GetEndLocation() override;
51 :
52 : bool SetVariableValue(v8::Local<v8::String> name,
53 : v8::Local<v8::Value> value) override;
54 :
55 : private:
56 : Isolate* isolate_;
57 : StandardFrame* frame_;
58 : int inlined_frame_index_;
59 : ScopeType type_;
60 : };
61 : } // namespace internal
62 : } // namespace v8
63 :
64 : #endif // V8_DEBUG_DEBUG_SCOPE_ITERATOR_H_
|