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

Unified Diff: src/runtime/runtime-compiler.cc

Issue 2057403003: Hooking up asm-wasm conversion. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 4 years, 6 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/runtime/runtime.h ('k') | src/s390/builtins-s390.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-compiler.cc
diff --git a/src/runtime/runtime-compiler.cc b/src/runtime/runtime-compiler.cc
index c0950456f9b82d88802caa7e1e1b913ffbc11f02..258975375cf7dfcff431d4d02fb378bea023ef9f 100644
--- a/src/runtime/runtime-compiler.cc
+++ b/src/runtime/runtime-compiler.cc
@@ -5,6 +5,7 @@
#include "src/runtime/runtime-utils.h"
#include "src/arguments.h"
+#include "src/asmjs/asm-js.h"
#include "src/compiler.h"
#include "src/deoptimizer.h"
#include "src/frames-inl.h"
@@ -79,6 +80,31 @@ RUNTIME_FUNCTION(Runtime_CompileOptimized_NotConcurrent) {
return function->code();
}
+RUNTIME_FUNCTION(Runtime_InstantiateAsmJs) {
+ HandleScope scope(isolate);
+ DCHECK_EQ(args.length(), 4);
+ CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
+
+ Handle<JSObject> foreign;
+ if (args[2]->IsJSObject()) {
+ foreign = args.at<i::JSObject>(2);
+ }
+ Handle<JSArrayBuffer> memory;
+ if (args[3]->IsJSArrayBuffer()) {
+ memory = args.at<i::JSArrayBuffer>(3);
+ }
+ if (args[1]->IsJSObject()) {
+ MaybeHandle<Object> result;
+ result = AsmJs::InstantiateAsmWasm(
+ isolate, handle(function->shared()->asm_wasm_data()), memory, foreign);
+ if (!result.is_null()) {
+ return *result.ToHandleChecked();
+ }
+ }
+ // Remove wasm data and return a smi 0 to indicate failure.
+ function->shared()->ClearAsmWasmData();
+ return Smi::FromInt(0);
+}
RUNTIME_FUNCTION(Runtime_NotifyStubFailure) {
HandleScope scope(isolate);
@@ -89,7 +115,6 @@ RUNTIME_FUNCTION(Runtime_NotifyStubFailure) {
return isolate->heap()->undefined_value();
}
-
class ActivationsFinder : public ThreadVisitor {
public:
Code* code_;
« no previous file with comments | « src/runtime/runtime.h ('k') | src/s390/builtins-s390.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698