aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-10-16 18:47:01 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-10-16 18:47:01 -0700
commitf14734515b78b581f540ebca50e3f200a6a72ebe (patch)
treefc6e0edc85f156d868ae12973478f2598cd0a348 /src
parent128137d92d7144607a56c736514c148ca4ce7029 (diff)
simplify bss handling
Diffstat (limited to 'src')
-rw-r--r--src/jsifier.js12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index e84de3ee..7901a5e3 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -272,20 +272,14 @@ function JSify(data, functionsOnly, givenFunctions) {
}
if (isBSS(item)) {
- var length = calcAllocatedSize(item.type);
- length = Runtime.alignMemory(length);
-
// If using indexed globals, go ahead and early out (no need to explicitly
// initialize).
- if (!NAMED_GLOBALS) {
- return;
- }
+ if (!NAMED_GLOBALS) return;
+
// If using named globals, we can at least shorten the call to allocate by
// passing an integer representing the size of memory to alloc instead of
// an array of 0s of size length.
- else {
- constant = length;
- }
+ constant = Runtime.alignMemory(calcAllocatedSize(item.type));
} else {
if (item.external) {
if (Runtime.isNumberType(item.type) || isPointerType(item.type)) {