diff options
author | Dan Gohman <sunfish@google.com> | 2013-10-02 16:11:34 -0700 |
---|---|---|
committer | Dan Gohman <sunfish@google.com> | 2013-10-02 16:11:34 -0700 |
commit | 4b8ff3fb5dcbc1ef61b17f1d7a7ca4bdb3f0b811 (patch) | |
tree | 2b4b27227fb69f4fe66ff3b198664d37a4cab12f /src/preamble.js | |
parent | 4f6975f249d2f8eaabe66dd8bee5146cd9d74d28 (diff) |
Optimize alignment rounding.
Replace x>>2<<2 and x>>3<<3 with x&-4 and x&-8, respectively, since
an and is cheaper than two shifts.
Diffstat (limited to 'src/preamble.js')
-rw-r--r-- | src/preamble.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/preamble.js b/src/preamble.js index 183fd0c8..75519094 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -644,7 +644,7 @@ Module['stringToUTF32'] = stringToUTF32; var PAGE_SIZE = 4096; function alignMemoryPage(x) { - return ((x+4095)>>12)<<12; + return (x+4095)&-4096; } var HEAP; |