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

Unified Diff: src/wasm/function-body-decoder.h

Issue 2612643002: [wasm] simplify dependencies between graph builder and function decoder (Closed)
Patch Set: Created 3 years, 12 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/compiler/wasm-compiler.cc ('k') | src/wasm/function-body-decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/function-body-decoder.h
diff --git a/src/wasm/function-body-decoder.h b/src/wasm/function-body-decoder.h
index 744701da8b7432b13a9415f37d10262465b23bb8..b58b8e3bf6ba05ea358973af0922e7009a11b86b 100644
--- a/src/wasm/function-body-decoder.h
+++ b/src/wasm/function-body-decoder.h
@@ -308,11 +308,10 @@ struct MemoryAccessOperand {
};
typedef compiler::WasmGraphBuilder TFBuilder;
-struct ModuleEnv; // forward declaration of module interface.
+struct WasmModule; // forward declaration of module interface.
// All of the various data structures necessary to decode a function body.
struct FunctionBody {
- ModuleEnv* module; // module environment
FunctionSig* sig; // function signature
const byte* base; // base of the module bytes, for error reporting
const byte* start; // start of the function body
@@ -321,7 +320,7 @@ struct FunctionBody {
static inline FunctionBody FunctionBodyForTesting(const byte* start,
const byte* end) {
- return {nullptr, nullptr, start, start, end};
+ return {nullptr, start, start, end};
}
struct DecodeStruct {
@@ -333,28 +332,28 @@ inline std::ostream& operator<<(std::ostream& os, const DecodeStruct& tree) {
}
V8_EXPORT_PRIVATE DecodeResult VerifyWasmCode(AccountingAllocator* allocator,
+ const wasm::WasmModule* module,
FunctionBody& body);
DecodeResult BuildTFGraph(AccountingAllocator* allocator, TFBuilder* builder,
FunctionBody& body);
bool PrintWasmCode(AccountingAllocator* allocator, const FunctionBody& body,
- std::ostream& os,
+ const wasm::WasmModule* module, std::ostream& os,
std::vector<std::tuple<uint32_t, int, int>>* offset_table);
// A simplified form of AST printing, e.g. from a debugger.
void PrintWasmCodeForDebugging(const byte* start, const byte* end);
inline DecodeResult VerifyWasmCode(AccountingAllocator* allocator,
- ModuleEnv* module, FunctionSig* sig,
+ const WasmModule* module, FunctionSig* sig,
const byte* start, const byte* end) {
- FunctionBody body = {module, sig, nullptr, start, end};
- return VerifyWasmCode(allocator, body);
+ FunctionBody body = {sig, nullptr, start, end};
+ return VerifyWasmCode(allocator, module, body);
}
inline DecodeResult BuildTFGraph(AccountingAllocator* allocator,
- TFBuilder* builder, ModuleEnv* module,
- FunctionSig* sig, const byte* start,
- const byte* end) {
- FunctionBody body = {module, sig, nullptr, start, end};
+ TFBuilder* builder, FunctionSig* sig,
+ const byte* start, const byte* end) {
+ FunctionBody body = {sig, nullptr, start, end};
return BuildTFGraph(allocator, builder, body);
}
« no previous file with comments | « src/compiler/wasm-compiler.cc ('k') | src/wasm/function-body-decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698