aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-10-30 16:39:44 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-10-30 17:38:43 -0700
commit233f79bafda245925bd39b82e45b1dfa5a75a73f (patch)
tree1ab7b9fca85de7acceeeed4243f4655764177b67
parent5252554297cc5fca5cc96d1d2e71da00412a0e18 (diff)
optimize isIllegalType
-rw-r--r--src/parseTools.js18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/parseTools.js b/src/parseTools.js
index 16f4058c..314c5ffb 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -215,8 +215,22 @@ function isIdenticallyImplemented(type1, type2) {
}
function isIllegalType(type) {
- var bits = getBits(type);
- return bits > 0 && (bits >= 64 || !isPowerOfTwo(bits));
+ switch (type) {
+ case 'i1':
+ case 'i8':
+ case 'i16':
+ case 'i32':
+ case 'float':
+ case 'double':
+ case 'rawJS':
+ case '<2 x float>':
+ case '<4 x float>':
+ case '<2 x i32>':
+ case '<4 x i32>':
+ case 'void': return false;
+ }
+ if (!type || type[type.length-1] === '*') return false;
+ return true;
}
function isVoidType(type) {