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

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

Issue 2229723002: [wasm] Support validation of asm.js modules with != 3 args. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 4 years, 4 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
Index: src/runtime/runtime-compiler.cc
diff --git a/src/runtime/runtime-compiler.cc b/src/runtime/runtime-compiler.cc
index 862fefcd5045ad3fbc7a5dcd85c2b032be34387a..43faa21315cfe7c02edcae7011f5f65cd55cfead 100644
--- a/src/runtime/runtime-compiler.cc
+++ b/src/runtime/runtime-compiler.cc
@@ -4,6 +4,8 @@
#include "src/runtime/runtime-utils.h"
+#include "src/runtime/runtime-compiler.h"
+
#include "src/arguments.h"
#include "src/asmjs/asm-js.h"
#include "src/compiler.h"
@@ -82,18 +84,19 @@ RUNTIME_FUNCTION(Runtime_CompileOptimized_NotConcurrent) {
RUNTIME_FUNCTION(Runtime_InstantiateAsmJs) {
HandleScope scope(isolate);
- DCHECK_EQ(args.length(), 4);
+ DCHECK_GE(args.length(), 1);
CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
Handle<JSObject> foreign;
- if (args[2]->IsJSObject()) {
+ if (args.length() > 2 && args[2]->IsJSObject()) {
foreign = args.at<i::JSObject>(2);
}
Handle<JSArrayBuffer> memory;
- if (args[3]->IsJSArrayBuffer()) {
+ if (args.length() > 3 && args[3]->IsJSArrayBuffer()) {
memory = args.at<i::JSArrayBuffer>(3);
}
- if (args[1]->IsJSObject()) {
+ if (args.length() > 1 && args[1]->IsJSObject() &&
+ function->shared()->HasAsmWasmData()) {
MaybeHandle<Object> result;
result = AsmJs::InstantiateAsmWasm(
isolate, handle(function->shared()->asm_wasm_data()), memory, foreign);
« src/runtime/runtime.h ('K') | « src/runtime/runtime.h ('k') | src/runtime/runtime-test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698