aboutsummaryrefslogtreecommitdiff
path: root/src/preamble.js
diff options
context:
space:
mode:
authorDan Gohman <sunfish@google.com>2013-10-02 16:11:34 -0700
committerDan Gohman <sunfish@google.com>2013-10-02 16:11:34 -0700
commit4b8ff3fb5dcbc1ef61b17f1d7a7ca4bdb3f0b811 (patch)
tree2b4b27227fb69f4fe66ff3b198664d37a4cab12f /src/preamble.js
parent4f6975f249d2f8eaabe66dd8bee5146cd9d74d28 (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.js2
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;