From ad9585b34605f8113e0858e24ef7a91b1d380217 Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Sat, 18 Jul 2015 14:21:09 -0700 Subject: [PATCH] Speed up uncompiled code by "IFDEF'ing" disabled code, rare asserts, etc. --- Gruntfile.js | 4 +- blog/2015/07/17/README.md | 2 +- .../compaq/deskpro386/vga/4096kb/machine.xml | 2 +- docs/pcjs/demos/components.xsl | 2 +- docs/pcjs/demos/pc-dbg.js | 368 ++++++++--------- docs/pcjs/demos/pc.js | 370 +++++++++--------- modules/pcjs/lib/chipset.js | 8 +- modules/pcjs/lib/defines.js | 2 +- modules/pcjs/lib/memory.js | 45 +-- modules/pcjs/lib/x86cpu.js | 27 +- modules/pcjs/lib/x86func.js | 5 +- versions/pcjs/1.18.4/pc-dbg.js | 368 ++++++++--------- versions/pcjs/1.18.4/pc.js | 370 +++++++++--------- 13 files changed, 796 insertions(+), 777 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index f94c028bf..1696549e5 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -171,7 +171,7 @@ module.exports = function(grunt) { banner: '"use strict";\n\n', process: function(src, filepath) { return "// " + filepath + "\n\n" + - src.replace(/(^|\n)[ \t]*(['"])use strict\2;?\s*/g, '$1').replace(/[ \t]*if\s*\(typeof\s+(module|APP_PCJS)\s*!==\s*(['"])undefined\2\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '').replace(/[ \t]*[A-Za-z_][A-Za-z0-9_\.]*\.assert\(.*\);[^\n]*(\n|$)/g, ''); + src.replace(/(^|\n)[ \t]*(['"])use strict\2;?\s*/g, '$1').replace(/[ \t]*if\s*\(typeof\s+(module|APP_PCJS)\s*!==\s*(['"])undefined\2\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '').replace(/[ \t]*[A-Za-z_][A-Za-z0-9_\.]*\.assert\([^\n]*\);[^\n]*/g, ''); } } }, @@ -182,7 +182,7 @@ module.exports = function(grunt) { banner: '"use strict";\n\n', process: function(src, filepath) { return "// " + filepath + "\n\n" + - src.replace(/(^|\n)[ \t]*(['"])use strict\2;?\s*/g, '$1').replace(/[ \t]*if\s*\(typeof\s+(module|APP_PCJS)\s*!==\s*(['"])undefined\2\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '').replace(/[ \t]*[A-Za-z_][A-Za-z0-9_\.]*\.assert\(.*\);[^\n]*(\n|$)/g, ''); + src.replace(/(^|\n)[ \t]*(['"])use strict\2;?\s*/g, '$1').replace(/[ \t]*if\s*\(typeof\s+(module|APP_PCJS)\s*!==\s*(['"])undefined\2\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '').replace(/[ \t]*[A-Za-z_][A-Za-z0-9_\.]*\.assert\([^\n]*\);[^\n]*/g, ''); } } } diff --git a/blog/2015/07/17/README.md b/blog/2015/07/17/README.md index e47ab779f..4b355d5fa 100644 --- a/blog/2015/07/17/README.md +++ b/blog/2015/07/17/README.md @@ -79,7 +79,7 @@ NOTE: This is a pre-release version of Windows 95, as I don't currently have the To be continued.... -[Embedded DeskPro 386](/devices/pc/machine/compaq/deskpro386/vga/4096kb/machine.xml "PCjs:deskpro386-vga-4096k:::debugger") +[Embedded DeskPro 386](/devices/pc/machine/compaq/deskpro386/vga/4096kb/machine.xml "PCjs:deskpro386-vga-4096k::uncompiled:debugger") *[@jeffpar](http://twitter.com/jeffpar)* *July 17, 2015* diff --git a/devices/pc/machine/compaq/deskpro386/vga/4096kb/machine.xml b/devices/pc/machine/compaq/deskpro386/vga/4096kb/machine.xml index 2adf56561..b4895bf1d 100644 --- a/devices/pc/machine/compaq/deskpro386/vga/4096kb/machine.xml +++ b/devices/pc/machine/compaq/deskpro386/vga/4096kb/machine.xml @@ -10,7 +10,7 @@