therubyracer 0.8.1.pre2 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of therubyracer might be problematic. Click here for more details.
- data/Changelog.md +2 -1
- data/README.md +6 -3
- data/ext/v8/upstream/3.1.8/.gitignore +31 -0
- data/ext/v8/upstream/3.1.8/AUTHORS +40 -0
- data/ext/v8/upstream/3.1.8/ChangeLog +2566 -0
- data/ext/v8/upstream/3.1.8/LICENSE +52 -0
- data/ext/v8/upstream/3.1.8/LICENSE.strongtalk +29 -0
- data/ext/v8/upstream/3.1.8/LICENSE.v8 +26 -0
- data/ext/v8/upstream/3.1.8/LICENSE.valgrind +45 -0
- data/ext/v8/upstream/3.1.8/SConstruct +1192 -0
- data/ext/v8/upstream/3.1.8/build/README.txt +25 -0
- data/ext/v8/upstream/3.1.8/build/all.gyp +18 -0
- data/ext/v8/upstream/3.1.8/build/armu.gypi +32 -0
- data/ext/v8/upstream/3.1.8/build/common.gypi +82 -0
- data/ext/v8/upstream/3.1.8/build/gyp_v8 +145 -0
- data/ext/v8/upstream/3.1.8/include/v8-debug.h +384 -0
- data/ext/v8/upstream/3.1.8/include/v8-preparser.h +116 -0
- data/ext/v8/upstream/3.1.8/include/v8-profiler.h +426 -0
- data/ext/v8/upstream/3.1.8/include/v8-testing.h +99 -0
- data/ext/v8/upstream/3.1.8/include/v8.h +3846 -0
- data/ext/v8/upstream/3.1.8/include/v8stdint.h +53 -0
- data/ext/v8/upstream/3.1.8/preparser/preparser-process.cc +206 -0
- data/ext/v8/upstream/3.1.8/src/SConscript +356 -0
- data/ext/v8/upstream/3.1.8/src/accessors.cc +907 -0
- data/ext/v8/upstream/3.1.8/src/accessors.h +121 -0
- data/ext/v8/upstream/3.1.8/src/allocation.cc +204 -0
- data/ext/v8/upstream/3.1.8/src/allocation.h +176 -0
- data/ext/v8/upstream/3.1.8/src/api.cc +5191 -0
- data/ext/v8/upstream/3.1.8/src/api.h +508 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/apinatives.js +0 -0
- data/ext/v8/upstream/3.1.8/src/apiutils.h +80 -0
- data/ext/v8/upstream/3.1.8/src/arguments.h +105 -0
- data/ext/v8/upstream/3.1.8/src/arm/assembler-arm-inl.h +352 -0
- data/ext/v8/upstream/3.1.8/src/arm/assembler-arm.cc +2756 -0
- data/ext/v8/upstream/3.1.8/src/arm/assembler-arm.h +1294 -0
- data/ext/v8/upstream/3.1.8/src/arm/builtins-arm.cc +1628 -0
- data/ext/v8/upstream/3.1.8/src/arm/code-stubs-arm.cc +6783 -0
- data/ext/v8/upstream/3.1.8/src/arm/code-stubs-arm.h +657 -0
- data/ext/v8/upstream/3.1.8/src/arm/codegen-arm-inl.h +48 -0
- data/ext/v8/upstream/3.1.8/src/arm/codegen-arm.cc +7403 -0
- data/ext/v8/upstream/3.1.8/src/arm/codegen-arm.h +595 -0
- data/ext/v8/upstream/3.1.8/src/arm/constants-arm.cc +152 -0
- data/ext/v8/upstream/3.1.8/src/arm/constants-arm.h +769 -0
- data/ext/v8/upstream/3.1.8/src/arm/cpu-arm.cc +147 -0
- data/ext/v8/upstream/3.1.8/src/arm/debug-arm.cc +315 -0
- data/ext/v8/upstream/3.1.8/src/arm/deoptimizer-arm.cc +700 -0
- data/ext/v8/upstream/3.1.8/src/arm/disasm-arm.cc +1439 -0
- data/ext/v8/upstream/3.1.8/src/arm/frames-arm.cc +45 -0
- data/ext/v8/upstream/3.1.8/src/arm/frames-arm.h +168 -0
- data/ext/v8/upstream/3.1.8/src/arm/full-codegen-arm.cc +4230 -0
- data/ext/v8/upstream/3.1.8/src/arm/ic-arm.cc +1799 -0
- data/ext/v8/upstream/3.1.8/src/arm/jump-target-arm.cc +174 -0
- data/ext/v8/upstream/3.1.8/src/arm/lithium-arm.cc +2041 -0
- data/ext/v8/upstream/3.1.8/src/arm/lithium-arm.h +2046 -0
- data/ext/v8/upstream/3.1.8/src/arm/lithium-codegen-arm.cc +3822 -0
- data/ext/v8/upstream/3.1.8/src/arm/lithium-codegen-arm.h +312 -0
- data/ext/v8/upstream/3.1.8/src/arm/lithium-gap-resolver-arm.cc +303 -0
- data/ext/v8/upstream/3.1.8/src/arm/lithium-gap-resolver-arm.h +84 -0
- data/ext/v8/upstream/3.1.8/src/arm/macro-assembler-arm.cc +2701 -0
- data/ext/v8/upstream/3.1.8/src/arm/macro-assembler-arm.h +1015 -0
- data/ext/v8/upstream/3.1.8/src/arm/regexp-macro-assembler-arm.cc +1280 -0
- data/ext/v8/upstream/3.1.8/src/arm/regexp-macro-assembler-arm.h +252 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/arm/register-allocator-arm-inl.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/arm/register-allocator-arm.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/arm/register-allocator-arm.h +0 -0
- data/ext/v8/upstream/3.1.8/src/arm/simulator-arm.cc +3165 -0
- data/ext/v8/upstream/3.1.8/src/arm/simulator-arm.h +402 -0
- data/ext/v8/upstream/3.1.8/src/arm/stub-cache-arm.cc +4077 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/arm/virtual-frame-arm-inl.h +0 -0
- data/ext/v8/upstream/3.1.8/src/arm/virtual-frame-arm.cc +843 -0
- data/ext/v8/upstream/3.1.8/src/arm/virtual-frame-arm.h +520 -0
- data/ext/v8/upstream/3.1.8/src/array.js +1231 -0
- data/ext/v8/upstream/3.1.8/src/assembler.cc +973 -0
- data/ext/v8/upstream/3.1.8/src/assembler.h +787 -0
- data/ext/v8/upstream/3.1.8/src/ast-inl.h +107 -0
- data/ext/v8/upstream/3.1.8/src/ast.cc +1067 -0
- data/ext/v8/upstream/3.1.8/src/ast.h +2177 -0
- data/ext/v8/upstream/3.1.8/src/atomicops.h +165 -0
- data/ext/v8/upstream/3.1.8/src/atomicops_internals_arm_gcc.h +145 -0
- data/ext/v8/upstream/3.1.8/src/atomicops_internals_x86_gcc.cc +126 -0
- data/ext/v8/upstream/3.1.8/src/atomicops_internals_x86_gcc.h +287 -0
- data/ext/v8/upstream/3.1.8/src/atomicops_internals_x86_macosx.h +301 -0
- data/ext/v8/upstream/3.1.8/src/atomicops_internals_x86_msvc.h +203 -0
- data/ext/v8/upstream/3.1.8/src/bignum-dtoa.cc +655 -0
- data/ext/v8/upstream/3.1.8/src/bignum-dtoa.h +81 -0
- data/ext/v8/upstream/3.1.8/src/bignum.cc +768 -0
- data/ext/v8/upstream/3.1.8/src/bignum.h +140 -0
- data/ext/v8/upstream/3.1.8/src/bootstrapper.cc +1888 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/bootstrapper.h +0 -0
- data/ext/v8/upstream/3.1.8/src/builtins.cc +1586 -0
- data/ext/v8/upstream/3.1.8/src/builtins.h +339 -0
- data/ext/v8/upstream/3.1.8/src/bytecodes-irregexp.h +105 -0
- data/ext/v8/upstream/3.1.8/src/cached-powers.cc +177 -0
- data/ext/v8/upstream/3.1.8/src/cached-powers.h +65 -0
- data/ext/v8/upstream/3.1.8/src/char-predicates-inl.h +94 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/char-predicates.h +0 -0
- data/ext/v8/upstream/3.1.8/src/checks.cc +110 -0
- data/ext/v8/upstream/3.1.8/src/checks.h +292 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/circular-queue-inl.h +0 -0
- data/ext/v8/upstream/3.1.8/src/circular-queue.cc +122 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/circular-queue.h +0 -0
- data/ext/v8/upstream/3.1.8/src/code-stubs.cc +230 -0
- data/ext/v8/upstream/3.1.8/src/code-stubs.h +950 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/code.h +0 -0
- data/ext/v8/upstream/3.1.8/src/codegen-inl.h +64 -0
- data/ext/v8/upstream/3.1.8/src/codegen.cc +495 -0
- data/ext/v8/upstream/3.1.8/src/codegen.h +245 -0
- data/ext/v8/upstream/3.1.8/src/compilation-cache.cc +654 -0
- data/ext/v8/upstream/3.1.8/src/compilation-cache.h +112 -0
- data/ext/v8/upstream/3.1.8/src/compiler.cc +806 -0
- data/ext/v8/upstream/3.1.8/src/compiler.h +290 -0
- data/ext/v8/upstream/3.1.8/src/contexts.cc +320 -0
- data/ext/v8/upstream/3.1.8/src/contexts.h +376 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/conversions-inl.h +0 -0
- data/ext/v8/upstream/3.1.8/src/conversions.cc +1069 -0
- data/ext/v8/upstream/3.1.8/src/conversions.h +122 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/counters.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/counters.h +242 -0
- data/ext/v8/upstream/3.1.8/src/cpu-profiler-inl.h +100 -0
- data/ext/v8/upstream/3.1.8/src/cpu-profiler.cc +554 -0
- data/ext/v8/upstream/3.1.8/src/cpu-profiler.h +291 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/cpu.h +0 -0
- data/ext/v8/upstream/3.1.8/src/d8-debug.cc +367 -0
- data/ext/v8/upstream/3.1.8/src/d8-debug.h +157 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/d8-posix.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/d8-readline.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/d8-windows.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/d8.cc +792 -0
- data/ext/v8/upstream/3.1.8/src/d8.gyp +85 -0
- data/ext/v8/upstream/3.1.8/src/d8.h +231 -0
- data/ext/v8/upstream/3.1.8/src/d8.js +2798 -0
- data/ext/v8/upstream/3.1.8/src/data-flow.cc +545 -0
- data/ext/v8/upstream/3.1.8/src/data-flow.h +379 -0
- data/ext/v8/upstream/3.1.8/src/date.js +1103 -0
- data/ext/v8/upstream/3.1.8/src/dateparser-inl.h +125 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/dateparser.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/dateparser.h +263 -0
- data/ext/v8/upstream/3.1.8/src/debug-agent.cc +446 -0
- data/ext/v8/upstream/3.1.8/src/debug-agent.h +131 -0
- data/ext/v8/upstream/3.1.8/src/debug-debugger.js +2569 -0
- data/ext/v8/upstream/3.1.8/src/debug.cc +3085 -0
- data/ext/v8/upstream/3.1.8/src/debug.h +1025 -0
- data/ext/v8/upstream/3.1.8/src/deoptimizer.cc +1185 -0
- data/ext/v8/upstream/3.1.8/src/deoptimizer.h +529 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/disasm.h +0 -0
- data/ext/v8/upstream/3.1.8/src/disassembler.cc +338 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/disassembler.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/diy-fp.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/diy-fp.h +0 -0
- data/ext/v8/upstream/3.1.8/src/double.h +238 -0
- data/ext/v8/upstream/3.1.8/src/dtoa.cc +103 -0
- data/ext/v8/upstream/3.1.8/src/dtoa.h +85 -0
- data/ext/v8/upstream/3.1.8/src/execution.cc +735 -0
- data/ext/v8/upstream/3.1.8/src/execution.h +322 -0
- data/ext/v8/upstream/3.1.8/src/extensions/experimental/experimental.gyp +53 -0
- data/ext/v8/upstream/3.1.8/src/extensions/experimental/i18n-extension.cc +264 -0
- data/ext/v8/upstream/3.1.8/src/extensions/experimental/i18n-extension.h +64 -0
- data/ext/v8/upstream/3.1.8/src/extensions/externalize-string-extension.cc +141 -0
- data/ext/v8/upstream/3.1.8/src/extensions/externalize-string-extension.h +50 -0
- data/ext/v8/upstream/3.1.8/src/extensions/gc-extension.cc +58 -0
- data/ext/v8/upstream/3.1.8/src/extensions/gc-extension.h +49 -0
- data/ext/v8/upstream/3.1.8/src/factory.cc +1087 -0
- data/ext/v8/upstream/3.1.8/src/factory.h +432 -0
- data/ext/v8/upstream/3.1.8/src/fast-dtoa.cc +736 -0
- data/ext/v8/upstream/3.1.8/src/fast-dtoa.h +83 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/fixed-dtoa.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/fixed-dtoa.h +0 -0
- data/ext/v8/upstream/3.1.8/src/flag-definitions.h +552 -0
- data/ext/v8/upstream/3.1.8/src/flags.cc +551 -0
- data/ext/v8/upstream/3.1.8/src/flags.h +79 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/frame-element.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/frame-element.h +277 -0
- data/ext/v8/upstream/3.1.8/src/frames-inl.h +210 -0
- data/ext/v8/upstream/3.1.8/src/frames.cc +1232 -0
- data/ext/v8/upstream/3.1.8/src/frames.h +826 -0
- data/ext/v8/upstream/3.1.8/src/full-codegen.cc +1382 -0
- data/ext/v8/upstream/3.1.8/src/full-codegen.h +751 -0
- data/ext/v8/upstream/3.1.8/src/func-name-inferrer.cc +90 -0
- data/ext/v8/upstream/3.1.8/src/func-name-inferrer.h +111 -0
- data/ext/v8/upstream/3.1.8/src/gdb-jit.cc +1547 -0
- data/ext/v8/upstream/3.1.8/src/gdb-jit.h +138 -0
- data/ext/v8/upstream/3.1.8/src/global-handles.cc +534 -0
- data/ext/v8/upstream/3.1.8/src/global-handles.h +181 -0
- data/ext/v8/upstream/3.1.8/src/globals.h +325 -0
- data/ext/v8/upstream/3.1.8/src/handles-inl.h +80 -0
- data/ext/v8/upstream/3.1.8/src/handles.cc +910 -0
- data/ext/v8/upstream/3.1.8/src/handles.h +424 -0
- data/ext/v8/upstream/3.1.8/src/hashmap.cc +230 -0
- data/ext/v8/upstream/3.1.8/src/hashmap.h +121 -0
- data/ext/v8/upstream/3.1.8/src/heap-inl.h +587 -0
- data/ext/v8/upstream/3.1.8/src/heap-profiler.cc +1128 -0
- data/ext/v8/upstream/3.1.8/src/heap-profiler.h +381 -0
- data/ext/v8/upstream/3.1.8/src/heap.cc +5610 -0
- data/ext/v8/upstream/3.1.8/src/heap.h +2218 -0
- data/ext/v8/upstream/3.1.8/src/hydrogen-instructions.cc +1490 -0
- data/ext/v8/upstream/3.1.8/src/hydrogen-instructions.h +3493 -0
- data/ext/v8/upstream/3.1.8/src/hydrogen.cc +6056 -0
- data/ext/v8/upstream/3.1.8/src/hydrogen.h +1091 -0
- data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32-inl.h +429 -0
- data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32.cc +2800 -0
- data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32.h +1093 -0
- data/ext/v8/upstream/3.1.8/src/ia32/builtins-ia32.cc +1590 -0
- data/ext/v8/upstream/3.1.8/src/ia32/code-stubs-ia32.cc +6624 -0
- data/ext/v8/upstream/3.1.8/src/ia32/code-stubs-ia32.h +536 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/codegen-ia32-inl.h +0 -0
- data/ext/v8/upstream/3.1.8/src/ia32/codegen-ia32.cc +10354 -0
- data/ext/v8/upstream/3.1.8/src/ia32/codegen-ia32.h +798 -0
- data/ext/v8/upstream/3.1.8/src/ia32/cpu-ia32.cc +87 -0
- data/ext/v8/upstream/3.1.8/src/ia32/debug-ia32.cc +309 -0
- data/ext/v8/upstream/3.1.8/src/ia32/deoptimizer-ia32.cc +664 -0
- data/ext/v8/upstream/3.1.8/src/ia32/disasm-ia32.cc +1597 -0
- data/ext/v8/upstream/3.1.8/src/ia32/frames-ia32.cc +45 -0
- data/ext/v8/upstream/3.1.8/src/ia32/frames-ia32.h +140 -0
- data/ext/v8/upstream/3.1.8/src/ia32/full-codegen-ia32.cc +4278 -0
- data/ext/v8/upstream/3.1.8/src/ia32/ic-ia32.cc +1786 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/jump-target-ia32.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/ia32/lithium-codegen-ia32.cc +3880 -0
- data/ext/v8/upstream/3.1.8/src/ia32/lithium-codegen-ia32.h +309 -0
- data/ext/v8/upstream/3.1.8/src/ia32/lithium-gap-resolver-ia32.cc +460 -0
- data/ext/v8/upstream/3.1.8/src/ia32/lithium-gap-resolver-ia32.h +110 -0
- data/ext/v8/upstream/3.1.8/src/ia32/lithium-ia32.cc +2095 -0
- data/ext/v8/upstream/3.1.8/src/ia32/lithium-ia32.h +2127 -0
- data/ext/v8/upstream/3.1.8/src/ia32/macro-assembler-ia32.cc +2031 -0
- data/ext/v8/upstream/3.1.8/src/ia32/macro-assembler-ia32.h +798 -0
- data/ext/v8/upstream/3.1.8/src/ia32/regexp-macro-assembler-ia32.cc +1253 -0
- data/ext/v8/upstream/3.1.8/src/ia32/regexp-macro-assembler-ia32.h +215 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/register-allocator-ia32-inl.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/register-allocator-ia32.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/register-allocator-ia32.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/simulator-ia32.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/ia32/simulator-ia32.h +72 -0
- data/ext/v8/upstream/3.1.8/src/ia32/stub-cache-ia32.cc +3732 -0
- data/ext/v8/upstream/3.1.8/src/ia32/virtual-frame-ia32.cc +1360 -0
- data/ext/v8/upstream/3.1.8/src/ia32/virtual-frame-ia32.h +646 -0
- data/ext/v8/upstream/3.1.8/src/ic-inl.h +129 -0
- data/ext/v8/upstream/3.1.8/src/ic.cc +2333 -0
- data/ext/v8/upstream/3.1.8/src/ic.h +639 -0
- data/ext/v8/upstream/3.1.8/src/inspector.cc +63 -0
- data/ext/v8/upstream/3.1.8/src/inspector.h +62 -0
- data/ext/v8/upstream/3.1.8/src/interpreter-irregexp.cc +655 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/interpreter-irregexp.h +0 -0
- data/ext/v8/upstream/3.1.8/src/json.js +342 -0
- data/ext/v8/upstream/3.1.8/src/jsregexp.cc +5340 -0
- data/ext/v8/upstream/3.1.8/src/jsregexp.h +1484 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/jump-target-heavy-inl.h +0 -0
- data/ext/v8/upstream/3.1.8/src/jump-target-heavy.cc +430 -0
- data/ext/v8/upstream/3.1.8/src/jump-target-heavy.h +244 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/jump-target-inl.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/jump-target-light-inl.h +0 -0
- data/ext/v8/upstream/3.1.8/src/jump-target-light.cc +111 -0
- data/ext/v8/upstream/3.1.8/src/jump-target-light.h +193 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/jump-target.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/jump-target.h +0 -0
- data/ext/v8/upstream/3.1.8/src/list-inl.h +206 -0
- data/ext/v8/upstream/3.1.8/src/list.h +164 -0
- data/ext/v8/upstream/3.1.8/src/lithium-allocator-inl.h +140 -0
- data/ext/v8/upstream/3.1.8/src/lithium-allocator.cc +2093 -0
- data/ext/v8/upstream/3.1.8/src/lithium-allocator.h +644 -0
- data/ext/v8/upstream/3.1.8/src/lithium.cc +168 -0
- data/ext/v8/upstream/3.1.8/src/lithium.h +592 -0
- data/ext/v8/upstream/3.1.8/src/liveedit-debugger.js +1082 -0
- data/ext/v8/upstream/3.1.8/src/liveedit.cc +1650 -0
- data/ext/v8/upstream/3.1.8/src/liveedit.h +174 -0
- data/ext/v8/upstream/3.1.8/src/liveobjectlist-inl.h +126 -0
- data/ext/v8/upstream/3.1.8/src/liveobjectlist.cc +2527 -0
- data/ext/v8/upstream/3.1.8/src/liveobjectlist.h +322 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/log-inl.h +0 -0
- data/ext/v8/upstream/3.1.8/src/log-utils.cc +336 -0
- data/ext/v8/upstream/3.1.8/src/log-utils.h +232 -0
- data/ext/v8/upstream/3.1.8/src/log.cc +1608 -0
- data/ext/v8/upstream/3.1.8/src/log.h +379 -0
- data/ext/v8/upstream/3.1.8/src/macro-assembler.h +120 -0
- data/ext/v8/upstream/3.1.8/src/macros.py +178 -0
- data/ext/v8/upstream/3.1.8/src/mark-compact.cc +2957 -0
- data/ext/v8/upstream/3.1.8/src/mark-compact.h +433 -0
- data/ext/v8/upstream/3.1.8/src/math.js +264 -0
- data/ext/v8/upstream/3.1.8/src/memory.h +82 -0
- data/ext/v8/upstream/3.1.8/src/messages.cc +164 -0
- data/ext/v8/upstream/3.1.8/src/messages.h +114 -0
- data/ext/v8/upstream/3.1.8/src/messages.js +1071 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/assembler-mips-inl.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/assembler-mips.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/mips/assembler-mips.h +667 -0
- data/ext/v8/upstream/3.1.8/src/mips/builtins-mips.cc +205 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/codegen-mips-inl.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/codegen-mips.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/mips/codegen-mips.h +431 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/constants-mips.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/constants-mips.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/cpu-mips.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/mips/debug-mips.cc +127 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/disasm-mips.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/fast-codegen-mips.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/mips/frames-mips.cc +96 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/frames-mips.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/full-codegen-mips.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/mips/ic-mips.cc +208 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/jump-target-mips.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/macro-assembler-mips.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/macro-assembler-mips.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/register-allocator-mips-inl.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/register-allocator-mips.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/register-allocator-mips.h +0 -0
- data/ext/v8/upstream/3.1.8/src/mips/simulator-mips.cc +1650 -0
- data/ext/v8/upstream/3.1.8/src/mips/simulator-mips.h +311 -0
- data/ext/v8/upstream/3.1.8/src/mips/stub-cache-mips.cc +418 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/virtual-frame-mips.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/virtual-frame-mips.h +0 -0
- data/ext/v8/upstream/3.1.8/src/mirror-debugger.js +2380 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mksnapshot.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/natives.h +0 -0
- data/ext/v8/upstream/3.1.8/src/objects-debug.cc +722 -0
- data/ext/v8/upstream/3.1.8/src/objects-inl.h +3946 -0
- data/ext/v8/upstream/3.1.8/src/objects-printer.cc +801 -0
- data/ext/v8/upstream/3.1.8/src/objects-visiting.cc +142 -0
- data/ext/v8/upstream/3.1.8/src/objects-visiting.h +401 -0
- data/ext/v8/upstream/3.1.8/src/objects.cc +10044 -0
- data/ext/v8/upstream/3.1.8/src/objects.h +6571 -0
- data/ext/v8/upstream/3.1.8/src/parser.cc +5165 -0
- data/ext/v8/upstream/3.1.8/src/parser.h +802 -0
- data/ext/v8/upstream/3.1.8/src/platform-cygwin.cc +745 -0
- data/ext/v8/upstream/3.1.8/src/platform-freebsd.cc +702 -0
- data/ext/v8/upstream/3.1.8/src/platform-linux.cc +981 -0
- data/ext/v8/upstream/3.1.8/src/platform-macos.cc +732 -0
- data/ext/v8/upstream/3.1.8/src/platform-nullos.cc +498 -0
- data/ext/v8/upstream/3.1.8/src/platform-openbsd.cc +657 -0
- data/ext/v8/upstream/3.1.8/src/platform-posix.cc +399 -0
- data/ext/v8/upstream/3.1.8/src/platform-solaris.cc +714 -0
- data/ext/v8/upstream/3.1.8/src/platform-win32.cc +1974 -0
- data/ext/v8/upstream/3.1.8/src/platform.h +636 -0
- data/ext/v8/upstream/3.1.8/src/preparse-data.cc +183 -0
- data/ext/v8/upstream/3.1.8/src/preparse-data.h +249 -0
- data/ext/v8/upstream/3.1.8/src/preparser-api.cc +213 -0
- data/ext/v8/upstream/3.1.8/src/preparser.cc +1205 -0
- data/ext/v8/upstream/3.1.8/src/preparser.h +278 -0
- data/ext/v8/upstream/3.1.8/src/prettyprinter.cc +1539 -0
- data/ext/v8/upstream/3.1.8/src/prettyprinter.h +223 -0
- data/ext/v8/upstream/3.1.8/src/profile-generator-inl.h +128 -0
- data/ext/v8/upstream/3.1.8/src/profile-generator.cc +2899 -0
- data/ext/v8/upstream/3.1.8/src/profile-generator.h +1151 -0
- data/ext/v8/upstream/3.1.8/src/property.cc +96 -0
- data/ext/v8/upstream/3.1.8/src/property.h +337 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/regexp-macro-assembler-irregexp-inl.h +0 -0
- data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler-irregexp.cc +470 -0
- data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler-irregexp.h +142 -0
- data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler-tracer.cc +373 -0
- data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler-tracer.h +104 -0
- data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler.cc +257 -0
- data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler.h +231 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/regexp-stack.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/regexp-stack.h +0 -0
- data/ext/v8/upstream/3.1.8/src/regexp.js +483 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/register-allocator-inl.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/register-allocator.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/register-allocator.h +0 -0
- data/ext/v8/upstream/3.1.8/src/rewriter.cc +1023 -0
- data/ext/v8/upstream/3.1.8/src/rewriter.h +59 -0
- data/ext/v8/upstream/3.1.8/src/runtime-profiler.cc +443 -0
- data/ext/v8/upstream/3.1.8/src/runtime-profiler.h +77 -0
- data/ext/v8/upstream/3.1.8/src/runtime.cc +11592 -0
- data/ext/v8/upstream/3.1.8/src/runtime.h +582 -0
- data/ext/v8/upstream/3.1.8/src/runtime.js +643 -0
- data/ext/v8/upstream/3.1.8/src/safepoint-table.cc +253 -0
- data/ext/v8/upstream/3.1.8/src/safepoint-table.h +263 -0
- data/ext/v8/upstream/3.1.8/src/scanner-base.cc +971 -0
- data/ext/v8/upstream/3.1.8/src/scanner-base.h +653 -0
- data/ext/v8/upstream/3.1.8/src/scanner.cc +586 -0
- data/ext/v8/upstream/3.1.8/src/scanner.h +194 -0
- data/ext/v8/upstream/3.1.8/src/scopeinfo.cc +636 -0
- data/ext/v8/upstream/3.1.8/src/scopeinfo.h +238 -0
- data/ext/v8/upstream/3.1.8/src/scopes.cc +1063 -0
- data/ext/v8/upstream/3.1.8/src/scopes.h +494 -0
- data/ext/v8/upstream/3.1.8/src/serialize.cc +1535 -0
- data/ext/v8/upstream/3.1.8/src/serialize.h +584 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/shell.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/simulator.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/smart-pointer.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/snapshot-common.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/snapshot-empty.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/snapshot.h +0 -0
- data/ext/v8/upstream/3.1.8/src/spaces-inl.h +524 -0
- data/ext/v8/upstream/3.1.8/src/spaces.cc +3254 -0
- data/ext/v8/upstream/3.1.8/src/spaces.h +2362 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/splay-tree-inl.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/splay-tree.h +0 -0
- data/ext/v8/upstream/3.1.8/src/string-search.cc +40 -0
- data/ext/v8/upstream/3.1.8/src/string-search.h +567 -0
- data/ext/v8/upstream/3.1.8/src/string-stream.cc +584 -0
- data/ext/v8/upstream/3.1.8/src/string-stream.h +191 -0
- data/ext/v8/upstream/3.1.8/src/string.js +915 -0
- data/ext/v8/upstream/3.1.8/src/strtod.cc +440 -0
- data/ext/v8/upstream/3.1.8/src/strtod.h +40 -0
- data/ext/v8/upstream/3.1.8/src/stub-cache.cc +1878 -0
- data/ext/v8/upstream/3.1.8/src/stub-cache.h +849 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/third_party/valgrind/valgrind.h +0 -0
- data/ext/v8/upstream/3.1.8/src/token.cc +63 -0
- data/ext/v8/upstream/3.1.8/src/token.h +288 -0
- data/ext/v8/upstream/3.1.8/src/top.cc +1152 -0
- data/ext/v8/upstream/3.1.8/src/top.h +608 -0
- data/ext/v8/upstream/3.1.8/src/type-info.cc +406 -0
- data/ext/v8/upstream/3.1.8/src/type-info.h +283 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/unbound-queue-inl.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/unbound-queue.h +0 -0
- data/ext/v8/upstream/3.1.8/src/unicode-inl.h +238 -0
- data/ext/v8/upstream/3.1.8/src/unicode.cc +1624 -0
- data/ext/v8/upstream/3.1.8/src/unicode.h +280 -0
- data/ext/v8/upstream/3.1.8/src/uri.js +402 -0
- data/ext/v8/upstream/3.1.8/src/utils.cc +371 -0
- data/ext/v8/upstream/3.1.8/src/utils.h +793 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/v8-counters.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/v8-counters.h +290 -0
- data/ext/v8/upstream/3.1.8/src/v8.cc +270 -0
- data/ext/v8/upstream/3.1.8/src/v8.h +127 -0
- data/ext/v8/upstream/3.1.8/src/v8checks.h +64 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/v8dll-main.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/v8globals.h +480 -0
- data/ext/v8/upstream/3.1.8/src/v8natives.js +1252 -0
- data/ext/v8/upstream/3.1.8/src/v8preparserdll-main.cc +39 -0
- data/ext/v8/upstream/3.1.8/src/v8threads.cc +440 -0
- data/ext/v8/upstream/3.1.8/src/v8threads.h +157 -0
- data/ext/v8/upstream/3.1.8/src/v8utils.h +354 -0
- data/ext/v8/upstream/3.1.8/src/variables.cc +132 -0
- data/ext/v8/upstream/3.1.8/src/variables.h +212 -0
- data/ext/v8/upstream/3.1.8/src/version.cc +95 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/version.h +0 -0
- data/ext/v8/upstream/3.1.8/src/virtual-frame-heavy-inl.h +190 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/virtual-frame-heavy.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/virtual-frame-inl.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/virtual-frame-light-inl.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/virtual-frame-light.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/virtual-frame.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/virtual-frame.h +59 -0
- data/ext/v8/upstream/3.1.8/src/vm-state-inl.h +134 -0
- data/ext/v8/upstream/3.1.8/src/vm-state.h +68 -0
- data/ext/v8/upstream/3.1.8/src/win32-headers.h +95 -0
- data/ext/v8/upstream/3.1.8/src/x64/assembler-x64-inl.h +455 -0
- data/ext/v8/upstream/3.1.8/src/x64/assembler-x64.cc +3162 -0
- data/ext/v8/upstream/3.1.8/src/x64/assembler-x64.h +1584 -0
- data/ext/v8/upstream/3.1.8/src/x64/builtins-x64.cc +1492 -0
- data/ext/v8/upstream/3.1.8/src/x64/code-stubs-x64.cc +5150 -0
- data/ext/v8/upstream/3.1.8/src/x64/code-stubs-x64.h +519 -0
- data/ext/v8/upstream/3.1.8/src/x64/codegen-x64-inl.h +46 -0
- data/ext/v8/upstream/3.1.8/src/x64/codegen-x64.cc +8835 -0
- data/ext/v8/upstream/3.1.8/src/x64/codegen-x64.h +750 -0
- data/ext/v8/upstream/3.1.8/src/x64/cpu-x64.cc +86 -0
- data/ext/v8/upstream/3.1.8/src/x64/debug-x64.cc +316 -0
- data/ext/v8/upstream/3.1.8/src/x64/deoptimizer-x64.cc +781 -0
- data/ext/v8/upstream/3.1.8/src/x64/disasm-x64.cc +1737 -0
- data/ext/v8/upstream/3.1.8/src/x64/frames-x64.cc +45 -0
- data/ext/v8/upstream/3.1.8/src/x64/frames-x64.h +130 -0
- data/ext/v8/upstream/3.1.8/src/x64/full-codegen-x64.cc +3984 -0
- data/ext/v8/upstream/3.1.8/src/x64/ic-x64.cc +1761 -0
- data/ext/v8/upstream/3.1.8/src/x64/jump-target-x64.cc +437 -0
- data/ext/v8/upstream/3.1.8/src/x64/lithium-codegen-x64.cc +3639 -0
- data/ext/v8/upstream/3.1.8/src/x64/lithium-codegen-x64.h +305 -0
- data/ext/v8/upstream/3.1.8/src/x64/lithium-gap-resolver-x64.cc +320 -0
- data/ext/v8/upstream/3.1.8/src/x64/lithium-gap-resolver-x64.h +74 -0
- data/ext/v8/upstream/3.1.8/src/x64/lithium-x64.cc +2044 -0
- data/ext/v8/upstream/3.1.8/src/x64/lithium-x64.h +2052 -0
- data/ext/v8/upstream/3.1.8/src/x64/macro-assembler-x64.cc +2660 -0
- data/ext/v8/upstream/3.1.8/src/x64/macro-assembler-x64.h +1852 -0
- data/ext/v8/upstream/3.1.8/src/x64/regexp-macro-assembler-x64.cc +1382 -0
- data/ext/v8/upstream/3.1.8/src/x64/regexp-macro-assembler-x64.h +278 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/x64/register-allocator-x64-inl.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/x64/register-allocator-x64.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/x64/register-allocator-x64.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/x64/simulator-x64.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/x64/simulator-x64.h +71 -0
- data/ext/v8/upstream/3.1.8/src/x64/stub-cache-x64.cc +3509 -0
- data/ext/v8/upstream/3.1.8/src/x64/virtual-frame-x64.cc +1292 -0
- data/ext/v8/upstream/3.1.8/src/x64/virtual-frame-x64.h +593 -0
- data/ext/v8/upstream/3.1.8/src/zone-inl.h +83 -0
- data/ext/v8/upstream/3.1.8/src/zone.cc +195 -0
- data/ext/v8/upstream/3.1.8/src/zone.h +233 -0
- data/ext/v8/upstream/3.1.8/tools/codemap.js +265 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/consarray.js +0 -0
- data/ext/v8/upstream/3.1.8/tools/csvparser.js +78 -0
- data/ext/v8/upstream/3.1.8/tools/disasm.py +92 -0
- data/ext/v8/upstream/3.1.8/tools/gc-nvp-trace-processor.py +328 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/generate-ten-powers.scm +0 -0
- data/ext/v8/upstream/3.1.8/tools/grokdump.py +840 -0
- data/ext/v8/upstream/3.1.8/tools/gyp/v8.gyp +869 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/js2c.py +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/jsmin.py +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/linux-tick-processor +0 -0
- data/ext/v8/upstream/3.1.8/tools/ll_prof.py +919 -0
- data/ext/v8/upstream/3.1.8/tools/logreader.js +185 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/mac-nm +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/mac-tick-processor +0 -0
- data/ext/v8/upstream/3.1.8/tools/oom_dump/README +31 -0
- data/ext/v8/upstream/3.1.8/tools/oom_dump/SConstruct +42 -0
- data/ext/v8/upstream/3.1.8/tools/oom_dump/oom_dump.cc +288 -0
- data/ext/v8/upstream/3.1.8/tools/presubmit.py +305 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/process-heap-prof.py +0 -0
- data/ext/v8/upstream/3.1.8/tools/profile.js +751 -0
- data/ext/v8/upstream/3.1.8/tools/profile_view.js +219 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/run-valgrind.py +0 -0
- data/ext/v8/upstream/3.1.8/tools/splaytree.js +316 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/stats-viewer.py +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/tickprocessor-driver.js +0 -0
- data/ext/v8/upstream/3.1.8/tools/tickprocessor.js +863 -0
- data/ext/v8/upstream/3.1.8/tools/utils.py +96 -0
- data/ext/v8/upstream/3.1.8/tools/visual_studio/README.txt +70 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/arm.vsprops +0 -0
- data/ext/v8/upstream/3.1.8/tools/visual_studio/common.vsprops +34 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/d8.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/d8_arm.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/d8_x64.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/d8js2c.cmd +0 -0
- data/ext/v8/upstream/3.1.8/tools/visual_studio/debug.vsprops +17 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/ia32.vsprops +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/js2c.cmd +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/release.vsprops +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8.sln +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_arm.sln +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_arm.vcproj +0 -0
- data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base.vcproj +1296 -0
- data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base_arm.vcproj +1234 -0
- data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base_x64.vcproj +1296 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_cctest.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_cctest_arm.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_cctest_x64.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_mksnapshot.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_mksnapshot_x64.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_process_sample.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_process_sample_arm.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_process_sample_x64.vcproj +0 -0
- data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_shell_sample.vcproj +147 -0
- data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_shell_sample_arm.vcproj +147 -0
- data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_shell_sample_x64.vcproj +163 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_snapshot.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_snapshot_cc.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_snapshot_cc_x64.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_snapshot_x64.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_x64.sln +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_x64.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/x64.vsprops +0 -0
- data/ext/v8/upstream/3.1.8/tools/windows-tick-processor.bat +30 -0
- data/ext/v8/upstream/Makefile +2 -1
- data/ext/v8/v8_template.cpp +2 -2
- data/lib/v8/version.rb +1 -1
- data/spec/redjs/jsapi_spec.rb +2 -2
- metadata +552 -490
- data/ext/v8/upstream/2.3.3/.gitignore +0 -26
- data/ext/v8/upstream/2.3.3/AUTHORS +0 -31
- data/ext/v8/upstream/2.3.3/ChangeLog +0 -1916
- data/ext/v8/upstream/2.3.3/LICENSE +0 -55
- data/ext/v8/upstream/2.3.3/SConstruct +0 -1154
- data/ext/v8/upstream/2.3.3/include/v8-debug.h +0 -381
- data/ext/v8/upstream/2.3.3/include/v8-profiler.h +0 -353
- data/ext/v8/upstream/2.3.3/include/v8.h +0 -3616
- data/ext/v8/upstream/2.3.3/src/SConscript +0 -330
- data/ext/v8/upstream/2.3.3/src/accessors.cc +0 -661
- data/ext/v8/upstream/2.3.3/src/accessors.h +0 -114
- data/ext/v8/upstream/2.3.3/src/allocation.cc +0 -198
- data/ext/v8/upstream/2.3.3/src/allocation.h +0 -169
- data/ext/v8/upstream/2.3.3/src/api.cc +0 -4795
- data/ext/v8/upstream/2.3.3/src/api.h +0 -485
- data/ext/v8/upstream/2.3.3/src/apiutils.h +0 -69
- data/ext/v8/upstream/2.3.3/src/arguments.h +0 -96
- data/ext/v8/upstream/2.3.3/src/arm/assembler-arm-inl.h +0 -305
- data/ext/v8/upstream/2.3.3/src/arm/assembler-arm.cc +0 -2580
- data/ext/v8/upstream/2.3.3/src/arm/assembler-arm.h +0 -1275
- data/ext/v8/upstream/2.3.3/src/arm/builtins-arm.cc +0 -1320
- data/ext/v8/upstream/2.3.3/src/arm/codegen-arm-inl.h +0 -48
- data/ext/v8/upstream/2.3.3/src/arm/codegen-arm.cc +0 -11398
- data/ext/v8/upstream/2.3.3/src/arm/codegen-arm.h +0 -1102
- data/ext/v8/upstream/2.3.3/src/arm/constants-arm.cc +0 -154
- data/ext/v8/upstream/2.3.3/src/arm/constants-arm.h +0 -388
- data/ext/v8/upstream/2.3.3/src/arm/cpu-arm.cc +0 -142
- data/ext/v8/upstream/2.3.3/src/arm/debug-arm.cc +0 -309
- data/ext/v8/upstream/2.3.3/src/arm/disasm-arm.cc +0 -1459
- data/ext/v8/upstream/2.3.3/src/arm/fast-codegen-arm.cc +0 -241
- data/ext/v8/upstream/2.3.3/src/arm/frames-arm.cc +0 -123
- data/ext/v8/upstream/2.3.3/src/arm/frames-arm.h +0 -162
- data/ext/v8/upstream/2.3.3/src/arm/full-codegen-arm.cc +0 -3178
- data/ext/v8/upstream/2.3.3/src/arm/ic-arm.cc +0 -2258
- data/ext/v8/upstream/2.3.3/src/arm/jump-target-arm.cc +0 -164
- data/ext/v8/upstream/2.3.3/src/arm/macro-assembler-arm.cc +0 -1892
- data/ext/v8/upstream/2.3.3/src/arm/macro-assembler-arm.h +0 -727
- data/ext/v8/upstream/2.3.3/src/arm/regexp-macro-assembler-arm.cc +0 -1261
- data/ext/v8/upstream/2.3.3/src/arm/regexp-macro-assembler-arm.h +0 -266
- data/ext/v8/upstream/2.3.3/src/arm/simulator-arm.cc +0 -2822
- data/ext/v8/upstream/2.3.3/src/arm/simulator-arm.h +0 -361
- data/ext/v8/upstream/2.3.3/src/arm/stub-cache-arm.cc +0 -2387
- data/ext/v8/upstream/2.3.3/src/arm/virtual-frame-arm.cc +0 -834
- data/ext/v8/upstream/2.3.3/src/arm/virtual-frame-arm.h +0 -519
- data/ext/v8/upstream/2.3.3/src/array.js +0 -1127
- data/ext/v8/upstream/2.3.3/src/assembler.cc +0 -801
- data/ext/v8/upstream/2.3.3/src/assembler.h +0 -573
- data/ext/v8/upstream/2.3.3/src/ast-inl.h +0 -81
- data/ext/v8/upstream/2.3.3/src/ast.cc +0 -1152
- data/ext/v8/upstream/2.3.3/src/ast.h +0 -2106
- data/ext/v8/upstream/2.3.3/src/bootstrapper.cc +0 -1819
- data/ext/v8/upstream/2.3.3/src/builtins.cc +0 -1529
- data/ext/v8/upstream/2.3.3/src/builtins.h +0 -263
- data/ext/v8/upstream/2.3.3/src/bytecodes-irregexp.h +0 -104
- data/ext/v8/upstream/2.3.3/src/cached-powers.h +0 -119
- data/ext/v8/upstream/2.3.3/src/char-predicates-inl.h +0 -86
- data/ext/v8/upstream/2.3.3/src/checks.cc +0 -100
- data/ext/v8/upstream/2.3.3/src/checks.h +0 -310
- data/ext/v8/upstream/2.3.3/src/circular-queue.cc +0 -121
- data/ext/v8/upstream/2.3.3/src/code-stubs.cc +0 -177
- data/ext/v8/upstream/2.3.3/src/code-stubs.h +0 -177
- data/ext/v8/upstream/2.3.3/src/codegen-inl.h +0 -60
- data/ext/v8/upstream/2.3.3/src/codegen.cc +0 -516
- data/ext/v8/upstream/2.3.3/src/codegen.h +0 -897
- data/ext/v8/upstream/2.3.3/src/compilation-cache.cc +0 -562
- data/ext/v8/upstream/2.3.3/src/compilation-cache.h +0 -102
- data/ext/v8/upstream/2.3.3/src/compiler.cc +0 -654
- data/ext/v8/upstream/2.3.3/src/compiler.h +0 -299
- data/ext/v8/upstream/2.3.3/src/contexts.cc +0 -256
- data/ext/v8/upstream/2.3.3/src/contexts.h +0 -342
- data/ext/v8/upstream/2.3.3/src/conversions.cc +0 -1119
- data/ext/v8/upstream/2.3.3/src/conversions.h +0 -123
- data/ext/v8/upstream/2.3.3/src/counters.h +0 -239
- data/ext/v8/upstream/2.3.3/src/cpu-profiler-inl.h +0 -100
- data/ext/v8/upstream/2.3.3/src/cpu-profiler.cc +0 -538
- data/ext/v8/upstream/2.3.3/src/cpu-profiler.h +0 -285
- data/ext/v8/upstream/2.3.3/src/d8-debug.cc +0 -356
- data/ext/v8/upstream/2.3.3/src/d8-debug.h +0 -155
- data/ext/v8/upstream/2.3.3/src/d8.cc +0 -783
- data/ext/v8/upstream/2.3.3/src/d8.h +0 -227
- data/ext/v8/upstream/2.3.3/src/d8.js +0 -1683
- data/ext/v8/upstream/2.3.3/src/data-flow.cc +0 -758
- data/ext/v8/upstream/2.3.3/src/data-flow.h +0 -278
- data/ext/v8/upstream/2.3.3/src/date.js +0 -1059
- data/ext/v8/upstream/2.3.3/src/dateparser-inl.h +0 -123
- data/ext/v8/upstream/2.3.3/src/dateparser.h +0 -244
- data/ext/v8/upstream/2.3.3/src/debug-agent.cc +0 -427
- data/ext/v8/upstream/2.3.3/src/debug-agent.h +0 -129
- data/ext/v8/upstream/2.3.3/src/debug-debugger.js +0 -2227
- data/ext/v8/upstream/2.3.3/src/debug.cc +0 -3005
- data/ext/v8/upstream/2.3.3/src/debug.h +0 -993
- data/ext/v8/upstream/2.3.3/src/disassembler.cc +0 -312
- data/ext/v8/upstream/2.3.3/src/double.h +0 -169
- data/ext/v8/upstream/2.3.3/src/dtoa-config.c +0 -92
- data/ext/v8/upstream/2.3.3/src/dtoa.cc +0 -77
- data/ext/v8/upstream/2.3.3/src/dtoa.h +0 -81
- data/ext/v8/upstream/2.3.3/src/execution.cc +0 -809
- data/ext/v8/upstream/2.3.3/src/execution.h +0 -336
- data/ext/v8/upstream/2.3.3/src/factory.cc +0 -1003
- data/ext/v8/upstream/2.3.3/src/factory.h +0 -410
- data/ext/v8/upstream/2.3.3/src/fast-codegen.cc +0 -746
- data/ext/v8/upstream/2.3.3/src/fast-codegen.h +0 -161
- data/ext/v8/upstream/2.3.3/src/fast-dtoa.cc +0 -505
- data/ext/v8/upstream/2.3.3/src/fast-dtoa.h +0 -58
- data/ext/v8/upstream/2.3.3/src/flag-definitions.h +0 -455
- data/ext/v8/upstream/2.3.3/src/flags.cc +0 -551
- data/ext/v8/upstream/2.3.3/src/flags.h +0 -81
- data/ext/v8/upstream/2.3.3/src/flow-graph.cc +0 -763
- data/ext/v8/upstream/2.3.3/src/flow-graph.h +0 -180
- data/ext/v8/upstream/2.3.3/src/frame-element.h +0 -273
- data/ext/v8/upstream/2.3.3/src/frames-inl.h +0 -217
- data/ext/v8/upstream/2.3.3/src/frames.cc +0 -826
- data/ext/v8/upstream/2.3.3/src/frames.h +0 -682
- data/ext/v8/upstream/2.3.3/src/full-codegen.cc +0 -1443
- data/ext/v8/upstream/2.3.3/src/full-codegen.h +0 -548
- data/ext/v8/upstream/2.3.3/src/func-name-inferrer.cc +0 -76
- data/ext/v8/upstream/2.3.3/src/func-name-inferrer.h +0 -135
- data/ext/v8/upstream/2.3.3/src/global-handles.cc +0 -520
- data/ext/v8/upstream/2.3.3/src/global-handles.h +0 -180
- data/ext/v8/upstream/2.3.3/src/globals.h +0 -669
- data/ext/v8/upstream/2.3.3/src/handles-inl.h +0 -76
- data/ext/v8/upstream/2.3.3/src/handles.cc +0 -825
- data/ext/v8/upstream/2.3.3/src/handles.h +0 -393
- data/ext/v8/upstream/2.3.3/src/hashmap.cc +0 -226
- data/ext/v8/upstream/2.3.3/src/hashmap.h +0 -120
- data/ext/v8/upstream/2.3.3/src/heap-inl.h +0 -493
- data/ext/v8/upstream/2.3.3/src/heap-profiler.cc +0 -779
- data/ext/v8/upstream/2.3.3/src/heap-profiler.h +0 -323
- data/ext/v8/upstream/2.3.3/src/heap.cc +0 -4994
- data/ext/v8/upstream/2.3.3/src/heap.h +0 -1984
- data/ext/v8/upstream/2.3.3/src/ia32/assembler-ia32-inl.h +0 -360
- data/ext/v8/upstream/2.3.3/src/ia32/assembler-ia32.cc +0 -2600
- data/ext/v8/upstream/2.3.3/src/ia32/assembler-ia32.h +0 -969
- data/ext/v8/upstream/2.3.3/src/ia32/builtins-ia32.cc +0 -1261
- data/ext/v8/upstream/2.3.3/src/ia32/codegen-ia32.cc +0 -13968
- data/ext/v8/upstream/2.3.3/src/ia32/codegen-ia32.h +0 -1097
- data/ext/v8/upstream/2.3.3/src/ia32/cpu-ia32.cc +0 -83
- data/ext/v8/upstream/2.3.3/src/ia32/debug-ia32.cc +0 -309
- data/ext/v8/upstream/2.3.3/src/ia32/disasm-ia32.cc +0 -1471
- data/ext/v8/upstream/2.3.3/src/ia32/fast-codegen-ia32.cc +0 -954
- data/ext/v8/upstream/2.3.3/src/ia32/fast-codegen-ia32.h +0 -155
- data/ext/v8/upstream/2.3.3/src/ia32/frames-ia32.cc +0 -115
- data/ext/v8/upstream/2.3.3/src/ia32/frames-ia32.h +0 -135
- data/ext/v8/upstream/2.3.3/src/ia32/full-codegen-ia32.cc +0 -3281
- data/ext/v8/upstream/2.3.3/src/ia32/ic-ia32.cc +0 -1966
- data/ext/v8/upstream/2.3.3/src/ia32/macro-assembler-ia32.cc +0 -1610
- data/ext/v8/upstream/2.3.3/src/ia32/macro-assembler-ia32.h +0 -610
- data/ext/v8/upstream/2.3.3/src/ia32/regexp-macro-assembler-ia32.cc +0 -1247
- data/ext/v8/upstream/2.3.3/src/ia32/regexp-macro-assembler-ia32.h +0 -214
- data/ext/v8/upstream/2.3.3/src/ia32/simulator-ia32.h +0 -62
- data/ext/v8/upstream/2.3.3/src/ia32/stub-cache-ia32.cc +0 -2750
- data/ext/v8/upstream/2.3.3/src/ia32/virtual-frame-ia32.cc +0 -1334
- data/ext/v8/upstream/2.3.3/src/ia32/virtual-frame-ia32.h +0 -627
- data/ext/v8/upstream/2.3.3/src/ic-inl.h +0 -120
- data/ext/v8/upstream/2.3.3/src/ic.cc +0 -1827
- data/ext/v8/upstream/2.3.3/src/ic.h +0 -515
- data/ext/v8/upstream/2.3.3/src/interpreter-irregexp.cc +0 -646
- data/ext/v8/upstream/2.3.3/src/json.js +0 -268
- data/ext/v8/upstream/2.3.3/src/jsregexp.cc +0 -5283
- data/ext/v8/upstream/2.3.3/src/jsregexp.h +0 -1463
- data/ext/v8/upstream/2.3.3/src/jump-target-heavy.cc +0 -429
- data/ext/v8/upstream/2.3.3/src/jump-target-heavy.h +0 -244
- data/ext/v8/upstream/2.3.3/src/jump-target-light.cc +0 -110
- data/ext/v8/upstream/2.3.3/src/jump-target-light.h +0 -192
- data/ext/v8/upstream/2.3.3/src/list-inl.h +0 -166
- data/ext/v8/upstream/2.3.3/src/list.h +0 -159
- data/ext/v8/upstream/2.3.3/src/liveedit-debugger.js +0 -1057
- data/ext/v8/upstream/2.3.3/src/liveedit.cc +0 -1480
- data/ext/v8/upstream/2.3.3/src/liveedit.h +0 -170
- data/ext/v8/upstream/2.3.3/src/log-utils.cc +0 -497
- data/ext/v8/upstream/2.3.3/src/log-utils.h +0 -289
- data/ext/v8/upstream/2.3.3/src/log.cc +0 -1561
- data/ext/v8/upstream/2.3.3/src/log.h +0 -384
- data/ext/v8/upstream/2.3.3/src/macro-assembler.h +0 -86
- data/ext/v8/upstream/2.3.3/src/macros.py +0 -177
- data/ext/v8/upstream/2.3.3/src/mark-compact.cc +0 -2330
- data/ext/v8/upstream/2.3.3/src/mark-compact.h +0 -451
- data/ext/v8/upstream/2.3.3/src/math.js +0 -264
- data/ext/v8/upstream/2.3.3/src/memory.h +0 -74
- data/ext/v8/upstream/2.3.3/src/messages.cc +0 -183
- data/ext/v8/upstream/2.3.3/src/messages.h +0 -113
- data/ext/v8/upstream/2.3.3/src/messages.js +0 -982
- data/ext/v8/upstream/2.3.3/src/mips/assembler-mips.h +0 -668
- data/ext/v8/upstream/2.3.3/src/mips/builtins-mips.cc +0 -205
- data/ext/v8/upstream/2.3.3/src/mips/codegen-mips.h +0 -434
- data/ext/v8/upstream/2.3.3/src/mips/debug-mips.cc +0 -131
- data/ext/v8/upstream/2.3.3/src/mips/frames-mips.cc +0 -102
- data/ext/v8/upstream/2.3.3/src/mips/ic-mips.cc +0 -220
- data/ext/v8/upstream/2.3.3/src/mips/simulator-mips.cc +0 -1651
- data/ext/v8/upstream/2.3.3/src/mips/simulator-mips.h +0 -311
- data/ext/v8/upstream/2.3.3/src/mips/stub-cache-mips.cc +0 -403
- data/ext/v8/upstream/2.3.3/src/mirror-debugger.js +0 -2380
- data/ext/v8/upstream/2.3.3/src/objects-debug.cc +0 -1366
- data/ext/v8/upstream/2.3.3/src/objects-inl.h +0 -3333
- data/ext/v8/upstream/2.3.3/src/objects.cc +0 -8820
- data/ext/v8/upstream/2.3.3/src/objects.h +0 -5373
- data/ext/v8/upstream/2.3.3/src/oprofile-agent.cc +0 -108
- data/ext/v8/upstream/2.3.3/src/oprofile-agent.h +0 -77
- data/ext/v8/upstream/2.3.3/src/parser.cc +0 -5207
- data/ext/v8/upstream/2.3.3/src/parser.h +0 -197
- data/ext/v8/upstream/2.3.3/src/platform-freebsd.cc +0 -667
- data/ext/v8/upstream/2.3.3/src/platform-linux.cc +0 -862
- data/ext/v8/upstream/2.3.3/src/platform-macos.cc +0 -665
- data/ext/v8/upstream/2.3.3/src/platform-nullos.cc +0 -454
- data/ext/v8/upstream/2.3.3/src/platform-openbsd.cc +0 -622
- data/ext/v8/upstream/2.3.3/src/platform-posix.cc +0 -362
- data/ext/v8/upstream/2.3.3/src/platform-solaris.cc +0 -653
- data/ext/v8/upstream/2.3.3/src/platform-win32.cc +0 -1911
- data/ext/v8/upstream/2.3.3/src/platform.h +0 -577
- data/ext/v8/upstream/2.3.3/src/powers-ten.h +0 -2461
- data/ext/v8/upstream/2.3.3/src/prettyprinter.cc +0 -1531
- data/ext/v8/upstream/2.3.3/src/prettyprinter.h +0 -221
- data/ext/v8/upstream/2.3.3/src/profile-generator-inl.h +0 -148
- data/ext/v8/upstream/2.3.3/src/profile-generator.cc +0 -1830
- data/ext/v8/upstream/2.3.3/src/profile-generator.h +0 -853
- data/ext/v8/upstream/2.3.3/src/property.cc +0 -96
- data/ext/v8/upstream/2.3.3/src/property.h +0 -315
- data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler-irregexp.cc +0 -464
- data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler-irregexp.h +0 -141
- data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler-tracer.cc +0 -356
- data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler-tracer.h +0 -103
- data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler.cc +0 -261
- data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler.h +0 -228
- data/ext/v8/upstream/2.3.3/src/regexp.js +0 -549
- data/ext/v8/upstream/2.3.3/src/rewriter.cc +0 -1038
- data/ext/v8/upstream/2.3.3/src/rewriter.h +0 -54
- data/ext/v8/upstream/2.3.3/src/runtime.cc +0 -10599
- data/ext/v8/upstream/2.3.3/src/runtime.h +0 -459
- data/ext/v8/upstream/2.3.3/src/runtime.js +0 -629
- data/ext/v8/upstream/2.3.3/src/scanner.cc +0 -1346
- data/ext/v8/upstream/2.3.3/src/scanner.h +0 -503
- data/ext/v8/upstream/2.3.3/src/scopeinfo.cc +0 -637
- data/ext/v8/upstream/2.3.3/src/scopeinfo.h +0 -233
- data/ext/v8/upstream/2.3.3/src/scopes.cc +0 -962
- data/ext/v8/upstream/2.3.3/src/scopes.h +0 -400
- data/ext/v8/upstream/2.3.3/src/serialize.cc +0 -1461
- data/ext/v8/upstream/2.3.3/src/serialize.h +0 -581
- data/ext/v8/upstream/2.3.3/src/spaces-inl.h +0 -483
- data/ext/v8/upstream/2.3.3/src/spaces.cc +0 -2901
- data/ext/v8/upstream/2.3.3/src/spaces.h +0 -2197
- data/ext/v8/upstream/2.3.3/src/string-stream.cc +0 -584
- data/ext/v8/upstream/2.3.3/src/string-stream.h +0 -189
- data/ext/v8/upstream/2.3.3/src/string.js +0 -1006
- data/ext/v8/upstream/2.3.3/src/stub-cache.cc +0 -1379
- data/ext/v8/upstream/2.3.3/src/stub-cache.h +0 -756
- data/ext/v8/upstream/2.3.3/src/third_party/dtoa/COPYING +0 -15
- data/ext/v8/upstream/2.3.3/src/third_party/dtoa/dtoa.c +0 -3334
- data/ext/v8/upstream/2.3.3/src/token.cc +0 -56
- data/ext/v8/upstream/2.3.3/src/token.h +0 -270
- data/ext/v8/upstream/2.3.3/src/top.cc +0 -1067
- data/ext/v8/upstream/2.3.3/src/top.h +0 -463
- data/ext/v8/upstream/2.3.3/src/type-info.cc +0 -53
- data/ext/v8/upstream/2.3.3/src/type-info.h +0 -244
- data/ext/v8/upstream/2.3.3/src/unicode-inl.h +0 -238
- data/ext/v8/upstream/2.3.3/src/unicode.cc +0 -749
- data/ext/v8/upstream/2.3.3/src/unicode.h +0 -279
- data/ext/v8/upstream/2.3.3/src/uri.js +0 -415
- data/ext/v8/upstream/2.3.3/src/utils.cc +0 -285
- data/ext/v8/upstream/2.3.3/src/utils.h +0 -745
- data/ext/v8/upstream/2.3.3/src/v8-counters.h +0 -250
- data/ext/v8/upstream/2.3.3/src/v8.cc +0 -228
- data/ext/v8/upstream/2.3.3/src/v8.h +0 -121
- data/ext/v8/upstream/2.3.3/src/v8natives.js +0 -1188
- data/ext/v8/upstream/2.3.3/src/v8threads.cc +0 -461
- data/ext/v8/upstream/2.3.3/src/v8threads.h +0 -159
- data/ext/v8/upstream/2.3.3/src/variables.cc +0 -119
- data/ext/v8/upstream/2.3.3/src/variables.h +0 -205
- data/ext/v8/upstream/2.3.3/src/version.cc +0 -88
- data/ext/v8/upstream/2.3.3/src/virtual-frame-heavy-inl.h +0 -192
- data/ext/v8/upstream/2.3.3/src/virtual-frame.h +0 -46
- data/ext/v8/upstream/2.3.3/src/vm-state-inl.h +0 -137
- data/ext/v8/upstream/2.3.3/src/vm-state.cc +0 -39
- data/ext/v8/upstream/2.3.3/src/vm-state.h +0 -77
- data/ext/v8/upstream/2.3.3/src/x64/assembler-x64-inl.h +0 -400
- data/ext/v8/upstream/2.3.3/src/x64/assembler-x64.cc +0 -2963
- data/ext/v8/upstream/2.3.3/src/x64/assembler-x64.h +0 -1438
- data/ext/v8/upstream/2.3.3/src/x64/builtins-x64.cc +0 -1296
- data/ext/v8/upstream/2.3.3/src/x64/codegen-x64-inl.h +0 -46
- data/ext/v8/upstream/2.3.3/src/x64/codegen-x64.cc +0 -12491
- data/ext/v8/upstream/2.3.3/src/x64/codegen-x64.h +0 -1090
- data/ext/v8/upstream/2.3.3/src/x64/cpu-x64.cc +0 -83
- data/ext/v8/upstream/2.3.3/src/x64/debug-x64.cc +0 -267
- data/ext/v8/upstream/2.3.3/src/x64/disasm-x64.cc +0 -1696
- data/ext/v8/upstream/2.3.3/src/x64/fast-codegen-x64.cc +0 -250
- data/ext/v8/upstream/2.3.3/src/x64/frames-x64.cc +0 -113
- data/ext/v8/upstream/2.3.3/src/x64/frames-x64.h +0 -125
- data/ext/v8/upstream/2.3.3/src/x64/full-codegen-x64.cc +0 -3270
- data/ext/v8/upstream/2.3.3/src/x64/ic-x64.cc +0 -1907
- data/ext/v8/upstream/2.3.3/src/x64/jump-target-x64.cc +0 -437
- data/ext/v8/upstream/2.3.3/src/x64/macro-assembler-x64.cc +0 -2793
- data/ext/v8/upstream/2.3.3/src/x64/macro-assembler-x64.h +0 -916
- data/ext/v8/upstream/2.3.3/src/x64/regexp-macro-assembler-x64.cc +0 -1374
- data/ext/v8/upstream/2.3.3/src/x64/regexp-macro-assembler-x64.h +0 -277
- data/ext/v8/upstream/2.3.3/src/x64/simulator-x64.h +0 -63
- data/ext/v8/upstream/2.3.3/src/x64/stub-cache-x64.cc +0 -2560
- data/ext/v8/upstream/2.3.3/src/x64/virtual-frame-x64.cc +0 -1264
- data/ext/v8/upstream/2.3.3/src/x64/virtual-frame-x64.h +0 -590
- data/ext/v8/upstream/2.3.3/src/zone-inl.h +0 -82
- data/ext/v8/upstream/2.3.3/src/zone.cc +0 -194
- data/ext/v8/upstream/2.3.3/src/zone.h +0 -221
- data/ext/v8/upstream/2.3.3/tools/codemap.js +0 -270
- data/ext/v8/upstream/2.3.3/tools/csvparser.js +0 -83
- data/ext/v8/upstream/2.3.3/tools/gc-nvp-trace-processor.py +0 -317
- data/ext/v8/upstream/2.3.3/tools/gyp/v8.gyp +0 -749
- data/ext/v8/upstream/2.3.3/tools/linux-tick-processor.py +0 -78
- data/ext/v8/upstream/2.3.3/tools/logreader.js +0 -338
- data/ext/v8/upstream/2.3.3/tools/oprofile/annotate +0 -7
- data/ext/v8/upstream/2.3.3/tools/oprofile/common +0 -19
- data/ext/v8/upstream/2.3.3/tools/oprofile/dump +0 -7
- data/ext/v8/upstream/2.3.3/tools/oprofile/report +0 -7
- data/ext/v8/upstream/2.3.3/tools/oprofile/reset +0 -7
- data/ext/v8/upstream/2.3.3/tools/oprofile/run +0 -14
- data/ext/v8/upstream/2.3.3/tools/oprofile/shutdown +0 -7
- data/ext/v8/upstream/2.3.3/tools/oprofile/start +0 -7
- data/ext/v8/upstream/2.3.3/tools/presubmit.py +0 -299
- data/ext/v8/upstream/2.3.3/tools/profile.js +0 -691
- data/ext/v8/upstream/2.3.3/tools/profile_view.js +0 -224
- data/ext/v8/upstream/2.3.3/tools/splaytree.js +0 -322
- data/ext/v8/upstream/2.3.3/tools/splaytree.py +0 -226
- data/ext/v8/upstream/2.3.3/tools/tickprocessor.js +0 -862
- data/ext/v8/upstream/2.3.3/tools/tickprocessor.py +0 -571
- data/ext/v8/upstream/2.3.3/tools/utils.py +0 -88
- data/ext/v8/upstream/2.3.3/tools/visual_studio/README.txt +0 -71
- data/ext/v8/upstream/2.3.3/tools/visual_studio/common.vsprops +0 -34
- data/ext/v8/upstream/2.3.3/tools/visual_studio/debug.vsprops +0 -17
- data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_base.vcproj +0 -1143
- data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_base_arm.vcproj +0 -1115
- data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_base_x64.vcproj +0 -1096
- data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_shell_sample.vcproj +0 -145
- data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_shell_sample_arm.vcproj +0 -145
- data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_shell_sample_x64.vcproj +0 -161
- data/ext/v8/upstream/2.3.3/tools/windows-tick-processor.bat +0 -29
- data/ext/v8/upstream/2.3.3/tools/windows-tick-processor.py +0 -137
@@ -1,83 +0,0 @@
|
|
1
|
-
// Copyright 2009 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
|
-
// CPU specific code for x64 independent of OS goes here.
|
29
|
-
|
30
|
-
#ifdef __GNUC__
|
31
|
-
#include "third_party/valgrind/valgrind.h"
|
32
|
-
#endif
|
33
|
-
|
34
|
-
#include "v8.h"
|
35
|
-
|
36
|
-
#if defined(V8_TARGET_ARCH_X64)
|
37
|
-
|
38
|
-
#include "cpu.h"
|
39
|
-
#include "macro-assembler.h"
|
40
|
-
|
41
|
-
namespace v8 {
|
42
|
-
namespace internal {
|
43
|
-
|
44
|
-
void CPU::Setup() {
|
45
|
-
CpuFeatures::Probe();
|
46
|
-
}
|
47
|
-
|
48
|
-
|
49
|
-
void CPU::FlushICache(void* start, size_t size) {
|
50
|
-
// No need to flush the instruction cache on Intel. On Intel instruction
|
51
|
-
// cache flushing is only necessary when multiple cores running the same
|
52
|
-
// code simultaneously. V8 (and JavaScript) is single threaded and when code
|
53
|
-
// is patched on an intel CPU the core performing the patching will have its
|
54
|
-
// own instruction cache updated automatically.
|
55
|
-
|
56
|
-
// If flushing of the instruction cache becomes necessary Windows has the
|
57
|
-
// API function FlushInstructionCache.
|
58
|
-
|
59
|
-
// By default, valgrind only checks the stack for writes that might need to
|
60
|
-
// invalidate already cached translated code. This leads to random
|
61
|
-
// instability when code patches or moves are sometimes unnoticed. One
|
62
|
-
// solution is to run valgrind with --smc-check=all, but this comes at a big
|
63
|
-
// performance cost. We can notify valgrind to invalidate its cache.
|
64
|
-
#ifdef VALGRIND_DISCARD_TRANSLATIONS
|
65
|
-
VALGRIND_DISCARD_TRANSLATIONS(start, size);
|
66
|
-
#endif
|
67
|
-
}
|
68
|
-
|
69
|
-
|
70
|
-
void CPU::DebugBreak() {
|
71
|
-
#ifdef _MSC_VER
|
72
|
-
// To avoid Visual Studio runtime support the following code can be used
|
73
|
-
// instead
|
74
|
-
// __asm { int 3 }
|
75
|
-
__debugbreak();
|
76
|
-
#else
|
77
|
-
asm("int $3");
|
78
|
-
#endif
|
79
|
-
}
|
80
|
-
|
81
|
-
} } // namespace v8::internal
|
82
|
-
|
83
|
-
#endif // V8_TARGET_ARCH_X64
|
@@ -1,267 +0,0 @@
|
|
1
|
-
// Copyright 2010 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
|
-
|
29
|
-
#include "v8.h"
|
30
|
-
|
31
|
-
#if defined(V8_TARGET_ARCH_X64)
|
32
|
-
|
33
|
-
#include "codegen-inl.h"
|
34
|
-
#include "debug.h"
|
35
|
-
|
36
|
-
|
37
|
-
namespace v8 {
|
38
|
-
namespace internal {
|
39
|
-
|
40
|
-
#ifdef ENABLE_DEBUGGER_SUPPORT
|
41
|
-
|
42
|
-
bool Debug::IsDebugBreakAtReturn(v8::internal::RelocInfo* rinfo) {
|
43
|
-
ASSERT(RelocInfo::IsJSReturn(rinfo->rmode()));
|
44
|
-
return rinfo->IsPatchedReturnSequence();
|
45
|
-
}
|
46
|
-
|
47
|
-
#define __ ACCESS_MASM(masm)
|
48
|
-
|
49
|
-
static void Generate_DebugBreakCallHelper(MacroAssembler* masm,
|
50
|
-
RegList pointer_regs,
|
51
|
-
bool convert_call_to_jmp) {
|
52
|
-
// Save the content of all general purpose registers in memory. This copy in
|
53
|
-
// memory is later pushed onto the JS expression stack for the fake JS frame
|
54
|
-
// generated and also to the C frame generated on top of that. In the JS
|
55
|
-
// frame ONLY the registers containing pointers will be pushed on the
|
56
|
-
// expression stack. This causes the GC to update these pointers so that
|
57
|
-
// they will have the correct value when returning from the debugger.
|
58
|
-
__ SaveRegistersToMemory(kJSCallerSaved);
|
59
|
-
|
60
|
-
// Enter an internal frame.
|
61
|
-
__ EnterInternalFrame();
|
62
|
-
|
63
|
-
// Store the registers containing object pointers on the expression stack to
|
64
|
-
// make sure that these are correctly updated during GC.
|
65
|
-
__ PushRegistersFromMemory(pointer_regs);
|
66
|
-
|
67
|
-
#ifdef DEBUG
|
68
|
-
__ RecordComment("// Calling from debug break to runtime - come in - over");
|
69
|
-
#endif
|
70
|
-
__ xor_(rax, rax); // No arguments (argc == 0).
|
71
|
-
__ movq(rbx, ExternalReference::debug_break());
|
72
|
-
|
73
|
-
CEntryStub ceb(1, ExitFrame::MODE_DEBUG);
|
74
|
-
__ CallStub(&ceb);
|
75
|
-
|
76
|
-
// Restore the register values containing object pointers from the expression
|
77
|
-
// stack in the reverse order as they where pushed.
|
78
|
-
__ PopRegistersToMemory(pointer_regs);
|
79
|
-
|
80
|
-
// Get rid of the internal frame.
|
81
|
-
__ LeaveInternalFrame();
|
82
|
-
|
83
|
-
// If this call did not replace a call but patched other code then there will
|
84
|
-
// be an unwanted return address left on the stack. Here we get rid of that.
|
85
|
-
if (convert_call_to_jmp) {
|
86
|
-
__ pop(rax);
|
87
|
-
}
|
88
|
-
|
89
|
-
// Finally restore all registers.
|
90
|
-
__ RestoreRegistersFromMemory(kJSCallerSaved);
|
91
|
-
|
92
|
-
// Now that the break point has been handled, resume normal execution by
|
93
|
-
// jumping to the target address intended by the caller and that was
|
94
|
-
// overwritten by the address of DebugBreakXXX.
|
95
|
-
ExternalReference after_break_target =
|
96
|
-
ExternalReference(Debug_Address::AfterBreakTarget());
|
97
|
-
__ movq(kScratchRegister, after_break_target);
|
98
|
-
__ jmp(Operand(kScratchRegister, 0));
|
99
|
-
}
|
100
|
-
|
101
|
-
|
102
|
-
void Debug::GenerateCallICDebugBreak(MacroAssembler* masm) {
|
103
|
-
// Register state for keyed IC call call (from ic-x64.cc)
|
104
|
-
// ----------- S t a t e -------------
|
105
|
-
// -- rax: number of arguments
|
106
|
-
// -----------------------------------
|
107
|
-
// The number of arguments in rax is not smi encoded.
|
108
|
-
Generate_DebugBreakCallHelper(masm, 0, false);
|
109
|
-
}
|
110
|
-
|
111
|
-
|
112
|
-
void Debug::GenerateConstructCallDebugBreak(MacroAssembler* masm) {
|
113
|
-
// Register state just before return from JS function (from codegen-x64.cc).
|
114
|
-
// rax is the actual number of arguments not encoded as a smi, see comment
|
115
|
-
// above IC call.
|
116
|
-
// ----------- S t a t e -------------
|
117
|
-
// -- rax: number of arguments
|
118
|
-
// -----------------------------------
|
119
|
-
// The number of arguments in rax is not smi encoded.
|
120
|
-
Generate_DebugBreakCallHelper(masm, 0, false);
|
121
|
-
}
|
122
|
-
|
123
|
-
|
124
|
-
void Debug::GenerateKeyedLoadICDebugBreak(MacroAssembler* masm) {
|
125
|
-
// Register state for keyed IC load call (from ic-x64.cc).
|
126
|
-
// ----------- S t a t e -------------
|
127
|
-
// -- rax : key
|
128
|
-
// -- rdx : receiver
|
129
|
-
// -----------------------------------
|
130
|
-
Generate_DebugBreakCallHelper(masm, rax.bit() | rdx.bit(), false);
|
131
|
-
}
|
132
|
-
|
133
|
-
|
134
|
-
void Debug::GenerateKeyedStoreICDebugBreak(MacroAssembler* masm) {
|
135
|
-
// Register state for keyed IC load call (from ic-x64.cc).
|
136
|
-
// ----------- S t a t e -------------
|
137
|
-
// -- rax : value
|
138
|
-
// -- rcx : key
|
139
|
-
// -- rdx : receiver
|
140
|
-
// -----------------------------------
|
141
|
-
Generate_DebugBreakCallHelper(masm, rax.bit() | rcx.bit() | rdx.bit(), false);
|
142
|
-
}
|
143
|
-
|
144
|
-
|
145
|
-
void Debug::GenerateLoadICDebugBreak(MacroAssembler* masm) {
|
146
|
-
// Register state for IC load call (from ic-x64.cc).
|
147
|
-
// ----------- S t a t e -------------
|
148
|
-
// -- rax : receiver
|
149
|
-
// -- rcx : name
|
150
|
-
// -----------------------------------
|
151
|
-
Generate_DebugBreakCallHelper(masm, rax.bit() | rcx.bit(), false);
|
152
|
-
}
|
153
|
-
|
154
|
-
|
155
|
-
void Debug::GenerateReturnDebugBreak(MacroAssembler* masm) {
|
156
|
-
// Register state just before return from JS function (from codegen-x64.cc).
|
157
|
-
// ----------- S t a t e -------------
|
158
|
-
// -- rax: return value
|
159
|
-
// -----------------------------------
|
160
|
-
Generate_DebugBreakCallHelper(masm, rax.bit(), true);
|
161
|
-
}
|
162
|
-
|
163
|
-
|
164
|
-
void Debug::GenerateStoreICDebugBreak(MacroAssembler* masm) {
|
165
|
-
// Register state for IC store call (from ic-x64.cc).
|
166
|
-
// ----------- S t a t e -------------
|
167
|
-
// -- rax : value
|
168
|
-
// -- rcx : name
|
169
|
-
// -- rdx : receiver
|
170
|
-
// -----------------------------------
|
171
|
-
Generate_DebugBreakCallHelper(masm, rax.bit() | rcx.bit() | rdx.bit(), false);
|
172
|
-
}
|
173
|
-
|
174
|
-
|
175
|
-
void Debug::GenerateStubNoRegistersDebugBreak(MacroAssembler* masm) {
|
176
|
-
// Register state for stub CallFunction (from CallFunctionStub in ic-x64.cc).
|
177
|
-
// ----------- S t a t e -------------
|
178
|
-
// No registers used on entry.
|
179
|
-
// -----------------------------------
|
180
|
-
Generate_DebugBreakCallHelper(masm, 0, false);
|
181
|
-
}
|
182
|
-
|
183
|
-
|
184
|
-
void Debug::GenerateSlot(MacroAssembler* masm) {
|
185
|
-
// Generate enough nop's to make space for a call instruction.
|
186
|
-
Label check_codesize;
|
187
|
-
__ bind(&check_codesize);
|
188
|
-
__ RecordDebugBreakSlot();
|
189
|
-
for (int i = 0; i < Assembler::kDebugBreakSlotLength; i++) {
|
190
|
-
__ nop();
|
191
|
-
}
|
192
|
-
ASSERT_EQ(Assembler::kDebugBreakSlotLength,
|
193
|
-
masm->SizeOfCodeGeneratedSince(&check_codesize));
|
194
|
-
}
|
195
|
-
|
196
|
-
|
197
|
-
void Debug::GenerateSlotDebugBreak(MacroAssembler* masm) {
|
198
|
-
// In the places where a debug break slot is inserted no registers can contain
|
199
|
-
// object pointers.
|
200
|
-
Generate_DebugBreakCallHelper(masm, 0, true);
|
201
|
-
}
|
202
|
-
|
203
|
-
|
204
|
-
void Debug::GeneratePlainReturnLiveEdit(MacroAssembler* masm) {
|
205
|
-
masm->Abort("LiveEdit frame dropping is not supported on x64");
|
206
|
-
}
|
207
|
-
|
208
|
-
|
209
|
-
void Debug::GenerateFrameDropperLiveEdit(MacroAssembler* masm) {
|
210
|
-
masm->Abort("LiveEdit frame dropping is not supported on x64");
|
211
|
-
}
|
212
|
-
|
213
|
-
#undef __
|
214
|
-
|
215
|
-
|
216
|
-
void Debug::SetUpFrameDropperFrame(StackFrame* bottom_js_frame,
|
217
|
-
Handle<Code> code) {
|
218
|
-
UNREACHABLE();
|
219
|
-
}
|
220
|
-
const int Debug::kFrameDropperFrameSize = -1;
|
221
|
-
|
222
|
-
|
223
|
-
void BreakLocationIterator::ClearDebugBreakAtReturn() {
|
224
|
-
rinfo()->PatchCode(original_rinfo()->pc(),
|
225
|
-
Assembler::kJSReturnSequenceLength);
|
226
|
-
}
|
227
|
-
|
228
|
-
|
229
|
-
bool BreakLocationIterator::IsDebugBreakAtReturn() {
|
230
|
-
return Debug::IsDebugBreakAtReturn(rinfo());
|
231
|
-
}
|
232
|
-
|
233
|
-
|
234
|
-
void BreakLocationIterator::SetDebugBreakAtReturn() {
|
235
|
-
ASSERT(Assembler::kJSReturnSequenceLength >=
|
236
|
-
Assembler::kCallInstructionLength);
|
237
|
-
rinfo()->PatchCodeWithCall(Debug::debug_break_return()->entry(),
|
238
|
-
Assembler::kJSReturnSequenceLength - Assembler::kCallInstructionLength);
|
239
|
-
}
|
240
|
-
|
241
|
-
|
242
|
-
bool BreakLocationIterator::IsDebugBreakAtSlot() {
|
243
|
-
ASSERT(IsDebugBreakSlot());
|
244
|
-
// Check whether the debug break slot instructions have been patched.
|
245
|
-
return !Assembler::IsNop(rinfo()->pc());
|
246
|
-
}
|
247
|
-
|
248
|
-
|
249
|
-
void BreakLocationIterator::SetDebugBreakAtSlot() {
|
250
|
-
ASSERT(IsDebugBreakSlot());
|
251
|
-
rinfo()->PatchCodeWithCall(
|
252
|
-
Debug::debug_break_slot()->entry(),
|
253
|
-
Assembler::kDebugBreakSlotLength - Assembler::kCallInstructionLength);
|
254
|
-
}
|
255
|
-
|
256
|
-
|
257
|
-
void BreakLocationIterator::ClearDebugBreakAtSlot() {
|
258
|
-
ASSERT(IsDebugBreakSlot());
|
259
|
-
rinfo()->PatchCode(original_rinfo()->pc(), Assembler::kDebugBreakSlotLength);
|
260
|
-
}
|
261
|
-
|
262
|
-
|
263
|
-
#endif // ENABLE_DEBUGGER_SUPPORT
|
264
|
-
|
265
|
-
} } // namespace v8::internal
|
266
|
-
|
267
|
-
#endif // V8_TARGET_ARCH_X64
|
@@ -1,1696 +0,0 @@
|
|
1
|
-
// Copyright 2009 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 <assert.h>
|
29
|
-
#include <stdio.h>
|
30
|
-
#include <stdarg.h>
|
31
|
-
|
32
|
-
#include "v8.h"
|
33
|
-
|
34
|
-
#if defined(V8_TARGET_ARCH_X64)
|
35
|
-
|
36
|
-
#include "disasm.h"
|
37
|
-
|
38
|
-
namespace disasm {
|
39
|
-
|
40
|
-
enum OperandType {
|
41
|
-
UNSET_OP_ORDER = 0,
|
42
|
-
// Operand size decides between 16, 32 and 64 bit operands.
|
43
|
-
REG_OPER_OP_ORDER = 1, // Register destination, operand source.
|
44
|
-
OPER_REG_OP_ORDER = 2, // Operand destination, register source.
|
45
|
-
// Fixed 8-bit operands.
|
46
|
-
BYTE_SIZE_OPERAND_FLAG = 4,
|
47
|
-
BYTE_REG_OPER_OP_ORDER = REG_OPER_OP_ORDER | BYTE_SIZE_OPERAND_FLAG,
|
48
|
-
BYTE_OPER_REG_OP_ORDER = OPER_REG_OP_ORDER | BYTE_SIZE_OPERAND_FLAG
|
49
|
-
};
|
50
|
-
|
51
|
-
//------------------------------------------------------------------
|
52
|
-
// Tables
|
53
|
-
//------------------------------------------------------------------
|
54
|
-
struct ByteMnemonic {
|
55
|
-
int b; // -1 terminates, otherwise must be in range (0..255)
|
56
|
-
OperandType op_order_;
|
57
|
-
const char* mnem;
|
58
|
-
};
|
59
|
-
|
60
|
-
|
61
|
-
static ByteMnemonic two_operands_instr[] = {
|
62
|
-
{ 0x00, BYTE_OPER_REG_OP_ORDER, "add" },
|
63
|
-
{ 0x01, OPER_REG_OP_ORDER, "add" },
|
64
|
-
{ 0x02, BYTE_REG_OPER_OP_ORDER, "add" },
|
65
|
-
{ 0x03, REG_OPER_OP_ORDER, "add" },
|
66
|
-
{ 0x08, BYTE_OPER_REG_OP_ORDER, "or" },
|
67
|
-
{ 0x09, OPER_REG_OP_ORDER, "or" },
|
68
|
-
{ 0x0A, BYTE_REG_OPER_OP_ORDER, "or" },
|
69
|
-
{ 0x0B, REG_OPER_OP_ORDER, "or" },
|
70
|
-
{ 0x10, BYTE_OPER_REG_OP_ORDER, "adc" },
|
71
|
-
{ 0x11, OPER_REG_OP_ORDER, "adc" },
|
72
|
-
{ 0x12, BYTE_REG_OPER_OP_ORDER, "adc" },
|
73
|
-
{ 0x13, REG_OPER_OP_ORDER, "adc" },
|
74
|
-
{ 0x18, BYTE_OPER_REG_OP_ORDER, "sbb" },
|
75
|
-
{ 0x19, OPER_REG_OP_ORDER, "sbb" },
|
76
|
-
{ 0x1A, BYTE_REG_OPER_OP_ORDER, "sbb" },
|
77
|
-
{ 0x1B, REG_OPER_OP_ORDER, "sbb" },
|
78
|
-
{ 0x20, BYTE_OPER_REG_OP_ORDER, "and" },
|
79
|
-
{ 0x21, OPER_REG_OP_ORDER, "and" },
|
80
|
-
{ 0x22, BYTE_REG_OPER_OP_ORDER, "and" },
|
81
|
-
{ 0x23, REG_OPER_OP_ORDER, "and" },
|
82
|
-
{ 0x28, BYTE_OPER_REG_OP_ORDER, "sub" },
|
83
|
-
{ 0x29, OPER_REG_OP_ORDER, "sub" },
|
84
|
-
{ 0x2A, BYTE_REG_OPER_OP_ORDER, "sub" },
|
85
|
-
{ 0x2B, REG_OPER_OP_ORDER, "sub" },
|
86
|
-
{ 0x30, BYTE_OPER_REG_OP_ORDER, "xor" },
|
87
|
-
{ 0x31, OPER_REG_OP_ORDER, "xor" },
|
88
|
-
{ 0x32, BYTE_REG_OPER_OP_ORDER, "xor" },
|
89
|
-
{ 0x33, REG_OPER_OP_ORDER, "xor" },
|
90
|
-
{ 0x38, BYTE_OPER_REG_OP_ORDER, "cmp" },
|
91
|
-
{ 0x39, OPER_REG_OP_ORDER, "cmp" },
|
92
|
-
{ 0x3A, BYTE_REG_OPER_OP_ORDER, "cmp" },
|
93
|
-
{ 0x3B, REG_OPER_OP_ORDER, "cmp" },
|
94
|
-
{ 0x63, REG_OPER_OP_ORDER, "movsxlq" },
|
95
|
-
{ 0x84, BYTE_REG_OPER_OP_ORDER, "test" },
|
96
|
-
{ 0x85, REG_OPER_OP_ORDER, "test" },
|
97
|
-
{ 0x86, BYTE_REG_OPER_OP_ORDER, "xchg" },
|
98
|
-
{ 0x87, REG_OPER_OP_ORDER, "xchg" },
|
99
|
-
{ 0x88, BYTE_OPER_REG_OP_ORDER, "mov" },
|
100
|
-
{ 0x89, OPER_REG_OP_ORDER, "mov" },
|
101
|
-
{ 0x8A, BYTE_REG_OPER_OP_ORDER, "mov" },
|
102
|
-
{ 0x8B, REG_OPER_OP_ORDER, "mov" },
|
103
|
-
{ 0x8D, REG_OPER_OP_ORDER, "lea" },
|
104
|
-
{ -1, UNSET_OP_ORDER, "" }
|
105
|
-
};
|
106
|
-
|
107
|
-
|
108
|
-
static ByteMnemonic zero_operands_instr[] = {
|
109
|
-
{ 0xC3, UNSET_OP_ORDER, "ret" },
|
110
|
-
{ 0xC9, UNSET_OP_ORDER, "leave" },
|
111
|
-
{ 0xF4, UNSET_OP_ORDER, "hlt" },
|
112
|
-
{ 0xCC, UNSET_OP_ORDER, "int3" },
|
113
|
-
{ 0x60, UNSET_OP_ORDER, "pushad" },
|
114
|
-
{ 0x61, UNSET_OP_ORDER, "popad" },
|
115
|
-
{ 0x9C, UNSET_OP_ORDER, "pushfd" },
|
116
|
-
{ 0x9D, UNSET_OP_ORDER, "popfd" },
|
117
|
-
{ 0x9E, UNSET_OP_ORDER, "sahf" },
|
118
|
-
{ 0x99, UNSET_OP_ORDER, "cdq" },
|
119
|
-
{ 0x9B, UNSET_OP_ORDER, "fwait" },
|
120
|
-
{ 0xA4, UNSET_OP_ORDER, "movs" },
|
121
|
-
{ 0xA5, UNSET_OP_ORDER, "movs" },
|
122
|
-
{ 0xA6, UNSET_OP_ORDER, "cmps" },
|
123
|
-
{ 0xA7, UNSET_OP_ORDER, "cmps" },
|
124
|
-
{ -1, UNSET_OP_ORDER, "" }
|
125
|
-
};
|
126
|
-
|
127
|
-
|
128
|
-
static ByteMnemonic call_jump_instr[] = {
|
129
|
-
{ 0xE8, UNSET_OP_ORDER, "call" },
|
130
|
-
{ 0xE9, UNSET_OP_ORDER, "jmp" },
|
131
|
-
{ -1, UNSET_OP_ORDER, "" }
|
132
|
-
};
|
133
|
-
|
134
|
-
|
135
|
-
static ByteMnemonic short_immediate_instr[] = {
|
136
|
-
{ 0x05, UNSET_OP_ORDER, "add" },
|
137
|
-
{ 0x0D, UNSET_OP_ORDER, "or" },
|
138
|
-
{ 0x15, UNSET_OP_ORDER, "adc" },
|
139
|
-
{ 0x1D, UNSET_OP_ORDER, "sbb" },
|
140
|
-
{ 0x25, UNSET_OP_ORDER, "and" },
|
141
|
-
{ 0x2D, UNSET_OP_ORDER, "sub" },
|
142
|
-
{ 0x35, UNSET_OP_ORDER, "xor" },
|
143
|
-
{ 0x3D, UNSET_OP_ORDER, "cmp" },
|
144
|
-
{ -1, UNSET_OP_ORDER, "" }
|
145
|
-
};
|
146
|
-
|
147
|
-
|
148
|
-
static const char* conditional_code_suffix[] = {
|
149
|
-
"o", "no", "c", "nc", "z", "nz", "na", "a",
|
150
|
-
"s", "ns", "pe", "po", "l", "ge", "le", "g"
|
151
|
-
};
|
152
|
-
|
153
|
-
|
154
|
-
enum InstructionType {
|
155
|
-
NO_INSTR,
|
156
|
-
ZERO_OPERANDS_INSTR,
|
157
|
-
TWO_OPERANDS_INSTR,
|
158
|
-
JUMP_CONDITIONAL_SHORT_INSTR,
|
159
|
-
REGISTER_INSTR,
|
160
|
-
PUSHPOP_INSTR, // Has implicit 64-bit operand size.
|
161
|
-
MOVE_REG_INSTR,
|
162
|
-
CALL_JUMP_INSTR,
|
163
|
-
SHORT_IMMEDIATE_INSTR
|
164
|
-
};
|
165
|
-
|
166
|
-
|
167
|
-
enum Prefixes {
|
168
|
-
ESCAPE_PREFIX = 0x0F,
|
169
|
-
OPERAND_SIZE_OVERRIDE_PREFIX = 0x66,
|
170
|
-
ADDRESS_SIZE_OVERRIDE_PREFIX = 0x67,
|
171
|
-
REPNE_PREFIX = 0xF2,
|
172
|
-
REP_PREFIX = 0xF3,
|
173
|
-
REPEQ_PREFIX = REP_PREFIX
|
174
|
-
};
|
175
|
-
|
176
|
-
|
177
|
-
struct InstructionDesc {
|
178
|
-
const char* mnem;
|
179
|
-
InstructionType type;
|
180
|
-
OperandType op_order_;
|
181
|
-
bool byte_size_operation; // Fixed 8-bit operation.
|
182
|
-
};
|
183
|
-
|
184
|
-
|
185
|
-
class InstructionTable {
|
186
|
-
public:
|
187
|
-
InstructionTable();
|
188
|
-
const InstructionDesc& Get(byte x) const {
|
189
|
-
return instructions_[x];
|
190
|
-
}
|
191
|
-
|
192
|
-
private:
|
193
|
-
InstructionDesc instructions_[256];
|
194
|
-
void Clear();
|
195
|
-
void Init();
|
196
|
-
void CopyTable(ByteMnemonic bm[], InstructionType type);
|
197
|
-
void SetTableRange(InstructionType type, byte start, byte end, bool byte_size,
|
198
|
-
const char* mnem);
|
199
|
-
void AddJumpConditionalShort();
|
200
|
-
};
|
201
|
-
|
202
|
-
|
203
|
-
InstructionTable::InstructionTable() {
|
204
|
-
Clear();
|
205
|
-
Init();
|
206
|
-
}
|
207
|
-
|
208
|
-
|
209
|
-
void InstructionTable::Clear() {
|
210
|
-
for (int i = 0; i < 256; i++) {
|
211
|
-
instructions_[i].mnem = "(bad)";
|
212
|
-
instructions_[i].type = NO_INSTR;
|
213
|
-
instructions_[i].op_order_ = UNSET_OP_ORDER;
|
214
|
-
instructions_[i].byte_size_operation = false;
|
215
|
-
}
|
216
|
-
}
|
217
|
-
|
218
|
-
|
219
|
-
void InstructionTable::Init() {
|
220
|
-
CopyTable(two_operands_instr, TWO_OPERANDS_INSTR);
|
221
|
-
CopyTable(zero_operands_instr, ZERO_OPERANDS_INSTR);
|
222
|
-
CopyTable(call_jump_instr, CALL_JUMP_INSTR);
|
223
|
-
CopyTable(short_immediate_instr, SHORT_IMMEDIATE_INSTR);
|
224
|
-
AddJumpConditionalShort();
|
225
|
-
SetTableRange(PUSHPOP_INSTR, 0x50, 0x57, false, "push");
|
226
|
-
SetTableRange(PUSHPOP_INSTR, 0x58, 0x5F, false, "pop");
|
227
|
-
SetTableRange(MOVE_REG_INSTR, 0xB8, 0xBF, false, "mov");
|
228
|
-
}
|
229
|
-
|
230
|
-
|
231
|
-
void InstructionTable::CopyTable(ByteMnemonic bm[], InstructionType type) {
|
232
|
-
for (int i = 0; bm[i].b >= 0; i++) {
|
233
|
-
InstructionDesc* id = &instructions_[bm[i].b];
|
234
|
-
id->mnem = bm[i].mnem;
|
235
|
-
OperandType op_order = bm[i].op_order_;
|
236
|
-
id->op_order_ =
|
237
|
-
static_cast<OperandType>(op_order & ~BYTE_SIZE_OPERAND_FLAG);
|
238
|
-
ASSERT_EQ(NO_INSTR, id->type); // Information not already entered
|
239
|
-
id->type = type;
|
240
|
-
id->byte_size_operation = ((op_order & BYTE_SIZE_OPERAND_FLAG) != 0);
|
241
|
-
}
|
242
|
-
}
|
243
|
-
|
244
|
-
|
245
|
-
void InstructionTable::SetTableRange(InstructionType type,
|
246
|
-
byte start,
|
247
|
-
byte end,
|
248
|
-
bool byte_size,
|
249
|
-
const char* mnem) {
|
250
|
-
for (byte b = start; b <= end; b++) {
|
251
|
-
InstructionDesc* id = &instructions_[b];
|
252
|
-
ASSERT_EQ(NO_INSTR, id->type); // Information not already entered
|
253
|
-
id->mnem = mnem;
|
254
|
-
id->type = type;
|
255
|
-
id->byte_size_operation = byte_size;
|
256
|
-
}
|
257
|
-
}
|
258
|
-
|
259
|
-
|
260
|
-
void InstructionTable::AddJumpConditionalShort() {
|
261
|
-
for (byte b = 0x70; b <= 0x7F; b++) {
|
262
|
-
InstructionDesc* id = &instructions_[b];
|
263
|
-
ASSERT_EQ(NO_INSTR, id->type); // Information not already entered
|
264
|
-
id->mnem = NULL; // Computed depending on condition code.
|
265
|
-
id->type = JUMP_CONDITIONAL_SHORT_INSTR;
|
266
|
-
}
|
267
|
-
}
|
268
|
-
|
269
|
-
|
270
|
-
static InstructionTable instruction_table;
|
271
|
-
|
272
|
-
static InstructionDesc cmov_instructions[16] = {
|
273
|
-
{"cmovo", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
|
274
|
-
{"cmovno", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
|
275
|
-
{"cmovc", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
|
276
|
-
{"cmovnc", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
|
277
|
-
{"cmovz", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
|
278
|
-
{"cmovnz", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
|
279
|
-
{"cmovna", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
|
280
|
-
{"cmova", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
|
281
|
-
{"cmovs", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
|
282
|
-
{"cmovns", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
|
283
|
-
{"cmovpe", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
|
284
|
-
{"cmovpo", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
|
285
|
-
{"cmovl", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
|
286
|
-
{"cmovge", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
|
287
|
-
{"cmovle", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
|
288
|
-
{"cmovg", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false}
|
289
|
-
};
|
290
|
-
|
291
|
-
//------------------------------------------------------------------------------
|
292
|
-
// DisassemblerX64 implementation.
|
293
|
-
|
294
|
-
enum UnimplementedOpcodeAction {
|
295
|
-
CONTINUE_ON_UNIMPLEMENTED_OPCODE,
|
296
|
-
ABORT_ON_UNIMPLEMENTED_OPCODE
|
297
|
-
};
|
298
|
-
|
299
|
-
// A new DisassemblerX64 object is created to disassemble each instruction.
|
300
|
-
// The object can only disassemble a single instruction.
|
301
|
-
class DisassemblerX64 {
|
302
|
-
public:
|
303
|
-
DisassemblerX64(const NameConverter& converter,
|
304
|
-
UnimplementedOpcodeAction unimplemented_action =
|
305
|
-
ABORT_ON_UNIMPLEMENTED_OPCODE)
|
306
|
-
: converter_(converter),
|
307
|
-
tmp_buffer_pos_(0),
|
308
|
-
abort_on_unimplemented_(
|
309
|
-
unimplemented_action == ABORT_ON_UNIMPLEMENTED_OPCODE),
|
310
|
-
rex_(0),
|
311
|
-
operand_size_(0),
|
312
|
-
group_1_prefix_(0),
|
313
|
-
byte_size_operand_(false) {
|
314
|
-
tmp_buffer_[0] = '\0';
|
315
|
-
}
|
316
|
-
|
317
|
-
virtual ~DisassemblerX64() {
|
318
|
-
}
|
319
|
-
|
320
|
-
// Writes one disassembled instruction into 'buffer' (0-terminated).
|
321
|
-
// Returns the length of the disassembled machine instruction in bytes.
|
322
|
-
int InstructionDecode(v8::internal::Vector<char> buffer, byte* instruction);
|
323
|
-
|
324
|
-
private:
|
325
|
-
enum OperandSize {
|
326
|
-
BYTE_SIZE = 0,
|
327
|
-
WORD_SIZE = 1,
|
328
|
-
DOUBLEWORD_SIZE = 2,
|
329
|
-
QUADWORD_SIZE = 3
|
330
|
-
};
|
331
|
-
|
332
|
-
const NameConverter& converter_;
|
333
|
-
v8::internal::EmbeddedVector<char, 128> tmp_buffer_;
|
334
|
-
unsigned int tmp_buffer_pos_;
|
335
|
-
bool abort_on_unimplemented_;
|
336
|
-
// Prefixes parsed
|
337
|
-
byte rex_;
|
338
|
-
byte operand_size_; // 0x66 or (if no group 3 prefix is present) 0x0.
|
339
|
-
byte group_1_prefix_; // 0xF2, 0xF3, or (if no group 1 prefix is present) 0.
|
340
|
-
// Byte size operand override.
|
341
|
-
bool byte_size_operand_;
|
342
|
-
|
343
|
-
void setRex(byte rex) {
|
344
|
-
ASSERT_EQ(0x40, rex & 0xF0);
|
345
|
-
rex_ = rex;
|
346
|
-
}
|
347
|
-
|
348
|
-
bool rex() { return rex_ != 0; }
|
349
|
-
|
350
|
-
bool rex_b() { return (rex_ & 0x01) != 0; }
|
351
|
-
|
352
|
-
// Actual number of base register given the low bits and the rex.b state.
|
353
|
-
int base_reg(int low_bits) { return low_bits | ((rex_ & 0x01) << 3); }
|
354
|
-
|
355
|
-
bool rex_x() { return (rex_ & 0x02) != 0; }
|
356
|
-
|
357
|
-
bool rex_r() { return (rex_ & 0x04) != 0; }
|
358
|
-
|
359
|
-
bool rex_w() { return (rex_ & 0x08) != 0; }
|
360
|
-
|
361
|
-
OperandSize operand_size() {
|
362
|
-
if (byte_size_operand_) return BYTE_SIZE;
|
363
|
-
if (rex_w()) return QUADWORD_SIZE;
|
364
|
-
if (operand_size_ != 0) return WORD_SIZE;
|
365
|
-
return DOUBLEWORD_SIZE;
|
366
|
-
}
|
367
|
-
|
368
|
-
char operand_size_code() {
|
369
|
-
return "bwlq"[operand_size()];
|
370
|
-
}
|
371
|
-
|
372
|
-
const char* NameOfCPURegister(int reg) const {
|
373
|
-
return converter_.NameOfCPURegister(reg);
|
374
|
-
}
|
375
|
-
|
376
|
-
const char* NameOfByteCPURegister(int reg) const {
|
377
|
-
return converter_.NameOfByteCPURegister(reg);
|
378
|
-
}
|
379
|
-
|
380
|
-
const char* NameOfXMMRegister(int reg) const {
|
381
|
-
return converter_.NameOfXMMRegister(reg);
|
382
|
-
}
|
383
|
-
|
384
|
-
const char* NameOfAddress(byte* addr) const {
|
385
|
-
return converter_.NameOfAddress(addr);
|
386
|
-
}
|
387
|
-
|
388
|
-
// Disassembler helper functions.
|
389
|
-
void get_modrm(byte data,
|
390
|
-
int* mod,
|
391
|
-
int* regop,
|
392
|
-
int* rm) {
|
393
|
-
*mod = (data >> 6) & 3;
|
394
|
-
*regop = ((data & 0x38) >> 3) | (rex_r() ? 8 : 0);
|
395
|
-
*rm = (data & 7) | (rex_b() ? 8 : 0);
|
396
|
-
}
|
397
|
-
|
398
|
-
void get_sib(byte data,
|
399
|
-
int* scale,
|
400
|
-
int* index,
|
401
|
-
int* base) {
|
402
|
-
*scale = (data >> 6) & 3;
|
403
|
-
*index = ((data >> 3) & 7) | (rex_x() ? 8 : 0);
|
404
|
-
*base = (data & 7) | (rex_b() ? 8 : 0);
|
405
|
-
}
|
406
|
-
|
407
|
-
typedef const char* (DisassemblerX64::*RegisterNameMapping)(int reg) const;
|
408
|
-
|
409
|
-
int PrintRightOperandHelper(byte* modrmp,
|
410
|
-
RegisterNameMapping register_name);
|
411
|
-
int PrintRightOperand(byte* modrmp);
|
412
|
-
int PrintRightByteOperand(byte* modrmp);
|
413
|
-
int PrintRightXMMOperand(byte* modrmp);
|
414
|
-
int PrintOperands(const char* mnem,
|
415
|
-
OperandType op_order,
|
416
|
-
byte* data);
|
417
|
-
int PrintImmediate(byte* data, OperandSize size);
|
418
|
-
int PrintImmediateOp(byte* data);
|
419
|
-
const char* TwoByteMnemonic(byte opcode);
|
420
|
-
int TwoByteOpcodeInstruction(byte* data);
|
421
|
-
int F6F7Instruction(byte* data);
|
422
|
-
int ShiftInstruction(byte* data);
|
423
|
-
int JumpShort(byte* data);
|
424
|
-
int JumpConditional(byte* data);
|
425
|
-
int JumpConditionalShort(byte* data);
|
426
|
-
int SetCC(byte* data);
|
427
|
-
int FPUInstruction(byte* data);
|
428
|
-
int MemoryFPUInstruction(int escape_opcode, int regop, byte* modrm_start);
|
429
|
-
int RegisterFPUInstruction(int escape_opcode, byte modrm_byte);
|
430
|
-
void AppendToBuffer(const char* format, ...);
|
431
|
-
|
432
|
-
void UnimplementedInstruction() {
|
433
|
-
if (abort_on_unimplemented_) {
|
434
|
-
CHECK(false);
|
435
|
-
} else {
|
436
|
-
AppendToBuffer("'Unimplemented Instruction'");
|
437
|
-
}
|
438
|
-
}
|
439
|
-
};
|
440
|
-
|
441
|
-
|
442
|
-
void DisassemblerX64::AppendToBuffer(const char* format, ...) {
|
443
|
-
v8::internal::Vector<char> buf = tmp_buffer_ + tmp_buffer_pos_;
|
444
|
-
va_list args;
|
445
|
-
va_start(args, format);
|
446
|
-
int result = v8::internal::OS::VSNPrintF(buf, format, args);
|
447
|
-
va_end(args);
|
448
|
-
tmp_buffer_pos_ += result;
|
449
|
-
}
|
450
|
-
|
451
|
-
|
452
|
-
int DisassemblerX64::PrintRightOperandHelper(
|
453
|
-
byte* modrmp,
|
454
|
-
RegisterNameMapping register_name) {
|
455
|
-
int mod, regop, rm;
|
456
|
-
get_modrm(*modrmp, &mod, ®op, &rm);
|
457
|
-
switch (mod) {
|
458
|
-
case 0:
|
459
|
-
if ((rm & 7) == 5) {
|
460
|
-
int32_t disp = *reinterpret_cast<int32_t*>(modrmp + 1);
|
461
|
-
AppendToBuffer("[0x%x]", disp);
|
462
|
-
return 5;
|
463
|
-
} else if ((rm & 7) == 4) {
|
464
|
-
// Codes for SIB byte.
|
465
|
-
byte sib = *(modrmp + 1);
|
466
|
-
int scale, index, base;
|
467
|
-
get_sib(sib, &scale, &index, &base);
|
468
|
-
if (index == 4 && (base & 7) == 4 && scale == 0 /*times_1*/) {
|
469
|
-
// index == rsp means no index. Only use sib byte with no index for
|
470
|
-
// rsp and r12 base.
|
471
|
-
AppendToBuffer("[%s]", NameOfCPURegister(base));
|
472
|
-
return 2;
|
473
|
-
} else if (base == 5) {
|
474
|
-
// base == rbp means no base register (when mod == 0).
|
475
|
-
int32_t disp = *reinterpret_cast<int32_t*>(modrmp + 2);
|
476
|
-
AppendToBuffer("[%s*%d+0x%x]",
|
477
|
-
NameOfCPURegister(index),
|
478
|
-
1 << scale, disp);
|
479
|
-
return 6;
|
480
|
-
} else if (index != 4 && base != 5) {
|
481
|
-
// [base+index*scale]
|
482
|
-
AppendToBuffer("[%s+%s*%d]",
|
483
|
-
NameOfCPURegister(base),
|
484
|
-
NameOfCPURegister(index),
|
485
|
-
1 << scale);
|
486
|
-
return 2;
|
487
|
-
} else {
|
488
|
-
UnimplementedInstruction();
|
489
|
-
return 1;
|
490
|
-
}
|
491
|
-
} else {
|
492
|
-
AppendToBuffer("[%s]", NameOfCPURegister(rm));
|
493
|
-
return 1;
|
494
|
-
}
|
495
|
-
break;
|
496
|
-
case 1: // fall through
|
497
|
-
case 2:
|
498
|
-
if ((rm & 7) == 4) {
|
499
|
-
byte sib = *(modrmp + 1);
|
500
|
-
int scale, index, base;
|
501
|
-
get_sib(sib, &scale, &index, &base);
|
502
|
-
int disp = (mod == 2) ? *reinterpret_cast<int32_t*>(modrmp + 2)
|
503
|
-
: *reinterpret_cast<char*>(modrmp + 2);
|
504
|
-
if (index == 4 && (base & 7) == 4 && scale == 0 /*times_1*/) {
|
505
|
-
if (-disp > 0) {
|
506
|
-
AppendToBuffer("[%s-0x%x]", NameOfCPURegister(base), -disp);
|
507
|
-
} else {
|
508
|
-
AppendToBuffer("[%s+0x%x]", NameOfCPURegister(base), disp);
|
509
|
-
}
|
510
|
-
} else {
|
511
|
-
if (-disp > 0) {
|
512
|
-
AppendToBuffer("[%s+%s*%d-0x%x]",
|
513
|
-
NameOfCPURegister(base),
|
514
|
-
NameOfCPURegister(index),
|
515
|
-
1 << scale,
|
516
|
-
-disp);
|
517
|
-
} else {
|
518
|
-
AppendToBuffer("[%s+%s*%d+0x%x]",
|
519
|
-
NameOfCPURegister(base),
|
520
|
-
NameOfCPURegister(index),
|
521
|
-
1 << scale,
|
522
|
-
disp);
|
523
|
-
}
|
524
|
-
}
|
525
|
-
return mod == 2 ? 6 : 3;
|
526
|
-
} else {
|
527
|
-
// No sib.
|
528
|
-
int disp = (mod == 2) ? *reinterpret_cast<int32_t*>(modrmp + 1)
|
529
|
-
: *reinterpret_cast<char*>(modrmp + 1);
|
530
|
-
if (-disp > 0) {
|
531
|
-
AppendToBuffer("[%s-0x%x]", NameOfCPURegister(rm), -disp);
|
532
|
-
} else {
|
533
|
-
AppendToBuffer("[%s+0x%x]", NameOfCPURegister(rm), disp);
|
534
|
-
}
|
535
|
-
return (mod == 2) ? 5 : 2;
|
536
|
-
}
|
537
|
-
break;
|
538
|
-
case 3:
|
539
|
-
AppendToBuffer("%s", (this->*register_name)(rm));
|
540
|
-
return 1;
|
541
|
-
default:
|
542
|
-
UnimplementedInstruction();
|
543
|
-
return 1;
|
544
|
-
}
|
545
|
-
UNREACHABLE();
|
546
|
-
}
|
547
|
-
|
548
|
-
|
549
|
-
int DisassemblerX64::PrintImmediate(byte* data, OperandSize size) {
|
550
|
-
int64_t value;
|
551
|
-
int count;
|
552
|
-
switch (size) {
|
553
|
-
case BYTE_SIZE:
|
554
|
-
value = *data;
|
555
|
-
count = 1;
|
556
|
-
break;
|
557
|
-
case WORD_SIZE:
|
558
|
-
value = *reinterpret_cast<int16_t*>(data);
|
559
|
-
count = 2;
|
560
|
-
break;
|
561
|
-
case DOUBLEWORD_SIZE:
|
562
|
-
value = *reinterpret_cast<uint32_t*>(data);
|
563
|
-
count = 4;
|
564
|
-
break;
|
565
|
-
case QUADWORD_SIZE:
|
566
|
-
value = *reinterpret_cast<int32_t*>(data);
|
567
|
-
count = 4;
|
568
|
-
break;
|
569
|
-
default:
|
570
|
-
UNREACHABLE();
|
571
|
-
value = 0; // Initialize variables on all paths to satisfy the compiler.
|
572
|
-
count = 0;
|
573
|
-
}
|
574
|
-
AppendToBuffer("%" V8_PTR_PREFIX "x", value);
|
575
|
-
return count;
|
576
|
-
}
|
577
|
-
|
578
|
-
|
579
|
-
int DisassemblerX64::PrintRightOperand(byte* modrmp) {
|
580
|
-
return PrintRightOperandHelper(modrmp,
|
581
|
-
&DisassemblerX64::NameOfCPURegister);
|
582
|
-
}
|
583
|
-
|
584
|
-
|
585
|
-
int DisassemblerX64::PrintRightByteOperand(byte* modrmp) {
|
586
|
-
return PrintRightOperandHelper(modrmp,
|
587
|
-
&DisassemblerX64::NameOfByteCPURegister);
|
588
|
-
}
|
589
|
-
|
590
|
-
|
591
|
-
int DisassemblerX64::PrintRightXMMOperand(byte* modrmp) {
|
592
|
-
return PrintRightOperandHelper(modrmp,
|
593
|
-
&DisassemblerX64::NameOfXMMRegister);
|
594
|
-
}
|
595
|
-
|
596
|
-
|
597
|
-
// Returns number of bytes used including the current *data.
|
598
|
-
// Writes instruction's mnemonic, left and right operands to 'tmp_buffer_'.
|
599
|
-
int DisassemblerX64::PrintOperands(const char* mnem,
|
600
|
-
OperandType op_order,
|
601
|
-
byte* data) {
|
602
|
-
byte modrm = *data;
|
603
|
-
int mod, regop, rm;
|
604
|
-
get_modrm(modrm, &mod, ®op, &rm);
|
605
|
-
int advance = 0;
|
606
|
-
const char* register_name =
|
607
|
-
byte_size_operand_ ? NameOfByteCPURegister(regop)
|
608
|
-
: NameOfCPURegister(regop);
|
609
|
-
switch (op_order) {
|
610
|
-
case REG_OPER_OP_ORDER: {
|
611
|
-
AppendToBuffer("%s%c %s,",
|
612
|
-
mnem,
|
613
|
-
operand_size_code(),
|
614
|
-
register_name);
|
615
|
-
advance = byte_size_operand_ ? PrintRightByteOperand(data)
|
616
|
-
: PrintRightOperand(data);
|
617
|
-
break;
|
618
|
-
}
|
619
|
-
case OPER_REG_OP_ORDER: {
|
620
|
-
AppendToBuffer("%s%c ", mnem, operand_size_code());
|
621
|
-
advance = byte_size_operand_ ? PrintRightByteOperand(data)
|
622
|
-
: PrintRightOperand(data);
|
623
|
-
AppendToBuffer(",%s", register_name);
|
624
|
-
break;
|
625
|
-
}
|
626
|
-
default:
|
627
|
-
UNREACHABLE();
|
628
|
-
break;
|
629
|
-
}
|
630
|
-
return advance;
|
631
|
-
}
|
632
|
-
|
633
|
-
|
634
|
-
// Returns number of bytes used by machine instruction, including *data byte.
|
635
|
-
// Writes immediate instructions to 'tmp_buffer_'.
|
636
|
-
int DisassemblerX64::PrintImmediateOp(byte* data) {
|
637
|
-
bool byte_size_immediate = (*data & 0x02) != 0;
|
638
|
-
byte modrm = *(data + 1);
|
639
|
-
int mod, regop, rm;
|
640
|
-
get_modrm(modrm, &mod, ®op, &rm);
|
641
|
-
const char* mnem = "Imm???";
|
642
|
-
switch (regop) {
|
643
|
-
case 0:
|
644
|
-
mnem = "add";
|
645
|
-
break;
|
646
|
-
case 1:
|
647
|
-
mnem = "or";
|
648
|
-
break;
|
649
|
-
case 2:
|
650
|
-
mnem = "adc";
|
651
|
-
break;
|
652
|
-
case 4:
|
653
|
-
mnem = "and";
|
654
|
-
break;
|
655
|
-
case 5:
|
656
|
-
mnem = "sub";
|
657
|
-
break;
|
658
|
-
case 6:
|
659
|
-
mnem = "xor";
|
660
|
-
break;
|
661
|
-
case 7:
|
662
|
-
mnem = "cmp";
|
663
|
-
break;
|
664
|
-
default:
|
665
|
-
UnimplementedInstruction();
|
666
|
-
}
|
667
|
-
AppendToBuffer("%s%c ", mnem, operand_size_code());
|
668
|
-
int count = PrintRightOperand(data + 1);
|
669
|
-
AppendToBuffer(",0x");
|
670
|
-
OperandSize immediate_size = byte_size_immediate ? BYTE_SIZE : operand_size();
|
671
|
-
count += PrintImmediate(data + 1 + count, immediate_size);
|
672
|
-
return 1 + count;
|
673
|
-
}
|
674
|
-
|
675
|
-
|
676
|
-
// Returns number of bytes used, including *data.
|
677
|
-
int DisassemblerX64::F6F7Instruction(byte* data) {
|
678
|
-
ASSERT(*data == 0xF7 || *data == 0xF6);
|
679
|
-
byte modrm = *(data + 1);
|
680
|
-
int mod, regop, rm;
|
681
|
-
get_modrm(modrm, &mod, ®op, &rm);
|
682
|
-
if (mod == 3 && regop != 0) {
|
683
|
-
const char* mnem = NULL;
|
684
|
-
switch (regop) {
|
685
|
-
case 2:
|
686
|
-
mnem = "not";
|
687
|
-
break;
|
688
|
-
case 3:
|
689
|
-
mnem = "neg";
|
690
|
-
break;
|
691
|
-
case 4:
|
692
|
-
mnem = "mul";
|
693
|
-
break;
|
694
|
-
case 7:
|
695
|
-
mnem = "idiv";
|
696
|
-
break;
|
697
|
-
default:
|
698
|
-
UnimplementedInstruction();
|
699
|
-
}
|
700
|
-
AppendToBuffer("%s%c %s",
|
701
|
-
mnem,
|
702
|
-
operand_size_code(),
|
703
|
-
NameOfCPURegister(rm));
|
704
|
-
return 2;
|
705
|
-
} else if (regop == 0) {
|
706
|
-
AppendToBuffer("test%c ", operand_size_code());
|
707
|
-
int count = PrintRightOperand(data + 1); // Use name of 64-bit register.
|
708
|
-
AppendToBuffer(",0x");
|
709
|
-
count += PrintImmediate(data + 1 + count, operand_size());
|
710
|
-
return 1 + count;
|
711
|
-
} else {
|
712
|
-
UnimplementedInstruction();
|
713
|
-
return 2;
|
714
|
-
}
|
715
|
-
}
|
716
|
-
|
717
|
-
|
718
|
-
int DisassemblerX64::ShiftInstruction(byte* data) {
|
719
|
-
byte op = *data & (~1);
|
720
|
-
if (op != 0xD0 && op != 0xD2 && op != 0xC0) {
|
721
|
-
UnimplementedInstruction();
|
722
|
-
return 1;
|
723
|
-
}
|
724
|
-
byte modrm = *(data + 1);
|
725
|
-
int mod, regop, rm;
|
726
|
-
get_modrm(modrm, &mod, ®op, &rm);
|
727
|
-
regop &= 0x7; // The REX.R bit does not affect the operation.
|
728
|
-
int imm8 = -1;
|
729
|
-
int num_bytes = 2;
|
730
|
-
if (mod != 3) {
|
731
|
-
UnimplementedInstruction();
|
732
|
-
return num_bytes;
|
733
|
-
}
|
734
|
-
const char* mnem = NULL;
|
735
|
-
switch (regop) {
|
736
|
-
case 0:
|
737
|
-
mnem = "rol";
|
738
|
-
break;
|
739
|
-
case 1:
|
740
|
-
mnem = "ror";
|
741
|
-
break;
|
742
|
-
case 2:
|
743
|
-
mnem = "rcl";
|
744
|
-
break;
|
745
|
-
case 3:
|
746
|
-
mnem = "rcr";
|
747
|
-
break;
|
748
|
-
case 4:
|
749
|
-
mnem = "shl";
|
750
|
-
break;
|
751
|
-
case 5:
|
752
|
-
mnem = "shr";
|
753
|
-
break;
|
754
|
-
case 7:
|
755
|
-
mnem = "sar";
|
756
|
-
break;
|
757
|
-
default:
|
758
|
-
UnimplementedInstruction();
|
759
|
-
return num_bytes;
|
760
|
-
}
|
761
|
-
ASSERT_NE(NULL, mnem);
|
762
|
-
if (op == 0xD0) {
|
763
|
-
imm8 = 1;
|
764
|
-
} else if (op == 0xC0) {
|
765
|
-
imm8 = *(data + 2);
|
766
|
-
num_bytes = 3;
|
767
|
-
}
|
768
|
-
AppendToBuffer("%s%c %s,",
|
769
|
-
mnem,
|
770
|
-
operand_size_code(),
|
771
|
-
byte_size_operand_ ? NameOfByteCPURegister(rm)
|
772
|
-
: NameOfCPURegister(rm));
|
773
|
-
if (op == 0xD2) {
|
774
|
-
AppendToBuffer("cl");
|
775
|
-
} else {
|
776
|
-
AppendToBuffer("%d", imm8);
|
777
|
-
}
|
778
|
-
return num_bytes;
|
779
|
-
}
|
780
|
-
|
781
|
-
|
782
|
-
// Returns number of bytes used, including *data.
|
783
|
-
int DisassemblerX64::JumpShort(byte* data) {
|
784
|
-
ASSERT_EQ(0xEB, *data);
|
785
|
-
byte b = *(data + 1);
|
786
|
-
byte* dest = data + static_cast<int8_t>(b) + 2;
|
787
|
-
AppendToBuffer("jmp %s", NameOfAddress(dest));
|
788
|
-
return 2;
|
789
|
-
}
|
790
|
-
|
791
|
-
|
792
|
-
// Returns number of bytes used, including *data.
|
793
|
-
int DisassemblerX64::JumpConditional(byte* data) {
|
794
|
-
ASSERT_EQ(0x0F, *data);
|
795
|
-
byte cond = *(data + 1) & 0x0F;
|
796
|
-
byte* dest = data + *reinterpret_cast<int32_t*>(data + 2) + 6;
|
797
|
-
const char* mnem = conditional_code_suffix[cond];
|
798
|
-
AppendToBuffer("j%s %s", mnem, NameOfAddress(dest));
|
799
|
-
return 6; // includes 0x0F
|
800
|
-
}
|
801
|
-
|
802
|
-
|
803
|
-
// Returns number of bytes used, including *data.
|
804
|
-
int DisassemblerX64::JumpConditionalShort(byte* data) {
|
805
|
-
byte cond = *data & 0x0F;
|
806
|
-
byte b = *(data + 1);
|
807
|
-
byte* dest = data + static_cast<int8_t>(b) + 2;
|
808
|
-
const char* mnem = conditional_code_suffix[cond];
|
809
|
-
AppendToBuffer("j%s %s", mnem, NameOfAddress(dest));
|
810
|
-
return 2;
|
811
|
-
}
|
812
|
-
|
813
|
-
|
814
|
-
// Returns number of bytes used, including *data.
|
815
|
-
int DisassemblerX64::SetCC(byte* data) {
|
816
|
-
ASSERT_EQ(0x0F, *data);
|
817
|
-
byte cond = *(data + 1) & 0x0F;
|
818
|
-
const char* mnem = conditional_code_suffix[cond];
|
819
|
-
AppendToBuffer("set%s%c ", mnem, operand_size_code());
|
820
|
-
PrintRightByteOperand(data + 2);
|
821
|
-
return 3; // includes 0x0F
|
822
|
-
}
|
823
|
-
|
824
|
-
|
825
|
-
// Returns number of bytes used, including *data.
|
826
|
-
int DisassemblerX64::FPUInstruction(byte* data) {
|
827
|
-
byte escape_opcode = *data;
|
828
|
-
ASSERT_EQ(0xD8, escape_opcode & 0xF8);
|
829
|
-
byte modrm_byte = *(data+1);
|
830
|
-
|
831
|
-
if (modrm_byte >= 0xC0) {
|
832
|
-
return RegisterFPUInstruction(escape_opcode, modrm_byte);
|
833
|
-
} else {
|
834
|
-
return MemoryFPUInstruction(escape_opcode, modrm_byte, data+1);
|
835
|
-
}
|
836
|
-
}
|
837
|
-
|
838
|
-
int DisassemblerX64::MemoryFPUInstruction(int escape_opcode,
|
839
|
-
int modrm_byte,
|
840
|
-
byte* modrm_start) {
|
841
|
-
const char* mnem = "?";
|
842
|
-
int regop = (modrm_byte >> 3) & 0x7; // reg/op field of modrm byte.
|
843
|
-
switch (escape_opcode) {
|
844
|
-
case 0xD9: switch (regop) {
|
845
|
-
case 0: mnem = "fld_s"; break;
|
846
|
-
case 3: mnem = "fstp_s"; break;
|
847
|
-
case 7: mnem = "fstcw"; break;
|
848
|
-
default: UnimplementedInstruction();
|
849
|
-
}
|
850
|
-
break;
|
851
|
-
|
852
|
-
case 0xDB: switch (regop) {
|
853
|
-
case 0: mnem = "fild_s"; break;
|
854
|
-
case 1: mnem = "fisttp_s"; break;
|
855
|
-
case 2: mnem = "fist_s"; break;
|
856
|
-
case 3: mnem = "fistp_s"; break;
|
857
|
-
default: UnimplementedInstruction();
|
858
|
-
}
|
859
|
-
break;
|
860
|
-
|
861
|
-
case 0xDD: switch (regop) {
|
862
|
-
case 0: mnem = "fld_d"; break;
|
863
|
-
case 3: mnem = "fstp_d"; break;
|
864
|
-
default: UnimplementedInstruction();
|
865
|
-
}
|
866
|
-
break;
|
867
|
-
|
868
|
-
case 0xDF: switch (regop) {
|
869
|
-
case 5: mnem = "fild_d"; break;
|
870
|
-
case 7: mnem = "fistp_d"; break;
|
871
|
-
default: UnimplementedInstruction();
|
872
|
-
}
|
873
|
-
break;
|
874
|
-
|
875
|
-
default: UnimplementedInstruction();
|
876
|
-
}
|
877
|
-
AppendToBuffer("%s ", mnem);
|
878
|
-
int count = PrintRightOperand(modrm_start);
|
879
|
-
return count + 1;
|
880
|
-
}
|
881
|
-
|
882
|
-
int DisassemblerX64::RegisterFPUInstruction(int escape_opcode,
|
883
|
-
byte modrm_byte) {
|
884
|
-
bool has_register = false; // Is the FPU register encoded in modrm_byte?
|
885
|
-
const char* mnem = "?";
|
886
|
-
|
887
|
-
switch (escape_opcode) {
|
888
|
-
case 0xD8:
|
889
|
-
UnimplementedInstruction();
|
890
|
-
break;
|
891
|
-
|
892
|
-
case 0xD9:
|
893
|
-
switch (modrm_byte & 0xF8) {
|
894
|
-
case 0xC8:
|
895
|
-
mnem = "fxch";
|
896
|
-
has_register = true;
|
897
|
-
break;
|
898
|
-
default:
|
899
|
-
switch (modrm_byte) {
|
900
|
-
case 0xE0: mnem = "fchs"; break;
|
901
|
-
case 0xE1: mnem = "fabs"; break;
|
902
|
-
case 0xE4: mnem = "ftst"; break;
|
903
|
-
case 0xE8: mnem = "fld1"; break;
|
904
|
-
case 0xEE: mnem = "fldz"; break;
|
905
|
-
case 0xF5: mnem = "fprem1"; break;
|
906
|
-
case 0xF7: mnem = "fincstp"; break;
|
907
|
-
case 0xF8: mnem = "fprem"; break;
|
908
|
-
case 0xFE: mnem = "fsin"; break;
|
909
|
-
case 0xFF: mnem = "fcos"; break;
|
910
|
-
default: UnimplementedInstruction();
|
911
|
-
}
|
912
|
-
}
|
913
|
-
break;
|
914
|
-
|
915
|
-
case 0xDA:
|
916
|
-
if (modrm_byte == 0xE9) {
|
917
|
-
mnem = "fucompp";
|
918
|
-
} else {
|
919
|
-
UnimplementedInstruction();
|
920
|
-
}
|
921
|
-
break;
|
922
|
-
|
923
|
-
case 0xDB:
|
924
|
-
if ((modrm_byte & 0xF8) == 0xE8) {
|
925
|
-
mnem = "fucomi";
|
926
|
-
has_register = true;
|
927
|
-
} else if (modrm_byte == 0xE2) {
|
928
|
-
mnem = "fclex";
|
929
|
-
} else {
|
930
|
-
UnimplementedInstruction();
|
931
|
-
}
|
932
|
-
break;
|
933
|
-
|
934
|
-
case 0xDC:
|
935
|
-
has_register = true;
|
936
|
-
switch (modrm_byte & 0xF8) {
|
937
|
-
case 0xC0: mnem = "fadd"; break;
|
938
|
-
case 0xE8: mnem = "fsub"; break;
|
939
|
-
case 0xC8: mnem = "fmul"; break;
|
940
|
-
case 0xF8: mnem = "fdiv"; break;
|
941
|
-
default: UnimplementedInstruction();
|
942
|
-
}
|
943
|
-
break;
|
944
|
-
|
945
|
-
case 0xDD:
|
946
|
-
has_register = true;
|
947
|
-
switch (modrm_byte & 0xF8) {
|
948
|
-
case 0xC0: mnem = "ffree"; break;
|
949
|
-
case 0xD8: mnem = "fstp"; break;
|
950
|
-
default: UnimplementedInstruction();
|
951
|
-
}
|
952
|
-
break;
|
953
|
-
|
954
|
-
case 0xDE:
|
955
|
-
if (modrm_byte == 0xD9) {
|
956
|
-
mnem = "fcompp";
|
957
|
-
} else {
|
958
|
-
has_register = true;
|
959
|
-
switch (modrm_byte & 0xF8) {
|
960
|
-
case 0xC0: mnem = "faddp"; break;
|
961
|
-
case 0xE8: mnem = "fsubp"; break;
|
962
|
-
case 0xC8: mnem = "fmulp"; break;
|
963
|
-
case 0xF8: mnem = "fdivp"; break;
|
964
|
-
default: UnimplementedInstruction();
|
965
|
-
}
|
966
|
-
}
|
967
|
-
break;
|
968
|
-
|
969
|
-
case 0xDF:
|
970
|
-
if (modrm_byte == 0xE0) {
|
971
|
-
mnem = "fnstsw_ax";
|
972
|
-
} else if ((modrm_byte & 0xF8) == 0xE8) {
|
973
|
-
mnem = "fucomip";
|
974
|
-
has_register = true;
|
975
|
-
}
|
976
|
-
break;
|
977
|
-
|
978
|
-
default: UnimplementedInstruction();
|
979
|
-
}
|
980
|
-
|
981
|
-
if (has_register) {
|
982
|
-
AppendToBuffer("%s st%d", mnem, modrm_byte & 0x7);
|
983
|
-
} else {
|
984
|
-
AppendToBuffer("%s", mnem);
|
985
|
-
}
|
986
|
-
return 2;
|
987
|
-
}
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
// Handle all two-byte opcodes, which start with 0x0F.
|
992
|
-
// These instructions may be affected by an 0x66, 0xF2, or 0xF3 prefix.
|
993
|
-
// We do not use any three-byte opcodes, which start with 0x0F38 or 0x0F3A.
|
994
|
-
int DisassemblerX64::TwoByteOpcodeInstruction(byte* data) {
|
995
|
-
byte opcode = *(data + 1);
|
996
|
-
byte* current = data + 2;
|
997
|
-
// At return, "current" points to the start of the next instruction.
|
998
|
-
const char* mnemonic = TwoByteMnemonic(opcode);
|
999
|
-
if (operand_size_ == 0x66) {
|
1000
|
-
// 0x66 0x0F prefix.
|
1001
|
-
int mod, regop, rm;
|
1002
|
-
if (opcode == 0x3A) {
|
1003
|
-
byte third_byte = *current;
|
1004
|
-
current = data + 3;
|
1005
|
-
if (third_byte == 0x17) {
|
1006
|
-
get_modrm(*current, &mod, ®op, &rm);
|
1007
|
-
AppendToBuffer("extractps "); // reg/m32, xmm, imm8
|
1008
|
-
current += PrintRightOperand(current);
|
1009
|
-
AppendToBuffer(", %s, %d", NameOfCPURegister(regop), (*current) & 3);
|
1010
|
-
current += 1;
|
1011
|
-
} else {
|
1012
|
-
UnimplementedInstruction();
|
1013
|
-
}
|
1014
|
-
} else {
|
1015
|
-
get_modrm(*current, &mod, ®op, &rm);
|
1016
|
-
if (opcode == 0x6E) {
|
1017
|
-
AppendToBuffer("mov%c %s,",
|
1018
|
-
rex_w() ? 'q' : 'd',
|
1019
|
-
NameOfXMMRegister(regop));
|
1020
|
-
current += PrintRightOperand(current);
|
1021
|
-
} else if (opcode == 0x7E) {
|
1022
|
-
AppendToBuffer("mov%c %s,",
|
1023
|
-
rex_w() ? 'q' : 'd',
|
1024
|
-
NameOfCPURegister(regop));
|
1025
|
-
current += PrintRightXMMOperand(current);
|
1026
|
-
} else {
|
1027
|
-
const char* mnemonic = "?";
|
1028
|
-
if (opcode == 0x57) {
|
1029
|
-
mnemonic = "xorpd";
|
1030
|
-
} else if (opcode == 0x2E) {
|
1031
|
-
mnemonic = "ucomisd";
|
1032
|
-
} else if (opcode == 0x2F) {
|
1033
|
-
mnemonic = "comisd";
|
1034
|
-
} else {
|
1035
|
-
UnimplementedInstruction();
|
1036
|
-
}
|
1037
|
-
AppendToBuffer("%s %s,", mnemonic, NameOfXMMRegister(regop));
|
1038
|
-
current += PrintRightXMMOperand(current);
|
1039
|
-
}
|
1040
|
-
}
|
1041
|
-
} else if (group_1_prefix_ == 0xF2) {
|
1042
|
-
// Beginning of instructions with prefix 0xF2.
|
1043
|
-
|
1044
|
-
if (opcode == 0x11 || opcode == 0x10) {
|
1045
|
-
// MOVSD: Move scalar double-precision fp to/from/between XMM registers.
|
1046
|
-
AppendToBuffer("movsd ");
|
1047
|
-
int mod, regop, rm;
|
1048
|
-
get_modrm(*current, &mod, ®op, &rm);
|
1049
|
-
if (opcode == 0x11) {
|
1050
|
-
current += PrintRightOperand(current);
|
1051
|
-
AppendToBuffer(",%s", NameOfXMMRegister(regop));
|
1052
|
-
} else {
|
1053
|
-
AppendToBuffer("%s,", NameOfXMMRegister(regop));
|
1054
|
-
current += PrintRightOperand(current);
|
1055
|
-
}
|
1056
|
-
} else if (opcode == 0x2A) {
|
1057
|
-
// CVTSI2SD: integer to XMM double conversion.
|
1058
|
-
int mod, regop, rm;
|
1059
|
-
get_modrm(*current, &mod, ®op, &rm);
|
1060
|
-
AppendToBuffer("%sd %s,", mnemonic, NameOfXMMRegister(regop));
|
1061
|
-
current += PrintRightOperand(current);
|
1062
|
-
} else if ((opcode & 0xF8) == 0x58 || opcode == 0x51) {
|
1063
|
-
// XMM arithmetic. Mnemonic was retrieved at the start of this function.
|
1064
|
-
int mod, regop, rm;
|
1065
|
-
get_modrm(*current, &mod, ®op, &rm);
|
1066
|
-
AppendToBuffer("%s %s,", mnemonic, NameOfXMMRegister(regop));
|
1067
|
-
current += PrintRightXMMOperand(current);
|
1068
|
-
} else {
|
1069
|
-
UnimplementedInstruction();
|
1070
|
-
}
|
1071
|
-
} else if (group_1_prefix_ == 0xF3) {
|
1072
|
-
// Instructions with prefix 0xF3.
|
1073
|
-
if (opcode == 0x11 || opcode == 0x10) {
|
1074
|
-
// MOVSS: Move scalar double-precision fp to/from/between XMM registers.
|
1075
|
-
AppendToBuffer("movss ");
|
1076
|
-
int mod, regop, rm;
|
1077
|
-
get_modrm(*current, &mod, ®op, &rm);
|
1078
|
-
if (opcode == 0x11) {
|
1079
|
-
current += PrintRightOperand(current);
|
1080
|
-
AppendToBuffer(",%s", NameOfXMMRegister(regop));
|
1081
|
-
} else {
|
1082
|
-
AppendToBuffer("%s,", NameOfXMMRegister(regop));
|
1083
|
-
current += PrintRightOperand(current);
|
1084
|
-
}
|
1085
|
-
} else if (opcode == 0x2A) {
|
1086
|
-
// CVTSI2SS: integer to XMM single conversion.
|
1087
|
-
int mod, regop, rm;
|
1088
|
-
get_modrm(*current, &mod, ®op, &rm);
|
1089
|
-
AppendToBuffer("%ss %s,", mnemonic, NameOfXMMRegister(regop));
|
1090
|
-
current += PrintRightOperand(current);
|
1091
|
-
} else if (opcode == 0x2C) {
|
1092
|
-
// CVTTSS2SI: Convert scalar single-precision FP to dword integer.
|
1093
|
-
// Assert that mod is not 3, so source is memory, not an XMM register.
|
1094
|
-
ASSERT_NE(0xC0, *current & 0xC0);
|
1095
|
-
current += PrintOperands("cvttss2si", REG_OPER_OP_ORDER, current);
|
1096
|
-
} else if (opcode == 0x5A) {
|
1097
|
-
int mod, regop, rm;
|
1098
|
-
get_modrm(*current, &mod, ®op, &rm);
|
1099
|
-
AppendToBuffer("cvtss2sd %s,", NameOfXMMRegister(regop));
|
1100
|
-
current += PrintRightXMMOperand(current);
|
1101
|
-
} else {
|
1102
|
-
UnimplementedInstruction();
|
1103
|
-
}
|
1104
|
-
} else if (opcode == 0x1F) {
|
1105
|
-
// NOP
|
1106
|
-
int mod, regop, rm;
|
1107
|
-
get_modrm(*current, &mod, ®op, &rm);
|
1108
|
-
current++;
|
1109
|
-
if (regop == 4) { // SIB byte present.
|
1110
|
-
current++;
|
1111
|
-
}
|
1112
|
-
if (mod == 1) { // Byte displacement.
|
1113
|
-
current += 1;
|
1114
|
-
} else if (mod == 2) { // 32-bit displacement.
|
1115
|
-
current += 4;
|
1116
|
-
} // else no immediate displacement.
|
1117
|
-
AppendToBuffer("nop");
|
1118
|
-
} else if (opcode == 0xA2 || opcode == 0x31) {
|
1119
|
-
// RDTSC or CPUID
|
1120
|
-
AppendToBuffer("%s", mnemonic);
|
1121
|
-
|
1122
|
-
} else if ((opcode & 0xF0) == 0x40) {
|
1123
|
-
// CMOVcc: conditional move.
|
1124
|
-
int condition = opcode & 0x0F;
|
1125
|
-
const InstructionDesc& idesc = cmov_instructions[condition];
|
1126
|
-
byte_size_operand_ = idesc.byte_size_operation;
|
1127
|
-
current += PrintOperands(idesc.mnem, idesc.op_order_, current);
|
1128
|
-
|
1129
|
-
} else if ((opcode & 0xF0) == 0x80) {
|
1130
|
-
// Jcc: Conditional jump (branch).
|
1131
|
-
current = data + JumpConditional(data);
|
1132
|
-
|
1133
|
-
} else if (opcode == 0xBE || opcode == 0xBF || opcode == 0xB6 ||
|
1134
|
-
opcode == 0xB7 || opcode == 0xAF) {
|
1135
|
-
// Size-extending moves, IMUL.
|
1136
|
-
current += PrintOperands(mnemonic, REG_OPER_OP_ORDER, current);
|
1137
|
-
|
1138
|
-
} else if ((opcode & 0xF0) == 0x90) {
|
1139
|
-
// SETcc: Set byte on condition. Needs pointer to beginning of instruction.
|
1140
|
-
current = data + SetCC(data);
|
1141
|
-
|
1142
|
-
} else if (opcode == 0xAB || opcode == 0xA5 || opcode == 0xAD) {
|
1143
|
-
// SHLD, SHRD (double-precision shift), BTS (bit set).
|
1144
|
-
AppendToBuffer("%s ", mnemonic);
|
1145
|
-
int mod, regop, rm;
|
1146
|
-
get_modrm(*current, &mod, ®op, &rm);
|
1147
|
-
current += PrintRightOperand(current);
|
1148
|
-
if (opcode == 0xAB) {
|
1149
|
-
AppendToBuffer(",%s", NameOfCPURegister(regop));
|
1150
|
-
} else {
|
1151
|
-
AppendToBuffer(",%s,cl", NameOfCPURegister(regop));
|
1152
|
-
}
|
1153
|
-
} else {
|
1154
|
-
UnimplementedInstruction();
|
1155
|
-
}
|
1156
|
-
return static_cast<int>(current - data);
|
1157
|
-
}
|
1158
|
-
|
1159
|
-
|
1160
|
-
// Mnemonics for two-byte opcode instructions starting with 0x0F.
|
1161
|
-
// The argument is the second byte of the two-byte opcode.
|
1162
|
-
// Returns NULL if the instruction is not handled here.
|
1163
|
-
const char* DisassemblerX64::TwoByteMnemonic(byte opcode) {
|
1164
|
-
switch (opcode) {
|
1165
|
-
case 0x1F:
|
1166
|
-
return "nop";
|
1167
|
-
case 0x2A: // F2/F3 prefix.
|
1168
|
-
return "cvtsi2s";
|
1169
|
-
case 0x31:
|
1170
|
-
return "rdtsc";
|
1171
|
-
case 0x51: // F2 prefix.
|
1172
|
-
return "sqrtsd";
|
1173
|
-
case 0x58: // F2 prefix.
|
1174
|
-
return "addsd";
|
1175
|
-
case 0x59: // F2 prefix.
|
1176
|
-
return "mulsd";
|
1177
|
-
case 0x5C: // F2 prefix.
|
1178
|
-
return "subsd";
|
1179
|
-
case 0x5E: // F2 prefix.
|
1180
|
-
return "divsd";
|
1181
|
-
case 0xA2:
|
1182
|
-
return "cpuid";
|
1183
|
-
case 0xA5:
|
1184
|
-
return "shld";
|
1185
|
-
case 0xAB:
|
1186
|
-
return "bts";
|
1187
|
-
case 0xAD:
|
1188
|
-
return "shrd";
|
1189
|
-
case 0xAF:
|
1190
|
-
return "imul";
|
1191
|
-
case 0xB6:
|
1192
|
-
return "movzxb";
|
1193
|
-
case 0xB7:
|
1194
|
-
return "movzxw";
|
1195
|
-
case 0xBE:
|
1196
|
-
return "movsxb";
|
1197
|
-
case 0xBF:
|
1198
|
-
return "movsxw";
|
1199
|
-
default:
|
1200
|
-
return NULL;
|
1201
|
-
}
|
1202
|
-
}
|
1203
|
-
|
1204
|
-
|
1205
|
-
// Disassembles the instruction at instr, and writes it into out_buffer.
|
1206
|
-
int DisassemblerX64::InstructionDecode(v8::internal::Vector<char> out_buffer,
|
1207
|
-
byte* instr) {
|
1208
|
-
tmp_buffer_pos_ = 0; // starting to write as position 0
|
1209
|
-
byte* data = instr;
|
1210
|
-
bool processed = true; // Will be set to false if the current instruction
|
1211
|
-
// is not in 'instructions' table.
|
1212
|
-
byte current;
|
1213
|
-
|
1214
|
-
// Scan for prefixes.
|
1215
|
-
while (true) {
|
1216
|
-
current = *data;
|
1217
|
-
if (current == OPERAND_SIZE_OVERRIDE_PREFIX) { // Group 3 prefix.
|
1218
|
-
operand_size_ = current;
|
1219
|
-
} else if ((current & 0xF0) == 0x40) { // REX prefix.
|
1220
|
-
setRex(current);
|
1221
|
-
if (rex_w()) AppendToBuffer("REX.W ");
|
1222
|
-
} else if ((current & 0xFE) == 0xF2) { // Group 1 prefix (0xF2 or 0xF3).
|
1223
|
-
group_1_prefix_ = current;
|
1224
|
-
} else { // Not a prefix - an opcode.
|
1225
|
-
break;
|
1226
|
-
}
|
1227
|
-
data++;
|
1228
|
-
}
|
1229
|
-
|
1230
|
-
const InstructionDesc& idesc = instruction_table.Get(current);
|
1231
|
-
byte_size_operand_ = idesc.byte_size_operation;
|
1232
|
-
switch (idesc.type) {
|
1233
|
-
case ZERO_OPERANDS_INSTR:
|
1234
|
-
if (current >= 0xA4 && current <= 0xA7) {
|
1235
|
-
// String move or compare operations.
|
1236
|
-
if (group_1_prefix_ == REP_PREFIX) {
|
1237
|
-
// REP.
|
1238
|
-
AppendToBuffer("rep ");
|
1239
|
-
}
|
1240
|
-
if (rex_w()) AppendToBuffer("REX.W ");
|
1241
|
-
AppendToBuffer("%s%c", idesc.mnem, operand_size_code());
|
1242
|
-
} else {
|
1243
|
-
AppendToBuffer("%s", idesc.mnem, operand_size_code());
|
1244
|
-
}
|
1245
|
-
data++;
|
1246
|
-
break;
|
1247
|
-
|
1248
|
-
case TWO_OPERANDS_INSTR:
|
1249
|
-
data++;
|
1250
|
-
data += PrintOperands(idesc.mnem, idesc.op_order_, data);
|
1251
|
-
break;
|
1252
|
-
|
1253
|
-
case JUMP_CONDITIONAL_SHORT_INSTR:
|
1254
|
-
data += JumpConditionalShort(data);
|
1255
|
-
break;
|
1256
|
-
|
1257
|
-
case REGISTER_INSTR:
|
1258
|
-
AppendToBuffer("%s%c %s",
|
1259
|
-
idesc.mnem,
|
1260
|
-
operand_size_code(),
|
1261
|
-
NameOfCPURegister(base_reg(current & 0x07)));
|
1262
|
-
data++;
|
1263
|
-
break;
|
1264
|
-
case PUSHPOP_INSTR:
|
1265
|
-
AppendToBuffer("%s %s",
|
1266
|
-
idesc.mnem,
|
1267
|
-
NameOfCPURegister(base_reg(current & 0x07)));
|
1268
|
-
data++;
|
1269
|
-
break;
|
1270
|
-
case MOVE_REG_INSTR: {
|
1271
|
-
byte* addr = NULL;
|
1272
|
-
switch (operand_size()) {
|
1273
|
-
case WORD_SIZE:
|
1274
|
-
addr = reinterpret_cast<byte*>(*reinterpret_cast<int16_t*>(data + 1));
|
1275
|
-
data += 3;
|
1276
|
-
break;
|
1277
|
-
case DOUBLEWORD_SIZE:
|
1278
|
-
addr = reinterpret_cast<byte*>(*reinterpret_cast<int32_t*>(data + 1));
|
1279
|
-
data += 5;
|
1280
|
-
break;
|
1281
|
-
case QUADWORD_SIZE:
|
1282
|
-
addr = reinterpret_cast<byte*>(*reinterpret_cast<int64_t*>(data + 1));
|
1283
|
-
data += 9;
|
1284
|
-
break;
|
1285
|
-
default:
|
1286
|
-
UNREACHABLE();
|
1287
|
-
}
|
1288
|
-
AppendToBuffer("mov%c %s,%s",
|
1289
|
-
operand_size_code(),
|
1290
|
-
NameOfCPURegister(base_reg(current & 0x07)),
|
1291
|
-
NameOfAddress(addr));
|
1292
|
-
break;
|
1293
|
-
}
|
1294
|
-
|
1295
|
-
case CALL_JUMP_INSTR: {
|
1296
|
-
byte* addr = data + *reinterpret_cast<int32_t*>(data + 1) + 5;
|
1297
|
-
AppendToBuffer("%s %s", idesc.mnem, NameOfAddress(addr));
|
1298
|
-
data += 5;
|
1299
|
-
break;
|
1300
|
-
}
|
1301
|
-
|
1302
|
-
case SHORT_IMMEDIATE_INSTR: {
|
1303
|
-
byte* addr =
|
1304
|
-
reinterpret_cast<byte*>(*reinterpret_cast<int32_t*>(data + 1));
|
1305
|
-
AppendToBuffer("%s rax, %s", idesc.mnem, NameOfAddress(addr));
|
1306
|
-
data += 5;
|
1307
|
-
break;
|
1308
|
-
}
|
1309
|
-
|
1310
|
-
case NO_INSTR:
|
1311
|
-
processed = false;
|
1312
|
-
break;
|
1313
|
-
|
1314
|
-
default:
|
1315
|
-
UNIMPLEMENTED(); // This type is not implemented.
|
1316
|
-
}
|
1317
|
-
|
1318
|
-
// The first byte didn't match any of the simple opcodes, so we
|
1319
|
-
// need to do special processing on it.
|
1320
|
-
if (!processed) {
|
1321
|
-
switch (*data) {
|
1322
|
-
case 0xC2:
|
1323
|
-
AppendToBuffer("ret 0x%x", *reinterpret_cast<uint16_t*>(data + 1));
|
1324
|
-
data += 3;
|
1325
|
-
break;
|
1326
|
-
|
1327
|
-
case 0x69: // fall through
|
1328
|
-
case 0x6B: {
|
1329
|
-
int mod, regop, rm;
|
1330
|
-
get_modrm(*(data + 1), &mod, ®op, &rm);
|
1331
|
-
int32_t imm = *data == 0x6B ? *(data + 2)
|
1332
|
-
: *reinterpret_cast<int32_t*>(data + 2);
|
1333
|
-
AppendToBuffer("imul%c %s,%s,0x%x",
|
1334
|
-
operand_size_code(),
|
1335
|
-
NameOfCPURegister(regop),
|
1336
|
-
NameOfCPURegister(rm), imm);
|
1337
|
-
data += 2 + (*data == 0x6B ? 1 : 4);
|
1338
|
-
break;
|
1339
|
-
}
|
1340
|
-
|
1341
|
-
case 0x81: // fall through
|
1342
|
-
case 0x83: // 0x81 with sign extension bit set
|
1343
|
-
data += PrintImmediateOp(data);
|
1344
|
-
break;
|
1345
|
-
|
1346
|
-
case 0x0F:
|
1347
|
-
data += TwoByteOpcodeInstruction(data);
|
1348
|
-
break;
|
1349
|
-
|
1350
|
-
case 0x8F: {
|
1351
|
-
data++;
|
1352
|
-
int mod, regop, rm;
|
1353
|
-
get_modrm(*data, &mod, ®op, &rm);
|
1354
|
-
if (regop == 0) {
|
1355
|
-
AppendToBuffer("pop ");
|
1356
|
-
data += PrintRightOperand(data);
|
1357
|
-
}
|
1358
|
-
}
|
1359
|
-
break;
|
1360
|
-
|
1361
|
-
case 0xFF: {
|
1362
|
-
data++;
|
1363
|
-
int mod, regop, rm;
|
1364
|
-
get_modrm(*data, &mod, ®op, &rm);
|
1365
|
-
const char* mnem = NULL;
|
1366
|
-
switch (regop) {
|
1367
|
-
case 0:
|
1368
|
-
mnem = "inc";
|
1369
|
-
break;
|
1370
|
-
case 1:
|
1371
|
-
mnem = "dec";
|
1372
|
-
break;
|
1373
|
-
case 2:
|
1374
|
-
mnem = "call";
|
1375
|
-
break;
|
1376
|
-
case 4:
|
1377
|
-
mnem = "jmp";
|
1378
|
-
break;
|
1379
|
-
case 6:
|
1380
|
-
mnem = "push";
|
1381
|
-
break;
|
1382
|
-
default:
|
1383
|
-
mnem = "???";
|
1384
|
-
}
|
1385
|
-
AppendToBuffer(((regop <= 1) ? "%s%c " : "%s "),
|
1386
|
-
mnem,
|
1387
|
-
operand_size_code());
|
1388
|
-
data += PrintRightOperand(data);
|
1389
|
-
}
|
1390
|
-
break;
|
1391
|
-
|
1392
|
-
case 0xC7: // imm32, fall through
|
1393
|
-
case 0xC6: // imm8
|
1394
|
-
{
|
1395
|
-
bool is_byte = *data == 0xC6;
|
1396
|
-
data++;
|
1397
|
-
|
1398
|
-
AppendToBuffer("mov%c ", is_byte ? 'b' : operand_size_code());
|
1399
|
-
data += PrintRightOperand(data);
|
1400
|
-
int32_t imm = is_byte ? *data : *reinterpret_cast<int32_t*>(data);
|
1401
|
-
AppendToBuffer(",0x%x", imm);
|
1402
|
-
data += is_byte ? 1 : 4;
|
1403
|
-
}
|
1404
|
-
break;
|
1405
|
-
|
1406
|
-
case 0x80: {
|
1407
|
-
data++;
|
1408
|
-
AppendToBuffer("cmpb ");
|
1409
|
-
data += PrintRightOperand(data);
|
1410
|
-
int32_t imm = *data;
|
1411
|
-
AppendToBuffer(",0x%x", imm);
|
1412
|
-
data++;
|
1413
|
-
}
|
1414
|
-
break;
|
1415
|
-
|
1416
|
-
case 0x88: // 8bit, fall through
|
1417
|
-
case 0x89: // 32bit
|
1418
|
-
{
|
1419
|
-
bool is_byte = *data == 0x88;
|
1420
|
-
int mod, regop, rm;
|
1421
|
-
data++;
|
1422
|
-
get_modrm(*data, &mod, ®op, &rm);
|
1423
|
-
AppendToBuffer("mov%c ", is_byte ? 'b' : operand_size_code());
|
1424
|
-
data += PrintRightOperand(data);
|
1425
|
-
AppendToBuffer(",%s", NameOfCPURegister(regop));
|
1426
|
-
}
|
1427
|
-
break;
|
1428
|
-
|
1429
|
-
case 0x90:
|
1430
|
-
case 0x91:
|
1431
|
-
case 0x92:
|
1432
|
-
case 0x93:
|
1433
|
-
case 0x94:
|
1434
|
-
case 0x95:
|
1435
|
-
case 0x96:
|
1436
|
-
case 0x97: {
|
1437
|
-
int reg = (*data & 0x7) | (rex_b() ? 8 : 0);
|
1438
|
-
if (reg == 0) {
|
1439
|
-
AppendToBuffer("nop"); // Common name for xchg rax,rax.
|
1440
|
-
} else {
|
1441
|
-
AppendToBuffer("xchg%c rax, %s",
|
1442
|
-
operand_size_code(),
|
1443
|
-
NameOfCPURegister(reg));
|
1444
|
-
}
|
1445
|
-
data++;
|
1446
|
-
}
|
1447
|
-
break;
|
1448
|
-
|
1449
|
-
case 0xFE: {
|
1450
|
-
data++;
|
1451
|
-
int mod, regop, rm;
|
1452
|
-
get_modrm(*data, &mod, ®op, &rm);
|
1453
|
-
if (mod == 3 && regop == 1) {
|
1454
|
-
AppendToBuffer("decb %s", NameOfCPURegister(rm));
|
1455
|
-
} else {
|
1456
|
-
UnimplementedInstruction();
|
1457
|
-
}
|
1458
|
-
data++;
|
1459
|
-
}
|
1460
|
-
break;
|
1461
|
-
|
1462
|
-
case 0x68:
|
1463
|
-
AppendToBuffer("push 0x%x", *reinterpret_cast<int32_t*>(data + 1));
|
1464
|
-
data += 5;
|
1465
|
-
break;
|
1466
|
-
|
1467
|
-
case 0x6A:
|
1468
|
-
AppendToBuffer("push 0x%x", *reinterpret_cast<int8_t*>(data + 1));
|
1469
|
-
data += 2;
|
1470
|
-
break;
|
1471
|
-
|
1472
|
-
case 0xA1: // Fall through.
|
1473
|
-
case 0xA3:
|
1474
|
-
switch (operand_size()) {
|
1475
|
-
case DOUBLEWORD_SIZE: {
|
1476
|
-
const char* memory_location = NameOfAddress(
|
1477
|
-
reinterpret_cast<byte*>(
|
1478
|
-
*reinterpret_cast<int32_t*>(data + 1)));
|
1479
|
-
if (*data == 0xA1) { // Opcode 0xA1
|
1480
|
-
AppendToBuffer("movzxlq rax,(%s)", memory_location);
|
1481
|
-
} else { // Opcode 0xA3
|
1482
|
-
AppendToBuffer("movzxlq (%s),rax", memory_location);
|
1483
|
-
}
|
1484
|
-
data += 5;
|
1485
|
-
break;
|
1486
|
-
}
|
1487
|
-
case QUADWORD_SIZE: {
|
1488
|
-
// New x64 instruction mov rax,(imm_64).
|
1489
|
-
const char* memory_location = NameOfAddress(
|
1490
|
-
*reinterpret_cast<byte**>(data + 1));
|
1491
|
-
if (*data == 0xA1) { // Opcode 0xA1
|
1492
|
-
AppendToBuffer("movq rax,(%s)", memory_location);
|
1493
|
-
} else { // Opcode 0xA3
|
1494
|
-
AppendToBuffer("movq (%s),rax", memory_location);
|
1495
|
-
}
|
1496
|
-
data += 9;
|
1497
|
-
break;
|
1498
|
-
}
|
1499
|
-
default:
|
1500
|
-
UnimplementedInstruction();
|
1501
|
-
data += 2;
|
1502
|
-
}
|
1503
|
-
break;
|
1504
|
-
|
1505
|
-
case 0xA8:
|
1506
|
-
AppendToBuffer("test al,0x%x", *reinterpret_cast<uint8_t*>(data + 1));
|
1507
|
-
data += 2;
|
1508
|
-
break;
|
1509
|
-
|
1510
|
-
case 0xA9: {
|
1511
|
-
int64_t value = 0;
|
1512
|
-
switch (operand_size()) {
|
1513
|
-
case WORD_SIZE:
|
1514
|
-
value = *reinterpret_cast<uint16_t*>(data + 1);
|
1515
|
-
data += 3;
|
1516
|
-
break;
|
1517
|
-
case DOUBLEWORD_SIZE:
|
1518
|
-
value = *reinterpret_cast<uint32_t*>(data + 1);
|
1519
|
-
data += 5;
|
1520
|
-
break;
|
1521
|
-
case QUADWORD_SIZE:
|
1522
|
-
value = *reinterpret_cast<int32_t*>(data + 1);
|
1523
|
-
data += 5;
|
1524
|
-
break;
|
1525
|
-
default:
|
1526
|
-
UNREACHABLE();
|
1527
|
-
}
|
1528
|
-
AppendToBuffer("test%c rax,0x%"V8_PTR_PREFIX"x",
|
1529
|
-
operand_size_code(),
|
1530
|
-
value);
|
1531
|
-
break;
|
1532
|
-
}
|
1533
|
-
case 0xD1: // fall through
|
1534
|
-
case 0xD3: // fall through
|
1535
|
-
case 0xC1:
|
1536
|
-
data += ShiftInstruction(data);
|
1537
|
-
break;
|
1538
|
-
case 0xD0: // fall through
|
1539
|
-
case 0xD2: // fall through
|
1540
|
-
case 0xC0:
|
1541
|
-
byte_size_operand_ = true;
|
1542
|
-
data += ShiftInstruction(data);
|
1543
|
-
break;
|
1544
|
-
|
1545
|
-
case 0xD9: // fall through
|
1546
|
-
case 0xDA: // fall through
|
1547
|
-
case 0xDB: // fall through
|
1548
|
-
case 0xDC: // fall through
|
1549
|
-
case 0xDD: // fall through
|
1550
|
-
case 0xDE: // fall through
|
1551
|
-
case 0xDF:
|
1552
|
-
data += FPUInstruction(data);
|
1553
|
-
break;
|
1554
|
-
|
1555
|
-
case 0xEB:
|
1556
|
-
data += JumpShort(data);
|
1557
|
-
break;
|
1558
|
-
|
1559
|
-
case 0xF6:
|
1560
|
-
byte_size_operand_ = true; // fall through
|
1561
|
-
case 0xF7:
|
1562
|
-
data += F6F7Instruction(data);
|
1563
|
-
break;
|
1564
|
-
|
1565
|
-
default:
|
1566
|
-
UnimplementedInstruction();
|
1567
|
-
data += 1;
|
1568
|
-
}
|
1569
|
-
} // !processed
|
1570
|
-
|
1571
|
-
if (tmp_buffer_pos_ < sizeof tmp_buffer_) {
|
1572
|
-
tmp_buffer_[tmp_buffer_pos_] = '\0';
|
1573
|
-
}
|
1574
|
-
|
1575
|
-
int instr_len = static_cast<int>(data - instr);
|
1576
|
-
ASSERT(instr_len > 0); // Ensure progress.
|
1577
|
-
|
1578
|
-
int outp = 0;
|
1579
|
-
// Instruction bytes.
|
1580
|
-
for (byte* bp = instr; bp < data; bp++) {
|
1581
|
-
outp += v8::internal::OS::SNPrintF(out_buffer + outp, "%02x", *bp);
|
1582
|
-
}
|
1583
|
-
for (int i = 6 - instr_len; i >= 0; i--) {
|
1584
|
-
outp += v8::internal::OS::SNPrintF(out_buffer + outp, " ");
|
1585
|
-
}
|
1586
|
-
|
1587
|
-
outp += v8::internal::OS::SNPrintF(out_buffer + outp, " %s",
|
1588
|
-
tmp_buffer_.start());
|
1589
|
-
return instr_len;
|
1590
|
-
}
|
1591
|
-
|
1592
|
-
//------------------------------------------------------------------------------
|
1593
|
-
|
1594
|
-
|
1595
|
-
static const char* cpu_regs[16] = {
|
1596
|
-
"rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi",
|
1597
|
-
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"
|
1598
|
-
};
|
1599
|
-
|
1600
|
-
|
1601
|
-
static const char* byte_cpu_regs[16] = {
|
1602
|
-
"al", "cl", "dl", "bl", "spl", "bpl", "sil", "dil",
|
1603
|
-
"r8l", "r9l", "r10l", "r11l", "r12l", "r13l", "r14l", "r15l"
|
1604
|
-
};
|
1605
|
-
|
1606
|
-
|
1607
|
-
static const char* xmm_regs[16] = {
|
1608
|
-
"xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7",
|
1609
|
-
"xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15"
|
1610
|
-
};
|
1611
|
-
|
1612
|
-
|
1613
|
-
const char* NameConverter::NameOfAddress(byte* addr) const {
|
1614
|
-
static v8::internal::EmbeddedVector<char, 32> tmp_buffer;
|
1615
|
-
v8::internal::OS::SNPrintF(tmp_buffer, "%p", addr);
|
1616
|
-
return tmp_buffer.start();
|
1617
|
-
}
|
1618
|
-
|
1619
|
-
|
1620
|
-
const char* NameConverter::NameOfConstant(byte* addr) const {
|
1621
|
-
return NameOfAddress(addr);
|
1622
|
-
}
|
1623
|
-
|
1624
|
-
|
1625
|
-
const char* NameConverter::NameOfCPURegister(int reg) const {
|
1626
|
-
if (0 <= reg && reg < 16)
|
1627
|
-
return cpu_regs[reg];
|
1628
|
-
return "noreg";
|
1629
|
-
}
|
1630
|
-
|
1631
|
-
|
1632
|
-
const char* NameConverter::NameOfByteCPURegister(int reg) const {
|
1633
|
-
if (0 <= reg && reg < 16)
|
1634
|
-
return byte_cpu_regs[reg];
|
1635
|
-
return "noreg";
|
1636
|
-
}
|
1637
|
-
|
1638
|
-
|
1639
|
-
const char* NameConverter::NameOfXMMRegister(int reg) const {
|
1640
|
-
if (0 <= reg && reg < 16)
|
1641
|
-
return xmm_regs[reg];
|
1642
|
-
return "noxmmreg";
|
1643
|
-
}
|
1644
|
-
|
1645
|
-
|
1646
|
-
const char* NameConverter::NameInCode(byte* addr) const {
|
1647
|
-
// X64 does not embed debug strings at the moment.
|
1648
|
-
UNREACHABLE();
|
1649
|
-
return "";
|
1650
|
-
}
|
1651
|
-
|
1652
|
-
//------------------------------------------------------------------------------
|
1653
|
-
|
1654
|
-
Disassembler::Disassembler(const NameConverter& converter)
|
1655
|
-
: converter_(converter) { }
|
1656
|
-
|
1657
|
-
Disassembler::~Disassembler() { }
|
1658
|
-
|
1659
|
-
|
1660
|
-
int Disassembler::InstructionDecode(v8::internal::Vector<char> buffer,
|
1661
|
-
byte* instruction) {
|
1662
|
-
DisassemblerX64 d(converter_, CONTINUE_ON_UNIMPLEMENTED_OPCODE);
|
1663
|
-
return d.InstructionDecode(buffer, instruction);
|
1664
|
-
}
|
1665
|
-
|
1666
|
-
|
1667
|
-
// The X64 assembler does not use constant pools.
|
1668
|
-
int Disassembler::ConstantPoolSizeAt(byte* instruction) {
|
1669
|
-
return -1;
|
1670
|
-
}
|
1671
|
-
|
1672
|
-
|
1673
|
-
void Disassembler::Disassemble(FILE* f, byte* begin, byte* end) {
|
1674
|
-
NameConverter converter;
|
1675
|
-
Disassembler d(converter);
|
1676
|
-
for (byte* pc = begin; pc < end;) {
|
1677
|
-
v8::internal::EmbeddedVector<char, 128> buffer;
|
1678
|
-
buffer[0] = '\0';
|
1679
|
-
byte* prev_pc = pc;
|
1680
|
-
pc += d.InstructionDecode(buffer, pc);
|
1681
|
-
fprintf(f, "%p", prev_pc);
|
1682
|
-
fprintf(f, " ");
|
1683
|
-
|
1684
|
-
for (byte* bp = prev_pc; bp < pc; bp++) {
|
1685
|
-
fprintf(f, "%02x", *bp);
|
1686
|
-
}
|
1687
|
-
for (int i = 6 - static_cast<int>(pc - prev_pc); i >= 0; i--) {
|
1688
|
-
fprintf(f, " ");
|
1689
|
-
}
|
1690
|
-
fprintf(f, " %s\n", buffer.start());
|
1691
|
-
}
|
1692
|
-
}
|
1693
|
-
|
1694
|
-
} // namespace disasm
|
1695
|
-
|
1696
|
-
#endif // V8_TARGET_ARCH_X64
|