summaryrefslogtreecommitdiff
path: root/deps/v8/src/wasm/function-body-decoder.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/wasm/function-body-decoder.h')
-rw-r--r--deps/v8/src/wasm/function-body-decoder.h42
1 files changed, 13 insertions, 29 deletions
diff --git a/deps/v8/src/wasm/function-body-decoder.h b/deps/v8/src/wasm/function-body-decoder.h
index 7dbb800399..13a3ae2d0c 100644
--- a/deps/v8/src/wasm/function-body-decoder.h
+++ b/deps/v8/src/wasm/function-body-decoder.h
@@ -17,7 +17,6 @@ namespace v8 {
namespace internal {
class BitVector; // forward declaration
-class Counters;
namespace compiler { // external declarations from compiler.
class NodeOriginTable;
@@ -26,9 +25,10 @@ class WasmGraphBuilder;
namespace wasm {
-typedef compiler::WasmGraphBuilder TFBuilder;
struct WasmModule; // forward declaration of module interface.
-enum ModuleOrigin : uint8_t;
+struct WasmFeatures;
+
+typedef compiler::WasmGraphBuilder TFBuilder;
// A wrapper around the signature and bytes of a function.
struct FunctionBody {
@@ -43,47 +43,30 @@ struct FunctionBody {
};
V8_EXPORT_PRIVATE DecodeResult VerifyWasmCode(AccountingAllocator* allocator,
- const wasm::WasmModule* module,
+ const WasmFeatures& enabled,
+ const WasmModule* module,
+ WasmFeatures* detected,
FunctionBody& body);
-// Note: If run in the background thread, must follow protocol using
-// isolate::async_counters() to guarantee usability of counters argument.
-DecodeResult VerifyWasmCodeWithStats(AccountingAllocator* allocator,
- const wasm::WasmModule* module,
- FunctionBody& body, ModuleOrigin origin,
- Counters* counters);
-
-DecodeResult BuildTFGraph(AccountingAllocator* allocator, TFBuilder* builder,
+DecodeResult BuildTFGraph(AccountingAllocator* allocator,
+ const WasmFeatures& enabled, const WasmModule* module,
+ TFBuilder* builder, WasmFeatures* detected,
FunctionBody& body,
compiler::NodeOriginTable* node_origins);
enum PrintLocals { kPrintLocals, kOmitLocals };
V8_EXPORT_PRIVATE
bool PrintRawWasmCode(AccountingAllocator* allocator, const FunctionBody& body,
- const wasm::WasmModule* module, PrintLocals print_locals);
+ const WasmModule* module, PrintLocals print_locals);
V8_EXPORT_PRIVATE
bool PrintRawWasmCode(AccountingAllocator* allocator, const FunctionBody& body,
- const wasm::WasmModule* module, PrintLocals print_locals,
+ const WasmModule* module, PrintLocals print_locals,
std::ostream& out,
std::vector<int>* line_numbers = nullptr);
// A simplified form of AST printing, e.g. from a debugger.
void PrintRawWasmCode(const byte* start, const byte* end);
-inline DecodeResult VerifyWasmCode(AccountingAllocator* allocator,
- const WasmModule* module, FunctionSig* sig,
- const byte* start, const byte* end) {
- FunctionBody body(sig, 0, start, end);
- return VerifyWasmCode(allocator, module, body);
-}
-
-inline DecodeResult BuildTFGraph(AccountingAllocator* allocator,
- TFBuilder* builder, FunctionSig* sig,
- const byte* start, const byte* end) {
- FunctionBody body(sig, 0, start, end);
- return BuildTFGraph(allocator, builder, body, nullptr);
-}
-
struct BodyLocalDecls {
// The size of the encoded declarations.
uint32_t encoded_size = 0; // size of encoded declarations
@@ -93,7 +76,8 @@ struct BodyLocalDecls {
explicit BodyLocalDecls(Zone* zone) : type_list(zone) {}
};
-V8_EXPORT_PRIVATE bool DecodeLocalDecls(BodyLocalDecls* decls,
+V8_EXPORT_PRIVATE bool DecodeLocalDecls(const WasmFeatures& enabled,
+ BodyLocalDecls* decls,
const byte* start, const byte* end);
V8_EXPORT_PRIVATE BitVector* AnalyzeLoopAssignmentForTesting(Zone* zone,