https://bugs.webkit.org/show_bug.cgi?id=172049
Rubber-stamped by Geoffrey Garen.
Added the current contents of browserbench.org.
* ARES-6/ARES-6.svg: Added.
* ARES-6/Air/README.md: Added.
* ARES-6/Air/airjs-tests.yaml: Added.
* ARES-6/Air/all.js: Added.
* ARES-6/Air/allocate_stack.js: Added.
* ARES-6/Air/arg.js: Added.
* ARES-6/Air/basic_block.js: Added.
* ARES-6/Air/benchmark.js: Added.
* ARES-6/Air/code.js: Added.
* ARES-6/Air/custom.js: Added.
* ARES-6/Air/frequented_block.js: Added.
* ARES-6/Air/insertion_set.js: Added.
* ARES-6/Air/inst.js: Added.
* ARES-6/Air/liveness.js: Added.
* ARES-6/Air/make_dist.sh: Added.
* ARES-6/Air/opcode.js: Added.
* ARES-6/Air/payload-airjs-ACLj8C.js: Added.
* ARES-6/Air/payload-gbemu-executeIteration.js: Added.
* ARES-6/Air/payload-imaging-gaussian-blur-gaussianBlur.js: Added.
* ARES-6/Air/payload-typescript-scanIdentifier.js: Added.
* ARES-6/Air/reg.js: Added.
* ARES-6/Air/stack_slot.js: Added.
* ARES-6/Air/stress-test.js: Added.
* ARES-6/Air/strip-hash.rb: Added.
* ARES-6/Air/symbols.js: Added.
* ARES-6/Air/test.html: Added.
* ARES-6/Air/test.js: Added.
* ARES-6/Air/tmp.js: Added.
* ARES-6/Air/tmp_base.js: Added.
* ARES-6/Air/util.js: Added.
* ARES-6/Babylon/AUTHORS: Added.
* ARES-6/Babylon/air-blob.js: Added.
* ARES-6/Babylon/babylon-blob.js: Added.
* ARES-6/Babylon/basic-blob.js: Added.
* ARES-6/Babylon/benchmark.js: Added.
* ARES-6/Babylon/index.js: Added.
* ARES-6/Babylon/inspector-blob.js: Added.
* ARES-6/Basic/ast.js: Added.
* ARES-6/Basic/basic-tests.yaml: Added.
* ARES-6/Basic/basic.js: Added.
* ARES-6/Basic/benchmark.js: Added.
* ARES-6/Basic/caseless_map.js: Added.
* ARES-6/Basic/lexer.js: Added.
* ARES-6/Basic/number.js: Added.
* ARES-6/Basic/parser.js: Added.
* ARES-6/Basic/random.js: Added.
* ARES-6/Basic/state.js: Added.
* ARES-6/Basic/stress-test.js: Added.
* ARES-6/Basic/test.html: Added.
* ARES-6/Basic/test.js: Added.
* ARES-6/Basic/util.js: Added.
* ARES-6/about.html: Added.
* ARES-6/air_benchmark.js: Added.
* ARES-6/babylon_benchmark.js: Added.
* ARES-6/basic_benchmark.js: Added.
* ARES-6/cli.js: Added.
* ARES-6/driver.js: Added.
* ARES-6/glue.js: Added.
* ARES-6/index.html: Added.
* ARES-6/ml/benchmark.js: Added.
* ARES-6/ml/index.js: Added.
* ARES-6/ml_benchmark.js: Added.
* ARES-6/results.js: Added.
* ARES-6/stats.js: Added.
* ARES-6/styles.css: Added.
* ARES-6/swoop.svg: Added.
* JetStream/CDjsSetup.js: Added.
* JetStream/JetStream-Logo.png: Added.
* JetStream/JetStream-Logo@2x.png: Added.
* JetStream/JetStream.css: Added.
* JetStream/JetStreamDriver.js: Added.
* JetStream/LLVM-test-suite-LICENSE.txt: Added.
* JetStream/Octane/base.js: Added.
* JetStream/Octane/code-load.js: Added.
* JetStream/Octane2/base.js: Added.
* JetStream/Octane2/box2d.js: Added.
* JetStream/Octane2/code-load.js: Added.
* JetStream/Octane2/crypto.js: Added.
* JetStream/Octane2/deltablue.js: Added.
* JetStream/Octane2/earley-boyer.js: Added.
* JetStream/Octane2/gbemu-part1.js: Added.
* JetStream/Octane2/gbemu-part2.js: Added.
* JetStream/Octane2/mandreel.js: Added.
* JetStream/Octane2/navier-stokes.js: Added.
* JetStream/Octane2/pdfjs.js: Added.
* JetStream/Octane2/raytrace.js: Added.
* JetStream/Octane2/regexp.js: Added.
* JetStream/Octane2/richards.js: Added.
* JetStream/Octane2/run.js: Added.
* JetStream/Octane2/splay.js: Added.
* JetStream/Octane2/typescript-compiler.js: Added.
* JetStream/Octane2/typescript-input.js: Added.
* JetStream/Octane2/typescript.js: Added.
* JetStream/Octane2/zlib-data.js: Added.
* JetStream/Octane2/zlib.js: Added.
* JetStream/Octane2Setup.js: Added.
* JetStream/OctaneSetup.js: Added.
* JetStream/Reference.js: Added.
* JetStream/SimplePayload.js: Added.
* JetStream/SimpleSetup.js: Added.
* JetStream/SunSpiderPayload.js: Added.
* JetStream/SunSpiderSetup.js: Added.
* JetStream/Swoosh.png: Added.
* JetStream/Swoosh@2x.png: Added.
* JetStream/TestingSetup.js: Added.
* JetStream/cdjs/benchmark.js: Added.
* JetStream/cdjs/call_sign.js: Added.
* JetStream/cdjs/collision.js: Added.
* JetStream/cdjs/collision_detector.js: Added.
* JetStream/cdjs/constants.js: Added.
* JetStream/cdjs/motion.js: Added.
* JetStream/cdjs/red_black_tree.js: Added.
* JetStream/cdjs/reduce_collision_set.js: Added.
* JetStream/cdjs/simulator.js: Added.
* JetStream/cdjs/util.js: Added.
* JetStream/cdjs/vector_2d.js: Added.
* JetStream/cdjs/vector_3d.js: Added.
* JetStream/in-depth.html: Added.
* JetStream/index.html: Added.
* JetStream/simple/bigfib.cpp: Added.
* JetStream/simple/bigfib.cpp.js: Added.
* JetStream/simple/container.cpp: Added.
* JetStream/simple/container.cpp.js: Added.
* JetStream/simple/dry.c: Added.
* JetStream/simple/dry.c.js: Added.
* JetStream/simple/float-mm.c: Added.
* JetStream/simple/float-mm.c.js: Added.
* JetStream/simple/gcc-loops.cpp: Added.
* JetStream/simple/gcc-loops.cpp.js: Added.
* JetStream/simple/hash-map.js: Added.
* JetStream/simple/n-body.c: Added.
* JetStream/simple/n-body.c.js: Added.
* JetStream/simple/quicksort.c: Added.
* JetStream/simple/quicksort.c.js: Added.
* JetStream/simple/towers.c: Added.
* JetStream/simple/towers.c.js: Added.
* JetStream/sources/3d-cube.js: Added.
* JetStream/sources/3d-raytrace.js: Added.
* JetStream/sources/base64.js: Added.
* JetStream/sources/bigfib.cpp: Added.
* JetStream/sources/bigfib.cpp.js: Added.
* JetStream/sources/box2d.js: Added.
* JetStream/sources/cdjs-benchmark.js: Added.
* JetStream/sources/cdjs-call_sign.js: Added.
* JetStream/sources/cdjs-collision.js: Added.
* JetStream/sources/cdjs-collision_detector.js: Added.
* JetStream/sources/cdjs-constants.js: Added.
* JetStream/sources/cdjs-motion.js: Added.
* JetStream/sources/cdjs-red_black_tree.js: Added.
* JetStream/sources/cdjs-reduce_collision_set.js: Added.
* JetStream/sources/cdjs-simulator.js: Added.
* JetStream/sources/cdjs-util.js: Added.
* JetStream/sources/cdjs-vector_2d.js: Added.
* JetStream/sources/cdjs-vector_3d.js: Added.
* JetStream/sources/code-first-load-code-load.js: Added.
* JetStream/sources/code-multi-load-code-load.js: Added.
* JetStream/sources/container.cpp: Added.
* JetStream/sources/container.cpp.js: Added.
* JetStream/sources/crypto-aes.js: Added.
* JetStream/sources/crypto-md5.js: Added.
* JetStream/sources/crypto-sha1.js: Added.
* JetStream/sources/crypto.js: Added.
* JetStream/sources/date-format-tofte.js: Added.
* JetStream/sources/date-format-xparb.js: Added.
* JetStream/sources/deltablue.js: Added.
* JetStream/sources/dry.c: Added.
* JetStream/sources/dry.c.js: Added.
* JetStream/sources/earley-boyer.js: Added.
* JetStream/sources/float-mm.c: Added.
* JetStream/sources/float-mm.c.js: Added.
* JetStream/sources/gbemu-part1.js: Added.
* JetStream/sources/gbemu-part2.js: Added.
* JetStream/sources/gcc-loops.cpp: Added.
* JetStream/sources/gcc-loops.cpp.js: Added.
* JetStream/sources/hash-map.js: Added.
* JetStream/sources/mandreel.js: Added.
* JetStream/sources/n-body.c: Added.
* JetStream/sources/n-body.c.js: Added.
* JetStream/sources/n-body.js: Added.
* JetStream/sources/navier-stokes.js: Added.
* JetStream/sources/pdfjs.js: Added.
* JetStream/sources/quicksort.c: Added.
* JetStream/sources/quicksort.c.js: Added.
* JetStream/sources/raytrace.js: Added.
* JetStream/sources/regex-dna.js: Added.
* JetStream/sources/regexp.js: Added.
* JetStream/sources/richards.js: Added.
* JetStream/sources/splay.js: Added.
* JetStream/sources/tagcloud.js: Added.
* JetStream/sources/towers.c: Added.
* JetStream/sources/towers.c.js: Added.
* JetStream/sources/typescript-compiler.js: Added.
* JetStream/sources/typescript-input.js: Added.
* JetStream/sources/typescript.js: Added.
* JetStream/sources/zlib-data.js: Added.
* JetStream/sources/zlib.js: Added.
* JetStream/sunspider/3d-cube.js: Added.
* JetStream/sunspider/3d-raytrace.js: Added.
* JetStream/sunspider/base64.js: Added.
* JetStream/sunspider/crypto-aes.js: Added.
* JetStream/sunspider/crypto-md5.js: Added.
* JetStream/sunspider/crypto-sha1.js: Added.
* JetStream/sunspider/date-format-tofte.js: Added.
* JetStream/sunspider/date-format-xparb.js: Added.
* JetStream/sunspider/n-body.js: Added.
* JetStream/sunspider/regex-dna.js: Added.
* JetStream/sunspider/tagcloud.js: Added.
* MotionMark/about.html: Added.
* MotionMark/developer.html: Added.
* MotionMark/index.html: Added.
* MotionMark/resources/debug-runner/animometer.css: Added.
* MotionMark/resources/debug-runner/animometer.js: Added.
* MotionMark/resources/debug-runner/d3.min.js: Added.
* MotionMark/resources/debug-runner/graph.js: Added.
* MotionMark/resources/debug-runner/tests.js: Added.
* MotionMark/resources/extensions.js: Added.
* MotionMark/resources/runner/animometer.css: Added.
* MotionMark/resources/runner/animometer.js: Added.
* MotionMark/resources/runner/benchmark-runner.js: Added.
* MotionMark/resources/runner/crystal.svg: Added.
* MotionMark/resources/runner/lines.svg: Added.
* MotionMark/resources/runner/logo.svg: Added.
* MotionMark/resources/runner/tests.js: Added.
* MotionMark/resources/statistics.js: Added.
* MotionMark/resources/strings.js: Added.
* MotionMark/tests/3d/resources/webgl.js: Added.
* MotionMark/tests/3d/webgl.html: Added.
* MotionMark/tests/bouncing-particles/bouncing-canvas-images.html: Added.
* MotionMark/tests/bouncing-particles/bouncing-canvas-shapes.html: Added.
* MotionMark/tests/bouncing-particles/bouncing-css-images.html: Added.
* MotionMark/tests/bouncing-particles/bouncing-css-shapes.html: Added.
* MotionMark/tests/bouncing-particles/bouncing-svg-images.html: Added.
* MotionMark/tests/bouncing-particles/bouncing-svg-shapes.html: Added.
* MotionMark/tests/bouncing-particles/bouncing-tagged-images.html: Added.
* MotionMark/tests/bouncing-particles/resources/bouncing-canvas-images.js: Added.
* MotionMark/tests/bouncing-particles/resources/bouncing-canvas-particles.js: Added.
* MotionMark/tests/bouncing-particles/resources/bouncing-canvas-shapes.js: Added.
* MotionMark/tests/bouncing-particles/resources/bouncing-css-images.js: Added.
* MotionMark/tests/bouncing-particles/resources/bouncing-css-shapes.js: Added.
* MotionMark/tests/bouncing-particles/resources/bouncing-particles.js: Added.
* MotionMark/tests/bouncing-particles/resources/bouncing-svg-images.js: Added.
* MotionMark/tests/bouncing-particles/resources/bouncing-svg-particles.js: Added.
* MotionMark/tests/bouncing-particles/resources/bouncing-svg-shapes.js: Added.
* MotionMark/tests/bouncing-particles/resources/bouncing-tagged-images.js: Added.
* MotionMark/tests/bouncing-particles/resources/image1.jpg: Added.
* MotionMark/tests/bouncing-particles/resources/image2.jpg: Added.
* MotionMark/tests/bouncing-particles/resources/image3.jpg: Added.
* MotionMark/tests/bouncing-particles/resources/image4.jpg: Added.
* MotionMark/tests/bouncing-particles/resources/image5.jpg: Added.
* MotionMark/tests/dom/compositing-transforms.html: Added.
* MotionMark/tests/dom/focus.html: Added.
* MotionMark/tests/dom/leaves.html: Added.
* MotionMark/tests/dom/particles.html: Added.
* MotionMark/tests/dom/resources/compositing-transforms.js: Added.
* MotionMark/tests/dom/resources/dom-particles.js: Added.
* MotionMark/tests/dom/resources/focus.js: Added.
* MotionMark/tests/dom/resources/leaves.js: Added.
* MotionMark/tests/master/canvas-stage.html: Added.
* MotionMark/tests/master/focus.html: Added.
* MotionMark/tests/master/image-data.html: Added.
* MotionMark/tests/master/leaves.html: Added.
* MotionMark/tests/master/multiply.html: Added.
* MotionMark/tests/master/resources/canvas-stage.js: Added.
* MotionMark/tests/master/resources/canvas-tests.js: Added.
* MotionMark/tests/master/resources/compass.svg: Added.
* MotionMark/tests/master/resources/compass100.png: Added.
* MotionMark/tests/master/resources/console.svg: Added.
* MotionMark/tests/master/resources/console100.png: Added.
* MotionMark/tests/master/resources/contribute.svg: Added.
* MotionMark/tests/master/resources/contribute100.png: Added.
* MotionMark/tests/master/resources/debugger.svg: Added.
* MotionMark/tests/master/resources/debugger100.png: Added.
* MotionMark/tests/master/resources/focus.js: Added.
* MotionMark/tests/master/resources/image-data.js: Added.
* MotionMark/tests/master/resources/inspector.svg: Added.
* MotionMark/tests/master/resources/inspector100.png: Added.
* MotionMark/tests/master/resources/layout.svg: Added.
* MotionMark/tests/master/resources/layout100.png: Added.
* MotionMark/tests/master/resources/leaves.js: Added.
* MotionMark/tests/master/resources/multiply.js: Added.
* MotionMark/tests/master/resources/particles.js: Added.
* MotionMark/tests/master/resources/performance.svg: Added.
* MotionMark/tests/master/resources/performance100.png: Added.
* MotionMark/tests/master/resources/script.svg: Added.
* MotionMark/tests/master/resources/script100.png: Added.
* MotionMark/tests/master/resources/shortcuts.svg: Added.
* MotionMark/tests/master/resources/shortcuts100.png: Added.
* MotionMark/tests/master/resources/standards.svg: Added.
* MotionMark/tests/master/resources/standards100.png: Added.
* MotionMark/tests/master/resources/storage.svg: Added.
* MotionMark/tests/master/resources/storage100.png: Added.
* MotionMark/tests/master/resources/styles.svg: Added.
* MotionMark/tests/master/resources/styles100.png: Added.
* MotionMark/tests/master/resources/svg-particles.js: Added.
* MotionMark/tests/master/resources/text.js: Added.
* MotionMark/tests/master/resources/timeline.svg: Added.
* MotionMark/tests/master/resources/timeline100.png: Added.
* MotionMark/tests/master/svg-particles.html: Added.
* MotionMark/tests/master/text.html: Added.
* MotionMark/tests/resources/main.js: Added.
* MotionMark/tests/resources/math.js: Added.
* MotionMark/tests/resources/stage.css: Added.
* MotionMark/tests/resources/star.svg: Added.
* MotionMark/tests/resources/yin-yang.png: Added.
* MotionMark/tests/resources/yin-yang.svg: Added.
* MotionMark/tests/simple/resources/simple-canvas-paths.js: Added.
* MotionMark/tests/simple/resources/simple-canvas.js: Added.
* MotionMark/tests/simple/resources/tiled-canvas-image.js: Added.
* MotionMark/tests/simple/simple-canvas-paths.html: Added.
* MotionMark/tests/simple/tiled-canvas-image.html: Added.
* MotionMark/tests/template/resources/template-canvas.js: Added.
* MotionMark/tests/template/resources/template-css.js: Added.
* MotionMark/tests/template/resources/template-svg.js: Added.
* MotionMark/tests/template/template-canvas.html: Added.
* MotionMark/tests/template/template-css.html: Added.
* MotionMark/tests/template/template-svg.html: Added.
* MotionMark/version: Added.
* Speedometer/Full.html: Added.
* Speedometer/InteractiveRunner.html: Added.
* Speedometer/resources/benchmark-report.js: Added.
* Speedometer/resources/benchmark-runner.js: Added.
* Speedometer/resources/flightjs-example-app/LICENSE.md: Added.
* Speedometer/resources/flightjs-example-app/README.md: Added.
* Speedometer/resources/flightjs-example-app/app/boot/page.js: Added.
* Speedometer/resources/flightjs-example-app/app/component_data/compose_box.js: Added.
* Speedometer/resources/flightjs-example-app/app/component_data/mail_items.js: Added.
* Speedometer/resources/flightjs-example-app/app/component_data/move_to.js: Added.
* Speedometer/resources/flightjs-example-app/app/component_ui/compose_box.js: Added.
* Speedometer/resources/flightjs-example-app/app/component_ui/folders.js: Added.
* Speedometer/resources/flightjs-example-app/app/component_ui/mail_controls.js: Added.
* Speedometer/resources/flightjs-example-app/app/component_ui/mail_items.js: Added.
* Speedometer/resources/flightjs-example-app/app/component_ui/move_to_selector.js: Added.
* Speedometer/resources/flightjs-example-app/app/component_ui/with_select.js: Added.
* Speedometer/resources/flightjs-example-app/app/css/custom.css: Added.
* Speedometer/resources/flightjs-example-app/app/data.js: Added.
* Speedometer/resources/flightjs-example-app/app/templates.js: Added.
* Speedometer/resources/flightjs-example-app/components/bootstrap/css/bootstrap-responsive.css: Added.
* Speedometer/resources/flightjs-example-app/components/bootstrap/css/bootstrap-responsive.min.css: Added.
* Speedometer/resources/flightjs-example-app/components/bootstrap/css/bootstrap.css: Added.
* Speedometer/resources/flightjs-example-app/components/bootstrap/css/bootstrap.min.css: Added.
* Speedometer/resources/flightjs-example-app/components/bootstrap/img/glyphicons-halflings-white.png: Added.
* Speedometer/resources/flightjs-example-app/components/bootstrap/img/glyphicons-halflings.png: Added.
* Speedometer/resources/flightjs-example-app/components/bootstrap/js/bootstrap.js: Added.
* Speedometer/resources/flightjs-example-app/components/bootstrap/js/bootstrap.min.js: Added.
* Speedometer/resources/flightjs-example-app/components/es5-shim/.gitignore: Added.
* Speedometer/resources/flightjs-example-app/components/es5-shim/CHANGES: Added.
* Speedometer/resources/flightjs-example-app/components/es5-shim/CONTRIBUTORS.md: Added.
* Speedometer/resources/flightjs-example-app/components/es5-shim/LICENSE: Added.
* Speedometer/resources/flightjs-example-app/components/es5-shim/README.md: Added.
* Speedometer/resources/flightjs-example-app/components/es5-shim/component.json: Added.
* Speedometer/resources/flightjs-example-app/components/es5-shim/es5-sham.js: Added.
* Speedometer/resources/flightjs-example-app/components/es5-shim/es5-sham.min.js: Added.
* Speedometer/resources/flightjs-example-app/components/es5-shim/es5-shim.js: Added.
* Speedometer/resources/flightjs-example-app/components/es5-shim/es5-shim.min.js: Added.
* Speedometer/resources/flightjs-example-app/components/es5-shim/package.json: Added.
* Speedometer/resources/flightjs-example-app/components/es5-shim/tests/helpers/h-kill.js: Added.
* Speedometer/resources/flightjs-example-app/components/es5-shim/tests/helpers/h-matchers.js: Added.
* Speedometer/resources/flightjs-example-app/components/es5-shim/tests/helpers/h.js: Added.
* Speedometer/resources/flightjs-example-app/components/es5-shim/tests/index.html: Added.
* Speedometer/resources/flightjs-example-app/components/es5-shim/tests/lib/jasmine-html.js: Added.
* Speedometer/resources/flightjs-example-app/components/es5-shim/tests/lib/jasmine.css: Added.
* Speedometer/resources/flightjs-example-app/components/es5-shim/tests/lib/jasmine.js: Added.
* Speedometer/resources/flightjs-example-app/components/es5-shim/tests/lib/jasmine_favicon.png: Added.
* Speedometer/resources/flightjs-example-app/components/es5-shim/tests/lib/json2.js: Added.
* Speedometer/resources/flightjs-example-app/components/es5-shim/tests/spec/s-array.js: Added.
* Speedometer/resources/flightjs-example-app/components/es5-shim/tests/spec/s-date.js: Added.
* Speedometer/resources/flightjs-example-app/components/es5-shim/tests/spec/s-function.js: Added.
* Speedometer/resources/flightjs-example-app/components/es5-shim/tests/spec/s-object.js: Added.
* Speedometer/resources/flightjs-example-app/components/es5-shim/tests/spec/s-string.js: Added.
* Speedometer/resources/flightjs-example-app/components/flight/.travis.yml: Added.
* Speedometer/resources/flightjs-example-app/components/flight/lib/advice.js: Added.
* Speedometer/resources/flightjs-example-app/components/flight/lib/component.js: Added.
* Speedometer/resources/flightjs-example-app/components/flight/lib/compose.js: Added.
* Speedometer/resources/flightjs-example-app/components/flight/lib/index.js: Added.
* Speedometer/resources/flightjs-example-app/components/flight/lib/logger.js: Added.
* Speedometer/resources/flightjs-example-app/components/flight/lib/registry.js: Added.
* Speedometer/resources/flightjs-example-app/components/flight/lib/utils.js: Added.
* Speedometer/resources/flightjs-example-app/components/flight/tools/debug/debug.js: Added.
* Speedometer/resources/flightjs-example-app/components/jasmine-flight/LICENSE.md: Added.
* Speedometer/resources/flightjs-example-app/components/jasmine-flight/README.md: Added.
* Speedometer/resources/flightjs-example-app/components/jasmine-flight/bower.json: Added.
* Speedometer/resources/flightjs-example-app/components/jasmine-flight/lib/jasmine-flight.js: Added.
* Speedometer/resources/flightjs-example-app/components/jasmine-jquery/lib/jasmine-jquery.js: Added.
* Speedometer/resources/flightjs-example-app/components/jquery/component.json: Added.
* Speedometer/resources/flightjs-example-app/components/jquery/composer.json: Added.
* Speedometer/resources/flightjs-example-app/components/jquery/jquery.js: Added.
* Speedometer/resources/flightjs-example-app/components/jquery/jquery.min.js: Added.
* Speedometer/resources/flightjs-example-app/components/mustache/mustache.js: Added.
* Speedometer/resources/flightjs-example-app/components/requirejs/require.js: Added.
* Speedometer/resources/flightjs-example-app/index.html: Added.
* Speedometer/resources/flightjs-example-app/karma.conf.js: Added.
* Speedometer/resources/flightjs-example-app/package.json: Added.
* Speedometer/resources/flightjs-example-app/requireMain.js: Added.
* Speedometer/resources/gauge.png: Added.
* Speedometer/resources/gauge@2x.png: Added.
* Speedometer/resources/logo.png: Added.
* Speedometer/resources/logo@2x.png: Added.
* Speedometer/resources/main.css: Added.
* Speedometer/resources/main.js: Added.
* Speedometer/resources/statistics.js: Added.
* Speedometer/resources/tests.js: Added.
* Speedometer/resources/todomvc/architecture-examples/angularjs/bower.json: Added.
* Speedometer/resources/todomvc/architecture-examples/angularjs/bower_components/angular-mocks/angular-mocks.js: Added.
* Speedometer/resources/todomvc/architecture-examples/angularjs/bower_components/angular/angular.js: Added.
* Speedometer/resources/todomvc/architecture-examples/angularjs/bower_components/todomvc-common/base.css: Added.
* Speedometer/resources/todomvc/architecture-examples/angularjs/bower_components/todomvc-common/base.js: Added.
* Speedometer/resources/todomvc/architecture-examples/angularjs/bower_components/todomvc-common/bg.png: Added.
* Speedometer/resources/todomvc/architecture-examples/angularjs/index.html: Added.
* Speedometer/resources/todomvc/architecture-examples/angularjs/js/app.js: Added.
* Speedometer/resources/todomvc/architecture-examples/angularjs/js/controllers/todoCtrl.js: Added.
* Speedometer/resources/todomvc/architecture-examples/angularjs/js/directives/todoBlur.js: Added.
* Speedometer/resources/todomvc/architecture-examples/angularjs/js/directives/todoEscape.js: Added.
* Speedometer/resources/todomvc/architecture-examples/angularjs/js/directives/todoFocus.js: Added.
* Speedometer/resources/todomvc/architecture-examples/angularjs/js/services/todoStorage.js: Added.
* Speedometer/resources/todomvc/architecture-examples/angularjs/readme.md: Added.
* Speedometer/resources/todomvc/architecture-examples/angularjs/test/config/testacular.conf.js: Added.
* Speedometer/resources/todomvc/architecture-examples/angularjs/test/package.json: Added.
* Speedometer/resources/todomvc/architecture-examples/angularjs/test/readme.md: Added.
* Speedometer/resources/todomvc/architecture-examples/angularjs/test/unit/directivesSpec.js: Added.
* Speedometer/resources/todomvc/architecture-examples/angularjs/test/unit/todoCtrlSpec.js: Added.
* Speedometer/resources/todomvc/architecture-examples/backbone/bower.json: Added.
* Speedometer/resources/todomvc/architecture-examples/backbone/bower_components/backbone.localStorage/backbone.localStorage.js: Added.
* Speedometer/resources/todomvc/architecture-examples/backbone/bower_components/backbone/backbone.js: Added.
* Speedometer/resources/todomvc/architecture-examples/backbone/bower_components/jquery/jquery.js: Added.
* Speedometer/resources/todomvc/architecture-examples/backbone/bower_components/todomvc-common/base.css: Added.
* Speedometer/resources/todomvc/architecture-examples/backbone/bower_components/todomvc-common/base.js: Added.
* Speedometer/resources/todomvc/architecture-examples/backbone/bower_components/todomvc-common/bg.png: Added.
* Speedometer/resources/todomvc/architecture-examples/backbone/bower_components/underscore/underscore.js: Added.
* Speedometer/resources/todomvc/architecture-examples/backbone/index.html: Added.
* Speedometer/resources/todomvc/architecture-examples/backbone/js/app.js: Added.
* Speedometer/resources/todomvc/architecture-examples/backbone/js/collections/todos.js: Added.
* Speedometer/resources/todomvc/architecture-examples/backbone/js/models/todo.js: Added.
* Speedometer/resources/todomvc/architecture-examples/backbone/js/routers/router.js: Added.
* Speedometer/resources/todomvc/architecture-examples/backbone/js/views/app-view.js: Added.
* Speedometer/resources/todomvc/architecture-examples/backbone/js/views/todo-view.js: Added.
* Speedometer/resources/todomvc/architecture-examples/backbone/readme.md: Added.
* Speedometer/resources/todomvc/architecture-examples/emberjs/bower.json: Added.
* Speedometer/resources/todomvc/architecture-examples/emberjs/bower_components/ember-data/ember-data.js: Added.
* Speedometer/resources/todomvc/architecture-examples/emberjs/bower_components/ember-localstorage-adapter/localstorage_adapter.js: Added.
* Speedometer/resources/todomvc/architecture-examples/emberjs/bower_components/ember/ember.js: Added.
* Speedometer/resources/todomvc/architecture-examples/emberjs/bower_components/handlebars/handlebars.js: Added.
* Speedometer/resources/todomvc/architecture-examples/emberjs/bower_components/jquery/jquery.js: Added.
* Speedometer/resources/todomvc/architecture-examples/emberjs/bower_components/todomvc-common/base.css: Added.
* Speedometer/resources/todomvc/architecture-examples/emberjs/bower_components/todomvc-common/base.js: Added.
* Speedometer/resources/todomvc/architecture-examples/emberjs/bower_components/todomvc-common/bg.png: Added.
* Speedometer/resources/todomvc/architecture-examples/emberjs/index.html: Added.
* Speedometer/resources/todomvc/architecture-examples/emberjs/js/app.js: Added.
* Speedometer/resources/todomvc/architecture-examples/emberjs/js/controllers/todo_controller.js: Added.
* Speedometer/resources/todomvc/architecture-examples/emberjs/js/controllers/todos_controller.js: Added.
* Speedometer/resources/todomvc/architecture-examples/emberjs/js/helpers/pluralize.js: Added.
* Speedometer/resources/todomvc/architecture-examples/emberjs/js/models/todo.js: Added.
* Speedometer/resources/todomvc/architecture-examples/emberjs/js/router.js: Added.
* Speedometer/resources/todomvc/architecture-examples/emberjs/js/views/edit_todo_view.js: Added.
* Speedometer/resources/todomvc/architecture-examples/emberjs/js/views/todos_view.js: Added.
* Speedometer/resources/todomvc/architecture-examples/emberjs/readme.md: Added.
* Speedometer/resources/todomvc/architecture-examples/emberjs/test.html: Added.
* Speedometer/resources/todomvc/architecture-examples/jquery/bower.json: Added.
* Speedometer/resources/todomvc/architecture-examples/jquery/bower_components/handlebars/handlebars.js: Added.
* Speedometer/resources/todomvc/architecture-examples/jquery/bower_components/jquery/jquery.js: Added.
* Speedometer/resources/todomvc/architecture-examples/jquery/bower_components/todomvc-common/base.css: Added.
* Speedometer/resources/todomvc/architecture-examples/jquery/bower_components/todomvc-common/base.js: Added.
* Speedometer/resources/todomvc/architecture-examples/jquery/bower_components/todomvc-common/bg.png: Added.
* Speedometer/resources/todomvc/architecture-examples/jquery/css/app.css: Added.
* Speedometer/resources/todomvc/architecture-examples/jquery/index.html: Added.
* Speedometer/resources/todomvc/architecture-examples/jquery/js/app.js: Added.
* Speedometer/resources/todomvc/architecture-examples/jquery/readme.md: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/.gitignore: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/.jshintrc: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/app/js/app.js: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/app/js/data/stats.js: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/app/js/data/todos.js: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/app/js/main.js: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/app/js/store.js: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/app/js/ui/main_selector.js: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/app/js/ui/new_item.js: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/app/js/ui/stats.js: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/app/js/ui/todo_list.js: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/app/js/ui/toggle_all.js: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/app/js/ui/with_filters.js: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/app/js/utils.js: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/app/templates/stats.html: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/app/templates/todo.html: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/bower.json: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/bower_components/depot/depot.js: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/bower_components/es5-shim/es5-sham.js: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/bower_components/es5-shim/es5-shim.js: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/bower_components/flight/lib/advice.js: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/bower_components/flight/lib/base.js: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/bower_components/flight/lib/component.js: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/bower_components/flight/lib/compose.js: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/bower_components/flight/lib/debug.js: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/bower_components/flight/lib/index.js: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/bower_components/flight/lib/logger.js: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/bower_components/flight/lib/registry.js: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/bower_components/flight/lib/utils.js: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/bower_components/jquery/jquery.js: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/bower_components/requirejs-text/text.js: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/bower_components/requirejs/require.js: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/bower_components/todomvc-common/base.css: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/bower_components/todomvc-common/base.js: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/bower_components/todomvc-common/bg.png: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/index.html: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/karma.conf.js: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/package.json: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/readme.md: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/test/.jshintrc: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/test/fixture/footer.html: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/test/fixture/new_todo.html: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/test/fixture/toggle_all.html: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/test/mock/datastore.js: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/test/spec/data/stats_spec.js: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/test/spec/data/todos_spec.js: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/test/spec/ui/new_item_spec.js: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/test/spec/ui/stats_spec.js: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/test/spec/ui/toggle_all_spec.js: Added.
* Speedometer/resources/todomvc/dependency-examples/flight/test/test-main.js: Added.
* Speedometer/resources/todomvc/labs/architecture-examples/react/bower.json: Added.
* Speedometer/resources/todomvc/labs/architecture-examples/react/bower_components/director/LICENSE: Added.
* Speedometer/resources/todomvc/labs/architecture-examples/react/bower_components/director/README.md: Added.
* Speedometer/resources/todomvc/labs/architecture-examples/react/bower_components/react/JSXTransformer.js: Added.
* Speedometer/resources/todomvc/labs/architecture-examples/react/bower_components/react/bower.json: Added.
* Speedometer/resources/todomvc/labs/architecture-examples/react/bower_components/react/react.js: Added.
* Speedometer/resources/todomvc/labs/architecture-examples/react/bower_components/react/react.min.js: Added.
* Speedometer/resources/todomvc/labs/architecture-examples/react/bower_components/todomvc-common/base.css: Added.
* Speedometer/resources/todomvc/labs/architecture-examples/react/bower_components/todomvc-common/base.js: Added.
* Speedometer/resources/todomvc/labs/architecture-examples/react/bower_components/todomvc-common/bg.png: Added.
* Speedometer/resources/todomvc/labs/architecture-examples/react/index.html: Added.
* Speedometer/resources/todomvc/labs/architecture-examples/react/js/app.jsx: Added.
* Speedometer/resources/todomvc/labs/architecture-examples/react/js/footer.jsx: Added.
* Speedometer/resources/todomvc/labs/architecture-examples/react/js/todoItem.jsx: Added.
* Speedometer/resources/todomvc/labs/architecture-examples/react/js/utils.jsx: Added.
* Speedometer/resources/todomvc/labs/architecture-examples/react/readme.md: Added.
* Speedometer/resources/todomvc/learn.json: Added.
* Speedometer/resources/todomvc/license.md: Added.
* Speedometer/resources/todomvc/readme.md: Added.
* Speedometer/resources/todomvc/vanilla-examples/vanillajs/bower.json: Added.
* Speedometer/resources/todomvc/vanilla-examples/vanillajs/bower_components/todomvc-common/base.css: Added.
* Speedometer/resources/todomvc/vanilla-examples/vanillajs/bower_components/todomvc-common/base.js: Added.
* Speedometer/resources/todomvc/vanilla-examples/vanillajs/bower_components/todomvc-common/bg.png: Added.
* Speedometer/resources/todomvc/vanilla-examples/vanillajs/index.html: Added.
* Speedometer/resources/todomvc/vanilla-examples/vanillajs/js/app.js: Added.
* Speedometer/resources/todomvc/vanilla-examples/vanillajs/js/controller.js: Added.
* Speedometer/resources/todomvc/vanilla-examples/vanillajs/js/helpers.js: Added.
* Speedometer/resources/todomvc/vanilla-examples/vanillajs/js/model.js: Added.
* Speedometer/resources/todomvc/vanilla-examples/vanillajs/js/store.js: Added.
* Speedometer/resources/todomvc/vanilla-examples/vanillajs/js/view.js: Added.
* Speedometer/resources/todomvc/vanilla-examples/vanillajs/readme.md: Added.
* index.html: Added.
* resources/ARES-6-Logo.png: Added.
* resources/ARES-6-Logo@2x.png: Added.
* resources/JetStream-Logo.png: Added.
* resources/JetStream-Logo@2x.png: Added.
* resources/MotionMark-Logo.png: Added.
* resources/MotionMark-Logo@2x.png: Added.
* resources/Speedometer-Logo.png: Added.
* resources/Speedometer-Logo@2x.png: Added.
* resources/main.css: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216811
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
--- /dev/null
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 335 74">
+ <title>ARES-6</title>
+ <path fill="#9B9B9B" d="M 12.837 13.785 C 6.052 13.785 0.59 19.247 0.59 26.032 L 0.59 73.366 L 13.416 73.366 L 13.416 54.168 L 47.179 54.168 L 47.179 73.366 L 60.171 73.366 L 60.171 26.032 C 60.171 19.247 54.627 13.785 47.841 13.785 L 12.837 13.785 Z M 13.416 41.259 L 13.416 26.694 L 47.179 26.694 L 47.179 41.259 L 13.416 41.259 Z M 124.854 26.115 C 124.854 19.412 119.309 13.868 112.524 13.868 L 65.273 13.868 L 65.273 73.366 L 78.099 73.366 L 78.099 54.251 C 78.182 54.333 78.347 54.333 78.347 54.333 C 78.347 54.002 78.265 53.837 78.099 53.837 L 95.146 53.754 L 111.613 73.366 L 124.854 73.366 L 124.854 68.98 C 120.716 64.015 116.165 58.719 111.944 53.754 L 112.524 53.754 C 119.309 53.754 124.854 48.21 124.854 41.507 L 124.854 26.115 Z M 78.099 26.694 L 111.862 26.694 L 111.862 40.845 L 78.099 40.845 L 78.099 26.694 Z"/><path fill="#E7B135" d="M 313.955 73.053 C 317.167 71.389 319.353 68.037 319.353 64.158 L 319.353 49.842 C 319.353 44.215 314.885 39.83 309.34 39.83 L 269.206 39.83 C 267.468 39.83 265.979 38.34 265.979 36.519 L 265.979 24.603 C 265.979 22.865 267.468 21.376 269.206 21.376 L 308.927 21.376 L 308.927 14.508 L 269.206 14.508 C 263.579 14.508 259.193 18.976 259.193 24.603 L 259.193 64.158 C 259.193 68.037 261.339 71.389 264.555 73.053 L 234.069 73.053 C 239.473 71.802 243.566 66.949 243.566 61.119 L 243.566 49.368 C 243.566 42.583 238.022 37.121 231.319 37.121 L 196.812 37.121 L 196.812 26.694 L 230.574 26.694 L 230.574 31.577 L 243.566 31.577 L 243.566 26.032 C 243.566 19.247 238.022 13.785 231.319 13.785 L 196.232 13.785 C 189.447 13.785 183.985 19.247 183.985 26.032 L 183.985 37.783 C 183.985 44.569 189.447 50.03 196.232 50.03 L 230.574 50.03 L 230.574 60.457 L 196.812 60.457 L 196.812 55.575 L 183.985 55.575 L 183.985 61.119 C 183.985 66.949 188.017 71.802 193.457 73.053 L 179.747 73.053 L 179.747 60.457 L 137.709 60.457 L 137.709 50.03 L 171.555 50.03 L 171.555 37.121 L 137.709 37.121 L 137.709 26.694 L 179.747 26.694 L 179.747 13.785 L 124.717 13.785 L 124.717 43.419 L 124.717 0.366 L 334.951 0.366 L 334.951 73.053 L 313.955 73.053 Z M 247.722 40.547 L 247.722 47.333 L 254.507 47.333 L 254.507 40.547 L 247.722 40.547 Z M 312.568 64.158 C 312.568 65.896 311.078 67.386 309.34 67.386 L 269.206 67.386 C 267.468 67.386 265.979 65.896 265.979 64.158 L 265.979 46.615 L 309.34 46.615 C 311.078 46.615 312.568 48.105 312.568 49.842 L 312.568 64.158 Z"/>
+</svg>
--- /dev/null
+# All about Air.js
+
+Air.js is an ES6 benchmark. It tries to faithfully use new features like arrow
+functions, classes, for-of, and Map/Set, among others. Air.js doesn't avoid any
+features out of fear that they might be slow, in the hope that we might learn
+how to make those features fast by looking at how Air.js and other benchmarks
+use them.
+
+This documents the motivation, design, and license of Air.js.
+
+To run Air.js, simply open "[Air.js/test.html](test.html)" in your browser. It
+will only run correctly if your browser supports ES6.
+
+## Motivation
+
+At the time that Air.js was written, most JavaScript benchmarks used ES5 or
+older versions of the language. ES6 testing mostly relied on microbenchmarks or
+conversions of existing tests to ES6. We try to use larger benchmarks to avoid
+over-optimizing for small pieces of code, and we avoid making changes to
+existing benchmarks because that approach has no limiting principle: if it's OK
+to change a benchmark to use a feature, does that mean we can also change it to
+remove the use of a feature we don't like? We feel that the best way to avoid
+falling into the trap of creating benchmarks that reinforce what some JS engine
+is already good at is to create a new benchmark from first principles.
+
+We only recently completed our new JavaScript compiler, called
+[B3](https://webkit.org/blog/5852/introducing-the-b3-jit-compiler/). B3's
+backend, called
+[Air](https://webkit.org/docs/b3/assembly-intermediate-representation.html), is
+very CPU-intensive and uses a combination of object-oriented and functional
+idioms in C++. Additionally, it relies heavily on high speed maps and sets. It
+goes so far as to use customized map/set implementations - even more so than
+the rest of WebKit. This makes Air a great candidate for ES6 benchmarking.
+Air.js is a faithful ES6 implementation of Air. It pulls no punches: just as
+the original C++ Air was written with expressiveness as a top priority, Air.js
+is liberal in its use of modern ES6 idioms whenever this helps make the code
+more readable. Unlike the original C++ Air, Air.js doesn't exploit a deep
+understanding of compilers to make the code easy to compile.
+
+## Design
+
+Air.js runs one of the more expensive Air phases, Air::allocateStack(). This
+turns abstract stack references into concrete stack references, by selecting
+how to lay out stack slots in the stack frame. This requires liveness analysis
+and an interference graph.
+
+Air.js relies on three major ES6 features more so than most of the others:
+
+- Arrow functions. Like the C++ Air, Air.js uses a functional style of
+ iterating most non-trivial data-structures:
+
+ inst.forEachArg((arg, role, type, width) => ...)
+
+ This is because the functional style allows the callbacks to mutate the data
+ being iterated: if the callback returns a non-null value, forEachArg() will
+ replace the argument with that value. This would not have been possible with
+ for-of.
+
+- For-of. Many Air data structures are amenable to for-of iteration. While the
+ innermost loops tend to use functional iteration, pretty much all of the
+ outer logic uses for-of heavily. For example:
+
+ for (let block of code) // Iterate over the basic blocks
+ for (let inst of block) // Iterate over the instructions in a block
+ ...
+
+- Map/Set. The liveness analysis and Air::allocateStack() rely on maps and
+ sets. For example, we use a liveAtHead map that is keyed by basic block. Its
+ values are sets of live stack slots. This is a relatively crude way of doing
+ liveness, but it is exactly how the original Air::LivenessAnalysis worked, so
+ we view it as being quite faithful to how a sensible programmer might use Map
+ and Set.
+
+Air.js also uses some other ES6 features. For example, it uses a Proxy
+in one place, though we doubt that it's on a critical path. Air.js uses classes
+and let/const extensively, as well a symbols. Symbols are used as enumeration
+elements, and so they frequently show up as cases in switch statements.
+
+The workflow of an Air.js run is pretty simple: we do 150 runs of allocateStack
+on four IR payloads.
+
+Each IR payload is a large piece of ES6 code that constructs an Air.js Code
+object, complete with blocks, temporaries, stack slots, and instructions. These
+payloads are generated by running Air::dumpAsJS() phase just prior to the
+native allocateStack phase on the largest hot function in four major JS
+benchmarks according to JavaScriptCore's internal profiling:
+
+- Octane/GBEmu, the executeIteration function.
+- Kraken/imaging-gaussian-blur, the gaussianBlur function.
+- Octane/Typescript, the scanIdentifier function,
+- Air.js, an anonymous closure identified by our profiler as ACLj8C.
+
+These payloads allow Air.js to precisely replay allocateStack on those actual
+functions.
+
+It was an a priori goal of Air.js to spend most of the time in the
+allocateStack phase. This is a faithful reproduction of the C++ allocateStack
+phase, including its use of an abstract liveness analysis. It's abstract in the
+sense that the same liveness algorithm can be reused for temporaries,
+registers, or stack slots. In C++ this meant using templates, while in ES6 it
+means more run-time dynamic dispatch.
+
+Each IR payload is executable code that allocates the IR, and about 15% of
+benchmark execution time is spent in that code. This is significant, but having
+learned this, we don't feel that it would be honest to try to change the
+efficiency of payload initialization. What if the payload initialization was
+more expensive on our engine than others? If it was, then such a change would
+not be fair.
+
+Air.js validates its results. We added a Code hashing capability to both the
+C++ Air and Air.js, and we assert each payload looks identical after
+allocateStack to what it would have looked like after the original C++
+allocateStack. We also validate that payloads hash properly before
+allcoateStack, to help catch bugs during payload initialization. We have not
+measured how long hashing takes, but it's a O(N) operation, while allocateStack
+is closer to O(N^2). We suspect that barring some engine pathologies, hashing
+should be much faster than allocateStack, and allocateStack should be where the
+bulk of time is spent.
+
+## License
+
+Copyright (C) 2016 Apple Inc. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+## Summary
+
+At the time that Air.js was written, we weren't happy with the ES6 benchmarks
+that were available to us. Air.js uses some ES6 features in anger, in the hope
+that we can learn about possible optimization strategies by looking at this and
+other benchmarks.
--- /dev/null
+# Copyright (C) 2016 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+- path: .
+ tests:
+ - stress-test.js
+ cmd: defaultRunNoisyTest unless parseRunCommands
+
--- /dev/null
+"use strict";
+
+load("symbols.js");
+load("tmp_base.js");
+load("arg.js");
+load("basic_block.js");
+load("code.js");
+load("frequented_block.js");
+load("inst.js");
+load("opcode.js");
+load("reg.js");
+load("stack_slot.js");
+load("tmp.js");
+load("util.js");
+load("custom.js");
+load("liveness.js");
+load("insertion_set.js");
+load("allocate_stack.js");
--- /dev/null
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+"use strict";
+
+function allocateStack(code)
+{
+ if (code.frameSize)
+ throw new Error("Frame size already determined");
+
+ function attemptAssignment(slot, offsetFromFP, otherSlots)
+ {
+ if (offsetFromFP > 0)
+ throw new Error("Expect negative offset");
+
+ offsetFromFP = -roundUpToMultipleOf(slot.alignment, -offsetFromFP);
+
+ for (let otherSlot of otherSlots) {
+ if (!otherSlot.offsetFromFP)
+ continue;
+ let overlap = rangesOverlap(
+ offsetFromFP,
+ offsetFromFP + slot.byteSize,
+ otherSlot.offsetFromFP,
+ otherSlot.offsetFromFP + otherSlot.byteSize);
+ if (overlap)
+ return false;
+ }
+
+ slot.setOffsetFromFP(offsetFromFP);
+ return true;
+ }
+
+ function assign(slot, otherSlots)
+ {
+ if (attemptAssignment(slot, -slot.byteSize, otherSlots))
+ return;
+
+ for (let otherSlot of otherSlots) {
+ if (!otherSlot.offsetFromFP)
+ continue;
+ if (attemptAssignment(slot, otherSlot.offsetFromFP - slot.byteSize, otherSlots))
+ return;
+ }
+
+ throw new Error("Assignment failed");
+ }
+
+ // Allocate all of the escaped slots in order. This is kind of a crazy algorithm to allow for
+ // the possibility of stack slots being assigned frame offsets before we even get here.
+ let assignedEscapedStackSlots = [];
+ let escapedStackSlotsWorklist = [];
+ for (let slot of code.stackSlots) {
+ if (slot.isLocked) {
+ if (slot.offsetFromFP)
+ assignedEscapedStackSlots.push(slot);
+ else
+ escapedStackSlotsWorklist.push(slot);
+ } else {
+ if (slot.offsetFromFP)
+ throw new Error("Offset already assigned");
+ }
+ }
+
+ // This is a fairly espensive loop, but it's OK because we'll usually only have a handful of
+ // escaped stack slots.
+ while (escapedStackSlotsWorklist.length) {
+ let slot = escapedStackSlotsWorklist.pop();
+ assign(slot, assignedEscapedStackSlots);
+ assignedEscapedStackSlots.push(slot);
+ }
+
+ // Now we handle the spill slots.
+ let liveness = new Liveness(StackSlot, code);
+ let interference = new Map();
+ for (let slot of code.stackSlots)
+ interference.set(slot, new Set());
+ let slots = [];
+
+ for (let block of code) {
+ let localCalc = liveness.localCalc(block);
+
+ function interfere(instIndex)
+ {
+ Inst.forEachDef(
+ StackSlot, block.get(instIndex), block.get(instIndex + 1),
+ (slot, role, type, width) => {
+ if (!slot.isSpill)
+ return;
+
+ for (let otherSlot of localCalc.liveSet) {
+ interference.get(slot).add(otherSlot);
+ interference.get(otherSlot).add(slot);
+ }
+ });
+ }
+
+ for (let instIndex = block.size; instIndex--;) {
+ // Kill dead stores. For simplicity we say that a store is killable if it has only late
+ // defs and those late defs are to things that are dead right now. We only do that
+ // because that's the only kind of dead stack store we will see here.
+ let inst = block.at(instIndex);
+ if (!inst.hasNonArgEffects) {
+ let ok = true;
+ inst.forEachArg((arg, role, type, width) => {
+ if (Arg.isEarlyDef(role)) {
+ ok = false;
+ return;
+ }
+ if (!Arg.isLateDef(role))
+ return;
+ if (!arg.isStack) {
+ ok = false;
+ return;
+ }
+
+ let slot = arg.stackSlot;
+ if (!slot.isSpill) {
+ ok = false;
+ return;
+ }
+
+ if (localCalc.liveSet.has(slot)) {
+ ok = false;
+ return;
+ }
+ });
+ if (ok)
+ inst.clear();
+ }
+
+ interfere(instIndex);
+ localCalc.execute(instIndex);
+ }
+ interfere(-1);
+
+ removeAllMatching(block.insts, inst => inst.opcode == Nop);
+ }
+
+ // Now we assign stack locations. At its heart this algorithm is just first-fit. For each
+ // StackSlot we just want to find the offsetFromFP that is closest to zero while ensuring no
+ // overlap with other StackSlots that this overlaps with.
+ for (let slot of code.stackSlots) {
+ if (slot.offsetFromFP)
+ continue;
+
+ assign(slot, assignedEscapedStackSlots.concat(Array.from(interference.get(slot))));
+ }
+
+ // Figure out how much stack we're using for stack slots.
+ let frameSizeForStackSlots = 0;
+ for (let slot of code.stackSlots) {
+ frameSizeForStackSlots = Math.max(
+ frameSizeForStackSlots,
+ -slot.offsetFromFP);
+ }
+
+ frameSizeForStackSlots = roundUpToMultipleOf(stackAlignmentBytes, frameSizeForStackSlots);
+
+ // No we need to deduce how much argument area we need.
+ for (let block of code) {
+ for (let inst of block) {
+ for (let arg of inst.args) {
+ if (arg.isCallArg) {
+ // For now, we assume that we use 8 bytes of the call arg. But that's not
+ // such an awesome assumption.
+ // FIXME: https://bugs.webkit.org/show_bug.cgi?id=150454
+ if (arg.offset < 0)
+ throw new Error("Did not expect negative offset for callArg");
+ code.requestCallArgAreaSize(arg.offset + 8);
+ }
+ }
+ }
+ }
+
+ code.setFrameSize(frameSizeForStackSlots + code.callArgAreaSize);
+
+ // Finally transform the code to use Addrs instead of StackSlots. This is a lossless
+ // transformation since we can search the StackSlots array to figure out which StackSlot any
+ // offset-from-FP refers to.
+
+ // FIXME: This may produce addresses that aren't valid if we end up with a ginormous stack frame.
+ // We would have to scavenge for temporaries if this happened. Fortunately, this case will be
+ // extremely rare so we can do crazy things when it arises.
+ // https://bugs.webkit.org/show_bug.cgi?id=152530
+
+ let insertionSet = new InsertionSet();
+ for (let block of code) {
+ for (let instIndex = 0; instIndex < block.size; ++instIndex) {
+ let inst = block.at(instIndex);
+ inst.forEachArg((arg, role, type, width) => {
+ function stackAddr(offset)
+ {
+ return Arg.createStackAddr(offset, code.frameSize, width);
+ }
+
+ switch (arg.kind) {
+ case Arg.Stack: {
+ let slot = arg.stackSlot;
+ if (Arg.isZDef(role)
+ && slot.isSpill
+ && slot.byteSize > Arg.bytes(width)) {
+ // Currently we only handle this simple case because it's the only one
+ // that arises: ZDef's are only 32-bit right now. So, when we hit these
+ // assertions it means that we need to implement those other kinds of
+ // zero fills.
+ if (slot.byteSize != 8) {
+ throw new Error(
+ `Bad spill slot size for ZDef: ${slot.byteSize}, width is ${width}`);
+ }
+ if (width != 32)
+ throw new Error("Bad width for ZDef");
+
+ insertionSet.insert(
+ instIndex + 1,
+ new Inst(
+ StoreZero32,
+ [stackAddr(arg.offset + 4 + slot.offsetFromFP)]));
+ }
+ return stackAddr(arg.offset + slot.offsetFromFP);
+ }
+ case Arg.CallArg:
+ return stackAddr(arg.offset - code.frameSize);
+ default:
+ break;
+ }
+ });
+ }
+ insertionSet.execute(block.insts);
+ }
+}
--- /dev/null
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+"use strict";
+
+class Arg {
+ constructor()
+ {
+ this._kind = Arg.Invalid;
+ }
+
+ static isAnyUse(role)
+ {
+ switch (role) {
+ case Arg.Use:
+ case Arg.ColdUse:
+ case Arg.UseDef:
+ case Arg.UseZDef:
+ case Arg.LateUse:
+ case Arg.LateColdUse:
+ case Arg.Scratch:
+ return true;
+ case Arg.Def:
+ case Arg.ZDef:
+ case Arg.UseAddr:
+ case Arg.EarlyDef:
+ return false;
+ default:
+ throw new Error("Bad role");
+ }
+ }
+
+ static isColdUse(role)
+ {
+ switch (role) {
+ case Arg.ColdUse:
+ case Arg.LateColdUse:
+ return true;
+ case Arg.Use:
+ case Arg.UseDef:
+ case Arg.UseZDef:
+ case Arg.LateUse:
+ case Arg.Def:
+ case Arg.ZDef:
+ case Arg.UseAddr:
+ case Arg.Scratch:
+ case Arg.EarlyDef:
+ return false;
+ default:
+ throw new Error("Bad role");
+ }
+ }
+
+ static isWarmUse(role)
+ {
+ return Arg.isAnyUse(role) && !Arg.isColdUse(role);
+ }
+
+ static cooled(role)
+ {
+ switch (role) {
+ case Arg.ColdUse:
+ case Arg.LateColdUse:
+ case Arg.UseDef:
+ case Arg.UseZDef:
+ case Arg.Def:
+ case Arg.ZDef:
+ case Arg.UseAddr:
+ case Arg.Scratch:
+ case Arg.EarlyDef:
+ return role;
+ case Arg.Use:
+ return Arg.ColdUse;
+ case Arg.LateUse:
+ return Arg.LateColdUse;
+ default:
+ throw new Error("Bad role");
+ }
+ }
+
+ static isEarlyUse(role)
+ {
+ switch (role) {
+ case Arg.Use:
+ case Arg.ColdUse:
+ case Arg.UseDef:
+ case Arg.UseZDef:
+ return true;
+ case Arg.Def:
+ case Arg.ZDef:
+ case Arg.UseAddr:
+ case Arg.LateUse:
+ case Arg.LateColdUse:
+ case Arg.Scratch:
+ case Arg.EarlyDef:
+ return false;
+ default:
+ throw new Error("Bad role");
+ }
+ }
+
+ static isLateUse(role)
+ {
+ switch (role) {
+ case Arg.LateUse:
+ case Arg.LateColdUse:
+ case Arg.Scratch:
+ return true;
+ case Arg.ColdUse:
+ case Arg.Use:
+ case Arg.UseDef:
+ case Arg.UseZDef:
+ case Arg.Def:
+ case Arg.ZDef:
+ case Arg.UseAddr:
+ case Arg.EarlyDef:
+ return false;
+ default:
+ throw new Error("Bad role");
+ }
+ }
+
+ static isAnyDef(role)
+ {
+ switch (role) {
+ case Arg.Use:
+ case Arg.ColdUse:
+ case Arg.UseAddr:
+ case Arg.LateUse:
+ case Arg.LateColdUse:
+ return false;
+ case Arg.Def:
+ case Arg.UseDef:
+ case Arg.ZDef:
+ case Arg.UseZDef:
+ case Arg.EarlyDef:
+ case Arg.Scratch:
+ return true;
+ default:
+ throw new Error("Bad role");
+ }
+ }
+
+ static isEarlyDef(role)
+ {
+ switch (role) {
+ case Arg.Use:
+ case Arg.ColdUse:
+ case Arg.UseAddr:
+ case Arg.LateUse:
+ case Arg.Def:
+ case Arg.UseDef:
+ case Arg.ZDef:
+ case Arg.UseZDef:
+ case Arg.LateColdUse:
+ return false;
+ case Arg.EarlyDef:
+ case Arg.Scratch:
+ return true;
+ default:
+ throw new Error("Bad role");
+ }
+ }
+
+ static isLateDef(role)
+ {
+ switch (role) {
+ case Arg.Use:
+ case Arg.ColdUse:
+ case Arg.UseAddr:
+ case Arg.LateUse:
+ case Arg.EarlyDef:
+ case Arg.Scratch:
+ case Arg.LateColdUse:
+ return false;
+ case Arg.Def:
+ case Arg.UseDef:
+ case Arg.ZDef:
+ case Arg.UseZDef:
+ return true;
+ default:
+ throw new Error("Bad role");
+ }
+ }
+
+ static isZDef(role)
+ {
+ switch (role) {
+ case Arg.Use:
+ case Arg.ColdUse:
+ case Arg.UseAddr:
+ case Arg.LateUse:
+ case Arg.Def:
+ case Arg.UseDef:
+ case Arg.EarlyDef:
+ case Arg.Scratch:
+ case Arg.LateColdUse:
+ return false;
+ case Arg.ZDef:
+ case Arg.UseZDef:
+ return true;
+ default:
+ throw new Error("Bad role");
+ }
+ }
+
+ static typeForB3Type(type)
+ {
+ switch (type) {
+ case Int32:
+ case Int64:
+ return GP;
+ case Float:
+ case Double:
+ return FP;
+ default:
+ throw new Error("Bad B3 type");
+ }
+ }
+
+ static widthForB3Type(type)
+ {
+ switch (type) {
+ case Int32:
+ case Float:
+ return 32;
+ case Int64:
+ case Double:
+ return 64;
+ default:
+ throw new Error("Bad B3 type");
+ }
+ }
+
+ static conservativeWidth(type)
+ {
+ return type == GP ? Ptr : 64;
+ }
+
+ static minimumWidth(type)
+ {
+ return type == GP ? 8 : 32;
+ }
+
+ static bytes(width)
+ {
+ return width / 8;
+ }
+
+ static widthForBytes(bytes)
+ {
+ switch (bytes) {
+ case 0:
+ case 1:
+ return 8;
+ case 2:
+ return 16;
+ case 3:
+ case 4:
+ return 32;
+ default:
+ if (bytes > 8)
+ throw new Error("Bad number of bytes");
+ return 64;
+ }
+ }
+
+ static createTmp(tmp)
+ {
+ let result = new Arg();
+ result._kind = Arg.Tmp;
+ result._tmp = tmp;
+ return result;
+ }
+
+ static fromReg(reg)
+ {
+ return Arg.createTmp(reg);
+ }
+
+ static createImm(value)
+ {
+ let result = new Arg();
+ result._kind = Arg.Imm;
+ result._value = value;
+ return result;
+ }
+
+ static createBigImm(lowValue, highValue = 0)
+ {
+ let result = new Arg();
+ result._kind = Arg.BigImm;
+ result._lowValue = lowValue;
+ result._highValue = highValue;
+ return result;
+ }
+
+ static createBitImm(value)
+ {
+ let result = new Arg();
+ result._kind = Arg.BitImm;
+ result._value = value;
+ return result;
+ }
+
+ static createBitImm64(lowValue, highValue = 0)
+ {
+ let result = new Arg();
+ result._kind = Arg.BitImm64;
+ result._lowValue = lowValue;
+ result._highValue = highValue;
+ return result;
+ }
+
+ static createAddr(base, offset = 0)
+ {
+ let result = new Arg();
+ result._kind = Arg.Addr;
+ result._base = base;
+ result._offset = offset;
+ return result;
+ }
+
+ static createStack(slot, offset = 0)
+ {
+ let result = new Arg();
+ result._kind = Arg.Stack;
+ result._slot = slot;
+ result._offset = offset;
+ return result;
+ }
+
+ static createCallArg(offset)
+ {
+ let result = new Arg();
+ result._kind = Arg.CallArg;
+ result._offset = offset;
+ return result;
+ }
+
+ static createStackAddr(offsetFromFP, frameSize, width)
+ {
+ let result = Arg.createAddr(Reg.callFrameRegister, offsetFromFP);
+ if (!result.isValidForm(width))
+ result = Arg.createAddr(Reg.stackPointerRegister, offsetFromFP + frameSize);
+ return result;
+ }
+
+ static isValidScale(scale, width)
+ {
+ switch (scale) {
+ case 1:
+ case 2:
+ case 4:
+ case 8:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ static logScale(scale)
+ {
+ switch (scale) {
+ case 1:
+ return 0;
+ case 2:
+ return 1;
+ case 4:
+ return 2;
+ case 8:
+ return 3;
+ default:
+ throw new Error("Bad scale");
+ }
+ }
+
+ static createIndex(base, index, scale = 1, offset = 0)
+ {
+ let result = new Arg();
+ result._kind = Arg.Index;
+ result._base = base;
+ result._index = index;
+ result._scale = scale;
+ result._offset = offset;
+ return result;
+ }
+
+ static createRelCond(condition)
+ {
+ let result = new Arg();
+ result._kind = Arg.RelCond;
+ result._condition = condition;
+ return result;
+ }
+
+ static createResCond(condition)
+ {
+ let result = new Arg();
+ result._kind = Arg.ResCond;
+ result._condition = condition;
+ return result;
+ }
+
+ static createDoubleCond(condition)
+ {
+ let result = new Arg();
+ result._kind = Arg.DoubleCond;
+ result._condition = condition;
+ return result;
+ }
+
+ static createWidth(width)
+ {
+ let result = new Arg();
+ result._kind = Arg.Width;
+ result._width = width;
+ return result;
+ }
+
+ static createSpecial()
+ {
+ let result = new Arg();
+ result._kind = Arg.Special;
+ return result;
+ }
+
+ get kind() { return this._kind; }
+ get isTmp() { return this._kind == Arg.Tmp; }
+ get isImm() { return this._kind == Arg.Imm; }
+ get isBigImm() { return this._kind == Arg.BigImm; }
+ get isBitImm() { return this._kind == Arg.BitImm; }
+ get isBitImm64() { return this._kind == Arg.BitImm64; }
+ get isSomeImm()
+ {
+ switch (this._kind) {
+ case Arg.Imm:
+ case Arg.BitImm:
+ return true;
+ default:
+ return false;
+ }
+ }
+ get isSomeBigImm()
+ {
+ switch (this._kind) {
+ case Arg.BigImm:
+ case Arg.BitImm64:
+ return true;
+ default:
+ return false;
+ }
+ }
+ get isAddr() { return this._kind == Arg.Addr; }
+ get isStack() { return this._kind == Arg.Stack; }
+ get isCallArg() { return this._kind == Arg.CallArg; }
+ get isIndex() { return this._kind == Arg.Index; }
+ get isMemory()
+ {
+ switch (this._kind) {
+ case Arg.Addr:
+ case Arg.Stack:
+ case Arg.CallArg:
+ case Arg.Index:
+ return true;
+ default:
+ return false;
+ }
+ }
+ get isStackMemory()
+ {
+ switch (this._kind) {
+ case Arg.Addr:
+ return this._base == Reg.callFrameRegister
+ || this._base == Reg.stackPointerRegister;
+ case Arg.Stack:
+ case Arg.CallArg:
+ return true;
+ default:
+ return false;
+ }
+ }
+ get isRelCond() { return this._kind == Arg.RelCond; }
+ get isResCond() { return this._kind == Arg.ResCond; }
+ get isDoubleCond() { return this._kind == Arg.DoubleCond; }
+ get isCondition()
+ {
+ switch (this._kind) {
+ case Arg.RelCond:
+ case Arg.ResCond:
+ case Arg.DoubleCond:
+ return true;
+ default:
+ return false;
+ }
+ }
+ get isWidth() { return this._kind == Arg.Width; }
+ get isSpecial() { return this._kind == Arg.Special; }
+ get isAlive() { return this.isTmp || this.isStack; }
+
+ get tmp()
+ {
+ if (this._kind != Arg.Tmp)
+ throw new Error("Called .tmp for non-tmp");
+ return this._tmp;
+ }
+
+ get value()
+ {
+ if (!this.isSomeImm)
+ throw new Error("Called .value for non-imm");
+ return this._value;
+ }
+
+ get lowValue()
+ {
+ if (!this.isSomeBigImm)
+ throw new Error("Called .lowValue for non-big-imm");
+ return this._lowValue;
+ }
+
+ get highValue()
+ {
+ if (!this.isSomeBigImm)
+ throw new Error("Called .highValue for non-big-imm");
+ return this._highValue;
+ }
+
+ get base()
+ {
+ switch (this._kind) {
+ case Arg.Addr:
+ case Arg.Index:
+ return this._base;
+ default:
+ throw new Error("Called .base for non-address");
+ }
+ }
+
+ get hasOffset() { return this.isMemory; }
+
+ get offset()
+ {
+ switch (this._kind) {
+ case Arg.Addr:
+ case Arg.Index:
+ case Arg.Stack:
+ case Arg.CallArg:
+ return this._offset;
+ default:
+ throw new Error("Called .offset for non-address");
+ }
+ }
+
+ get stackSlot()
+ {
+ if (this._kind != Arg.Stack)
+ throw new Error("Called .stackSlot for non-address");
+ return this._slot;
+ }
+
+ get index()
+ {
+ if (this._kind != Arg.Index)
+ throw new Error("Called .index for non-Index");
+ return this._index;
+ }
+
+ get scale()
+ {
+ if (this._kind != Arg.Index)
+ throw new Error("Called .scale for non-Index");
+ return this._scale;
+ }
+
+ get logScale()
+ {
+ return Arg.logScale(this.scale);
+ }
+
+ get width()
+ {
+ if (this._kind != Arg.Width)
+ throw new Error("Called .width for non-Width");
+ return this._width;
+ }
+
+ get isGPTmp() { return this.isTmp && this.tmp.isGP; }
+ get isFPTmp() { return this.isTmp && this.tmp.isFP; }
+
+ get isGP()
+ {
+ switch (this._kind) {
+ case Arg.Imm:
+ case Arg.BigImm:
+ case Arg.BitImm:
+ case Arg.BitImm64:
+ case Arg.Addr:
+ case Arg.Index:
+ case Arg.Stack:
+ case Arg.CallArg:
+ case Arg.RelCond:
+ case Arg.ResCond:
+ case Arg.DoubleCond:
+ case Arg.Width:
+ case Arg.Special:
+ return true;
+ case Arg.Tmp:
+ return this.isGPTmp;
+ case Arg.Invalid:
+ return false;
+ default:
+ throw new Error("Bad kind");
+ }
+ }
+
+ get isFP()
+ {
+ switch (this._kind) {
+ case Arg.Imm:
+ case Arg.BitImm:
+ case Arg.BitImm64:
+ case Arg.RelCond:
+ case Arg.ResCond:
+ case Arg.DoubleCond:
+ case Arg.Width:
+ case Arg.Special:
+ case Arg.Invalid:
+ return false;
+ case Arg.Addr:
+ case Arg.Index:
+ case Arg.Stack:
+ case Arg.CallArg:
+ case Arg.BigImm:
+ return true;
+ case Arg.Tmp:
+ return this.isFPTmp;
+ default:
+ throw new Error("Bad kind");
+ }
+ }
+
+ get hasType()
+ {
+ switch (this._kind) {
+ case Arg.Imm:
+ case Arg.BitImm:
+ case Arg.BitImm64:
+ case Arg.Tmp:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ get type()
+ {
+ return this.isGP ? GP : FP;
+ }
+
+ isType(type)
+ {
+ switch (type) {
+ case Arg.GP:
+ return this.isGP;
+ case Arg.FP:
+ return this.isFP;
+ default:
+ throw new Error("Bad type");
+ }
+ }
+
+ isCompatibleType(other)
+ {
+ if (this.hasType)
+ return other.isType(this.type);
+ if (other.hasType)
+ return this.isType(other.type);
+ return true;
+ }
+
+ get isGPR() { return this.isTmp && this.tmp.isGPR; }
+ get gpr() { return this.tmp.gpr; }
+ get isFPR() { return this.isTmp && this.tmp.isFPR; }
+ get fpr() { return this.tmp.fpr; }
+ get isReg() { return this.isTmp && this.tmp.isReg; }
+ get reg() { return this.tmp.reg; }
+
+ static isValidImmForm(value)
+ {
+ return isRepresentableAsInt32(value);
+ }
+ static isValidBitImmForm(value)
+ {
+ return isRepresentableAsInt32(value);
+ }
+ static isValidBitImm64Form(value)
+ {
+ return isRepresentableAsInt32(value);
+ }
+
+ static isValidAddrForm(offset, width)
+ {
+ return true;
+ }
+
+ static isValidIndexForm(scale, offset, width)
+ {
+ if (!isValidScale(scale, width))
+ return false;
+ return true;
+ }
+
+ isValidForm(width)
+ {
+ switch (this._kind) {
+ case Arg.Invalid:
+ return false;
+ case Arg.Tmp:
+ return true;
+ case Arg.Imm:
+ return Arg.isValidImmForm(this.value);
+ case Arg.BigImm:
+ return true;
+ case Arg.BitImm:
+ return Arg.isValidBitImmForm(this.value);
+ case Arg.BitImm64:
+ return Arg.isValidBitImm64Form(this.value);
+ case Arg.Addr:
+ case Arg.Stack:
+ case Arg.CallArg:
+ return Arg.isValidAddrForm(this.offset, width);
+ case Arg.Index:
+ return Arg.isValidIndexForm(this.scale, this.offset, width);
+ case Arg.RelCond:
+ case Arg.ResCond:
+ case Arg.DoubleCond:
+ case Arg.Width:
+ case Arg.Special:
+ return true;
+ default:
+ throw new Error("Bad kind");
+ }
+ }
+
+ forEachTmpFast(func)
+ {
+ switch (this._kind) {
+ case Arg.Tmp: {
+ let replacement;
+ if (replacement = func(this._tmp))
+ return Arg.createTmp(replacement);
+ break;
+ }
+ case Arg.Addr: {
+ let replacement;
+ if (replacement = func(this._base))
+ return Arg.createAddr(replacement, this._offset);
+ break;
+ }
+ case Arg.Index: {
+ let baseReplacement = func(this._base);
+ let indexReplacement = func(this._index);
+ if (baseReplacement || indexReplacement) {
+ return Arg.createIndex(
+ baseReplacement ? baseReplacement : this._base,
+ indexReplacement ? indexReplacement : this._index,
+ this._scale, this._offset);
+ }
+ break;
+ }
+ default:
+ break;
+ }
+ }
+
+ usesTmp(expectedTmp)
+ {
+ let usesTmp = false;
+ forEachTmpFast(tmp => {
+ usesTmp |= tmp == expectedTmp;
+ });
+ return usesTmp;
+ }
+
+ forEachTmp(role, type, width, func)
+ {
+ switch (this._kind) {
+ case Arg.Tmp: {
+ let replacement;
+ if (replacement = func(this._tmp, role, type, width))
+ return Arg.createTmp(replacement);
+ break;
+ }
+ case Arg.Addr: {
+ let replacement;
+ if (replacement = func(this._base, Arg.Use, GP, role == Arg.UseAddr ? width : Ptr))
+ return Arg.createAddr(replacement, this._offset);
+ break;
+ }
+ case Arg.Index: {
+ let baseReplacement = func(this._base, Arg.Use, GP, role == Arg.UseAddr ? width : Ptr);
+ let indexReplacement = func(this._index, Arg.Use, GP, role == Arg.UseAddr ? width : Ptr);
+ if (baseReplacement || indexReplacement) {
+ return Arg.createIndex(
+ baseReplacement ? baseReplacement : this._base,
+ indexReplacement ? indexReplacement : this._index,
+ this._scale, this._offset);
+ }
+ break;
+ }
+ default:
+ break;
+ }
+ }
+
+ is(thing) { return !!thing.extract(this); }
+ as(thing) { return thing.extract(this); }
+
+ // This lets you say things like:
+ // arg.forEach(Tmp | Reg | Arg | StackSlot, ...)
+ //
+ // It's used for abstract liveness analysis.
+ forEachFast(thing, func)
+ {
+ return thing.forEachFast(this, func);
+ }
+ forEach(thing, role, type, width, func)
+ {
+ return thing.forEach(this, role, type, width, func);
+ }
+
+ static extract(arg) { return arg; }
+ static forEachFast(arg, func) { return func(arg); }
+ static forEach(arg, role, type, width, func) { return func(arg, role, type, width); }
+
+ get condition()
+ {
+ switch (this._kind) {
+ case Arg.RelCond:
+ case Arg.ResCond:
+ case Arg.DoubleCond:
+ return this._condition;
+ default:
+ throw new Error("Called .condition for non-condition");
+ }
+ }
+
+ get isInvertible()
+ {
+ switch (this._kind) {
+ case Arg.RelCond:
+ case Arg.DoubleCold:
+ return true;
+ case Arg.ResCond:
+ switch (this._condition) {
+ case Zero:
+ case NonZero:
+ case Signed:
+ case PositiveOrZero:
+ return true;
+ default:
+ return false;
+ }
+ default:
+ return false;
+ }
+ }
+
+ static kindCode(kind)
+ {
+ switch (kind) {
+ case Arg.Invalid:
+ return 0;
+ case Arg.Tmp:
+ return 1;
+ case Arg.Imm:
+ return 2;
+ case Arg.BigImm:
+ return 3;
+ case Arg.BitImm:
+ return 4;
+ case Arg.BitImm64:
+ return 5;
+ case Arg.Addr:
+ return 6;
+ case Arg.Stack:
+ return 7;
+ case Arg.CallArg:
+ return 8;
+ case Arg.Index:
+ return 9;
+ case Arg.RelCond:
+ return 10;
+ case Arg.ResCond:
+ return 11;
+ case Arg.DoubleCond:
+ return 12;
+ case Arg.Special:
+ return 13;
+ case Arg.WidthArg:
+ return 14;
+ default:
+ throw new Error("Bad kind");
+ }
+ }
+
+ hash()
+ {
+ let result = Arg.kindCode(this._kind);
+
+ switch (this._kind) {
+ case Arg.Invalid:
+ case Arg.Special:
+ break;
+ case Arg.Tmp:
+ result += this._tmp.hash();
+ result |= 0;
+ break;
+ case Arg.Imm:
+ case Arg.BitImm:
+ result += this._value;
+ result |= 0;
+ break;
+ case Arg.BigImm:
+ case Arg.BitImm64:
+ result += this._lowValue;
+ result |= 0;
+ result += this._highValue;
+ result |= 0;
+ break;
+ case Arg.CallArg:
+ result += this._offset;
+ result |= 0;
+ break;
+ case Arg.RelCond:
+ result += relCondCode(this._condition);
+ result |= 0;
+ break;
+ case Arg.ResCond:
+ result += resCondCode(this._condition);
+ result |= 0;
+ break;
+ case Arg.DoubleCond:
+ result += doubleCondCode(this._condition);
+ result |= 0;
+ break;
+ case Arg.WidthArg:
+ result += this._width;
+ result |= 0;
+ break;
+ case Arg.Addr:
+ result += this._offset;
+ result |= 0;
+ result += this._base.hash();
+ result |= 0;
+ break;
+ case Arg.Index:
+ result += this._offset;
+ result |= 0;
+ result += this._scale;
+ result |= 0;
+ result += this._base.hash();
+ result |= 0;
+ result += this._index.hash();
+ result |= 0;
+ break;
+ case Arg.Stack:
+ result += this._offset;
+ result |= 0;
+ result += this.stackSlot.index;
+ result |= 0;
+ break;
+ }
+
+ return result >>> 0;
+ }
+
+ toString()
+ {
+ switch (this._kind) {
+ case Arg.Invalid:
+ return "<invalid>";
+ case Arg.Tmp:
+ return this._tmp.toString();
+ case Arg.Imm:
+ return "$" + this._value;
+ case Arg.BigImm:
+ case Arg.BitImm64:
+ return "$0x" + this._highValue.toString(16) + ":" + this._lowValue.toString(16);
+ case Arg.Addr:
+ return "" + (this._offset ? this._offset : "") + "(" + this._base + ")";
+ case Arg.Index:
+ return "" + (this._offset ? this._offset : "") + "(" + this._base +
+ "," + this._index + (this._scale == 1 ? "" : "," + this._scale) + ")";
+ case Arg.Stack:
+ return "" + (this._offset ? this._offset : "") + "(" + this._slot + ")";
+ case Arg.CallArg:
+ return "" + (this._offset ? this._offset : "") + "(callArg)";
+ case Arg.RelCond:
+ case Arg.ResCond:
+ case Arg.DoubleCond:
+ return symbolName(this._condition);
+ case Arg.Special:
+ return "special";
+ case Arg.Width:
+ return "" + this._value;
+ default:
+ throw new Error("Bad kind");
+ }
+ }
+}
+
+// Arg kinds
+Arg.Invalid = Symbol("Invalid");
+Arg.Tmp = Symbol("Tmp");
+Arg.Imm = Symbol("Imm");
+Arg.BigImm = Symbol("BigImm");
+Arg.BitImm = Symbol("BitImm");
+Arg.BitImm64 = Symbol("BitImm64");
+Arg.Addr = Symbol("Addr");
+Arg.Stack = Symbol("Stack");
+Arg.CallArg = Symbol("CallArg");
+Arg.Index = Symbol("Index");
+Arg.RelCond = Symbol("RelCond");
+Arg.ResCond = Symbol("ResCond");
+Arg.DoubleCond = Symbol("DoubleCond");
+Arg.Special = Symbol("Special");
+Arg.Width = Symbol("Width");
+
+// Arg roles
+Arg.Use = Symbol("Use");
+Arg.ColdUse = Symbol("ColdUse");
+Arg.LateUse = Symbol("LateUse");
+Arg.LateColdUse = Symbol("LateColdUse");
+Arg.Def = Symbol("Def");
+Arg.ZDef = Symbol("ZDef");
+Arg.UseDef = Symbol("UseDef");
+Arg.UseZDef = Symbol("UseZDef");
+Arg.EarlyDef = Symbol("EarlyDef");
+Arg.Scratch = Symbol("Scratch");
+Arg.UseAddr = Symbol("UseAddr");
+
--- /dev/null
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+"use strict";
+
+class BasicBlock {
+ constructor(index, frequency)
+ {
+ this._index = index;
+ this._frequency = frequency;
+ this._insts = [];
+ this._successors = [];
+ this._predecessors = [];
+ }
+
+ get index() { return this._index; }
+ get size() { return this._insts.length; }
+
+ [Symbol.iterator]()
+ {
+ return this._insts[Symbol.iterator]();
+ }
+
+ at(index)
+ {
+ if (index >= this._insts.length)
+ throw new Error("Out of bounds access");
+ return this._insts[index];
+ }
+
+ get(index)
+ {
+ if (index < 0 || index >= this._insts.length)
+ return null;
+ return this._insts[index];
+ }
+
+ get last()
+ {
+ return this._insts[this._insts.length - 1];
+ }
+
+ get insts() { return this._insts; }
+
+ append(inst) { this._insts.push(inst); }
+
+ get numSuccessors() { return this._successors.length; }
+ successor(index) { return this._successors[index]; }
+ get successors() { return this._successors; }
+
+ successorBlock(index) { return this._successors[index].block; }
+ get successorBlocks()
+ {
+ return new Proxy(this._successors, {
+ get(target, property) {
+ if (typeof property == "string"
+ && (property | 0) == property)
+ return target[property].block;
+ return target[property];
+ },
+
+ set(target, property, value) {
+ if (typeof property == "string"
+ && (property | 0) == property) {
+ var oldValue = target[property];
+ target[property] = new FrequentedBlock(
+ value, oldValue ? oldValue.frequency : Normal);
+ return;
+ }
+
+ target[property] = value;
+ }
+ });
+ }
+
+ get numPredecessors() { return this._predecessors.length; }
+ predecessor(index) { return this._predecessors[index]; }
+ get predecessors() { return this._predecessors; }
+
+ get frequency() { return this._frequency; }
+
+ toString()
+ {
+ return "#" + this._index;
+ }
+
+ get headerString()
+ {
+ let result = "";
+ result += `BB${this}: ; frequency = ${this._frequency}\n`;
+ if (this._predecessors.length)
+ result += " Predecessors: " + this._predecessors.join(", ") + "\n";
+ return result;
+ }
+
+ get footerString()
+ {
+ let result = "";
+ if (this._successors.length)
+ result += " Successors: " + this._successors.join(", ") + "\n";
+ return result;
+ }
+
+ toStringDeep()
+ {
+ let result = "";
+ result += this.headerString;
+ for (let inst of this)
+ result += ` ${inst}\n`;
+ result += this.footerString;
+ return result;
+ }
+}
+
--- /dev/null
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+"use strict";
+
+class AirBenchmark {
+ constructor(verbose = 0)
+ {
+ this._verbose = verbose;
+
+ this._payloads = [
+ {generate: createPayloadGbemuExecuteIteration, earlyHash: 632653144, lateHash: 372715518},
+ {generate: createPayloadImagingGaussianBlurGaussianBlur, earlyHash: 3677819581, lateHash: 1252116304},
+ {generate: createPayloadTypescriptScanIdentifier, earlyHash: 1914852601, lateHash: 837339551},
+ {generate: createPayloadAirJSACLj8C, earlyHash: 1373599940, lateHash: 3981283600}
+ ];
+ }
+
+ runIteration()
+ {
+ for (let payload of this._payloads) {
+ // Sadly about 17% of our time is in generate. I don't think that's really avoidable,
+ // and I don't mind testing VMs' ability to run such "data definition" code quickly. I
+ // would not have expected it to be so slow from first principles!
+ let code = payload.generate();
+
+ if (this._verbose) {
+ print("Before allocateStack:");
+ print(code);
+ }
+
+ let hash = code.hash();
+ if (hash != payload.earlyHash)
+ throw new Error(`Wrong early hash for ${payload.generate.name}: ${hash}`);
+
+ allocateStack(code);
+
+ if (this._verbose) {
+ print("After allocateStack:");
+ print(code);
+ }
+
+ hash = code.hash();
+ if (hash != payload.lateHash)
+ throw new Error(`Wrong late hash for ${payload.generate.name}: ${hash}`);
+ }
+ }
+}
+
+function runBenchmark()
+{
+ const verbose = 0;
+ const numIterations = 150;
+
+ let before = currentTime();
+
+ let benchmark = new AirBenchmark(verbose);
+
+ for (let iteration = 0; iteration < numIterations; ++iteration)
+ benchmark.runIteration();
+
+ let after = currentTime();
+ return after - before;
+}
--- /dev/null
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+"use strict";
+
+class Code {
+ constructor()
+ {
+ this._blocks = [];
+ this._stackSlots = [];
+ this._gpTmps = [];
+ this._fpTmps = [];
+ this._callArgAreaSize = 0;
+ this._frameSize = 0;
+ }
+
+ addBlock(frequency = 1)
+ {
+ return addIndexed(this._blocks, BasicBlock, frequency);
+ }
+
+ addStackSlot(byteSize, kind)
+ {
+ return addIndexed(this._stackSlots, StackSlot, byteSize, kind);
+ }
+
+ newTmp(type)
+ {
+ return addIndexed(this[`_${lowerSymbolName(type)}Tmps`], Tmp, type);
+ }
+
+ get size() { return this._blocks.length; }
+ at(index) { return this._blocks[index]; }
+
+ [Symbol.iterator]()
+ {
+ return this._blocks[Symbol.iterator]();
+ }
+
+ get blocks() { return this._blocks; }
+ get stackSlots() { return this._stackSlots; }
+
+ tmps(type) { return this[`_${lowerSymbolName(type)}Tmps`]; }
+
+ get callArgAreaSize() { return this._callArgAreaSize; }
+
+ requestCallArgAreaSize(size)
+ {
+ this._callArgAreaSize = Math.max(this._callArgAreaSize, roundUpToMultipleOf(stackAlignmentBytes, size));
+ }
+
+ get frameSize() { return this._frameSize; }
+
+ setFrameSize(frameSize) { this._frameSize = frameSize; }
+
+ hash()
+ {
+ let result = 0;
+ for (let block of this) {
+ result *= 1000001;
+ result |= 0;
+ for (let inst of block) {
+ result *= 97;
+ result |= 0;
+ result += inst.hash();
+ result |= 0;
+ }
+ for (let successor of block.successorBlocks) {
+ result *= 7;
+ result |= 0;
+ result += successor.index;
+ result |= 0;
+ }
+ }
+ for (let slot of this.stackSlots) {
+ result *= 101;
+ result |= 0;
+ result += slot.hash();
+ result |= 0;
+ }
+ return result >>> 0;
+ }
+
+ toString()
+ {
+ let result = "";
+ for (let block of this) {
+ result += block.toStringDeep();
+ }
+ if (this.stackSlots.length) {
+ result += "Stack slots:\n";
+ for (let slot of this.stackSlots)
+ result += ` ${slot}\n`;
+ }
+ if (this._frameSize)
+ result += `Frame size: ${this._frameSize}\n`;
+ if (this._callArgAreaSize)
+ result += `Call arg area size: ${this._callArgAreaSize}\n`;
+ return result;
+ }
+}
--- /dev/null
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+"use strict";
+
+const ShuffleCustom = {
+ forEachArg(inst, func)
+ {
+ var limit = Math.floor(inst.args.length / 3) * 3;
+ for (let i = 0; i < limit; i += 3) {
+ let src = inst.args[i + 0];
+ let dst = inst.args[i + 1];
+ let widthArg = inst.args[i + 2];
+ let width = widthArg.width;
+ let type = src.isGP && dst.isGP ? GP : FP;
+ inst.visitArg(i + 0, func, Arg.Use, type, width);
+ inst.visitArg(i + 1, func, Arg.Def, type, width);
+ inst.visitArg(i + 2, func, Arg.Use, GP, 8);
+ }
+ },
+
+ hasNonArgNonControlEffects(inst)
+ {
+ return false;
+ }
+};
+
+const PatchCustom = {
+ forEachArg(inst, func)
+ {
+ for (let i = 0; i < inst.args.length; ++i) {
+ let {type, role, width} = inst.patchArgData[i];
+ inst.visitArg(i, func, role, type, width);
+ }
+ },
+
+ hasNonArgNonControlEffects(inst)
+ {
+ return inst.patchHasNonArgEffects;
+ }
+};
+
+const CCallCustom = {
+ forEachArg(inst, func)
+ {
+ let index = 0;
+ inst.visitArg(index++, func, Arg.Use, GP, Ptr); // callee
+
+ if (inst.cCallType != Void) {
+ inst.visitArg(
+ index++, func, Arg.Def, Arg.typeForB3Type(inst.cCallType),
+ Arg.widthForB3Type(inst.cCallType));
+ }
+
+ for (let type of inst.cCallArgTypes) {
+ inst.visitArg(
+ index++, func, Arg.Use, Arg.typeForB3Type(type), Arg.widthForB3Type(type));
+ }
+ },
+
+ hasNonArgNonControlEffects(inst)
+ {
+ return true;
+ }
+};
+
+const ColdCCallCustom = {
+ forEachArg(inst, func)
+ {
+ CCallCustom.forEachArg(
+ inst,
+ (arg, role, type, width) => {
+ return func(arg, Arg.cooled(role), type, width);
+ });
+ },
+
+ hasNonArgNonControlEffects(inst)
+ {
+ return true;
+ }
+};
+
--- /dev/null
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+"use strict";
+
+class FrequentedBlock {
+ constructor(block, frequency)
+ {
+ this.block = block;
+ this.frequency = frequency;
+ }
+
+ toString()
+ {
+ return (this.frequency == Normal ? "" : "Rare:") + this.block;
+ }
+}
--- /dev/null
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+"use strict";
+
+class Insertion {
+ constructor(index, element)
+ {
+ this._index = index;
+ this._element = element;
+ }
+
+ get index() { return this._index; }
+ get element() { return this._element; }
+
+ lessThan(other)
+ {
+ return this._index < other._index;
+ }
+}
+
+class InsertionSet {
+ constructor()
+ {
+ this._insertions = []
+ }
+
+ appendInsertion(insertion)
+ {
+ this._insertions.push(insertion);
+ }
+
+ append(index, element)
+ {
+ this.appendInsertion(new Insertion(index, element));
+ }
+
+ execute(target)
+ {
+ // We bubble-sort because that's what the C++ code, and for the same reason as we do it:
+ // the stdlib doesn't have a stable sort and mergesort is slower in the common case of the
+ // array usually being sorted. This array is usually sorted.
+ bubbleSort(this._insertions, (a, b) => (a.lessThan(b)));
+
+ let numInsertions = this._insertions.length;
+ if (!numInsertions)
+ return 0;
+ let originalTargetSize = target.length;
+ target.length += numInsertions;
+ let lastIndex = target.length;
+ for (let indexInInsertions = numInsertions; indexInInsertions--;) {
+ let insertion = this._insertions[indexInInsertions];
+ if (indexInInsertions && insertion.index < this._insertions[indexInInsertions - 1].index)
+ throw new Error("Insertions out of order");
+ if (insertion.index > originalTargetSize)
+ throw new Error("Out-of-bounds insertion");
+ let firstIndex = insertion.index + indexInInsertions;
+ let indexOffset = indexInInsertions + 1;
+ for (let i = lastIndex; --i > firstIndex;)
+ target[i] = target[i - indexOffset];
+ target[firstIndex] = insertion.element;
+ lastIndex = firstIndex;
+ }
+ this._insertions = [];
+ return numInsertions;
+ }
+}
+
--- /dev/null
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+"use strict";
+
+class Inst {
+ constructor(opcode, args = [])
+ {
+ this._opcode = opcode;
+ this._args = args;
+ }
+
+ append(...args)
+ {
+ this._args.push(...args);
+ }
+
+ clear()
+ {
+ this._opcode = Nop;
+ this._args = [];
+ }
+
+ get opcode() { return this._opcode; }
+ get args() { return this._args; }
+
+ visitArg(index, func, ...args)
+ {
+ let replacement = func(this._args[index], ...args);
+ if (replacement)
+ this._args[index] = replacement;
+ }
+
+ forEachTmpFast(func)
+ {
+ for (let i = 0; i < this._args.length; ++i) {
+ let replacement;
+ if (replacement = this._args[i].forEachTmpFast(func))
+ this._args[i] = replacement;
+ }
+ }
+
+ forEachArg(func)
+ {
+ Inst_forEachArg(this, func);
+ }
+
+ forEachTmp(func)
+ {
+ this.forEachArg((arg, role, type, width) => {
+ return arg.forEachTmp(role, type, width, func);
+ });
+ }
+
+ forEach(thing, func)
+ {
+ this.forEachArg((arg, role, type, width) => {
+ return arg.forEach(thing, role, type, width, func);
+ });
+ }
+
+ static forEachDef(thing, prevInst, nextInst, func)
+ {
+ if (prevInst) {
+ prevInst.forEach(
+ thing,
+ (value, role, type, width) => {
+ if (Arg.isLateDef(role))
+ return func(value, role, type, width);
+ });
+ }
+
+ if (nextInst) {
+ nextInst.forEach(
+ thing,
+ (value, role, type, width) => {
+ if (Arg.isEarlyDef(role))
+ return func(value, role, type, width);
+ });
+ }
+ }
+
+ static forEachDefWithExtraClobberedRegs(thing, prevInst, nextInst, func)
+ {
+ forEachDef(thing, prevInst, nextInst, func);
+
+ let regDefRole;
+
+ let reportReg = reg => {
+ let type = reg.isGPR ? GP : FP;
+ func(thing.fromReg(reg), regDefRole, type, Arg.conservativeWidth(type));
+ };
+
+ if (prevInst && prevInst.opcode == Patch) {
+ regDefRole = Arg.Def;
+ prevInst.extraClobberedRegs.forEach(reportReg);
+ }
+
+ if (nextInst && nextInst.opcode == Patch) {
+ regDefRole = Arg.EarlyDef;
+ nextInst.extraEarlyClobberedRegs.forEach(reportReg);
+ }
+ }
+
+ get hasNonArgEffects() { return Inst_hasNonArgEffects(this); }
+
+ hash()
+ {
+ let result = opcodeCode(this.opcode);
+ for (let arg of this.args) {
+ result += arg.hash();
+ result |= 0;
+ }
+ return result >>> 0;
+ }
+
+ toString()
+ {
+ return "" + symbolName(this._opcode) + " " + this._args.join(", ");
+ }
+}
+
--- /dev/null
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+"use strict";
+
+class Liveness {
+ constructor(thing, code)
+ {
+ this._thing = thing;
+ this._code = code;
+
+ this._liveAtHead = new Map();
+ this._liveAtTail = new Map();
+
+ for (let block of code) {
+ this._liveAtHead.set(block, new Set());
+
+ let liveAtTail = new Set();
+ this._liveAtTail.set(block, liveAtTail);
+
+ block.last.forEach(
+ thing,
+ (value, role, type, width) => {
+ if (Arg.isLateUse(role))
+ liveAtTail.add(value);
+ });
+ }
+
+ let dirtyBlocks = new Set(code);
+
+ let changed;
+ do {
+ changed = false;
+
+ for (let blockIndex = code.size; blockIndex--;) {
+ let block = code.at(blockIndex);
+ if (!block)
+ continue;
+
+ if (!dirtyBlocks.delete(block))
+ continue;
+
+ let localCalc = this.localCalc(block);
+ for (let instIndex = block.size; instIndex--;)
+ localCalc.execute(instIndex);
+
+ // Handle the early def's of the first instruction.
+ block.at(0).forEach(
+ thing,
+ (value, role, type, width) => {
+ if (Arg.isEarlyDef(role))
+ localCalc.liveSet.remove(value);
+ });
+
+ let liveAtHead = this._liveAtHead.get(block);
+
+ if (!mergeIntoSet(liveAtHead, localCalc.liveSet))
+ continue;
+
+ for (let predecessor of block.predecessors) {
+ if (mergeIntoSet(this._liveAtTail.get(predecessor), liveAtHead)) {
+ dirtyBlocks.add(predecessor);
+ changed = true;
+ }
+ }
+ }
+ } while (changed);
+ }
+
+ get thing() { return this._thing; }
+ get code() { return this._code; }
+ get liveAtHead() { return this._liveAtHead; }
+ get liveAtTail() { return this._liveAtTail; }
+
+ localCalc(block)
+ {
+ let liveness = this;
+ class LocalCalc {
+ constructor()
+ {
+ this._liveSet = new Set(liveness.liveAtTail.get(block));
+ }
+
+ get liveSet() { return this._liveSet; }
+
+ execute(instIndex)
+ {
+ let inst = block.at(instIndex);
+
+ // First handle the early defs of the next instruction.
+ if (instIndex + 1 < block.size) {
+ block.at(instIndex + 1).forEach(
+ liveness.thing,
+ (value, role, type, width) => {
+ if (Arg.isEarlyDef(role))
+ this._liveSet.delete(value);
+ });
+ }
+
+ // Then handle defs.
+ inst.forEach(
+ liveness.thing,
+ (value, role, type, width) => {
+ if (Arg.isLateDef(role))
+ this._liveSet.delete(value);
+ });
+
+ // Then handle uses.
+ inst.forEach(
+ liveness.thing,
+ (value, role, type, width) => {
+ if (Arg.isEarlyUse(role))
+ this._liveSet.add(value);
+ });
+
+ // Finally handle the late uses of the previous instruction.
+ if (instIndex - 1 >= 0) {
+ block.at(instIndex - 1).forEach(
+ liveness.thing,
+ (value, role, type, width) => {
+ if (Arg.isLateUse(role))
+ this._liveSet.add(value);
+ });
+ }
+ }
+ }
+
+ return new LocalCalc();
+ }
+}
+
--- /dev/null
+#!/bin/sh
+
+set -e
+set -x
+
+MARKDOWN="perl $HOME/Documents/Markdown.pl"
+
+rm -rf Air.js
+mkdir Air.js
+${MARKDOWN} < README.md > Air.js/index.html
+cp \
+ all.js \
+ allocate_stack.js \
+ arg.js \
+ basic_block.js \
+ benchmark.js \
+ code.js \
+ custom.js \
+ frequented_block.js \
+ insertion_set.js \
+ inst.js \
+ liveness.js \
+ opcode.js \
+ payload-airjs-ACLj8C.js \
+ payload-gbemu-executeIteration.js \
+ payload-imaging-gaussian-blur-gaussianBlur.js \
+ payload-typescript-scanIdentifier.js \
+ reg.js \
+ stack_slot.js \
+ symbols.js \
+ test.html \
+ test.js \
+ tmp.js \
+ tmp_base.js \
+ util.js \
+ Air.js/
+
+tar -czvf Air.js.tar.gz Air.js
+
--- /dev/null
+"use strict";
+// Generated by opcode_generator.rb from JavaScriptCore/b3/air/AirOpcode.opcodes -- do not edit!
+const Nop = Symbol("Nop");
+const Add32 = Symbol("Add32");
+const Add8 = Symbol("Add8");
+const Add16 = Symbol("Add16");
+const Add64 = Symbol("Add64");
+const AddDouble = Symbol("AddDouble");
+const AddFloat = Symbol("AddFloat");
+const Sub32 = Symbol("Sub32");
+const Sub64 = Symbol("Sub64");
+const SubDouble = Symbol("SubDouble");
+const SubFloat = Symbol("SubFloat");
+const Neg32 = Symbol("Neg32");
+const Neg64 = Symbol("Neg64");
+const NegateDouble = Symbol("NegateDouble");
+const Mul32 = Symbol("Mul32");
+const Mul64 = Symbol("Mul64");
+const MultiplyAdd32 = Symbol("MultiplyAdd32");
+const MultiplyAdd64 = Symbol("MultiplyAdd64");
+const MultiplySub32 = Symbol("MultiplySub32");
+const MultiplySub64 = Symbol("MultiplySub64");
+const MultiplyNeg32 = Symbol("MultiplyNeg32");
+const MultiplyNeg64 = Symbol("MultiplyNeg64");
+const Div32 = Symbol("Div32");
+const Div64 = Symbol("Div64");
+const MulDouble = Symbol("MulDouble");
+const MulFloat = Symbol("MulFloat");
+const DivDouble = Symbol("DivDouble");
+const DivFloat = Symbol("DivFloat");
+const X86ConvertToDoubleWord32 = Symbol("X86ConvertToDoubleWord32");
+const X86ConvertToQuadWord64 = Symbol("X86ConvertToQuadWord64");
+const X86Div32 = Symbol("X86Div32");
+const X86Div64 = Symbol("X86Div64");
+const Lea = Symbol("Lea");
+const And32 = Symbol("And32");
+const And64 = Symbol("And64");
+const AndDouble = Symbol("AndDouble");
+const AndFloat = Symbol("AndFloat");
+const XorDouble = Symbol("XorDouble");
+const XorFloat = Symbol("XorFloat");
+const Lshift32 = Symbol("Lshift32");
+const Lshift64 = Symbol("Lshift64");
+const Rshift32 = Symbol("Rshift32");
+const Rshift64 = Symbol("Rshift64");
+const Urshift32 = Symbol("Urshift32");
+const Urshift64 = Symbol("Urshift64");
+const Or32 = Symbol("Or32");
+const Or64 = Symbol("Or64");
+const Xor32 = Symbol("Xor32");
+const Xor64 = Symbol("Xor64");
+const Not32 = Symbol("Not32");
+const Not64 = Symbol("Not64");
+const AbsDouble = Symbol("AbsDouble");
+const AbsFloat = Symbol("AbsFloat");
+const CeilDouble = Symbol("CeilDouble");
+const CeilFloat = Symbol("CeilFloat");
+const FloorDouble = Symbol("FloorDouble");
+const FloorFloat = Symbol("FloorFloat");
+const SqrtDouble = Symbol("SqrtDouble");
+const SqrtFloat = Symbol("SqrtFloat");
+const ConvertInt32ToDouble = Symbol("ConvertInt32ToDouble");
+const ConvertInt64ToDouble = Symbol("ConvertInt64ToDouble");
+const ConvertInt32ToFloat = Symbol("ConvertInt32ToFloat");
+const ConvertInt64ToFloat = Symbol("ConvertInt64ToFloat");
+const CountLeadingZeros32 = Symbol("CountLeadingZeros32");
+const CountLeadingZeros64 = Symbol("CountLeadingZeros64");
+const ConvertDoubleToFloat = Symbol("ConvertDoubleToFloat");
+const ConvertFloatToDouble = Symbol("ConvertFloatToDouble");
+const Move = Symbol("Move");
+const Swap32 = Symbol("Swap32");
+const Swap64 = Symbol("Swap64");
+const Move32 = Symbol("Move32");
+const StoreZero32 = Symbol("StoreZero32");
+const SignExtend32ToPtr = Symbol("SignExtend32ToPtr");
+const ZeroExtend8To32 = Symbol("ZeroExtend8To32");
+const SignExtend8To32 = Symbol("SignExtend8To32");
+const ZeroExtend16To32 = Symbol("ZeroExtend16To32");
+const SignExtend16To32 = Symbol("SignExtend16To32");
+const MoveFloat = Symbol("MoveFloat");
+const MoveDouble = Symbol("MoveDouble");
+const MoveZeroToDouble = Symbol("MoveZeroToDouble");
+const Move64ToDouble = Symbol("Move64ToDouble");
+const Move32ToFloat = Symbol("Move32ToFloat");
+const MoveDoubleTo64 = Symbol("MoveDoubleTo64");
+const MoveFloatTo32 = Symbol("MoveFloatTo32");
+const Load8 = Symbol("Load8");
+const Store8 = Symbol("Store8");
+const Load8SignedExtendTo32 = Symbol("Load8SignedExtendTo32");
+const Load16 = Symbol("Load16");
+const Load16SignedExtendTo32 = Symbol("Load16SignedExtendTo32");
+const Store16 = Symbol("Store16");
+const Compare32 = Symbol("Compare32");
+const Compare64 = Symbol("Compare64");
+const Test32 = Symbol("Test32");
+const Test64 = Symbol("Test64");
+const CompareDouble = Symbol("CompareDouble");
+const CompareFloat = Symbol("CompareFloat");
+const Branch8 = Symbol("Branch8");
+const Branch32 = Symbol("Branch32");
+const Branch64 = Symbol("Branch64");
+const BranchTest8 = Symbol("BranchTest8");
+const BranchTest32 = Symbol("BranchTest32");
+const BranchTest64 = Symbol("BranchTest64");
+const BranchDouble = Symbol("BranchDouble");
+const BranchFloat = Symbol("BranchFloat");
+const BranchAdd32 = Symbol("BranchAdd32");
+const BranchAdd64 = Symbol("BranchAdd64");
+const BranchMul32 = Symbol("BranchMul32");
+const BranchMul64 = Symbol("BranchMul64");
+const BranchSub32 = Symbol("BranchSub32");
+const BranchSub64 = Symbol("BranchSub64");
+const BranchNeg32 = Symbol("BranchNeg32");
+const BranchNeg64 = Symbol("BranchNeg64");
+const MoveConditionally32 = Symbol("MoveConditionally32");
+const MoveConditionally64 = Symbol("MoveConditionally64");
+const MoveConditionallyTest32 = Symbol("MoveConditionallyTest32");
+const MoveConditionallyTest64 = Symbol("MoveConditionallyTest64");
+const MoveConditionallyDouble = Symbol("MoveConditionallyDouble");
+const MoveConditionallyFloat = Symbol("MoveConditionallyFloat");
+const MoveDoubleConditionally32 = Symbol("MoveDoubleConditionally32");
+const MoveDoubleConditionally64 = Symbol("MoveDoubleConditionally64");
+const MoveDoubleConditionallyTest32 = Symbol("MoveDoubleConditionallyTest32");
+const MoveDoubleConditionallyTest64 = Symbol("MoveDoubleConditionallyTest64");
+const MoveDoubleConditionallyDouble = Symbol("MoveDoubleConditionallyDouble");
+const MoveDoubleConditionallyFloat = Symbol("MoveDoubleConditionallyFloat");
+const Jump = Symbol("Jump");
+const Ret32 = Symbol("Ret32");
+const Ret64 = Symbol("Ret64");
+const RetFloat = Symbol("RetFloat");
+const RetDouble = Symbol("RetDouble");
+const Oops = Symbol("Oops");
+const Shuffle = Symbol("Shuffle");
+const Patch = Symbol("Patch");
+const CCall = Symbol("CCall");
+const ColdCCall = Symbol("ColdCCall");
+function Inst_forEachArg(inst, func)
+{
+ let replacement;
+ switch (inst.opcode) {
+ case Nop:
+ break;
+ break;
+ case Add32:
+ switch (inst.args.length) {
+ case 3:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 32);
+ inst.visitArg(2, func, Arg.ZDef, GP, 32);
+ break;
+ case 2:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.UseZDef, GP, 32);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case Add8:
+ inst.visitArg(0, func, Arg.Use, GP, 8);
+ inst.visitArg(1, func, Arg.UseDef, GP, 8);
+ break;
+ break;
+ case Add16:
+ inst.visitArg(0, func, Arg.Use, GP, 16);
+ inst.visitArg(1, func, Arg.UseDef, GP, 16);
+ break;
+ break;
+ case Add64:
+ switch (inst.args.length) {
+ case 2:
+ inst.visitArg(0, func, Arg.Use, GP, 64);
+ inst.visitArg(1, func, Arg.UseDef, GP, 64);
+ break;
+ case 3:
+ inst.visitArg(0, func, Arg.Use, GP, 64);
+ inst.visitArg(1, func, Arg.Use, GP, 64);
+ inst.visitArg(2, func, Arg.Def, GP, 64);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case AddDouble:
+ switch (inst.args.length) {
+ case 3:
+ inst.visitArg(0, func, Arg.Use, FP, 64);
+ inst.visitArg(1, func, Arg.Use, FP, 64);
+ inst.visitArg(2, func, Arg.Def, FP, 64);
+ break;
+ case 2:
+ inst.visitArg(0, func, Arg.Use, FP, 64);
+ inst.visitArg(1, func, Arg.UseDef, FP, 64);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case AddFloat:
+ switch (inst.args.length) {
+ case 3:
+ inst.visitArg(0, func, Arg.Use, FP, 32);
+ inst.visitArg(1, func, Arg.Use, FP, 32);
+ inst.visitArg(2, func, Arg.Def, FP, 32);
+ break;
+ case 2:
+ inst.visitArg(0, func, Arg.Use, FP, 32);
+ inst.visitArg(1, func, Arg.UseDef, FP, 32);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case Sub32:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.UseZDef, GP, 32);
+ break;
+ break;
+ case Sub64:
+ inst.visitArg(0, func, Arg.Use, GP, 64);
+ inst.visitArg(1, func, Arg.UseDef, GP, 64);
+ break;
+ break;
+ case SubDouble:
+ switch (inst.args.length) {
+ case 3:
+ inst.visitArg(0, func, Arg.Use, FP, 64);
+ inst.visitArg(1, func, Arg.Use, FP, 64);
+ inst.visitArg(2, func, Arg.Def, FP, 64);
+ break;
+ case 2:
+ inst.visitArg(0, func, Arg.Use, FP, 64);
+ inst.visitArg(1, func, Arg.UseDef, FP, 64);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case SubFloat:
+ switch (inst.args.length) {
+ case 3:
+ inst.visitArg(0, func, Arg.Use, FP, 32);
+ inst.visitArg(1, func, Arg.Use, FP, 32);
+ inst.visitArg(2, func, Arg.Def, FP, 32);
+ break;
+ case 2:
+ inst.visitArg(0, func, Arg.Use, FP, 32);
+ inst.visitArg(1, func, Arg.UseDef, FP, 32);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case Neg32:
+ inst.visitArg(0, func, Arg.UseZDef, GP, 32);
+ break;
+ break;
+ case Neg64:
+ inst.visitArg(0, func, Arg.UseDef, GP, 64);
+ break;
+ break;
+ case NegateDouble:
+ inst.visitArg(0, func, Arg.Use, FP, 64);
+ inst.visitArg(1, func, Arg.Def, FP, 64);
+ break;
+ break;
+ case Mul32:
+ switch (inst.args.length) {
+ case 2:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.UseZDef, GP, 32);
+ break;
+ case 3:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 32);
+ inst.visitArg(2, func, Arg.ZDef, GP, 32);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case Mul64:
+ switch (inst.args.length) {
+ case 2:
+ inst.visitArg(0, func, Arg.Use, GP, 64);
+ inst.visitArg(1, func, Arg.UseDef, GP, 64);
+ break;
+ case 3:
+ inst.visitArg(0, func, Arg.Use, GP, 64);
+ inst.visitArg(1, func, Arg.Use, GP, 64);
+ inst.visitArg(2, func, Arg.Def, GP, 64);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case MultiplyAdd32:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 32);
+ inst.visitArg(2, func, Arg.Use, GP, 32);
+ inst.visitArg(3, func, Arg.ZDef, GP, 32);
+ break;
+ break;
+ case MultiplyAdd64:
+ inst.visitArg(0, func, Arg.Use, GP, 64);
+ inst.visitArg(1, func, Arg.Use, GP, 64);
+ inst.visitArg(2, func, Arg.Use, GP, 64);
+ inst.visitArg(3, func, Arg.Def, GP, 64);
+ break;
+ break;
+ case MultiplySub32:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 32);
+ inst.visitArg(2, func, Arg.Use, GP, 32);
+ inst.visitArg(3, func, Arg.ZDef, GP, 32);
+ break;
+ break;
+ case MultiplySub64:
+ inst.visitArg(0, func, Arg.Use, GP, 64);
+ inst.visitArg(1, func, Arg.Use, GP, 64);
+ inst.visitArg(2, func, Arg.Use, GP, 64);
+ inst.visitArg(3, func, Arg.Def, GP, 64);
+ break;
+ break;
+ case MultiplyNeg32:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 32);
+ inst.visitArg(2, func, Arg.ZDef, GP, 32);
+ break;
+ break;
+ case MultiplyNeg64:
+ inst.visitArg(0, func, Arg.Use, GP, 64);
+ inst.visitArg(1, func, Arg.Use, GP, 64);
+ inst.visitArg(2, func, Arg.ZDef, GP, 64);
+ break;
+ break;
+ case Div32:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 32);
+ inst.visitArg(2, func, Arg.ZDef, GP, 32);
+ break;
+ break;
+ case Div64:
+ inst.visitArg(0, func, Arg.Use, GP, 64);
+ inst.visitArg(1, func, Arg.Use, GP, 64);
+ inst.visitArg(2, func, Arg.Def, GP, 64);
+ break;
+ break;
+ case MulDouble:
+ switch (inst.args.length) {
+ case 3:
+ inst.visitArg(0, func, Arg.Use, FP, 64);
+ inst.visitArg(1, func, Arg.Use, FP, 64);
+ inst.visitArg(2, func, Arg.Def, FP, 64);
+ break;
+ case 2:
+ inst.visitArg(0, func, Arg.Use, FP, 64);
+ inst.visitArg(1, func, Arg.UseDef, FP, 64);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case MulFloat:
+ switch (inst.args.length) {
+ case 3:
+ inst.visitArg(0, func, Arg.Use, FP, 32);
+ inst.visitArg(1, func, Arg.Use, FP, 32);
+ inst.visitArg(2, func, Arg.Def, FP, 32);
+ break;
+ case 2:
+ inst.visitArg(0, func, Arg.Use, FP, 32);
+ inst.visitArg(1, func, Arg.UseDef, FP, 32);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case DivDouble:
+ switch (inst.args.length) {
+ case 3:
+ inst.visitArg(0, func, Arg.Use, FP, 64);
+ inst.visitArg(1, func, Arg.Use, FP, 32);
+ inst.visitArg(2, func, Arg.Def, FP, 64);
+ break;
+ case 2:
+ inst.visitArg(0, func, Arg.Use, FP, 64);
+ inst.visitArg(1, func, Arg.UseDef, FP, 64);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case DivFloat:
+ switch (inst.args.length) {
+ case 3:
+ inst.visitArg(0, func, Arg.Use, FP, 32);
+ inst.visitArg(1, func, Arg.Use, FP, 32);
+ inst.visitArg(2, func, Arg.Def, FP, 32);
+ break;
+ case 2:
+ inst.visitArg(0, func, Arg.Use, FP, 32);
+ inst.visitArg(1, func, Arg.UseDef, FP, 32);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case X86ConvertToDoubleWord32:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.ZDef, GP, 32);
+ break;
+ break;
+ case X86ConvertToQuadWord64:
+ inst.visitArg(0, func, Arg.Use, GP, 64);
+ inst.visitArg(1, func, Arg.Def, GP, 64);
+ break;
+ break;
+ case X86Div32:
+ inst.visitArg(0, func, Arg.UseZDef, GP, 32);
+ inst.visitArg(1, func, Arg.UseZDef, GP, 32);
+ inst.visitArg(2, func, Arg.Use, GP, 32);
+ break;
+ break;
+ case X86Div64:
+ inst.visitArg(0, func, Arg.UseZDef, GP, 64);
+ inst.visitArg(1, func, Arg.UseZDef, GP, 64);
+ inst.visitArg(2, func, Arg.Use, GP, 64);
+ break;
+ break;
+ case Lea:
+ inst.visitArg(0, func, Arg.UseAddr, GP, Ptr);
+ inst.visitArg(1, func, Arg.Def, GP, Ptr);
+ break;
+ break;
+ case And32:
+ switch (inst.args.length) {
+ case 3:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 32);
+ inst.visitArg(2, func, Arg.ZDef, GP, 32);
+ break;
+ case 2:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.UseZDef, GP, 32);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case And64:
+ switch (inst.args.length) {
+ case 3:
+ inst.visitArg(0, func, Arg.Use, GP, 64);
+ inst.visitArg(1, func, Arg.Use, GP, 64);
+ inst.visitArg(2, func, Arg.Def, GP, 64);
+ break;
+ case 2:
+ inst.visitArg(0, func, Arg.Use, GP, 64);
+ inst.visitArg(1, func, Arg.UseDef, GP, 64);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case AndDouble:
+ switch (inst.args.length) {
+ case 3:
+ inst.visitArg(0, func, Arg.Use, FP, 64);
+ inst.visitArg(1, func, Arg.Use, FP, 64);
+ inst.visitArg(2, func, Arg.Def, FP, 64);
+ break;
+ case 2:
+ inst.visitArg(0, func, Arg.Use, FP, 64);
+ inst.visitArg(1, func, Arg.UseDef, FP, 64);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case AndFloat:
+ switch (inst.args.length) {
+ case 3:
+ inst.visitArg(0, func, Arg.Use, FP, 32);
+ inst.visitArg(1, func, Arg.Use, FP, 32);
+ inst.visitArg(2, func, Arg.Def, FP, 32);
+ break;
+ case 2:
+ inst.visitArg(0, func, Arg.Use, FP, 32);
+ inst.visitArg(1, func, Arg.UseDef, FP, 32);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case XorDouble:
+ switch (inst.args.length) {
+ case 3:
+ inst.visitArg(0, func, Arg.Use, FP, 64);
+ inst.visitArg(1, func, Arg.Use, FP, 64);
+ inst.visitArg(2, func, Arg.Def, FP, 64);
+ break;
+ case 2:
+ inst.visitArg(0, func, Arg.Use, FP, 64);
+ inst.visitArg(1, func, Arg.UseDef, FP, 64);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case XorFloat:
+ switch (inst.args.length) {
+ case 3:
+ inst.visitArg(0, func, Arg.Use, FP, 32);
+ inst.visitArg(1, func, Arg.Use, FP, 32);
+ inst.visitArg(2, func, Arg.Def, FP, 32);
+ break;
+ case 2:
+ inst.visitArg(0, func, Arg.Use, FP, 32);
+ inst.visitArg(1, func, Arg.UseDef, FP, 32);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case Lshift32:
+ switch (inst.args.length) {
+ case 3:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 32);
+ inst.visitArg(2, func, Arg.ZDef, GP, 32);
+ break;
+ case 2:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.UseZDef, GP, 32);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case Lshift64:
+ switch (inst.args.length) {
+ case 3:
+ inst.visitArg(0, func, Arg.Use, GP, 64);
+ inst.visitArg(1, func, Arg.Use, GP, 64);
+ inst.visitArg(2, func, Arg.ZDef, GP, 64);
+ break;
+ case 2:
+ inst.visitArg(0, func, Arg.Use, GP, 64);
+ inst.visitArg(1, func, Arg.UseDef, GP, 64);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case Rshift32:
+ switch (inst.args.length) {
+ case 3:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 32);
+ inst.visitArg(2, func, Arg.ZDef, GP, 32);
+ break;
+ case 2:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.UseZDef, GP, 32);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case Rshift64:
+ switch (inst.args.length) {
+ case 3:
+ inst.visitArg(0, func, Arg.Use, GP, 64);
+ inst.visitArg(1, func, Arg.Use, GP, 64);
+ inst.visitArg(2, func, Arg.ZDef, GP, 64);
+ break;
+ case 2:
+ inst.visitArg(0, func, Arg.Use, GP, 64);
+ inst.visitArg(1, func, Arg.UseDef, GP, 64);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case Urshift32:
+ switch (inst.args.length) {
+ case 3:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 32);
+ inst.visitArg(2, func, Arg.ZDef, GP, 32);
+ break;
+ case 2:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.UseZDef, GP, 32);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case Urshift64:
+ switch (inst.args.length) {
+ case 3:
+ inst.visitArg(0, func, Arg.Use, GP, 64);
+ inst.visitArg(1, func, Arg.Use, GP, 64);
+ inst.visitArg(2, func, Arg.ZDef, GP, 64);
+ break;
+ case 2:
+ inst.visitArg(0, func, Arg.Use, GP, 64);
+ inst.visitArg(1, func, Arg.UseDef, GP, 64);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case Or32:
+ switch (inst.args.length) {
+ case 3:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 32);
+ inst.visitArg(2, func, Arg.ZDef, GP, 32);
+ break;
+ case 2:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.UseZDef, GP, 32);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case Or64:
+ switch (inst.args.length) {
+ case 3:
+ inst.visitArg(0, func, Arg.Use, GP, 64);
+ inst.visitArg(1, func, Arg.Use, GP, 64);
+ inst.visitArg(2, func, Arg.Def, GP, 64);
+ break;
+ case 2:
+ inst.visitArg(0, func, Arg.Use, GP, 64);
+ inst.visitArg(1, func, Arg.UseDef, GP, 64);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case Xor32:
+ switch (inst.args.length) {
+ case 3:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 32);
+ inst.visitArg(2, func, Arg.ZDef, GP, 32);
+ break;
+ case 2:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.UseZDef, GP, 32);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case Xor64:
+ switch (inst.args.length) {
+ case 3:
+ inst.visitArg(0, func, Arg.Use, GP, 64);
+ inst.visitArg(1, func, Arg.Use, GP, 64);
+ inst.visitArg(2, func, Arg.Def, GP, 64);
+ break;
+ case 2:
+ inst.visitArg(0, func, Arg.Use, GP, 64);
+ inst.visitArg(1, func, Arg.UseDef, GP, 64);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case Not32:
+ switch (inst.args.length) {
+ case 2:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.ZDef, GP, 32);
+ break;
+ case 1:
+ inst.visitArg(0, func, Arg.UseZDef, GP, 32);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case Not64:
+ switch (inst.args.length) {
+ case 2:
+ inst.visitArg(0, func, Arg.Use, GP, 64);
+ inst.visitArg(1, func, Arg.Def, GP, 64);
+ break;
+ case 1:
+ inst.visitArg(0, func, Arg.UseDef, GP, 64);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case AbsDouble:
+ inst.visitArg(0, func, Arg.Use, FP, 64);
+ inst.visitArg(1, func, Arg.Def, FP, 64);
+ break;
+ break;
+ case AbsFloat:
+ inst.visitArg(0, func, Arg.Use, FP, 32);
+ inst.visitArg(1, func, Arg.Def, FP, 32);
+ break;
+ break;
+ case CeilDouble:
+ inst.visitArg(0, func, Arg.Use, FP, 64);
+ inst.visitArg(1, func, Arg.Def, FP, 64);
+ break;
+ break;
+ case CeilFloat:
+ inst.visitArg(0, func, Arg.Use, FP, 32);
+ inst.visitArg(1, func, Arg.Def, FP, 32);
+ break;
+ break;
+ case FloorDouble:
+ inst.visitArg(0, func, Arg.Use, FP, 64);
+ inst.visitArg(1, func, Arg.Def, FP, 64);
+ break;
+ break;
+ case FloorFloat:
+ inst.visitArg(0, func, Arg.Use, FP, 32);
+ inst.visitArg(1, func, Arg.Def, FP, 32);
+ break;
+ break;
+ case SqrtDouble:
+ inst.visitArg(0, func, Arg.Use, FP, 64);
+ inst.visitArg(1, func, Arg.Def, FP, 64);
+ break;
+ break;
+ case SqrtFloat:
+ inst.visitArg(0, func, Arg.Use, FP, 32);
+ inst.visitArg(1, func, Arg.Def, FP, 32);
+ break;
+ break;
+ case ConvertInt32ToDouble:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Def, FP, 64);
+ break;
+ break;
+ case ConvertInt64ToDouble:
+ inst.visitArg(0, func, Arg.Use, GP, 64);
+ inst.visitArg(1, func, Arg.Def, FP, 64);
+ break;
+ break;
+ case ConvertInt32ToFloat:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Def, FP, 32);
+ break;
+ break;
+ case ConvertInt64ToFloat:
+ inst.visitArg(0, func, Arg.Use, GP, 64);
+ inst.visitArg(1, func, Arg.Def, FP, 32);
+ break;
+ break;
+ case CountLeadingZeros32:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.ZDef, GP, 32);
+ break;
+ break;
+ case CountLeadingZeros64:
+ inst.visitArg(0, func, Arg.Use, GP, 64);
+ inst.visitArg(1, func, Arg.Def, GP, 64);
+ break;
+ break;
+ case ConvertDoubleToFloat:
+ inst.visitArg(0, func, Arg.Use, FP, 64);
+ inst.visitArg(1, func, Arg.Def, FP, 32);
+ break;
+ break;
+ case ConvertFloatToDouble:
+ inst.visitArg(0, func, Arg.Use, FP, 32);
+ inst.visitArg(1, func, Arg.Def, FP, 64);
+ break;
+ break;
+ case Move:
+ inst.visitArg(0, func, Arg.Use, GP, Ptr);
+ inst.visitArg(1, func, Arg.Def, GP, Ptr);
+ break;
+ break;
+ case Swap32:
+ inst.visitArg(0, func, Arg.UseDef, GP, 32);
+ inst.visitArg(1, func, Arg.UseDef, GP, 32);
+ break;
+ break;
+ case Swap64:
+ inst.visitArg(0, func, Arg.UseDef, GP, 64);
+ inst.visitArg(1, func, Arg.UseDef, GP, 64);
+ break;
+ break;
+ case Move32:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.ZDef, GP, 32);
+ break;
+ break;
+ case StoreZero32:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ break;
+ break;
+ case SignExtend32ToPtr:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Def, GP, Ptr);
+ break;
+ break;
+ case ZeroExtend8To32:
+ inst.visitArg(0, func, Arg.Use, GP, 8);
+ inst.visitArg(1, func, Arg.ZDef, GP, 32);
+ break;
+ break;
+ case SignExtend8To32:
+ inst.visitArg(0, func, Arg.Use, GP, 8);
+ inst.visitArg(1, func, Arg.ZDef, GP, 32);
+ break;
+ break;
+ case ZeroExtend16To32:
+ inst.visitArg(0, func, Arg.Use, GP, 16);
+ inst.visitArg(1, func, Arg.ZDef, GP, 32);
+ break;
+ break;
+ case SignExtend16To32:
+ inst.visitArg(0, func, Arg.Use, GP, 16);
+ inst.visitArg(1, func, Arg.ZDef, GP, 32);
+ break;
+ break;
+ case MoveFloat:
+ inst.visitArg(0, func, Arg.Use, FP, 32);
+ inst.visitArg(1, func, Arg.Def, FP, 32);
+ break;
+ break;
+ case MoveDouble:
+ inst.visitArg(0, func, Arg.Use, FP, 64);
+ inst.visitArg(1, func, Arg.Def, FP, 64);
+ break;
+ break;
+ case MoveZeroToDouble:
+ inst.visitArg(0, func, Arg.Def, FP, 64);
+ break;
+ break;
+ case Move64ToDouble:
+ inst.visitArg(0, func, Arg.Use, GP, 64);
+ inst.visitArg(1, func, Arg.Def, FP, 64);
+ break;
+ break;
+ case Move32ToFloat:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Def, FP, 32);
+ break;
+ break;
+ case MoveDoubleTo64:
+ inst.visitArg(0, func, Arg.Use, FP, 64);
+ inst.visitArg(1, func, Arg.Def, GP, 64);
+ break;
+ break;
+ case MoveFloatTo32:
+ inst.visitArg(0, func, Arg.Use, FP, 32);
+ inst.visitArg(1, func, Arg.Def, GP, 32);
+ break;
+ break;
+ case Load8:
+ inst.visitArg(0, func, Arg.Use, GP, 8);
+ inst.visitArg(1, func, Arg.ZDef, GP, 32);
+ break;
+ break;
+ case Store8:
+ inst.visitArg(0, func, Arg.Use, GP, 8);
+ inst.visitArg(1, func, Arg.Def, GP, 8);
+ break;
+ break;
+ case Load8SignedExtendTo32:
+ inst.visitArg(0, func, Arg.Use, GP, 8);
+ inst.visitArg(1, func, Arg.ZDef, GP, 32);
+ break;
+ break;
+ case Load16:
+ inst.visitArg(0, func, Arg.Use, GP, 16);
+ inst.visitArg(1, func, Arg.ZDef, GP, 32);
+ break;
+ break;
+ case Load16SignedExtendTo32:
+ inst.visitArg(0, func, Arg.Use, GP, 16);
+ inst.visitArg(1, func, Arg.ZDef, GP, 32);
+ break;
+ break;
+ case Store16:
+ inst.visitArg(0, func, Arg.Use, GP, 16);
+ inst.visitArg(1, func, Arg.Def, GP, 16);
+ break;
+ break;
+ case Compare32:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 32);
+ inst.visitArg(2, func, Arg.Use, GP, 32);
+ inst.visitArg(3, func, Arg.ZDef, GP, 32);
+ break;
+ break;
+ case Compare64:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 64);
+ inst.visitArg(2, func, Arg.Use, GP, 64);
+ inst.visitArg(3, func, Arg.ZDef, GP, 32);
+ break;
+ break;
+ case Test32:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 32);
+ inst.visitArg(2, func, Arg.Use, GP, 32);
+ inst.visitArg(3, func, Arg.ZDef, GP, 32);
+ break;
+ break;
+ case Test64:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 64);
+ inst.visitArg(2, func, Arg.Use, GP, 64);
+ inst.visitArg(3, func, Arg.ZDef, GP, 32);
+ break;
+ break;
+ case CompareDouble:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, FP, 64);
+ inst.visitArg(2, func, Arg.Use, FP, 64);
+ inst.visitArg(3, func, Arg.ZDef, GP, 32);
+ break;
+ break;
+ case CompareFloat:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, FP, 32);
+ inst.visitArg(2, func, Arg.Use, FP, 32);
+ inst.visitArg(3, func, Arg.ZDef, GP, 32);
+ break;
+ break;
+ case Branch8:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 8);
+ inst.visitArg(2, func, Arg.Use, GP, 8);
+ break;
+ break;
+ case Branch32:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 32);
+ inst.visitArg(2, func, Arg.Use, GP, 32);
+ break;
+ break;
+ case Branch64:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 64);
+ inst.visitArg(2, func, Arg.Use, GP, 64);
+ break;
+ break;
+ case BranchTest8:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 8);
+ inst.visitArg(2, func, Arg.Use, GP, 8);
+ break;
+ break;
+ case BranchTest32:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 32);
+ inst.visitArg(2, func, Arg.Use, GP, 32);
+ break;
+ break;
+ case BranchTest64:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 64);
+ inst.visitArg(2, func, Arg.Use, GP, 64);
+ break;
+ break;
+ case BranchDouble:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, FP, 64);
+ inst.visitArg(2, func, Arg.Use, FP, 64);
+ break;
+ break;
+ case BranchFloat:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, FP, 32);
+ inst.visitArg(2, func, Arg.Use, FP, 32);
+ break;
+ break;
+ case BranchAdd32:
+ switch (inst.args.length) {
+ case 4:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 32);
+ inst.visitArg(2, func, Arg.Use, GP, 32);
+ inst.visitArg(3, func, Arg.ZDef, GP, 32);
+ break;
+ case 3:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 32);
+ inst.visitArg(2, func, Arg.UseZDef, GP, 32);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case BranchAdd64:
+ switch (inst.args.length) {
+ case 4:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 64);
+ inst.visitArg(2, func, Arg.Use, GP, 64);
+ inst.visitArg(3, func, Arg.ZDef, GP, 64);
+ break;
+ case 3:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 64);
+ inst.visitArg(2, func, Arg.UseDef, GP, 64);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case BranchMul32:
+ switch (inst.args.length) {
+ case 3:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 32);
+ inst.visitArg(2, func, Arg.UseZDef, GP, 32);
+ break;
+ case 4:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 32);
+ inst.visitArg(2, func, Arg.Use, GP, 32);
+ inst.visitArg(3, func, Arg.ZDef, GP, 32);
+ break;
+ case 6:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 32);
+ inst.visitArg(2, func, Arg.Use, GP, 32);
+ inst.visitArg(3, func, Arg.Scratch, GP, 32);
+ inst.visitArg(4, func, Arg.Scratch, GP, 32);
+ inst.visitArg(5, func, Arg.ZDef, GP, 32);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case BranchMul64:
+ switch (inst.args.length) {
+ case 3:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 64);
+ inst.visitArg(2, func, Arg.UseZDef, GP, 64);
+ break;
+ case 6:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 64);
+ inst.visitArg(2, func, Arg.Use, GP, 64);
+ inst.visitArg(3, func, Arg.Scratch, GP, 64);
+ inst.visitArg(4, func, Arg.Scratch, GP, 64);
+ inst.visitArg(5, func, Arg.ZDef, GP, 64);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case BranchSub32:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 32);
+ inst.visitArg(2, func, Arg.UseZDef, GP, 32);
+ break;
+ break;
+ case BranchSub64:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 64);
+ inst.visitArg(2, func, Arg.UseDef, GP, 64);
+ break;
+ break;
+ case BranchNeg32:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.UseZDef, GP, 32);
+ break;
+ break;
+ case BranchNeg64:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.UseZDef, GP, 64);
+ break;
+ break;
+ case MoveConditionally32:
+ switch (inst.args.length) {
+ case 5:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 32);
+ inst.visitArg(2, func, Arg.Use, GP, 32);
+ inst.visitArg(3, func, Arg.Use, GP, Ptr);
+ inst.visitArg(4, func, Arg.UseDef, GP, Ptr);
+ break;
+ case 6:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 32);
+ inst.visitArg(2, func, Arg.Use, GP, 32);
+ inst.visitArg(3, func, Arg.Use, GP, Ptr);
+ inst.visitArg(4, func, Arg.Use, GP, Ptr);
+ inst.visitArg(5, func, Arg.Def, GP, Ptr);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case MoveConditionally64:
+ switch (inst.args.length) {
+ case 5:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 64);
+ inst.visitArg(2, func, Arg.Use, GP, 64);
+ inst.visitArg(3, func, Arg.Use, GP, Ptr);
+ inst.visitArg(4, func, Arg.UseDef, GP, Ptr);
+ break;
+ case 6:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 64);
+ inst.visitArg(2, func, Arg.Use, GP, 64);
+ inst.visitArg(3, func, Arg.Use, GP, Ptr);
+ inst.visitArg(4, func, Arg.Use, GP, Ptr);
+ inst.visitArg(5, func, Arg.Def, GP, Ptr);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case MoveConditionallyTest32:
+ switch (inst.args.length) {
+ case 5:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 32);
+ inst.visitArg(2, func, Arg.Use, GP, 32);
+ inst.visitArg(3, func, Arg.Use, GP, Ptr);
+ inst.visitArg(4, func, Arg.UseDef, GP, Ptr);
+ break;
+ case 6:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 32);
+ inst.visitArg(2, func, Arg.Use, GP, 32);
+ inst.visitArg(3, func, Arg.Use, GP, Ptr);
+ inst.visitArg(4, func, Arg.Use, GP, Ptr);
+ inst.visitArg(5, func, Arg.Def, GP, Ptr);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case MoveConditionallyTest64:
+ switch (inst.args.length) {
+ case 5:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 64);
+ inst.visitArg(2, func, Arg.Use, GP, 64);
+ inst.visitArg(3, func, Arg.Use, GP, Ptr);
+ inst.visitArg(4, func, Arg.UseDef, GP, Ptr);
+ break;
+ case 6:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 32);
+ inst.visitArg(2, func, Arg.Use, GP, 32);
+ inst.visitArg(3, func, Arg.Use, GP, Ptr);
+ inst.visitArg(4, func, Arg.Use, GP, Ptr);
+ inst.visitArg(5, func, Arg.Def, GP, Ptr);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case MoveConditionallyDouble:
+ switch (inst.args.length) {
+ case 6:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, FP, 64);
+ inst.visitArg(2, func, Arg.Use, FP, 64);
+ inst.visitArg(3, func, Arg.Use, GP, Ptr);
+ inst.visitArg(4, func, Arg.Use, GP, Ptr);
+ inst.visitArg(5, func, Arg.Def, GP, Ptr);
+ break;
+ case 5:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, FP, 64);
+ inst.visitArg(2, func, Arg.Use, FP, 64);
+ inst.visitArg(3, func, Arg.Use, GP, Ptr);
+ inst.visitArg(4, func, Arg.UseDef, GP, Ptr);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case MoveConditionallyFloat:
+ switch (inst.args.length) {
+ case 6:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, FP, 32);
+ inst.visitArg(2, func, Arg.Use, FP, 32);
+ inst.visitArg(3, func, Arg.Use, GP, Ptr);
+ inst.visitArg(4, func, Arg.Use, GP, Ptr);
+ inst.visitArg(5, func, Arg.Def, GP, Ptr);
+ break;
+ case 5:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, FP, 32);
+ inst.visitArg(2, func, Arg.Use, FP, 32);
+ inst.visitArg(3, func, Arg.Use, GP, Ptr);
+ inst.visitArg(4, func, Arg.UseDef, GP, Ptr);
+ break;
+ default:
+ throw new Error("Bad overload");
+ break;
+ }
+ break;
+ case MoveDoubleConditionally32:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 32);
+ inst.visitArg(2, func, Arg.Use, GP, 32);
+ inst.visitArg(3, func, Arg.Use, FP, 64);
+ inst.visitArg(4, func, Arg.Use, FP, 64);
+ inst.visitArg(5, func, Arg.Def, FP, 64);
+ break;
+ break;
+ case MoveDoubleConditionally64:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 64);
+ inst.visitArg(2, func, Arg.Use, GP, 64);
+ inst.visitArg(3, func, Arg.Use, FP, 64);
+ inst.visitArg(4, func, Arg.Use, FP, 64);
+ inst.visitArg(5, func, Arg.Def, FP, 64);
+ break;
+ break;
+ case MoveDoubleConditionallyTest32:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 32);
+ inst.visitArg(2, func, Arg.Use, GP, 32);
+ inst.visitArg(3, func, Arg.Use, FP, 64);
+ inst.visitArg(4, func, Arg.Use, FP, 64);
+ inst.visitArg(5, func, Arg.Def, FP, 64);
+ break;
+ break;
+ case MoveDoubleConditionallyTest64:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, GP, 64);
+ inst.visitArg(2, func, Arg.Use, GP, 64);
+ inst.visitArg(3, func, Arg.Use, FP, 64);
+ inst.visitArg(4, func, Arg.Use, FP, 64);
+ inst.visitArg(5, func, Arg.Def, FP, 64);
+ break;
+ break;
+ case MoveDoubleConditionallyDouble:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, FP, 64);
+ inst.visitArg(2, func, Arg.Use, FP, 64);
+ inst.visitArg(3, func, Arg.Use, FP, 64);
+ inst.visitArg(4, func, Arg.Use, FP, 64);
+ inst.visitArg(5, func, Arg.Def, FP, 64);
+ break;
+ break;
+ case MoveDoubleConditionallyFloat:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ inst.visitArg(1, func, Arg.Use, FP, 32);
+ inst.visitArg(2, func, Arg.Use, FP, 32);
+ inst.visitArg(3, func, Arg.Use, FP, 64);
+ inst.visitArg(4, func, Arg.Use, FP, 64);
+ inst.visitArg(5, func, Arg.Def, FP, 64);
+ break;
+ break;
+ case Jump:
+ break;
+ break;
+ case Ret32:
+ inst.visitArg(0, func, Arg.Use, GP, 32);
+ break;
+ break;
+ case Ret64:
+ inst.visitArg(0, func, Arg.Use, GP, 64);
+ break;
+ break;
+ case RetFloat:
+ inst.visitArg(0, func, Arg.Use, FP, 32);
+ break;
+ break;
+ case RetDouble:
+ inst.visitArg(0, func, Arg.Use, FP, 64);
+ break;
+ break;
+ case Oops:
+ break;
+ break;
+ case Shuffle:
+ ShuffleCustom.forEachArg(inst, func);
+ break;
+ case Patch:
+ PatchCustom.forEachArg(inst, func);
+ break;
+ case CCall:
+ CCallCustom.forEachArg(inst, func);
+ break;
+ case ColdCCall:
+ ColdCCallCustom.forEachArg(inst, func);
+ break;
+ default:
+ throw "Bad opcode";
+ }
+}
+function Inst_hasNonArgEffects(inst)
+{
+ switch (inst.opcode) {
+ case Branch8:
+ case Branch32:
+ case Branch64:
+ case BranchTest8:
+ case BranchTest32:
+ case BranchTest64:
+ case BranchDouble:
+ case BranchFloat:
+ case BranchAdd32:
+ case BranchAdd64:
+ case BranchMul32:
+ case BranchMul64:
+ case BranchSub32:
+ case BranchSub64:
+ case BranchNeg32:
+ case BranchNeg64:
+ case Jump:
+ case Ret32:
+ case Ret64:
+ case RetFloat:
+ case RetDouble:
+ case Oops:
+ return true;
+ case Shuffle:
+ return ShuffleCustom.hasNonArgNonControlEffects(inst);
+ case Patch:
+ return PatchCustom.hasNonArgNonControlEffects(inst);
+ case CCall:
+ return CCallCustom.hasNonArgNonControlEffects(inst);
+ case ColdCCall:
+ return ColdCCallCustom.hasNonArgNonControlEffects(inst);
+ default:
+ return false;
+ }
+}
+function opcodeCode(opcode)
+{
+ switch (opcode) {
+ case AbsDouble:
+ return 0
+ case AbsFloat:
+ return 1
+ case Add16:
+ return 2
+ case Add32:
+ return 3
+ case Add64:
+ return 4
+ case Add8:
+ return 5
+ case AddDouble:
+ return 6
+ case AddFloat:
+ return 7
+ case And32:
+ return 8
+ case And64:
+ return 9
+ case AndDouble:
+ return 10
+ case AndFloat:
+ return 11
+ case Branch32:
+ return 12
+ case Branch64:
+ return 13
+ case Branch8:
+ return 14
+ case BranchAdd32:
+ return 15
+ case BranchAdd64:
+ return 16
+ case BranchDouble:
+ return 17
+ case BranchFloat:
+ return 18
+ case BranchMul32:
+ return 19
+ case BranchMul64:
+ return 20
+ case BranchNeg32:
+ return 21
+ case BranchNeg64:
+ return 22
+ case BranchSub32:
+ return 23
+ case BranchSub64:
+ return 24
+ case BranchTest32:
+ return 25
+ case BranchTest64:
+ return 26
+ case BranchTest8:
+ return 27
+ case CCall:
+ return 28
+ case CeilDouble:
+ return 29
+ case CeilFloat:
+ return 30
+ case ColdCCall:
+ return 31
+ case Compare32:
+ return 32
+ case Compare64:
+ return 33
+ case CompareDouble:
+ return 34
+ case CompareFloat:
+ return 35
+ case ConvertDoubleToFloat:
+ return 36
+ case ConvertFloatToDouble:
+ return 37
+ case ConvertInt32ToDouble:
+ return 38
+ case ConvertInt32ToFloat:
+ return 39
+ case ConvertInt64ToDouble:
+ return 40
+ case ConvertInt64ToFloat:
+ return 41
+ case CountLeadingZeros32:
+ return 42
+ case CountLeadingZeros64:
+ return 43
+ case Div32:
+ return 44
+ case Div64:
+ return 45
+ case DivDouble:
+ return 46
+ case DivFloat:
+ return 47
+ case FloorDouble:
+ return 48
+ case FloorFloat:
+ return 49
+ case Jump:
+ return 50
+ case Lea:
+ return 51
+ case Load16:
+ return 52
+ case Load16SignedExtendTo32:
+ return 53
+ case Load8:
+ return 54
+ case Load8SignedExtendTo32:
+ return 55
+ case Lshift32:
+ return 56
+ case Lshift64:
+ return 57
+ case Move:
+ return 58
+ case Move32:
+ return 59
+ case Move32ToFloat:
+ return 60
+ case Move64ToDouble:
+ return 61
+ case MoveConditionally32:
+ return 62
+ case MoveConditionally64:
+ return 63
+ case MoveConditionallyDouble:
+ return 64
+ case MoveConditionallyFloat:
+ return 65
+ case MoveConditionallyTest32:
+ return 66
+ case MoveConditionallyTest64:
+ return 67
+ case MoveDouble:
+ return 68
+ case MoveDoubleConditionally32:
+ return 69
+ case MoveDoubleConditionally64:
+ return 70
+ case MoveDoubleConditionallyDouble:
+ return 71
+ case MoveDoubleConditionallyFloat:
+ return 72
+ case MoveDoubleConditionallyTest32:
+ return 73
+ case MoveDoubleConditionallyTest64:
+ return 74
+ case MoveDoubleTo64:
+ return 75
+ case MoveFloat:
+ return 76
+ case MoveFloatTo32:
+ return 77
+ case MoveZeroToDouble:
+ return 78
+ case Mul32:
+ return 79
+ case Mul64:
+ return 80
+ case MulDouble:
+ return 81
+ case MulFloat:
+ return 82
+ case MultiplyAdd32:
+ return 83
+ case MultiplyAdd64:
+ return 84
+ case MultiplyNeg32:
+ return 85
+ case MultiplyNeg64:
+ return 86
+ case MultiplySub32:
+ return 87
+ case MultiplySub64:
+ return 88
+ case Neg32:
+ return 89
+ case Neg64:
+ return 90
+ case NegateDouble:
+ return 91
+ case Nop:
+ return 92
+ case Not32:
+ return 93
+ case Not64:
+ return 94
+ case Oops:
+ return 95
+ case Or32:
+ return 96
+ case Or64:
+ return 97
+ case Patch:
+ return 98
+ case Ret32:
+ return 99
+ case Ret64:
+ return 100
+ case RetDouble:
+ return 101
+ case RetFloat:
+ return 102
+ case Rshift32:
+ return 103
+ case Rshift64:
+ return 104
+ case Shuffle:
+ return 105
+ case SignExtend16To32:
+ return 106
+ case SignExtend32ToPtr:
+ return 107
+ case SignExtend8To32:
+ return 108
+ case SqrtDouble:
+ return 109
+ case SqrtFloat:
+ return 110
+ case Store16:
+ return 111
+ case Store8:
+ return 112
+ case StoreZero32:
+ return 113
+ case Sub32:
+ return 114
+ case Sub64:
+ return 115
+ case SubDouble:
+ return 116
+ case SubFloat:
+ return 117
+ case Swap32:
+ return 118
+ case Swap64:
+ return 119
+ case Test32:
+ return 120
+ case Test64:
+ return 121
+ case Urshift32:
+ return 122
+ case Urshift64:
+ return 123
+ case X86ConvertToDoubleWord32:
+ return 124
+ case X86ConvertToQuadWord64:
+ return 125
+ case X86Div32:
+ return 126
+ case X86Div64:
+ return 127
+ case Xor32:
+ return 128
+ case Xor64:
+ return 129
+ case XorDouble:
+ return 130
+ case XorFloat:
+ return 131
+ case ZeroExtend16To32:
+ return 132
+ case ZeroExtend8To32:
+ return 133
+ default:
+ throw new Error("bad opcode");
+ }
+}
--- /dev/null
+"use strict";
+// Generated by Air::dumpAsJS from #ACLj8C in Air.js
+function createPayloadAirJSACLj8C()
+{
+ let code = new Code();
+ let bb0 = code.addBlock();
+ let bb1 = code.addBlock();
+ let bb2 = code.addBlock();
+ let bb3 = code.addBlock();
+ let bb4 = code.addBlock();
+ let bb5 = code.addBlock();
+ let bb6 = code.addBlock();
+ let bb7 = code.addBlock();
+ let bb8 = code.addBlock();
+ let bb9 = code.addBlock();
+ let bb10 = code.addBlock();
+ let bb11 = code.addBlock();
+ let bb12 = code.addBlock();
+ let bb13 = code.addBlock();
+ let bb14 = code.addBlock();
+ let bb15 = code.addBlock();
+ let slot0 = code.addStackSlot(160, Locked);
+ let slot1 = code.addStackSlot(8, Spill);
+ let slot2 = code.addStackSlot(8, Spill);
+ let slot3 = code.addStackSlot(8, Spill);
+ let slot4 = code.addStackSlot(40, Locked);
+ slot4.setOffsetFromFP(-40);
+ let tmp61 = code.newTmp(GP);
+ let tmp60 = code.newTmp(GP);
+ let tmp59 = code.newTmp(GP);
+ let tmp58 = code.newTmp(GP);
+ let tmp57 = code.newTmp(GP);
+ let tmp56 = code.newTmp(GP);
+ let tmp55 = code.newTmp(GP);
+ let tmp54 = code.newTmp(GP);
+ let tmp53 = code.newTmp(GP);
+ let tmp52 = code.newTmp(GP);
+ let tmp51 = code.newTmp(GP);
+ let tmp50 = code.newTmp(GP);
+ let tmp49 = code.newTmp(GP);
+ let tmp48 = code.newTmp(GP);
+ let tmp47 = code.newTmp(GP);
+ let tmp46 = code.newTmp(GP);
+ let tmp45 = code.newTmp(GP);
+ let tmp44 = code.newTmp(GP);
+ let tmp43 = code.newTmp(GP);
+ let tmp42 = code.newTmp(GP);
+ let tmp41 = code.newTmp(GP);
+ let tmp40 = code.newTmp(GP);
+ let tmp39 = code.newTmp(GP);
+ let tmp38 = code.newTmp(GP);
+ let tmp37 = code.newTmp(GP);
+ let tmp36 = code.newTmp(GP);
+ let tmp35 = code.newTmp(GP);
+ let tmp34 = code.newTmp(GP);
+ let tmp33 = code.newTmp(GP);
+ let tmp32 = code.newTmp(GP);
+ let tmp31 = code.newTmp(GP);
+ let tmp30 = code.newTmp(GP);
+ let tmp29 = code.newTmp(GP);
+ let tmp28 = code.newTmp(GP);
+ let tmp27 = code.newTmp(GP);
+ let tmp26 = code.newTmp(GP);
+ let tmp25 = code.newTmp(GP);
+ let tmp24 = code.newTmp(GP);
+ let tmp23 = code.newTmp(GP);
+ let tmp22 = code.newTmp(GP);
+ let tmp21 = code.newTmp(GP);
+ let tmp20 = code.newTmp(GP);
+ let tmp19 = code.newTmp(GP);
+ let tmp18 = code.newTmp(GP);
+ let tmp17 = code.newTmp(GP);
+ let tmp16 = code.newTmp(GP);
+ let tmp15 = code.newTmp(GP);
+ let tmp14 = code.newTmp(GP);
+ let tmp13 = code.newTmp(GP);
+ let tmp12 = code.newTmp(GP);
+ let tmp11 = code.newTmp(GP);
+ let tmp10 = code.newTmp(GP);
+ let tmp9 = code.newTmp(GP);
+ let tmp8 = code.newTmp(GP);
+ let tmp7 = code.newTmp(GP);
+ let tmp6 = code.newTmp(GP);
+ let tmp5 = code.newTmp(GP);
+ let tmp4 = code.newTmp(GP);
+ let tmp3 = code.newTmp(GP);
+ let tmp2 = code.newTmp(GP);
+ let tmp1 = code.newTmp(GP);
+ let tmp0 = code.newTmp(GP);
+ let inst;
+ let arg;
+ bb0.successors.push(new FrequentedBlock(bb1, Normal));
+ bb0.successors.push(new FrequentedBlock(bb15, Normal));
+ inst = new Inst(Move);
+ arg = Arg.createBigImm(276424800, 1);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rax);
+ inst.args.push(arg);
+ bb0.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createTmp(Reg.rax);
+ inst.args.push(arg);
+ arg = Arg.createAddr(Reg.rbp, 16);
+ inst.args.push(arg);
+ bb0.append(inst);
+ inst = new Inst(Patch);
+ arg = Arg.createSpecial();
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rbp);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rax);
+ inst.args.push(arg);
+ inst.patchHasNonArgEffects = true;
+ inst.extraEarlyClobberedRegs = new Set();
+ inst.extraClobberedRegs = new Set();
+ inst.extraEarlyClobberedRegs.add(Reg.r11);
+ inst.extraClobberedRegs.add(Reg.r11);
+ inst.patchArgData = [];
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.Scratch, type: GP, width: 64});
+ bb0.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createAddr(Reg.rbp, 72);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rdi);
+ inst.args.push(arg);
+ bb0.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createAddr(Reg.rbp, 64);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rdx);
+ inst.args.push(arg);
+ bb0.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createAddr(Reg.rbp, 56);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rsi);
+ inst.args.push(arg);
+ bb0.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createAddr(Reg.rbp, 48);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r8);
+ inst.args.push(arg);
+ bb0.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createBigImm(2, -65536);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r15);
+ inst.args.push(arg);
+ bb0.append(inst);
+ inst = new Inst(Patch);
+ arg = Arg.createSpecial();
+ inst.args.push(arg);
+ arg = Arg.createResCond(NonZero);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r8);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r15);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r8);
+ inst.args.push(arg);
+ inst.patchHasNonArgEffects = true;
+ inst.extraEarlyClobberedRegs = new Set();
+ inst.extraClobberedRegs = new Set();
+ inst.patchArgData = [];
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 32});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ bb0.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createAddr(Reg.rbp, 24);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rax);
+ inst.args.push(arg);
+ bb0.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createAddr(Reg.rax, 16);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rcx);
+ inst.args.push(arg);
+ bb0.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createBigImm(0, -65536);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r14);
+ inst.args.push(arg);
+ bb0.append(inst);
+ inst = new Inst(Patch);
+ arg = Arg.createSpecial();
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rax);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r8);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r15);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r14);
+ inst.args.push(arg);
+ inst.patchHasNonArgEffects = true;
+ inst.extraEarlyClobberedRegs = new Set();
+ inst.extraClobberedRegs = new Set();
+ inst.extraEarlyClobberedRegs.add(Reg.r11);
+ inst.extraClobberedRegs.add(Reg.r11);
+ inst.patchArgData = [];
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.Def, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.LateUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.LateUse, type: GP, width: 64});
+ bb0.append(inst);
+ inst = new Inst(Patch);
+ arg = Arg.createSpecial();
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rcx);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rax);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r8);
+ inst.args.push(arg);
+ inst.patchHasNonArgEffects = true;
+ inst.extraEarlyClobberedRegs = new Set();
+ inst.extraClobberedRegs = new Set();
+ inst.patchArgData = [];
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ bb0.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createAddr(Reg.rcx, 32);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r12);
+ inst.args.push(arg);
+ bb0.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createAddr(Reg.rcx, 40);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rbx);
+ inst.args.push(arg);
+ bb0.append(inst);
+ inst = new Inst(Patch);
+ arg = Arg.createSpecial();
+ inst.args.push(arg);
+ arg = Arg.createResCond(NonZero);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rax);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r15);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rax);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rax);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rbx);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rdi);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rdx);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rsi);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r12);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r8);
+ inst.args.push(arg);
+ inst.patchHasNonArgEffects = true;
+ inst.extraEarlyClobberedRegs = new Set();
+ inst.extraClobberedRegs = new Set();
+ inst.patchArgData = [];
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 32});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ bb0.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createBigImm(276327648, 1);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rcx);
+ inst.args.push(arg);
+ bb0.append(inst);
+ inst = new Inst(Patch);
+ arg = Arg.createSpecial();
+ inst.args.push(arg);
+ arg = Arg.createRelCond(NotEqual);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rax);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rcx);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rax);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rax);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rbx);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rdi);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rdx);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rsi);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r12);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r8);
+ inst.args.push(arg);
+ inst.patchHasNonArgEffects = true;
+ inst.extraEarlyClobberedRegs = new Set();
+ inst.extraClobberedRegs = new Set();
+ inst.patchArgData = [];
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 32});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ bb0.append(inst);
+ inst = new Inst(Patch);
+ arg = Arg.createSpecial();
+ inst.args.push(arg);
+ arg = Arg.createRelCond(NotEqual);
+ inst.args.push(arg);
+ arg = Arg.createAddr(Reg.r8, 5);
+ inst.args.push(arg);
+ arg = Arg.createImm(21);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r8);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rbx);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rdi);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rdx);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rsi);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r12);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r8);
+ inst.args.push(arg);
+ inst.patchHasNonArgEffects = true;
+ inst.extraEarlyClobberedRegs = new Set();
+ inst.extraClobberedRegs = new Set();
+ inst.patchArgData = [];
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 32});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 8});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 8});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ bb0.append(inst);
+ inst = new Inst(Patch);
+ arg = Arg.createSpecial();
+ inst.args.push(arg);
+ arg = Arg.createResCond(NonZero);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r12);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r15);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r12);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rbx);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rdi);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rdx);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rsi);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r12);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r8);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r12);
+ inst.args.push(arg);
+ inst.patchHasNonArgEffects = true;
+ inst.extraEarlyClobberedRegs = new Set();
+ inst.extraClobberedRegs = new Set();
+ inst.patchArgData = [];
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 32});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ bb0.append(inst);
+ inst = new Inst(Patch);
+ arg = Arg.createSpecial();
+ inst.args.push(arg);
+ arg = Arg.createRelCond(NotEqual);
+ inst.args.push(arg);
+ arg = Arg.createAddr(Reg.r12, 0);
+ inst.args.push(arg);
+ arg = Arg.createImm(372);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r12);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rbx);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rdi);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rdx);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rsi);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r12);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r8);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r12);
+ inst.args.push(arg);
+ inst.patchHasNonArgEffects = true;
+ inst.extraEarlyClobberedRegs = new Set();
+ inst.extraClobberedRegs = new Set();
+ inst.patchArgData = [];
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 32});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 32});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 32});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ bb0.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createAddr(Reg.r12, 8);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rax);
+ inst.args.push(arg);
+ bb0.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createAddr(Reg.rax, -40);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rax);
+ inst.args.push(arg);
+ bb0.append(inst);
+ inst = new Inst(Patch);
+ arg = Arg.createSpecial();
+ inst.args.push(arg);
+ arg = Arg.createResCond(NonZero);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rbx);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r15);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rbx);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rbx);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rdi);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rdx);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rsi);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r12);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r8);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rax);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rbx);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rdi);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rdx);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rsi);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r8);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r12);
+ inst.args.push(arg);
+ inst.patchHasNonArgEffects = true;
+ inst.extraEarlyClobberedRegs = new Set();
+ inst.extraClobberedRegs = new Set();
+ inst.patchArgData = [];
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 32});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ bb0.append(inst);
+ inst = new Inst(Patch);
+ arg = Arg.createSpecial();
+ inst.args.push(arg);
+ arg = Arg.createResCond(NonZero);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rax);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r15);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rax);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rbx);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rdi);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rdx);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rsi);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r12);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r8);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rax);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rbx);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rdi);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rdx);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rsi);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r8);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r12);
+ inst.args.push(arg);
+ inst.patchHasNonArgEffects = true;
+ inst.extraEarlyClobberedRegs = new Set();
+ inst.extraClobberedRegs = new Set();
+ inst.patchArgData = [];
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 32});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ bb0.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createBigImm(276321024, 1);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rcx);
+ inst.args.push(arg);
+ bb0.append(inst);
+ inst = new Inst(Patch);
+ arg = Arg.createSpecial();
+ inst.args.push(arg);
+ arg = Arg.createRelCond(NotEqual);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rax);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rcx);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rax);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rbx);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rdi);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rdx);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rsi);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r12);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r8);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rax);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rbx);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rdi);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rdx);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rsi);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r8);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r12);
+ inst.args.push(arg);
+ inst.patchHasNonArgEffects = true;
+ inst.extraEarlyClobberedRegs = new Set();
+ inst.extraClobberedRegs = new Set();
+ inst.patchArgData = [];
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 32});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ bb0.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createTmp(Reg.rbx);
+ inst.args.push(arg);
+ arg = Arg.createStack(slot0, 72);
+ inst.args.push(arg);
+ bb0.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createTmp(Reg.rdi);
+ inst.args.push(arg);
+ arg = Arg.createStack(slot0, 64);
+ inst.args.push(arg);
+ bb0.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createTmp(Reg.rdx);
+ inst.args.push(arg);
+ arg = Arg.createStack(slot0, 56);
+ inst.args.push(arg);
+ bb0.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createTmp(Reg.rsi);
+ inst.args.push(arg);
+ arg = Arg.createStack(slot0, 48);
+ inst.args.push(arg);
+ bb0.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createTmp(Reg.r8);
+ inst.args.push(arg);
+ arg = Arg.createStack(slot0, 40);
+ inst.args.push(arg);
+ bb0.append(inst);
+ inst = new Inst(Patch);
+ arg = Arg.createSpecial();
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rax);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r8);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r15);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r14);
+ inst.args.push(arg);
+ inst.patchHasNonArgEffects = true;
+ inst.extraEarlyClobberedRegs = new Set();
+ inst.extraClobberedRegs = new Set();
+ inst.extraEarlyClobberedRegs.add(Reg.r11);
+ inst.extraClobberedRegs.add(Reg.r11);
+ inst.patchArgData = [];
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.Def, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.LateUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.LateUse, type: GP, width: 64});
+ bb0.append(inst);
+ inst = new Inst(Patch);
+ arg = Arg.createSpecial();
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r12);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rax);
+ inst.args.push(arg);
+ inst.patchHasNonArgEffects = true;
+ inst.extraEarlyClobberedRegs = new Set();
+ inst.extraClobberedRegs = new Set();
+ inst.patchArgData = [];
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ bb0.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createTmp(Reg.rax);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rcx);
+ inst.args.push(arg);
+ bb0.append(inst);
+ inst = new Inst(Xor64);
+ arg = Arg.createImm(6);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rcx);
+ inst.args.push(arg);
+ bb0.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createImm(-2);
+ inst.args.push(arg);
+ arg = Arg.createStack(slot2, 0);
+ inst.args.push(arg);
+ bb0.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createImm(-2);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r9);
+ inst.args.push(arg);
+ bb0.append(inst);
+ inst = new Inst(Patch);
+ arg = Arg.createSpecial();
+ inst.args.push(arg);
+ arg = Arg.createResCond(NonZero);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rcx);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r9);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rax);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r12);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rax);
+ inst.args.push(arg);
+ inst.patchHasNonArgEffects = true;
+ inst.extraEarlyClobberedRegs = new Set();
+ inst.extraClobberedRegs = new Set();
+ inst.patchArgData = [];
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 32});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ bb0.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createImm(1);
+ inst.args.push(arg);
+ arg = Arg.createStack(slot3, 0);
+ inst.args.push(arg);
+ bb0.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createImm(1);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rcx);
+ inst.args.push(arg);
+ bb0.append(inst);
+ inst = new Inst(BranchTest64);
+ arg = Arg.createResCond(NonZero);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rax);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rcx);
+ inst.args.push(arg);
+ bb0.append(inst);
+ bb1.successors.push(new FrequentedBlock(bb3, Normal));
+ bb1.successors.push(new FrequentedBlock(bb2, Normal));
+ bb1.predecessors.push(bb0);
+ inst = new Inst(Patch);
+ arg = Arg.createSpecial();
+ inst.args.push(arg);
+ arg = Arg.createRelCond(NotEqual);
+ inst.args.push(arg);
+ arg = Arg.createAddr(Reg.r8, 0);
+ inst.args.push(arg);
+ arg = Arg.createImm(468);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r8);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r12);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rbx);
+ inst.args.push(arg);
+ inst.patchHasNonArgEffects = true;
+ inst.extraEarlyClobberedRegs = new Set();
+ inst.extraClobberedRegs = new Set();
+ inst.patchArgData = [];
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 32});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 32});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 32});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ bb1.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createAddr(Reg.r8, 16);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rax);
+ inst.args.push(arg);
+ bb1.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createBigImm(276741160, 1);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rcx);
+ inst.args.push(arg);
+ bb1.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createAddr(Reg.rcx, 0);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rcx);
+ inst.args.push(arg);
+ bb1.append(inst);
+ inst = new Inst(Branch64);
+ arg = Arg.createRelCond(Equal);
+ inst.args.push(arg);
+ arg = Arg.createAddr(Reg.rax, 8);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rcx);
+ inst.args.push(arg);
+ bb1.append(inst);
+ bb2.predecessors.push(bb1);
+ inst = new Inst(Patch);
+ arg = Arg.createSpecial();
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r12);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rbx);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r8);
+ inst.args.push(arg);
+ inst.patchHasNonArgEffects = true;
+ inst.extraEarlyClobberedRegs = new Set();
+ inst.extraClobberedRegs = new Set();
+ inst.patchArgData = [];
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ bb2.append(inst);
+ inst = new Inst(Oops);
+ bb2.append(inst);
+ bb3.successors.push(new FrequentedBlock(bb4, Normal));
+ bb3.successors.push(new FrequentedBlock(bb7, Normal));
+ bb3.predecessors.push(bb1);
+ inst = new Inst(Move);
+ arg = Arg.createAddr(Reg.r8, 24);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r13);
+ inst.args.push(arg);
+ bb3.append(inst);
+ inst = new Inst(Patch);
+ arg = Arg.createSpecial();
+ inst.args.push(arg);
+ arg = Arg.createRelCond(NotEqual);
+ inst.args.push(arg);
+ arg = Arg.createAddr(Reg.rbx, 5);
+ inst.args.push(arg);
+ arg = Arg.createImm(23);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rbx);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r12);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rbx);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rdi);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rdx);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rsi);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r13);
+ inst.args.push(arg);
+ inst.patchHasNonArgEffects = true;
+ inst.extraEarlyClobberedRegs = new Set();
+ inst.extraClobberedRegs = new Set();
+ inst.patchArgData = [];
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 32});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 8});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 8});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ bb3.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createBigImm(275739616, 1);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rax);
+ inst.args.push(arg);
+ bb3.append(inst);
+ inst = new Inst(Branch64);
+ arg = Arg.createRelCond(Equal);
+ inst.args.push(arg);
+ arg = Arg.createAddr(Reg.rbx, 24);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rax);
+ inst.args.push(arg);
+ bb3.append(inst);
+ bb4.successors.push(new FrequentedBlock(bb5, Normal));
+ bb4.successors.push(new FrequentedBlock(bb6, Normal));
+ bb4.predecessors.push(bb3);
+ inst = new Inst(Move);
+ arg = Arg.createTmp(Reg.rbx);
+ inst.args.push(arg);
+ arg = Arg.createStack(slot0, 0);
+ inst.args.push(arg);
+ bb4.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createAddr(Reg.rbx, 16);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rax);
+ inst.args.push(arg);
+ bb4.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createAddr(Reg.rax, 32);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rcx);
+ inst.args.push(arg);
+ bb4.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createTmp(Reg.rcx);
+ inst.args.push(arg);
+ arg = Arg.createStack(slot1, 0);
+ inst.args.push(arg);
+ bb4.append(inst);
+ inst = new Inst(Patch);
+ arg = Arg.createSpecial();
+ inst.args.push(arg);
+ arg = Arg.createResCond(NonZero);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rcx);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r15);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rcx);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r12);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rbx);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rdi);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rdx);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rsi);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r13);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rcx);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rax);
+ inst.args.push(arg);
+ inst.patchHasNonArgEffects = true;
+ inst.extraEarlyClobberedRegs = new Set();
+ inst.extraClobberedRegs = new Set();
+ inst.patchArgData = [];
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 32});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.ColdUse, type: GP, width: 64});
+ bb4.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createTmp(Reg.rdi);
+ inst.args.push(arg);
+ arg = Arg.createStack(slot0, 32);
+ inst.args.push(arg);
+ bb4.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createTmp(Reg.rdx);
+ inst.args.push(arg);
+ arg = Arg.createStack(slot0, 24);
+ inst.args.push(arg);
+ bb4.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createTmp(Reg.rsi);
+ inst.args.push(arg);
+ arg = Arg.createStack(slot0, 16);
+ inst.args.push(arg);
+ bb4.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createTmp(Reg.r13);
+ inst.args.push(arg);
+ arg = Arg.createStack(slot0, 8);
+ inst.args.push(arg);
+ bb4.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createBigImm(276645872, 1);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rax);
+ inst.args.push(arg);
+ bb4.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createBigImm(276646496, 1);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rcx);
+ inst.args.push(arg);
+ bb4.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createTmp(Reg.rax);
+ inst.args.push(arg);
+ arg = Arg.createCallArg(8);
+ inst.args.push(arg);
+ bb4.append(inst);
+ inst = new Inst(Move32);
+ arg = Arg.createImm(2);
+ inst.args.push(arg);
+ arg = Arg.createCallArg(16);
+ inst.args.push(arg);
+ bb4.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createTmp(Reg.rcx);
+ inst.args.push(arg);
+ arg = Arg.createCallArg(24);
+ inst.args.push(arg);
+ bb4.append(inst);
+ inst = new Inst(Move);
+ arg = Arg.createTmp(Reg.rsi);
+ inst.args.push(arg);
+ arg = Arg.createCallArg(32);
+ inst.args.push(arg);
+ bb4.append(inst);
+ inst = new Inst(Patch);
+ arg = Arg.createSpecial();
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rax);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rax);
+ inst.args.push(arg);
+ arg = Arg.createCallArg(8);
+ inst.args.push(arg);
+ arg = Arg.createCallArg(16);
+ inst.args.push(arg);
+ arg = Arg.createCallArg(24);
+ inst.args.push(arg);
+ arg = Arg.createCallArg(32);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r15);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r14);
+ inst.args.push(arg);
+ inst.patchHasNonArgEffects = true;
+ inst.extraEarlyClobberedRegs = new Set();
+ inst.extraClobberedRegs = new Set();
+ inst.extraEarlyClobberedRegs.add(Reg.r11);
+ inst.extraClobberedRegs.add(Reg.rcx);
+ inst.extraClobberedRegs.add(Reg.rdx);
+ inst.extraClobberedRegs.add(Reg.rsi);
+ inst.extraClobberedRegs.add(Reg.rdi);
+ inst.extraClobberedRegs.add(Reg.r8);
+ inst.extraClobberedRegs.add(Reg.r9);
+ inst.extraClobberedRegs.add(Reg.r10);
+ inst.extraClobberedRegs.add(Reg.r11);
+ inst.extraClobberedRegs.add(Reg.xmm0);
+ inst.extraClobberedRegs.add(Reg.xmm1);
+ inst.extraClobberedRegs.add(Reg.xmm2);
+ inst.extraClobberedRegs.add(Reg.xmm3);
+ inst.extraClobberedRegs.add(Reg.xmm4);
+ inst.extraClobberedRegs.add(Reg.xmm5);
+ inst.extraClobberedRegs.add(Reg.xmm6);
+ inst.extraClobberedRegs.add(Reg.xmm7);
+ inst.extraClobberedRegs.add(Reg.xmm8);
+ inst.extraClobberedRegs.add(Reg.xmm9);
+ inst.extraClobberedRegs.add(Reg.xmm10);
+ inst.extraClobberedRegs.add(Reg.xmm11);
+ inst.extraClobberedRegs.add(Reg.xmm12);
+ inst.extraClobberedRegs.add(Reg.xmm13);
+ inst.extraClobberedRegs.add(Reg.xmm14);
+ inst.extraClobberedRegs.add(Reg.xmm15);
+ inst.patchArgData = [];
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.Def, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 32});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ inst.patchArgData.push({role: Arg.Use, type: GP, width: 64});
+ bb4.append(inst);
+ inst = new Inst(Patch);
+ arg = Arg.createSpecial();
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.r12);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rbx);
+ inst.args.push(arg);
+ arg = Arg.createStack(slot1, 0);
+ inst.args.push(arg);
+ arg = Arg.createTmp(Reg.rax);
+ inst.args.push(arg);