[wasm] Remove some dead module decoder entry points.

R=clemensh@chromium.org
BUG=v8:7754

Change-Id: Ia4c2fb2d87c8a5de96fa9f1f0621d21ae3eda611
Reviewed-on: https://chromium-review.googlesource.com/1145181
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54591}
This commit is contained in:
Michael Starzinger 2018-07-20 14:04:05 +02:00 committed by Commit Bot
parent 4b4125778a
commit bced36d203
3 changed files with 10 additions and 38 deletions

View File

@ -1498,18 +1498,14 @@ WasmInitExpr DecodeWasmInitExprForTesting(const byte* start, const byte* end) {
return decoder.DecodeInitExpr(start); return decoder.DecodeInitExpr(start);
} }
namespace { FunctionResult DecodeWasmFunctionForTesting(
Zone* zone, const ModuleWireBytes& wire_bytes, const WasmModule* module,
FunctionResult DecodeWasmFunction(Zone* zone, const ModuleWireBytes& wire_bytes, const byte* function_start, const byte* function_end, Counters* counters) {
const WasmModule* module,
const byte* function_start,
const byte* function_end,
Counters* counters) {
size_t size = function_end - function_start; size_t size = function_end - function_start;
if (function_start > function_end) if (function_start > function_end)
return FunctionResult::Error("start > end"); return FunctionResult::Error("start > end");
auto size_histogram = auto size_histogram = SELECT_WASM_COUNTER(counters, module->origin, wasm,
SELECT_WASM_COUNTER(counters, module->origin, wasm, function_size_bytes); function_size_bytes);
// TODO(bradnelson): Improve histogram handling of ptrdiff_t. // TODO(bradnelson): Improve histogram handling of ptrdiff_t.
size_histogram->AddSample(static_cast<int>(size)); size_histogram->AddSample(static_cast<int>(size));
if (size > kV8MaxWasmFunctionSize) if (size > kV8MaxWasmFunctionSize)
@ -1520,25 +1516,6 @@ FunctionResult DecodeWasmFunction(Zone* zone, const ModuleWireBytes& wire_bytes,
base::make_unique<WasmFunction>()); base::make_unique<WasmFunction>());
} }
} // namespace
FunctionResult SyncDecodeWasmFunction(Isolate* isolate, Zone* zone,
const ModuleWireBytes& wire_bytes,
const WasmModule* module,
const byte* function_start,
const byte* function_end) {
return DecodeWasmFunction(zone, wire_bytes, module, function_start,
function_end, isolate->counters());
}
FunctionResult AsyncDecodeWasmFunction(
Zone* zone, const ModuleWireBytes& wire_bytes, const WasmModule* module,
const byte* function_start, const byte* function_end,
std::shared_ptr<Counters> async_counters) {
return DecodeWasmFunction(zone, wire_bytes, module, function_start,
function_end, async_counters.get());
}
AsmJsOffsetsResult DecodeAsmJsOffsets(const byte* tables_start, AsmJsOffsetsResult DecodeAsmJsOffsets(const byte* tables_start,
const byte* tables_end) { const byte* tables_end) {
AsmJsOffsets table; AsmJsOffsets table;

View File

@ -74,14 +74,9 @@ V8_EXPORT_PRIVATE FunctionSig* DecodeWasmSignatureForTesting(Zone* zone,
// Decodes the bytes of a wasm function between // Decodes the bytes of a wasm function between
// {function_start} and {function_end}. // {function_start} and {function_end}.
V8_EXPORT_PRIVATE FunctionResult SyncDecodeWasmFunction( V8_EXPORT_PRIVATE FunctionResult DecodeWasmFunctionForTesting(
Isolate* isolate, Zone* zone, const ModuleWireBytes& wire_bytes, Zone* zone, const ModuleWireBytes& wire_bytes, const WasmModule* module,
const WasmModule* module, const byte* function_start, const byte* function_start, const byte* function_end, Counters* counters);
const byte* function_end);
V8_EXPORT_PRIVATE FunctionResult AsyncDecodeWasmFunction(
Zone* zone, ModuleEnv* env, const byte* function_start,
const byte* function_end, const std::shared_ptr<Counters> async_counters);
V8_EXPORT_PRIVATE WasmInitExpr DecodeWasmInitExprForTesting(const byte* start, V8_EXPORT_PRIVATE WasmInitExpr DecodeWasmInitExprForTesting(const byte* start,
const byte* end); const byte* end);

View File

@ -1453,8 +1453,8 @@ TEST_F(WasmFunctionVerifyTest, Ok_v_v_empty) {
kExprEnd // body kExprEnd // body
}; };
FunctionResult result = SyncDecodeWasmFunction( FunctionResult result = DecodeWasmFunctionForTesting(
isolate(), zone(), bytes, &module, data, data + sizeof(data)); zone(), bytes, &module, data, data + sizeof(data), isolate()->counters());
EXPECT_OK(result); EXPECT_OK(result);
if (result.val && result.ok()) { if (result.val && result.ok()) {