From cad0ea9ed5f0ac1dda62abe2c66d0a38ff8c104d Mon Sep 17 00:00:00 2001 From: Seth Thompson Date: Wed, 26 Oct 2016 22:52:58 +0200 Subject: fix improperly spaced markdown blocks and typos (for formatting on website (#837) --- FeatureTest.md | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'FeatureTest.md') diff --git a/FeatureTest.md b/FeatureTest.md index fea9328..14e3bad 100644 --- a/FeatureTest.md +++ b/FeatureTest.md @@ -13,12 +13,14 @@ like. Since some WebAssembly features add operators and all WebAssembly code in a module is validated ahead-of-time, the usual JavaScript feature detection pattern: + ``` if (foo) foo(); else alternativeToFoo(); ``` + won't work in WebAssembly (if `foo` isn't supported, `foo()` will fail to validate). @@ -68,6 +70,7 @@ that one function was an optimized, but feature-dependent, version of another function (similar to the [`ifunc` attribute](https://gcc.gnu.org/onlinedocs/gcc-4.7.2/gcc/Function-Attributes.html#index-g_t_0040code_007bifunc_007d-attribute-2529), but without the callback): + ``` #include void foo(...) { @@ -85,6 +88,7 @@ void foo_f64x2(...) __attribute__((optimizes("foo","f64x2"))) { ... foo(...); // calls either foo or foo_f64x2 ``` + In this example, the toolchain could emit both `foo` and `foo_f64x2` as function definitions in the "specific layer" binary format. The load-time polyfill would then replace `foo` with `foo_f64x2` if -- cgit v1.2.3