e5f5ac7d2b
Make use of %IsAsmWasmCode in place of Wasm.instantiateModuleFromAsm, in order to reduce the surface area of the Wasm object, and to focus on testing asm.js coming in via the parser. Ignore extra CONST_LEGACY assignment introduced by the parser when modules have the form: (function Foo(a, b, c) {..}); This requires both a validator and AsmWasmBuilder change. Move stdlib use collection to import time, to reject modules that import a function, even if not used. BUG= https://bugs.chromium.org/p/v8/issues/detail?id=4203 LOG=N R=jpp@chromium.org,titzer@chromium.org Review-Url: https://codereview.chromium.org/2264913002 Cr-Commit-Position: refs/heads/master@{#38806}
27 lines
651 B
JavaScript
27 lines
651 B
JavaScript
// Copyright 2016 the V8 project authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
// Flags: --validate-asm --allow-natives-syntax
|
|
|
|
function __f_61(stdlib, foreign, buffer) {
|
|
"use asm";
|
|
var __v_14 = new stdlib.Float64Array(buffer);
|
|
function __f_74() {
|
|
var __v_35 = 6.0;
|
|
__v_14[2] = __v_35 + 1.0;
|
|
}
|
|
return {__f_74: __f_74};
|
|
}
|
|
var ok = false;
|
|
try {
|
|
var __v_12 = new ArrayBuffer(2147483648);
|
|
ok = true;
|
|
} catch (e) {
|
|
// Can happen on 32 bit systems.
|
|
}
|
|
if (ok) {
|
|
var module = __f_61(this, null, __v_12);
|
|
assertTrue(%IsAsmWasmCode(__f_61));
|
|
}
|