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

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

Issue 2361053004: Revert of [wasm] Master CL for Binary 0xC changes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 3 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-debug.cc ('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 1f6e2a76139fcdde12946840f32017ae9fbf802a..91b592c0c1bafcd8e8a69c82fa1f4aad041185d6 100644
--- a/src/wasm/wasm-interpreter.h
+++ b/src/wasm/wasm-interpreter.h
@@ -28,7 +28,15 @@
const pc_t kInvalidPc = 0x80000000;
-typedef ZoneMap<pc_t, pcdiff_t> ControlTransferMap;
+// Visible for testing. A {ControlTransfer} helps the interpreter figure out
+// the target program counter and stack manipulations for a branch.
+struct ControlTransfer {
+ enum StackAction { kNoAction, kPopAndRepush, kPushVoid };
+ pcdiff_t pcdiff; // adjustment to the program counter (positive or negative).
+ spdiff_t spdiff; // number of elements to pop off the stack.
+ StackAction action; // action to perform on the stack.
+};
+typedef ZoneMap<pc_t, ControlTransfer> ControlTransferMap;
// Macro for defining union members.
#define FOREACH_UNION_MEMBER(V) \
@@ -124,7 +132,7 @@
virtual int GetFrameCount() = 0;
virtual const WasmFrame* GetFrame(int index) = 0;
virtual WasmFrame* GetMutableFrame(int index) = 0;
- virtual WasmVal GetReturnValue(int index = 0) = 0;
+ virtual WasmVal GetReturnValue() = 0;
// Thread-specific breakpoints.
bool SetBreakpoint(const WasmFunction* function, int pc, bool enabled);
@@ -181,8 +189,9 @@
bool SetFunctionCodeForTesting(const WasmFunction* function,
const byte* start, const byte* end);
- // Computes the control transfers for the given bytecode. Used internally in
- // the interpreter, but exposed for testing.
+ // Computes the control targets for the given bytecode as {pc offset, sp
+ // offset}
+ // pairs. Used internally in the interpreter, but exposed for testing.
static ControlTransferMap ComputeControlTransfersForTesting(Zone* zone,
const byte* start,
const byte* end);
« no previous file with comments | « src/wasm/wasm-debug.cc ('k') | src/wasm/wasm-interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698