Commit ccfd224e authored by ritesht's avatar ritesht Committed by Commit bot

[wasm] Adding a convolution matrix filter test to highlight the performance advantages of JITing

This cl also fixes two bugs in the previous code:
    1) JITed functions were not allowed access to the heap because the module instance wasn't correctly synthesized. This wasn't discovered in the previous test.
    2) Decoding of functions with the JITSingleFunction opcode was off by 1 as the length of the opcode wasn't computed correctly.
BUG=5044

Review-Url: https://codereview.chromium.org/2168183002
Cr-Commit-Position: refs/heads/master@{#37957}
parent e6d12302
......@@ -152,11 +152,18 @@ RUNTIME_FUNCTION(Runtime_JITSingleFunction) {
Handle<JSArrayBuffer> mem_buffer = Handle<JSArrayBuffer>::cast(obj);
wasm::WasmModule module(reinterpret_cast<byte*>(mem_buffer->backing_store()));
wasm::ErrorThrower thrower(isolate, "JITSingleFunction");
wasm::WasmModule module(reinterpret_cast<byte*>(mem_buffer->backing_store()));
wasm::WasmModuleInstance instance(&module);
instance.context = isolate->native_context();
instance.mem_size =
static_cast<uint32_t>(mem_buffer->byte_length()->Number());
instance.mem_start = reinterpret_cast<byte*>(mem_buffer->backing_store());
instance.globals_start = nullptr;
wasm::ModuleEnv module_env;
module_env.module = &module;
module_env.instance = nullptr;
module_env.instance = &instance;
module_env.origin = wasm::kWasmOrigin;
uint32_t signature_size = args.length() - fixed_args;
......
......@@ -17,7 +17,6 @@
#include "src/ostreams.h"
#include "src/compiler/wasm-compiler.h"
namespace v8 {
namespace internal {
namespace wasm {
......@@ -1038,8 +1037,9 @@ class WasmFullDecoder : public WasmDecoder {
BUILD(JITSingleFunction, base.node, length.node, index.node,
operand.sig_index, operand.sig, position());
Push(kAstI32, call);
break;
}
len = 1 + operand.length;
break;
}
}
default:
......
This diff is collapsed.
......@@ -70,6 +70,7 @@ var kArity0 = 0;
var kArity1 = 1;
var kArity2 = 2;
var kArity3 = 3;
var kArity4 = 4;
var kWasmFunctionTypeForm = 0x40;
var section_names = [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment