v8/test/mjsunit/wasm/compilation-limits-asm.js
Andreas Haas 22615158ed Reland [wasm] Make WebAssembly.compile() asynchronous
The following aspects were changed for the reland:

* The DeferredHandleScope is supposed with a specific pattern,
  i.e. allocate handles in a normal HandleScope and then 
  reopen them in the DeferredHandleScope.
* Set the native_context when it is used in a task.

Change-Id: Ia42c46ec6bc73179cb1f458e36658414ff85cc23
Reviewed-on: https://chromium-review.googlesource.com/468809
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#44434}
2017-04-06 10:13:08 +00:00

23 lines
633 B
JavaScript

// Copyright 2017 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: --allow-natives-syntax --validate-asm
// Compilation limits for WASM are not enforced for asm->wasm.
%SetWasmCompileControls(0, false);
function AsmModule() {
"use asm";
function xxx() { return 43; }
function yyy() { return 43; }
function zzz() { return 43; }
function main() { return 43; }
return {main: main};
}
assertEquals(43, AsmModule(
undefined, undefined, new ArrayBuffer(1024)).main());
assertTrue(%IsAsmWasmCode(AsmModule));