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

Unified Diff: src/wasm/wasm-interpreter.h

Issue 2096863003: [wasm] prototype for breakpoint support. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@extend-script-functionality
Patch Set: Created 4 years, 6 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/wasm/wasm-external-refs.h ('k') | src/wasm/wasm-interpreter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-interpreter.h
diff --git a/src/wasm/wasm-interpreter.h b/src/wasm/wasm-interpreter.h
index b106a202d218fb153dea168b1ef8f91bb748da19..ff1ce2422b3b4fdac568a55175dd2f8321262fb3 100644
--- a/src/wasm/wasm-interpreter.h
+++ b/src/wasm/wasm-interpreter.h
@@ -84,15 +84,16 @@ inline void WasmVal::to() {
}
// Representation of frames within the interpreter.
-class WasmFrame {
+class WasmInterpreterFrame {
public:
const WasmFunction* function() const { return function_; }
int pc() const { return pc_; }
private:
friend class WasmInterpreter;
+ friend class ThreadImpl;
- WasmFrame(const WasmFunction* function, int pc, int fp, int sp)
+ WasmInterpreterFrame(const WasmFunction* function, int pc, int fp, int sp)
: function_(function), pc_(pc), fp_(fp), sp_(sp) {}
const WasmFunction* function_;
@@ -130,17 +131,16 @@ class WasmInterpreter {
// Stack inspection and modification.
virtual pc_t GetBreakpointPc() = 0;
virtual int GetFrameCount() = 0;
- virtual const WasmFrame* GetFrame(int index) = 0;
- virtual WasmFrame* GetMutableFrame(int index) = 0;
+ virtual const WasmInterpreterFrame* GetFrame(int index) = 0;
+ virtual WasmInterpreterFrame* GetMutableFrame(int index) = 0;
virtual WasmVal GetReturnValue() = 0;
// Thread-specific breakpoints.
- bool SetBreakpoint(const WasmFunction* function, int pc, bool enabled);
- bool GetBreakpoint(const WasmFunction* function, int pc);
+ bool SetBreakpoint(uint32_t function_index, int pc, bool enabled);
+ bool GetBreakpoint(uint32_t function_index, int pc);
};
- WasmInterpreter(WasmModuleInstance* instance,
- base::AccountingAllocator* allocator);
+ WasmInterpreter(WasmModuleInstance* instance, Zone* zone);
~WasmInterpreter();
//==========================================================================
@@ -149,12 +149,12 @@ class WasmInterpreter {
void Run();
void Pause();
- // Set a breakpoint at {pc} in {function} to be {enabled}. Returns the
+ // Set a breakpoint at {pc} in {function_index} to be {enabled}. Returns the
// previous state of the breakpoint at {pc}.
- bool SetBreakpoint(const WasmFunction* function, pc_t pc, bool enabled);
+ bool SetBreakpoint(uint32_t function_index, pc_t pc, bool enabled);
- // Gets the current state of the breakpoint at {function}.
- bool GetBreakpoint(const WasmFunction* function, pc_t pc);
+ // Gets the current state of the breakpoint at {function_index}.
+ bool GetBreakpoint(uint32_t function_index, pc_t pc);
// Enable or disable tracing for {function}. Return the previous state.
bool SetTracing(const WasmFunction* function, bool enabled);
@@ -168,10 +168,10 @@ class WasmInterpreter {
//==========================================================================
// Stack frame inspection.
//==========================================================================
- WasmVal GetLocalVal(const WasmFrame* frame, int index);
- WasmVal GetExprVal(const WasmFrame* frame, int pc);
- void SetLocalVal(WasmFrame* frame, int index, WasmVal val);
- void SetExprVal(WasmFrame* frame, int pc, WasmVal val);
+ WasmVal GetLocalVal(const WasmInterpreterFrame* frame, int index);
+ WasmVal GetExprVal(const WasmInterpreterFrame* frame, int pc);
+ void SetLocalVal(WasmInterpreterFrame* frame, int index, WasmVal val);
+ void SetExprVal(WasmInterpreterFrame* frame, int pc, WasmVal val);
//==========================================================================
// Memory access.
@@ -198,7 +198,7 @@ class WasmInterpreter {
const byte* end);
private:
- Zone zone_;
+ Zone* zone_;
WasmInterpreterInternals* internals_;
};
« no previous file with comments | « src/wasm/wasm-external-refs.h ('k') | src/wasm/wasm-interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698