libv8-sgonyea 3.3.10
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +8 -0
- data/.gitmodules +3 -0
- data/Gemfile +4 -0
- data/README.md +76 -0
- data/Rakefile +113 -0
- data/ext/libv8/extconf.rb +28 -0
- data/lib/libv8.rb +15 -0
- data/lib/libv8/Makefile +30 -0
- data/lib/libv8/detect_cpu.rb +27 -0
- data/lib/libv8/fpic-on-linux-amd64.patch +13 -0
- data/lib/libv8/v8/.gitignore +35 -0
- data/lib/libv8/v8/AUTHORS +44 -0
- data/lib/libv8/v8/ChangeLog +2839 -0
- data/lib/libv8/v8/LICENSE +52 -0
- data/lib/libv8/v8/LICENSE.strongtalk +29 -0
- data/lib/libv8/v8/LICENSE.v8 +26 -0
- data/lib/libv8/v8/LICENSE.valgrind +45 -0
- data/lib/libv8/v8/SConstruct +1478 -0
- data/lib/libv8/v8/build/README.txt +49 -0
- data/lib/libv8/v8/build/all.gyp +18 -0
- data/lib/libv8/v8/build/armu.gypi +32 -0
- data/lib/libv8/v8/build/common.gypi +144 -0
- data/lib/libv8/v8/build/gyp_v8 +145 -0
- data/lib/libv8/v8/include/v8-debug.h +395 -0
- data/lib/libv8/v8/include/v8-preparser.h +117 -0
- data/lib/libv8/v8/include/v8-profiler.h +505 -0
- data/lib/libv8/v8/include/v8-testing.h +104 -0
- data/lib/libv8/v8/include/v8.h +4124 -0
- data/lib/libv8/v8/include/v8stdint.h +53 -0
- data/lib/libv8/v8/preparser/SConscript +38 -0
- data/lib/libv8/v8/preparser/preparser-process.cc +379 -0
- data/lib/libv8/v8/src/SConscript +368 -0
- data/lib/libv8/v8/src/accessors.cc +767 -0
- data/lib/libv8/v8/src/accessors.h +123 -0
- data/lib/libv8/v8/src/allocation-inl.h +49 -0
- data/lib/libv8/v8/src/allocation.cc +122 -0
- data/lib/libv8/v8/src/allocation.h +143 -0
- data/lib/libv8/v8/src/api.cc +5845 -0
- data/lib/libv8/v8/src/api.h +574 -0
- data/lib/libv8/v8/src/apinatives.js +110 -0
- data/lib/libv8/v8/src/apiutils.h +73 -0
- data/lib/libv8/v8/src/arguments.h +118 -0
- data/lib/libv8/v8/src/arm/assembler-arm-inl.h +353 -0
- data/lib/libv8/v8/src/arm/assembler-arm.cc +2661 -0
- data/lib/libv8/v8/src/arm/assembler-arm.h +1375 -0
- data/lib/libv8/v8/src/arm/builtins-arm.cc +1658 -0
- data/lib/libv8/v8/src/arm/code-stubs-arm.cc +6398 -0
- data/lib/libv8/v8/src/arm/code-stubs-arm.h +673 -0
- data/lib/libv8/v8/src/arm/codegen-arm.cc +52 -0
- data/lib/libv8/v8/src/arm/codegen-arm.h +91 -0
- data/lib/libv8/v8/src/arm/constants-arm.cc +152 -0
- data/lib/libv8/v8/src/arm/constants-arm.h +775 -0
- data/lib/libv8/v8/src/arm/cpu-arm.cc +120 -0
- data/lib/libv8/v8/src/arm/debug-arm.cc +317 -0
- data/lib/libv8/v8/src/arm/deoptimizer-arm.cc +754 -0
- data/lib/libv8/v8/src/arm/disasm-arm.cc +1506 -0
- data/lib/libv8/v8/src/arm/frames-arm.cc +45 -0
- data/lib/libv8/v8/src/arm/frames-arm.h +168 -0
- data/lib/libv8/v8/src/arm/full-codegen-arm.cc +4375 -0
- data/lib/libv8/v8/src/arm/ic-arm.cc +1562 -0
- data/lib/libv8/v8/src/arm/lithium-arm.cc +2206 -0
- data/lib/libv8/v8/src/arm/lithium-arm.h +2348 -0
- data/lib/libv8/v8/src/arm/lithium-codegen-arm.cc +4526 -0
- data/lib/libv8/v8/src/arm/lithium-codegen-arm.h +403 -0
- data/lib/libv8/v8/src/arm/lithium-gap-resolver-arm.cc +305 -0
- data/lib/libv8/v8/src/arm/lithium-gap-resolver-arm.h +84 -0
- data/lib/libv8/v8/src/arm/macro-assembler-arm.cc +3163 -0
- data/lib/libv8/v8/src/arm/macro-assembler-arm.h +1126 -0
- data/lib/libv8/v8/src/arm/regexp-macro-assembler-arm.cc +1287 -0
- data/lib/libv8/v8/src/arm/regexp-macro-assembler-arm.h +253 -0
- data/lib/libv8/v8/src/arm/simulator-arm.cc +3424 -0
- data/lib/libv8/v8/src/arm/simulator-arm.h +431 -0
- data/lib/libv8/v8/src/arm/stub-cache-arm.cc +4243 -0
- data/lib/libv8/v8/src/array.js +1366 -0
- data/lib/libv8/v8/src/assembler.cc +1207 -0
- data/lib/libv8/v8/src/assembler.h +858 -0
- data/lib/libv8/v8/src/ast-inl.h +112 -0
- data/lib/libv8/v8/src/ast.cc +1146 -0
- data/lib/libv8/v8/src/ast.h +2188 -0
- data/lib/libv8/v8/src/atomicops.h +167 -0
- data/lib/libv8/v8/src/atomicops_internals_arm_gcc.h +145 -0
- data/lib/libv8/v8/src/atomicops_internals_mips_gcc.h +169 -0
- data/lib/libv8/v8/src/atomicops_internals_x86_gcc.cc +133 -0
- data/lib/libv8/v8/src/atomicops_internals_x86_gcc.h +287 -0
- data/lib/libv8/v8/src/atomicops_internals_x86_macosx.h +301 -0
- data/lib/libv8/v8/src/atomicops_internals_x86_msvc.h +203 -0
- data/lib/libv8/v8/src/bignum-dtoa.cc +655 -0
- data/lib/libv8/v8/src/bignum-dtoa.h +81 -0
- data/lib/libv8/v8/src/bignum.cc +768 -0
- data/lib/libv8/v8/src/bignum.h +140 -0
- data/lib/libv8/v8/src/bootstrapper.cc +2184 -0
- data/lib/libv8/v8/src/bootstrapper.h +188 -0
- data/lib/libv8/v8/src/builtins.cc +1707 -0
- data/lib/libv8/v8/src/builtins.h +371 -0
- data/lib/libv8/v8/src/bytecodes-irregexp.h +105 -0
- data/lib/libv8/v8/src/cached-powers.cc +177 -0
- data/lib/libv8/v8/src/cached-powers.h +65 -0
- data/lib/libv8/v8/src/char-predicates-inl.h +94 -0
- data/lib/libv8/v8/src/char-predicates.h +67 -0
- data/lib/libv8/v8/src/checks.cc +110 -0
- data/lib/libv8/v8/src/checks.h +296 -0
- data/lib/libv8/v8/src/circular-queue-inl.h +53 -0
- data/lib/libv8/v8/src/circular-queue.cc +122 -0
- data/lib/libv8/v8/src/circular-queue.h +103 -0
- data/lib/libv8/v8/src/code-stubs.cc +267 -0
- data/lib/libv8/v8/src/code-stubs.h +1011 -0
- data/lib/libv8/v8/src/code.h +70 -0
- data/lib/libv8/v8/src/codegen.cc +231 -0
- data/lib/libv8/v8/src/codegen.h +84 -0
- data/lib/libv8/v8/src/compilation-cache.cc +540 -0
- data/lib/libv8/v8/src/compilation-cache.h +287 -0
- data/lib/libv8/v8/src/compiler.cc +786 -0
- data/lib/libv8/v8/src/compiler.h +312 -0
- data/lib/libv8/v8/src/contexts.cc +347 -0
- data/lib/libv8/v8/src/contexts.h +391 -0
- data/lib/libv8/v8/src/conversions-inl.h +106 -0
- data/lib/libv8/v8/src/conversions.cc +1131 -0
- data/lib/libv8/v8/src/conversions.h +135 -0
- data/lib/libv8/v8/src/counters.cc +93 -0
- data/lib/libv8/v8/src/counters.h +254 -0
- data/lib/libv8/v8/src/cpu-profiler-inl.h +101 -0
- data/lib/libv8/v8/src/cpu-profiler.cc +609 -0
- data/lib/libv8/v8/src/cpu-profiler.h +302 -0
- data/lib/libv8/v8/src/cpu.h +69 -0
- data/lib/libv8/v8/src/d8-debug.cc +367 -0
- data/lib/libv8/v8/src/d8-debug.h +158 -0
- data/lib/libv8/v8/src/d8-posix.cc +695 -0
- data/lib/libv8/v8/src/d8-readline.cc +130 -0
- data/lib/libv8/v8/src/d8-windows.cc +42 -0
- data/lib/libv8/v8/src/d8.cc +803 -0
- data/lib/libv8/v8/src/d8.gyp +91 -0
- data/lib/libv8/v8/src/d8.h +235 -0
- data/lib/libv8/v8/src/d8.js +2798 -0
- data/lib/libv8/v8/src/data-flow.cc +66 -0
- data/lib/libv8/v8/src/data-flow.h +205 -0
- data/lib/libv8/v8/src/date.js +1103 -0
- data/lib/libv8/v8/src/dateparser-inl.h +127 -0
- data/lib/libv8/v8/src/dateparser.cc +178 -0
- data/lib/libv8/v8/src/dateparser.h +266 -0
- data/lib/libv8/v8/src/debug-agent.cc +447 -0
- data/lib/libv8/v8/src/debug-agent.h +129 -0
- data/lib/libv8/v8/src/debug-debugger.js +2569 -0
- data/lib/libv8/v8/src/debug.cc +3165 -0
- data/lib/libv8/v8/src/debug.h +1057 -0
- data/lib/libv8/v8/src/deoptimizer.cc +1256 -0
- data/lib/libv8/v8/src/deoptimizer.h +602 -0
- data/lib/libv8/v8/src/disasm.h +80 -0
- data/lib/libv8/v8/src/disassembler.cc +343 -0
- data/lib/libv8/v8/src/disassembler.h +58 -0
- data/lib/libv8/v8/src/diy-fp.cc +58 -0
- data/lib/libv8/v8/src/diy-fp.h +117 -0
- data/lib/libv8/v8/src/double.h +238 -0
- data/lib/libv8/v8/src/dtoa.cc +103 -0
- data/lib/libv8/v8/src/dtoa.h +85 -0
- data/lib/libv8/v8/src/execution.cc +849 -0
- data/lib/libv8/v8/src/execution.h +297 -0
- data/lib/libv8/v8/src/extensions/experimental/break-iterator.cc +250 -0
- data/lib/libv8/v8/src/extensions/experimental/break-iterator.h +89 -0
- data/lib/libv8/v8/src/extensions/experimental/collator.cc +218 -0
- data/lib/libv8/v8/src/extensions/experimental/collator.h +69 -0
- data/lib/libv8/v8/src/extensions/experimental/experimental.gyp +94 -0
- data/lib/libv8/v8/src/extensions/experimental/i18n-extension.cc +78 -0
- data/lib/libv8/v8/src/extensions/experimental/i18n-extension.h +54 -0
- data/lib/libv8/v8/src/extensions/experimental/i18n-locale.cc +112 -0
- data/lib/libv8/v8/src/extensions/experimental/i18n-locale.h +60 -0
- data/lib/libv8/v8/src/extensions/experimental/i18n-utils.cc +43 -0
- data/lib/libv8/v8/src/extensions/experimental/i18n-utils.h +49 -0
- data/lib/libv8/v8/src/extensions/experimental/i18n.js +180 -0
- data/lib/libv8/v8/src/extensions/experimental/language-matcher.cc +251 -0
- data/lib/libv8/v8/src/extensions/experimental/language-matcher.h +95 -0
- data/lib/libv8/v8/src/extensions/externalize-string-extension.cc +141 -0
- data/lib/libv8/v8/src/extensions/externalize-string-extension.h +50 -0
- data/lib/libv8/v8/src/extensions/gc-extension.cc +58 -0
- data/lib/libv8/v8/src/extensions/gc-extension.h +49 -0
- data/lib/libv8/v8/src/factory.cc +1222 -0
- data/lib/libv8/v8/src/factory.h +442 -0
- data/lib/libv8/v8/src/fast-dtoa.cc +736 -0
- data/lib/libv8/v8/src/fast-dtoa.h +83 -0
- data/lib/libv8/v8/src/fixed-dtoa.cc +405 -0
- data/lib/libv8/v8/src/fixed-dtoa.h +55 -0
- data/lib/libv8/v8/src/flag-definitions.h +560 -0
- data/lib/libv8/v8/src/flags.cc +551 -0
- data/lib/libv8/v8/src/flags.h +79 -0
- data/lib/libv8/v8/src/frames-inl.h +247 -0
- data/lib/libv8/v8/src/frames.cc +1243 -0
- data/lib/libv8/v8/src/frames.h +870 -0
- data/lib/libv8/v8/src/full-codegen.cc +1374 -0
- data/lib/libv8/v8/src/full-codegen.h +771 -0
- data/lib/libv8/v8/src/func-name-inferrer.cc +92 -0
- data/lib/libv8/v8/src/func-name-inferrer.h +111 -0
- data/lib/libv8/v8/src/gdb-jit.cc +1555 -0
- data/lib/libv8/v8/src/gdb-jit.h +143 -0
- data/lib/libv8/v8/src/global-handles.cc +665 -0
- data/lib/libv8/v8/src/global-handles.h +284 -0
- data/lib/libv8/v8/src/globals.h +325 -0
- data/lib/libv8/v8/src/handles-inl.h +177 -0
- data/lib/libv8/v8/src/handles.cc +987 -0
- data/lib/libv8/v8/src/handles.h +382 -0
- data/lib/libv8/v8/src/hashmap.cc +230 -0
- data/lib/libv8/v8/src/hashmap.h +123 -0
- data/lib/libv8/v8/src/heap-inl.h +704 -0
- data/lib/libv8/v8/src/heap-profiler.cc +1173 -0
- data/lib/libv8/v8/src/heap-profiler.h +397 -0
- data/lib/libv8/v8/src/heap.cc +5930 -0
- data/lib/libv8/v8/src/heap.h +2268 -0
- data/lib/libv8/v8/src/hydrogen-instructions.cc +1769 -0
- data/lib/libv8/v8/src/hydrogen-instructions.h +3971 -0
- data/lib/libv8/v8/src/hydrogen.cc +6239 -0
- data/lib/libv8/v8/src/hydrogen.h +1202 -0
- data/lib/libv8/v8/src/ia32/assembler-ia32-inl.h +446 -0
- data/lib/libv8/v8/src/ia32/assembler-ia32.cc +2487 -0
- data/lib/libv8/v8/src/ia32/assembler-ia32.h +1144 -0
- data/lib/libv8/v8/src/ia32/builtins-ia32.cc +1621 -0
- data/lib/libv8/v8/src/ia32/code-stubs-ia32.cc +6198 -0
- data/lib/libv8/v8/src/ia32/code-stubs-ia32.h +517 -0
- data/lib/libv8/v8/src/ia32/codegen-ia32.cc +265 -0
- data/lib/libv8/v8/src/ia32/codegen-ia32.h +79 -0
- data/lib/libv8/v8/src/ia32/cpu-ia32.cc +88 -0
- data/lib/libv8/v8/src/ia32/debug-ia32.cc +312 -0
- data/lib/libv8/v8/src/ia32/deoptimizer-ia32.cc +774 -0
- data/lib/libv8/v8/src/ia32/disasm-ia32.cc +1628 -0
- data/lib/libv8/v8/src/ia32/frames-ia32.cc +45 -0
- data/lib/libv8/v8/src/ia32/frames-ia32.h +142 -0
- data/lib/libv8/v8/src/ia32/full-codegen-ia32.cc +4338 -0
- data/lib/libv8/v8/src/ia32/ic-ia32.cc +1597 -0
- data/lib/libv8/v8/src/ia32/lithium-codegen-ia32.cc +4461 -0
- data/lib/libv8/v8/src/ia32/lithium-codegen-ia32.h +375 -0
- data/lib/libv8/v8/src/ia32/lithium-gap-resolver-ia32.cc +475 -0
- data/lib/libv8/v8/src/ia32/lithium-gap-resolver-ia32.h +110 -0
- data/lib/libv8/v8/src/ia32/lithium-ia32.cc +2261 -0
- data/lib/libv8/v8/src/ia32/lithium-ia32.h +2396 -0
- data/lib/libv8/v8/src/ia32/macro-assembler-ia32.cc +2136 -0
- data/lib/libv8/v8/src/ia32/macro-assembler-ia32.h +775 -0
- data/lib/libv8/v8/src/ia32/regexp-macro-assembler-ia32.cc +1263 -0
- data/lib/libv8/v8/src/ia32/regexp-macro-assembler-ia32.h +216 -0
- data/lib/libv8/v8/src/ia32/simulator-ia32.cc +30 -0
- data/lib/libv8/v8/src/ia32/simulator-ia32.h +74 -0
- data/lib/libv8/v8/src/ia32/stub-cache-ia32.cc +3847 -0
- data/lib/libv8/v8/src/ic-inl.h +130 -0
- data/lib/libv8/v8/src/ic.cc +2577 -0
- data/lib/libv8/v8/src/ic.h +736 -0
- data/lib/libv8/v8/src/inspector.cc +63 -0
- data/lib/libv8/v8/src/inspector.h +62 -0
- data/lib/libv8/v8/src/interpreter-irregexp.cc +659 -0
- data/lib/libv8/v8/src/interpreter-irregexp.h +49 -0
- data/lib/libv8/v8/src/isolate-inl.h +50 -0
- data/lib/libv8/v8/src/isolate.cc +1869 -0
- data/lib/libv8/v8/src/isolate.h +1382 -0
- data/lib/libv8/v8/src/json-parser.cc +504 -0
- data/lib/libv8/v8/src/json-parser.h +161 -0
- data/lib/libv8/v8/src/json.js +342 -0
- data/lib/libv8/v8/src/jsregexp.cc +5385 -0
- data/lib/libv8/v8/src/jsregexp.h +1492 -0
- data/lib/libv8/v8/src/list-inl.h +212 -0
- data/lib/libv8/v8/src/list.h +174 -0
- data/lib/libv8/v8/src/lithium-allocator-inl.h +142 -0
- data/lib/libv8/v8/src/lithium-allocator.cc +2123 -0
- data/lib/libv8/v8/src/lithium-allocator.h +630 -0
- data/lib/libv8/v8/src/lithium.cc +190 -0
- data/lib/libv8/v8/src/lithium.h +597 -0
- data/lib/libv8/v8/src/liveedit-debugger.js +1082 -0
- data/lib/libv8/v8/src/liveedit.cc +1691 -0
- data/lib/libv8/v8/src/liveedit.h +180 -0
- data/lib/libv8/v8/src/liveobjectlist-inl.h +126 -0
- data/lib/libv8/v8/src/liveobjectlist.cc +2589 -0
- data/lib/libv8/v8/src/liveobjectlist.h +322 -0
- data/lib/libv8/v8/src/log-inl.h +59 -0
- data/lib/libv8/v8/src/log-utils.cc +428 -0
- data/lib/libv8/v8/src/log-utils.h +231 -0
- data/lib/libv8/v8/src/log.cc +1993 -0
- data/lib/libv8/v8/src/log.h +476 -0
- data/lib/libv8/v8/src/macro-assembler.h +120 -0
- data/lib/libv8/v8/src/macros.py +178 -0
- data/lib/libv8/v8/src/mark-compact.cc +3143 -0
- data/lib/libv8/v8/src/mark-compact.h +506 -0
- data/lib/libv8/v8/src/math.js +264 -0
- data/lib/libv8/v8/src/messages.cc +179 -0
- data/lib/libv8/v8/src/messages.h +113 -0
- data/lib/libv8/v8/src/messages.js +1096 -0
- data/lib/libv8/v8/src/mips/assembler-mips-inl.h +312 -0
- data/lib/libv8/v8/src/mips/assembler-mips.cc +1960 -0
- data/lib/libv8/v8/src/mips/assembler-mips.h +1138 -0
- data/lib/libv8/v8/src/mips/builtins-mips.cc +1628 -0
- data/lib/libv8/v8/src/mips/code-stubs-mips.cc +6656 -0
- data/lib/libv8/v8/src/mips/code-stubs-mips.h +682 -0
- data/lib/libv8/v8/src/mips/codegen-mips.cc +52 -0
- data/lib/libv8/v8/src/mips/codegen-mips.h +98 -0
- data/lib/libv8/v8/src/mips/constants-mips.cc +352 -0
- data/lib/libv8/v8/src/mips/constants-mips.h +739 -0
- data/lib/libv8/v8/src/mips/cpu-mips.cc +96 -0
- data/lib/libv8/v8/src/mips/debug-mips.cc +308 -0
- data/lib/libv8/v8/src/mips/deoptimizer-mips.cc +91 -0
- data/lib/libv8/v8/src/mips/disasm-mips.cc +1050 -0
- data/lib/libv8/v8/src/mips/frames-mips.cc +47 -0
- data/lib/libv8/v8/src/mips/frames-mips.h +219 -0
- data/lib/libv8/v8/src/mips/full-codegen-mips.cc +4388 -0
- data/lib/libv8/v8/src/mips/ic-mips.cc +1580 -0
- data/lib/libv8/v8/src/mips/lithium-codegen-mips.h +65 -0
- data/lib/libv8/v8/src/mips/lithium-mips.h +307 -0
- data/lib/libv8/v8/src/mips/macro-assembler-mips.cc +4056 -0
- data/lib/libv8/v8/src/mips/macro-assembler-mips.h +1214 -0
- data/lib/libv8/v8/src/mips/regexp-macro-assembler-mips.cc +1251 -0
- data/lib/libv8/v8/src/mips/regexp-macro-assembler-mips.h +252 -0
- data/lib/libv8/v8/src/mips/simulator-mips.cc +2621 -0
- data/lib/libv8/v8/src/mips/simulator-mips.h +401 -0
- data/lib/libv8/v8/src/mips/stub-cache-mips.cc +4285 -0
- data/lib/libv8/v8/src/mirror-debugger.js +2382 -0
- data/lib/libv8/v8/src/mksnapshot.cc +328 -0
- data/lib/libv8/v8/src/natives.h +64 -0
- data/lib/libv8/v8/src/objects-debug.cc +738 -0
- data/lib/libv8/v8/src/objects-inl.h +4323 -0
- data/lib/libv8/v8/src/objects-printer.cc +829 -0
- data/lib/libv8/v8/src/objects-visiting.cc +148 -0
- data/lib/libv8/v8/src/objects-visiting.h +424 -0
- data/lib/libv8/v8/src/objects.cc +10585 -0
- data/lib/libv8/v8/src/objects.h +6838 -0
- data/lib/libv8/v8/src/parser.cc +4997 -0
- data/lib/libv8/v8/src/parser.h +765 -0
- data/lib/libv8/v8/src/platform-cygwin.cc +779 -0
- data/lib/libv8/v8/src/platform-freebsd.cc +826 -0
- data/lib/libv8/v8/src/platform-linux.cc +1149 -0
- data/lib/libv8/v8/src/platform-macos.cc +830 -0
- data/lib/libv8/v8/src/platform-nullos.cc +479 -0
- data/lib/libv8/v8/src/platform-openbsd.cc +640 -0
- data/lib/libv8/v8/src/platform-posix.cc +424 -0
- data/lib/libv8/v8/src/platform-solaris.cc +762 -0
- data/lib/libv8/v8/src/platform-tls-mac.h +62 -0
- data/lib/libv8/v8/src/platform-tls-win32.h +62 -0
- data/lib/libv8/v8/src/platform-tls.h +50 -0
- data/lib/libv8/v8/src/platform-win32.cc +2021 -0
- data/lib/libv8/v8/src/platform.h +667 -0
- data/lib/libv8/v8/src/preparse-data-format.h +62 -0
- data/lib/libv8/v8/src/preparse-data.cc +183 -0
- data/lib/libv8/v8/src/preparse-data.h +225 -0
- data/lib/libv8/v8/src/preparser-api.cc +220 -0
- data/lib/libv8/v8/src/preparser.cc +1450 -0
- data/lib/libv8/v8/src/preparser.h +493 -0
- data/lib/libv8/v8/src/prettyprinter.cc +1493 -0
- data/lib/libv8/v8/src/prettyprinter.h +223 -0
- data/lib/libv8/v8/src/profile-generator-inl.h +128 -0
- data/lib/libv8/v8/src/profile-generator.cc +3098 -0
- data/lib/libv8/v8/src/profile-generator.h +1126 -0
- data/lib/libv8/v8/src/property.cc +105 -0
- data/lib/libv8/v8/src/property.h +365 -0
- data/lib/libv8/v8/src/proxy.js +83 -0
- data/lib/libv8/v8/src/regexp-macro-assembler-irregexp-inl.h +78 -0
- data/lib/libv8/v8/src/regexp-macro-assembler-irregexp.cc +471 -0
- data/lib/libv8/v8/src/regexp-macro-assembler-irregexp.h +142 -0
- data/lib/libv8/v8/src/regexp-macro-assembler-tracer.cc +373 -0
- data/lib/libv8/v8/src/regexp-macro-assembler-tracer.h +104 -0
- data/lib/libv8/v8/src/regexp-macro-assembler.cc +267 -0
- data/lib/libv8/v8/src/regexp-macro-assembler.h +243 -0
- data/lib/libv8/v8/src/regexp-stack.cc +111 -0
- data/lib/libv8/v8/src/regexp-stack.h +147 -0
- data/lib/libv8/v8/src/regexp.js +483 -0
- data/lib/libv8/v8/src/rewriter.cc +360 -0
- data/lib/libv8/v8/src/rewriter.h +50 -0
- data/lib/libv8/v8/src/runtime-profiler.cc +489 -0
- data/lib/libv8/v8/src/runtime-profiler.h +201 -0
- data/lib/libv8/v8/src/runtime.cc +12227 -0
- data/lib/libv8/v8/src/runtime.h +652 -0
- data/lib/libv8/v8/src/runtime.js +649 -0
- data/lib/libv8/v8/src/safepoint-table.cc +256 -0
- data/lib/libv8/v8/src/safepoint-table.h +270 -0
- data/lib/libv8/v8/src/scanner-base.cc +952 -0
- data/lib/libv8/v8/src/scanner-base.h +670 -0
- data/lib/libv8/v8/src/scanner.cc +345 -0
- data/lib/libv8/v8/src/scanner.h +146 -0
- data/lib/libv8/v8/src/scopeinfo.cc +646 -0
- data/lib/libv8/v8/src/scopeinfo.h +254 -0
- data/lib/libv8/v8/src/scopes.cc +1150 -0
- data/lib/libv8/v8/src/scopes.h +507 -0
- data/lib/libv8/v8/src/serialize.cc +1574 -0
- data/lib/libv8/v8/src/serialize.h +589 -0
- data/lib/libv8/v8/src/shell.h +55 -0
- data/lib/libv8/v8/src/simulator.h +43 -0
- data/lib/libv8/v8/src/small-pointer-list.h +163 -0
- data/lib/libv8/v8/src/smart-pointer.h +109 -0
- data/lib/libv8/v8/src/snapshot-common.cc +83 -0
- data/lib/libv8/v8/src/snapshot-empty.cc +54 -0
- data/lib/libv8/v8/src/snapshot.h +91 -0
- data/lib/libv8/v8/src/spaces-inl.h +529 -0
- data/lib/libv8/v8/src/spaces.cc +3145 -0
- data/lib/libv8/v8/src/spaces.h +2369 -0
- data/lib/libv8/v8/src/splay-tree-inl.h +310 -0
- data/lib/libv8/v8/src/splay-tree.h +205 -0
- data/lib/libv8/v8/src/string-search.cc +41 -0
- data/lib/libv8/v8/src/string-search.h +568 -0
- data/lib/libv8/v8/src/string-stream.cc +592 -0
- data/lib/libv8/v8/src/string-stream.h +191 -0
- data/lib/libv8/v8/src/string.js +994 -0
- data/lib/libv8/v8/src/strtod.cc +440 -0
- data/lib/libv8/v8/src/strtod.h +40 -0
- data/lib/libv8/v8/src/stub-cache.cc +1965 -0
- data/lib/libv8/v8/src/stub-cache.h +924 -0
- data/lib/libv8/v8/src/third_party/valgrind/valgrind.h +3925 -0
- data/lib/libv8/v8/src/token.cc +63 -0
- data/lib/libv8/v8/src/token.h +288 -0
- data/lib/libv8/v8/src/type-info.cc +507 -0
- data/lib/libv8/v8/src/type-info.h +272 -0
- data/lib/libv8/v8/src/unbound-queue-inl.h +95 -0
- data/lib/libv8/v8/src/unbound-queue.h +69 -0
- data/lib/libv8/v8/src/unicode-inl.h +238 -0
- data/lib/libv8/v8/src/unicode.cc +1624 -0
- data/lib/libv8/v8/src/unicode.h +280 -0
- data/lib/libv8/v8/src/uri.js +408 -0
- data/lib/libv8/v8/src/utils-inl.h +48 -0
- data/lib/libv8/v8/src/utils.cc +371 -0
- data/lib/libv8/v8/src/utils.h +800 -0
- data/lib/libv8/v8/src/v8-counters.cc +62 -0
- data/lib/libv8/v8/src/v8-counters.h +314 -0
- data/lib/libv8/v8/src/v8.cc +213 -0
- data/lib/libv8/v8/src/v8.h +131 -0
- data/lib/libv8/v8/src/v8checks.h +64 -0
- data/lib/libv8/v8/src/v8dll-main.cc +44 -0
- data/lib/libv8/v8/src/v8globals.h +512 -0
- data/lib/libv8/v8/src/v8memory.h +82 -0
- data/lib/libv8/v8/src/v8natives.js +1310 -0
- data/lib/libv8/v8/src/v8preparserdll-main.cc +39 -0
- data/lib/libv8/v8/src/v8threads.cc +464 -0
- data/lib/libv8/v8/src/v8threads.h +165 -0
- data/lib/libv8/v8/src/v8utils.h +319 -0
- data/lib/libv8/v8/src/variables.cc +114 -0
- data/lib/libv8/v8/src/variables.h +167 -0
- data/lib/libv8/v8/src/version.cc +116 -0
- data/lib/libv8/v8/src/version.h +68 -0
- data/lib/libv8/v8/src/vm-state-inl.h +138 -0
- data/lib/libv8/v8/src/vm-state.h +71 -0
- data/lib/libv8/v8/src/win32-headers.h +96 -0
- data/lib/libv8/v8/src/x64/assembler-x64-inl.h +462 -0
- data/lib/libv8/v8/src/x64/assembler-x64.cc +3027 -0
- data/lib/libv8/v8/src/x64/assembler-x64.h +1633 -0
- data/lib/libv8/v8/src/x64/builtins-x64.cc +1520 -0
- data/lib/libv8/v8/src/x64/code-stubs-x64.cc +5132 -0
- data/lib/libv8/v8/src/x64/code-stubs-x64.h +514 -0
- data/lib/libv8/v8/src/x64/codegen-x64.cc +146 -0
- data/lib/libv8/v8/src/x64/codegen-x64.h +76 -0
- data/lib/libv8/v8/src/x64/cpu-x64.cc +88 -0
- data/lib/libv8/v8/src/x64/debug-x64.cc +319 -0
- data/lib/libv8/v8/src/x64/deoptimizer-x64.cc +815 -0
- data/lib/libv8/v8/src/x64/disasm-x64.cc +1832 -0
- data/lib/libv8/v8/src/x64/frames-x64.cc +45 -0
- data/lib/libv8/v8/src/x64/frames-x64.h +130 -0
- data/lib/libv8/v8/src/x64/full-codegen-x64.cc +4318 -0
- data/lib/libv8/v8/src/x64/ic-x64.cc +1608 -0
- data/lib/libv8/v8/src/x64/lithium-codegen-x64.cc +4267 -0
- data/lib/libv8/v8/src/x64/lithium-codegen-x64.h +367 -0
- data/lib/libv8/v8/src/x64/lithium-gap-resolver-x64.cc +320 -0
- data/lib/libv8/v8/src/x64/lithium-gap-resolver-x64.h +74 -0
- data/lib/libv8/v8/src/x64/lithium-x64.cc +2202 -0
- data/lib/libv8/v8/src/x64/lithium-x64.h +2333 -0
- data/lib/libv8/v8/src/x64/macro-assembler-x64.cc +3745 -0
- data/lib/libv8/v8/src/x64/macro-assembler-x64.h +1290 -0
- data/lib/libv8/v8/src/x64/regexp-macro-assembler-x64.cc +1398 -0
- data/lib/libv8/v8/src/x64/regexp-macro-assembler-x64.h +282 -0
- data/lib/libv8/v8/src/x64/simulator-x64.cc +27 -0
- data/lib/libv8/v8/src/x64/simulator-x64.h +72 -0
- data/lib/libv8/v8/src/x64/stub-cache-x64.cc +3610 -0
- data/lib/libv8/v8/src/zone-inl.h +140 -0
- data/lib/libv8/v8/src/zone.cc +196 -0
- data/lib/libv8/v8/src/zone.h +240 -0
- data/lib/libv8/v8/tools/codemap.js +265 -0
- data/lib/libv8/v8/tools/consarray.js +93 -0
- data/lib/libv8/v8/tools/csvparser.js +78 -0
- data/lib/libv8/v8/tools/disasm.py +92 -0
- data/lib/libv8/v8/tools/freebsd-tick-processor +10 -0
- data/lib/libv8/v8/tools/gc-nvp-trace-processor.py +342 -0
- data/lib/libv8/v8/tools/gcmole/README +62 -0
- data/lib/libv8/v8/tools/gcmole/gccause.lua +60 -0
- data/lib/libv8/v8/tools/gcmole/gcmole.cc +1261 -0
- data/lib/libv8/v8/tools/gcmole/gcmole.lua +378 -0
- data/lib/libv8/v8/tools/generate-ten-powers.scm +286 -0
- data/lib/libv8/v8/tools/grokdump.py +841 -0
- data/lib/libv8/v8/tools/gyp/v8.gyp +995 -0
- data/lib/libv8/v8/tools/js2c.py +364 -0
- data/lib/libv8/v8/tools/jsmin.py +280 -0
- data/lib/libv8/v8/tools/linux-tick-processor +35 -0
- data/lib/libv8/v8/tools/ll_prof.py +942 -0
- data/lib/libv8/v8/tools/logreader.js +185 -0
- data/lib/libv8/v8/tools/mac-nm +18 -0
- data/lib/libv8/v8/tools/mac-tick-processor +6 -0
- data/lib/libv8/v8/tools/oom_dump/README +31 -0
- data/lib/libv8/v8/tools/oom_dump/SConstruct +42 -0
- data/lib/libv8/v8/tools/oom_dump/oom_dump.cc +288 -0
- data/lib/libv8/v8/tools/presubmit.py +305 -0
- data/lib/libv8/v8/tools/process-heap-prof.py +120 -0
- data/lib/libv8/v8/tools/profile.js +751 -0
- data/lib/libv8/v8/tools/profile_view.js +219 -0
- data/lib/libv8/v8/tools/run-valgrind.py +77 -0
- data/lib/libv8/v8/tools/splaytree.js +316 -0
- data/lib/libv8/v8/tools/stats-viewer.py +468 -0
- data/lib/libv8/v8/tools/test.py +1510 -0
- data/lib/libv8/v8/tools/tickprocessor-driver.js +59 -0
- data/lib/libv8/v8/tools/tickprocessor.js +877 -0
- data/lib/libv8/v8/tools/utils.py +96 -0
- data/lib/libv8/v8/tools/visual_studio/README.txt +12 -0
- data/lib/libv8/v8/tools/windows-tick-processor.bat +30 -0
- data/lib/libv8/version.rb +5 -0
- data/libv8.gemspec +36 -0
- metadata +578 -0
@@ -0,0 +1,375 @@
|
|
1
|
+
// Copyright 2011 the V8 project authors. All rights reserved.
|
2
|
+
// Redistribution and use in source and binary forms, with or without
|
3
|
+
// modification, are permitted provided that the following conditions are
|
4
|
+
// met:
|
5
|
+
//
|
6
|
+
// * Redistributions of source code must retain the above copyright
|
7
|
+
// notice, this list of conditions and the following disclaimer.
|
8
|
+
// * Redistributions in binary form must reproduce the above
|
9
|
+
// copyright notice, this list of conditions and the following
|
10
|
+
// disclaimer in the documentation and/or other materials provided
|
11
|
+
// with the distribution.
|
12
|
+
// * Neither the name of Google Inc. nor the names of its
|
13
|
+
// contributors may be used to endorse or promote products derived
|
14
|
+
// from this software without specific prior written permission.
|
15
|
+
//
|
16
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
17
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
18
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
19
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
20
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
21
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
22
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
23
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
24
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
25
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
26
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27
|
+
|
28
|
+
#ifndef V8_IA32_LITHIUM_CODEGEN_IA32_H_
|
29
|
+
#define V8_IA32_LITHIUM_CODEGEN_IA32_H_
|
30
|
+
|
31
|
+
#include "ia32/lithium-ia32.h"
|
32
|
+
|
33
|
+
#include "checks.h"
|
34
|
+
#include "deoptimizer.h"
|
35
|
+
#include "safepoint-table.h"
|
36
|
+
#include "scopes.h"
|
37
|
+
#include "ia32/lithium-gap-resolver-ia32.h"
|
38
|
+
|
39
|
+
namespace v8 {
|
40
|
+
namespace internal {
|
41
|
+
|
42
|
+
// Forward declarations.
|
43
|
+
class LDeferredCode;
|
44
|
+
class LGapNode;
|
45
|
+
class SafepointGenerator;
|
46
|
+
|
47
|
+
class LCodeGen BASE_EMBEDDED {
|
48
|
+
public:
|
49
|
+
LCodeGen(LChunk* chunk, MacroAssembler* assembler, CompilationInfo* info)
|
50
|
+
: chunk_(chunk),
|
51
|
+
masm_(assembler),
|
52
|
+
info_(info),
|
53
|
+
current_block_(-1),
|
54
|
+
current_instruction_(-1),
|
55
|
+
instructions_(chunk->instructions()),
|
56
|
+
deoptimizations_(4),
|
57
|
+
deoptimization_literals_(8),
|
58
|
+
inlined_function_count_(0),
|
59
|
+
scope_(info->scope()),
|
60
|
+
status_(UNUSED),
|
61
|
+
deferred_(8),
|
62
|
+
osr_pc_offset_(-1),
|
63
|
+
deoptimization_reloc_size(),
|
64
|
+
resolver_(this),
|
65
|
+
expected_safepoint_kind_(Safepoint::kSimple) {
|
66
|
+
PopulateDeoptimizationLiteralsWithInlinedFunctions();
|
67
|
+
}
|
68
|
+
|
69
|
+
// Simple accessors.
|
70
|
+
MacroAssembler* masm() const { return masm_; }
|
71
|
+
CompilationInfo* info() const { return info_; }
|
72
|
+
Isolate* isolate() const { return info_->isolate(); }
|
73
|
+
Factory* factory() const { return isolate()->factory(); }
|
74
|
+
Heap* heap() const { return isolate()->heap(); }
|
75
|
+
|
76
|
+
// Support for converting LOperands to assembler types.
|
77
|
+
Operand ToOperand(LOperand* op) const;
|
78
|
+
Register ToRegister(LOperand* op) const;
|
79
|
+
XMMRegister ToDoubleRegister(LOperand* op) const;
|
80
|
+
Immediate ToImmediate(LOperand* op);
|
81
|
+
|
82
|
+
// The operand denoting the second word (the one with a higher address) of
|
83
|
+
// a double stack slot.
|
84
|
+
Operand HighOperand(LOperand* op);
|
85
|
+
|
86
|
+
// Try to generate code for the entire chunk, but it may fail if the
|
87
|
+
// chunk contains constructs we cannot handle. Returns true if the
|
88
|
+
// code generation attempt succeeded.
|
89
|
+
bool GenerateCode();
|
90
|
+
|
91
|
+
// Finish the code by setting stack height, safepoint, and bailout
|
92
|
+
// information on it.
|
93
|
+
void FinishCode(Handle<Code> code);
|
94
|
+
|
95
|
+
// Deferred code support.
|
96
|
+
void DoDeferredNumberTagD(LNumberTagD* instr);
|
97
|
+
void DoDeferredNumberTagI(LNumberTagI* instr);
|
98
|
+
void DoDeferredTaggedToI(LTaggedToI* instr);
|
99
|
+
void DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr);
|
100
|
+
void DoDeferredStackCheck(LGoto* instr);
|
101
|
+
void DoDeferredStringCharCodeAt(LStringCharCodeAt* instr);
|
102
|
+
void DoDeferredStringCharFromCode(LStringCharFromCode* instr);
|
103
|
+
void DoDeferredLInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr,
|
104
|
+
Label* map_check);
|
105
|
+
|
106
|
+
// Parallel move support.
|
107
|
+
void DoParallelMove(LParallelMove* move);
|
108
|
+
void DoGap(LGap* instr);
|
109
|
+
|
110
|
+
// Emit frame translation commands for an environment.
|
111
|
+
void WriteTranslation(LEnvironment* environment, Translation* translation);
|
112
|
+
|
113
|
+
void EnsureRelocSpaceForDeoptimization();
|
114
|
+
|
115
|
+
// Declare methods that deal with the individual node types.
|
116
|
+
#define DECLARE_DO(type) void Do##type(L##type* node);
|
117
|
+
LITHIUM_CONCRETE_INSTRUCTION_LIST(DECLARE_DO)
|
118
|
+
#undef DECLARE_DO
|
119
|
+
|
120
|
+
private:
|
121
|
+
enum Status {
|
122
|
+
UNUSED,
|
123
|
+
GENERATING,
|
124
|
+
DONE,
|
125
|
+
ABORTED
|
126
|
+
};
|
127
|
+
|
128
|
+
bool is_unused() const { return status_ == UNUSED; }
|
129
|
+
bool is_generating() const { return status_ == GENERATING; }
|
130
|
+
bool is_done() const { return status_ == DONE; }
|
131
|
+
bool is_aborted() const { return status_ == ABORTED; }
|
132
|
+
|
133
|
+
int strict_mode_flag() const {
|
134
|
+
return info()->is_strict_mode() ? kStrictMode : kNonStrictMode;
|
135
|
+
}
|
136
|
+
|
137
|
+
LChunk* chunk() const { return chunk_; }
|
138
|
+
Scope* scope() const { return scope_; }
|
139
|
+
HGraph* graph() const { return chunk_->graph(); }
|
140
|
+
|
141
|
+
int GetNextEmittedBlock(int block);
|
142
|
+
LInstruction* GetNextInstruction();
|
143
|
+
|
144
|
+
void EmitClassOfTest(Label* if_true,
|
145
|
+
Label* if_false,
|
146
|
+
Handle<String> class_name,
|
147
|
+
Register input,
|
148
|
+
Register temporary,
|
149
|
+
Register temporary2);
|
150
|
+
|
151
|
+
int GetStackSlotCount() const { return chunk()->spill_slot_count(); }
|
152
|
+
int GetParameterCount() const { return scope()->num_parameters(); }
|
153
|
+
|
154
|
+
void Abort(const char* format, ...);
|
155
|
+
void Comment(const char* format, ...);
|
156
|
+
|
157
|
+
void AddDeferredCode(LDeferredCode* code) { deferred_.Add(code); }
|
158
|
+
|
159
|
+
// Code generation passes. Returns true if code generation should
|
160
|
+
// continue.
|
161
|
+
bool GeneratePrologue();
|
162
|
+
bool GenerateBody();
|
163
|
+
bool GenerateDeferredCode();
|
164
|
+
// Pad the reloc info to ensure that we have enough space to patch during
|
165
|
+
// deoptimization.
|
166
|
+
bool GenerateRelocPadding();
|
167
|
+
bool GenerateSafepointTable();
|
168
|
+
|
169
|
+
enum ContextMode {
|
170
|
+
RESTORE_CONTEXT,
|
171
|
+
CONTEXT_ADJUSTED
|
172
|
+
};
|
173
|
+
|
174
|
+
enum SafepointMode {
|
175
|
+
RECORD_SIMPLE_SAFEPOINT,
|
176
|
+
RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS
|
177
|
+
};
|
178
|
+
|
179
|
+
void CallCode(Handle<Code> code,
|
180
|
+
RelocInfo::Mode mode,
|
181
|
+
LInstruction* instr,
|
182
|
+
ContextMode context_mode);
|
183
|
+
|
184
|
+
void CallCodeGeneric(Handle<Code> code,
|
185
|
+
RelocInfo::Mode mode,
|
186
|
+
LInstruction* instr,
|
187
|
+
ContextMode context_mode,
|
188
|
+
SafepointMode safepoint_mode);
|
189
|
+
|
190
|
+
void CallRuntime(const Runtime::Function* fun,
|
191
|
+
int argc,
|
192
|
+
LInstruction* instr,
|
193
|
+
ContextMode context_mode);
|
194
|
+
|
195
|
+
void CallRuntime(Runtime::FunctionId id,
|
196
|
+
int argc,
|
197
|
+
LInstruction* instr,
|
198
|
+
ContextMode context_mode) {
|
199
|
+
const Runtime::Function* function = Runtime::FunctionForId(id);
|
200
|
+
CallRuntime(function, argc, instr, context_mode);
|
201
|
+
}
|
202
|
+
|
203
|
+
void CallRuntimeFromDeferred(Runtime::FunctionId id,
|
204
|
+
int argc,
|
205
|
+
LInstruction* instr);
|
206
|
+
|
207
|
+
// Generate a direct call to a known function. Expects the function
|
208
|
+
// to be in edi.
|
209
|
+
void CallKnownFunction(Handle<JSFunction> function,
|
210
|
+
int arity,
|
211
|
+
LInstruction* instr,
|
212
|
+
CallKind call_kind);
|
213
|
+
|
214
|
+
void LoadHeapObject(Register result, Handle<HeapObject> object);
|
215
|
+
|
216
|
+
void RegisterLazyDeoptimization(LInstruction* instr,
|
217
|
+
SafepointMode safepoint_mode);
|
218
|
+
|
219
|
+
void RegisterEnvironmentForDeoptimization(LEnvironment* environment);
|
220
|
+
void DeoptimizeIf(Condition cc, LEnvironment* environment);
|
221
|
+
|
222
|
+
void AddToTranslation(Translation* translation,
|
223
|
+
LOperand* op,
|
224
|
+
bool is_tagged);
|
225
|
+
void PopulateDeoptimizationData(Handle<Code> code);
|
226
|
+
int DefineDeoptimizationLiteral(Handle<Object> literal);
|
227
|
+
|
228
|
+
void PopulateDeoptimizationLiteralsWithInlinedFunctions();
|
229
|
+
|
230
|
+
Register ToRegister(int index) const;
|
231
|
+
XMMRegister ToDoubleRegister(int index) const;
|
232
|
+
int ToInteger32(LConstantOperand* op) const;
|
233
|
+
Operand BuildExternalArrayOperand(LOperand* external_pointer,
|
234
|
+
LOperand* key,
|
235
|
+
ExternalArrayType array_type);
|
236
|
+
|
237
|
+
// Specific math operations - used from DoUnaryMathOperation.
|
238
|
+
void EmitIntegerMathAbs(LUnaryMathOperation* instr);
|
239
|
+
void DoMathAbs(LUnaryMathOperation* instr);
|
240
|
+
void DoMathFloor(LUnaryMathOperation* instr);
|
241
|
+
void DoMathRound(LUnaryMathOperation* instr);
|
242
|
+
void DoMathSqrt(LUnaryMathOperation* instr);
|
243
|
+
void DoMathPowHalf(LUnaryMathOperation* instr);
|
244
|
+
void DoMathLog(LUnaryMathOperation* instr);
|
245
|
+
void DoMathCos(LUnaryMathOperation* instr);
|
246
|
+
void DoMathSin(LUnaryMathOperation* instr);
|
247
|
+
|
248
|
+
// Support for recording safepoint and position information.
|
249
|
+
void RecordSafepoint(LPointerMap* pointers,
|
250
|
+
Safepoint::Kind kind,
|
251
|
+
int arguments,
|
252
|
+
int deoptimization_index);
|
253
|
+
void RecordSafepoint(LPointerMap* pointers, int deoptimization_index);
|
254
|
+
void RecordSafepoint(int deoptimization_index);
|
255
|
+
void RecordSafepointWithRegisters(LPointerMap* pointers,
|
256
|
+
int arguments,
|
257
|
+
int deoptimization_index);
|
258
|
+
void RecordPosition(int position);
|
259
|
+
|
260
|
+
static Condition TokenToCondition(Token::Value op, bool is_unsigned);
|
261
|
+
void EmitGoto(int block, LDeferredCode* deferred_stack_check = NULL);
|
262
|
+
void EmitBranch(int left_block, int right_block, Condition cc);
|
263
|
+
void EmitCmpI(LOperand* left, LOperand* right);
|
264
|
+
void EmitNumberUntagD(Register input, XMMRegister result, LEnvironment* env);
|
265
|
+
|
266
|
+
// Emits optimized code for typeof x == "y". Modifies input register.
|
267
|
+
// Returns the condition on which a final split to
|
268
|
+
// true and false label should be made, to optimize fallthrough.
|
269
|
+
Condition EmitTypeofIs(Label* true_label, Label* false_label,
|
270
|
+
Register input, Handle<String> type_name);
|
271
|
+
|
272
|
+
// Emits optimized code for %_IsObject(x). Preserves input register.
|
273
|
+
// Returns the condition on which a final split to
|
274
|
+
// true and false label should be made, to optimize fallthrough.
|
275
|
+
Condition EmitIsObject(Register input,
|
276
|
+
Register temp1,
|
277
|
+
Register temp2,
|
278
|
+
Label* is_not_object,
|
279
|
+
Label* is_object);
|
280
|
+
|
281
|
+
// Emits optimized code for %_IsConstructCall().
|
282
|
+
// Caller should branch on equal condition.
|
283
|
+
void EmitIsConstructCall(Register temp);
|
284
|
+
|
285
|
+
void EmitLoadFieldOrConstantFunction(Register result,
|
286
|
+
Register object,
|
287
|
+
Handle<Map> type,
|
288
|
+
Handle<String> name);
|
289
|
+
|
290
|
+
LChunk* const chunk_;
|
291
|
+
MacroAssembler* const masm_;
|
292
|
+
CompilationInfo* const info_;
|
293
|
+
|
294
|
+
int current_block_;
|
295
|
+
int current_instruction_;
|
296
|
+
const ZoneList<LInstruction*>* instructions_;
|
297
|
+
ZoneList<LEnvironment*> deoptimizations_;
|
298
|
+
ZoneList<Handle<Object> > deoptimization_literals_;
|
299
|
+
int inlined_function_count_;
|
300
|
+
Scope* const scope_;
|
301
|
+
Status status_;
|
302
|
+
TranslationBuffer translations_;
|
303
|
+
ZoneList<LDeferredCode*> deferred_;
|
304
|
+
int osr_pc_offset_;
|
305
|
+
|
306
|
+
struct DeoptimizationRelocSize {
|
307
|
+
int min_size;
|
308
|
+
int last_pc_offset;
|
309
|
+
};
|
310
|
+
|
311
|
+
DeoptimizationRelocSize deoptimization_reloc_size;
|
312
|
+
|
313
|
+
// Builder that keeps track of safepoints in the code. The table
|
314
|
+
// itself is emitted at the end of the generated code.
|
315
|
+
SafepointTableBuilder safepoints_;
|
316
|
+
|
317
|
+
// Compiler from a set of parallel moves to a sequential list of moves.
|
318
|
+
LGapResolver resolver_;
|
319
|
+
|
320
|
+
Safepoint::Kind expected_safepoint_kind_;
|
321
|
+
|
322
|
+
class PushSafepointRegistersScope BASE_EMBEDDED {
|
323
|
+
public:
|
324
|
+
explicit PushSafepointRegistersScope(LCodeGen* codegen)
|
325
|
+
: codegen_(codegen) {
|
326
|
+
ASSERT(codegen_->expected_safepoint_kind_ == Safepoint::kSimple);
|
327
|
+
codegen_->masm_->PushSafepointRegisters();
|
328
|
+
codegen_->expected_safepoint_kind_ = Safepoint::kWithRegisters;
|
329
|
+
}
|
330
|
+
|
331
|
+
~PushSafepointRegistersScope() {
|
332
|
+
ASSERT(codegen_->expected_safepoint_kind_ == Safepoint::kWithRegisters);
|
333
|
+
codegen_->masm_->PopSafepointRegisters();
|
334
|
+
codegen_->expected_safepoint_kind_ = Safepoint::kSimple;
|
335
|
+
}
|
336
|
+
|
337
|
+
private:
|
338
|
+
LCodeGen* codegen_;
|
339
|
+
};
|
340
|
+
|
341
|
+
friend class LDeferredCode;
|
342
|
+
friend class LEnvironment;
|
343
|
+
friend class SafepointGenerator;
|
344
|
+
DISALLOW_COPY_AND_ASSIGN(LCodeGen);
|
345
|
+
};
|
346
|
+
|
347
|
+
|
348
|
+
class LDeferredCode: public ZoneObject {
|
349
|
+
public:
|
350
|
+
explicit LDeferredCode(LCodeGen* codegen)
|
351
|
+
: codegen_(codegen), external_exit_(NULL) {
|
352
|
+
codegen->AddDeferredCode(this);
|
353
|
+
}
|
354
|
+
|
355
|
+
virtual ~LDeferredCode() { }
|
356
|
+
virtual void Generate() = 0;
|
357
|
+
|
358
|
+
void SetExit(Label *exit) { external_exit_ = exit; }
|
359
|
+
Label* entry() { return &entry_; }
|
360
|
+
Label* exit() { return external_exit_ != NULL ? external_exit_ : &exit_; }
|
361
|
+
|
362
|
+
protected:
|
363
|
+
LCodeGen* codegen() const { return codegen_; }
|
364
|
+
MacroAssembler* masm() const { return codegen_->masm(); }
|
365
|
+
|
366
|
+
private:
|
367
|
+
LCodeGen* codegen_;
|
368
|
+
Label entry_;
|
369
|
+
Label exit_;
|
370
|
+
Label* external_exit_;
|
371
|
+
};
|
372
|
+
|
373
|
+
} } // namespace v8::internal
|
374
|
+
|
375
|
+
#endif // V8_IA32_LITHIUM_CODEGEN_IA32_H_
|
@@ -0,0 +1,475 @@
|
|
1
|
+
// Copyright 2011 the V8 project authors. All rights reserved.
|
2
|
+
// Redistribution and use in source and binary forms, with or without
|
3
|
+
// modification, are permitted provided that the following conditions are
|
4
|
+
// met:
|
5
|
+
//
|
6
|
+
// * Redistributions of source code must retain the above copyright
|
7
|
+
// notice, this list of conditions and the following disclaimer.
|
8
|
+
// * Redistributions in binary form must reproduce the above
|
9
|
+
// copyright notice, this list of conditions and the following
|
10
|
+
// disclaimer in the documentation and/or other materials provided
|
11
|
+
// with the distribution.
|
12
|
+
// * Neither the name of Google Inc. nor the names of its
|
13
|
+
// contributors may be used to endorse or promote products derived
|
14
|
+
// from this software without specific prior written permission.
|
15
|
+
//
|
16
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
17
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
18
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
19
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
20
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
21
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
22
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
23
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
24
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
25
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
26
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27
|
+
|
28
|
+
#include "v8.h"
|
29
|
+
|
30
|
+
#if defined(V8_TARGET_ARCH_IA32)
|
31
|
+
|
32
|
+
#include "ia32/lithium-gap-resolver-ia32.h"
|
33
|
+
#include "ia32/lithium-codegen-ia32.h"
|
34
|
+
|
35
|
+
namespace v8 {
|
36
|
+
namespace internal {
|
37
|
+
|
38
|
+
LGapResolver::LGapResolver(LCodeGen* owner)
|
39
|
+
: cgen_(owner),
|
40
|
+
moves_(32),
|
41
|
+
source_uses_(),
|
42
|
+
destination_uses_(),
|
43
|
+
spilled_register_(-1) {}
|
44
|
+
|
45
|
+
|
46
|
+
void LGapResolver::Resolve(LParallelMove* parallel_move) {
|
47
|
+
ASSERT(HasBeenReset());
|
48
|
+
// Build up a worklist of moves.
|
49
|
+
BuildInitialMoveList(parallel_move);
|
50
|
+
|
51
|
+
for (int i = 0; i < moves_.length(); ++i) {
|
52
|
+
LMoveOperands move = moves_[i];
|
53
|
+
// Skip constants to perform them last. They don't block other moves
|
54
|
+
// and skipping such moves with register destinations keeps those
|
55
|
+
// registers free for the whole algorithm.
|
56
|
+
if (!move.IsEliminated() && !move.source()->IsConstantOperand()) {
|
57
|
+
PerformMove(i);
|
58
|
+
}
|
59
|
+
}
|
60
|
+
|
61
|
+
// Perform the moves with constant sources.
|
62
|
+
for (int i = 0; i < moves_.length(); ++i) {
|
63
|
+
if (!moves_[i].IsEliminated()) {
|
64
|
+
ASSERT(moves_[i].source()->IsConstantOperand());
|
65
|
+
EmitMove(i);
|
66
|
+
}
|
67
|
+
}
|
68
|
+
|
69
|
+
Finish();
|
70
|
+
ASSERT(HasBeenReset());
|
71
|
+
}
|
72
|
+
|
73
|
+
|
74
|
+
void LGapResolver::BuildInitialMoveList(LParallelMove* parallel_move) {
|
75
|
+
// Perform a linear sweep of the moves to add them to the initial list of
|
76
|
+
// moves to perform, ignoring any move that is redundant (the source is
|
77
|
+
// the same as the destination, the destination is ignored and
|
78
|
+
// unallocated, or the move was already eliminated).
|
79
|
+
const ZoneList<LMoveOperands>* moves = parallel_move->move_operands();
|
80
|
+
for (int i = 0; i < moves->length(); ++i) {
|
81
|
+
LMoveOperands move = moves->at(i);
|
82
|
+
if (!move.IsRedundant()) AddMove(move);
|
83
|
+
}
|
84
|
+
Verify();
|
85
|
+
}
|
86
|
+
|
87
|
+
|
88
|
+
void LGapResolver::PerformMove(int index) {
|
89
|
+
// Each call to this function performs a move and deletes it from the move
|
90
|
+
// graph. We first recursively perform any move blocking this one. We
|
91
|
+
// mark a move as "pending" on entry to PerformMove in order to detect
|
92
|
+
// cycles in the move graph. We use operand swaps to resolve cycles,
|
93
|
+
// which means that a call to PerformMove could change any source operand
|
94
|
+
// in the move graph.
|
95
|
+
|
96
|
+
ASSERT(!moves_[index].IsPending());
|
97
|
+
ASSERT(!moves_[index].IsRedundant());
|
98
|
+
|
99
|
+
// Clear this move's destination to indicate a pending move. The actual
|
100
|
+
// destination is saved on the side.
|
101
|
+
ASSERT(moves_[index].source() != NULL); // Or else it will look eliminated.
|
102
|
+
LOperand* destination = moves_[index].destination();
|
103
|
+
moves_[index].set_destination(NULL);
|
104
|
+
|
105
|
+
// Perform a depth-first traversal of the move graph to resolve
|
106
|
+
// dependencies. Any unperformed, unpending move with a source the same
|
107
|
+
// as this one's destination blocks this one so recursively perform all
|
108
|
+
// such moves.
|
109
|
+
for (int i = 0; i < moves_.length(); ++i) {
|
110
|
+
LMoveOperands other_move = moves_[i];
|
111
|
+
if (other_move.Blocks(destination) && !other_move.IsPending()) {
|
112
|
+
// Though PerformMove can change any source operand in the move graph,
|
113
|
+
// this call cannot create a blocking move via a swap (this loop does
|
114
|
+
// not miss any). Assume there is a non-blocking move with source A
|
115
|
+
// and this move is blocked on source B and there is a swap of A and
|
116
|
+
// B. Then A and B must be involved in the same cycle (or they would
|
117
|
+
// not be swapped). Since this move's destination is B and there is
|
118
|
+
// only a single incoming edge to an operand, this move must also be
|
119
|
+
// involved in the same cycle. In that case, the blocking move will
|
120
|
+
// be created but will be "pending" when we return from PerformMove.
|
121
|
+
PerformMove(i);
|
122
|
+
}
|
123
|
+
}
|
124
|
+
|
125
|
+
// We are about to resolve this move and don't need it marked as
|
126
|
+
// pending, so restore its destination.
|
127
|
+
moves_[index].set_destination(destination);
|
128
|
+
|
129
|
+
// This move's source may have changed due to swaps to resolve cycles and
|
130
|
+
// so it may now be the last move in the cycle. If so remove it.
|
131
|
+
if (moves_[index].source()->Equals(destination)) {
|
132
|
+
RemoveMove(index);
|
133
|
+
return;
|
134
|
+
}
|
135
|
+
|
136
|
+
// The move may be blocked on a (at most one) pending move, in which case
|
137
|
+
// we have a cycle. Search for such a blocking move and perform a swap to
|
138
|
+
// resolve it.
|
139
|
+
for (int i = 0; i < moves_.length(); ++i) {
|
140
|
+
LMoveOperands other_move = moves_[i];
|
141
|
+
if (other_move.Blocks(destination)) {
|
142
|
+
ASSERT(other_move.IsPending());
|
143
|
+
EmitSwap(index);
|
144
|
+
return;
|
145
|
+
}
|
146
|
+
}
|
147
|
+
|
148
|
+
// This move is not blocked.
|
149
|
+
EmitMove(index);
|
150
|
+
}
|
151
|
+
|
152
|
+
|
153
|
+
void LGapResolver::AddMove(LMoveOperands move) {
|
154
|
+
LOperand* source = move.source();
|
155
|
+
if (source->IsRegister()) ++source_uses_[source->index()];
|
156
|
+
|
157
|
+
LOperand* destination = move.destination();
|
158
|
+
if (destination->IsRegister()) ++destination_uses_[destination->index()];
|
159
|
+
|
160
|
+
moves_.Add(move);
|
161
|
+
}
|
162
|
+
|
163
|
+
|
164
|
+
void LGapResolver::RemoveMove(int index) {
|
165
|
+
LOperand* source = moves_[index].source();
|
166
|
+
if (source->IsRegister()) {
|
167
|
+
--source_uses_[source->index()];
|
168
|
+
ASSERT(source_uses_[source->index()] >= 0);
|
169
|
+
}
|
170
|
+
|
171
|
+
LOperand* destination = moves_[index].destination();
|
172
|
+
if (destination->IsRegister()) {
|
173
|
+
--destination_uses_[destination->index()];
|
174
|
+
ASSERT(destination_uses_[destination->index()] >= 0);
|
175
|
+
}
|
176
|
+
|
177
|
+
moves_[index].Eliminate();
|
178
|
+
}
|
179
|
+
|
180
|
+
|
181
|
+
int LGapResolver::CountSourceUses(LOperand* operand) {
|
182
|
+
int count = 0;
|
183
|
+
for (int i = 0; i < moves_.length(); ++i) {
|
184
|
+
if (!moves_[i].IsEliminated() && moves_[i].source()->Equals(operand)) {
|
185
|
+
++count;
|
186
|
+
}
|
187
|
+
}
|
188
|
+
return count;
|
189
|
+
}
|
190
|
+
|
191
|
+
|
192
|
+
Register LGapResolver::GetFreeRegisterNot(Register reg) {
|
193
|
+
int skip_index = reg.is(no_reg) ? -1 : Register::ToAllocationIndex(reg);
|
194
|
+
for (int i = 0; i < Register::kNumAllocatableRegisters; ++i) {
|
195
|
+
if (source_uses_[i] == 0 && destination_uses_[i] > 0 && i != skip_index) {
|
196
|
+
return Register::FromAllocationIndex(i);
|
197
|
+
}
|
198
|
+
}
|
199
|
+
return no_reg;
|
200
|
+
}
|
201
|
+
|
202
|
+
|
203
|
+
bool LGapResolver::HasBeenReset() {
|
204
|
+
if (!moves_.is_empty()) return false;
|
205
|
+
if (spilled_register_ >= 0) return false;
|
206
|
+
|
207
|
+
for (int i = 0; i < Register::kNumAllocatableRegisters; ++i) {
|
208
|
+
if (source_uses_[i] != 0) return false;
|
209
|
+
if (destination_uses_[i] != 0) return false;
|
210
|
+
}
|
211
|
+
return true;
|
212
|
+
}
|
213
|
+
|
214
|
+
|
215
|
+
void LGapResolver::Verify() {
|
216
|
+
#ifdef ENABLE_SLOW_ASSERTS
|
217
|
+
// No operand should be the destination for more than one move.
|
218
|
+
for (int i = 0; i < moves_.length(); ++i) {
|
219
|
+
LOperand* destination = moves_[i].destination();
|
220
|
+
for (int j = i + 1; j < moves_.length(); ++j) {
|
221
|
+
SLOW_ASSERT(!destination->Equals(moves_[j].destination()));
|
222
|
+
}
|
223
|
+
}
|
224
|
+
#endif
|
225
|
+
}
|
226
|
+
|
227
|
+
|
228
|
+
#define __ ACCESS_MASM(cgen_->masm())
|
229
|
+
|
230
|
+
void LGapResolver::Finish() {
|
231
|
+
if (spilled_register_ >= 0) {
|
232
|
+
__ pop(Register::FromAllocationIndex(spilled_register_));
|
233
|
+
spilled_register_ = -1;
|
234
|
+
}
|
235
|
+
moves_.Rewind(0);
|
236
|
+
}
|
237
|
+
|
238
|
+
|
239
|
+
void LGapResolver::EnsureRestored(LOperand* operand) {
|
240
|
+
if (operand->IsRegister() && operand->index() == spilled_register_) {
|
241
|
+
__ pop(Register::FromAllocationIndex(spilled_register_));
|
242
|
+
spilled_register_ = -1;
|
243
|
+
}
|
244
|
+
}
|
245
|
+
|
246
|
+
|
247
|
+
Register LGapResolver::EnsureTempRegister() {
|
248
|
+
// 1. We may have already spilled to create a temp register.
|
249
|
+
if (spilled_register_ >= 0) {
|
250
|
+
return Register::FromAllocationIndex(spilled_register_);
|
251
|
+
}
|
252
|
+
|
253
|
+
// 2. We may have a free register that we can use without spilling.
|
254
|
+
Register free = GetFreeRegisterNot(no_reg);
|
255
|
+
if (!free.is(no_reg)) return free;
|
256
|
+
|
257
|
+
// 3. Prefer to spill a register that is not used in any remaining move
|
258
|
+
// because it will not need to be restored until the end.
|
259
|
+
for (int i = 0; i < Register::kNumAllocatableRegisters; ++i) {
|
260
|
+
if (source_uses_[i] == 0 && destination_uses_[i] == 0) {
|
261
|
+
Register scratch = Register::FromAllocationIndex(i);
|
262
|
+
__ push(scratch);
|
263
|
+
spilled_register_ = i;
|
264
|
+
return scratch;
|
265
|
+
}
|
266
|
+
}
|
267
|
+
|
268
|
+
// 4. Use an arbitrary register. Register 0 is as arbitrary as any other.
|
269
|
+
Register scratch = Register::FromAllocationIndex(0);
|
270
|
+
__ push(scratch);
|
271
|
+
spilled_register_ = 0;
|
272
|
+
return scratch;
|
273
|
+
}
|
274
|
+
|
275
|
+
|
276
|
+
void LGapResolver::EmitMove(int index) {
|
277
|
+
LOperand* source = moves_[index].source();
|
278
|
+
LOperand* destination = moves_[index].destination();
|
279
|
+
EnsureRestored(source);
|
280
|
+
EnsureRestored(destination);
|
281
|
+
|
282
|
+
// Dispatch on the source and destination operand kinds. Not all
|
283
|
+
// combinations are possible.
|
284
|
+
if (source->IsRegister()) {
|
285
|
+
ASSERT(destination->IsRegister() || destination->IsStackSlot());
|
286
|
+
Register src = cgen_->ToRegister(source);
|
287
|
+
Operand dst = cgen_->ToOperand(destination);
|
288
|
+
__ mov(dst, src);
|
289
|
+
|
290
|
+
} else if (source->IsStackSlot()) {
|
291
|
+
ASSERT(destination->IsRegister() || destination->IsStackSlot());
|
292
|
+
Operand src = cgen_->ToOperand(source);
|
293
|
+
if (destination->IsRegister()) {
|
294
|
+
Register dst = cgen_->ToRegister(destination);
|
295
|
+
__ mov(dst, src);
|
296
|
+
} else {
|
297
|
+
// Spill on demand to use a temporary register for memory-to-memory
|
298
|
+
// moves.
|
299
|
+
Register tmp = EnsureTempRegister();
|
300
|
+
Operand dst = cgen_->ToOperand(destination);
|
301
|
+
__ mov(tmp, src);
|
302
|
+
__ mov(dst, tmp);
|
303
|
+
}
|
304
|
+
|
305
|
+
} else if (source->IsConstantOperand()) {
|
306
|
+
ASSERT(destination->IsRegister() || destination->IsStackSlot());
|
307
|
+
Immediate src = cgen_->ToImmediate(source);
|
308
|
+
Operand dst = cgen_->ToOperand(destination);
|
309
|
+
__ mov(dst, src);
|
310
|
+
|
311
|
+
} else if (source->IsDoubleRegister()) {
|
312
|
+
XMMRegister src = cgen_->ToDoubleRegister(source);
|
313
|
+
if (destination->IsDoubleRegister()) {
|
314
|
+
XMMRegister dst = cgen_->ToDoubleRegister(destination);
|
315
|
+
__ movaps(dst, src);
|
316
|
+
} else {
|
317
|
+
ASSERT(destination->IsDoubleStackSlot());
|
318
|
+
Operand dst = cgen_->ToOperand(destination);
|
319
|
+
__ movdbl(dst, src);
|
320
|
+
}
|
321
|
+
} else if (source->IsDoubleStackSlot()) {
|
322
|
+
ASSERT(destination->IsDoubleRegister() ||
|
323
|
+
destination->IsDoubleStackSlot());
|
324
|
+
Operand src = cgen_->ToOperand(source);
|
325
|
+
if (destination->IsDoubleRegister()) {
|
326
|
+
XMMRegister dst = cgen_->ToDoubleRegister(destination);
|
327
|
+
__ movdbl(dst, src);
|
328
|
+
} else {
|
329
|
+
// We rely on having xmm0 available as a fixed scratch register.
|
330
|
+
Operand dst = cgen_->ToOperand(destination);
|
331
|
+
__ movdbl(xmm0, src);
|
332
|
+
__ movdbl(dst, xmm0);
|
333
|
+
}
|
334
|
+
|
335
|
+
} else {
|
336
|
+
UNREACHABLE();
|
337
|
+
}
|
338
|
+
|
339
|
+
RemoveMove(index);
|
340
|
+
}
|
341
|
+
|
342
|
+
|
343
|
+
void LGapResolver::EmitSwap(int index) {
|
344
|
+
LOperand* source = moves_[index].source();
|
345
|
+
LOperand* destination = moves_[index].destination();
|
346
|
+
EnsureRestored(source);
|
347
|
+
EnsureRestored(destination);
|
348
|
+
|
349
|
+
// Dispatch on the source and destination operand kinds. Not all
|
350
|
+
// combinations are possible.
|
351
|
+
if (source->IsRegister() && destination->IsRegister()) {
|
352
|
+
// Register-register.
|
353
|
+
Register src = cgen_->ToRegister(source);
|
354
|
+
Register dst = cgen_->ToRegister(destination);
|
355
|
+
__ xchg(dst, src);
|
356
|
+
|
357
|
+
} else if ((source->IsRegister() && destination->IsStackSlot()) ||
|
358
|
+
(source->IsStackSlot() && destination->IsRegister())) {
|
359
|
+
// Register-memory. Use a free register as a temp if possible. Do not
|
360
|
+
// spill on demand because the simple spill implementation cannot avoid
|
361
|
+
// spilling src at this point.
|
362
|
+
Register tmp = GetFreeRegisterNot(no_reg);
|
363
|
+
Register reg =
|
364
|
+
cgen_->ToRegister(source->IsRegister() ? source : destination);
|
365
|
+
Operand mem =
|
366
|
+
cgen_->ToOperand(source->IsRegister() ? destination : source);
|
367
|
+
if (tmp.is(no_reg)) {
|
368
|
+
__ xor_(reg, mem);
|
369
|
+
__ xor_(mem, reg);
|
370
|
+
__ xor_(reg, mem);
|
371
|
+
} else {
|
372
|
+
__ mov(tmp, mem);
|
373
|
+
__ mov(mem, reg);
|
374
|
+
__ mov(reg, tmp);
|
375
|
+
}
|
376
|
+
|
377
|
+
} else if (source->IsStackSlot() && destination->IsStackSlot()) {
|
378
|
+
// Memory-memory. Spill on demand to use a temporary. If there is a
|
379
|
+
// free register after that, use it as a second temporary.
|
380
|
+
Register tmp0 = EnsureTempRegister();
|
381
|
+
Register tmp1 = GetFreeRegisterNot(tmp0);
|
382
|
+
Operand src = cgen_->ToOperand(source);
|
383
|
+
Operand dst = cgen_->ToOperand(destination);
|
384
|
+
if (tmp1.is(no_reg)) {
|
385
|
+
// Only one temp register available to us.
|
386
|
+
__ mov(tmp0, dst);
|
387
|
+
__ xor_(tmp0, src);
|
388
|
+
__ xor_(src, tmp0);
|
389
|
+
__ xor_(tmp0, src);
|
390
|
+
__ mov(dst, tmp0);
|
391
|
+
} else {
|
392
|
+
__ mov(tmp0, dst);
|
393
|
+
__ mov(tmp1, src);
|
394
|
+
__ mov(dst, tmp1);
|
395
|
+
__ mov(src, tmp0);
|
396
|
+
}
|
397
|
+
} else if (source->IsDoubleRegister() && destination->IsDoubleRegister()) {
|
398
|
+
// XMM register-register swap. We rely on having xmm0
|
399
|
+
// available as a fixed scratch register.
|
400
|
+
XMMRegister src = cgen_->ToDoubleRegister(source);
|
401
|
+
XMMRegister dst = cgen_->ToDoubleRegister(destination);
|
402
|
+
__ movaps(xmm0, src);
|
403
|
+
__ movaps(src, dst);
|
404
|
+
__ movaps(dst, xmm0);
|
405
|
+
|
406
|
+
} else if (source->IsDoubleRegister() || destination->IsDoubleRegister()) {
|
407
|
+
// XMM register-memory swap. We rely on having xmm0
|
408
|
+
// available as a fixed scratch register.
|
409
|
+
ASSERT(source->IsDoubleStackSlot() || destination->IsDoubleStackSlot());
|
410
|
+
XMMRegister reg = cgen_->ToDoubleRegister(source->IsDoubleRegister()
|
411
|
+
? source
|
412
|
+
: destination);
|
413
|
+
Operand other =
|
414
|
+
cgen_->ToOperand(source->IsDoubleRegister() ? destination : source);
|
415
|
+
__ movdbl(xmm0, other);
|
416
|
+
__ movdbl(other, reg);
|
417
|
+
__ movdbl(reg, Operand(xmm0));
|
418
|
+
|
419
|
+
} else if (source->IsDoubleStackSlot() && destination->IsDoubleStackSlot()) {
|
420
|
+
// Double-width memory-to-memory. Spill on demand to use a general
|
421
|
+
// purpose temporary register and also rely on having xmm0 available as
|
422
|
+
// a fixed scratch register.
|
423
|
+
Register tmp = EnsureTempRegister();
|
424
|
+
Operand src0 = cgen_->ToOperand(source);
|
425
|
+
Operand src1 = cgen_->HighOperand(source);
|
426
|
+
Operand dst0 = cgen_->ToOperand(destination);
|
427
|
+
Operand dst1 = cgen_->HighOperand(destination);
|
428
|
+
__ movdbl(xmm0, dst0); // Save destination in xmm0.
|
429
|
+
__ mov(tmp, src0); // Then use tmp to copy source to destination.
|
430
|
+
__ mov(dst0, tmp);
|
431
|
+
__ mov(tmp, src1);
|
432
|
+
__ mov(dst1, tmp);
|
433
|
+
__ movdbl(src0, xmm0);
|
434
|
+
|
435
|
+
} else {
|
436
|
+
// No other combinations are possible.
|
437
|
+
UNREACHABLE();
|
438
|
+
}
|
439
|
+
|
440
|
+
// The swap of source and destination has executed a move from source to
|
441
|
+
// destination.
|
442
|
+
RemoveMove(index);
|
443
|
+
|
444
|
+
// Any unperformed (including pending) move with a source of either
|
445
|
+
// this move's source or destination needs to have their source
|
446
|
+
// changed to reflect the state of affairs after the swap.
|
447
|
+
for (int i = 0; i < moves_.length(); ++i) {
|
448
|
+
LMoveOperands other_move = moves_[i];
|
449
|
+
if (other_move.Blocks(source)) {
|
450
|
+
moves_[i].set_source(destination);
|
451
|
+
} else if (other_move.Blocks(destination)) {
|
452
|
+
moves_[i].set_source(source);
|
453
|
+
}
|
454
|
+
}
|
455
|
+
|
456
|
+
// In addition to swapping the actual uses as sources, we need to update
|
457
|
+
// the use counts.
|
458
|
+
if (source->IsRegister() && destination->IsRegister()) {
|
459
|
+
int temp = source_uses_[source->index()];
|
460
|
+
source_uses_[source->index()] = source_uses_[destination->index()];
|
461
|
+
source_uses_[destination->index()] = temp;
|
462
|
+
} else if (source->IsRegister()) {
|
463
|
+
// We don't have use counts for non-register operands like destination.
|
464
|
+
// Compute those counts now.
|
465
|
+
source_uses_[source->index()] = CountSourceUses(source);
|
466
|
+
} else if (destination->IsRegister()) {
|
467
|
+
source_uses_[destination->index()] = CountSourceUses(destination);
|
468
|
+
}
|
469
|
+
}
|
470
|
+
|
471
|
+
#undef __
|
472
|
+
|
473
|
+
} } // namespace v8::internal
|
474
|
+
|
475
|
+
#endif // V8_TARGET_ARCH_IA32
|