Add an --expose-wasm flag.

This adds a runtime flag that controls whether the WASM object is
exposed to JavaScript. While currently guarded by the V8_WASM build-time
flag, after landing in V8 the build-time flag will be removed, leaving
only this new runtime flag.

R=mstarzinger@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1507623002

Cr-Commit-Position: refs/heads/master@{#32657}
This commit is contained in:
titzer 2015-12-07 05:39:13 -08:00 committed by Commit bot
parent 5b5821142b
commit a29f81f603
2 changed files with 4 additions and 1 deletions

View File

@ -2657,7 +2657,9 @@ bool Genesis::InstallSpecialObjects(Handle<Context> native_context) {
} }
#if defined(V8_WASM) #if defined(V8_WASM)
WasmJs::Install(isolate, global); if (FLAG_expose_wasm) {
WasmJs::Install(isolate, global);
}
#endif #endif
return true; return true;

View File

@ -465,6 +465,7 @@ DEFINE_BOOL(trace_turbo_escape, false, "enable tracing in escape analysis")
#if defined(V8_WASM) #if defined(V8_WASM)
// Flags for native WebAssembly. // Flags for native WebAssembly.
DEFINE_BOOL(expose_wasm, true, "expose WASM interface to JavaScript")
DEFINE_BOOL(trace_wasm_decoder, false, "trace decoding of wasm code") DEFINE_BOOL(trace_wasm_decoder, false, "trace decoding of wasm code")
DEFINE_BOOL(trace_wasm_decode_time, false, "trace decoding time of wasm code") DEFINE_BOOL(trace_wasm_decode_time, false, "trace decoding time of wasm code")
DEFINE_BOOL(trace_wasm_compiler, false, "trace compiling of wasm code") DEFINE_BOOL(trace_wasm_compiler, false, "trace compiling of wasm code")