From 6368dd2fdaead388a3062b8bdc47e25d7f3a2c6a Mon Sep 17 00:00:00 2001 From: Michael Holman Date: Thu, 10 Nov 2016 18:21:12 -0800 Subject: [PATCH 1/2] put wasm under experimental JS features flag --- lib/Common/ConfigFlagsList.h | 20 +++-- lib/Runtime/Base/ThreadConfigFlagsList.h | 1 + lib/Runtime/Library/JavascriptLibrary.cpp | 10 +-- lib/Runtime/Library/WebAssemblyModule.cpp | 4 +- lib/WasmReader/WasmReader.h | 2 +- test/WasmSpec/rlexe.xml | 104 +++++++++++----------- test/wasm/rlexe.xml | 32 +++---- 7 files changed, 90 insertions(+), 83 deletions(-) diff --git a/lib/Common/ConfigFlagsList.h b/lib/Common/ConfigFlagsList.h index 201cd215c42..e603b43336a 100644 --- a/lib/Common/ConfigFlagsList.h +++ b/lib/Common/ConfigFlagsList.h @@ -31,13 +31,12 @@ PHASE(All) PHASE(Delay) PHASE(Speculation) PHASE(GatherCodeGenData) - PHASE(Wasm) - PHASE(WasmBytecode) - PHASE(WasmParser) - PHASE(WasmReader) - PHASE(WasmSection) - PHASE(WasmLEB128) - PHASE(WasmFunctionBody) + PHASE(WasmBytecode) + PHASE(WasmParser) + PHASE(WasmReader) + PHASE(WasmSection) + PHASE(WasmLEB128) + PHASE(WasmFunctionBody) PHASE(WasmDeferred) PHASE(WasmNativeTypeCallTest) PHASE(Asmjs) @@ -378,6 +377,7 @@ PHASE(All) #else #define DEFAULT_CONFIG_SIMDJS (false) #endif +#define DEFAULT_CONFIG_WASM (false) #define DEFAULT_CONFIG_BgJitDelayFgBuffer (0) #define DEFAULT_CONFIG_BgJitPendingFuncCap (31) #define DEFAULT_CONFIG_CurrentSourceInfo (true) @@ -830,6 +830,7 @@ FLAGNR(Boolean, AsmJsEdge , "Enable asm.js features which may have b #define COMPILE_DISABLE_Simdjs 0 #endif FLAGPR_REGOVR_EXP(Boolean, ES6, Simdjs, "Enable Simdjs", DEFAULT_CONFIG_SIMDJS) + FLAGR(Boolean, Simd128TypeSpec, "Enable type-specialization of Simd128 symbols", false) FLAGNR(Boolean, AssertBreak , "Debug break on assert", false) @@ -1023,6 +1024,11 @@ FLAGPRA (Boolean, ES6, ESSharedArrayBuffer , sab , "Enable Share // /ES6 (BLUE+1) features/flags +#ifndef COMPILE_DISABLE_Wasm +#define COMPILE_DISABLE_Wasm 0 +#endif +FLAGPR_REGOVR_EXP(Boolean, ES6, Wasm, "Enable WebAssembly", DEFAULT_CONFIG_WASM) + #ifdef ENABLE_PROJECTION FLAGNR(Boolean, WinRTDelegateInterfaces , "Treat WinRT Delegates as Interfaces when determining their resolvability.", DEFAULT_CONFIG_WinRTDelegateInterfaces) FLAGR(Boolean, WinRTAdaptiveApps , "Enable the adaptive apps feature, allowing for variable projection." , DEFAULT_CONFIG_WinRTAdaptiveApps) diff --git a/lib/Runtime/Base/ThreadConfigFlagsList.h b/lib/Runtime/Base/ThreadConfigFlagsList.h index 85805e5474d..a7398f42f5a 100644 --- a/lib/Runtime/Base/ThreadConfigFlagsList.h +++ b/lib/Runtime/Base/ThreadConfigFlagsList.h @@ -48,6 +48,7 @@ FLAG_RELEASE(IsES7AsyncAndAwaitEnabled, ES7AsyncAwait) FLAG_RELEASE(IsArrayBufferTransferEnabled, ArrayBufferTransfer) FLAG_RELEASE(IsESObjectGetOwnPropertyDescriptorsEnabled, ESObjectGetOwnPropertyDescriptors) FLAG_RELEASE(IsESSharedArrayBufferEnabled, ESSharedArrayBuffer) +FLAG_RELEASE(IsWasmEnabled, Wasm) #ifdef ENABLE_PROJECTION FLAG(AreWinRTDelegatesInterfaces, WinRTDelegateInterfaces) FLAG_RELEASE(IsWinRTAdaptiveAppsEnabled, WinRTAdaptiveApps) diff --git a/lib/Runtime/Library/JavascriptLibrary.cpp b/lib/Runtime/Library/JavascriptLibrary.cpp index eb5874a8a0e..4259199e9e5 100644 --- a/lib/Runtime/Library/JavascriptLibrary.cpp +++ b/lib/Runtime/Library/JavascriptLibrary.cpp @@ -307,7 +307,7 @@ namespace Js INIT_ERROR_PROTO(uriErrorPrototype, InitializeURIErrorPrototype); #ifdef ENABLE_WASM - if (PHASE_ON1(WasmPhase)) + if (scriptContext->GetConfig()->IsWasmEnabled()) { INIT_ERROR_PROTO(webAssemblyCompileErrorPrototype, InitializeWebAssemblyCompileErrorPrototype); INIT_ERROR_PROTO(webAssemblyRuntimeErrorPrototype, InitializeWebAssemblyRuntimeErrorPrototype); @@ -363,7 +363,7 @@ namespace Js DeferredTypeHandler::GetDefaultInstance())); #ifdef ENABLE_WASM - if (PHASE_ON1(WasmPhase)) + if (scriptContext->GetConfig()->IsWasmEnabled()) { webAssemblyMemoryPrototype = DynamicObject::New(recycler, DynamicType::New(scriptContext, TypeIds_Object, objectPrototype, nullptr, @@ -467,7 +467,7 @@ namespace Js INIT_SIMPLE_TYPE(uriErrorType, TypeIds_Error, uriErrorPrototype); #ifdef ENABLE_WASM - if (PHASE_ON1(WasmPhase)) + if (scriptContext->GetConfig()->IsWasmEnabled()) { INIT_SIMPLE_TYPE(webAssemblyCompileErrorType, TypeIds_Error, webAssemblyCompileErrorPrototype); INIT_SIMPLE_TYPE(webAssemblyRuntimeErrorType, TypeIds_Error, webAssemblyRuntimeErrorPrototype); @@ -612,7 +612,7 @@ namespace Js #endif #ifdef ENABLE_WASM - if (PHASE_ON1(WasmPhase)) + if (scriptContext->GetConfig()->IsWasmEnabled()) { webAssemblyModuleType = DynamicType::New(scriptContext, TypeIds_WebAssemblyModule, webAssemblyModulePrototype, nullptr, NullTypeHandler::GetDefaultInstance(), true, true); webAssemblyInstanceType = DynamicType::New(scriptContext, TypeIds_WebAssemblyInstance, webAssemblyInstancePrototype, nullptr, NullTypeHandler::GetDefaultInstance(), true, true); @@ -1508,7 +1508,7 @@ namespace Js AddFunction(globalObject, PropertyIds::URIError, uriErrorConstructor); #ifdef ENABLE_WASM - if (PHASE_ON1(WasmPhase)) + if (scriptContext->GetConfig()->IsWasmEnabled()) { // new WebAssembly object webAssemblyObject = DynamicObject::New(recycler, diff --git a/lib/Runtime/Library/WebAssemblyModule.cpp b/lib/Runtime/Library/WebAssemblyModule.cpp index 15c43ec5cfc..3f206f55131 100644 --- a/lib/Runtime/Library/WebAssemblyModule.cpp +++ b/lib/Runtime/Library/WebAssemblyModule.cpp @@ -94,7 +94,7 @@ WebAssemblyModule::CreateModule( const byte* buffer, const uint lengthBytes) { - AutoProfilingPhase wasmPhase(scriptContext, Js::WasmPhase); + AutoProfilingPhase wasmPhase(scriptContext, Js::WasmBytecodePhase); Unused(wasmPhase); WebAssemblyModule * webAssemblyModule = nullptr; @@ -162,7 +162,7 @@ WebAssemblyModule::ValidateModule( const byte* buffer, const uint lengthBytes) { - AutoProfilingPhase wasmPhase(scriptContext, Js::WasmPhase); + AutoProfilingPhase wasmPhase(scriptContext, Js::WasmBytecodePhase); Unused(wasmPhase); try diff --git a/lib/WasmReader/WasmReader.h b/lib/WasmReader/WasmReader.h index c226dea0de0..1120ef2e3b3 100644 --- a/lib/WasmReader/WasmReader.h +++ b/lib/WasmReader/WasmReader.h @@ -20,7 +20,7 @@ } // Level of tracing -#define DO_WASM_TRACE_ALL PHASE_TRACE1(Js::WasmPhase) +#define DO_WASM_TRACE_ALL PHASE_TRACE1(Js::WasmBytecodePhase) #define DO_WASM_TRACE_DECODER DO_WASM_TRACE_ALL || PHASE_TRACE1(Js::WasmReaderPhase) #define DO_WASM_TRACE_SECTION DO_WASM_TRACE_DECODER || PHASE_TRACE1(Js::WasmSectionPhase) #define DO_WASM_TRACE_LEB128 DO_WASM_TRACE_ALL || PHASE_TRACE1(Js::WasmLEB128Phase) diff --git a/test/WasmSpec/rlexe.xml b/test/WasmSpec/rlexe.xml index baddf084127..b140b811af3 100644 --- a/test/WasmSpec/rlexe.xml +++ b/test/WasmSpec/rlexe.xml @@ -5,364 +5,364 @@ spec.js baselines\address.baseline - -on:wasm -args testsuite-bin\address.json -endargs + -wasm -args testsuite-bin\address.json -endargs spec.js baselines\block.baseline - -on:wasm -args testsuite-bin\block.json -endargs + -wasm -args testsuite-bin\block.json -endargs spec.js baselines\br.baseline - -on:wasm -args testsuite-bin\br.json -endargs + -wasm -args testsuite-bin\br.json -endargs spec.js baselines\br_if.baseline - -on:wasm -args testsuite-bin\br_if.json -endargs + -wasm -args testsuite-bin\br_if.json -endargs spec.js baselines\br_table.baseline - -on:wasm -args testsuite-bin\br_table.json -endargs + -wasm -args testsuite-bin\br_table.json -endargs spec.js baselines\break-drop.baseline - -on:wasm -args testsuite-bin\break-drop.json -endargs + -wasm -args testsuite-bin\break-drop.json -endargs spec.js baselines\call.baseline - -on:wasm -args testsuite-bin\call.json -endargs + -wasm -args testsuite-bin\call.json -endargs spec.js baselines\call_indirect.baseline - -on:wasm -args testsuite-bin\call_indirect.json -endargs + -wasm -args testsuite-bin\call_indirect.json -endargs spec.js baselines\chakra_i64.baseline - -on:wasm -args testsuite-bin\chakra_i64.json -endargs + -wasm -args testsuite-bin\chakra_i64.json -endargs spec.js baselines\comments.baseline - -on:wasm -args testsuite-bin\comments.json -endargs + -wasm -args testsuite-bin\comments.json -endargs spec.js baselines\conversions.baseline - -on:wasm -args testsuite-bin\conversions.json -endargs + -wasm -args testsuite-bin\conversions.json -endargs spec.js baselines\endianness.baseline - -on:wasm -args testsuite-bin\endianness.json -endargs + -wasm -args testsuite-bin\endianness.json -endargs spec.js baselines\f32.baseline - -on:wasm -args testsuite-bin\f32.json -endargs + -wasm -args testsuite-bin\f32.json -endargs spec.js baselines\f32_cmp.baseline - -on:wasm -args testsuite-bin\f32_cmp.json -endargs + -wasm -args testsuite-bin\f32_cmp.json -endargs spec.js baselines\f64.baseline - -on:wasm -args testsuite-bin\f64.json -endargs + -wasm -args testsuite-bin\f64.json -endargs spec.js baselines\f64_cmp.baseline - -on:wasm -args testsuite-bin\f64_cmp.json -endargs + -wasm -args testsuite-bin\f64_cmp.json -endargs spec.js baselines\fac.baseline - -on:wasm -args testsuite-bin\fac.json -endargs + -wasm -args testsuite-bin\fac.json -endargs spec.js baselines\float_exprs.baseline - -on:wasm -args testsuite-bin\float_exprs.json -endargs + -wasm -args testsuite-bin\float_exprs.json -endargs spec.js baselines\float_literals.baseline - -on:wasm -args testsuite-bin\float_literals.json -endargs + -wasm -args testsuite-bin\float_literals.json -endargs spec.js baselines\float_misc.baseline - -on:wasm -args testsuite-bin\float_misc.json -endargs + -wasm -args testsuite-bin\float_misc.json -endargs spec.js baselines\forward.baseline - -on:wasm -args testsuite-bin\forward.json -endargs + -wasm -args testsuite-bin\forward.json -endargs spec.js baselines\func.baseline - -on:wasm -args testsuite-bin\func.json -endargs + -wasm -args testsuite-bin\func.json -endargs spec.js baselines\func_ptrs.baseline - -on:wasm -args testsuite-bin\func_ptrs.json -endargs + -wasm -args testsuite-bin\func_ptrs.json -endargs spec.js baselines\get_local.baseline - -on:wasm -args testsuite-bin\get_local.json -endargs + -wasm -args testsuite-bin\get_local.json -endargs spec.js baselines\globals.baseline - -on:wasm -args testsuite-bin\globals.json -endargs + -wasm -args testsuite-bin\globals.json -endargs spec.js baselines\i32.baseline - -on:wasm -args testsuite-bin\i32.json -endargs + -wasm -args testsuite-bin\i32.json -endargs spec.js baselines\i64.baseline - -on:wasm -args testsuite-bin\i64.json -endargs + -wasm -args testsuite-bin\i64.json -endargs spec.js baselines\imports.baseline - -on:wasm -args testsuite-bin\imports.json -endargs + -wasm -args testsuite-bin\imports.json -endargs spec.js baselines\int_exprs.baseline - -on:wasm -args testsuite-bin\int_exprs.json -endargs + -wasm -args testsuite-bin\int_exprs.json -endargs spec.js baselines\int_literals.baseline - -on:wasm -args testsuite-bin\int_literals.json -endargs + -wasm -args testsuite-bin\int_literals.json -endargs spec.js baselines\labels.baseline - -on:wasm -args testsuite-bin\labels.json -endargs + -wasm -args testsuite-bin\labels.json -endargs spec.js baselines\left-to-right.baseline - -on:wasm -args testsuite-bin\left-to-right.json -endargs + -wasm -args testsuite-bin\left-to-right.json -endargs spec.js baselines\loop.baseline - -on:wasm -args testsuite-bin\loop.json -endargs + -wasm -args testsuite-bin\loop.json -endargs spec.js baselines\memory.baseline - -on:wasm -args testsuite-bin\memory.json -endargs + -wasm -args testsuite-bin\memory.json -endargs spec.js baselines\memory_redundancy.baseline - -on:wasm -args testsuite-bin\memory_redundancy.json -endargs + -wasm -args testsuite-bin\memory_redundancy.json -endargs spec.js baselines\memory_trap.baseline - -on:wasm -args testsuite-bin\memory_trap.json -endargs + -wasm -args testsuite-bin\memory_trap.json -endargs spec.js baselines\names.baseline - -on:wasm -args testsuite-bin\names.json -endargs + -wasm -args testsuite-bin\names.json -endargs spec.js baselines\nop.baseline - -on:wasm -args testsuite-bin\nop.json -endargs + -wasm -args testsuite-bin\nop.json -endargs spec.js baselines\resizing.baseline - -on:wasm -args testsuite-bin\resizing.json -endargs + -wasm -args testsuite-bin\resizing.json -endargs spec.js baselines\return.baseline - -on:wasm -args testsuite-bin\return.json -endargs + -wasm -args testsuite-bin\return.json -endargs spec.js baselines\select.baseline - -on:wasm -args testsuite-bin\select.json -endargs + -wasm -args testsuite-bin\select.json -endargs spec.js baselines\set_local.baseline - -on:wasm -args testsuite-bin\set_local.json -endargs + -wasm -args testsuite-bin\set_local.json -endargs spec.js baselines\skip-stack-guard-page.baseline - -on:wasm -args testsuite-bin\skip-stack-guard-page.json -endargs + -wasm -args testsuite-bin\skip-stack-guard-page.json -endargs spec.js baselines\stack.baseline - -on:wasm -args testsuite-bin\stack.json -endargs + -wasm -args testsuite-bin\stack.json -endargs spec.js baselines\start.baseline - -on:wasm -args testsuite-bin\start.json -endargs + -wasm -args testsuite-bin\start.json -endargs spec.js baselines\store_retval.baseline - -on:wasm -args testsuite-bin\store_retval.json -endargs + -wasm -args testsuite-bin\store_retval.json -endargs spec.js baselines\switch.baseline - -on:wasm -args testsuite-bin\switch.json -endargs + -wasm -args testsuite-bin\switch.json -endargs spec.js baselines\tee_local.baseline - -on:wasm -args testsuite-bin\tee_local.json -endargs + -wasm -args testsuite-bin\tee_local.json -endargs spec.js baselines\traps.baseline - -on:wasm -args testsuite-bin\traps.json -endargs + -wasm -args testsuite-bin\traps.json -endargs spec.js baselines\typecheck.baseline - -on:wasm -args testsuite-bin\typecheck.json -endargs + -wasm -args testsuite-bin\typecheck.json -endargs spec.js baselines\unreachable.baseline - -on:wasm -args testsuite-bin\unreachable.json -endargs + -wasm -args testsuite-bin\unreachable.json -endargs spec.js baselines\unwind.baseline - -on:wasm -args testsuite-bin\unwind.json -endargs + -wasm -args testsuite-bin\unwind.json -endargs diff --git a/test/wasm/rlexe.xml b/test/wasm/rlexe.xml index 8429ab3afab..1e768dab537 100644 --- a/test/wasm/rlexe.xml +++ b/test/wasm/rlexe.xml @@ -4,108 +4,108 @@ rot.js rot.baseline - -on:wasm + -wasm misc.js misc.baseline - -on:wasm + -wasm controlflow.js controlflow.baseline - -on:wasm + -wasm f32.js f32.baseline - -on:Wasm + -wasm math.js - -on:Wasm -on:WasmNativeTypeCallTest + -wasm -on:wasmNativeTypeCallTest dropteelocal.js dropteelocal.baseline - -on:Wasm + -wasm i32_popcnt.js i32_popcnt.baseline - -on:Wasm + -wasm f32address.js - -on:Wasm + -wasm unreachable.js - -on:Wasm + -wasm global.js global.baseline - -on:Wasm + -wasm basic.js basic.baseline - -on:Wasm + -wasm table.js table.baseline - -on:Wasm + -wasm table_imports.js baselines\table_imports.baseline - -on:Wasm -on:WasmNativeTypeCallTest + -wasm -on:wasmNativeTypeCallTest call.js baselines\call.baseline - -on:Wasm + -wasm array.js array.baseline - -on:Wasm + -wasm trunc.js - -on:Wasm + -wasm From b09b62aa3689a9fff55818f107be502489ec2d35 Mon Sep 17 00:00:00 2001 From: Michael Holman Date: Fri, 11 Nov 2016 11:52:34 -0800 Subject: [PATCH 2/2] update es6 baselines --- test/es6/es6_all.baseline | 2 ++ test/es6/es6_stable.baseline | 2 ++ test/es6/es6_stable.enable_disable.baseline | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/test/es6/es6_all.baseline b/test/es6/es6_all.baseline index 0062cb0ac98..8d79fee967b 100644 --- a/test/es6/es6_all.baseline +++ b/test/es6/es6_all.baseline @@ -81,5 +81,7 @@ FLAG ES6 = 1 - setting child flag ESObjectGetOwnPropertyDescriptors = 1 FLAG ESObjectGetOwnPropertyDescriptors = 1 FLAG ES6 = 1 - setting child flag ESSharedArrayBuffer = 1 FLAG ESSharedArrayBuffer = 1 +FLAG ES6 = 1 - setting child flag Wasm = 1 +FLAG Wasm = 1 FLAG WERExceptionSupport = 1 default argument diff --git a/test/es6/es6_stable.baseline b/test/es6/es6_stable.baseline index 75d4991c9ba..cff24398b95 100644 --- a/test/es6/es6_stable.baseline +++ b/test/es6/es6_stable.baseline @@ -83,6 +83,8 @@ FLAG ES6 = 1 - setting child flag ESObjectGetOwnPropertyDescriptors = 1 FLAG ESObjectGetOwnPropertyDescriptors = 1 FLAG ES6 = 1 - setting child flag ESSharedArrayBuffer = 0 FLAG ESSharedArrayBuffer = 0 +FLAG ES6 = 1 - setting child flag Wasm = 0 +FLAG Wasm = 0 FLAG ES6DefaultArgs = 1 FLAG WERExceptionSupport = 1 default argument diff --git a/test/es6/es6_stable.enable_disable.baseline b/test/es6/es6_stable.enable_disable.baseline index 908519e936e..234f064708c 100644 --- a/test/es6/es6_stable.enable_disable.baseline +++ b/test/es6/es6_stable.enable_disable.baseline @@ -83,6 +83,8 @@ FLAG ES6 = 1 - setting child flag ESObjectGetOwnPropertyDescriptors = 1 FLAG ESObjectGetOwnPropertyDescriptors = 1 FLAG ES6 = 1 - setting child flag ESSharedArrayBuffer = 0 FLAG ESSharedArrayBuffer = 0 +FLAG ES6 = 1 - setting child flag Wasm = 0 +FLAG Wasm = 0 FLAG ES6 = 0 FLAG ES6 = 0 - setting child flag Simdjs = 0 FLAG Simdjs = 0 @@ -168,6 +170,8 @@ FLAG ES6 = 0 - setting child flag ESObjectGetOwnPropertyDescriptors = 0 FLAG ESObjectGetOwnPropertyDescriptors = 0 FLAG ES6 = 0 - setting child flag ESSharedArrayBuffer = 0 FLAG ESSharedArrayBuffer = 0 +FLAG ES6 = 0 - setting child flag Wasm = 0 +FLAG Wasm = 0 FLAG ES6DefaultArgs = 1 FLAG WERExceptionSupport = 1 default argument