diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/intertyper.js | 4 | ||||
-rw-r--r-- | src/jsifier.js | 4 | ||||
-rw-r--r-- | src/library.js | 10 | ||||
-rw-r--r-- | src/parseTools.js | 6 | ||||
-rw-r--r-- | src/runtime.js | 4 | ||||
-rw-r--r-- | src/settings.js | 4 |
6 files changed, 16 insertions, 16 deletions
diff --git a/src/intertyper.js b/src/intertyper.js index 4e91261e..7743ce62 100644 --- a/src/intertyper.js +++ b/src/intertyper.js @@ -348,7 +348,7 @@ function intertyper(lines, sidePass, baseLineNums) { if (token1Text == 'triple') { var triple = item.tokens[3].text; triple = triple.substr(1, triple.length-2); - var expected = TARGET_LE32 ? 'le32-unknown-nacl' : 'i386-pc-linux-gnu'; + var expected = TARGET_ASMJS_UNKNOWN_EMSCRIPTEN ? 'asmjs-unknown-emscripten' : 'i386-pc-linux-gnu'; if (triple !== expected) { warn('using an unexpected LLVM triple: ' + [triple, ' !== ', expected] + ' (are you using emcc for everything and not clang?)'); } @@ -688,7 +688,7 @@ function intertyper(lines, sidePass, baseLineNums) { Types.hasInlineJS = true; warnOnce('inline JavaScript using asm() will cause the code to no longer fall in the asm.js subset of JavaScript, which can reduce performance - consider using emscripten_run_script'); } - assert(TARGET_LE32, 'inline js is only supported in le32'); + assert(TARGET_ASMJS_UNKNOWN_EMSCRIPTEN, 'inline js is only supported in asmjs-unknown-emscripten'); // Inline assembly is just JavaScript that we paste into the code item.intertype = 'value'; if (tokensLeft[0].text == 'sideeffect') tokensLeft.splice(0, 1); diff --git a/src/jsifier.js b/src/jsifier.js index c1ca893b..56dc9d26 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -1413,7 +1413,7 @@ function JSify(data, functionsOnly) { } } function va_argHandler(item) { - assert(TARGET_LE32); + assert(TARGET_ASMJS_UNKNOWN_EMSCRIPTEN); var ident = item.value.ident; var move = Runtime.STACK_ALIGN; @@ -1710,7 +1710,7 @@ function JSify(data, functionsOnly) { if ((phase == 'pre' || phase == 'glue') && !Variables.generatedGlobalBase && !BUILD_AS_SHARED_LIB) { Variables.generatedGlobalBase = true; // Globals are done, here is the rest of static memory - assert((TARGET_LE32 && Runtime.GLOBAL_BASE == 8) || (TARGET_X86 && Runtime.GLOBAL_BASE == 4)); // this is assumed in e.g. relocations for linkable modules + assert((TARGET_ASMJS_UNKNOWN_EMSCRIPTEN && Runtime.GLOBAL_BASE == 8) || (TARGET_X86 && Runtime.GLOBAL_BASE == 4)); // this is assumed in e.g. relocations for linkable modules if (!SIDE_MODULE) { print('STATIC_BASE = ' + Runtime.GLOBAL_BASE + ';\n'); print('STATICTOP = STATIC_BASE + ' + Runtime.alignMemory(Variables.nextIndexedOffset) + ';\n'); diff --git a/src/library.js b/src/library.js index 5df5ff20..18a794fd 100644 --- a/src/library.js +++ b/src/library.js @@ -1861,14 +1861,14 @@ LibraryManager.library = { // int x = 4; printf("%c\n", (char)x); var ret; if (type === 'double') { -#if TARGET_LE32 == 2 +#if TARGET_ASMJS_UNKNOWN_EMSCRIPTEN == 2 ret = {{{ makeGetValue('varargs', 'argIndex', 'double', undefined, undefined, true, 4) }}}; #else ret = {{{ makeGetValue('varargs', 'argIndex', 'double', undefined, undefined, true) }}}; #endif #if USE_TYPED_ARRAYS == 2 } else if (type == 'i64') { -#if TARGET_LE32 == 1 +#if TARGET_ASMJS_UNKNOWN_EMSCRIPTEN == 1 ret = [{{{ makeGetValue('varargs', 'argIndex', 'i32', undefined, undefined, true) }}}, {{{ makeGetValue('varargs', 'argIndex+8', 'i32', undefined, undefined, true) }}}]; argIndex += {{{ STACK_ALIGN }}}; // each 32-bit chunk is in a 64-bit block @@ -1885,7 +1885,7 @@ LibraryManager.library = { type = 'i32'; // varargs are always i32, i64, or double ret = {{{ makeGetValue('varargs', 'argIndex', 'i32', undefined, undefined, true) }}}; } -#if TARGET_LE32 == 2 +#if TARGET_ASMJS_UNKNOWN_EMSCRIPTEN == 2 argIndex += Runtime.getNativeFieldSize(type); #else argIndex += Math.max(Runtime.getNativeFieldSize(type), Runtime.getAlignSize(type, null, true)); @@ -2859,7 +2859,7 @@ LibraryManager.library = { vsscanf: 'sscanf', #endif -#if TARGET_LE32 +#if TARGET_ASMJS_UNKNOWN_EMSCRIPTEN // convert va_arg into varargs vfprintf__deps: ['fprintf'], vfprintf: function(s, f, va_arg) { @@ -4178,7 +4178,7 @@ LibraryManager.library = { #if TARGET_X86 return makeSetValue(ptr, 0, 'varrp', 'void*'); #endif -#if TARGET_LE32 +#if TARGET_ASMJS_UNKNOWN_EMSCRIPTEN // 2-word structure: struct { void* start; void* currentOffset; } return makeSetValue(ptr, 0, 'varrp', 'void*') + ';' + makeSetValue(ptr, Runtime.QUANTUM_SIZE, 0, 'void*'); #endif diff --git a/src/parseTools.js b/src/parseTools.js index fe56580e..4fb76196 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -1161,7 +1161,7 @@ function getHeapOffset(offset, type, forceAsm) { if (Runtime.getNativeFieldSize(type) > 4) { if (type == 'i64' || TARGET_X86) { - type = 'i32'; // XXX we emulate 64-bit values as 32 in x86, and also in le32 but only i64, not double + type = 'i32'; // XXX we emulate 64-bit values as 32 in x86, and also in asmjs-unknown-emscripten but only i64, not double } } @@ -1287,7 +1287,7 @@ function makeGetValue(ptr, pos, type, noNeedFirst, unsigned, ignore, align, noSa return '{ ' + ret.join(', ') + ' }'; } - // In double mode 1, in x86 we always assume unaligned because we can't trust that; otherwise in le32 + // In double mode 1, in x86 we always assume unaligned because we can't trust that; otherwise in asmjs-unknown-emscripten // we need this code path if we are not fully aligned. if (DOUBLE_MODE == 1 && USE_TYPED_ARRAYS == 2 && type == 'double' && (TARGET_X86 || align < 8)) { return '(' + makeSetTempDouble(0, 'i32', makeGetValue(ptr, pos, 'i32', noNeedFirst, unsigned, ignore, align, noSafe)) + ',' + @@ -1826,7 +1826,7 @@ function makeGetSlabs(ptr, type, allowMultiple, unsigned) { case '<4 x i32>': case 'i32': case 'i64': return [unsigned ? 'HEAPU32' : 'HEAP32']; break; case 'double': { - if (TARGET_LE32) return ['HEAPF64']; // in le32, we do have the ability to assume 64-bit alignment + if (TARGET_ASMJS_UNKNOWN_EMSCRIPTEN) return ['HEAPF64']; // in asmjs-unknown-emscripten, we do have the ability to assume 64-bit alignment // otherwise, fall through to float } case '<4 x float>': diff --git a/src/runtime.js b/src/runtime.js index fecd3b68..97de7473 100644 --- a/src/runtime.js +++ b/src/runtime.js @@ -185,10 +185,10 @@ var Runtime = { // type can be a native type or a struct (or null, for structs we only look at size here) getAlignSize: function(type, size, vararg) { // we align i64s and doubles on 64-bit boundaries, unlike x86 -#if TARGET_LE32 == 1 +#if TARGET_ASMJS_UNKNOWN_EMSCRIPTEN == 1 if (vararg) return 8; #endif -#if TARGET_LE32 +#if TARGET_ASMJS_UNKNOWN_EMSCRIPTEN if (!vararg && (type == 'i64' || type == 'double')) return 8; if (!type) return Math.min(size, 8); // align structures internally to 64 bits #endif diff --git a/src/settings.js b/src/settings.js index 1c6b998e..7f9fbabf 100644 --- a/src/settings.js +++ b/src/settings.js @@ -23,8 +23,8 @@ var QUANTUM_SIZE = 4; // This is the size of an individual field in a structure. // Changing this from the default of 4 is deprecated. var TARGET_X86 = 0; // For i386-pc-linux-gnu -var TARGET_LE32 = 1; // For le32-unknown-nacl. 1 is normal, 2 is for the fastcomp llvm - // backend using pnacl abi simplification +var TARGET_ASMJS_UNKNOWN_EMSCRIPTEN = 1; // For asmjs-unknown-emscripten. 1 is normal, 2 is for the fastcomp llvm + // backend using emscripten-customized abi simplification var CORRECT_SIGNS = 1; // Whether we make sure to convert unsigned values to signed values. // Decreases performance with additional runtime checks. Might not be |