diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-02-08 12:07:17 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-02-08 12:07:17 -0800 |
commit | ef59283debcb71ddadf5d9e9c2444d463f165557 (patch) | |
tree | 4d45bcf00b6a0620e3c3aa77adb03eff54dd4bd9 /src/runtime.js | |
parent | cd7d64a1945a7309804008feead7ebe4acb5a722 (diff) |
refactor legalizer code, and handle stores of <32 bits but not i8 or i16, properly
Diffstat (limited to 'src/runtime.js')
-rw-r--r-- | src/runtime.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/runtime.js b/src/runtime.js index 190260e6..b5663045 100644 --- a/src/runtime.js +++ b/src/runtime.js @@ -185,8 +185,14 @@ var Runtime = { "%float": 4, "%double": 8 }['%'+type]; // add '%' since float and double confuse Closure compiler as keys, and also spidermonkey as a compiler will remove 's from '_i8' etc - if (!size && type[type.length-1] == '*') { - size = Runtime.QUANTUM_SIZE; // A pointer + if (!size) { + if (type[type.length-1] == '*') { + size = Runtime.QUANTUM_SIZE; // A pointer + } else if (type[0] == 'i') { + var bits = parseInt(type.substr(1)); + assert(bits % 8 == 0); + size = bits/8; + } } return size; }, |