Index: src/wasm/wasm-js.cc |
diff --git a/src/wasm/wasm-js.cc b/src/wasm/wasm-js.cc |
index 84c7e0d5cf9a4f3b3b81f629efda1e0399a9272b..add9c5373c18b4a7d0ae9ce2458bd8c0cfdf2782 100644 |
--- a/src/wasm/wasm-js.cc |
+++ b/src/wasm/wasm-js.cc |
@@ -100,31 +100,6 @@ void VerifyFunction(const v8::FunctionCallbackInfo<v8::Value>& args) { |
} |
-void CompileRun(const v8::FunctionCallbackInfo<v8::Value>& args) { |
- HandleScope scope(args.GetIsolate()); |
- i::Isolate* isolate = reinterpret_cast<i::Isolate*>(args.GetIsolate()); |
- ErrorThrower thrower(isolate, "WASM.compileRun()"); |
- |
- RawBuffer buffer = GetRawBufferArgument(thrower, args); |
- if (thrower.error()) return; |
- |
- // Decode and pre-verify the functions before compiling and running. |
- i::Zone zone; |
- internal::wasm::ModuleResult result = internal::wasm::DecodeWasmModule( |
- isolate, &zone, buffer.start, buffer.end, true, false); |
- |
- if (result.failed()) { |
- thrower.Failed("", result); |
- } else { |
- // Success. Compile and run! |
- int32_t retval = i::wasm::CompileAndRunWasmModule(isolate, result.val); |
- args.GetReturnValue().Set(retval); |
- } |
- |
- if (result.val) delete result.val; |
-} |
- |
- |
v8::internal::wasm::WasmModuleIndex* TranslateAsmModule(i::ParseInfo* info, |
ErrorThrower* thrower) { |
info->set_global(); |
@@ -156,37 +131,6 @@ v8::internal::wasm::WasmModuleIndex* TranslateAsmModule(i::ParseInfo* info, |
} |
-void AsmCompileRun(const v8::FunctionCallbackInfo<v8::Value>& args) { |
- HandleScope scope(args.GetIsolate()); |
- i::Isolate* isolate = reinterpret_cast<i::Isolate*>(args.GetIsolate()); |
- ErrorThrower thrower(isolate, "WASM.asmCompileRun()"); |
- |
- if (args.Length() != 1) { |
- thrower.Error("Invalid argument count"); |
- return; |
- } |
- if (!args[0]->IsString()) { |
- thrower.Error("Asm module text should be a string"); |
- return; |
- } |
- |
- i::Factory* factory = isolate->factory(); |
- i::Zone zone; |
- Local<String> source = Local<String>::Cast(args[0]); |
- i::Handle<i::Script> script = factory->NewScript(Utils::OpenHandle(*source)); |
- i::ParseInfo info(&zone, script); |
- |
- auto module = TranslateAsmModule(&info, &thrower); |
- if (module == nullptr) { |
- return; |
- } |
- |
- int32_t result = v8::internal::wasm::CompileAndRunWasmModule( |
- isolate, module->Begin(), module->End(), true); |
- args.GetReturnValue().Set(result); |
-} |
- |
- |
void InstantiateModuleCommon(const v8::FunctionCallbackInfo<v8::Value>& args, |
const byte* start, const byte* end, |
ErrorThrower* thrower, bool must_decode) { |
@@ -312,11 +256,9 @@ void WasmJs::Install(Isolate* isolate, Handle<JSGlobalObject> global) { |
JSObject::AddProperty(global, name, wasm_object, attributes); |
// Install functions on the WASM object. |
- InstallFunc(isolate, wasm_object, "instantiateModule", InstantiateModule); |
InstallFunc(isolate, wasm_object, "verifyModule", VerifyModule); |
InstallFunc(isolate, wasm_object, "verifyFunction", VerifyFunction); |
- InstallFunc(isolate, wasm_object, "compileRun", CompileRun); |
- InstallFunc(isolate, wasm_object, "asmCompileRun", AsmCompileRun); |
+ InstallFunc(isolate, wasm_object, "instantiateModule", InstantiateModule); |
InstallFunc(isolate, wasm_object, "instantiateModuleFromAsm", |
InstantiateModuleFromAsm); |
} |