diff --git a/compiler/codegen.js b/compiler/codegen.js index 3f105307..945e75b3 100644 --- a/compiler/codegen.js +++ b/compiler/codegen.js @@ -13,7 +13,6 @@ import { TYPES, TYPE_FLAGS, TYPE_NAMES } from './types.js'; import semantic, { knownValue, unknownValue } from './semantic.js'; import parse from './parse.js'; import temporalPolyfillSource from './temporal.js'; -import { log } from './log.js'; import './prefs.js'; // jsval constants @@ -4456,8 +4455,6 @@ const objectHack = node => { const name = '__' + objectName + '_' + node.property.name; if ((!hasFuncWithName(name) && !(name in builtinVars) && !hasFuncWithName(name + '$get')) && (hasFuncWithName(objectName) || objectName in builtinVars || hasFuncWithName('__' + objectName) || ('__' + objectName) in builtinVars)) return; - if (Prefs.codeLog) log('codegen', `object hack! ${node.object.name}.${node.property.name} -> ${name}`); - return { type: 'Identifier', name, diff --git a/compiler/index.js b/compiler/index.js index 5576bdf0..a826ec13 100644 --- a/compiler/index.js +++ b/compiler/index.js @@ -88,7 +88,7 @@ export default (code, module = Prefs.module, run = false) => { if (logProgress) progressDone('generated IR', t1); - if (Prefs.funcs || Prefs.optFuncs || Prefs.f) logFuncs(cg.funcs, cg.globals); + if (Prefs.f) logFuncs(cg.funcs, cg.globals); if (globalThis.precompile) return cg; if (logProgress) progressStart('rendering C...'); diff --git a/compiler/types.js b/compiler/types.js index b7592e66..7359a9d6 100644 --- a/compiler/types.js +++ b/compiler/types.js @@ -1,5 +1,3 @@ -import './prefs.js'; - export const TYPE_FLAGS = { parity: 0b10000000, length: 0b01000000, @@ -70,22 +68,3 @@ registerInternalType('__Porffor_AsyncGenerator'); for (const x of [ '', 'Aggregate', 'Type', 'Reference', 'Syntax', 'Range', 'Eval', 'URI' ]) registerInternalType(`${x}Error`); - -if (Prefs.largestTypes) { - const typeKeys = Object.keys(TYPES); - const typeVals = Object.values(TYPES); - - const largestType = (vals, keys) => { - const val = Math.max(...vals); - const key = keys[vals.indexOf(val)]; - return [ val, key ]; - }; - - const logType = (label, val, key) => console.log(`${label} ${key} - ${val} (0x${val.toString(16)}, 0b${val.toString(2).padStart(8, '0')})`); - - const largestUnflagged = largestType(typeVals.map(x => x & 0b00111111), typeKeys); - logType(`largest type: `, ...largestUnflagged); - logType(`largest type w/ flags:`, ...largestType(typeVals, typeKeys)); - console.log('types left:', 0b00111111 - largestUnflagged[0]); - console.log(); -}