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
@@ -0,0 +1,3162 @@
|
|
1
|
+
// Copyright 2011 the V8 project authors. All rights reserved.
|
2
|
+
// Redistribution and use in source and binary forms, with or without
|
3
|
+
// modification, are permitted provided that the following conditions are
|
4
|
+
// met:
|
5
|
+
//
|
6
|
+
// * Redistributions of source code must retain the above copyright
|
7
|
+
// notice, this list of conditions and the following disclaimer.
|
8
|
+
// * Redistributions in binary form must reproduce the above
|
9
|
+
// copyright notice, this list of conditions and the following
|
10
|
+
// disclaimer in the documentation and/or other materials provided
|
11
|
+
// with the distribution.
|
12
|
+
// * Neither the name of Google Inc. nor the names of its
|
13
|
+
// contributors may be used to endorse or promote products derived
|
14
|
+
// from this software without specific prior written permission.
|
15
|
+
//
|
16
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
17
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
18
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
19
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
20
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
21
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
22
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
23
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
24
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
25
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
26
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27
|
+
|
28
|
+
#include "v8.h"
|
29
|
+
|
30
|
+
#if defined(V8_TARGET_ARCH_X64)
|
31
|
+
|
32
|
+
#include "macro-assembler.h"
|
33
|
+
#include "serialize.h"
|
34
|
+
|
35
|
+
namespace v8 {
|
36
|
+
namespace internal {
|
37
|
+
|
38
|
+
// -----------------------------------------------------------------------------
|
39
|
+
// Implementation of CpuFeatures
|
40
|
+
|
41
|
+
// The required user mode extensions in X64 are (from AMD64 ABI Table A.1):
|
42
|
+
// fpu, tsc, cx8, cmov, mmx, sse, sse2, fxsr, syscall
|
43
|
+
uint64_t CpuFeatures::supported_ = kDefaultCpuFeatures;
|
44
|
+
uint64_t CpuFeatures::enabled_ = 0;
|
45
|
+
uint64_t CpuFeatures::found_by_runtime_probing_ = 0;
|
46
|
+
|
47
|
+
void CpuFeatures::Probe(bool portable) {
|
48
|
+
ASSERT(Heap::HasBeenSetup());
|
49
|
+
supported_ = kDefaultCpuFeatures;
|
50
|
+
if (portable && Serializer::enabled()) {
|
51
|
+
supported_ |= OS::CpuFeaturesImpliedByPlatform();
|
52
|
+
return; // No features if we might serialize.
|
53
|
+
}
|
54
|
+
|
55
|
+
Assembler assm(NULL, 0);
|
56
|
+
Label cpuid, done;
|
57
|
+
#define __ assm.
|
58
|
+
// Save old rsp, since we are going to modify the stack.
|
59
|
+
__ push(rbp);
|
60
|
+
__ pushfq();
|
61
|
+
__ push(rcx);
|
62
|
+
__ push(rbx);
|
63
|
+
__ movq(rbp, rsp);
|
64
|
+
|
65
|
+
// If we can modify bit 21 of the EFLAGS register, then CPUID is supported.
|
66
|
+
__ pushfq();
|
67
|
+
__ pop(rax);
|
68
|
+
__ movq(rdx, rax);
|
69
|
+
__ xor_(rax, Immediate(0x200000)); // Flip bit 21.
|
70
|
+
__ push(rax);
|
71
|
+
__ popfq();
|
72
|
+
__ pushfq();
|
73
|
+
__ pop(rax);
|
74
|
+
__ xor_(rax, rdx); // Different if CPUID is supported.
|
75
|
+
__ j(not_zero, &cpuid);
|
76
|
+
|
77
|
+
// CPUID not supported. Clear the supported features in rax.
|
78
|
+
__ xor_(rax, rax);
|
79
|
+
__ jmp(&done);
|
80
|
+
|
81
|
+
// Invoke CPUID with 1 in eax to get feature information in
|
82
|
+
// ecx:edx. Temporarily enable CPUID support because we know it's
|
83
|
+
// safe here.
|
84
|
+
__ bind(&cpuid);
|
85
|
+
__ movq(rax, Immediate(1));
|
86
|
+
supported_ = kDefaultCpuFeatures | (1 << CPUID);
|
87
|
+
{ Scope fscope(CPUID);
|
88
|
+
__ cpuid();
|
89
|
+
// Move the result from ecx:edx to rdi.
|
90
|
+
__ movl(rdi, rdx); // Zero-extended to 64 bits.
|
91
|
+
__ shl(rcx, Immediate(32));
|
92
|
+
__ or_(rdi, rcx);
|
93
|
+
|
94
|
+
// Get the sahf supported flag, from CPUID(0x80000001)
|
95
|
+
__ movq(rax, 0x80000001, RelocInfo::NONE);
|
96
|
+
__ cpuid();
|
97
|
+
}
|
98
|
+
supported_ = kDefaultCpuFeatures;
|
99
|
+
|
100
|
+
// Put the CPU flags in rax.
|
101
|
+
// rax = (rcx & 1) | (rdi & ~1) | (1 << CPUID).
|
102
|
+
__ movl(rax, Immediate(1));
|
103
|
+
__ and_(rcx, rax); // Bit 0 is set if SAHF instruction supported.
|
104
|
+
__ not_(rax);
|
105
|
+
__ and_(rax, rdi);
|
106
|
+
__ or_(rax, rcx);
|
107
|
+
__ or_(rax, Immediate(1 << CPUID));
|
108
|
+
|
109
|
+
// Done.
|
110
|
+
__ bind(&done);
|
111
|
+
__ movq(rsp, rbp);
|
112
|
+
__ pop(rbx);
|
113
|
+
__ pop(rcx);
|
114
|
+
__ popfq();
|
115
|
+
__ pop(rbp);
|
116
|
+
__ ret(0);
|
117
|
+
#undef __
|
118
|
+
|
119
|
+
CodeDesc desc;
|
120
|
+
assm.GetCode(&desc);
|
121
|
+
MaybeObject* maybe_code = Heap::CreateCode(desc,
|
122
|
+
Code::ComputeFlags(Code::STUB),
|
123
|
+
Handle<Object>());
|
124
|
+
Object* code;
|
125
|
+
if (!maybe_code->ToObject(&code)) return;
|
126
|
+
if (!code->IsCode()) return;
|
127
|
+
PROFILE(CodeCreateEvent(Logger::BUILTIN_TAG,
|
128
|
+
Code::cast(code), "CpuFeatures::Probe"));
|
129
|
+
typedef uint64_t (*F0)();
|
130
|
+
F0 probe = FUNCTION_CAST<F0>(Code::cast(code)->entry());
|
131
|
+
supported_ = probe();
|
132
|
+
found_by_runtime_probing_ = supported_;
|
133
|
+
found_by_runtime_probing_ &= ~kDefaultCpuFeatures;
|
134
|
+
uint64_t os_guarantees = OS::CpuFeaturesImpliedByPlatform();
|
135
|
+
supported_ |= os_guarantees;
|
136
|
+
found_by_runtime_probing_ &= portable ? ~os_guarantees : 0;
|
137
|
+
// SSE2 and CMOV must be available on an X64 CPU.
|
138
|
+
ASSERT(IsSupported(CPUID));
|
139
|
+
ASSERT(IsSupported(SSE2));
|
140
|
+
ASSERT(IsSupported(CMOV));
|
141
|
+
}
|
142
|
+
|
143
|
+
|
144
|
+
// -----------------------------------------------------------------------------
|
145
|
+
// Implementation of RelocInfo
|
146
|
+
|
147
|
+
// Patch the code at the current PC with a call to the target address.
|
148
|
+
// Additional guard int3 instructions can be added if required.
|
149
|
+
void RelocInfo::PatchCodeWithCall(Address target, int guard_bytes) {
|
150
|
+
// Load register with immediate 64 and call through a register instructions
|
151
|
+
// takes up 13 bytes and int3 takes up one byte.
|
152
|
+
static const int kCallCodeSize = 13;
|
153
|
+
int code_size = kCallCodeSize + guard_bytes;
|
154
|
+
|
155
|
+
// Create a code patcher.
|
156
|
+
CodePatcher patcher(pc_, code_size);
|
157
|
+
|
158
|
+
// Add a label for checking the size of the code used for returning.
|
159
|
+
#ifdef DEBUG
|
160
|
+
Label check_codesize;
|
161
|
+
patcher.masm()->bind(&check_codesize);
|
162
|
+
#endif
|
163
|
+
|
164
|
+
// Patch the code.
|
165
|
+
patcher.masm()->movq(r10, target, RelocInfo::NONE);
|
166
|
+
patcher.masm()->call(r10);
|
167
|
+
|
168
|
+
// Check that the size of the code generated is as expected.
|
169
|
+
ASSERT_EQ(kCallCodeSize,
|
170
|
+
patcher.masm()->SizeOfCodeGeneratedSince(&check_codesize));
|
171
|
+
|
172
|
+
// Add the requested number of int3 instructions after the call.
|
173
|
+
for (int i = 0; i < guard_bytes; i++) {
|
174
|
+
patcher.masm()->int3();
|
175
|
+
}
|
176
|
+
}
|
177
|
+
|
178
|
+
|
179
|
+
void RelocInfo::PatchCode(byte* instructions, int instruction_count) {
|
180
|
+
// Patch the code at the current address with the supplied instructions.
|
181
|
+
for (int i = 0; i < instruction_count; i++) {
|
182
|
+
*(pc_ + i) = *(instructions + i);
|
183
|
+
}
|
184
|
+
|
185
|
+
// Indicate that code has changed.
|
186
|
+
CPU::FlushICache(pc_, instruction_count);
|
187
|
+
}
|
188
|
+
|
189
|
+
|
190
|
+
// -----------------------------------------------------------------------------
|
191
|
+
// Register constants.
|
192
|
+
|
193
|
+
const int Register::kRegisterCodeByAllocationIndex[kNumAllocatableRegisters] = {
|
194
|
+
// rax, rbx, rdx, rcx, rdi, r8, r9, r11, r14, r12
|
195
|
+
0, 3, 2, 1, 7, 8, 9, 11, 14, 12
|
196
|
+
};
|
197
|
+
|
198
|
+
const int Register::kAllocationIndexByRegisterCode[kNumRegisters] = {
|
199
|
+
0, 3, 2, 1, -1, -1, -1, 4, 5, 6, -1, 7, 9, -1, 8, -1
|
200
|
+
};
|
201
|
+
|
202
|
+
|
203
|
+
// -----------------------------------------------------------------------------
|
204
|
+
// Implementation of Operand
|
205
|
+
|
206
|
+
Operand::Operand(Register base, int32_t disp) : rex_(0) {
|
207
|
+
len_ = 1;
|
208
|
+
if (base.is(rsp) || base.is(r12)) {
|
209
|
+
// SIB byte is needed to encode (rsp + offset) or (r12 + offset).
|
210
|
+
set_sib(times_1, rsp, base);
|
211
|
+
}
|
212
|
+
|
213
|
+
if (disp == 0 && !base.is(rbp) && !base.is(r13)) {
|
214
|
+
set_modrm(0, base);
|
215
|
+
} else if (is_int8(disp)) {
|
216
|
+
set_modrm(1, base);
|
217
|
+
set_disp8(disp);
|
218
|
+
} else {
|
219
|
+
set_modrm(2, base);
|
220
|
+
set_disp32(disp);
|
221
|
+
}
|
222
|
+
}
|
223
|
+
|
224
|
+
|
225
|
+
Operand::Operand(Register base,
|
226
|
+
Register index,
|
227
|
+
ScaleFactor scale,
|
228
|
+
int32_t disp) : rex_(0) {
|
229
|
+
ASSERT(!index.is(rsp));
|
230
|
+
len_ = 1;
|
231
|
+
set_sib(scale, index, base);
|
232
|
+
if (disp == 0 && !base.is(rbp) && !base.is(r13)) {
|
233
|
+
// This call to set_modrm doesn't overwrite the REX.B (or REX.X) bits
|
234
|
+
// possibly set by set_sib.
|
235
|
+
set_modrm(0, rsp);
|
236
|
+
} else if (is_int8(disp)) {
|
237
|
+
set_modrm(1, rsp);
|
238
|
+
set_disp8(disp);
|
239
|
+
} else {
|
240
|
+
set_modrm(2, rsp);
|
241
|
+
set_disp32(disp);
|
242
|
+
}
|
243
|
+
}
|
244
|
+
|
245
|
+
|
246
|
+
Operand::Operand(Register index,
|
247
|
+
ScaleFactor scale,
|
248
|
+
int32_t disp) : rex_(0) {
|
249
|
+
ASSERT(!index.is(rsp));
|
250
|
+
len_ = 1;
|
251
|
+
set_modrm(0, rsp);
|
252
|
+
set_sib(scale, index, rbp);
|
253
|
+
set_disp32(disp);
|
254
|
+
}
|
255
|
+
|
256
|
+
|
257
|
+
Operand::Operand(const Operand& operand, int32_t offset) {
|
258
|
+
ASSERT(operand.len_ >= 1);
|
259
|
+
// Operand encodes REX ModR/M [SIB] [Disp].
|
260
|
+
byte modrm = operand.buf_[0];
|
261
|
+
ASSERT(modrm < 0xC0); // Disallow mode 3 (register target).
|
262
|
+
bool has_sib = ((modrm & 0x07) == 0x04);
|
263
|
+
byte mode = modrm & 0xC0;
|
264
|
+
int disp_offset = has_sib ? 2 : 1;
|
265
|
+
int base_reg = (has_sib ? operand.buf_[1] : modrm) & 0x07;
|
266
|
+
// Mode 0 with rbp/r13 as ModR/M or SIB base register always has a 32-bit
|
267
|
+
// displacement.
|
268
|
+
bool is_baseless = (mode == 0) && (base_reg == 0x05); // No base or RIP base.
|
269
|
+
int32_t disp_value = 0;
|
270
|
+
if (mode == 0x80 || is_baseless) {
|
271
|
+
// Mode 2 or mode 0 with rbp/r13 as base: Word displacement.
|
272
|
+
disp_value = *BitCast<const int32_t*>(&operand.buf_[disp_offset]);
|
273
|
+
} else if (mode == 0x40) {
|
274
|
+
// Mode 1: Byte displacement.
|
275
|
+
disp_value = static_cast<signed char>(operand.buf_[disp_offset]);
|
276
|
+
}
|
277
|
+
|
278
|
+
// Write new operand with same registers, but with modified displacement.
|
279
|
+
ASSERT(offset >= 0 ? disp_value + offset > disp_value
|
280
|
+
: disp_value + offset < disp_value); // No overflow.
|
281
|
+
disp_value += offset;
|
282
|
+
rex_ = operand.rex_;
|
283
|
+
if (!is_int8(disp_value) || is_baseless) {
|
284
|
+
// Need 32 bits of displacement, mode 2 or mode 1 with register rbp/r13.
|
285
|
+
buf_[0] = (modrm & 0x3f) | (is_baseless ? 0x00 : 0x80);
|
286
|
+
len_ = disp_offset + 4;
|
287
|
+
Memory::int32_at(&buf_[disp_offset]) = disp_value;
|
288
|
+
} else if (disp_value != 0 || (base_reg == 0x05)) {
|
289
|
+
// Need 8 bits of displacement.
|
290
|
+
buf_[0] = (modrm & 0x3f) | 0x40; // Mode 1.
|
291
|
+
len_ = disp_offset + 1;
|
292
|
+
buf_[disp_offset] = static_cast<byte>(disp_value);
|
293
|
+
} else {
|
294
|
+
// Need no displacement.
|
295
|
+
buf_[0] = (modrm & 0x3f); // Mode 0.
|
296
|
+
len_ = disp_offset;
|
297
|
+
}
|
298
|
+
if (has_sib) {
|
299
|
+
buf_[1] = operand.buf_[1];
|
300
|
+
}
|
301
|
+
}
|
302
|
+
|
303
|
+
|
304
|
+
bool Operand::AddressUsesRegister(Register reg) const {
|
305
|
+
int code = reg.code();
|
306
|
+
ASSERT((buf_[0] & 0xC0) != 0xC0); // Always a memory operand.
|
307
|
+
// Start with only low three bits of base register. Initial decoding doesn't
|
308
|
+
// distinguish on the REX.B bit.
|
309
|
+
int base_code = buf_[0] & 0x07;
|
310
|
+
if (base_code == rsp.code()) {
|
311
|
+
// SIB byte present in buf_[1].
|
312
|
+
// Check the index register from the SIB byte + REX.X prefix.
|
313
|
+
int index_code = ((buf_[1] >> 3) & 0x07) | ((rex_ & 0x02) << 2);
|
314
|
+
// Index code (including REX.X) of 0x04 (rsp) means no index register.
|
315
|
+
if (index_code != rsp.code() && index_code == code) return true;
|
316
|
+
// Add REX.B to get the full base register code.
|
317
|
+
base_code = (buf_[1] & 0x07) | ((rex_ & 0x01) << 3);
|
318
|
+
// A base register of 0x05 (rbp) with mod = 0 means no base register.
|
319
|
+
if (base_code == rbp.code() && ((buf_[0] & 0xC0) == 0)) return false;
|
320
|
+
return code == base_code;
|
321
|
+
} else {
|
322
|
+
// A base register with low bits of 0x05 (rbp or r13) and mod = 0 means
|
323
|
+
// no base register.
|
324
|
+
if (base_code == rbp.code() && ((buf_[0] & 0xC0) == 0)) return false;
|
325
|
+
base_code |= ((rex_ & 0x01) << 3);
|
326
|
+
return code == base_code;
|
327
|
+
}
|
328
|
+
}
|
329
|
+
|
330
|
+
|
331
|
+
// -----------------------------------------------------------------------------
|
332
|
+
// Implementation of Assembler.
|
333
|
+
|
334
|
+
#ifdef GENERATED_CODE_COVERAGE
|
335
|
+
static void InitCoverageLog();
|
336
|
+
#endif
|
337
|
+
|
338
|
+
byte* Assembler::spare_buffer_ = NULL;
|
339
|
+
|
340
|
+
Assembler::Assembler(void* buffer, int buffer_size)
|
341
|
+
: code_targets_(100), positions_recorder_(this) {
|
342
|
+
if (buffer == NULL) {
|
343
|
+
// Do our own buffer management.
|
344
|
+
if (buffer_size <= kMinimalBufferSize) {
|
345
|
+
buffer_size = kMinimalBufferSize;
|
346
|
+
|
347
|
+
if (spare_buffer_ != NULL) {
|
348
|
+
buffer = spare_buffer_;
|
349
|
+
spare_buffer_ = NULL;
|
350
|
+
}
|
351
|
+
}
|
352
|
+
if (buffer == NULL) {
|
353
|
+
buffer_ = NewArray<byte>(buffer_size);
|
354
|
+
} else {
|
355
|
+
buffer_ = static_cast<byte*>(buffer);
|
356
|
+
}
|
357
|
+
buffer_size_ = buffer_size;
|
358
|
+
own_buffer_ = true;
|
359
|
+
} else {
|
360
|
+
// Use externally provided buffer instead.
|
361
|
+
ASSERT(buffer_size > 0);
|
362
|
+
buffer_ = static_cast<byte*>(buffer);
|
363
|
+
buffer_size_ = buffer_size;
|
364
|
+
own_buffer_ = false;
|
365
|
+
}
|
366
|
+
|
367
|
+
// Clear the buffer in debug mode unless it was provided by the
|
368
|
+
// caller in which case we can't be sure it's okay to overwrite
|
369
|
+
// existing code in it.
|
370
|
+
#ifdef DEBUG
|
371
|
+
if (own_buffer_) {
|
372
|
+
memset(buffer_, 0xCC, buffer_size); // int3
|
373
|
+
}
|
374
|
+
#endif
|
375
|
+
|
376
|
+
// Setup buffer pointers.
|
377
|
+
ASSERT(buffer_ != NULL);
|
378
|
+
pc_ = buffer_;
|
379
|
+
reloc_info_writer.Reposition(buffer_ + buffer_size, pc_);
|
380
|
+
|
381
|
+
last_pc_ = NULL;
|
382
|
+
|
383
|
+
#ifdef GENERATED_CODE_COVERAGE
|
384
|
+
InitCoverageLog();
|
385
|
+
#endif
|
386
|
+
}
|
387
|
+
|
388
|
+
|
389
|
+
Assembler::~Assembler() {
|
390
|
+
if (own_buffer_) {
|
391
|
+
if (spare_buffer_ == NULL && buffer_size_ == kMinimalBufferSize) {
|
392
|
+
spare_buffer_ = buffer_;
|
393
|
+
} else {
|
394
|
+
DeleteArray(buffer_);
|
395
|
+
}
|
396
|
+
}
|
397
|
+
}
|
398
|
+
|
399
|
+
|
400
|
+
void Assembler::GetCode(CodeDesc* desc) {
|
401
|
+
// Finalize code (at this point overflow() may be true, but the gap ensures
|
402
|
+
// that we are still not overlapping instructions and relocation info).
|
403
|
+
ASSERT(pc_ <= reloc_info_writer.pos()); // No overlap.
|
404
|
+
// Setup code descriptor.
|
405
|
+
desc->buffer = buffer_;
|
406
|
+
desc->buffer_size = buffer_size_;
|
407
|
+
desc->instr_size = pc_offset();
|
408
|
+
ASSERT(desc->instr_size > 0); // Zero-size code objects upset the system.
|
409
|
+
desc->reloc_size =
|
410
|
+
static_cast<int>((buffer_ + buffer_size_) - reloc_info_writer.pos());
|
411
|
+
desc->origin = this;
|
412
|
+
|
413
|
+
Counters::reloc_info_size.Increment(desc->reloc_size);
|
414
|
+
}
|
415
|
+
|
416
|
+
|
417
|
+
void Assembler::Align(int m) {
|
418
|
+
ASSERT(IsPowerOf2(m));
|
419
|
+
int delta = (m - (pc_offset() & (m - 1))) & (m - 1);
|
420
|
+
while (delta >= 9) {
|
421
|
+
nop(9);
|
422
|
+
delta -= 9;
|
423
|
+
}
|
424
|
+
if (delta > 0) {
|
425
|
+
nop(delta);
|
426
|
+
}
|
427
|
+
}
|
428
|
+
|
429
|
+
|
430
|
+
void Assembler::CodeTargetAlign() {
|
431
|
+
Align(16); // Preferred alignment of jump targets on x64.
|
432
|
+
}
|
433
|
+
|
434
|
+
|
435
|
+
void Assembler::bind_to(Label* L, int pos) {
|
436
|
+
ASSERT(!L->is_bound()); // Label may only be bound once.
|
437
|
+
last_pc_ = NULL;
|
438
|
+
ASSERT(0 <= pos && pos <= pc_offset()); // Position must be valid.
|
439
|
+
if (L->is_linked()) {
|
440
|
+
int current = L->pos();
|
441
|
+
int next = long_at(current);
|
442
|
+
while (next != current) {
|
443
|
+
// Relative address, relative to point after address.
|
444
|
+
int imm32 = pos - (current + sizeof(int32_t));
|
445
|
+
long_at_put(current, imm32);
|
446
|
+
current = next;
|
447
|
+
next = long_at(next);
|
448
|
+
}
|
449
|
+
// Fix up last fixup on linked list.
|
450
|
+
int last_imm32 = pos - (current + sizeof(int32_t));
|
451
|
+
long_at_put(current, last_imm32);
|
452
|
+
}
|
453
|
+
L->bind_to(pos);
|
454
|
+
}
|
455
|
+
|
456
|
+
|
457
|
+
void Assembler::bind(Label* L) {
|
458
|
+
bind_to(L, pc_offset());
|
459
|
+
}
|
460
|
+
|
461
|
+
|
462
|
+
void Assembler::bind(NearLabel* L) {
|
463
|
+
ASSERT(!L->is_bound());
|
464
|
+
last_pc_ = NULL;
|
465
|
+
while (L->unresolved_branches_ > 0) {
|
466
|
+
int branch_pos = L->unresolved_positions_[L->unresolved_branches_ - 1];
|
467
|
+
int disp = pc_offset() - branch_pos;
|
468
|
+
ASSERT(is_int8(disp));
|
469
|
+
set_byte_at(branch_pos - sizeof(int8_t), disp);
|
470
|
+
L->unresolved_branches_--;
|
471
|
+
}
|
472
|
+
L->bind_to(pc_offset());
|
473
|
+
}
|
474
|
+
|
475
|
+
|
476
|
+
void Assembler::GrowBuffer() {
|
477
|
+
ASSERT(buffer_overflow());
|
478
|
+
if (!own_buffer_) FATAL("external code buffer is too small");
|
479
|
+
|
480
|
+
// Compute new buffer size.
|
481
|
+
CodeDesc desc; // the new buffer
|
482
|
+
if (buffer_size_ < 4*KB) {
|
483
|
+
desc.buffer_size = 4*KB;
|
484
|
+
} else {
|
485
|
+
desc.buffer_size = 2*buffer_size_;
|
486
|
+
}
|
487
|
+
// Some internal data structures overflow for very large buffers,
|
488
|
+
// they must ensure that kMaximalBufferSize is not too large.
|
489
|
+
if ((desc.buffer_size > kMaximalBufferSize) ||
|
490
|
+
(desc.buffer_size > Heap::MaxOldGenerationSize())) {
|
491
|
+
V8::FatalProcessOutOfMemory("Assembler::GrowBuffer");
|
492
|
+
}
|
493
|
+
|
494
|
+
// Setup new buffer.
|
495
|
+
desc.buffer = NewArray<byte>(desc.buffer_size);
|
496
|
+
desc.instr_size = pc_offset();
|
497
|
+
desc.reloc_size =
|
498
|
+
static_cast<int>((buffer_ + buffer_size_) - (reloc_info_writer.pos()));
|
499
|
+
|
500
|
+
// Clear the buffer in debug mode. Use 'int3' instructions to make
|
501
|
+
// sure to get into problems if we ever run uninitialized code.
|
502
|
+
#ifdef DEBUG
|
503
|
+
memset(desc.buffer, 0xCC, desc.buffer_size);
|
504
|
+
#endif
|
505
|
+
|
506
|
+
// Copy the data.
|
507
|
+
intptr_t pc_delta = desc.buffer - buffer_;
|
508
|
+
intptr_t rc_delta = (desc.buffer + desc.buffer_size) -
|
509
|
+
(buffer_ + buffer_size_);
|
510
|
+
memmove(desc.buffer, buffer_, desc.instr_size);
|
511
|
+
memmove(rc_delta + reloc_info_writer.pos(),
|
512
|
+
reloc_info_writer.pos(), desc.reloc_size);
|
513
|
+
|
514
|
+
// Switch buffers.
|
515
|
+
if (spare_buffer_ == NULL && buffer_size_ == kMinimalBufferSize) {
|
516
|
+
spare_buffer_ = buffer_;
|
517
|
+
} else {
|
518
|
+
DeleteArray(buffer_);
|
519
|
+
}
|
520
|
+
buffer_ = desc.buffer;
|
521
|
+
buffer_size_ = desc.buffer_size;
|
522
|
+
pc_ += pc_delta;
|
523
|
+
if (last_pc_ != NULL) {
|
524
|
+
last_pc_ += pc_delta;
|
525
|
+
}
|
526
|
+
reloc_info_writer.Reposition(reloc_info_writer.pos() + rc_delta,
|
527
|
+
reloc_info_writer.last_pc() + pc_delta);
|
528
|
+
|
529
|
+
// Relocate runtime entries.
|
530
|
+
for (RelocIterator it(desc); !it.done(); it.next()) {
|
531
|
+
RelocInfo::Mode rmode = it.rinfo()->rmode();
|
532
|
+
if (rmode == RelocInfo::INTERNAL_REFERENCE) {
|
533
|
+
intptr_t* p = reinterpret_cast<intptr_t*>(it.rinfo()->pc());
|
534
|
+
if (*p != 0) { // 0 means uninitialized.
|
535
|
+
*p += pc_delta;
|
536
|
+
}
|
537
|
+
}
|
538
|
+
}
|
539
|
+
|
540
|
+
ASSERT(!buffer_overflow());
|
541
|
+
}
|
542
|
+
|
543
|
+
|
544
|
+
void Assembler::emit_operand(int code, const Operand& adr) {
|
545
|
+
ASSERT(is_uint3(code));
|
546
|
+
const unsigned length = adr.len_;
|
547
|
+
ASSERT(length > 0);
|
548
|
+
|
549
|
+
// Emit updated ModR/M byte containing the given register.
|
550
|
+
ASSERT((adr.buf_[0] & 0x38) == 0);
|
551
|
+
pc_[0] = adr.buf_[0] | code << 3;
|
552
|
+
|
553
|
+
// Emit the rest of the encoded operand.
|
554
|
+
for (unsigned i = 1; i < length; i++) pc_[i] = adr.buf_[i];
|
555
|
+
pc_ += length;
|
556
|
+
}
|
557
|
+
|
558
|
+
|
559
|
+
// Assembler Instruction implementations.
|
560
|
+
|
561
|
+
void Assembler::arithmetic_op(byte opcode, Register reg, const Operand& op) {
|
562
|
+
EnsureSpace ensure_space(this);
|
563
|
+
last_pc_ = pc_;
|
564
|
+
emit_rex_64(reg, op);
|
565
|
+
emit(opcode);
|
566
|
+
emit_operand(reg, op);
|
567
|
+
}
|
568
|
+
|
569
|
+
|
570
|
+
void Assembler::arithmetic_op(byte opcode, Register reg, Register rm_reg) {
|
571
|
+
EnsureSpace ensure_space(this);
|
572
|
+
last_pc_ = pc_;
|
573
|
+
ASSERT((opcode & 0xC6) == 2);
|
574
|
+
if (rm_reg.low_bits() == 4) { // Forces SIB byte.
|
575
|
+
// Swap reg and rm_reg and change opcode operand order.
|
576
|
+
emit_rex_64(rm_reg, reg);
|
577
|
+
emit(opcode ^ 0x02);
|
578
|
+
emit_modrm(rm_reg, reg);
|
579
|
+
} else {
|
580
|
+
emit_rex_64(reg, rm_reg);
|
581
|
+
emit(opcode);
|
582
|
+
emit_modrm(reg, rm_reg);
|
583
|
+
}
|
584
|
+
}
|
585
|
+
|
586
|
+
|
587
|
+
void Assembler::arithmetic_op_16(byte opcode, Register reg, Register rm_reg) {
|
588
|
+
EnsureSpace ensure_space(this);
|
589
|
+
last_pc_ = pc_;
|
590
|
+
ASSERT((opcode & 0xC6) == 2);
|
591
|
+
if (rm_reg.low_bits() == 4) { // Forces SIB byte.
|
592
|
+
// Swap reg and rm_reg and change opcode operand order.
|
593
|
+
emit(0x66);
|
594
|
+
emit_optional_rex_32(rm_reg, reg);
|
595
|
+
emit(opcode ^ 0x02);
|
596
|
+
emit_modrm(rm_reg, reg);
|
597
|
+
} else {
|
598
|
+
emit(0x66);
|
599
|
+
emit_optional_rex_32(reg, rm_reg);
|
600
|
+
emit(opcode);
|
601
|
+
emit_modrm(reg, rm_reg);
|
602
|
+
}
|
603
|
+
}
|
604
|
+
|
605
|
+
|
606
|
+
void Assembler::arithmetic_op_16(byte opcode,
|
607
|
+
Register reg,
|
608
|
+
const Operand& rm_reg) {
|
609
|
+
EnsureSpace ensure_space(this);
|
610
|
+
last_pc_ = pc_;
|
611
|
+
emit(0x66);
|
612
|
+
emit_optional_rex_32(reg, rm_reg);
|
613
|
+
emit(opcode);
|
614
|
+
emit_operand(reg, rm_reg);
|
615
|
+
}
|
616
|
+
|
617
|
+
|
618
|
+
void Assembler::arithmetic_op_32(byte opcode, Register reg, Register rm_reg) {
|
619
|
+
EnsureSpace ensure_space(this);
|
620
|
+
last_pc_ = pc_;
|
621
|
+
ASSERT((opcode & 0xC6) == 2);
|
622
|
+
if (rm_reg.low_bits() == 4) { // Forces SIB byte.
|
623
|
+
// Swap reg and rm_reg and change opcode operand order.
|
624
|
+
emit_optional_rex_32(rm_reg, reg);
|
625
|
+
emit(opcode ^ 0x02); // E.g. 0x03 -> 0x01 for ADD.
|
626
|
+
emit_modrm(rm_reg, reg);
|
627
|
+
} else {
|
628
|
+
emit_optional_rex_32(reg, rm_reg);
|
629
|
+
emit(opcode);
|
630
|
+
emit_modrm(reg, rm_reg);
|
631
|
+
}
|
632
|
+
}
|
633
|
+
|
634
|
+
|
635
|
+
void Assembler::arithmetic_op_32(byte opcode,
|
636
|
+
Register reg,
|
637
|
+
const Operand& rm_reg) {
|
638
|
+
EnsureSpace ensure_space(this);
|
639
|
+
last_pc_ = pc_;
|
640
|
+
emit_optional_rex_32(reg, rm_reg);
|
641
|
+
emit(opcode);
|
642
|
+
emit_operand(reg, rm_reg);
|
643
|
+
}
|
644
|
+
|
645
|
+
|
646
|
+
void Assembler::immediate_arithmetic_op(byte subcode,
|
647
|
+
Register dst,
|
648
|
+
Immediate src) {
|
649
|
+
EnsureSpace ensure_space(this);
|
650
|
+
last_pc_ = pc_;
|
651
|
+
emit_rex_64(dst);
|
652
|
+
if (is_int8(src.value_)) {
|
653
|
+
emit(0x83);
|
654
|
+
emit_modrm(subcode, dst);
|
655
|
+
emit(src.value_);
|
656
|
+
} else if (dst.is(rax)) {
|
657
|
+
emit(0x05 | (subcode << 3));
|
658
|
+
emitl(src.value_);
|
659
|
+
} else {
|
660
|
+
emit(0x81);
|
661
|
+
emit_modrm(subcode, dst);
|
662
|
+
emitl(src.value_);
|
663
|
+
}
|
664
|
+
}
|
665
|
+
|
666
|
+
void Assembler::immediate_arithmetic_op(byte subcode,
|
667
|
+
const Operand& dst,
|
668
|
+
Immediate src) {
|
669
|
+
EnsureSpace ensure_space(this);
|
670
|
+
last_pc_ = pc_;
|
671
|
+
emit_rex_64(dst);
|
672
|
+
if (is_int8(src.value_)) {
|
673
|
+
emit(0x83);
|
674
|
+
emit_operand(subcode, dst);
|
675
|
+
emit(src.value_);
|
676
|
+
} else {
|
677
|
+
emit(0x81);
|
678
|
+
emit_operand(subcode, dst);
|
679
|
+
emitl(src.value_);
|
680
|
+
}
|
681
|
+
}
|
682
|
+
|
683
|
+
|
684
|
+
void Assembler::immediate_arithmetic_op_16(byte subcode,
|
685
|
+
Register dst,
|
686
|
+
Immediate src) {
|
687
|
+
EnsureSpace ensure_space(this);
|
688
|
+
last_pc_ = pc_;
|
689
|
+
emit(0x66); // Operand size override prefix.
|
690
|
+
emit_optional_rex_32(dst);
|
691
|
+
if (is_int8(src.value_)) {
|
692
|
+
emit(0x83);
|
693
|
+
emit_modrm(subcode, dst);
|
694
|
+
emit(src.value_);
|
695
|
+
} else if (dst.is(rax)) {
|
696
|
+
emit(0x05 | (subcode << 3));
|
697
|
+
emitw(src.value_);
|
698
|
+
} else {
|
699
|
+
emit(0x81);
|
700
|
+
emit_modrm(subcode, dst);
|
701
|
+
emitw(src.value_);
|
702
|
+
}
|
703
|
+
}
|
704
|
+
|
705
|
+
|
706
|
+
void Assembler::immediate_arithmetic_op_16(byte subcode,
|
707
|
+
const Operand& dst,
|
708
|
+
Immediate src) {
|
709
|
+
EnsureSpace ensure_space(this);
|
710
|
+
last_pc_ = pc_;
|
711
|
+
emit(0x66); // Operand size override prefix.
|
712
|
+
emit_optional_rex_32(dst);
|
713
|
+
if (is_int8(src.value_)) {
|
714
|
+
emit(0x83);
|
715
|
+
emit_operand(subcode, dst);
|
716
|
+
emit(src.value_);
|
717
|
+
} else {
|
718
|
+
emit(0x81);
|
719
|
+
emit_operand(subcode, dst);
|
720
|
+
emitw(src.value_);
|
721
|
+
}
|
722
|
+
}
|
723
|
+
|
724
|
+
|
725
|
+
void Assembler::immediate_arithmetic_op_32(byte subcode,
|
726
|
+
Register dst,
|
727
|
+
Immediate src) {
|
728
|
+
EnsureSpace ensure_space(this);
|
729
|
+
last_pc_ = pc_;
|
730
|
+
emit_optional_rex_32(dst);
|
731
|
+
if (is_int8(src.value_)) {
|
732
|
+
emit(0x83);
|
733
|
+
emit_modrm(subcode, dst);
|
734
|
+
emit(src.value_);
|
735
|
+
} else if (dst.is(rax)) {
|
736
|
+
emit(0x05 | (subcode << 3));
|
737
|
+
emitl(src.value_);
|
738
|
+
} else {
|
739
|
+
emit(0x81);
|
740
|
+
emit_modrm(subcode, dst);
|
741
|
+
emitl(src.value_);
|
742
|
+
}
|
743
|
+
}
|
744
|
+
|
745
|
+
|
746
|
+
void Assembler::immediate_arithmetic_op_32(byte subcode,
|
747
|
+
const Operand& dst,
|
748
|
+
Immediate src) {
|
749
|
+
EnsureSpace ensure_space(this);
|
750
|
+
last_pc_ = pc_;
|
751
|
+
emit_optional_rex_32(dst);
|
752
|
+
if (is_int8(src.value_)) {
|
753
|
+
emit(0x83);
|
754
|
+
emit_operand(subcode, dst);
|
755
|
+
emit(src.value_);
|
756
|
+
} else {
|
757
|
+
emit(0x81);
|
758
|
+
emit_operand(subcode, dst);
|
759
|
+
emitl(src.value_);
|
760
|
+
}
|
761
|
+
}
|
762
|
+
|
763
|
+
|
764
|
+
void Assembler::immediate_arithmetic_op_8(byte subcode,
|
765
|
+
const Operand& dst,
|
766
|
+
Immediate src) {
|
767
|
+
EnsureSpace ensure_space(this);
|
768
|
+
last_pc_ = pc_;
|
769
|
+
emit_optional_rex_32(dst);
|
770
|
+
ASSERT(is_int8(src.value_) || is_uint8(src.value_));
|
771
|
+
emit(0x80);
|
772
|
+
emit_operand(subcode, dst);
|
773
|
+
emit(src.value_);
|
774
|
+
}
|
775
|
+
|
776
|
+
|
777
|
+
void Assembler::immediate_arithmetic_op_8(byte subcode,
|
778
|
+
Register dst,
|
779
|
+
Immediate src) {
|
780
|
+
EnsureSpace ensure_space(this);
|
781
|
+
last_pc_ = pc_;
|
782
|
+
if (dst.code() > 3) {
|
783
|
+
// Use 64-bit mode byte registers.
|
784
|
+
emit_rex_64(dst);
|
785
|
+
}
|
786
|
+
ASSERT(is_int8(src.value_) || is_uint8(src.value_));
|
787
|
+
emit(0x80);
|
788
|
+
emit_modrm(subcode, dst);
|
789
|
+
emit(src.value_);
|
790
|
+
}
|
791
|
+
|
792
|
+
|
793
|
+
void Assembler::shift(Register dst, Immediate shift_amount, int subcode) {
|
794
|
+
EnsureSpace ensure_space(this);
|
795
|
+
last_pc_ = pc_;
|
796
|
+
ASSERT(is_uint6(shift_amount.value_)); // illegal shift count
|
797
|
+
if (shift_amount.value_ == 1) {
|
798
|
+
emit_rex_64(dst);
|
799
|
+
emit(0xD1);
|
800
|
+
emit_modrm(subcode, dst);
|
801
|
+
} else {
|
802
|
+
emit_rex_64(dst);
|
803
|
+
emit(0xC1);
|
804
|
+
emit_modrm(subcode, dst);
|
805
|
+
emit(shift_amount.value_);
|
806
|
+
}
|
807
|
+
}
|
808
|
+
|
809
|
+
|
810
|
+
void Assembler::shift(Register dst, int subcode) {
|
811
|
+
EnsureSpace ensure_space(this);
|
812
|
+
last_pc_ = pc_;
|
813
|
+
emit_rex_64(dst);
|
814
|
+
emit(0xD3);
|
815
|
+
emit_modrm(subcode, dst);
|
816
|
+
}
|
817
|
+
|
818
|
+
|
819
|
+
void Assembler::shift_32(Register dst, int subcode) {
|
820
|
+
EnsureSpace ensure_space(this);
|
821
|
+
last_pc_ = pc_;
|
822
|
+
emit_optional_rex_32(dst);
|
823
|
+
emit(0xD3);
|
824
|
+
emit_modrm(subcode, dst);
|
825
|
+
}
|
826
|
+
|
827
|
+
|
828
|
+
void Assembler::shift_32(Register dst, Immediate shift_amount, int subcode) {
|
829
|
+
EnsureSpace ensure_space(this);
|
830
|
+
last_pc_ = pc_;
|
831
|
+
ASSERT(is_uint5(shift_amount.value_)); // illegal shift count
|
832
|
+
if (shift_amount.value_ == 1) {
|
833
|
+
emit_optional_rex_32(dst);
|
834
|
+
emit(0xD1);
|
835
|
+
emit_modrm(subcode, dst);
|
836
|
+
} else {
|
837
|
+
emit_optional_rex_32(dst);
|
838
|
+
emit(0xC1);
|
839
|
+
emit_modrm(subcode, dst);
|
840
|
+
emit(shift_amount.value_);
|
841
|
+
}
|
842
|
+
}
|
843
|
+
|
844
|
+
|
845
|
+
void Assembler::bt(const Operand& dst, Register src) {
|
846
|
+
EnsureSpace ensure_space(this);
|
847
|
+
last_pc_ = pc_;
|
848
|
+
emit_rex_64(src, dst);
|
849
|
+
emit(0x0F);
|
850
|
+
emit(0xA3);
|
851
|
+
emit_operand(src, dst);
|
852
|
+
}
|
853
|
+
|
854
|
+
|
855
|
+
void Assembler::bts(const Operand& dst, Register src) {
|
856
|
+
EnsureSpace ensure_space(this);
|
857
|
+
last_pc_ = pc_;
|
858
|
+
emit_rex_64(src, dst);
|
859
|
+
emit(0x0F);
|
860
|
+
emit(0xAB);
|
861
|
+
emit_operand(src, dst);
|
862
|
+
}
|
863
|
+
|
864
|
+
|
865
|
+
void Assembler::call(Label* L) {
|
866
|
+
positions_recorder()->WriteRecordedPositions();
|
867
|
+
EnsureSpace ensure_space(this);
|
868
|
+
last_pc_ = pc_;
|
869
|
+
// 1110 1000 #32-bit disp.
|
870
|
+
emit(0xE8);
|
871
|
+
if (L->is_bound()) {
|
872
|
+
int offset = L->pos() - pc_offset() - sizeof(int32_t);
|
873
|
+
ASSERT(offset <= 0);
|
874
|
+
emitl(offset);
|
875
|
+
} else if (L->is_linked()) {
|
876
|
+
emitl(L->pos());
|
877
|
+
L->link_to(pc_offset() - sizeof(int32_t));
|
878
|
+
} else {
|
879
|
+
ASSERT(L->is_unused());
|
880
|
+
int32_t current = pc_offset();
|
881
|
+
emitl(current);
|
882
|
+
L->link_to(current);
|
883
|
+
}
|
884
|
+
}
|
885
|
+
|
886
|
+
|
887
|
+
void Assembler::call(Handle<Code> target, RelocInfo::Mode rmode) {
|
888
|
+
positions_recorder()->WriteRecordedPositions();
|
889
|
+
EnsureSpace ensure_space(this);
|
890
|
+
last_pc_ = pc_;
|
891
|
+
// 1110 1000 #32-bit disp.
|
892
|
+
emit(0xE8);
|
893
|
+
emit_code_target(target, rmode);
|
894
|
+
}
|
895
|
+
|
896
|
+
|
897
|
+
void Assembler::call(Register adr) {
|
898
|
+
positions_recorder()->WriteRecordedPositions();
|
899
|
+
EnsureSpace ensure_space(this);
|
900
|
+
last_pc_ = pc_;
|
901
|
+
// Opcode: FF /2 r64.
|
902
|
+
emit_optional_rex_32(adr);
|
903
|
+
emit(0xFF);
|
904
|
+
emit_modrm(0x2, adr);
|
905
|
+
}
|
906
|
+
|
907
|
+
|
908
|
+
void Assembler::call(const Operand& op) {
|
909
|
+
positions_recorder()->WriteRecordedPositions();
|
910
|
+
EnsureSpace ensure_space(this);
|
911
|
+
last_pc_ = pc_;
|
912
|
+
// Opcode: FF /2 m64.
|
913
|
+
emit_optional_rex_32(op);
|
914
|
+
emit(0xFF);
|
915
|
+
emit_operand(0x2, op);
|
916
|
+
}
|
917
|
+
|
918
|
+
|
919
|
+
// Calls directly to the given address using a relative offset.
|
920
|
+
// Should only ever be used in Code objects for calls within the
|
921
|
+
// same Code object. Should not be used when generating new code (use labels),
|
922
|
+
// but only when patching existing code.
|
923
|
+
void Assembler::call(Address target) {
|
924
|
+
positions_recorder()->WriteRecordedPositions();
|
925
|
+
EnsureSpace ensure_space(this);
|
926
|
+
last_pc_ = pc_;
|
927
|
+
// 1110 1000 #32-bit disp.
|
928
|
+
emit(0xE8);
|
929
|
+
Address source = pc_ + 4;
|
930
|
+
intptr_t displacement = target - source;
|
931
|
+
ASSERT(is_int32(displacement));
|
932
|
+
emitl(static_cast<int32_t>(displacement));
|
933
|
+
}
|
934
|
+
|
935
|
+
|
936
|
+
void Assembler::clc() {
|
937
|
+
EnsureSpace ensure_space(this);
|
938
|
+
last_pc_ = pc_;
|
939
|
+
emit(0xF8);
|
940
|
+
}
|
941
|
+
|
942
|
+
void Assembler::cdq() {
|
943
|
+
EnsureSpace ensure_space(this);
|
944
|
+
last_pc_ = pc_;
|
945
|
+
emit(0x99);
|
946
|
+
}
|
947
|
+
|
948
|
+
|
949
|
+
void Assembler::cmovq(Condition cc, Register dst, Register src) {
|
950
|
+
if (cc == always) {
|
951
|
+
movq(dst, src);
|
952
|
+
} else if (cc == never) {
|
953
|
+
return;
|
954
|
+
}
|
955
|
+
// No need to check CpuInfo for CMOV support, it's a required part of the
|
956
|
+
// 64-bit architecture.
|
957
|
+
ASSERT(cc >= 0); // Use mov for unconditional moves.
|
958
|
+
EnsureSpace ensure_space(this);
|
959
|
+
last_pc_ = pc_;
|
960
|
+
// Opcode: REX.W 0f 40 + cc /r.
|
961
|
+
emit_rex_64(dst, src);
|
962
|
+
emit(0x0f);
|
963
|
+
emit(0x40 + cc);
|
964
|
+
emit_modrm(dst, src);
|
965
|
+
}
|
966
|
+
|
967
|
+
|
968
|
+
void Assembler::cmovq(Condition cc, Register dst, const Operand& src) {
|
969
|
+
if (cc == always) {
|
970
|
+
movq(dst, src);
|
971
|
+
} else if (cc == never) {
|
972
|
+
return;
|
973
|
+
}
|
974
|
+
ASSERT(cc >= 0);
|
975
|
+
EnsureSpace ensure_space(this);
|
976
|
+
last_pc_ = pc_;
|
977
|
+
// Opcode: REX.W 0f 40 + cc /r.
|
978
|
+
emit_rex_64(dst, src);
|
979
|
+
emit(0x0f);
|
980
|
+
emit(0x40 + cc);
|
981
|
+
emit_operand(dst, src);
|
982
|
+
}
|
983
|
+
|
984
|
+
|
985
|
+
void Assembler::cmovl(Condition cc, Register dst, Register src) {
|
986
|
+
if (cc == always) {
|
987
|
+
movl(dst, src);
|
988
|
+
} else if (cc == never) {
|
989
|
+
return;
|
990
|
+
}
|
991
|
+
ASSERT(cc >= 0);
|
992
|
+
EnsureSpace ensure_space(this);
|
993
|
+
last_pc_ = pc_;
|
994
|
+
// Opcode: 0f 40 + cc /r.
|
995
|
+
emit_optional_rex_32(dst, src);
|
996
|
+
emit(0x0f);
|
997
|
+
emit(0x40 + cc);
|
998
|
+
emit_modrm(dst, src);
|
999
|
+
}
|
1000
|
+
|
1001
|
+
|
1002
|
+
void Assembler::cmovl(Condition cc, Register dst, const Operand& src) {
|
1003
|
+
if (cc == always) {
|
1004
|
+
movl(dst, src);
|
1005
|
+
} else if (cc == never) {
|
1006
|
+
return;
|
1007
|
+
}
|
1008
|
+
ASSERT(cc >= 0);
|
1009
|
+
EnsureSpace ensure_space(this);
|
1010
|
+
last_pc_ = pc_;
|
1011
|
+
// Opcode: 0f 40 + cc /r.
|
1012
|
+
emit_optional_rex_32(dst, src);
|
1013
|
+
emit(0x0f);
|
1014
|
+
emit(0x40 + cc);
|
1015
|
+
emit_operand(dst, src);
|
1016
|
+
}
|
1017
|
+
|
1018
|
+
|
1019
|
+
void Assembler::cmpb_al(Immediate imm8) {
|
1020
|
+
ASSERT(is_int8(imm8.value_) || is_uint8(imm8.value_));
|
1021
|
+
EnsureSpace ensure_space(this);
|
1022
|
+
last_pc_ = pc_;
|
1023
|
+
emit(0x3c);
|
1024
|
+
emit(imm8.value_);
|
1025
|
+
}
|
1026
|
+
|
1027
|
+
|
1028
|
+
void Assembler::cpuid() {
|
1029
|
+
ASSERT(CpuFeatures::IsEnabled(CPUID));
|
1030
|
+
EnsureSpace ensure_space(this);
|
1031
|
+
last_pc_ = pc_;
|
1032
|
+
emit(0x0F);
|
1033
|
+
emit(0xA2);
|
1034
|
+
}
|
1035
|
+
|
1036
|
+
|
1037
|
+
void Assembler::cqo() {
|
1038
|
+
EnsureSpace ensure_space(this);
|
1039
|
+
last_pc_ = pc_;
|
1040
|
+
emit_rex_64();
|
1041
|
+
emit(0x99);
|
1042
|
+
}
|
1043
|
+
|
1044
|
+
|
1045
|
+
void Assembler::decq(Register dst) {
|
1046
|
+
EnsureSpace ensure_space(this);
|
1047
|
+
last_pc_ = pc_;
|
1048
|
+
emit_rex_64(dst);
|
1049
|
+
emit(0xFF);
|
1050
|
+
emit_modrm(0x1, dst);
|
1051
|
+
}
|
1052
|
+
|
1053
|
+
|
1054
|
+
void Assembler::decq(const Operand& dst) {
|
1055
|
+
EnsureSpace ensure_space(this);
|
1056
|
+
last_pc_ = pc_;
|
1057
|
+
emit_rex_64(dst);
|
1058
|
+
emit(0xFF);
|
1059
|
+
emit_operand(1, dst);
|
1060
|
+
}
|
1061
|
+
|
1062
|
+
|
1063
|
+
void Assembler::decl(Register dst) {
|
1064
|
+
EnsureSpace ensure_space(this);
|
1065
|
+
last_pc_ = pc_;
|
1066
|
+
emit_optional_rex_32(dst);
|
1067
|
+
emit(0xFF);
|
1068
|
+
emit_modrm(0x1, dst);
|
1069
|
+
}
|
1070
|
+
|
1071
|
+
|
1072
|
+
void Assembler::decl(const Operand& dst) {
|
1073
|
+
EnsureSpace ensure_space(this);
|
1074
|
+
last_pc_ = pc_;
|
1075
|
+
emit_optional_rex_32(dst);
|
1076
|
+
emit(0xFF);
|
1077
|
+
emit_operand(1, dst);
|
1078
|
+
}
|
1079
|
+
|
1080
|
+
|
1081
|
+
void Assembler::decb(Register dst) {
|
1082
|
+
EnsureSpace ensure_space(this);
|
1083
|
+
last_pc_ = pc_;
|
1084
|
+
if (dst.code() > 3) {
|
1085
|
+
// Register is not one of al, bl, cl, dl. Its encoding needs REX.
|
1086
|
+
emit_rex_32(dst);
|
1087
|
+
}
|
1088
|
+
emit(0xFE);
|
1089
|
+
emit_modrm(0x1, dst);
|
1090
|
+
}
|
1091
|
+
|
1092
|
+
|
1093
|
+
void Assembler::decb(const Operand& dst) {
|
1094
|
+
EnsureSpace ensure_space(this);
|
1095
|
+
last_pc_ = pc_;
|
1096
|
+
emit_optional_rex_32(dst);
|
1097
|
+
emit(0xFE);
|
1098
|
+
emit_operand(1, dst);
|
1099
|
+
}
|
1100
|
+
|
1101
|
+
|
1102
|
+
void Assembler::enter(Immediate size) {
|
1103
|
+
EnsureSpace ensure_space(this);
|
1104
|
+
last_pc_ = pc_;
|
1105
|
+
emit(0xC8);
|
1106
|
+
emitw(size.value_); // 16 bit operand, always.
|
1107
|
+
emit(0);
|
1108
|
+
}
|
1109
|
+
|
1110
|
+
|
1111
|
+
void Assembler::hlt() {
|
1112
|
+
EnsureSpace ensure_space(this);
|
1113
|
+
last_pc_ = pc_;
|
1114
|
+
emit(0xF4);
|
1115
|
+
}
|
1116
|
+
|
1117
|
+
|
1118
|
+
void Assembler::idivq(Register src) {
|
1119
|
+
EnsureSpace ensure_space(this);
|
1120
|
+
last_pc_ = pc_;
|
1121
|
+
emit_rex_64(src);
|
1122
|
+
emit(0xF7);
|
1123
|
+
emit_modrm(0x7, src);
|
1124
|
+
}
|
1125
|
+
|
1126
|
+
|
1127
|
+
void Assembler::idivl(Register src) {
|
1128
|
+
EnsureSpace ensure_space(this);
|
1129
|
+
last_pc_ = pc_;
|
1130
|
+
emit_optional_rex_32(src);
|
1131
|
+
emit(0xF7);
|
1132
|
+
emit_modrm(0x7, src);
|
1133
|
+
}
|
1134
|
+
|
1135
|
+
|
1136
|
+
void Assembler::imul(Register src) {
|
1137
|
+
EnsureSpace ensure_space(this);
|
1138
|
+
last_pc_ = pc_;
|
1139
|
+
emit_rex_64(src);
|
1140
|
+
emit(0xF7);
|
1141
|
+
emit_modrm(0x5, src);
|
1142
|
+
}
|
1143
|
+
|
1144
|
+
|
1145
|
+
void Assembler::imul(Register dst, Register src) {
|
1146
|
+
EnsureSpace ensure_space(this);
|
1147
|
+
last_pc_ = pc_;
|
1148
|
+
emit_rex_64(dst, src);
|
1149
|
+
emit(0x0F);
|
1150
|
+
emit(0xAF);
|
1151
|
+
emit_modrm(dst, src);
|
1152
|
+
}
|
1153
|
+
|
1154
|
+
|
1155
|
+
void Assembler::imul(Register dst, const Operand& src) {
|
1156
|
+
EnsureSpace ensure_space(this);
|
1157
|
+
last_pc_ = pc_;
|
1158
|
+
emit_rex_64(dst, src);
|
1159
|
+
emit(0x0F);
|
1160
|
+
emit(0xAF);
|
1161
|
+
emit_operand(dst, src);
|
1162
|
+
}
|
1163
|
+
|
1164
|
+
|
1165
|
+
void Assembler::imul(Register dst, Register src, Immediate imm) {
|
1166
|
+
EnsureSpace ensure_space(this);
|
1167
|
+
last_pc_ = pc_;
|
1168
|
+
emit_rex_64(dst, src);
|
1169
|
+
if (is_int8(imm.value_)) {
|
1170
|
+
emit(0x6B);
|
1171
|
+
emit_modrm(dst, src);
|
1172
|
+
emit(imm.value_);
|
1173
|
+
} else {
|
1174
|
+
emit(0x69);
|
1175
|
+
emit_modrm(dst, src);
|
1176
|
+
emitl(imm.value_);
|
1177
|
+
}
|
1178
|
+
}
|
1179
|
+
|
1180
|
+
|
1181
|
+
void Assembler::imull(Register dst, Register src) {
|
1182
|
+
EnsureSpace ensure_space(this);
|
1183
|
+
last_pc_ = pc_;
|
1184
|
+
emit_optional_rex_32(dst, src);
|
1185
|
+
emit(0x0F);
|
1186
|
+
emit(0xAF);
|
1187
|
+
emit_modrm(dst, src);
|
1188
|
+
}
|
1189
|
+
|
1190
|
+
|
1191
|
+
void Assembler::imull(Register dst, const Operand& src) {
|
1192
|
+
EnsureSpace ensure_space(this);
|
1193
|
+
last_pc_ = pc_;
|
1194
|
+
emit_optional_rex_32(dst, src);
|
1195
|
+
emit(0x0F);
|
1196
|
+
emit(0xAF);
|
1197
|
+
emit_operand(dst, src);
|
1198
|
+
}
|
1199
|
+
|
1200
|
+
|
1201
|
+
void Assembler::imull(Register dst, Register src, Immediate imm) {
|
1202
|
+
EnsureSpace ensure_space(this);
|
1203
|
+
last_pc_ = pc_;
|
1204
|
+
emit_optional_rex_32(dst, src);
|
1205
|
+
if (is_int8(imm.value_)) {
|
1206
|
+
emit(0x6B);
|
1207
|
+
emit_modrm(dst, src);
|
1208
|
+
emit(imm.value_);
|
1209
|
+
} else {
|
1210
|
+
emit(0x69);
|
1211
|
+
emit_modrm(dst, src);
|
1212
|
+
emitl(imm.value_);
|
1213
|
+
}
|
1214
|
+
}
|
1215
|
+
|
1216
|
+
|
1217
|
+
void Assembler::incq(Register dst) {
|
1218
|
+
EnsureSpace ensure_space(this);
|
1219
|
+
last_pc_ = pc_;
|
1220
|
+
emit_rex_64(dst);
|
1221
|
+
emit(0xFF);
|
1222
|
+
emit_modrm(0x0, dst);
|
1223
|
+
}
|
1224
|
+
|
1225
|
+
|
1226
|
+
void Assembler::incq(const Operand& dst) {
|
1227
|
+
EnsureSpace ensure_space(this);
|
1228
|
+
last_pc_ = pc_;
|
1229
|
+
emit_rex_64(dst);
|
1230
|
+
emit(0xFF);
|
1231
|
+
emit_operand(0, dst);
|
1232
|
+
}
|
1233
|
+
|
1234
|
+
|
1235
|
+
void Assembler::incl(const Operand& dst) {
|
1236
|
+
EnsureSpace ensure_space(this);
|
1237
|
+
last_pc_ = pc_;
|
1238
|
+
emit_optional_rex_32(dst);
|
1239
|
+
emit(0xFF);
|
1240
|
+
emit_operand(0, dst);
|
1241
|
+
}
|
1242
|
+
|
1243
|
+
|
1244
|
+
void Assembler::incl(Register dst) {
|
1245
|
+
EnsureSpace ensure_space(this);
|
1246
|
+
last_pc_ = pc_;
|
1247
|
+
emit_optional_rex_32(dst);
|
1248
|
+
emit(0xFF);
|
1249
|
+
emit_modrm(0, dst);
|
1250
|
+
}
|
1251
|
+
|
1252
|
+
|
1253
|
+
void Assembler::int3() {
|
1254
|
+
EnsureSpace ensure_space(this);
|
1255
|
+
last_pc_ = pc_;
|
1256
|
+
emit(0xCC);
|
1257
|
+
}
|
1258
|
+
|
1259
|
+
|
1260
|
+
void Assembler::j(Condition cc, Label* L) {
|
1261
|
+
if (cc == always) {
|
1262
|
+
jmp(L);
|
1263
|
+
return;
|
1264
|
+
} else if (cc == never) {
|
1265
|
+
return;
|
1266
|
+
}
|
1267
|
+
EnsureSpace ensure_space(this);
|
1268
|
+
last_pc_ = pc_;
|
1269
|
+
ASSERT(is_uint4(cc));
|
1270
|
+
if (L->is_bound()) {
|
1271
|
+
const int short_size = 2;
|
1272
|
+
const int long_size = 6;
|
1273
|
+
int offs = L->pos() - pc_offset();
|
1274
|
+
ASSERT(offs <= 0);
|
1275
|
+
if (is_int8(offs - short_size)) {
|
1276
|
+
// 0111 tttn #8-bit disp.
|
1277
|
+
emit(0x70 | cc);
|
1278
|
+
emit((offs - short_size) & 0xFF);
|
1279
|
+
} else {
|
1280
|
+
// 0000 1111 1000 tttn #32-bit disp.
|
1281
|
+
emit(0x0F);
|
1282
|
+
emit(0x80 | cc);
|
1283
|
+
emitl(offs - long_size);
|
1284
|
+
}
|
1285
|
+
} else if (L->is_linked()) {
|
1286
|
+
// 0000 1111 1000 tttn #32-bit disp.
|
1287
|
+
emit(0x0F);
|
1288
|
+
emit(0x80 | cc);
|
1289
|
+
emitl(L->pos());
|
1290
|
+
L->link_to(pc_offset() - sizeof(int32_t));
|
1291
|
+
} else {
|
1292
|
+
ASSERT(L->is_unused());
|
1293
|
+
emit(0x0F);
|
1294
|
+
emit(0x80 | cc);
|
1295
|
+
int32_t current = pc_offset();
|
1296
|
+
emitl(current);
|
1297
|
+
L->link_to(current);
|
1298
|
+
}
|
1299
|
+
}
|
1300
|
+
|
1301
|
+
|
1302
|
+
void Assembler::j(Condition cc,
|
1303
|
+
Handle<Code> target,
|
1304
|
+
RelocInfo::Mode rmode) {
|
1305
|
+
EnsureSpace ensure_space(this);
|
1306
|
+
last_pc_ = pc_;
|
1307
|
+
ASSERT(is_uint4(cc));
|
1308
|
+
// 0000 1111 1000 tttn #32-bit disp.
|
1309
|
+
emit(0x0F);
|
1310
|
+
emit(0x80 | cc);
|
1311
|
+
emit_code_target(target, rmode);
|
1312
|
+
}
|
1313
|
+
|
1314
|
+
|
1315
|
+
void Assembler::j(Condition cc, NearLabel* L, Hint hint) {
|
1316
|
+
EnsureSpace ensure_space(this);
|
1317
|
+
last_pc_ = pc_;
|
1318
|
+
ASSERT(0 <= cc && cc < 16);
|
1319
|
+
if (FLAG_emit_branch_hints && hint != no_hint) emit(hint);
|
1320
|
+
if (L->is_bound()) {
|
1321
|
+
const int short_size = 2;
|
1322
|
+
int offs = L->pos() - pc_offset();
|
1323
|
+
ASSERT(offs <= 0);
|
1324
|
+
ASSERT(is_int8(offs - short_size));
|
1325
|
+
// 0111 tttn #8-bit disp
|
1326
|
+
emit(0x70 | cc);
|
1327
|
+
emit((offs - short_size) & 0xFF);
|
1328
|
+
} else {
|
1329
|
+
emit(0x70 | cc);
|
1330
|
+
emit(0x00); // The displacement will be resolved later.
|
1331
|
+
L->link_to(pc_offset());
|
1332
|
+
}
|
1333
|
+
}
|
1334
|
+
|
1335
|
+
|
1336
|
+
void Assembler::jmp(Label* L) {
|
1337
|
+
EnsureSpace ensure_space(this);
|
1338
|
+
last_pc_ = pc_;
|
1339
|
+
const int short_size = sizeof(int8_t);
|
1340
|
+
const int long_size = sizeof(int32_t);
|
1341
|
+
if (L->is_bound()) {
|
1342
|
+
int offs = L->pos() - pc_offset() - 1;
|
1343
|
+
ASSERT(offs <= 0);
|
1344
|
+
if (is_int8(offs - short_size)) {
|
1345
|
+
// 1110 1011 #8-bit disp.
|
1346
|
+
emit(0xEB);
|
1347
|
+
emit((offs - short_size) & 0xFF);
|
1348
|
+
} else {
|
1349
|
+
// 1110 1001 #32-bit disp.
|
1350
|
+
emit(0xE9);
|
1351
|
+
emitl(offs - long_size);
|
1352
|
+
}
|
1353
|
+
} else if (L->is_linked()) {
|
1354
|
+
// 1110 1001 #32-bit disp.
|
1355
|
+
emit(0xE9);
|
1356
|
+
emitl(L->pos());
|
1357
|
+
L->link_to(pc_offset() - long_size);
|
1358
|
+
} else {
|
1359
|
+
// 1110 1001 #32-bit disp.
|
1360
|
+
ASSERT(L->is_unused());
|
1361
|
+
emit(0xE9);
|
1362
|
+
int32_t current = pc_offset();
|
1363
|
+
emitl(current);
|
1364
|
+
L->link_to(current);
|
1365
|
+
}
|
1366
|
+
}
|
1367
|
+
|
1368
|
+
|
1369
|
+
void Assembler::jmp(Handle<Code> target, RelocInfo::Mode rmode) {
|
1370
|
+
EnsureSpace ensure_space(this);
|
1371
|
+
last_pc_ = pc_;
|
1372
|
+
// 1110 1001 #32-bit disp.
|
1373
|
+
emit(0xE9);
|
1374
|
+
emit_code_target(target, rmode);
|
1375
|
+
}
|
1376
|
+
|
1377
|
+
|
1378
|
+
void Assembler::jmp(NearLabel* L) {
|
1379
|
+
EnsureSpace ensure_space(this);
|
1380
|
+
last_pc_ = pc_;
|
1381
|
+
if (L->is_bound()) {
|
1382
|
+
const int short_size = sizeof(int8_t);
|
1383
|
+
int offs = L->pos() - pc_offset();
|
1384
|
+
ASSERT(offs <= 0);
|
1385
|
+
ASSERT(is_int8(offs - short_size));
|
1386
|
+
// 1110 1011 #8-bit disp.
|
1387
|
+
emit(0xEB);
|
1388
|
+
emit((offs - short_size) & 0xFF);
|
1389
|
+
} else {
|
1390
|
+
emit(0xEB);
|
1391
|
+
emit(0x00); // The displacement will be resolved later.
|
1392
|
+
L->link_to(pc_offset());
|
1393
|
+
}
|
1394
|
+
}
|
1395
|
+
|
1396
|
+
|
1397
|
+
void Assembler::jmp(Register target) {
|
1398
|
+
EnsureSpace ensure_space(this);
|
1399
|
+
last_pc_ = pc_;
|
1400
|
+
// Opcode FF/4 r64.
|
1401
|
+
emit_optional_rex_32(target);
|
1402
|
+
emit(0xFF);
|
1403
|
+
emit_modrm(0x4, target);
|
1404
|
+
}
|
1405
|
+
|
1406
|
+
|
1407
|
+
void Assembler::jmp(const Operand& src) {
|
1408
|
+
EnsureSpace ensure_space(this);
|
1409
|
+
last_pc_ = pc_;
|
1410
|
+
// Opcode FF/4 m64.
|
1411
|
+
emit_optional_rex_32(src);
|
1412
|
+
emit(0xFF);
|
1413
|
+
emit_operand(0x4, src);
|
1414
|
+
}
|
1415
|
+
|
1416
|
+
|
1417
|
+
void Assembler::lea(Register dst, const Operand& src) {
|
1418
|
+
EnsureSpace ensure_space(this);
|
1419
|
+
last_pc_ = pc_;
|
1420
|
+
emit_rex_64(dst, src);
|
1421
|
+
emit(0x8D);
|
1422
|
+
emit_operand(dst, src);
|
1423
|
+
}
|
1424
|
+
|
1425
|
+
|
1426
|
+
void Assembler::leal(Register dst, const Operand& src) {
|
1427
|
+
EnsureSpace ensure_space(this);
|
1428
|
+
last_pc_ = pc_;
|
1429
|
+
emit_optional_rex_32(dst, src);
|
1430
|
+
emit(0x8D);
|
1431
|
+
emit_operand(dst, src);
|
1432
|
+
}
|
1433
|
+
|
1434
|
+
|
1435
|
+
void Assembler::load_rax(void* value, RelocInfo::Mode mode) {
|
1436
|
+
EnsureSpace ensure_space(this);
|
1437
|
+
last_pc_ = pc_;
|
1438
|
+
emit(0x48); // REX.W
|
1439
|
+
emit(0xA1);
|
1440
|
+
emitq(reinterpret_cast<uintptr_t>(value), mode);
|
1441
|
+
}
|
1442
|
+
|
1443
|
+
|
1444
|
+
void Assembler::load_rax(ExternalReference ref) {
|
1445
|
+
load_rax(ref.address(), RelocInfo::EXTERNAL_REFERENCE);
|
1446
|
+
}
|
1447
|
+
|
1448
|
+
|
1449
|
+
void Assembler::leave() {
|
1450
|
+
EnsureSpace ensure_space(this);
|
1451
|
+
last_pc_ = pc_;
|
1452
|
+
emit(0xC9);
|
1453
|
+
}
|
1454
|
+
|
1455
|
+
|
1456
|
+
void Assembler::movb(Register dst, const Operand& src) {
|
1457
|
+
EnsureSpace ensure_space(this);
|
1458
|
+
last_pc_ = pc_;
|
1459
|
+
emit_rex_32(dst, src);
|
1460
|
+
emit(0x8A);
|
1461
|
+
emit_operand(dst, src);
|
1462
|
+
}
|
1463
|
+
|
1464
|
+
|
1465
|
+
void Assembler::movb(Register dst, Immediate imm) {
|
1466
|
+
EnsureSpace ensure_space(this);
|
1467
|
+
last_pc_ = pc_;
|
1468
|
+
emit_rex_32(dst);
|
1469
|
+
emit(0xC6);
|
1470
|
+
emit_modrm(0x0, dst);
|
1471
|
+
emit(imm.value_);
|
1472
|
+
}
|
1473
|
+
|
1474
|
+
|
1475
|
+
void Assembler::movb(const Operand& dst, Register src) {
|
1476
|
+
EnsureSpace ensure_space(this);
|
1477
|
+
last_pc_ = pc_;
|
1478
|
+
emit_rex_32(src, dst);
|
1479
|
+
emit(0x88);
|
1480
|
+
emit_operand(src, dst);
|
1481
|
+
}
|
1482
|
+
|
1483
|
+
|
1484
|
+
void Assembler::movw(const Operand& dst, Register src) {
|
1485
|
+
EnsureSpace ensure_space(this);
|
1486
|
+
last_pc_ = pc_;
|
1487
|
+
emit(0x66);
|
1488
|
+
emit_optional_rex_32(src, dst);
|
1489
|
+
emit(0x89);
|
1490
|
+
emit_operand(src, dst);
|
1491
|
+
}
|
1492
|
+
|
1493
|
+
|
1494
|
+
void Assembler::movl(Register dst, const Operand& src) {
|
1495
|
+
EnsureSpace ensure_space(this);
|
1496
|
+
last_pc_ = pc_;
|
1497
|
+
emit_optional_rex_32(dst, src);
|
1498
|
+
emit(0x8B);
|
1499
|
+
emit_operand(dst, src);
|
1500
|
+
}
|
1501
|
+
|
1502
|
+
|
1503
|
+
void Assembler::movl(Register dst, Register src) {
|
1504
|
+
EnsureSpace ensure_space(this);
|
1505
|
+
last_pc_ = pc_;
|
1506
|
+
if (src.low_bits() == 4) {
|
1507
|
+
emit_optional_rex_32(src, dst);
|
1508
|
+
emit(0x89);
|
1509
|
+
emit_modrm(src, dst);
|
1510
|
+
} else {
|
1511
|
+
emit_optional_rex_32(dst, src);
|
1512
|
+
emit(0x8B);
|
1513
|
+
emit_modrm(dst, src);
|
1514
|
+
}
|
1515
|
+
}
|
1516
|
+
|
1517
|
+
|
1518
|
+
void Assembler::movl(const Operand& dst, Register src) {
|
1519
|
+
EnsureSpace ensure_space(this);
|
1520
|
+
last_pc_ = pc_;
|
1521
|
+
emit_optional_rex_32(src, dst);
|
1522
|
+
emit(0x89);
|
1523
|
+
emit_operand(src, dst);
|
1524
|
+
}
|
1525
|
+
|
1526
|
+
|
1527
|
+
void Assembler::movl(const Operand& dst, Immediate value) {
|
1528
|
+
EnsureSpace ensure_space(this);
|
1529
|
+
last_pc_ = pc_;
|
1530
|
+
emit_optional_rex_32(dst);
|
1531
|
+
emit(0xC7);
|
1532
|
+
emit_operand(0x0, dst);
|
1533
|
+
emit(value); // Only 32-bit immediates are possible, not 8-bit immediates.
|
1534
|
+
}
|
1535
|
+
|
1536
|
+
|
1537
|
+
void Assembler::movl(Register dst, Immediate value) {
|
1538
|
+
EnsureSpace ensure_space(this);
|
1539
|
+
last_pc_ = pc_;
|
1540
|
+
emit_optional_rex_32(dst);
|
1541
|
+
emit(0xC7);
|
1542
|
+
emit_modrm(0x0, dst);
|
1543
|
+
emit(value); // Only 32-bit immediates are possible, not 8-bit immediates.
|
1544
|
+
}
|
1545
|
+
|
1546
|
+
|
1547
|
+
void Assembler::movq(Register dst, const Operand& src) {
|
1548
|
+
EnsureSpace ensure_space(this);
|
1549
|
+
last_pc_ = pc_;
|
1550
|
+
emit_rex_64(dst, src);
|
1551
|
+
emit(0x8B);
|
1552
|
+
emit_operand(dst, src);
|
1553
|
+
}
|
1554
|
+
|
1555
|
+
|
1556
|
+
void Assembler::movq(Register dst, Register src) {
|
1557
|
+
EnsureSpace ensure_space(this);
|
1558
|
+
last_pc_ = pc_;
|
1559
|
+
if (src.low_bits() == 4) {
|
1560
|
+
emit_rex_64(src, dst);
|
1561
|
+
emit(0x89);
|
1562
|
+
emit_modrm(src, dst);
|
1563
|
+
} else {
|
1564
|
+
emit_rex_64(dst, src);
|
1565
|
+
emit(0x8B);
|
1566
|
+
emit_modrm(dst, src);
|
1567
|
+
}
|
1568
|
+
}
|
1569
|
+
|
1570
|
+
|
1571
|
+
void Assembler::movq(Register dst, Immediate value) {
|
1572
|
+
EnsureSpace ensure_space(this);
|
1573
|
+
last_pc_ = pc_;
|
1574
|
+
emit_rex_64(dst);
|
1575
|
+
emit(0xC7);
|
1576
|
+
emit_modrm(0x0, dst);
|
1577
|
+
emit(value); // Only 32-bit immediates are possible, not 8-bit immediates.
|
1578
|
+
}
|
1579
|
+
|
1580
|
+
|
1581
|
+
void Assembler::movq(const Operand& dst, Register src) {
|
1582
|
+
EnsureSpace ensure_space(this);
|
1583
|
+
last_pc_ = pc_;
|
1584
|
+
emit_rex_64(src, dst);
|
1585
|
+
emit(0x89);
|
1586
|
+
emit_operand(src, dst);
|
1587
|
+
}
|
1588
|
+
|
1589
|
+
|
1590
|
+
void Assembler::movq(Register dst, void* value, RelocInfo::Mode rmode) {
|
1591
|
+
// This method must not be used with heap object references. The stored
|
1592
|
+
// address is not GC safe. Use the handle version instead.
|
1593
|
+
ASSERT(rmode > RelocInfo::LAST_GCED_ENUM);
|
1594
|
+
EnsureSpace ensure_space(this);
|
1595
|
+
last_pc_ = pc_;
|
1596
|
+
emit_rex_64(dst);
|
1597
|
+
emit(0xB8 | dst.low_bits());
|
1598
|
+
emitq(reinterpret_cast<uintptr_t>(value), rmode);
|
1599
|
+
}
|
1600
|
+
|
1601
|
+
|
1602
|
+
void Assembler::movq(Register dst, int64_t value, RelocInfo::Mode rmode) {
|
1603
|
+
// Non-relocatable values might not need a 64-bit representation.
|
1604
|
+
if (rmode == RelocInfo::NONE) {
|
1605
|
+
// Sadly, there is no zero or sign extending move for 8-bit immediates.
|
1606
|
+
if (is_int32(value)) {
|
1607
|
+
movq(dst, Immediate(static_cast<int32_t>(value)));
|
1608
|
+
return;
|
1609
|
+
} else if (is_uint32(value)) {
|
1610
|
+
movl(dst, Immediate(static_cast<int32_t>(value)));
|
1611
|
+
return;
|
1612
|
+
}
|
1613
|
+
// Value cannot be represented by 32 bits, so do a full 64 bit immediate
|
1614
|
+
// value.
|
1615
|
+
}
|
1616
|
+
EnsureSpace ensure_space(this);
|
1617
|
+
last_pc_ = pc_;
|
1618
|
+
emit_rex_64(dst);
|
1619
|
+
emit(0xB8 | dst.low_bits());
|
1620
|
+
emitq(value, rmode);
|
1621
|
+
}
|
1622
|
+
|
1623
|
+
|
1624
|
+
void Assembler::movq(Register dst, ExternalReference ref) {
|
1625
|
+
int64_t value = reinterpret_cast<int64_t>(ref.address());
|
1626
|
+
movq(dst, value, RelocInfo::EXTERNAL_REFERENCE);
|
1627
|
+
}
|
1628
|
+
|
1629
|
+
|
1630
|
+
void Assembler::movq(const Operand& dst, Immediate value) {
|
1631
|
+
EnsureSpace ensure_space(this);
|
1632
|
+
last_pc_ = pc_;
|
1633
|
+
emit_rex_64(dst);
|
1634
|
+
emit(0xC7);
|
1635
|
+
emit_operand(0, dst);
|
1636
|
+
emit(value);
|
1637
|
+
}
|
1638
|
+
|
1639
|
+
|
1640
|
+
// Loads the ip-relative location of the src label into the target location
|
1641
|
+
// (as a 32-bit offset sign extended to 64-bit).
|
1642
|
+
void Assembler::movl(const Operand& dst, Label* src) {
|
1643
|
+
EnsureSpace ensure_space(this);
|
1644
|
+
last_pc_ = pc_;
|
1645
|
+
emit_optional_rex_32(dst);
|
1646
|
+
emit(0xC7);
|
1647
|
+
emit_operand(0, dst);
|
1648
|
+
if (src->is_bound()) {
|
1649
|
+
int offset = src->pos() - pc_offset() - sizeof(int32_t);
|
1650
|
+
ASSERT(offset <= 0);
|
1651
|
+
emitl(offset);
|
1652
|
+
} else if (src->is_linked()) {
|
1653
|
+
emitl(src->pos());
|
1654
|
+
src->link_to(pc_offset() - sizeof(int32_t));
|
1655
|
+
} else {
|
1656
|
+
ASSERT(src->is_unused());
|
1657
|
+
int32_t current = pc_offset();
|
1658
|
+
emitl(current);
|
1659
|
+
src->link_to(current);
|
1660
|
+
}
|
1661
|
+
}
|
1662
|
+
|
1663
|
+
|
1664
|
+
void Assembler::movq(Register dst, Handle<Object> value, RelocInfo::Mode mode) {
|
1665
|
+
// If there is no relocation info, emit the value of the handle efficiently
|
1666
|
+
// (possibly using less that 8 bytes for the value).
|
1667
|
+
if (mode == RelocInfo::NONE) {
|
1668
|
+
// There is no possible reason to store a heap pointer without relocation
|
1669
|
+
// info, so it must be a smi.
|
1670
|
+
ASSERT(value->IsSmi());
|
1671
|
+
movq(dst, reinterpret_cast<int64_t>(*value), RelocInfo::NONE);
|
1672
|
+
} else {
|
1673
|
+
EnsureSpace ensure_space(this);
|
1674
|
+
last_pc_ = pc_;
|
1675
|
+
ASSERT(value->IsHeapObject());
|
1676
|
+
ASSERT(!Heap::InNewSpace(*value));
|
1677
|
+
emit_rex_64(dst);
|
1678
|
+
emit(0xB8 | dst.low_bits());
|
1679
|
+
emitq(reinterpret_cast<uintptr_t>(value.location()), mode);
|
1680
|
+
}
|
1681
|
+
}
|
1682
|
+
|
1683
|
+
|
1684
|
+
void Assembler::movsxbq(Register dst, const Operand& src) {
|
1685
|
+
EnsureSpace ensure_space(this);
|
1686
|
+
last_pc_ = pc_;
|
1687
|
+
emit_rex_64(dst, src);
|
1688
|
+
emit(0x0F);
|
1689
|
+
emit(0xBE);
|
1690
|
+
emit_operand(dst, src);
|
1691
|
+
}
|
1692
|
+
|
1693
|
+
|
1694
|
+
void Assembler::movsxwq(Register dst, const Operand& src) {
|
1695
|
+
EnsureSpace ensure_space(this);
|
1696
|
+
last_pc_ = pc_;
|
1697
|
+
emit_rex_64(dst, src);
|
1698
|
+
emit(0x0F);
|
1699
|
+
emit(0xBF);
|
1700
|
+
emit_operand(dst, src);
|
1701
|
+
}
|
1702
|
+
|
1703
|
+
|
1704
|
+
void Assembler::movsxlq(Register dst, Register src) {
|
1705
|
+
EnsureSpace ensure_space(this);
|
1706
|
+
last_pc_ = pc_;
|
1707
|
+
emit_rex_64(dst, src);
|
1708
|
+
emit(0x63);
|
1709
|
+
emit_modrm(dst, src);
|
1710
|
+
}
|
1711
|
+
|
1712
|
+
|
1713
|
+
void Assembler::movsxlq(Register dst, const Operand& src) {
|
1714
|
+
EnsureSpace ensure_space(this);
|
1715
|
+
last_pc_ = pc_;
|
1716
|
+
emit_rex_64(dst, src);
|
1717
|
+
emit(0x63);
|
1718
|
+
emit_operand(dst, src);
|
1719
|
+
}
|
1720
|
+
|
1721
|
+
|
1722
|
+
void Assembler::movzxbq(Register dst, const Operand& src) {
|
1723
|
+
EnsureSpace ensure_space(this);
|
1724
|
+
last_pc_ = pc_;
|
1725
|
+
emit_optional_rex_32(dst, src);
|
1726
|
+
emit(0x0F);
|
1727
|
+
emit(0xB6);
|
1728
|
+
emit_operand(dst, src);
|
1729
|
+
}
|
1730
|
+
|
1731
|
+
|
1732
|
+
void Assembler::movzxbl(Register dst, const Operand& src) {
|
1733
|
+
EnsureSpace ensure_space(this);
|
1734
|
+
last_pc_ = pc_;
|
1735
|
+
emit_optional_rex_32(dst, src);
|
1736
|
+
emit(0x0F);
|
1737
|
+
emit(0xB6);
|
1738
|
+
emit_operand(dst, src);
|
1739
|
+
}
|
1740
|
+
|
1741
|
+
|
1742
|
+
void Assembler::movzxwq(Register dst, const Operand& src) {
|
1743
|
+
EnsureSpace ensure_space(this);
|
1744
|
+
last_pc_ = pc_;
|
1745
|
+
emit_optional_rex_32(dst, src);
|
1746
|
+
emit(0x0F);
|
1747
|
+
emit(0xB7);
|
1748
|
+
emit_operand(dst, src);
|
1749
|
+
}
|
1750
|
+
|
1751
|
+
|
1752
|
+
void Assembler::movzxwl(Register dst, const Operand& src) {
|
1753
|
+
EnsureSpace ensure_space(this);
|
1754
|
+
last_pc_ = pc_;
|
1755
|
+
emit_optional_rex_32(dst, src);
|
1756
|
+
emit(0x0F);
|
1757
|
+
emit(0xB7);
|
1758
|
+
emit_operand(dst, src);
|
1759
|
+
}
|
1760
|
+
|
1761
|
+
|
1762
|
+
void Assembler::repmovsb() {
|
1763
|
+
EnsureSpace ensure_space(this);
|
1764
|
+
last_pc_ = pc_;
|
1765
|
+
emit(0xF3);
|
1766
|
+
emit(0xA4);
|
1767
|
+
}
|
1768
|
+
|
1769
|
+
|
1770
|
+
void Assembler::repmovsw() {
|
1771
|
+
EnsureSpace ensure_space(this);
|
1772
|
+
last_pc_ = pc_;
|
1773
|
+
emit(0x66); // Operand size override.
|
1774
|
+
emit(0xF3);
|
1775
|
+
emit(0xA4);
|
1776
|
+
}
|
1777
|
+
|
1778
|
+
|
1779
|
+
void Assembler::repmovsl() {
|
1780
|
+
EnsureSpace ensure_space(this);
|
1781
|
+
last_pc_ = pc_;
|
1782
|
+
emit(0xF3);
|
1783
|
+
emit(0xA5);
|
1784
|
+
}
|
1785
|
+
|
1786
|
+
|
1787
|
+
void Assembler::repmovsq() {
|
1788
|
+
EnsureSpace ensure_space(this);
|
1789
|
+
last_pc_ = pc_;
|
1790
|
+
emit(0xF3);
|
1791
|
+
emit_rex_64();
|
1792
|
+
emit(0xA5);
|
1793
|
+
}
|
1794
|
+
|
1795
|
+
|
1796
|
+
void Assembler::mul(Register src) {
|
1797
|
+
EnsureSpace ensure_space(this);
|
1798
|
+
last_pc_ = pc_;
|
1799
|
+
emit_rex_64(src);
|
1800
|
+
emit(0xF7);
|
1801
|
+
emit_modrm(0x4, src);
|
1802
|
+
}
|
1803
|
+
|
1804
|
+
|
1805
|
+
void Assembler::neg(Register dst) {
|
1806
|
+
EnsureSpace ensure_space(this);
|
1807
|
+
last_pc_ = pc_;
|
1808
|
+
emit_rex_64(dst);
|
1809
|
+
emit(0xF7);
|
1810
|
+
emit_modrm(0x3, dst);
|
1811
|
+
}
|
1812
|
+
|
1813
|
+
|
1814
|
+
void Assembler::negl(Register dst) {
|
1815
|
+
EnsureSpace ensure_space(this);
|
1816
|
+
last_pc_ = pc_;
|
1817
|
+
emit_optional_rex_32(dst);
|
1818
|
+
emit(0xF7);
|
1819
|
+
emit_modrm(0x3, dst);
|
1820
|
+
}
|
1821
|
+
|
1822
|
+
|
1823
|
+
void Assembler::neg(const Operand& dst) {
|
1824
|
+
EnsureSpace ensure_space(this);
|
1825
|
+
last_pc_ = pc_;
|
1826
|
+
emit_rex_64(dst);
|
1827
|
+
emit(0xF7);
|
1828
|
+
emit_operand(3, dst);
|
1829
|
+
}
|
1830
|
+
|
1831
|
+
|
1832
|
+
void Assembler::nop() {
|
1833
|
+
EnsureSpace ensure_space(this);
|
1834
|
+
last_pc_ = pc_;
|
1835
|
+
emit(0x90);
|
1836
|
+
}
|
1837
|
+
|
1838
|
+
|
1839
|
+
void Assembler::not_(Register dst) {
|
1840
|
+
EnsureSpace ensure_space(this);
|
1841
|
+
last_pc_ = pc_;
|
1842
|
+
emit_rex_64(dst);
|
1843
|
+
emit(0xF7);
|
1844
|
+
emit_modrm(0x2, dst);
|
1845
|
+
}
|
1846
|
+
|
1847
|
+
|
1848
|
+
void Assembler::not_(const Operand& dst) {
|
1849
|
+
EnsureSpace ensure_space(this);
|
1850
|
+
last_pc_ = pc_;
|
1851
|
+
emit_rex_64(dst);
|
1852
|
+
emit(0xF7);
|
1853
|
+
emit_operand(2, dst);
|
1854
|
+
}
|
1855
|
+
|
1856
|
+
|
1857
|
+
void Assembler::notl(Register dst) {
|
1858
|
+
EnsureSpace ensure_space(this);
|
1859
|
+
last_pc_ = pc_;
|
1860
|
+
emit_optional_rex_32(dst);
|
1861
|
+
emit(0xF7);
|
1862
|
+
emit_modrm(0x2, dst);
|
1863
|
+
}
|
1864
|
+
|
1865
|
+
|
1866
|
+
void Assembler::nop(int n) {
|
1867
|
+
// The recommended muti-byte sequences of NOP instructions from the Intel 64
|
1868
|
+
// and IA-32 Architectures Software Developer's Manual.
|
1869
|
+
//
|
1870
|
+
// Length Assembly Byte Sequence
|
1871
|
+
// 2 bytes 66 NOP 66 90H
|
1872
|
+
// 3 bytes NOP DWORD ptr [EAX] 0F 1F 00H
|
1873
|
+
// 4 bytes NOP DWORD ptr [EAX + 00H] 0F 1F 40 00H
|
1874
|
+
// 5 bytes NOP DWORD ptr [EAX + EAX*1 + 00H] 0F 1F 44 00 00H
|
1875
|
+
// 6 bytes 66 NOP DWORD ptr [EAX + EAX*1 + 00H] 66 0F 1F 44 00 00H
|
1876
|
+
// 7 bytes NOP DWORD ptr [EAX + 00000000H] 0F 1F 80 00 00 00 00H
|
1877
|
+
// 8 bytes NOP DWORD ptr [EAX + EAX*1 + 00000000H] 0F 1F 84 00 00 00 00 00H
|
1878
|
+
// 9 bytes 66 NOP DWORD ptr [EAX + EAX*1 + 66 0F 1F 84 00 00 00 00
|
1879
|
+
// 00000000H] 00H
|
1880
|
+
|
1881
|
+
ASSERT(1 <= n);
|
1882
|
+
ASSERT(n <= 9);
|
1883
|
+
EnsureSpace ensure_space(this);
|
1884
|
+
last_pc_ = pc_;
|
1885
|
+
switch (n) {
|
1886
|
+
case 1:
|
1887
|
+
emit(0x90);
|
1888
|
+
return;
|
1889
|
+
case 2:
|
1890
|
+
emit(0x66);
|
1891
|
+
emit(0x90);
|
1892
|
+
return;
|
1893
|
+
case 3:
|
1894
|
+
emit(0x0f);
|
1895
|
+
emit(0x1f);
|
1896
|
+
emit(0x00);
|
1897
|
+
return;
|
1898
|
+
case 4:
|
1899
|
+
emit(0x0f);
|
1900
|
+
emit(0x1f);
|
1901
|
+
emit(0x40);
|
1902
|
+
emit(0x00);
|
1903
|
+
return;
|
1904
|
+
case 5:
|
1905
|
+
emit(0x0f);
|
1906
|
+
emit(0x1f);
|
1907
|
+
emit(0x44);
|
1908
|
+
emit(0x00);
|
1909
|
+
emit(0x00);
|
1910
|
+
return;
|
1911
|
+
case 6:
|
1912
|
+
emit(0x66);
|
1913
|
+
emit(0x0f);
|
1914
|
+
emit(0x1f);
|
1915
|
+
emit(0x44);
|
1916
|
+
emit(0x00);
|
1917
|
+
emit(0x00);
|
1918
|
+
return;
|
1919
|
+
case 7:
|
1920
|
+
emit(0x0f);
|
1921
|
+
emit(0x1f);
|
1922
|
+
emit(0x80);
|
1923
|
+
emit(0x00);
|
1924
|
+
emit(0x00);
|
1925
|
+
emit(0x00);
|
1926
|
+
emit(0x00);
|
1927
|
+
return;
|
1928
|
+
case 8:
|
1929
|
+
emit(0x0f);
|
1930
|
+
emit(0x1f);
|
1931
|
+
emit(0x84);
|
1932
|
+
emit(0x00);
|
1933
|
+
emit(0x00);
|
1934
|
+
emit(0x00);
|
1935
|
+
emit(0x00);
|
1936
|
+
emit(0x00);
|
1937
|
+
return;
|
1938
|
+
case 9:
|
1939
|
+
emit(0x66);
|
1940
|
+
emit(0x0f);
|
1941
|
+
emit(0x1f);
|
1942
|
+
emit(0x84);
|
1943
|
+
emit(0x00);
|
1944
|
+
emit(0x00);
|
1945
|
+
emit(0x00);
|
1946
|
+
emit(0x00);
|
1947
|
+
emit(0x00);
|
1948
|
+
return;
|
1949
|
+
}
|
1950
|
+
}
|
1951
|
+
|
1952
|
+
|
1953
|
+
void Assembler::pop(Register dst) {
|
1954
|
+
EnsureSpace ensure_space(this);
|
1955
|
+
last_pc_ = pc_;
|
1956
|
+
emit_optional_rex_32(dst);
|
1957
|
+
emit(0x58 | dst.low_bits());
|
1958
|
+
}
|
1959
|
+
|
1960
|
+
|
1961
|
+
void Assembler::pop(const Operand& dst) {
|
1962
|
+
EnsureSpace ensure_space(this);
|
1963
|
+
last_pc_ = pc_;
|
1964
|
+
emit_optional_rex_32(dst);
|
1965
|
+
emit(0x8F);
|
1966
|
+
emit_operand(0, dst);
|
1967
|
+
}
|
1968
|
+
|
1969
|
+
|
1970
|
+
void Assembler::popfq() {
|
1971
|
+
EnsureSpace ensure_space(this);
|
1972
|
+
last_pc_ = pc_;
|
1973
|
+
emit(0x9D);
|
1974
|
+
}
|
1975
|
+
|
1976
|
+
|
1977
|
+
void Assembler::push(Register src) {
|
1978
|
+
EnsureSpace ensure_space(this);
|
1979
|
+
last_pc_ = pc_;
|
1980
|
+
emit_optional_rex_32(src);
|
1981
|
+
emit(0x50 | src.low_bits());
|
1982
|
+
}
|
1983
|
+
|
1984
|
+
|
1985
|
+
void Assembler::push(const Operand& src) {
|
1986
|
+
EnsureSpace ensure_space(this);
|
1987
|
+
last_pc_ = pc_;
|
1988
|
+
emit_optional_rex_32(src);
|
1989
|
+
emit(0xFF);
|
1990
|
+
emit_operand(6, src);
|
1991
|
+
}
|
1992
|
+
|
1993
|
+
|
1994
|
+
void Assembler::push(Immediate value) {
|
1995
|
+
EnsureSpace ensure_space(this);
|
1996
|
+
last_pc_ = pc_;
|
1997
|
+
if (is_int8(value.value_)) {
|
1998
|
+
emit(0x6A);
|
1999
|
+
emit(value.value_); // Emit low byte of value.
|
2000
|
+
} else {
|
2001
|
+
emit(0x68);
|
2002
|
+
emitl(value.value_);
|
2003
|
+
}
|
2004
|
+
}
|
2005
|
+
|
2006
|
+
|
2007
|
+
void Assembler::push_imm32(int32_t imm32) {
|
2008
|
+
EnsureSpace ensure_space(this);
|
2009
|
+
last_pc_ = pc_;
|
2010
|
+
emit(0x68);
|
2011
|
+
emitl(imm32);
|
2012
|
+
}
|
2013
|
+
|
2014
|
+
|
2015
|
+
void Assembler::pushfq() {
|
2016
|
+
EnsureSpace ensure_space(this);
|
2017
|
+
last_pc_ = pc_;
|
2018
|
+
emit(0x9C);
|
2019
|
+
}
|
2020
|
+
|
2021
|
+
|
2022
|
+
void Assembler::rdtsc() {
|
2023
|
+
EnsureSpace ensure_space(this);
|
2024
|
+
last_pc_ = pc_;
|
2025
|
+
emit(0x0F);
|
2026
|
+
emit(0x31);
|
2027
|
+
}
|
2028
|
+
|
2029
|
+
|
2030
|
+
void Assembler::ret(int imm16) {
|
2031
|
+
EnsureSpace ensure_space(this);
|
2032
|
+
last_pc_ = pc_;
|
2033
|
+
ASSERT(is_uint16(imm16));
|
2034
|
+
if (imm16 == 0) {
|
2035
|
+
emit(0xC3);
|
2036
|
+
} else {
|
2037
|
+
emit(0xC2);
|
2038
|
+
emit(imm16 & 0xFF);
|
2039
|
+
emit((imm16 >> 8) & 0xFF);
|
2040
|
+
}
|
2041
|
+
}
|
2042
|
+
|
2043
|
+
|
2044
|
+
void Assembler::setcc(Condition cc, Register reg) {
|
2045
|
+
if (cc > last_condition) {
|
2046
|
+
movb(reg, Immediate(cc == always ? 1 : 0));
|
2047
|
+
return;
|
2048
|
+
}
|
2049
|
+
EnsureSpace ensure_space(this);
|
2050
|
+
last_pc_ = pc_;
|
2051
|
+
ASSERT(is_uint4(cc));
|
2052
|
+
if (reg.code() > 3) { // Use x64 byte registers, where different.
|
2053
|
+
emit_rex_32(reg);
|
2054
|
+
}
|
2055
|
+
emit(0x0F);
|
2056
|
+
emit(0x90 | cc);
|
2057
|
+
emit_modrm(0x0, reg);
|
2058
|
+
}
|
2059
|
+
|
2060
|
+
|
2061
|
+
void Assembler::shld(Register dst, Register src) {
|
2062
|
+
EnsureSpace ensure_space(this);
|
2063
|
+
last_pc_ = pc_;
|
2064
|
+
emit_rex_64(src, dst);
|
2065
|
+
emit(0x0F);
|
2066
|
+
emit(0xA5);
|
2067
|
+
emit_modrm(src, dst);
|
2068
|
+
}
|
2069
|
+
|
2070
|
+
|
2071
|
+
void Assembler::shrd(Register dst, Register src) {
|
2072
|
+
EnsureSpace ensure_space(this);
|
2073
|
+
last_pc_ = pc_;
|
2074
|
+
emit_rex_64(src, dst);
|
2075
|
+
emit(0x0F);
|
2076
|
+
emit(0xAD);
|
2077
|
+
emit_modrm(src, dst);
|
2078
|
+
}
|
2079
|
+
|
2080
|
+
|
2081
|
+
void Assembler::xchg(Register dst, Register src) {
|
2082
|
+
EnsureSpace ensure_space(this);
|
2083
|
+
last_pc_ = pc_;
|
2084
|
+
if (src.is(rax) || dst.is(rax)) { // Single-byte encoding
|
2085
|
+
Register other = src.is(rax) ? dst : src;
|
2086
|
+
emit_rex_64(other);
|
2087
|
+
emit(0x90 | other.low_bits());
|
2088
|
+
} else if (dst.low_bits() == 4) {
|
2089
|
+
emit_rex_64(dst, src);
|
2090
|
+
emit(0x87);
|
2091
|
+
emit_modrm(dst, src);
|
2092
|
+
} else {
|
2093
|
+
emit_rex_64(src, dst);
|
2094
|
+
emit(0x87);
|
2095
|
+
emit_modrm(src, dst);
|
2096
|
+
}
|
2097
|
+
}
|
2098
|
+
|
2099
|
+
|
2100
|
+
void Assembler::store_rax(void* dst, RelocInfo::Mode mode) {
|
2101
|
+
EnsureSpace ensure_space(this);
|
2102
|
+
last_pc_ = pc_;
|
2103
|
+
emit(0x48); // REX.W
|
2104
|
+
emit(0xA3);
|
2105
|
+
emitq(reinterpret_cast<uintptr_t>(dst), mode);
|
2106
|
+
}
|
2107
|
+
|
2108
|
+
|
2109
|
+
void Assembler::store_rax(ExternalReference ref) {
|
2110
|
+
store_rax(ref.address(), RelocInfo::EXTERNAL_REFERENCE);
|
2111
|
+
}
|
2112
|
+
|
2113
|
+
|
2114
|
+
void Assembler::testb(Register dst, Register src) {
|
2115
|
+
EnsureSpace ensure_space(this);
|
2116
|
+
last_pc_ = pc_;
|
2117
|
+
if (src.low_bits() == 4) {
|
2118
|
+
emit_rex_32(src, dst);
|
2119
|
+
emit(0x84);
|
2120
|
+
emit_modrm(src, dst);
|
2121
|
+
} else {
|
2122
|
+
if (dst.code() > 3 || src.code() > 3) {
|
2123
|
+
// Register is not one of al, bl, cl, dl. Its encoding needs REX.
|
2124
|
+
emit_rex_32(dst, src);
|
2125
|
+
}
|
2126
|
+
emit(0x84);
|
2127
|
+
emit_modrm(dst, src);
|
2128
|
+
}
|
2129
|
+
}
|
2130
|
+
|
2131
|
+
|
2132
|
+
void Assembler::testb(Register reg, Immediate mask) {
|
2133
|
+
ASSERT(is_int8(mask.value_) || is_uint8(mask.value_));
|
2134
|
+
EnsureSpace ensure_space(this);
|
2135
|
+
last_pc_ = pc_;
|
2136
|
+
if (reg.is(rax)) {
|
2137
|
+
emit(0xA8);
|
2138
|
+
emit(mask.value_); // Low byte emitted.
|
2139
|
+
} else {
|
2140
|
+
if (reg.code() > 3) {
|
2141
|
+
// Register is not one of al, bl, cl, dl. Its encoding needs REX.
|
2142
|
+
emit_rex_32(reg);
|
2143
|
+
}
|
2144
|
+
emit(0xF6);
|
2145
|
+
emit_modrm(0x0, reg);
|
2146
|
+
emit(mask.value_); // Low byte emitted.
|
2147
|
+
}
|
2148
|
+
}
|
2149
|
+
|
2150
|
+
|
2151
|
+
void Assembler::testb(const Operand& op, Immediate mask) {
|
2152
|
+
ASSERT(is_int8(mask.value_) || is_uint8(mask.value_));
|
2153
|
+
EnsureSpace ensure_space(this);
|
2154
|
+
last_pc_ = pc_;
|
2155
|
+
emit_optional_rex_32(rax, op);
|
2156
|
+
emit(0xF6);
|
2157
|
+
emit_operand(rax, op); // Operation code 0
|
2158
|
+
emit(mask.value_); // Low byte emitted.
|
2159
|
+
}
|
2160
|
+
|
2161
|
+
|
2162
|
+
void Assembler::testb(const Operand& op, Register reg) {
|
2163
|
+
EnsureSpace ensure_space(this);
|
2164
|
+
last_pc_ = pc_;
|
2165
|
+
if (reg.code() > 3) {
|
2166
|
+
// Register is not one of al, bl, cl, dl. Its encoding needs REX.
|
2167
|
+
emit_rex_32(reg, op);
|
2168
|
+
} else {
|
2169
|
+
emit_optional_rex_32(reg, op);
|
2170
|
+
}
|
2171
|
+
emit(0x84);
|
2172
|
+
emit_operand(reg, op);
|
2173
|
+
}
|
2174
|
+
|
2175
|
+
|
2176
|
+
void Assembler::testl(Register dst, Register src) {
|
2177
|
+
EnsureSpace ensure_space(this);
|
2178
|
+
last_pc_ = pc_;
|
2179
|
+
if (src.low_bits() == 4) {
|
2180
|
+
emit_optional_rex_32(src, dst);
|
2181
|
+
emit(0x85);
|
2182
|
+
emit_modrm(src, dst);
|
2183
|
+
} else {
|
2184
|
+
emit_optional_rex_32(dst, src);
|
2185
|
+
emit(0x85);
|
2186
|
+
emit_modrm(dst, src);
|
2187
|
+
}
|
2188
|
+
}
|
2189
|
+
|
2190
|
+
|
2191
|
+
void Assembler::testl(Register reg, Immediate mask) {
|
2192
|
+
// testl with a mask that fits in the low byte is exactly testb.
|
2193
|
+
if (is_uint8(mask.value_)) {
|
2194
|
+
testb(reg, mask);
|
2195
|
+
return;
|
2196
|
+
}
|
2197
|
+
EnsureSpace ensure_space(this);
|
2198
|
+
last_pc_ = pc_;
|
2199
|
+
if (reg.is(rax)) {
|
2200
|
+
emit(0xA9);
|
2201
|
+
emit(mask);
|
2202
|
+
} else {
|
2203
|
+
emit_optional_rex_32(rax, reg);
|
2204
|
+
emit(0xF7);
|
2205
|
+
emit_modrm(0x0, reg);
|
2206
|
+
emit(mask);
|
2207
|
+
}
|
2208
|
+
}
|
2209
|
+
|
2210
|
+
|
2211
|
+
void Assembler::testl(const Operand& op, Immediate mask) {
|
2212
|
+
// testl with a mask that fits in the low byte is exactly testb.
|
2213
|
+
if (is_uint8(mask.value_)) {
|
2214
|
+
testb(op, mask);
|
2215
|
+
return;
|
2216
|
+
}
|
2217
|
+
EnsureSpace ensure_space(this);
|
2218
|
+
last_pc_ = pc_;
|
2219
|
+
emit_optional_rex_32(rax, op);
|
2220
|
+
emit(0xF7);
|
2221
|
+
emit_operand(rax, op); // Operation code 0
|
2222
|
+
emit(mask);
|
2223
|
+
}
|
2224
|
+
|
2225
|
+
|
2226
|
+
void Assembler::testq(const Operand& op, Register reg) {
|
2227
|
+
EnsureSpace ensure_space(this);
|
2228
|
+
last_pc_ = pc_;
|
2229
|
+
emit_rex_64(reg, op);
|
2230
|
+
emit(0x85);
|
2231
|
+
emit_operand(reg, op);
|
2232
|
+
}
|
2233
|
+
|
2234
|
+
|
2235
|
+
void Assembler::testq(Register dst, Register src) {
|
2236
|
+
EnsureSpace ensure_space(this);
|
2237
|
+
last_pc_ = pc_;
|
2238
|
+
if (src.low_bits() == 4) {
|
2239
|
+
emit_rex_64(src, dst);
|
2240
|
+
emit(0x85);
|
2241
|
+
emit_modrm(src, dst);
|
2242
|
+
} else {
|
2243
|
+
emit_rex_64(dst, src);
|
2244
|
+
emit(0x85);
|
2245
|
+
emit_modrm(dst, src);
|
2246
|
+
}
|
2247
|
+
}
|
2248
|
+
|
2249
|
+
|
2250
|
+
void Assembler::testq(Register dst, Immediate mask) {
|
2251
|
+
EnsureSpace ensure_space(this);
|
2252
|
+
last_pc_ = pc_;
|
2253
|
+
if (dst.is(rax)) {
|
2254
|
+
emit_rex_64();
|
2255
|
+
emit(0xA9);
|
2256
|
+
emit(mask);
|
2257
|
+
} else {
|
2258
|
+
emit_rex_64(dst);
|
2259
|
+
emit(0xF7);
|
2260
|
+
emit_modrm(0, dst);
|
2261
|
+
emit(mask);
|
2262
|
+
}
|
2263
|
+
}
|
2264
|
+
|
2265
|
+
|
2266
|
+
// FPU instructions.
|
2267
|
+
|
2268
|
+
|
2269
|
+
void Assembler::fld(int i) {
|
2270
|
+
EnsureSpace ensure_space(this);
|
2271
|
+
last_pc_ = pc_;
|
2272
|
+
emit_farith(0xD9, 0xC0, i);
|
2273
|
+
}
|
2274
|
+
|
2275
|
+
|
2276
|
+
void Assembler::fld1() {
|
2277
|
+
EnsureSpace ensure_space(this);
|
2278
|
+
last_pc_ = pc_;
|
2279
|
+
emit(0xD9);
|
2280
|
+
emit(0xE8);
|
2281
|
+
}
|
2282
|
+
|
2283
|
+
|
2284
|
+
void Assembler::fldz() {
|
2285
|
+
EnsureSpace ensure_space(this);
|
2286
|
+
last_pc_ = pc_;
|
2287
|
+
emit(0xD9);
|
2288
|
+
emit(0xEE);
|
2289
|
+
}
|
2290
|
+
|
2291
|
+
|
2292
|
+
void Assembler::fldpi() {
|
2293
|
+
EnsureSpace ensure_space(this);
|
2294
|
+
last_pc_ = pc_;
|
2295
|
+
emit(0xD9);
|
2296
|
+
emit(0xEB);
|
2297
|
+
}
|
2298
|
+
|
2299
|
+
|
2300
|
+
void Assembler::fldln2() {
|
2301
|
+
EnsureSpace ensure_space(this);
|
2302
|
+
last_pc_ = pc_;
|
2303
|
+
emit(0xD9);
|
2304
|
+
emit(0xED);
|
2305
|
+
}
|
2306
|
+
|
2307
|
+
|
2308
|
+
void Assembler::fld_s(const Operand& adr) {
|
2309
|
+
EnsureSpace ensure_space(this);
|
2310
|
+
last_pc_ = pc_;
|
2311
|
+
emit_optional_rex_32(adr);
|
2312
|
+
emit(0xD9);
|
2313
|
+
emit_operand(0, adr);
|
2314
|
+
}
|
2315
|
+
|
2316
|
+
|
2317
|
+
void Assembler::fld_d(const Operand& adr) {
|
2318
|
+
EnsureSpace ensure_space(this);
|
2319
|
+
last_pc_ = pc_;
|
2320
|
+
emit_optional_rex_32(adr);
|
2321
|
+
emit(0xDD);
|
2322
|
+
emit_operand(0, adr);
|
2323
|
+
}
|
2324
|
+
|
2325
|
+
|
2326
|
+
void Assembler::fstp_s(const Operand& adr) {
|
2327
|
+
EnsureSpace ensure_space(this);
|
2328
|
+
last_pc_ = pc_;
|
2329
|
+
emit_optional_rex_32(adr);
|
2330
|
+
emit(0xD9);
|
2331
|
+
emit_operand(3, adr);
|
2332
|
+
}
|
2333
|
+
|
2334
|
+
|
2335
|
+
void Assembler::fstp_d(const Operand& adr) {
|
2336
|
+
EnsureSpace ensure_space(this);
|
2337
|
+
last_pc_ = pc_;
|
2338
|
+
emit_optional_rex_32(adr);
|
2339
|
+
emit(0xDD);
|
2340
|
+
emit_operand(3, adr);
|
2341
|
+
}
|
2342
|
+
|
2343
|
+
|
2344
|
+
void Assembler::fstp(int index) {
|
2345
|
+
ASSERT(is_uint3(index));
|
2346
|
+
EnsureSpace ensure_space(this);
|
2347
|
+
last_pc_ = pc_;
|
2348
|
+
emit_farith(0xDD, 0xD8, index);
|
2349
|
+
}
|
2350
|
+
|
2351
|
+
|
2352
|
+
void Assembler::fild_s(const Operand& adr) {
|
2353
|
+
EnsureSpace ensure_space(this);
|
2354
|
+
last_pc_ = pc_;
|
2355
|
+
emit_optional_rex_32(adr);
|
2356
|
+
emit(0xDB);
|
2357
|
+
emit_operand(0, adr);
|
2358
|
+
}
|
2359
|
+
|
2360
|
+
|
2361
|
+
void Assembler::fild_d(const Operand& adr) {
|
2362
|
+
EnsureSpace ensure_space(this);
|
2363
|
+
last_pc_ = pc_;
|
2364
|
+
emit_optional_rex_32(adr);
|
2365
|
+
emit(0xDF);
|
2366
|
+
emit_operand(5, adr);
|
2367
|
+
}
|
2368
|
+
|
2369
|
+
|
2370
|
+
void Assembler::fistp_s(const Operand& adr) {
|
2371
|
+
EnsureSpace ensure_space(this);
|
2372
|
+
last_pc_ = pc_;
|
2373
|
+
emit_optional_rex_32(adr);
|
2374
|
+
emit(0xDB);
|
2375
|
+
emit_operand(3, adr);
|
2376
|
+
}
|
2377
|
+
|
2378
|
+
|
2379
|
+
void Assembler::fisttp_s(const Operand& adr) {
|
2380
|
+
ASSERT(CpuFeatures::IsEnabled(SSE3));
|
2381
|
+
EnsureSpace ensure_space(this);
|
2382
|
+
last_pc_ = pc_;
|
2383
|
+
emit_optional_rex_32(adr);
|
2384
|
+
emit(0xDB);
|
2385
|
+
emit_operand(1, adr);
|
2386
|
+
}
|
2387
|
+
|
2388
|
+
|
2389
|
+
void Assembler::fisttp_d(const Operand& adr) {
|
2390
|
+
ASSERT(CpuFeatures::IsEnabled(SSE3));
|
2391
|
+
EnsureSpace ensure_space(this);
|
2392
|
+
last_pc_ = pc_;
|
2393
|
+
emit_optional_rex_32(adr);
|
2394
|
+
emit(0xDD);
|
2395
|
+
emit_operand(1, adr);
|
2396
|
+
}
|
2397
|
+
|
2398
|
+
|
2399
|
+
void Assembler::fist_s(const Operand& adr) {
|
2400
|
+
EnsureSpace ensure_space(this);
|
2401
|
+
last_pc_ = pc_;
|
2402
|
+
emit_optional_rex_32(adr);
|
2403
|
+
emit(0xDB);
|
2404
|
+
emit_operand(2, adr);
|
2405
|
+
}
|
2406
|
+
|
2407
|
+
|
2408
|
+
void Assembler::fistp_d(const Operand& adr) {
|
2409
|
+
EnsureSpace ensure_space(this);
|
2410
|
+
last_pc_ = pc_;
|
2411
|
+
emit_optional_rex_32(adr);
|
2412
|
+
emit(0xDF);
|
2413
|
+
emit_operand(7, adr);
|
2414
|
+
}
|
2415
|
+
|
2416
|
+
|
2417
|
+
void Assembler::fabs() {
|
2418
|
+
EnsureSpace ensure_space(this);
|
2419
|
+
last_pc_ = pc_;
|
2420
|
+
emit(0xD9);
|
2421
|
+
emit(0xE1);
|
2422
|
+
}
|
2423
|
+
|
2424
|
+
|
2425
|
+
void Assembler::fchs() {
|
2426
|
+
EnsureSpace ensure_space(this);
|
2427
|
+
last_pc_ = pc_;
|
2428
|
+
emit(0xD9);
|
2429
|
+
emit(0xE0);
|
2430
|
+
}
|
2431
|
+
|
2432
|
+
|
2433
|
+
void Assembler::fcos() {
|
2434
|
+
EnsureSpace ensure_space(this);
|
2435
|
+
last_pc_ = pc_;
|
2436
|
+
emit(0xD9);
|
2437
|
+
emit(0xFF);
|
2438
|
+
}
|
2439
|
+
|
2440
|
+
|
2441
|
+
void Assembler::fsin() {
|
2442
|
+
EnsureSpace ensure_space(this);
|
2443
|
+
last_pc_ = pc_;
|
2444
|
+
emit(0xD9);
|
2445
|
+
emit(0xFE);
|
2446
|
+
}
|
2447
|
+
|
2448
|
+
|
2449
|
+
void Assembler::fyl2x() {
|
2450
|
+
EnsureSpace ensure_space(this);
|
2451
|
+
last_pc_ = pc_;
|
2452
|
+
emit(0xD9);
|
2453
|
+
emit(0xF1);
|
2454
|
+
}
|
2455
|
+
|
2456
|
+
|
2457
|
+
void Assembler::fadd(int i) {
|
2458
|
+
EnsureSpace ensure_space(this);
|
2459
|
+
last_pc_ = pc_;
|
2460
|
+
emit_farith(0xDC, 0xC0, i);
|
2461
|
+
}
|
2462
|
+
|
2463
|
+
|
2464
|
+
void Assembler::fsub(int i) {
|
2465
|
+
EnsureSpace ensure_space(this);
|
2466
|
+
last_pc_ = pc_;
|
2467
|
+
emit_farith(0xDC, 0xE8, i);
|
2468
|
+
}
|
2469
|
+
|
2470
|
+
|
2471
|
+
void Assembler::fisub_s(const Operand& adr) {
|
2472
|
+
EnsureSpace ensure_space(this);
|
2473
|
+
last_pc_ = pc_;
|
2474
|
+
emit_optional_rex_32(adr);
|
2475
|
+
emit(0xDA);
|
2476
|
+
emit_operand(4, adr);
|
2477
|
+
}
|
2478
|
+
|
2479
|
+
|
2480
|
+
void Assembler::fmul(int i) {
|
2481
|
+
EnsureSpace ensure_space(this);
|
2482
|
+
last_pc_ = pc_;
|
2483
|
+
emit_farith(0xDC, 0xC8, i);
|
2484
|
+
}
|
2485
|
+
|
2486
|
+
|
2487
|
+
void Assembler::fdiv(int i) {
|
2488
|
+
EnsureSpace ensure_space(this);
|
2489
|
+
last_pc_ = pc_;
|
2490
|
+
emit_farith(0xDC, 0xF8, i);
|
2491
|
+
}
|
2492
|
+
|
2493
|
+
|
2494
|
+
void Assembler::faddp(int i) {
|
2495
|
+
EnsureSpace ensure_space(this);
|
2496
|
+
last_pc_ = pc_;
|
2497
|
+
emit_farith(0xDE, 0xC0, i);
|
2498
|
+
}
|
2499
|
+
|
2500
|
+
|
2501
|
+
void Assembler::fsubp(int i) {
|
2502
|
+
EnsureSpace ensure_space(this);
|
2503
|
+
last_pc_ = pc_;
|
2504
|
+
emit_farith(0xDE, 0xE8, i);
|
2505
|
+
}
|
2506
|
+
|
2507
|
+
|
2508
|
+
void Assembler::fsubrp(int i) {
|
2509
|
+
EnsureSpace ensure_space(this);
|
2510
|
+
last_pc_ = pc_;
|
2511
|
+
emit_farith(0xDE, 0xE0, i);
|
2512
|
+
}
|
2513
|
+
|
2514
|
+
|
2515
|
+
void Assembler::fmulp(int i) {
|
2516
|
+
EnsureSpace ensure_space(this);
|
2517
|
+
last_pc_ = pc_;
|
2518
|
+
emit_farith(0xDE, 0xC8, i);
|
2519
|
+
}
|
2520
|
+
|
2521
|
+
|
2522
|
+
void Assembler::fdivp(int i) {
|
2523
|
+
EnsureSpace ensure_space(this);
|
2524
|
+
last_pc_ = pc_;
|
2525
|
+
emit_farith(0xDE, 0xF8, i);
|
2526
|
+
}
|
2527
|
+
|
2528
|
+
|
2529
|
+
void Assembler::fprem() {
|
2530
|
+
EnsureSpace ensure_space(this);
|
2531
|
+
last_pc_ = pc_;
|
2532
|
+
emit(0xD9);
|
2533
|
+
emit(0xF8);
|
2534
|
+
}
|
2535
|
+
|
2536
|
+
|
2537
|
+
void Assembler::fprem1() {
|
2538
|
+
EnsureSpace ensure_space(this);
|
2539
|
+
last_pc_ = pc_;
|
2540
|
+
emit(0xD9);
|
2541
|
+
emit(0xF5);
|
2542
|
+
}
|
2543
|
+
|
2544
|
+
|
2545
|
+
void Assembler::fxch(int i) {
|
2546
|
+
EnsureSpace ensure_space(this);
|
2547
|
+
last_pc_ = pc_;
|
2548
|
+
emit_farith(0xD9, 0xC8, i);
|
2549
|
+
}
|
2550
|
+
|
2551
|
+
|
2552
|
+
void Assembler::fincstp() {
|
2553
|
+
EnsureSpace ensure_space(this);
|
2554
|
+
last_pc_ = pc_;
|
2555
|
+
emit(0xD9);
|
2556
|
+
emit(0xF7);
|
2557
|
+
}
|
2558
|
+
|
2559
|
+
|
2560
|
+
void Assembler::ffree(int i) {
|
2561
|
+
EnsureSpace ensure_space(this);
|
2562
|
+
last_pc_ = pc_;
|
2563
|
+
emit_farith(0xDD, 0xC0, i);
|
2564
|
+
}
|
2565
|
+
|
2566
|
+
|
2567
|
+
void Assembler::ftst() {
|
2568
|
+
EnsureSpace ensure_space(this);
|
2569
|
+
last_pc_ = pc_;
|
2570
|
+
emit(0xD9);
|
2571
|
+
emit(0xE4);
|
2572
|
+
}
|
2573
|
+
|
2574
|
+
|
2575
|
+
void Assembler::fucomp(int i) {
|
2576
|
+
EnsureSpace ensure_space(this);
|
2577
|
+
last_pc_ = pc_;
|
2578
|
+
emit_farith(0xDD, 0xE8, i);
|
2579
|
+
}
|
2580
|
+
|
2581
|
+
|
2582
|
+
void Assembler::fucompp() {
|
2583
|
+
EnsureSpace ensure_space(this);
|
2584
|
+
last_pc_ = pc_;
|
2585
|
+
emit(0xDA);
|
2586
|
+
emit(0xE9);
|
2587
|
+
}
|
2588
|
+
|
2589
|
+
|
2590
|
+
void Assembler::fucomi(int i) {
|
2591
|
+
EnsureSpace ensure_space(this);
|
2592
|
+
last_pc_ = pc_;
|
2593
|
+
emit(0xDB);
|
2594
|
+
emit(0xE8 + i);
|
2595
|
+
}
|
2596
|
+
|
2597
|
+
|
2598
|
+
void Assembler::fucomip() {
|
2599
|
+
EnsureSpace ensure_space(this);
|
2600
|
+
last_pc_ = pc_;
|
2601
|
+
emit(0xDF);
|
2602
|
+
emit(0xE9);
|
2603
|
+
}
|
2604
|
+
|
2605
|
+
|
2606
|
+
void Assembler::fcompp() {
|
2607
|
+
EnsureSpace ensure_space(this);
|
2608
|
+
last_pc_ = pc_;
|
2609
|
+
emit(0xDE);
|
2610
|
+
emit(0xD9);
|
2611
|
+
}
|
2612
|
+
|
2613
|
+
|
2614
|
+
void Assembler::fnstsw_ax() {
|
2615
|
+
EnsureSpace ensure_space(this);
|
2616
|
+
last_pc_ = pc_;
|
2617
|
+
emit(0xDF);
|
2618
|
+
emit(0xE0);
|
2619
|
+
}
|
2620
|
+
|
2621
|
+
|
2622
|
+
void Assembler::fwait() {
|
2623
|
+
EnsureSpace ensure_space(this);
|
2624
|
+
last_pc_ = pc_;
|
2625
|
+
emit(0x9B);
|
2626
|
+
}
|
2627
|
+
|
2628
|
+
|
2629
|
+
void Assembler::frndint() {
|
2630
|
+
EnsureSpace ensure_space(this);
|
2631
|
+
last_pc_ = pc_;
|
2632
|
+
emit(0xD9);
|
2633
|
+
emit(0xFC);
|
2634
|
+
}
|
2635
|
+
|
2636
|
+
|
2637
|
+
void Assembler::fnclex() {
|
2638
|
+
EnsureSpace ensure_space(this);
|
2639
|
+
last_pc_ = pc_;
|
2640
|
+
emit(0xDB);
|
2641
|
+
emit(0xE2);
|
2642
|
+
}
|
2643
|
+
|
2644
|
+
|
2645
|
+
void Assembler::sahf() {
|
2646
|
+
// TODO(X64): Test for presence. Not all 64-bit intel CPU's have sahf
|
2647
|
+
// in 64-bit mode. Test CpuID.
|
2648
|
+
EnsureSpace ensure_space(this);
|
2649
|
+
last_pc_ = pc_;
|
2650
|
+
emit(0x9E);
|
2651
|
+
}
|
2652
|
+
|
2653
|
+
|
2654
|
+
void Assembler::emit_farith(int b1, int b2, int i) {
|
2655
|
+
ASSERT(is_uint8(b1) && is_uint8(b2)); // wrong opcode
|
2656
|
+
ASSERT(is_uint3(i)); // illegal stack offset
|
2657
|
+
emit(b1);
|
2658
|
+
emit(b2 + i);
|
2659
|
+
}
|
2660
|
+
|
2661
|
+
// SSE 2 operations.
|
2662
|
+
|
2663
|
+
void Assembler::movd(XMMRegister dst, Register src) {
|
2664
|
+
EnsureSpace ensure_space(this);
|
2665
|
+
last_pc_ = pc_;
|
2666
|
+
emit(0x66);
|
2667
|
+
emit_optional_rex_32(dst, src);
|
2668
|
+
emit(0x0F);
|
2669
|
+
emit(0x6E);
|
2670
|
+
emit_sse_operand(dst, src);
|
2671
|
+
}
|
2672
|
+
|
2673
|
+
|
2674
|
+
void Assembler::movd(Register dst, XMMRegister src) {
|
2675
|
+
EnsureSpace ensure_space(this);
|
2676
|
+
last_pc_ = pc_;
|
2677
|
+
emit(0x66);
|
2678
|
+
emit_optional_rex_32(src, dst);
|
2679
|
+
emit(0x0F);
|
2680
|
+
emit(0x7E);
|
2681
|
+
emit_sse_operand(src, dst);
|
2682
|
+
}
|
2683
|
+
|
2684
|
+
|
2685
|
+
void Assembler::movq(XMMRegister dst, Register src) {
|
2686
|
+
EnsureSpace ensure_space(this);
|
2687
|
+
last_pc_ = pc_;
|
2688
|
+
emit(0x66);
|
2689
|
+
emit_rex_64(dst, src);
|
2690
|
+
emit(0x0F);
|
2691
|
+
emit(0x6E);
|
2692
|
+
emit_sse_operand(dst, src);
|
2693
|
+
}
|
2694
|
+
|
2695
|
+
|
2696
|
+
void Assembler::movq(Register dst, XMMRegister src) {
|
2697
|
+
EnsureSpace ensure_space(this);
|
2698
|
+
last_pc_ = pc_;
|
2699
|
+
emit(0x66);
|
2700
|
+
emit_rex_64(src, dst);
|
2701
|
+
emit(0x0F);
|
2702
|
+
emit(0x7E);
|
2703
|
+
emit_sse_operand(src, dst);
|
2704
|
+
}
|
2705
|
+
|
2706
|
+
|
2707
|
+
void Assembler::movdqa(const Operand& dst, XMMRegister src) {
|
2708
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2709
|
+
EnsureSpace ensure_space(this);
|
2710
|
+
last_pc_ = pc_;
|
2711
|
+
emit(0x66);
|
2712
|
+
emit_rex_64(src, dst);
|
2713
|
+
emit(0x0F);
|
2714
|
+
emit(0x7F);
|
2715
|
+
emit_sse_operand(src, dst);
|
2716
|
+
}
|
2717
|
+
|
2718
|
+
|
2719
|
+
void Assembler::movdqa(XMMRegister dst, const Operand& src) {
|
2720
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2721
|
+
EnsureSpace ensure_space(this);
|
2722
|
+
last_pc_ = pc_;
|
2723
|
+
emit(0x66);
|
2724
|
+
emit_rex_64(dst, src);
|
2725
|
+
emit(0x0F);
|
2726
|
+
emit(0x6F);
|
2727
|
+
emit_sse_operand(dst, src);
|
2728
|
+
}
|
2729
|
+
|
2730
|
+
|
2731
|
+
void Assembler::extractps(Register dst, XMMRegister src, byte imm8) {
|
2732
|
+
ASSERT(is_uint2(imm8));
|
2733
|
+
EnsureSpace ensure_space(this);
|
2734
|
+
last_pc_ = pc_;
|
2735
|
+
emit(0x66);
|
2736
|
+
emit_optional_rex_32(dst, src);
|
2737
|
+
emit(0x0F);
|
2738
|
+
emit(0x3A);
|
2739
|
+
emit(0x17);
|
2740
|
+
emit_sse_operand(dst, src);
|
2741
|
+
emit(imm8);
|
2742
|
+
}
|
2743
|
+
|
2744
|
+
|
2745
|
+
void Assembler::movsd(const Operand& dst, XMMRegister src) {
|
2746
|
+
EnsureSpace ensure_space(this);
|
2747
|
+
last_pc_ = pc_;
|
2748
|
+
emit(0xF2); // double
|
2749
|
+
emit_optional_rex_32(src, dst);
|
2750
|
+
emit(0x0F);
|
2751
|
+
emit(0x11); // store
|
2752
|
+
emit_sse_operand(src, dst);
|
2753
|
+
}
|
2754
|
+
|
2755
|
+
|
2756
|
+
void Assembler::movsd(XMMRegister dst, XMMRegister src) {
|
2757
|
+
EnsureSpace ensure_space(this);
|
2758
|
+
last_pc_ = pc_;
|
2759
|
+
emit(0xF2); // double
|
2760
|
+
emit_optional_rex_32(dst, src);
|
2761
|
+
emit(0x0F);
|
2762
|
+
emit(0x10); // load
|
2763
|
+
emit_sse_operand(dst, src);
|
2764
|
+
}
|
2765
|
+
|
2766
|
+
|
2767
|
+
void Assembler::movsd(XMMRegister dst, const Operand& src) {
|
2768
|
+
EnsureSpace ensure_space(this);
|
2769
|
+
last_pc_ = pc_;
|
2770
|
+
emit(0xF2); // double
|
2771
|
+
emit_optional_rex_32(dst, src);
|
2772
|
+
emit(0x0F);
|
2773
|
+
emit(0x10); // load
|
2774
|
+
emit_sse_operand(dst, src);
|
2775
|
+
}
|
2776
|
+
|
2777
|
+
|
2778
|
+
void Assembler::movss(XMMRegister dst, const Operand& src) {
|
2779
|
+
EnsureSpace ensure_space(this);
|
2780
|
+
last_pc_ = pc_;
|
2781
|
+
emit(0xF3); // single
|
2782
|
+
emit_optional_rex_32(dst, src);
|
2783
|
+
emit(0x0F);
|
2784
|
+
emit(0x10); // load
|
2785
|
+
emit_sse_operand(dst, src);
|
2786
|
+
}
|
2787
|
+
|
2788
|
+
|
2789
|
+
void Assembler::movss(const Operand& src, XMMRegister dst) {
|
2790
|
+
EnsureSpace ensure_space(this);
|
2791
|
+
last_pc_ = pc_;
|
2792
|
+
emit(0xF3); // single
|
2793
|
+
emit_optional_rex_32(dst, src);
|
2794
|
+
emit(0x0F);
|
2795
|
+
emit(0x11); // store
|
2796
|
+
emit_sse_operand(dst, src);
|
2797
|
+
}
|
2798
|
+
|
2799
|
+
|
2800
|
+
void Assembler::cvttss2si(Register dst, const Operand& src) {
|
2801
|
+
EnsureSpace ensure_space(this);
|
2802
|
+
last_pc_ = pc_;
|
2803
|
+
emit(0xF3);
|
2804
|
+
emit_optional_rex_32(dst, src);
|
2805
|
+
emit(0x0F);
|
2806
|
+
emit(0x2C);
|
2807
|
+
emit_operand(dst, src);
|
2808
|
+
}
|
2809
|
+
|
2810
|
+
|
2811
|
+
void Assembler::cvttss2si(Register dst, XMMRegister src) {
|
2812
|
+
EnsureSpace ensure_space(this);
|
2813
|
+
last_pc_ = pc_;
|
2814
|
+
emit(0xF3);
|
2815
|
+
emit_optional_rex_32(dst, src);
|
2816
|
+
emit(0x0F);
|
2817
|
+
emit(0x2C);
|
2818
|
+
emit_sse_operand(dst, src);
|
2819
|
+
}
|
2820
|
+
|
2821
|
+
|
2822
|
+
void Assembler::cvttsd2si(Register dst, const Operand& src) {
|
2823
|
+
EnsureSpace ensure_space(this);
|
2824
|
+
last_pc_ = pc_;
|
2825
|
+
emit(0xF2);
|
2826
|
+
emit_optional_rex_32(dst, src);
|
2827
|
+
emit(0x0F);
|
2828
|
+
emit(0x2C);
|
2829
|
+
emit_operand(dst, src);
|
2830
|
+
}
|
2831
|
+
|
2832
|
+
|
2833
|
+
void Assembler::cvttsd2si(Register dst, XMMRegister src) {
|
2834
|
+
EnsureSpace ensure_space(this);
|
2835
|
+
last_pc_ = pc_;
|
2836
|
+
emit(0xF2);
|
2837
|
+
emit_optional_rex_32(dst, src);
|
2838
|
+
emit(0x0F);
|
2839
|
+
emit(0x2C);
|
2840
|
+
emit_sse_operand(dst, src);
|
2841
|
+
}
|
2842
|
+
|
2843
|
+
|
2844
|
+
void Assembler::cvttsd2siq(Register dst, XMMRegister src) {
|
2845
|
+
EnsureSpace ensure_space(this);
|
2846
|
+
last_pc_ = pc_;
|
2847
|
+
emit(0xF2);
|
2848
|
+
emit_rex_64(dst, src);
|
2849
|
+
emit(0x0F);
|
2850
|
+
emit(0x2C);
|
2851
|
+
emit_sse_operand(dst, src);
|
2852
|
+
}
|
2853
|
+
|
2854
|
+
|
2855
|
+
void Assembler::cvtlsi2sd(XMMRegister dst, const Operand& src) {
|
2856
|
+
EnsureSpace ensure_space(this);
|
2857
|
+
last_pc_ = pc_;
|
2858
|
+
emit(0xF2);
|
2859
|
+
emit_optional_rex_32(dst, src);
|
2860
|
+
emit(0x0F);
|
2861
|
+
emit(0x2A);
|
2862
|
+
emit_sse_operand(dst, src);
|
2863
|
+
}
|
2864
|
+
|
2865
|
+
|
2866
|
+
void Assembler::cvtlsi2sd(XMMRegister dst, Register src) {
|
2867
|
+
EnsureSpace ensure_space(this);
|
2868
|
+
last_pc_ = pc_;
|
2869
|
+
emit(0xF2);
|
2870
|
+
emit_optional_rex_32(dst, src);
|
2871
|
+
emit(0x0F);
|
2872
|
+
emit(0x2A);
|
2873
|
+
emit_sse_operand(dst, src);
|
2874
|
+
}
|
2875
|
+
|
2876
|
+
|
2877
|
+
void Assembler::cvtlsi2ss(XMMRegister dst, Register src) {
|
2878
|
+
EnsureSpace ensure_space(this);
|
2879
|
+
last_pc_ = pc_;
|
2880
|
+
emit(0xF3);
|
2881
|
+
emit_optional_rex_32(dst, src);
|
2882
|
+
emit(0x0F);
|
2883
|
+
emit(0x2A);
|
2884
|
+
emit_sse_operand(dst, src);
|
2885
|
+
}
|
2886
|
+
|
2887
|
+
|
2888
|
+
void Assembler::cvtqsi2sd(XMMRegister dst, Register src) {
|
2889
|
+
EnsureSpace ensure_space(this);
|
2890
|
+
last_pc_ = pc_;
|
2891
|
+
emit(0xF2);
|
2892
|
+
emit_rex_64(dst, src);
|
2893
|
+
emit(0x0F);
|
2894
|
+
emit(0x2A);
|
2895
|
+
emit_sse_operand(dst, src);
|
2896
|
+
}
|
2897
|
+
|
2898
|
+
|
2899
|
+
void Assembler::cvtss2sd(XMMRegister dst, XMMRegister src) {
|
2900
|
+
EnsureSpace ensure_space(this);
|
2901
|
+
last_pc_ = pc_;
|
2902
|
+
emit(0xF3);
|
2903
|
+
emit_optional_rex_32(dst, src);
|
2904
|
+
emit(0x0F);
|
2905
|
+
emit(0x5A);
|
2906
|
+
emit_sse_operand(dst, src);
|
2907
|
+
}
|
2908
|
+
|
2909
|
+
|
2910
|
+
void Assembler::cvtss2sd(XMMRegister dst, const Operand& src) {
|
2911
|
+
EnsureSpace ensure_space(this);
|
2912
|
+
last_pc_ = pc_;
|
2913
|
+
emit(0xF3);
|
2914
|
+
emit_optional_rex_32(dst, src);
|
2915
|
+
emit(0x0F);
|
2916
|
+
emit(0x5A);
|
2917
|
+
emit_sse_operand(dst, src);
|
2918
|
+
}
|
2919
|
+
|
2920
|
+
|
2921
|
+
void Assembler::cvtsd2ss(XMMRegister dst, XMMRegister src) {
|
2922
|
+
EnsureSpace ensure_space(this);
|
2923
|
+
last_pc_ = pc_;
|
2924
|
+
emit(0xF2);
|
2925
|
+
emit_optional_rex_32(dst, src);
|
2926
|
+
emit(0x0F);
|
2927
|
+
emit(0x5A);
|
2928
|
+
emit_sse_operand(dst, src);
|
2929
|
+
}
|
2930
|
+
|
2931
|
+
|
2932
|
+
void Assembler::cvtsd2si(Register dst, XMMRegister src) {
|
2933
|
+
EnsureSpace ensure_space(this);
|
2934
|
+
last_pc_ = pc_;
|
2935
|
+
emit(0xF2);
|
2936
|
+
emit_optional_rex_32(dst, src);
|
2937
|
+
emit(0x0F);
|
2938
|
+
emit(0x2D);
|
2939
|
+
emit_sse_operand(dst, src);
|
2940
|
+
}
|
2941
|
+
|
2942
|
+
|
2943
|
+
void Assembler::cvtsd2siq(Register dst, XMMRegister src) {
|
2944
|
+
EnsureSpace ensure_space(this);
|
2945
|
+
last_pc_ = pc_;
|
2946
|
+
emit(0xF2);
|
2947
|
+
emit_rex_64(dst, src);
|
2948
|
+
emit(0x0F);
|
2949
|
+
emit(0x2D);
|
2950
|
+
emit_sse_operand(dst, src);
|
2951
|
+
}
|
2952
|
+
|
2953
|
+
|
2954
|
+
void Assembler::addsd(XMMRegister dst, XMMRegister src) {
|
2955
|
+
EnsureSpace ensure_space(this);
|
2956
|
+
last_pc_ = pc_;
|
2957
|
+
emit(0xF2);
|
2958
|
+
emit_optional_rex_32(dst, src);
|
2959
|
+
emit(0x0F);
|
2960
|
+
emit(0x58);
|
2961
|
+
emit_sse_operand(dst, src);
|
2962
|
+
}
|
2963
|
+
|
2964
|
+
|
2965
|
+
void Assembler::mulsd(XMMRegister dst, XMMRegister src) {
|
2966
|
+
EnsureSpace ensure_space(this);
|
2967
|
+
last_pc_ = pc_;
|
2968
|
+
emit(0xF2);
|
2969
|
+
emit_optional_rex_32(dst, src);
|
2970
|
+
emit(0x0F);
|
2971
|
+
emit(0x59);
|
2972
|
+
emit_sse_operand(dst, src);
|
2973
|
+
}
|
2974
|
+
|
2975
|
+
|
2976
|
+
void Assembler::subsd(XMMRegister dst, XMMRegister src) {
|
2977
|
+
EnsureSpace ensure_space(this);
|
2978
|
+
last_pc_ = pc_;
|
2979
|
+
emit(0xF2);
|
2980
|
+
emit_optional_rex_32(dst, src);
|
2981
|
+
emit(0x0F);
|
2982
|
+
emit(0x5C);
|
2983
|
+
emit_sse_operand(dst, src);
|
2984
|
+
}
|
2985
|
+
|
2986
|
+
|
2987
|
+
void Assembler::divsd(XMMRegister dst, XMMRegister src) {
|
2988
|
+
EnsureSpace ensure_space(this);
|
2989
|
+
last_pc_ = pc_;
|
2990
|
+
emit(0xF2);
|
2991
|
+
emit_optional_rex_32(dst, src);
|
2992
|
+
emit(0x0F);
|
2993
|
+
emit(0x5E);
|
2994
|
+
emit_sse_operand(dst, src);
|
2995
|
+
}
|
2996
|
+
|
2997
|
+
|
2998
|
+
void Assembler::andpd(XMMRegister dst, XMMRegister src) {
|
2999
|
+
EnsureSpace ensure_space(this);
|
3000
|
+
last_pc_ = pc_;
|
3001
|
+
emit(0x66);
|
3002
|
+
emit_optional_rex_32(dst, src);
|
3003
|
+
emit(0x0F);
|
3004
|
+
emit(0x54);
|
3005
|
+
emit_sse_operand(dst, src);
|
3006
|
+
}
|
3007
|
+
|
3008
|
+
|
3009
|
+
void Assembler::orpd(XMMRegister dst, XMMRegister src) {
|
3010
|
+
EnsureSpace ensure_space(this);
|
3011
|
+
last_pc_ = pc_;
|
3012
|
+
emit(0x66);
|
3013
|
+
emit_optional_rex_32(dst, src);
|
3014
|
+
emit(0x0F);
|
3015
|
+
emit(0x56);
|
3016
|
+
emit_sse_operand(dst, src);
|
3017
|
+
}
|
3018
|
+
|
3019
|
+
|
3020
|
+
void Assembler::xorpd(XMMRegister dst, XMMRegister src) {
|
3021
|
+
EnsureSpace ensure_space(this);
|
3022
|
+
last_pc_ = pc_;
|
3023
|
+
emit(0x66);
|
3024
|
+
emit_optional_rex_32(dst, src);
|
3025
|
+
emit(0x0F);
|
3026
|
+
emit(0x57);
|
3027
|
+
emit_sse_operand(dst, src);
|
3028
|
+
}
|
3029
|
+
|
3030
|
+
|
3031
|
+
void Assembler::sqrtsd(XMMRegister dst, XMMRegister src) {
|
3032
|
+
EnsureSpace ensure_space(this);
|
3033
|
+
last_pc_ = pc_;
|
3034
|
+
emit(0xF2);
|
3035
|
+
emit_optional_rex_32(dst, src);
|
3036
|
+
emit(0x0F);
|
3037
|
+
emit(0x51);
|
3038
|
+
emit_sse_operand(dst, src);
|
3039
|
+
}
|
3040
|
+
|
3041
|
+
|
3042
|
+
void Assembler::ucomisd(XMMRegister dst, XMMRegister src) {
|
3043
|
+
EnsureSpace ensure_space(this);
|
3044
|
+
last_pc_ = pc_;
|
3045
|
+
emit(0x66);
|
3046
|
+
emit_optional_rex_32(dst, src);
|
3047
|
+
emit(0x0f);
|
3048
|
+
emit(0x2e);
|
3049
|
+
emit_sse_operand(dst, src);
|
3050
|
+
}
|
3051
|
+
|
3052
|
+
|
3053
|
+
void Assembler::ucomisd(XMMRegister dst, const Operand& src) {
|
3054
|
+
EnsureSpace ensure_space(this);
|
3055
|
+
last_pc_ = pc_;
|
3056
|
+
emit(0x66);
|
3057
|
+
emit_optional_rex_32(dst, src);
|
3058
|
+
emit(0x0f);
|
3059
|
+
emit(0x2e);
|
3060
|
+
emit_sse_operand(dst, src);
|
3061
|
+
}
|
3062
|
+
|
3063
|
+
|
3064
|
+
void Assembler::movmskpd(Register dst, XMMRegister src) {
|
3065
|
+
EnsureSpace ensure_space(this);
|
3066
|
+
last_pc_ = pc_;
|
3067
|
+
emit(0x66);
|
3068
|
+
emit_optional_rex_32(dst, src);
|
3069
|
+
emit(0x0f);
|
3070
|
+
emit(0x50);
|
3071
|
+
emit_sse_operand(dst, src);
|
3072
|
+
}
|
3073
|
+
|
3074
|
+
|
3075
|
+
void Assembler::emit_sse_operand(XMMRegister reg, const Operand& adr) {
|
3076
|
+
Register ireg = { reg.code() };
|
3077
|
+
emit_operand(ireg, adr);
|
3078
|
+
}
|
3079
|
+
|
3080
|
+
|
3081
|
+
void Assembler::emit_sse_operand(XMMRegister dst, XMMRegister src) {
|
3082
|
+
emit(0xC0 | (dst.low_bits() << 3) | src.low_bits());
|
3083
|
+
}
|
3084
|
+
|
3085
|
+
void Assembler::emit_sse_operand(XMMRegister dst, Register src) {
|
3086
|
+
emit(0xC0 | (dst.low_bits() << 3) | src.low_bits());
|
3087
|
+
}
|
3088
|
+
|
3089
|
+
void Assembler::emit_sse_operand(Register dst, XMMRegister src) {
|
3090
|
+
emit(0xC0 | (dst.low_bits() << 3) | src.low_bits());
|
3091
|
+
}
|
3092
|
+
|
3093
|
+
|
3094
|
+
void Assembler::db(uint8_t data) {
|
3095
|
+
EnsureSpace ensure_space(this);
|
3096
|
+
emit(data);
|
3097
|
+
}
|
3098
|
+
|
3099
|
+
|
3100
|
+
void Assembler::dd(uint32_t data) {
|
3101
|
+
EnsureSpace ensure_space(this);
|
3102
|
+
emitl(data);
|
3103
|
+
}
|
3104
|
+
|
3105
|
+
|
3106
|
+
// Relocation information implementations.
|
3107
|
+
|
3108
|
+
void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
|
3109
|
+
ASSERT(rmode != RelocInfo::NONE);
|
3110
|
+
// Don't record external references unless the heap will be serialized.
|
3111
|
+
if (rmode == RelocInfo::EXTERNAL_REFERENCE) {
|
3112
|
+
#ifdef DEBUG
|
3113
|
+
if (!Serializer::enabled()) {
|
3114
|
+
Serializer::TooLateToEnableNow();
|
3115
|
+
}
|
3116
|
+
#endif
|
3117
|
+
if (!Serializer::enabled() && !FLAG_debug_code) {
|
3118
|
+
return;
|
3119
|
+
}
|
3120
|
+
}
|
3121
|
+
RelocInfo rinfo(pc_, rmode, data);
|
3122
|
+
reloc_info_writer.Write(&rinfo);
|
3123
|
+
}
|
3124
|
+
|
3125
|
+
void Assembler::RecordJSReturn() {
|
3126
|
+
positions_recorder()->WriteRecordedPositions();
|
3127
|
+
EnsureSpace ensure_space(this);
|
3128
|
+
RecordRelocInfo(RelocInfo::JS_RETURN);
|
3129
|
+
}
|
3130
|
+
|
3131
|
+
|
3132
|
+
void Assembler::RecordDebugBreakSlot() {
|
3133
|
+
positions_recorder()->WriteRecordedPositions();
|
3134
|
+
EnsureSpace ensure_space(this);
|
3135
|
+
RecordRelocInfo(RelocInfo::DEBUG_BREAK_SLOT);
|
3136
|
+
}
|
3137
|
+
|
3138
|
+
|
3139
|
+
void Assembler::RecordComment(const char* msg, bool force) {
|
3140
|
+
if (FLAG_code_comments || force) {
|
3141
|
+
EnsureSpace ensure_space(this);
|
3142
|
+
RecordRelocInfo(RelocInfo::COMMENT, reinterpret_cast<intptr_t>(msg));
|
3143
|
+
}
|
3144
|
+
}
|
3145
|
+
|
3146
|
+
|
3147
|
+
const int RelocInfo::kApplyMask = RelocInfo::kCodeTargetMask |
|
3148
|
+
1 << RelocInfo::INTERNAL_REFERENCE;
|
3149
|
+
|
3150
|
+
|
3151
|
+
bool RelocInfo::IsCodedSpecially() {
|
3152
|
+
// The deserializer needs to know whether a pointer is specially coded. Being
|
3153
|
+
// specially coded on x64 means that it is a relative 32 bit address, as used
|
3154
|
+
// by branch instructions.
|
3155
|
+
return (1 << rmode_) & kApplyMask;
|
3156
|
+
}
|
3157
|
+
|
3158
|
+
|
3159
|
+
|
3160
|
+
} } // namespace v8::internal
|
3161
|
+
|
3162
|
+
#endif // V8_TARGET_ARCH_X64
|