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,429 @@
|
|
1
|
+
// Copyright (c) 1994-2006 Sun Microsystems Inc.
|
2
|
+
// All Rights Reserved.
|
3
|
+
//
|
4
|
+
// Redistribution and use in source and binary forms, with or without
|
5
|
+
// modification, are permitted provided that the following conditions are
|
6
|
+
// met:
|
7
|
+
//
|
8
|
+
// - Redistributions of source code must retain the above copyright notice,
|
9
|
+
// this list of conditions and the following disclaimer.
|
10
|
+
//
|
11
|
+
// - Redistribution in binary form must reproduce the above copyright
|
12
|
+
// notice, this list of conditions and the following disclaimer in the
|
13
|
+
// documentation and/or other materials provided with the distribution.
|
14
|
+
//
|
15
|
+
// - Neither the name of Sun Microsystems or the names of contributors may
|
16
|
+
// be used to endorse or promote products derived from this software without
|
17
|
+
// specific prior written permission.
|
18
|
+
//
|
19
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
20
|
+
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
21
|
+
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
22
|
+
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
23
|
+
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
24
|
+
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
25
|
+
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
26
|
+
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
27
|
+
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
28
|
+
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
29
|
+
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
30
|
+
|
31
|
+
// The original source code covered by the above license above has been
|
32
|
+
// modified significantly by Google Inc.
|
33
|
+
// Copyright 2006-2008 the V8 project authors. All rights reserved.
|
34
|
+
|
35
|
+
// A light-weight IA32 Assembler.
|
36
|
+
|
37
|
+
#ifndef V8_IA32_ASSEMBLER_IA32_INL_H_
|
38
|
+
#define V8_IA32_ASSEMBLER_IA32_INL_H_
|
39
|
+
|
40
|
+
#include "cpu.h"
|
41
|
+
#include "debug.h"
|
42
|
+
|
43
|
+
namespace v8 {
|
44
|
+
namespace internal {
|
45
|
+
|
46
|
+
|
47
|
+
// The modes possibly affected by apply must be in kApplyMask.
|
48
|
+
void RelocInfo::apply(intptr_t delta) {
|
49
|
+
if (rmode_ == RUNTIME_ENTRY || IsCodeTarget(rmode_)) {
|
50
|
+
int32_t* p = reinterpret_cast<int32_t*>(pc_);
|
51
|
+
*p -= delta; // Relocate entry.
|
52
|
+
CPU::FlushICache(p, sizeof(uint32_t));
|
53
|
+
} else if (rmode_ == JS_RETURN && IsPatchedReturnSequence()) {
|
54
|
+
// Special handling of js_return when a break point is set (call
|
55
|
+
// instruction has been inserted).
|
56
|
+
int32_t* p = reinterpret_cast<int32_t*>(pc_ + 1);
|
57
|
+
*p -= delta; // Relocate entry.
|
58
|
+
CPU::FlushICache(p, sizeof(uint32_t));
|
59
|
+
} else if (rmode_ == DEBUG_BREAK_SLOT && IsPatchedDebugBreakSlotSequence()) {
|
60
|
+
// Special handling of a debug break slot when a break point is set (call
|
61
|
+
// instruction has been inserted).
|
62
|
+
int32_t* p = reinterpret_cast<int32_t*>(pc_ + 1);
|
63
|
+
*p -= delta; // Relocate entry.
|
64
|
+
CPU::FlushICache(p, sizeof(uint32_t));
|
65
|
+
} else if (IsInternalReference(rmode_)) {
|
66
|
+
// absolute code pointer inside code object moves with the code object.
|
67
|
+
int32_t* p = reinterpret_cast<int32_t*>(pc_);
|
68
|
+
*p += delta; // Relocate entry.
|
69
|
+
CPU::FlushICache(p, sizeof(uint32_t));
|
70
|
+
}
|
71
|
+
}
|
72
|
+
|
73
|
+
|
74
|
+
Address RelocInfo::target_address() {
|
75
|
+
ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY);
|
76
|
+
return Assembler::target_address_at(pc_);
|
77
|
+
}
|
78
|
+
|
79
|
+
|
80
|
+
Address RelocInfo::target_address_address() {
|
81
|
+
ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY);
|
82
|
+
return reinterpret_cast<Address>(pc_);
|
83
|
+
}
|
84
|
+
|
85
|
+
|
86
|
+
int RelocInfo::target_address_size() {
|
87
|
+
return Assembler::kExternalTargetSize;
|
88
|
+
}
|
89
|
+
|
90
|
+
|
91
|
+
void RelocInfo::set_target_address(Address target) {
|
92
|
+
ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY);
|
93
|
+
Assembler::set_target_address_at(pc_, target);
|
94
|
+
}
|
95
|
+
|
96
|
+
|
97
|
+
Object* RelocInfo::target_object() {
|
98
|
+
ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
|
99
|
+
return Memory::Object_at(pc_);
|
100
|
+
}
|
101
|
+
|
102
|
+
|
103
|
+
Handle<Object> RelocInfo::target_object_handle(Assembler* origin) {
|
104
|
+
ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
|
105
|
+
return Memory::Object_Handle_at(pc_);
|
106
|
+
}
|
107
|
+
|
108
|
+
|
109
|
+
Object** RelocInfo::target_object_address() {
|
110
|
+
ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
|
111
|
+
return &Memory::Object_at(pc_);
|
112
|
+
}
|
113
|
+
|
114
|
+
|
115
|
+
void RelocInfo::set_target_object(Object* target) {
|
116
|
+
ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
|
117
|
+
Memory::Object_at(pc_) = target;
|
118
|
+
CPU::FlushICache(pc_, sizeof(Address));
|
119
|
+
}
|
120
|
+
|
121
|
+
|
122
|
+
Address* RelocInfo::target_reference_address() {
|
123
|
+
ASSERT(rmode_ == RelocInfo::EXTERNAL_REFERENCE);
|
124
|
+
return reinterpret_cast<Address*>(pc_);
|
125
|
+
}
|
126
|
+
|
127
|
+
|
128
|
+
Handle<JSGlobalPropertyCell> RelocInfo::target_cell_handle() {
|
129
|
+
ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL);
|
130
|
+
Address address = Memory::Address_at(pc_);
|
131
|
+
return Handle<JSGlobalPropertyCell>(
|
132
|
+
reinterpret_cast<JSGlobalPropertyCell**>(address));
|
133
|
+
}
|
134
|
+
|
135
|
+
|
136
|
+
JSGlobalPropertyCell* RelocInfo::target_cell() {
|
137
|
+
ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL);
|
138
|
+
Address address = Memory::Address_at(pc_);
|
139
|
+
Object* object = HeapObject::FromAddress(
|
140
|
+
address - JSGlobalPropertyCell::kValueOffset);
|
141
|
+
return reinterpret_cast<JSGlobalPropertyCell*>(object);
|
142
|
+
}
|
143
|
+
|
144
|
+
|
145
|
+
void RelocInfo::set_target_cell(JSGlobalPropertyCell* cell) {
|
146
|
+
ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL);
|
147
|
+
Address address = cell->address() + JSGlobalPropertyCell::kValueOffset;
|
148
|
+
Memory::Address_at(pc_) = address;
|
149
|
+
CPU::FlushICache(pc_, sizeof(Address));
|
150
|
+
}
|
151
|
+
|
152
|
+
|
153
|
+
Address RelocInfo::call_address() {
|
154
|
+
ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) ||
|
155
|
+
(IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence()));
|
156
|
+
return Assembler::target_address_at(pc_ + 1);
|
157
|
+
}
|
158
|
+
|
159
|
+
|
160
|
+
void RelocInfo::set_call_address(Address target) {
|
161
|
+
ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) ||
|
162
|
+
(IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence()));
|
163
|
+
Assembler::set_target_address_at(pc_ + 1, target);
|
164
|
+
}
|
165
|
+
|
166
|
+
|
167
|
+
Object* RelocInfo::call_object() {
|
168
|
+
return *call_object_address();
|
169
|
+
}
|
170
|
+
|
171
|
+
|
172
|
+
void RelocInfo::set_call_object(Object* target) {
|
173
|
+
*call_object_address() = target;
|
174
|
+
}
|
175
|
+
|
176
|
+
|
177
|
+
Object** RelocInfo::call_object_address() {
|
178
|
+
ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) ||
|
179
|
+
(IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence()));
|
180
|
+
return reinterpret_cast<Object**>(pc_ + 1);
|
181
|
+
}
|
182
|
+
|
183
|
+
|
184
|
+
bool RelocInfo::IsPatchedReturnSequence() {
|
185
|
+
return *pc_ == 0xE8;
|
186
|
+
}
|
187
|
+
|
188
|
+
|
189
|
+
bool RelocInfo::IsPatchedDebugBreakSlotSequence() {
|
190
|
+
return !Assembler::IsNop(pc());
|
191
|
+
}
|
192
|
+
|
193
|
+
|
194
|
+
void RelocInfo::Visit(ObjectVisitor* visitor) {
|
195
|
+
RelocInfo::Mode mode = rmode();
|
196
|
+
if (mode == RelocInfo::EMBEDDED_OBJECT) {
|
197
|
+
visitor->VisitPointer(target_object_address());
|
198
|
+
CPU::FlushICache(pc_, sizeof(Address));
|
199
|
+
} else if (RelocInfo::IsCodeTarget(mode)) {
|
200
|
+
visitor->VisitCodeTarget(this);
|
201
|
+
} else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) {
|
202
|
+
visitor->VisitGlobalPropertyCell(this);
|
203
|
+
} else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
|
204
|
+
visitor->VisitExternalReference(target_reference_address());
|
205
|
+
CPU::FlushICache(pc_, sizeof(Address));
|
206
|
+
#ifdef ENABLE_DEBUGGER_SUPPORT
|
207
|
+
} else if (Debug::has_break_points() &&
|
208
|
+
((RelocInfo::IsJSReturn(mode) &&
|
209
|
+
IsPatchedReturnSequence()) ||
|
210
|
+
(RelocInfo::IsDebugBreakSlot(mode) &&
|
211
|
+
IsPatchedDebugBreakSlotSequence()))) {
|
212
|
+
visitor->VisitDebugTarget(this);
|
213
|
+
#endif
|
214
|
+
} else if (mode == RelocInfo::RUNTIME_ENTRY) {
|
215
|
+
visitor->VisitRuntimeEntry(this);
|
216
|
+
}
|
217
|
+
}
|
218
|
+
|
219
|
+
|
220
|
+
template<typename StaticVisitor>
|
221
|
+
void RelocInfo::Visit() {
|
222
|
+
RelocInfo::Mode mode = rmode();
|
223
|
+
if (mode == RelocInfo::EMBEDDED_OBJECT) {
|
224
|
+
StaticVisitor::VisitPointer(target_object_address());
|
225
|
+
CPU::FlushICache(pc_, sizeof(Address));
|
226
|
+
} else if (RelocInfo::IsCodeTarget(mode)) {
|
227
|
+
StaticVisitor::VisitCodeTarget(this);
|
228
|
+
} else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) {
|
229
|
+
StaticVisitor::VisitGlobalPropertyCell(this);
|
230
|
+
} else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
|
231
|
+
StaticVisitor::VisitExternalReference(target_reference_address());
|
232
|
+
CPU::FlushICache(pc_, sizeof(Address));
|
233
|
+
#ifdef ENABLE_DEBUGGER_SUPPORT
|
234
|
+
} else if (Debug::has_break_points() &&
|
235
|
+
((RelocInfo::IsJSReturn(mode) &&
|
236
|
+
IsPatchedReturnSequence()) ||
|
237
|
+
(RelocInfo::IsDebugBreakSlot(mode) &&
|
238
|
+
IsPatchedDebugBreakSlotSequence()))) {
|
239
|
+
StaticVisitor::VisitDebugTarget(this);
|
240
|
+
#endif
|
241
|
+
} else if (mode == RelocInfo::RUNTIME_ENTRY) {
|
242
|
+
StaticVisitor::VisitRuntimeEntry(this);
|
243
|
+
}
|
244
|
+
}
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
Immediate::Immediate(int x) {
|
249
|
+
x_ = x;
|
250
|
+
rmode_ = RelocInfo::NONE;
|
251
|
+
}
|
252
|
+
|
253
|
+
|
254
|
+
Immediate::Immediate(const ExternalReference& ext) {
|
255
|
+
x_ = reinterpret_cast<int32_t>(ext.address());
|
256
|
+
rmode_ = RelocInfo::EXTERNAL_REFERENCE;
|
257
|
+
}
|
258
|
+
|
259
|
+
|
260
|
+
Immediate::Immediate(Label* internal_offset) {
|
261
|
+
x_ = reinterpret_cast<int32_t>(internal_offset);
|
262
|
+
rmode_ = RelocInfo::INTERNAL_REFERENCE;
|
263
|
+
}
|
264
|
+
|
265
|
+
|
266
|
+
Immediate::Immediate(Handle<Object> handle) {
|
267
|
+
// Verify all Objects referred by code are NOT in new space.
|
268
|
+
Object* obj = *handle;
|
269
|
+
ASSERT(!Heap::InNewSpace(obj));
|
270
|
+
if (obj->IsHeapObject()) {
|
271
|
+
x_ = reinterpret_cast<intptr_t>(handle.location());
|
272
|
+
rmode_ = RelocInfo::EMBEDDED_OBJECT;
|
273
|
+
} else {
|
274
|
+
// no relocation needed
|
275
|
+
x_ = reinterpret_cast<intptr_t>(obj);
|
276
|
+
rmode_ = RelocInfo::NONE;
|
277
|
+
}
|
278
|
+
}
|
279
|
+
|
280
|
+
|
281
|
+
Immediate::Immediate(Smi* value) {
|
282
|
+
x_ = reinterpret_cast<intptr_t>(value);
|
283
|
+
rmode_ = RelocInfo::NONE;
|
284
|
+
}
|
285
|
+
|
286
|
+
|
287
|
+
Immediate::Immediate(Address addr) {
|
288
|
+
x_ = reinterpret_cast<int32_t>(addr);
|
289
|
+
rmode_ = RelocInfo::NONE;
|
290
|
+
}
|
291
|
+
|
292
|
+
|
293
|
+
void Assembler::emit(uint32_t x) {
|
294
|
+
*reinterpret_cast<uint32_t*>(pc_) = x;
|
295
|
+
pc_ += sizeof(uint32_t);
|
296
|
+
}
|
297
|
+
|
298
|
+
|
299
|
+
void Assembler::emit(Handle<Object> handle) {
|
300
|
+
// Verify all Objects referred by code are NOT in new space.
|
301
|
+
Object* obj = *handle;
|
302
|
+
ASSERT(!Heap::InNewSpace(obj));
|
303
|
+
if (obj->IsHeapObject()) {
|
304
|
+
emit(reinterpret_cast<intptr_t>(handle.location()),
|
305
|
+
RelocInfo::EMBEDDED_OBJECT);
|
306
|
+
} else {
|
307
|
+
// no relocation needed
|
308
|
+
emit(reinterpret_cast<intptr_t>(obj));
|
309
|
+
}
|
310
|
+
}
|
311
|
+
|
312
|
+
|
313
|
+
void Assembler::emit(uint32_t x, RelocInfo::Mode rmode) {
|
314
|
+
if (rmode != RelocInfo::NONE) RecordRelocInfo(rmode);
|
315
|
+
emit(x);
|
316
|
+
}
|
317
|
+
|
318
|
+
|
319
|
+
void Assembler::emit(const Immediate& x) {
|
320
|
+
if (x.rmode_ == RelocInfo::INTERNAL_REFERENCE) {
|
321
|
+
Label* label = reinterpret_cast<Label*>(x.x_);
|
322
|
+
emit_code_relative_offset(label);
|
323
|
+
return;
|
324
|
+
}
|
325
|
+
if (x.rmode_ != RelocInfo::NONE) RecordRelocInfo(x.rmode_);
|
326
|
+
emit(x.x_);
|
327
|
+
}
|
328
|
+
|
329
|
+
|
330
|
+
void Assembler::emit_code_relative_offset(Label* label) {
|
331
|
+
if (label->is_bound()) {
|
332
|
+
int32_t pos;
|
333
|
+
pos = label->pos() + Code::kHeaderSize - kHeapObjectTag;
|
334
|
+
emit(pos);
|
335
|
+
} else {
|
336
|
+
emit_disp(label, Displacement::CODE_RELATIVE);
|
337
|
+
}
|
338
|
+
}
|
339
|
+
|
340
|
+
|
341
|
+
void Assembler::emit_w(const Immediate& x) {
|
342
|
+
ASSERT(x.rmode_ == RelocInfo::NONE);
|
343
|
+
uint16_t value = static_cast<uint16_t>(x.x_);
|
344
|
+
reinterpret_cast<uint16_t*>(pc_)[0] = value;
|
345
|
+
pc_ += sizeof(uint16_t);
|
346
|
+
}
|
347
|
+
|
348
|
+
|
349
|
+
Address Assembler::target_address_at(Address pc) {
|
350
|
+
return pc + sizeof(int32_t) + *reinterpret_cast<int32_t*>(pc);
|
351
|
+
}
|
352
|
+
|
353
|
+
|
354
|
+
void Assembler::set_target_address_at(Address pc, Address target) {
|
355
|
+
int32_t* p = reinterpret_cast<int32_t*>(pc);
|
356
|
+
*p = target - (pc + sizeof(int32_t));
|
357
|
+
CPU::FlushICache(p, sizeof(int32_t));
|
358
|
+
}
|
359
|
+
|
360
|
+
|
361
|
+
Displacement Assembler::disp_at(Label* L) {
|
362
|
+
return Displacement(long_at(L->pos()));
|
363
|
+
}
|
364
|
+
|
365
|
+
|
366
|
+
void Assembler::disp_at_put(Label* L, Displacement disp) {
|
367
|
+
long_at_put(L->pos(), disp.data());
|
368
|
+
}
|
369
|
+
|
370
|
+
|
371
|
+
void Assembler::emit_disp(Label* L, Displacement::Type type) {
|
372
|
+
Displacement disp(L, type);
|
373
|
+
L->link_to(pc_offset());
|
374
|
+
emit(static_cast<int>(disp.data()));
|
375
|
+
}
|
376
|
+
|
377
|
+
|
378
|
+
void Operand::set_modrm(int mod, Register rm) {
|
379
|
+
ASSERT((mod & -4) == 0);
|
380
|
+
buf_[0] = mod << 6 | rm.code();
|
381
|
+
len_ = 1;
|
382
|
+
}
|
383
|
+
|
384
|
+
|
385
|
+
void Operand::set_sib(ScaleFactor scale, Register index, Register base) {
|
386
|
+
ASSERT(len_ == 1);
|
387
|
+
ASSERT((scale & -4) == 0);
|
388
|
+
// Use SIB with no index register only for base esp.
|
389
|
+
ASSERT(!index.is(esp) || base.is(esp));
|
390
|
+
buf_[1] = scale << 6 | index.code() << 3 | base.code();
|
391
|
+
len_ = 2;
|
392
|
+
}
|
393
|
+
|
394
|
+
|
395
|
+
void Operand::set_disp8(int8_t disp) {
|
396
|
+
ASSERT(len_ == 1 || len_ == 2);
|
397
|
+
*reinterpret_cast<int8_t*>(&buf_[len_++]) = disp;
|
398
|
+
}
|
399
|
+
|
400
|
+
|
401
|
+
void Operand::set_dispr(int32_t disp, RelocInfo::Mode rmode) {
|
402
|
+
ASSERT(len_ == 1 || len_ == 2);
|
403
|
+
int32_t* p = reinterpret_cast<int32_t*>(&buf_[len_]);
|
404
|
+
*p = disp;
|
405
|
+
len_ += sizeof(int32_t);
|
406
|
+
rmode_ = rmode;
|
407
|
+
}
|
408
|
+
|
409
|
+
Operand::Operand(Register reg) {
|
410
|
+
// reg
|
411
|
+
set_modrm(3, reg);
|
412
|
+
}
|
413
|
+
|
414
|
+
|
415
|
+
Operand::Operand(XMMRegister xmm_reg) {
|
416
|
+
Register reg = { xmm_reg.code() };
|
417
|
+
set_modrm(3, reg);
|
418
|
+
}
|
419
|
+
|
420
|
+
|
421
|
+
Operand::Operand(int32_t disp, RelocInfo::Mode rmode) {
|
422
|
+
// [disp/r]
|
423
|
+
set_modrm(0, ebp);
|
424
|
+
set_dispr(disp, rmode);
|
425
|
+
}
|
426
|
+
|
427
|
+
} } // namespace v8::internal
|
428
|
+
|
429
|
+
#endif // V8_IA32_ASSEMBLER_IA32_INL_H_
|
@@ -0,0 +1,2800 @@
|
|
1
|
+
// Copyright (c) 1994-2006 Sun Microsystems Inc.
|
2
|
+
// All Rights Reserved.
|
3
|
+
//
|
4
|
+
// Redistribution and use in source and binary forms, with or without
|
5
|
+
// modification, are permitted provided that the following conditions
|
6
|
+
// are met:
|
7
|
+
//
|
8
|
+
// - Redistributions of source code must retain the above copyright notice,
|
9
|
+
// this list of conditions and the following disclaimer.
|
10
|
+
//
|
11
|
+
// - Redistribution in binary form must reproduce the above copyright
|
12
|
+
// notice, this list of conditions and the following disclaimer in the
|
13
|
+
// documentation and/or other materials provided with the
|
14
|
+
// distribution.
|
15
|
+
//
|
16
|
+
// - Neither the name of Sun Microsystems or the names of contributors may
|
17
|
+
// be used to endorse or promote products derived from this software without
|
18
|
+
// specific prior written permission.
|
19
|
+
//
|
20
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
21
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
22
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
23
|
+
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
24
|
+
// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
25
|
+
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
26
|
+
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
27
|
+
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
28
|
+
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
29
|
+
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
30
|
+
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
31
|
+
// OF THE POSSIBILITY OF SUCH DAMAGE.
|
32
|
+
|
33
|
+
// The original source code covered by the above license above has been modified
|
34
|
+
// significantly by Google Inc.
|
35
|
+
// Copyright 2010 the V8 project authors. All rights reserved.
|
36
|
+
|
37
|
+
#include "v8.h"
|
38
|
+
|
39
|
+
#if defined(V8_TARGET_ARCH_IA32)
|
40
|
+
|
41
|
+
#include "disassembler.h"
|
42
|
+
#include "macro-assembler.h"
|
43
|
+
#include "serialize.h"
|
44
|
+
|
45
|
+
namespace v8 {
|
46
|
+
namespace internal {
|
47
|
+
|
48
|
+
// -----------------------------------------------------------------------------
|
49
|
+
// Implementation of CpuFeatures
|
50
|
+
|
51
|
+
// Safe default is no features.
|
52
|
+
uint64_t CpuFeatures::supported_ = 0;
|
53
|
+
uint64_t CpuFeatures::enabled_ = 0;
|
54
|
+
uint64_t CpuFeatures::found_by_runtime_probing_ = 0;
|
55
|
+
|
56
|
+
|
57
|
+
// The Probe method needs executable memory, so it uses Heap::CreateCode.
|
58
|
+
// Allocation failure is silent and leads to safe default.
|
59
|
+
void CpuFeatures::Probe(bool portable) {
|
60
|
+
ASSERT(Heap::HasBeenSetup());
|
61
|
+
ASSERT(supported_ == 0);
|
62
|
+
if (portable && Serializer::enabled()) {
|
63
|
+
supported_ |= OS::CpuFeaturesImpliedByPlatform();
|
64
|
+
return; // No features if we might serialize.
|
65
|
+
}
|
66
|
+
|
67
|
+
Assembler assm(NULL, 0);
|
68
|
+
Label cpuid, done;
|
69
|
+
#define __ assm.
|
70
|
+
// Save old esp, since we are going to modify the stack.
|
71
|
+
__ push(ebp);
|
72
|
+
__ pushfd();
|
73
|
+
__ push(ecx);
|
74
|
+
__ push(ebx);
|
75
|
+
__ mov(ebp, Operand(esp));
|
76
|
+
|
77
|
+
// If we can modify bit 21 of the EFLAGS register, then CPUID is supported.
|
78
|
+
__ pushfd();
|
79
|
+
__ pop(eax);
|
80
|
+
__ mov(edx, Operand(eax));
|
81
|
+
__ xor_(eax, 0x200000); // Flip bit 21.
|
82
|
+
__ push(eax);
|
83
|
+
__ popfd();
|
84
|
+
__ pushfd();
|
85
|
+
__ pop(eax);
|
86
|
+
__ xor_(eax, Operand(edx)); // Different if CPUID is supported.
|
87
|
+
__ j(not_zero, &cpuid);
|
88
|
+
|
89
|
+
// CPUID not supported. Clear the supported features in edx:eax.
|
90
|
+
__ xor_(eax, Operand(eax));
|
91
|
+
__ xor_(edx, Operand(edx));
|
92
|
+
__ jmp(&done);
|
93
|
+
|
94
|
+
// Invoke CPUID with 1 in eax to get feature information in
|
95
|
+
// ecx:edx. Temporarily enable CPUID support because we know it's
|
96
|
+
// safe here.
|
97
|
+
__ bind(&cpuid);
|
98
|
+
__ mov(eax, 1);
|
99
|
+
supported_ = (1 << CPUID);
|
100
|
+
{ Scope fscope(CPUID);
|
101
|
+
__ cpuid();
|
102
|
+
}
|
103
|
+
supported_ = 0;
|
104
|
+
|
105
|
+
// Move the result from ecx:edx to edx:eax and make sure to mark the
|
106
|
+
// CPUID feature as supported.
|
107
|
+
__ mov(eax, Operand(edx));
|
108
|
+
__ or_(eax, 1 << CPUID);
|
109
|
+
__ mov(edx, Operand(ecx));
|
110
|
+
|
111
|
+
// Done.
|
112
|
+
__ bind(&done);
|
113
|
+
__ mov(esp, Operand(ebp));
|
114
|
+
__ pop(ebx);
|
115
|
+
__ pop(ecx);
|
116
|
+
__ popfd();
|
117
|
+
__ pop(ebp);
|
118
|
+
__ ret(0);
|
119
|
+
#undef __
|
120
|
+
|
121
|
+
CodeDesc desc;
|
122
|
+
assm.GetCode(&desc);
|
123
|
+
|
124
|
+
Object* code;
|
125
|
+
{ MaybeObject* maybe_code = Heap::CreateCode(desc,
|
126
|
+
Code::ComputeFlags(Code::STUB),
|
127
|
+
Handle<Code>::null());
|
128
|
+
if (!maybe_code->ToObject(&code)) return;
|
129
|
+
}
|
130
|
+
if (!code->IsCode()) return;
|
131
|
+
|
132
|
+
PROFILE(CodeCreateEvent(Logger::BUILTIN_TAG,
|
133
|
+
Code::cast(code), "CpuFeatures::Probe"));
|
134
|
+
typedef uint64_t (*F0)();
|
135
|
+
F0 probe = FUNCTION_CAST<F0>(Code::cast(code)->entry());
|
136
|
+
supported_ = probe();
|
137
|
+
found_by_runtime_probing_ = supported_;
|
138
|
+
uint64_t os_guarantees = OS::CpuFeaturesImpliedByPlatform();
|
139
|
+
supported_ |= os_guarantees;
|
140
|
+
found_by_runtime_probing_ &= portable ? ~os_guarantees : 0;
|
141
|
+
}
|
142
|
+
|
143
|
+
|
144
|
+
// -----------------------------------------------------------------------------
|
145
|
+
// Implementation of Displacement
|
146
|
+
|
147
|
+
void Displacement::init(Label* L, Type type) {
|
148
|
+
ASSERT(!L->is_bound());
|
149
|
+
int next = 0;
|
150
|
+
if (L->is_linked()) {
|
151
|
+
next = L->pos();
|
152
|
+
ASSERT(next > 0); // Displacements must be at positions > 0
|
153
|
+
}
|
154
|
+
// Ensure that we _never_ overflow the next field.
|
155
|
+
ASSERT(NextField::is_valid(Assembler::kMaximalBufferSize));
|
156
|
+
data_ = NextField::encode(next) | TypeField::encode(type);
|
157
|
+
}
|
158
|
+
|
159
|
+
|
160
|
+
// -----------------------------------------------------------------------------
|
161
|
+
// Implementation of RelocInfo
|
162
|
+
|
163
|
+
|
164
|
+
const int RelocInfo::kApplyMask =
|
165
|
+
RelocInfo::kCodeTargetMask | 1 << RelocInfo::RUNTIME_ENTRY |
|
166
|
+
1 << RelocInfo::JS_RETURN | 1 << RelocInfo::INTERNAL_REFERENCE |
|
167
|
+
1 << RelocInfo::DEBUG_BREAK_SLOT;
|
168
|
+
|
169
|
+
|
170
|
+
bool RelocInfo::IsCodedSpecially() {
|
171
|
+
// The deserializer needs to know whether a pointer is specially coded. Being
|
172
|
+
// specially coded on IA32 means that it is a relative address, as used by
|
173
|
+
// branch instructions. These are also the ones that need changing when a
|
174
|
+
// code object moves.
|
175
|
+
return (1 << rmode_) & kApplyMask;
|
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
|
+
// Patch the code at the current PC with a call to the target address.
|
191
|
+
// Additional guard int3 instructions can be added if required.
|
192
|
+
void RelocInfo::PatchCodeWithCall(Address target, int guard_bytes) {
|
193
|
+
// Call instruction takes up 5 bytes and int3 takes up one byte.
|
194
|
+
static const int kCallCodeSize = 5;
|
195
|
+
int code_size = kCallCodeSize + guard_bytes;
|
196
|
+
|
197
|
+
// Create a code patcher.
|
198
|
+
CodePatcher patcher(pc_, code_size);
|
199
|
+
|
200
|
+
// Add a label for checking the size of the code used for returning.
|
201
|
+
#ifdef DEBUG
|
202
|
+
Label check_codesize;
|
203
|
+
patcher.masm()->bind(&check_codesize);
|
204
|
+
#endif
|
205
|
+
|
206
|
+
// Patch the code.
|
207
|
+
patcher.masm()->call(target, RelocInfo::NONE);
|
208
|
+
|
209
|
+
// Check that the size of the code generated is as expected.
|
210
|
+
ASSERT_EQ(kCallCodeSize,
|
211
|
+
patcher.masm()->SizeOfCodeGeneratedSince(&check_codesize));
|
212
|
+
|
213
|
+
// Add the requested number of int3 instructions after the call.
|
214
|
+
ASSERT_GE(guard_bytes, 0);
|
215
|
+
for (int i = 0; i < guard_bytes; i++) {
|
216
|
+
patcher.masm()->int3();
|
217
|
+
}
|
218
|
+
}
|
219
|
+
|
220
|
+
|
221
|
+
// -----------------------------------------------------------------------------
|
222
|
+
// Implementation of Operand
|
223
|
+
|
224
|
+
Operand::Operand(Register base, int32_t disp, RelocInfo::Mode rmode) {
|
225
|
+
// [base + disp/r]
|
226
|
+
if (disp == 0 && rmode == RelocInfo::NONE && !base.is(ebp)) {
|
227
|
+
// [base]
|
228
|
+
set_modrm(0, base);
|
229
|
+
if (base.is(esp)) set_sib(times_1, esp, base);
|
230
|
+
} else if (is_int8(disp) && rmode == RelocInfo::NONE) {
|
231
|
+
// [base + disp8]
|
232
|
+
set_modrm(1, base);
|
233
|
+
if (base.is(esp)) set_sib(times_1, esp, base);
|
234
|
+
set_disp8(disp);
|
235
|
+
} else {
|
236
|
+
// [base + disp/r]
|
237
|
+
set_modrm(2, base);
|
238
|
+
if (base.is(esp)) set_sib(times_1, esp, base);
|
239
|
+
set_dispr(disp, rmode);
|
240
|
+
}
|
241
|
+
}
|
242
|
+
|
243
|
+
|
244
|
+
Operand::Operand(Register base,
|
245
|
+
Register index,
|
246
|
+
ScaleFactor scale,
|
247
|
+
int32_t disp,
|
248
|
+
RelocInfo::Mode rmode) {
|
249
|
+
ASSERT(!index.is(esp)); // illegal addressing mode
|
250
|
+
// [base + index*scale + disp/r]
|
251
|
+
if (disp == 0 && rmode == RelocInfo::NONE && !base.is(ebp)) {
|
252
|
+
// [base + index*scale]
|
253
|
+
set_modrm(0, esp);
|
254
|
+
set_sib(scale, index, base);
|
255
|
+
} else if (is_int8(disp) && rmode == RelocInfo::NONE) {
|
256
|
+
// [base + index*scale + disp8]
|
257
|
+
set_modrm(1, esp);
|
258
|
+
set_sib(scale, index, base);
|
259
|
+
set_disp8(disp);
|
260
|
+
} else {
|
261
|
+
// [base + index*scale + disp/r]
|
262
|
+
set_modrm(2, esp);
|
263
|
+
set_sib(scale, index, base);
|
264
|
+
set_dispr(disp, rmode);
|
265
|
+
}
|
266
|
+
}
|
267
|
+
|
268
|
+
|
269
|
+
Operand::Operand(Register index,
|
270
|
+
ScaleFactor scale,
|
271
|
+
int32_t disp,
|
272
|
+
RelocInfo::Mode rmode) {
|
273
|
+
ASSERT(!index.is(esp)); // illegal addressing mode
|
274
|
+
// [index*scale + disp/r]
|
275
|
+
set_modrm(0, esp);
|
276
|
+
set_sib(scale, index, ebp);
|
277
|
+
set_dispr(disp, rmode);
|
278
|
+
}
|
279
|
+
|
280
|
+
|
281
|
+
bool Operand::is_reg(Register reg) const {
|
282
|
+
return ((buf_[0] & 0xF8) == 0xC0) // addressing mode is register only.
|
283
|
+
&& ((buf_[0] & 0x07) == reg.code()); // register codes match.
|
284
|
+
}
|
285
|
+
|
286
|
+
// -----------------------------------------------------------------------------
|
287
|
+
// Implementation of Assembler.
|
288
|
+
|
289
|
+
// Emit a single byte. Must always be inlined.
|
290
|
+
#define EMIT(x) \
|
291
|
+
*pc_++ = (x)
|
292
|
+
|
293
|
+
|
294
|
+
#ifdef GENERATED_CODE_COVERAGE
|
295
|
+
static void InitCoverageLog();
|
296
|
+
#endif
|
297
|
+
|
298
|
+
// Spare buffer.
|
299
|
+
byte* Assembler::spare_buffer_ = NULL;
|
300
|
+
|
301
|
+
Assembler::Assembler(void* buffer, int buffer_size)
|
302
|
+
: positions_recorder_(this) {
|
303
|
+
if (buffer == NULL) {
|
304
|
+
// Do our own buffer management.
|
305
|
+
if (buffer_size <= kMinimalBufferSize) {
|
306
|
+
buffer_size = kMinimalBufferSize;
|
307
|
+
|
308
|
+
if (spare_buffer_ != NULL) {
|
309
|
+
buffer = spare_buffer_;
|
310
|
+
spare_buffer_ = NULL;
|
311
|
+
}
|
312
|
+
}
|
313
|
+
if (buffer == NULL) {
|
314
|
+
buffer_ = NewArray<byte>(buffer_size);
|
315
|
+
} else {
|
316
|
+
buffer_ = static_cast<byte*>(buffer);
|
317
|
+
}
|
318
|
+
buffer_size_ = buffer_size;
|
319
|
+
own_buffer_ = true;
|
320
|
+
} else {
|
321
|
+
// Use externally provided buffer instead.
|
322
|
+
ASSERT(buffer_size > 0);
|
323
|
+
buffer_ = static_cast<byte*>(buffer);
|
324
|
+
buffer_size_ = buffer_size;
|
325
|
+
own_buffer_ = false;
|
326
|
+
}
|
327
|
+
|
328
|
+
// Clear the buffer in debug mode unless it was provided by the
|
329
|
+
// caller in which case we can't be sure it's okay to overwrite
|
330
|
+
// existing code in it; see CodePatcher::CodePatcher(...).
|
331
|
+
#ifdef DEBUG
|
332
|
+
if (own_buffer_) {
|
333
|
+
memset(buffer_, 0xCC, buffer_size); // int3
|
334
|
+
}
|
335
|
+
#endif
|
336
|
+
|
337
|
+
// Setup buffer pointers.
|
338
|
+
ASSERT(buffer_ != NULL);
|
339
|
+
pc_ = buffer_;
|
340
|
+
reloc_info_writer.Reposition(buffer_ + buffer_size, pc_);
|
341
|
+
|
342
|
+
last_pc_ = NULL;
|
343
|
+
#ifdef GENERATED_CODE_COVERAGE
|
344
|
+
InitCoverageLog();
|
345
|
+
#endif
|
346
|
+
}
|
347
|
+
|
348
|
+
|
349
|
+
Assembler::~Assembler() {
|
350
|
+
if (own_buffer_) {
|
351
|
+
if (spare_buffer_ == NULL && buffer_size_ == kMinimalBufferSize) {
|
352
|
+
spare_buffer_ = buffer_;
|
353
|
+
} else {
|
354
|
+
DeleteArray(buffer_);
|
355
|
+
}
|
356
|
+
}
|
357
|
+
}
|
358
|
+
|
359
|
+
|
360
|
+
void Assembler::GetCode(CodeDesc* desc) {
|
361
|
+
// Finalize code (at this point overflow() may be true, but the gap ensures
|
362
|
+
// that we are still not overlapping instructions and relocation info).
|
363
|
+
ASSERT(pc_ <= reloc_info_writer.pos()); // No overlap.
|
364
|
+
// Setup code descriptor.
|
365
|
+
desc->buffer = buffer_;
|
366
|
+
desc->buffer_size = buffer_size_;
|
367
|
+
desc->instr_size = pc_offset();
|
368
|
+
desc->reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos();
|
369
|
+
desc->origin = this;
|
370
|
+
|
371
|
+
Counters::reloc_info_size.Increment(desc->reloc_size);
|
372
|
+
}
|
373
|
+
|
374
|
+
|
375
|
+
void Assembler::Align(int m) {
|
376
|
+
ASSERT(IsPowerOf2(m));
|
377
|
+
while ((pc_offset() & (m - 1)) != 0) {
|
378
|
+
nop();
|
379
|
+
}
|
380
|
+
}
|
381
|
+
|
382
|
+
|
383
|
+
void Assembler::CodeTargetAlign() {
|
384
|
+
Align(16); // Preferred alignment of jump targets on ia32.
|
385
|
+
}
|
386
|
+
|
387
|
+
|
388
|
+
void Assembler::cpuid() {
|
389
|
+
ASSERT(CpuFeatures::IsEnabled(CPUID));
|
390
|
+
EnsureSpace ensure_space(this);
|
391
|
+
last_pc_ = pc_;
|
392
|
+
EMIT(0x0F);
|
393
|
+
EMIT(0xA2);
|
394
|
+
}
|
395
|
+
|
396
|
+
|
397
|
+
void Assembler::pushad() {
|
398
|
+
EnsureSpace ensure_space(this);
|
399
|
+
last_pc_ = pc_;
|
400
|
+
EMIT(0x60);
|
401
|
+
}
|
402
|
+
|
403
|
+
|
404
|
+
void Assembler::popad() {
|
405
|
+
EnsureSpace ensure_space(this);
|
406
|
+
last_pc_ = pc_;
|
407
|
+
EMIT(0x61);
|
408
|
+
}
|
409
|
+
|
410
|
+
|
411
|
+
void Assembler::pushfd() {
|
412
|
+
EnsureSpace ensure_space(this);
|
413
|
+
last_pc_ = pc_;
|
414
|
+
EMIT(0x9C);
|
415
|
+
}
|
416
|
+
|
417
|
+
|
418
|
+
void Assembler::popfd() {
|
419
|
+
EnsureSpace ensure_space(this);
|
420
|
+
last_pc_ = pc_;
|
421
|
+
EMIT(0x9D);
|
422
|
+
}
|
423
|
+
|
424
|
+
|
425
|
+
void Assembler::push(const Immediate& x) {
|
426
|
+
EnsureSpace ensure_space(this);
|
427
|
+
last_pc_ = pc_;
|
428
|
+
if (x.is_int8()) {
|
429
|
+
EMIT(0x6a);
|
430
|
+
EMIT(x.x_);
|
431
|
+
} else {
|
432
|
+
EMIT(0x68);
|
433
|
+
emit(x);
|
434
|
+
}
|
435
|
+
}
|
436
|
+
|
437
|
+
|
438
|
+
void Assembler::push_imm32(int32_t imm32) {
|
439
|
+
EnsureSpace ensure_space(this);
|
440
|
+
EMIT(0x68);
|
441
|
+
emit(imm32);
|
442
|
+
}
|
443
|
+
|
444
|
+
|
445
|
+
void Assembler::push(Register src) {
|
446
|
+
EnsureSpace ensure_space(this);
|
447
|
+
last_pc_ = pc_;
|
448
|
+
EMIT(0x50 | src.code());
|
449
|
+
}
|
450
|
+
|
451
|
+
|
452
|
+
void Assembler::push(const Operand& src) {
|
453
|
+
EnsureSpace ensure_space(this);
|
454
|
+
last_pc_ = pc_;
|
455
|
+
EMIT(0xFF);
|
456
|
+
emit_operand(esi, src);
|
457
|
+
}
|
458
|
+
|
459
|
+
|
460
|
+
void Assembler::pop(Register dst) {
|
461
|
+
ASSERT(reloc_info_writer.last_pc() != NULL);
|
462
|
+
if (FLAG_peephole_optimization && (reloc_info_writer.last_pc() <= last_pc_)) {
|
463
|
+
// (last_pc_ != NULL) is rolled into the above check.
|
464
|
+
// If a last_pc_ is set, we need to make sure that there has not been any
|
465
|
+
// relocation information generated between the last instruction and this
|
466
|
+
// pop instruction.
|
467
|
+
byte instr = last_pc_[0];
|
468
|
+
if ((instr & ~0x7) == 0x50) {
|
469
|
+
int push_reg_code = instr & 0x7;
|
470
|
+
if (push_reg_code == dst.code()) {
|
471
|
+
pc_ = last_pc_;
|
472
|
+
if (FLAG_print_peephole_optimization) {
|
473
|
+
PrintF("%d push/pop (same reg) eliminated\n", pc_offset());
|
474
|
+
}
|
475
|
+
} else {
|
476
|
+
// Convert 'push src; pop dst' to 'mov dst, src'.
|
477
|
+
last_pc_[0] = 0x8b;
|
478
|
+
Register src = { push_reg_code };
|
479
|
+
EnsureSpace ensure_space(this);
|
480
|
+
emit_operand(dst, Operand(src));
|
481
|
+
if (FLAG_print_peephole_optimization) {
|
482
|
+
PrintF("%d push/pop (reg->reg) eliminated\n", pc_offset());
|
483
|
+
}
|
484
|
+
}
|
485
|
+
last_pc_ = NULL;
|
486
|
+
return;
|
487
|
+
} else if (instr == 0xff) { // push of an operand, convert to a move
|
488
|
+
byte op1 = last_pc_[1];
|
489
|
+
// Check if the operation is really a push.
|
490
|
+
if ((op1 & 0x38) == (6 << 3)) {
|
491
|
+
op1 = (op1 & ~0x38) | static_cast<byte>(dst.code() << 3);
|
492
|
+
last_pc_[0] = 0x8b;
|
493
|
+
last_pc_[1] = op1;
|
494
|
+
last_pc_ = NULL;
|
495
|
+
if (FLAG_print_peephole_optimization) {
|
496
|
+
PrintF("%d push/pop (op->reg) eliminated\n", pc_offset());
|
497
|
+
}
|
498
|
+
return;
|
499
|
+
}
|
500
|
+
} else if ((instr == 0x89) &&
|
501
|
+
(last_pc_[1] == 0x04) &&
|
502
|
+
(last_pc_[2] == 0x24)) {
|
503
|
+
// 0x71283c 396 890424 mov [esp],eax
|
504
|
+
// 0x71283f 399 58 pop eax
|
505
|
+
if (dst.is(eax)) {
|
506
|
+
// change to
|
507
|
+
// 0x710fac 216 83c404 add esp,0x4
|
508
|
+
last_pc_[0] = 0x83;
|
509
|
+
last_pc_[1] = 0xc4;
|
510
|
+
last_pc_[2] = 0x04;
|
511
|
+
last_pc_ = NULL;
|
512
|
+
if (FLAG_print_peephole_optimization) {
|
513
|
+
PrintF("%d push/pop (mov-pop) eliminated\n", pc_offset());
|
514
|
+
}
|
515
|
+
return;
|
516
|
+
}
|
517
|
+
} else if (instr == 0x6a && dst.is(eax)) { // push of immediate 8 bit
|
518
|
+
byte imm8 = last_pc_[1];
|
519
|
+
if (imm8 == 0) {
|
520
|
+
// 6a00 push 0x0
|
521
|
+
// 58 pop eax
|
522
|
+
last_pc_[0] = 0x31;
|
523
|
+
last_pc_[1] = 0xc0;
|
524
|
+
// change to
|
525
|
+
// 31c0 xor eax,eax
|
526
|
+
last_pc_ = NULL;
|
527
|
+
if (FLAG_print_peephole_optimization) {
|
528
|
+
PrintF("%d push/pop (imm->reg) eliminated\n", pc_offset());
|
529
|
+
}
|
530
|
+
return;
|
531
|
+
} else {
|
532
|
+
// 6a00 push 0xXX
|
533
|
+
// 58 pop eax
|
534
|
+
last_pc_[0] = 0xb8;
|
535
|
+
EnsureSpace ensure_space(this);
|
536
|
+
if ((imm8 & 0x80) != 0) {
|
537
|
+
EMIT(0xff);
|
538
|
+
EMIT(0xff);
|
539
|
+
EMIT(0xff);
|
540
|
+
// change to
|
541
|
+
// b8XXffffff mov eax,0xffffffXX
|
542
|
+
} else {
|
543
|
+
EMIT(0x00);
|
544
|
+
EMIT(0x00);
|
545
|
+
EMIT(0x00);
|
546
|
+
// change to
|
547
|
+
// b8XX000000 mov eax,0x000000XX
|
548
|
+
}
|
549
|
+
last_pc_ = NULL;
|
550
|
+
if (FLAG_print_peephole_optimization) {
|
551
|
+
PrintF("%d push/pop (imm->reg) eliminated\n", pc_offset());
|
552
|
+
}
|
553
|
+
return;
|
554
|
+
}
|
555
|
+
} else if (instr == 0x68 && dst.is(eax)) { // push of immediate 32 bit
|
556
|
+
// 68XXXXXXXX push 0xXXXXXXXX
|
557
|
+
// 58 pop eax
|
558
|
+
last_pc_[0] = 0xb8;
|
559
|
+
last_pc_ = NULL;
|
560
|
+
// change to
|
561
|
+
// b8XXXXXXXX mov eax,0xXXXXXXXX
|
562
|
+
if (FLAG_print_peephole_optimization) {
|
563
|
+
PrintF("%d push/pop (imm->reg) eliminated\n", pc_offset());
|
564
|
+
}
|
565
|
+
return;
|
566
|
+
}
|
567
|
+
|
568
|
+
// Other potential patterns for peephole:
|
569
|
+
// 0x712716 102 890424 mov [esp], eax
|
570
|
+
// 0x712719 105 8b1424 mov edx, [esp]
|
571
|
+
}
|
572
|
+
EnsureSpace ensure_space(this);
|
573
|
+
last_pc_ = pc_;
|
574
|
+
EMIT(0x58 | dst.code());
|
575
|
+
}
|
576
|
+
|
577
|
+
|
578
|
+
void Assembler::pop(const Operand& dst) {
|
579
|
+
EnsureSpace ensure_space(this);
|
580
|
+
last_pc_ = pc_;
|
581
|
+
EMIT(0x8F);
|
582
|
+
emit_operand(eax, dst);
|
583
|
+
}
|
584
|
+
|
585
|
+
|
586
|
+
void Assembler::enter(const Immediate& size) {
|
587
|
+
EnsureSpace ensure_space(this);
|
588
|
+
last_pc_ = pc_;
|
589
|
+
EMIT(0xC8);
|
590
|
+
emit_w(size);
|
591
|
+
EMIT(0);
|
592
|
+
}
|
593
|
+
|
594
|
+
|
595
|
+
void Assembler::leave() {
|
596
|
+
EnsureSpace ensure_space(this);
|
597
|
+
last_pc_ = pc_;
|
598
|
+
EMIT(0xC9);
|
599
|
+
}
|
600
|
+
|
601
|
+
|
602
|
+
void Assembler::mov_b(Register dst, const Operand& src) {
|
603
|
+
ASSERT(dst.code() < 4);
|
604
|
+
EnsureSpace ensure_space(this);
|
605
|
+
last_pc_ = pc_;
|
606
|
+
EMIT(0x8A);
|
607
|
+
emit_operand(dst, src);
|
608
|
+
}
|
609
|
+
|
610
|
+
|
611
|
+
void Assembler::mov_b(const Operand& dst, int8_t imm8) {
|
612
|
+
EnsureSpace ensure_space(this);
|
613
|
+
last_pc_ = pc_;
|
614
|
+
EMIT(0xC6);
|
615
|
+
emit_operand(eax, dst);
|
616
|
+
EMIT(imm8);
|
617
|
+
}
|
618
|
+
|
619
|
+
|
620
|
+
void Assembler::mov_b(const Operand& dst, Register src) {
|
621
|
+
ASSERT(src.code() < 4);
|
622
|
+
EnsureSpace ensure_space(this);
|
623
|
+
last_pc_ = pc_;
|
624
|
+
EMIT(0x88);
|
625
|
+
emit_operand(src, dst);
|
626
|
+
}
|
627
|
+
|
628
|
+
|
629
|
+
void Assembler::mov_w(Register dst, const Operand& src) {
|
630
|
+
EnsureSpace ensure_space(this);
|
631
|
+
last_pc_ = pc_;
|
632
|
+
EMIT(0x66);
|
633
|
+
EMIT(0x8B);
|
634
|
+
emit_operand(dst, src);
|
635
|
+
}
|
636
|
+
|
637
|
+
|
638
|
+
void Assembler::mov_w(const Operand& dst, Register src) {
|
639
|
+
EnsureSpace ensure_space(this);
|
640
|
+
last_pc_ = pc_;
|
641
|
+
EMIT(0x66);
|
642
|
+
EMIT(0x89);
|
643
|
+
emit_operand(src, dst);
|
644
|
+
}
|
645
|
+
|
646
|
+
|
647
|
+
void Assembler::mov(Register dst, int32_t imm32) {
|
648
|
+
EnsureSpace ensure_space(this);
|
649
|
+
last_pc_ = pc_;
|
650
|
+
EMIT(0xB8 | dst.code());
|
651
|
+
emit(imm32);
|
652
|
+
}
|
653
|
+
|
654
|
+
|
655
|
+
void Assembler::mov(Register dst, const Immediate& x) {
|
656
|
+
EnsureSpace ensure_space(this);
|
657
|
+
last_pc_ = pc_;
|
658
|
+
EMIT(0xB8 | dst.code());
|
659
|
+
emit(x);
|
660
|
+
}
|
661
|
+
|
662
|
+
|
663
|
+
void Assembler::mov(Register dst, Handle<Object> handle) {
|
664
|
+
EnsureSpace ensure_space(this);
|
665
|
+
last_pc_ = pc_;
|
666
|
+
EMIT(0xB8 | dst.code());
|
667
|
+
emit(handle);
|
668
|
+
}
|
669
|
+
|
670
|
+
|
671
|
+
void Assembler::mov(Register dst, const Operand& src) {
|
672
|
+
EnsureSpace ensure_space(this);
|
673
|
+
last_pc_ = pc_;
|
674
|
+
EMIT(0x8B);
|
675
|
+
emit_operand(dst, src);
|
676
|
+
}
|
677
|
+
|
678
|
+
|
679
|
+
void Assembler::mov(Register dst, Register src) {
|
680
|
+
EnsureSpace ensure_space(this);
|
681
|
+
last_pc_ = pc_;
|
682
|
+
EMIT(0x89);
|
683
|
+
EMIT(0xC0 | src.code() << 3 | dst.code());
|
684
|
+
}
|
685
|
+
|
686
|
+
|
687
|
+
void Assembler::mov(const Operand& dst, const Immediate& x) {
|
688
|
+
EnsureSpace ensure_space(this);
|
689
|
+
last_pc_ = pc_;
|
690
|
+
EMIT(0xC7);
|
691
|
+
emit_operand(eax, dst);
|
692
|
+
emit(x);
|
693
|
+
}
|
694
|
+
|
695
|
+
|
696
|
+
void Assembler::mov(const Operand& dst, Handle<Object> handle) {
|
697
|
+
EnsureSpace ensure_space(this);
|
698
|
+
last_pc_ = pc_;
|
699
|
+
EMIT(0xC7);
|
700
|
+
emit_operand(eax, dst);
|
701
|
+
emit(handle);
|
702
|
+
}
|
703
|
+
|
704
|
+
|
705
|
+
void Assembler::mov(const Operand& dst, Register src) {
|
706
|
+
EnsureSpace ensure_space(this);
|
707
|
+
last_pc_ = pc_;
|
708
|
+
EMIT(0x89);
|
709
|
+
emit_operand(src, dst);
|
710
|
+
}
|
711
|
+
|
712
|
+
|
713
|
+
void Assembler::movsx_b(Register dst, const Operand& src) {
|
714
|
+
EnsureSpace ensure_space(this);
|
715
|
+
last_pc_ = pc_;
|
716
|
+
EMIT(0x0F);
|
717
|
+
EMIT(0xBE);
|
718
|
+
emit_operand(dst, src);
|
719
|
+
}
|
720
|
+
|
721
|
+
|
722
|
+
void Assembler::movsx_w(Register dst, const Operand& src) {
|
723
|
+
EnsureSpace ensure_space(this);
|
724
|
+
last_pc_ = pc_;
|
725
|
+
EMIT(0x0F);
|
726
|
+
EMIT(0xBF);
|
727
|
+
emit_operand(dst, src);
|
728
|
+
}
|
729
|
+
|
730
|
+
|
731
|
+
void Assembler::movzx_b(Register dst, const Operand& src) {
|
732
|
+
EnsureSpace ensure_space(this);
|
733
|
+
last_pc_ = pc_;
|
734
|
+
EMIT(0x0F);
|
735
|
+
EMIT(0xB6);
|
736
|
+
emit_operand(dst, src);
|
737
|
+
}
|
738
|
+
|
739
|
+
|
740
|
+
void Assembler::movzx_w(Register dst, const Operand& src) {
|
741
|
+
EnsureSpace ensure_space(this);
|
742
|
+
last_pc_ = pc_;
|
743
|
+
EMIT(0x0F);
|
744
|
+
EMIT(0xB7);
|
745
|
+
emit_operand(dst, src);
|
746
|
+
}
|
747
|
+
|
748
|
+
|
749
|
+
void Assembler::cmov(Condition cc, Register dst, int32_t imm32) {
|
750
|
+
ASSERT(CpuFeatures::IsEnabled(CMOV));
|
751
|
+
EnsureSpace ensure_space(this);
|
752
|
+
last_pc_ = pc_;
|
753
|
+
UNIMPLEMENTED();
|
754
|
+
USE(cc);
|
755
|
+
USE(dst);
|
756
|
+
USE(imm32);
|
757
|
+
}
|
758
|
+
|
759
|
+
|
760
|
+
void Assembler::cmov(Condition cc, Register dst, Handle<Object> handle) {
|
761
|
+
ASSERT(CpuFeatures::IsEnabled(CMOV));
|
762
|
+
EnsureSpace ensure_space(this);
|
763
|
+
last_pc_ = pc_;
|
764
|
+
UNIMPLEMENTED();
|
765
|
+
USE(cc);
|
766
|
+
USE(dst);
|
767
|
+
USE(handle);
|
768
|
+
}
|
769
|
+
|
770
|
+
|
771
|
+
void Assembler::cmov(Condition cc, Register dst, const Operand& src) {
|
772
|
+
ASSERT(CpuFeatures::IsEnabled(CMOV));
|
773
|
+
EnsureSpace ensure_space(this);
|
774
|
+
last_pc_ = pc_;
|
775
|
+
// Opcode: 0f 40 + cc /r.
|
776
|
+
EMIT(0x0F);
|
777
|
+
EMIT(0x40 + cc);
|
778
|
+
emit_operand(dst, src);
|
779
|
+
}
|
780
|
+
|
781
|
+
|
782
|
+
void Assembler::cld() {
|
783
|
+
EnsureSpace ensure_space(this);
|
784
|
+
last_pc_ = pc_;
|
785
|
+
EMIT(0xFC);
|
786
|
+
}
|
787
|
+
|
788
|
+
|
789
|
+
void Assembler::rep_movs() {
|
790
|
+
EnsureSpace ensure_space(this);
|
791
|
+
last_pc_ = pc_;
|
792
|
+
EMIT(0xF3);
|
793
|
+
EMIT(0xA5);
|
794
|
+
}
|
795
|
+
|
796
|
+
|
797
|
+
void Assembler::rep_stos() {
|
798
|
+
EnsureSpace ensure_space(this);
|
799
|
+
last_pc_ = pc_;
|
800
|
+
EMIT(0xF3);
|
801
|
+
EMIT(0xAB);
|
802
|
+
}
|
803
|
+
|
804
|
+
|
805
|
+
void Assembler::stos() {
|
806
|
+
EnsureSpace ensure_space(this);
|
807
|
+
last_pc_ = pc_;
|
808
|
+
EMIT(0xAB);
|
809
|
+
}
|
810
|
+
|
811
|
+
|
812
|
+
void Assembler::xchg(Register dst, Register src) {
|
813
|
+
EnsureSpace ensure_space(this);
|
814
|
+
last_pc_ = pc_;
|
815
|
+
if (src.is(eax) || dst.is(eax)) { // Single-byte encoding.
|
816
|
+
EMIT(0x90 | (src.is(eax) ? dst.code() : src.code()));
|
817
|
+
} else {
|
818
|
+
EMIT(0x87);
|
819
|
+
EMIT(0xC0 | src.code() << 3 | dst.code());
|
820
|
+
}
|
821
|
+
}
|
822
|
+
|
823
|
+
|
824
|
+
void Assembler::adc(Register dst, int32_t imm32) {
|
825
|
+
EnsureSpace ensure_space(this);
|
826
|
+
last_pc_ = pc_;
|
827
|
+
emit_arith(2, Operand(dst), Immediate(imm32));
|
828
|
+
}
|
829
|
+
|
830
|
+
|
831
|
+
void Assembler::adc(Register dst, const Operand& src) {
|
832
|
+
EnsureSpace ensure_space(this);
|
833
|
+
last_pc_ = pc_;
|
834
|
+
EMIT(0x13);
|
835
|
+
emit_operand(dst, src);
|
836
|
+
}
|
837
|
+
|
838
|
+
|
839
|
+
void Assembler::add(Register dst, const Operand& src) {
|
840
|
+
EnsureSpace ensure_space(this);
|
841
|
+
last_pc_ = pc_;
|
842
|
+
EMIT(0x03);
|
843
|
+
emit_operand(dst, src);
|
844
|
+
}
|
845
|
+
|
846
|
+
|
847
|
+
void Assembler::add(const Operand& dst, const Immediate& x) {
|
848
|
+
ASSERT(reloc_info_writer.last_pc() != NULL);
|
849
|
+
if (FLAG_peephole_optimization && (reloc_info_writer.last_pc() <= last_pc_)) {
|
850
|
+
byte instr = last_pc_[0];
|
851
|
+
if ((instr & 0xf8) == 0x50) {
|
852
|
+
// Last instruction was a push. Check whether this is a pop without a
|
853
|
+
// result.
|
854
|
+
if ((dst.is_reg(esp)) &&
|
855
|
+
(x.x_ == kPointerSize) && (x.rmode_ == RelocInfo::NONE)) {
|
856
|
+
pc_ = last_pc_;
|
857
|
+
last_pc_ = NULL;
|
858
|
+
if (FLAG_print_peephole_optimization) {
|
859
|
+
PrintF("%d push/pop(noreg) eliminated\n", pc_offset());
|
860
|
+
}
|
861
|
+
return;
|
862
|
+
}
|
863
|
+
}
|
864
|
+
}
|
865
|
+
EnsureSpace ensure_space(this);
|
866
|
+
last_pc_ = pc_;
|
867
|
+
emit_arith(0, dst, x);
|
868
|
+
}
|
869
|
+
|
870
|
+
|
871
|
+
void Assembler::and_(Register dst, int32_t imm32) {
|
872
|
+
and_(dst, Immediate(imm32));
|
873
|
+
}
|
874
|
+
|
875
|
+
|
876
|
+
void Assembler::and_(Register dst, const Immediate& x) {
|
877
|
+
EnsureSpace ensure_space(this);
|
878
|
+
last_pc_ = pc_;
|
879
|
+
emit_arith(4, Operand(dst), x);
|
880
|
+
}
|
881
|
+
|
882
|
+
|
883
|
+
void Assembler::and_(Register dst, const Operand& src) {
|
884
|
+
EnsureSpace ensure_space(this);
|
885
|
+
last_pc_ = pc_;
|
886
|
+
EMIT(0x23);
|
887
|
+
emit_operand(dst, src);
|
888
|
+
}
|
889
|
+
|
890
|
+
|
891
|
+
void Assembler::and_(const Operand& dst, const Immediate& x) {
|
892
|
+
EnsureSpace ensure_space(this);
|
893
|
+
last_pc_ = pc_;
|
894
|
+
emit_arith(4, dst, x);
|
895
|
+
}
|
896
|
+
|
897
|
+
|
898
|
+
void Assembler::and_(const Operand& dst, Register src) {
|
899
|
+
EnsureSpace ensure_space(this);
|
900
|
+
last_pc_ = pc_;
|
901
|
+
EMIT(0x21);
|
902
|
+
emit_operand(src, dst);
|
903
|
+
}
|
904
|
+
|
905
|
+
|
906
|
+
void Assembler::cmpb(const Operand& op, int8_t imm8) {
|
907
|
+
EnsureSpace ensure_space(this);
|
908
|
+
last_pc_ = pc_;
|
909
|
+
EMIT(0x80);
|
910
|
+
emit_operand(edi, op); // edi == 7
|
911
|
+
EMIT(imm8);
|
912
|
+
}
|
913
|
+
|
914
|
+
|
915
|
+
void Assembler::cmpb(const Operand& dst, Register src) {
|
916
|
+
ASSERT(src.is_byte_register());
|
917
|
+
EnsureSpace ensure_space(this);
|
918
|
+
last_pc_ = pc_;
|
919
|
+
EMIT(0x38);
|
920
|
+
emit_operand(src, dst);
|
921
|
+
}
|
922
|
+
|
923
|
+
|
924
|
+
void Assembler::cmpb(Register dst, const Operand& src) {
|
925
|
+
ASSERT(dst.is_byte_register());
|
926
|
+
EnsureSpace ensure_space(this);
|
927
|
+
last_pc_ = pc_;
|
928
|
+
EMIT(0x3A);
|
929
|
+
emit_operand(dst, src);
|
930
|
+
}
|
931
|
+
|
932
|
+
|
933
|
+
void Assembler::cmpw(const Operand& op, Immediate imm16) {
|
934
|
+
ASSERT(imm16.is_int16());
|
935
|
+
EnsureSpace ensure_space(this);
|
936
|
+
last_pc_ = pc_;
|
937
|
+
EMIT(0x66);
|
938
|
+
EMIT(0x81);
|
939
|
+
emit_operand(edi, op);
|
940
|
+
emit_w(imm16);
|
941
|
+
}
|
942
|
+
|
943
|
+
|
944
|
+
void Assembler::cmp(Register reg, int32_t imm32) {
|
945
|
+
EnsureSpace ensure_space(this);
|
946
|
+
last_pc_ = pc_;
|
947
|
+
emit_arith(7, Operand(reg), Immediate(imm32));
|
948
|
+
}
|
949
|
+
|
950
|
+
|
951
|
+
void Assembler::cmp(Register reg, Handle<Object> handle) {
|
952
|
+
EnsureSpace ensure_space(this);
|
953
|
+
last_pc_ = pc_;
|
954
|
+
emit_arith(7, Operand(reg), Immediate(handle));
|
955
|
+
}
|
956
|
+
|
957
|
+
|
958
|
+
void Assembler::cmp(Register reg, const Operand& op) {
|
959
|
+
EnsureSpace ensure_space(this);
|
960
|
+
last_pc_ = pc_;
|
961
|
+
EMIT(0x3B);
|
962
|
+
emit_operand(reg, op);
|
963
|
+
}
|
964
|
+
|
965
|
+
|
966
|
+
void Assembler::cmp(const Operand& op, const Immediate& imm) {
|
967
|
+
EnsureSpace ensure_space(this);
|
968
|
+
last_pc_ = pc_;
|
969
|
+
emit_arith(7, op, imm);
|
970
|
+
}
|
971
|
+
|
972
|
+
|
973
|
+
void Assembler::cmp(const Operand& op, Handle<Object> handle) {
|
974
|
+
EnsureSpace ensure_space(this);
|
975
|
+
last_pc_ = pc_;
|
976
|
+
emit_arith(7, op, Immediate(handle));
|
977
|
+
}
|
978
|
+
|
979
|
+
|
980
|
+
void Assembler::cmpb_al(const Operand& op) {
|
981
|
+
EnsureSpace ensure_space(this);
|
982
|
+
last_pc_ = pc_;
|
983
|
+
EMIT(0x38); // CMP r/m8, r8
|
984
|
+
emit_operand(eax, op); // eax has same code as register al.
|
985
|
+
}
|
986
|
+
|
987
|
+
|
988
|
+
void Assembler::cmpw_ax(const Operand& op) {
|
989
|
+
EnsureSpace ensure_space(this);
|
990
|
+
last_pc_ = pc_;
|
991
|
+
EMIT(0x66);
|
992
|
+
EMIT(0x39); // CMP r/m16, r16
|
993
|
+
emit_operand(eax, op); // eax has same code as register ax.
|
994
|
+
}
|
995
|
+
|
996
|
+
|
997
|
+
void Assembler::dec_b(Register dst) {
|
998
|
+
EnsureSpace ensure_space(this);
|
999
|
+
last_pc_ = pc_;
|
1000
|
+
EMIT(0xFE);
|
1001
|
+
EMIT(0xC8 | dst.code());
|
1002
|
+
}
|
1003
|
+
|
1004
|
+
|
1005
|
+
void Assembler::dec_b(const Operand& dst) {
|
1006
|
+
EnsureSpace ensure_space(this);
|
1007
|
+
last_pc_ = pc_;
|
1008
|
+
EMIT(0xFE);
|
1009
|
+
emit_operand(ecx, dst);
|
1010
|
+
}
|
1011
|
+
|
1012
|
+
|
1013
|
+
void Assembler::dec(Register dst) {
|
1014
|
+
EnsureSpace ensure_space(this);
|
1015
|
+
last_pc_ = pc_;
|
1016
|
+
EMIT(0x48 | dst.code());
|
1017
|
+
}
|
1018
|
+
|
1019
|
+
|
1020
|
+
void Assembler::dec(const Operand& dst) {
|
1021
|
+
EnsureSpace ensure_space(this);
|
1022
|
+
last_pc_ = pc_;
|
1023
|
+
EMIT(0xFF);
|
1024
|
+
emit_operand(ecx, dst);
|
1025
|
+
}
|
1026
|
+
|
1027
|
+
|
1028
|
+
void Assembler::cdq() {
|
1029
|
+
EnsureSpace ensure_space(this);
|
1030
|
+
last_pc_ = pc_;
|
1031
|
+
EMIT(0x99);
|
1032
|
+
}
|
1033
|
+
|
1034
|
+
|
1035
|
+
void Assembler::idiv(Register src) {
|
1036
|
+
EnsureSpace ensure_space(this);
|
1037
|
+
last_pc_ = pc_;
|
1038
|
+
EMIT(0xF7);
|
1039
|
+
EMIT(0xF8 | src.code());
|
1040
|
+
}
|
1041
|
+
|
1042
|
+
|
1043
|
+
void Assembler::imul(Register reg) {
|
1044
|
+
EnsureSpace ensure_space(this);
|
1045
|
+
last_pc_ = pc_;
|
1046
|
+
EMIT(0xF7);
|
1047
|
+
EMIT(0xE8 | reg.code());
|
1048
|
+
}
|
1049
|
+
|
1050
|
+
|
1051
|
+
void Assembler::imul(Register dst, const Operand& src) {
|
1052
|
+
EnsureSpace ensure_space(this);
|
1053
|
+
last_pc_ = pc_;
|
1054
|
+
EMIT(0x0F);
|
1055
|
+
EMIT(0xAF);
|
1056
|
+
emit_operand(dst, src);
|
1057
|
+
}
|
1058
|
+
|
1059
|
+
|
1060
|
+
void Assembler::imul(Register dst, Register src, int32_t imm32) {
|
1061
|
+
EnsureSpace ensure_space(this);
|
1062
|
+
last_pc_ = pc_;
|
1063
|
+
if (is_int8(imm32)) {
|
1064
|
+
EMIT(0x6B);
|
1065
|
+
EMIT(0xC0 | dst.code() << 3 | src.code());
|
1066
|
+
EMIT(imm32);
|
1067
|
+
} else {
|
1068
|
+
EMIT(0x69);
|
1069
|
+
EMIT(0xC0 | dst.code() << 3 | src.code());
|
1070
|
+
emit(imm32);
|
1071
|
+
}
|
1072
|
+
}
|
1073
|
+
|
1074
|
+
|
1075
|
+
void Assembler::inc(Register dst) {
|
1076
|
+
EnsureSpace ensure_space(this);
|
1077
|
+
last_pc_ = pc_;
|
1078
|
+
EMIT(0x40 | dst.code());
|
1079
|
+
}
|
1080
|
+
|
1081
|
+
|
1082
|
+
void Assembler::inc(const Operand& dst) {
|
1083
|
+
EnsureSpace ensure_space(this);
|
1084
|
+
last_pc_ = pc_;
|
1085
|
+
EMIT(0xFF);
|
1086
|
+
emit_operand(eax, dst);
|
1087
|
+
}
|
1088
|
+
|
1089
|
+
|
1090
|
+
void Assembler::lea(Register dst, const Operand& src) {
|
1091
|
+
EnsureSpace ensure_space(this);
|
1092
|
+
last_pc_ = pc_;
|
1093
|
+
EMIT(0x8D);
|
1094
|
+
emit_operand(dst, src);
|
1095
|
+
}
|
1096
|
+
|
1097
|
+
|
1098
|
+
void Assembler::mul(Register src) {
|
1099
|
+
EnsureSpace ensure_space(this);
|
1100
|
+
last_pc_ = pc_;
|
1101
|
+
EMIT(0xF7);
|
1102
|
+
EMIT(0xE0 | src.code());
|
1103
|
+
}
|
1104
|
+
|
1105
|
+
|
1106
|
+
void Assembler::neg(Register dst) {
|
1107
|
+
EnsureSpace ensure_space(this);
|
1108
|
+
last_pc_ = pc_;
|
1109
|
+
EMIT(0xF7);
|
1110
|
+
EMIT(0xD8 | dst.code());
|
1111
|
+
}
|
1112
|
+
|
1113
|
+
|
1114
|
+
void Assembler::not_(Register dst) {
|
1115
|
+
EnsureSpace ensure_space(this);
|
1116
|
+
last_pc_ = pc_;
|
1117
|
+
EMIT(0xF7);
|
1118
|
+
EMIT(0xD0 | dst.code());
|
1119
|
+
}
|
1120
|
+
|
1121
|
+
|
1122
|
+
void Assembler::or_(Register dst, int32_t imm32) {
|
1123
|
+
EnsureSpace ensure_space(this);
|
1124
|
+
last_pc_ = pc_;
|
1125
|
+
emit_arith(1, Operand(dst), Immediate(imm32));
|
1126
|
+
}
|
1127
|
+
|
1128
|
+
|
1129
|
+
void Assembler::or_(Register dst, const Operand& src) {
|
1130
|
+
EnsureSpace ensure_space(this);
|
1131
|
+
last_pc_ = pc_;
|
1132
|
+
EMIT(0x0B);
|
1133
|
+
emit_operand(dst, src);
|
1134
|
+
}
|
1135
|
+
|
1136
|
+
|
1137
|
+
void Assembler::or_(const Operand& dst, const Immediate& x) {
|
1138
|
+
EnsureSpace ensure_space(this);
|
1139
|
+
last_pc_ = pc_;
|
1140
|
+
emit_arith(1, dst, x);
|
1141
|
+
}
|
1142
|
+
|
1143
|
+
|
1144
|
+
void Assembler::or_(const Operand& dst, Register src) {
|
1145
|
+
EnsureSpace ensure_space(this);
|
1146
|
+
last_pc_ = pc_;
|
1147
|
+
EMIT(0x09);
|
1148
|
+
emit_operand(src, dst);
|
1149
|
+
}
|
1150
|
+
|
1151
|
+
|
1152
|
+
void Assembler::rcl(Register dst, uint8_t imm8) {
|
1153
|
+
EnsureSpace ensure_space(this);
|
1154
|
+
last_pc_ = pc_;
|
1155
|
+
ASSERT(is_uint5(imm8)); // illegal shift count
|
1156
|
+
if (imm8 == 1) {
|
1157
|
+
EMIT(0xD1);
|
1158
|
+
EMIT(0xD0 | dst.code());
|
1159
|
+
} else {
|
1160
|
+
EMIT(0xC1);
|
1161
|
+
EMIT(0xD0 | dst.code());
|
1162
|
+
EMIT(imm8);
|
1163
|
+
}
|
1164
|
+
}
|
1165
|
+
|
1166
|
+
|
1167
|
+
void Assembler::rcr(Register dst, uint8_t imm8) {
|
1168
|
+
EnsureSpace ensure_space(this);
|
1169
|
+
last_pc_ = pc_;
|
1170
|
+
ASSERT(is_uint5(imm8)); // illegal shift count
|
1171
|
+
if (imm8 == 1) {
|
1172
|
+
EMIT(0xD1);
|
1173
|
+
EMIT(0xD8 | dst.code());
|
1174
|
+
} else {
|
1175
|
+
EMIT(0xC1);
|
1176
|
+
EMIT(0xD8 | dst.code());
|
1177
|
+
EMIT(imm8);
|
1178
|
+
}
|
1179
|
+
}
|
1180
|
+
|
1181
|
+
|
1182
|
+
void Assembler::sar(Register dst, uint8_t imm8) {
|
1183
|
+
EnsureSpace ensure_space(this);
|
1184
|
+
last_pc_ = pc_;
|
1185
|
+
ASSERT(is_uint5(imm8)); // illegal shift count
|
1186
|
+
if (imm8 == 1) {
|
1187
|
+
EMIT(0xD1);
|
1188
|
+
EMIT(0xF8 | dst.code());
|
1189
|
+
} else {
|
1190
|
+
EMIT(0xC1);
|
1191
|
+
EMIT(0xF8 | dst.code());
|
1192
|
+
EMIT(imm8);
|
1193
|
+
}
|
1194
|
+
}
|
1195
|
+
|
1196
|
+
|
1197
|
+
void Assembler::sar_cl(Register dst) {
|
1198
|
+
EnsureSpace ensure_space(this);
|
1199
|
+
last_pc_ = pc_;
|
1200
|
+
EMIT(0xD3);
|
1201
|
+
EMIT(0xF8 | dst.code());
|
1202
|
+
}
|
1203
|
+
|
1204
|
+
|
1205
|
+
void Assembler::sbb(Register dst, const Operand& src) {
|
1206
|
+
EnsureSpace ensure_space(this);
|
1207
|
+
last_pc_ = pc_;
|
1208
|
+
EMIT(0x1B);
|
1209
|
+
emit_operand(dst, src);
|
1210
|
+
}
|
1211
|
+
|
1212
|
+
|
1213
|
+
void Assembler::shld(Register dst, const Operand& src) {
|
1214
|
+
EnsureSpace ensure_space(this);
|
1215
|
+
last_pc_ = pc_;
|
1216
|
+
EMIT(0x0F);
|
1217
|
+
EMIT(0xA5);
|
1218
|
+
emit_operand(dst, src);
|
1219
|
+
}
|
1220
|
+
|
1221
|
+
|
1222
|
+
void Assembler::shl(Register dst, uint8_t imm8) {
|
1223
|
+
EnsureSpace ensure_space(this);
|
1224
|
+
last_pc_ = pc_;
|
1225
|
+
ASSERT(is_uint5(imm8)); // illegal shift count
|
1226
|
+
if (imm8 == 1) {
|
1227
|
+
EMIT(0xD1);
|
1228
|
+
EMIT(0xE0 | dst.code());
|
1229
|
+
} else {
|
1230
|
+
EMIT(0xC1);
|
1231
|
+
EMIT(0xE0 | dst.code());
|
1232
|
+
EMIT(imm8);
|
1233
|
+
}
|
1234
|
+
}
|
1235
|
+
|
1236
|
+
|
1237
|
+
void Assembler::shl_cl(Register dst) {
|
1238
|
+
EnsureSpace ensure_space(this);
|
1239
|
+
last_pc_ = pc_;
|
1240
|
+
EMIT(0xD3);
|
1241
|
+
EMIT(0xE0 | dst.code());
|
1242
|
+
}
|
1243
|
+
|
1244
|
+
|
1245
|
+
void Assembler::shrd(Register dst, const Operand& src) {
|
1246
|
+
EnsureSpace ensure_space(this);
|
1247
|
+
last_pc_ = pc_;
|
1248
|
+
EMIT(0x0F);
|
1249
|
+
EMIT(0xAD);
|
1250
|
+
emit_operand(dst, src);
|
1251
|
+
}
|
1252
|
+
|
1253
|
+
|
1254
|
+
void Assembler::shr(Register dst, uint8_t imm8) {
|
1255
|
+
EnsureSpace ensure_space(this);
|
1256
|
+
last_pc_ = pc_;
|
1257
|
+
ASSERT(is_uint5(imm8)); // illegal shift count
|
1258
|
+
if (imm8 == 1) {
|
1259
|
+
EMIT(0xD1);
|
1260
|
+
EMIT(0xE8 | dst.code());
|
1261
|
+
} else {
|
1262
|
+
EMIT(0xC1);
|
1263
|
+
EMIT(0xE8 | dst.code());
|
1264
|
+
EMIT(imm8);
|
1265
|
+
}
|
1266
|
+
}
|
1267
|
+
|
1268
|
+
|
1269
|
+
void Assembler::shr_cl(Register dst) {
|
1270
|
+
EnsureSpace ensure_space(this);
|
1271
|
+
last_pc_ = pc_;
|
1272
|
+
EMIT(0xD3);
|
1273
|
+
EMIT(0xE8 | dst.code());
|
1274
|
+
}
|
1275
|
+
|
1276
|
+
|
1277
|
+
void Assembler::subb(const Operand& op, int8_t imm8) {
|
1278
|
+
EnsureSpace ensure_space(this);
|
1279
|
+
last_pc_ = pc_;
|
1280
|
+
if (op.is_reg(eax)) {
|
1281
|
+
EMIT(0x2c);
|
1282
|
+
} else {
|
1283
|
+
EMIT(0x80);
|
1284
|
+
emit_operand(ebp, op); // ebp == 5
|
1285
|
+
}
|
1286
|
+
EMIT(imm8);
|
1287
|
+
}
|
1288
|
+
|
1289
|
+
|
1290
|
+
void Assembler::sub(const Operand& dst, const Immediate& x) {
|
1291
|
+
EnsureSpace ensure_space(this);
|
1292
|
+
last_pc_ = pc_;
|
1293
|
+
emit_arith(5, dst, x);
|
1294
|
+
}
|
1295
|
+
|
1296
|
+
|
1297
|
+
void Assembler::sub(Register dst, const Operand& src) {
|
1298
|
+
EnsureSpace ensure_space(this);
|
1299
|
+
last_pc_ = pc_;
|
1300
|
+
EMIT(0x2B);
|
1301
|
+
emit_operand(dst, src);
|
1302
|
+
}
|
1303
|
+
|
1304
|
+
|
1305
|
+
void Assembler::subb(Register dst, const Operand& src) {
|
1306
|
+
ASSERT(dst.code() < 4);
|
1307
|
+
EnsureSpace ensure_space(this);
|
1308
|
+
last_pc_ = pc_;
|
1309
|
+
EMIT(0x2A);
|
1310
|
+
emit_operand(dst, src);
|
1311
|
+
}
|
1312
|
+
|
1313
|
+
|
1314
|
+
void Assembler::sub(const Operand& dst, Register src) {
|
1315
|
+
EnsureSpace ensure_space(this);
|
1316
|
+
last_pc_ = pc_;
|
1317
|
+
EMIT(0x29);
|
1318
|
+
emit_operand(src, dst);
|
1319
|
+
}
|
1320
|
+
|
1321
|
+
|
1322
|
+
void Assembler::test(Register reg, const Immediate& imm) {
|
1323
|
+
EnsureSpace ensure_space(this);
|
1324
|
+
last_pc_ = pc_;
|
1325
|
+
// Only use test against byte for registers that have a byte
|
1326
|
+
// variant: eax, ebx, ecx, and edx.
|
1327
|
+
if (imm.rmode_ == RelocInfo::NONE && is_uint8(imm.x_) && reg.code() < 4) {
|
1328
|
+
uint8_t imm8 = imm.x_;
|
1329
|
+
if (reg.is(eax)) {
|
1330
|
+
EMIT(0xA8);
|
1331
|
+
EMIT(imm8);
|
1332
|
+
} else {
|
1333
|
+
emit_arith_b(0xF6, 0xC0, reg, imm8);
|
1334
|
+
}
|
1335
|
+
} else {
|
1336
|
+
// This is not using emit_arith because test doesn't support
|
1337
|
+
// sign-extension of 8-bit operands.
|
1338
|
+
if (reg.is(eax)) {
|
1339
|
+
EMIT(0xA9);
|
1340
|
+
} else {
|
1341
|
+
EMIT(0xF7);
|
1342
|
+
EMIT(0xC0 | reg.code());
|
1343
|
+
}
|
1344
|
+
emit(imm);
|
1345
|
+
}
|
1346
|
+
}
|
1347
|
+
|
1348
|
+
|
1349
|
+
void Assembler::test(Register reg, const Operand& op) {
|
1350
|
+
EnsureSpace ensure_space(this);
|
1351
|
+
last_pc_ = pc_;
|
1352
|
+
EMIT(0x85);
|
1353
|
+
emit_operand(reg, op);
|
1354
|
+
}
|
1355
|
+
|
1356
|
+
|
1357
|
+
void Assembler::test_b(Register reg, const Operand& op) {
|
1358
|
+
EnsureSpace ensure_space(this);
|
1359
|
+
last_pc_ = pc_;
|
1360
|
+
EMIT(0x84);
|
1361
|
+
emit_operand(reg, op);
|
1362
|
+
}
|
1363
|
+
|
1364
|
+
|
1365
|
+
void Assembler::test(const Operand& op, const Immediate& imm) {
|
1366
|
+
EnsureSpace ensure_space(this);
|
1367
|
+
last_pc_ = pc_;
|
1368
|
+
EMIT(0xF7);
|
1369
|
+
emit_operand(eax, op);
|
1370
|
+
emit(imm);
|
1371
|
+
}
|
1372
|
+
|
1373
|
+
|
1374
|
+
void Assembler::test_b(const Operand& op, uint8_t imm8) {
|
1375
|
+
EnsureSpace ensure_space(this);
|
1376
|
+
last_pc_ = pc_;
|
1377
|
+
EMIT(0xF6);
|
1378
|
+
emit_operand(eax, op);
|
1379
|
+
EMIT(imm8);
|
1380
|
+
}
|
1381
|
+
|
1382
|
+
|
1383
|
+
void Assembler::xor_(Register dst, int32_t imm32) {
|
1384
|
+
EnsureSpace ensure_space(this);
|
1385
|
+
last_pc_ = pc_;
|
1386
|
+
emit_arith(6, Operand(dst), Immediate(imm32));
|
1387
|
+
}
|
1388
|
+
|
1389
|
+
|
1390
|
+
void Assembler::xor_(Register dst, const Operand& src) {
|
1391
|
+
EnsureSpace ensure_space(this);
|
1392
|
+
last_pc_ = pc_;
|
1393
|
+
EMIT(0x33);
|
1394
|
+
emit_operand(dst, src);
|
1395
|
+
}
|
1396
|
+
|
1397
|
+
|
1398
|
+
void Assembler::xor_(const Operand& src, Register dst) {
|
1399
|
+
EnsureSpace ensure_space(this);
|
1400
|
+
last_pc_ = pc_;
|
1401
|
+
EMIT(0x31);
|
1402
|
+
emit_operand(dst, src);
|
1403
|
+
}
|
1404
|
+
|
1405
|
+
|
1406
|
+
void Assembler::xor_(const Operand& dst, const Immediate& x) {
|
1407
|
+
EnsureSpace ensure_space(this);
|
1408
|
+
last_pc_ = pc_;
|
1409
|
+
emit_arith(6, dst, x);
|
1410
|
+
}
|
1411
|
+
|
1412
|
+
|
1413
|
+
void Assembler::bt(const Operand& dst, Register src) {
|
1414
|
+
EnsureSpace ensure_space(this);
|
1415
|
+
last_pc_ = pc_;
|
1416
|
+
EMIT(0x0F);
|
1417
|
+
EMIT(0xA3);
|
1418
|
+
emit_operand(src, dst);
|
1419
|
+
}
|
1420
|
+
|
1421
|
+
|
1422
|
+
void Assembler::bts(const Operand& dst, Register src) {
|
1423
|
+
EnsureSpace ensure_space(this);
|
1424
|
+
last_pc_ = pc_;
|
1425
|
+
EMIT(0x0F);
|
1426
|
+
EMIT(0xAB);
|
1427
|
+
emit_operand(src, dst);
|
1428
|
+
}
|
1429
|
+
|
1430
|
+
|
1431
|
+
void Assembler::hlt() {
|
1432
|
+
EnsureSpace ensure_space(this);
|
1433
|
+
last_pc_ = pc_;
|
1434
|
+
EMIT(0xF4);
|
1435
|
+
}
|
1436
|
+
|
1437
|
+
|
1438
|
+
void Assembler::int3() {
|
1439
|
+
EnsureSpace ensure_space(this);
|
1440
|
+
last_pc_ = pc_;
|
1441
|
+
EMIT(0xCC);
|
1442
|
+
}
|
1443
|
+
|
1444
|
+
|
1445
|
+
void Assembler::nop() {
|
1446
|
+
EnsureSpace ensure_space(this);
|
1447
|
+
last_pc_ = pc_;
|
1448
|
+
EMIT(0x90);
|
1449
|
+
}
|
1450
|
+
|
1451
|
+
|
1452
|
+
void Assembler::rdtsc() {
|
1453
|
+
ASSERT(CpuFeatures::IsEnabled(RDTSC));
|
1454
|
+
EnsureSpace ensure_space(this);
|
1455
|
+
last_pc_ = pc_;
|
1456
|
+
EMIT(0x0F);
|
1457
|
+
EMIT(0x31);
|
1458
|
+
}
|
1459
|
+
|
1460
|
+
|
1461
|
+
void Assembler::ret(int imm16) {
|
1462
|
+
EnsureSpace ensure_space(this);
|
1463
|
+
last_pc_ = pc_;
|
1464
|
+
ASSERT(is_uint16(imm16));
|
1465
|
+
if (imm16 == 0) {
|
1466
|
+
EMIT(0xC3);
|
1467
|
+
} else {
|
1468
|
+
EMIT(0xC2);
|
1469
|
+
EMIT(imm16 & 0xFF);
|
1470
|
+
EMIT((imm16 >> 8) & 0xFF);
|
1471
|
+
}
|
1472
|
+
}
|
1473
|
+
|
1474
|
+
|
1475
|
+
// Labels refer to positions in the (to be) generated code.
|
1476
|
+
// There are bound, linked, and unused labels.
|
1477
|
+
//
|
1478
|
+
// Bound labels refer to known positions in the already
|
1479
|
+
// generated code. pos() is the position the label refers to.
|
1480
|
+
//
|
1481
|
+
// Linked labels refer to unknown positions in the code
|
1482
|
+
// to be generated; pos() is the position of the 32bit
|
1483
|
+
// Displacement of the last instruction using the label.
|
1484
|
+
|
1485
|
+
|
1486
|
+
void Assembler::print(Label* L) {
|
1487
|
+
if (L->is_unused()) {
|
1488
|
+
PrintF("unused label\n");
|
1489
|
+
} else if (L->is_bound()) {
|
1490
|
+
PrintF("bound label to %d\n", L->pos());
|
1491
|
+
} else if (L->is_linked()) {
|
1492
|
+
Label l = *L;
|
1493
|
+
PrintF("unbound label");
|
1494
|
+
while (l.is_linked()) {
|
1495
|
+
Displacement disp = disp_at(&l);
|
1496
|
+
PrintF("@ %d ", l.pos());
|
1497
|
+
disp.print();
|
1498
|
+
PrintF("\n");
|
1499
|
+
disp.next(&l);
|
1500
|
+
}
|
1501
|
+
} else {
|
1502
|
+
PrintF("label in inconsistent state (pos = %d)\n", L->pos_);
|
1503
|
+
}
|
1504
|
+
}
|
1505
|
+
|
1506
|
+
|
1507
|
+
void Assembler::bind_to(Label* L, int pos) {
|
1508
|
+
EnsureSpace ensure_space(this);
|
1509
|
+
last_pc_ = NULL;
|
1510
|
+
ASSERT(0 <= pos && pos <= pc_offset()); // must have a valid binding position
|
1511
|
+
while (L->is_linked()) {
|
1512
|
+
Displacement disp = disp_at(L);
|
1513
|
+
int fixup_pos = L->pos();
|
1514
|
+
if (disp.type() == Displacement::CODE_RELATIVE) {
|
1515
|
+
// Relative to Code* heap object pointer.
|
1516
|
+
long_at_put(fixup_pos, pos + Code::kHeaderSize - kHeapObjectTag);
|
1517
|
+
} else {
|
1518
|
+
if (disp.type() == Displacement::UNCONDITIONAL_JUMP) {
|
1519
|
+
ASSERT(byte_at(fixup_pos - 1) == 0xE9); // jmp expected
|
1520
|
+
}
|
1521
|
+
// Relative address, relative to point after address.
|
1522
|
+
int imm32 = pos - (fixup_pos + sizeof(int32_t));
|
1523
|
+
long_at_put(fixup_pos, imm32);
|
1524
|
+
}
|
1525
|
+
disp.next(L);
|
1526
|
+
}
|
1527
|
+
L->bind_to(pos);
|
1528
|
+
}
|
1529
|
+
|
1530
|
+
|
1531
|
+
void Assembler::bind(Label* L) {
|
1532
|
+
EnsureSpace ensure_space(this);
|
1533
|
+
last_pc_ = NULL;
|
1534
|
+
ASSERT(!L->is_bound()); // label can only be bound once
|
1535
|
+
bind_to(L, pc_offset());
|
1536
|
+
}
|
1537
|
+
|
1538
|
+
|
1539
|
+
void Assembler::bind(NearLabel* L) {
|
1540
|
+
ASSERT(!L->is_bound());
|
1541
|
+
last_pc_ = NULL;
|
1542
|
+
while (L->unresolved_branches_ > 0) {
|
1543
|
+
int branch_pos = L->unresolved_positions_[L->unresolved_branches_ - 1];
|
1544
|
+
int disp = pc_offset() - branch_pos;
|
1545
|
+
ASSERT(is_int8(disp));
|
1546
|
+
set_byte_at(branch_pos - sizeof(int8_t), disp);
|
1547
|
+
L->unresolved_branches_--;
|
1548
|
+
}
|
1549
|
+
L->bind_to(pc_offset());
|
1550
|
+
}
|
1551
|
+
|
1552
|
+
|
1553
|
+
void Assembler::call(Label* L) {
|
1554
|
+
positions_recorder()->WriteRecordedPositions();
|
1555
|
+
EnsureSpace ensure_space(this);
|
1556
|
+
last_pc_ = pc_;
|
1557
|
+
if (L->is_bound()) {
|
1558
|
+
const int long_size = 5;
|
1559
|
+
int offs = L->pos() - pc_offset();
|
1560
|
+
ASSERT(offs <= 0);
|
1561
|
+
// 1110 1000 #32-bit disp.
|
1562
|
+
EMIT(0xE8);
|
1563
|
+
emit(offs - long_size);
|
1564
|
+
} else {
|
1565
|
+
// 1110 1000 #32-bit disp.
|
1566
|
+
EMIT(0xE8);
|
1567
|
+
emit_disp(L, Displacement::OTHER);
|
1568
|
+
}
|
1569
|
+
}
|
1570
|
+
|
1571
|
+
|
1572
|
+
void Assembler::call(byte* entry, RelocInfo::Mode rmode) {
|
1573
|
+
positions_recorder()->WriteRecordedPositions();
|
1574
|
+
EnsureSpace ensure_space(this);
|
1575
|
+
last_pc_ = pc_;
|
1576
|
+
ASSERT(!RelocInfo::IsCodeTarget(rmode));
|
1577
|
+
EMIT(0xE8);
|
1578
|
+
emit(entry - (pc_ + sizeof(int32_t)), rmode);
|
1579
|
+
}
|
1580
|
+
|
1581
|
+
|
1582
|
+
void Assembler::call(const Operand& adr) {
|
1583
|
+
positions_recorder()->WriteRecordedPositions();
|
1584
|
+
EnsureSpace ensure_space(this);
|
1585
|
+
last_pc_ = pc_;
|
1586
|
+
EMIT(0xFF);
|
1587
|
+
emit_operand(edx, adr);
|
1588
|
+
}
|
1589
|
+
|
1590
|
+
|
1591
|
+
void Assembler::call(Handle<Code> code, RelocInfo::Mode rmode) {
|
1592
|
+
positions_recorder()->WriteRecordedPositions();
|
1593
|
+
EnsureSpace ensure_space(this);
|
1594
|
+
last_pc_ = pc_;
|
1595
|
+
ASSERT(RelocInfo::IsCodeTarget(rmode));
|
1596
|
+
EMIT(0xE8);
|
1597
|
+
emit(reinterpret_cast<intptr_t>(code.location()), rmode);
|
1598
|
+
}
|
1599
|
+
|
1600
|
+
|
1601
|
+
void Assembler::jmp(Label* L) {
|
1602
|
+
EnsureSpace ensure_space(this);
|
1603
|
+
last_pc_ = pc_;
|
1604
|
+
if (L->is_bound()) {
|
1605
|
+
const int short_size = 2;
|
1606
|
+
const int long_size = 5;
|
1607
|
+
int offs = L->pos() - pc_offset();
|
1608
|
+
ASSERT(offs <= 0);
|
1609
|
+
if (is_int8(offs - short_size)) {
|
1610
|
+
// 1110 1011 #8-bit disp.
|
1611
|
+
EMIT(0xEB);
|
1612
|
+
EMIT((offs - short_size) & 0xFF);
|
1613
|
+
} else {
|
1614
|
+
// 1110 1001 #32-bit disp.
|
1615
|
+
EMIT(0xE9);
|
1616
|
+
emit(offs - long_size);
|
1617
|
+
}
|
1618
|
+
} else {
|
1619
|
+
// 1110 1001 #32-bit disp.
|
1620
|
+
EMIT(0xE9);
|
1621
|
+
emit_disp(L, Displacement::UNCONDITIONAL_JUMP);
|
1622
|
+
}
|
1623
|
+
}
|
1624
|
+
|
1625
|
+
|
1626
|
+
void Assembler::jmp(byte* entry, RelocInfo::Mode rmode) {
|
1627
|
+
EnsureSpace ensure_space(this);
|
1628
|
+
last_pc_ = pc_;
|
1629
|
+
ASSERT(!RelocInfo::IsCodeTarget(rmode));
|
1630
|
+
EMIT(0xE9);
|
1631
|
+
emit(entry - (pc_ + sizeof(int32_t)), rmode);
|
1632
|
+
}
|
1633
|
+
|
1634
|
+
|
1635
|
+
void Assembler::jmp(const Operand& adr) {
|
1636
|
+
EnsureSpace ensure_space(this);
|
1637
|
+
last_pc_ = pc_;
|
1638
|
+
EMIT(0xFF);
|
1639
|
+
emit_operand(esp, adr);
|
1640
|
+
}
|
1641
|
+
|
1642
|
+
|
1643
|
+
void Assembler::jmp(Handle<Code> code, RelocInfo::Mode rmode) {
|
1644
|
+
EnsureSpace ensure_space(this);
|
1645
|
+
last_pc_ = pc_;
|
1646
|
+
ASSERT(RelocInfo::IsCodeTarget(rmode));
|
1647
|
+
EMIT(0xE9);
|
1648
|
+
emit(reinterpret_cast<intptr_t>(code.location()), rmode);
|
1649
|
+
}
|
1650
|
+
|
1651
|
+
|
1652
|
+
void Assembler::jmp(NearLabel* L) {
|
1653
|
+
EnsureSpace ensure_space(this);
|
1654
|
+
last_pc_ = pc_;
|
1655
|
+
if (L->is_bound()) {
|
1656
|
+
const int short_size = 2;
|
1657
|
+
int offs = L->pos() - pc_offset();
|
1658
|
+
ASSERT(offs <= 0);
|
1659
|
+
ASSERT(is_int8(offs - short_size));
|
1660
|
+
// 1110 1011 #8-bit disp.
|
1661
|
+
EMIT(0xEB);
|
1662
|
+
EMIT((offs - short_size) & 0xFF);
|
1663
|
+
} else {
|
1664
|
+
EMIT(0xEB);
|
1665
|
+
EMIT(0x00); // The displacement will be resolved later.
|
1666
|
+
L->link_to(pc_offset());
|
1667
|
+
}
|
1668
|
+
}
|
1669
|
+
|
1670
|
+
|
1671
|
+
void Assembler::j(Condition cc, Label* L, Hint hint) {
|
1672
|
+
EnsureSpace ensure_space(this);
|
1673
|
+
last_pc_ = pc_;
|
1674
|
+
ASSERT(0 <= cc && cc < 16);
|
1675
|
+
if (FLAG_emit_branch_hints && hint != no_hint) EMIT(hint);
|
1676
|
+
if (L->is_bound()) {
|
1677
|
+
const int short_size = 2;
|
1678
|
+
const int long_size = 6;
|
1679
|
+
int offs = L->pos() - pc_offset();
|
1680
|
+
ASSERT(offs <= 0);
|
1681
|
+
if (is_int8(offs - short_size)) {
|
1682
|
+
// 0111 tttn #8-bit disp
|
1683
|
+
EMIT(0x70 | cc);
|
1684
|
+
EMIT((offs - short_size) & 0xFF);
|
1685
|
+
} else {
|
1686
|
+
// 0000 1111 1000 tttn #32-bit disp
|
1687
|
+
EMIT(0x0F);
|
1688
|
+
EMIT(0x80 | cc);
|
1689
|
+
emit(offs - long_size);
|
1690
|
+
}
|
1691
|
+
} else {
|
1692
|
+
// 0000 1111 1000 tttn #32-bit disp
|
1693
|
+
// Note: could eliminate cond. jumps to this jump if condition
|
1694
|
+
// is the same however, seems to be rather unlikely case.
|
1695
|
+
EMIT(0x0F);
|
1696
|
+
EMIT(0x80 | cc);
|
1697
|
+
emit_disp(L, Displacement::OTHER);
|
1698
|
+
}
|
1699
|
+
}
|
1700
|
+
|
1701
|
+
|
1702
|
+
void Assembler::j(Condition cc, byte* entry, RelocInfo::Mode rmode, Hint hint) {
|
1703
|
+
EnsureSpace ensure_space(this);
|
1704
|
+
last_pc_ = pc_;
|
1705
|
+
ASSERT((0 <= cc) && (cc < 16));
|
1706
|
+
if (FLAG_emit_branch_hints && hint != no_hint) EMIT(hint);
|
1707
|
+
// 0000 1111 1000 tttn #32-bit disp.
|
1708
|
+
EMIT(0x0F);
|
1709
|
+
EMIT(0x80 | cc);
|
1710
|
+
emit(entry - (pc_ + sizeof(int32_t)), rmode);
|
1711
|
+
}
|
1712
|
+
|
1713
|
+
|
1714
|
+
void Assembler::j(Condition cc, Handle<Code> code, Hint hint) {
|
1715
|
+
EnsureSpace ensure_space(this);
|
1716
|
+
last_pc_ = pc_;
|
1717
|
+
if (FLAG_emit_branch_hints && hint != no_hint) EMIT(hint);
|
1718
|
+
// 0000 1111 1000 tttn #32-bit disp
|
1719
|
+
EMIT(0x0F);
|
1720
|
+
EMIT(0x80 | cc);
|
1721
|
+
emit(reinterpret_cast<intptr_t>(code.location()), RelocInfo::CODE_TARGET);
|
1722
|
+
}
|
1723
|
+
|
1724
|
+
|
1725
|
+
void Assembler::j(Condition cc, NearLabel* L, Hint hint) {
|
1726
|
+
EnsureSpace ensure_space(this);
|
1727
|
+
last_pc_ = pc_;
|
1728
|
+
ASSERT(0 <= cc && cc < 16);
|
1729
|
+
if (FLAG_emit_branch_hints && hint != no_hint) EMIT(hint);
|
1730
|
+
if (L->is_bound()) {
|
1731
|
+
const int short_size = 2;
|
1732
|
+
int offs = L->pos() - pc_offset();
|
1733
|
+
ASSERT(offs <= 0);
|
1734
|
+
ASSERT(is_int8(offs - short_size));
|
1735
|
+
// 0111 tttn #8-bit disp
|
1736
|
+
EMIT(0x70 | cc);
|
1737
|
+
EMIT((offs - short_size) & 0xFF);
|
1738
|
+
} else {
|
1739
|
+
EMIT(0x70 | cc);
|
1740
|
+
EMIT(0x00); // The displacement will be resolved later.
|
1741
|
+
L->link_to(pc_offset());
|
1742
|
+
}
|
1743
|
+
}
|
1744
|
+
|
1745
|
+
|
1746
|
+
// FPU instructions.
|
1747
|
+
|
1748
|
+
void Assembler::fld(int i) {
|
1749
|
+
EnsureSpace ensure_space(this);
|
1750
|
+
last_pc_ = pc_;
|
1751
|
+
emit_farith(0xD9, 0xC0, i);
|
1752
|
+
}
|
1753
|
+
|
1754
|
+
|
1755
|
+
void Assembler::fstp(int i) {
|
1756
|
+
EnsureSpace ensure_space(this);
|
1757
|
+
last_pc_ = pc_;
|
1758
|
+
emit_farith(0xDD, 0xD8, i);
|
1759
|
+
}
|
1760
|
+
|
1761
|
+
|
1762
|
+
void Assembler::fld1() {
|
1763
|
+
EnsureSpace ensure_space(this);
|
1764
|
+
last_pc_ = pc_;
|
1765
|
+
EMIT(0xD9);
|
1766
|
+
EMIT(0xE8);
|
1767
|
+
}
|
1768
|
+
|
1769
|
+
|
1770
|
+
void Assembler::fldpi() {
|
1771
|
+
EnsureSpace ensure_space(this);
|
1772
|
+
last_pc_ = pc_;
|
1773
|
+
EMIT(0xD9);
|
1774
|
+
EMIT(0xEB);
|
1775
|
+
}
|
1776
|
+
|
1777
|
+
|
1778
|
+
void Assembler::fldz() {
|
1779
|
+
EnsureSpace ensure_space(this);
|
1780
|
+
last_pc_ = pc_;
|
1781
|
+
EMIT(0xD9);
|
1782
|
+
EMIT(0xEE);
|
1783
|
+
}
|
1784
|
+
|
1785
|
+
|
1786
|
+
void Assembler::fldln2() {
|
1787
|
+
EnsureSpace ensure_space(this);
|
1788
|
+
last_pc_ = pc_;
|
1789
|
+
EMIT(0xD9);
|
1790
|
+
EMIT(0xED);
|
1791
|
+
}
|
1792
|
+
|
1793
|
+
|
1794
|
+
void Assembler::fld_s(const Operand& adr) {
|
1795
|
+
EnsureSpace ensure_space(this);
|
1796
|
+
last_pc_ = pc_;
|
1797
|
+
EMIT(0xD9);
|
1798
|
+
emit_operand(eax, adr);
|
1799
|
+
}
|
1800
|
+
|
1801
|
+
|
1802
|
+
void Assembler::fld_d(const Operand& adr) {
|
1803
|
+
EnsureSpace ensure_space(this);
|
1804
|
+
last_pc_ = pc_;
|
1805
|
+
EMIT(0xDD);
|
1806
|
+
emit_operand(eax, adr);
|
1807
|
+
}
|
1808
|
+
|
1809
|
+
|
1810
|
+
void Assembler::fstp_s(const Operand& adr) {
|
1811
|
+
EnsureSpace ensure_space(this);
|
1812
|
+
last_pc_ = pc_;
|
1813
|
+
EMIT(0xD9);
|
1814
|
+
emit_operand(ebx, adr);
|
1815
|
+
}
|
1816
|
+
|
1817
|
+
|
1818
|
+
void Assembler::fstp_d(const Operand& adr) {
|
1819
|
+
EnsureSpace ensure_space(this);
|
1820
|
+
last_pc_ = pc_;
|
1821
|
+
EMIT(0xDD);
|
1822
|
+
emit_operand(ebx, adr);
|
1823
|
+
}
|
1824
|
+
|
1825
|
+
|
1826
|
+
void Assembler::fst_d(const Operand& adr) {
|
1827
|
+
EnsureSpace ensure_space(this);
|
1828
|
+
last_pc_ = pc_;
|
1829
|
+
EMIT(0xDD);
|
1830
|
+
emit_operand(edx, adr);
|
1831
|
+
}
|
1832
|
+
|
1833
|
+
|
1834
|
+
void Assembler::fild_s(const Operand& adr) {
|
1835
|
+
EnsureSpace ensure_space(this);
|
1836
|
+
last_pc_ = pc_;
|
1837
|
+
EMIT(0xDB);
|
1838
|
+
emit_operand(eax, adr);
|
1839
|
+
}
|
1840
|
+
|
1841
|
+
|
1842
|
+
void Assembler::fild_d(const Operand& adr) {
|
1843
|
+
EnsureSpace ensure_space(this);
|
1844
|
+
last_pc_ = pc_;
|
1845
|
+
EMIT(0xDF);
|
1846
|
+
emit_operand(ebp, adr);
|
1847
|
+
}
|
1848
|
+
|
1849
|
+
|
1850
|
+
void Assembler::fistp_s(const Operand& adr) {
|
1851
|
+
EnsureSpace ensure_space(this);
|
1852
|
+
last_pc_ = pc_;
|
1853
|
+
EMIT(0xDB);
|
1854
|
+
emit_operand(ebx, adr);
|
1855
|
+
}
|
1856
|
+
|
1857
|
+
|
1858
|
+
void Assembler::fisttp_s(const Operand& adr) {
|
1859
|
+
ASSERT(CpuFeatures::IsEnabled(SSE3));
|
1860
|
+
EnsureSpace ensure_space(this);
|
1861
|
+
last_pc_ = pc_;
|
1862
|
+
EMIT(0xDB);
|
1863
|
+
emit_operand(ecx, adr);
|
1864
|
+
}
|
1865
|
+
|
1866
|
+
|
1867
|
+
void Assembler::fisttp_d(const Operand& adr) {
|
1868
|
+
ASSERT(CpuFeatures::IsEnabled(SSE3));
|
1869
|
+
EnsureSpace ensure_space(this);
|
1870
|
+
last_pc_ = pc_;
|
1871
|
+
EMIT(0xDD);
|
1872
|
+
emit_operand(ecx, adr);
|
1873
|
+
}
|
1874
|
+
|
1875
|
+
|
1876
|
+
void Assembler::fist_s(const Operand& adr) {
|
1877
|
+
EnsureSpace ensure_space(this);
|
1878
|
+
last_pc_ = pc_;
|
1879
|
+
EMIT(0xDB);
|
1880
|
+
emit_operand(edx, adr);
|
1881
|
+
}
|
1882
|
+
|
1883
|
+
|
1884
|
+
void Assembler::fistp_d(const Operand& adr) {
|
1885
|
+
EnsureSpace ensure_space(this);
|
1886
|
+
last_pc_ = pc_;
|
1887
|
+
EMIT(0xDF);
|
1888
|
+
emit_operand(edi, adr);
|
1889
|
+
}
|
1890
|
+
|
1891
|
+
|
1892
|
+
void Assembler::fabs() {
|
1893
|
+
EnsureSpace ensure_space(this);
|
1894
|
+
last_pc_ = pc_;
|
1895
|
+
EMIT(0xD9);
|
1896
|
+
EMIT(0xE1);
|
1897
|
+
}
|
1898
|
+
|
1899
|
+
|
1900
|
+
void Assembler::fchs() {
|
1901
|
+
EnsureSpace ensure_space(this);
|
1902
|
+
last_pc_ = pc_;
|
1903
|
+
EMIT(0xD9);
|
1904
|
+
EMIT(0xE0);
|
1905
|
+
}
|
1906
|
+
|
1907
|
+
|
1908
|
+
void Assembler::fcos() {
|
1909
|
+
EnsureSpace ensure_space(this);
|
1910
|
+
last_pc_ = pc_;
|
1911
|
+
EMIT(0xD9);
|
1912
|
+
EMIT(0xFF);
|
1913
|
+
}
|
1914
|
+
|
1915
|
+
|
1916
|
+
void Assembler::fsin() {
|
1917
|
+
EnsureSpace ensure_space(this);
|
1918
|
+
last_pc_ = pc_;
|
1919
|
+
EMIT(0xD9);
|
1920
|
+
EMIT(0xFE);
|
1921
|
+
}
|
1922
|
+
|
1923
|
+
|
1924
|
+
void Assembler::fyl2x() {
|
1925
|
+
EnsureSpace ensure_space(this);
|
1926
|
+
last_pc_ = pc_;
|
1927
|
+
EMIT(0xD9);
|
1928
|
+
EMIT(0xF1);
|
1929
|
+
}
|
1930
|
+
|
1931
|
+
|
1932
|
+
void Assembler::fadd(int i) {
|
1933
|
+
EnsureSpace ensure_space(this);
|
1934
|
+
last_pc_ = pc_;
|
1935
|
+
emit_farith(0xDC, 0xC0, i);
|
1936
|
+
}
|
1937
|
+
|
1938
|
+
|
1939
|
+
void Assembler::fsub(int i) {
|
1940
|
+
EnsureSpace ensure_space(this);
|
1941
|
+
last_pc_ = pc_;
|
1942
|
+
emit_farith(0xDC, 0xE8, i);
|
1943
|
+
}
|
1944
|
+
|
1945
|
+
|
1946
|
+
void Assembler::fisub_s(const Operand& adr) {
|
1947
|
+
EnsureSpace ensure_space(this);
|
1948
|
+
last_pc_ = pc_;
|
1949
|
+
EMIT(0xDA);
|
1950
|
+
emit_operand(esp, adr);
|
1951
|
+
}
|
1952
|
+
|
1953
|
+
|
1954
|
+
void Assembler::fmul(int i) {
|
1955
|
+
EnsureSpace ensure_space(this);
|
1956
|
+
last_pc_ = pc_;
|
1957
|
+
emit_farith(0xDC, 0xC8, i);
|
1958
|
+
}
|
1959
|
+
|
1960
|
+
|
1961
|
+
void Assembler::fdiv(int i) {
|
1962
|
+
EnsureSpace ensure_space(this);
|
1963
|
+
last_pc_ = pc_;
|
1964
|
+
emit_farith(0xDC, 0xF8, i);
|
1965
|
+
}
|
1966
|
+
|
1967
|
+
|
1968
|
+
void Assembler::faddp(int i) {
|
1969
|
+
EnsureSpace ensure_space(this);
|
1970
|
+
last_pc_ = pc_;
|
1971
|
+
emit_farith(0xDE, 0xC0, i);
|
1972
|
+
}
|
1973
|
+
|
1974
|
+
|
1975
|
+
void Assembler::fsubp(int i) {
|
1976
|
+
EnsureSpace ensure_space(this);
|
1977
|
+
last_pc_ = pc_;
|
1978
|
+
emit_farith(0xDE, 0xE8, i);
|
1979
|
+
}
|
1980
|
+
|
1981
|
+
|
1982
|
+
void Assembler::fsubrp(int i) {
|
1983
|
+
EnsureSpace ensure_space(this);
|
1984
|
+
last_pc_ = pc_;
|
1985
|
+
emit_farith(0xDE, 0xE0, i);
|
1986
|
+
}
|
1987
|
+
|
1988
|
+
|
1989
|
+
void Assembler::fmulp(int i) {
|
1990
|
+
EnsureSpace ensure_space(this);
|
1991
|
+
last_pc_ = pc_;
|
1992
|
+
emit_farith(0xDE, 0xC8, i);
|
1993
|
+
}
|
1994
|
+
|
1995
|
+
|
1996
|
+
void Assembler::fdivp(int i) {
|
1997
|
+
EnsureSpace ensure_space(this);
|
1998
|
+
last_pc_ = pc_;
|
1999
|
+
emit_farith(0xDE, 0xF8, i);
|
2000
|
+
}
|
2001
|
+
|
2002
|
+
|
2003
|
+
void Assembler::fprem() {
|
2004
|
+
EnsureSpace ensure_space(this);
|
2005
|
+
last_pc_ = pc_;
|
2006
|
+
EMIT(0xD9);
|
2007
|
+
EMIT(0xF8);
|
2008
|
+
}
|
2009
|
+
|
2010
|
+
|
2011
|
+
void Assembler::fprem1() {
|
2012
|
+
EnsureSpace ensure_space(this);
|
2013
|
+
last_pc_ = pc_;
|
2014
|
+
EMIT(0xD9);
|
2015
|
+
EMIT(0xF5);
|
2016
|
+
}
|
2017
|
+
|
2018
|
+
|
2019
|
+
void Assembler::fxch(int i) {
|
2020
|
+
EnsureSpace ensure_space(this);
|
2021
|
+
last_pc_ = pc_;
|
2022
|
+
emit_farith(0xD9, 0xC8, i);
|
2023
|
+
}
|
2024
|
+
|
2025
|
+
|
2026
|
+
void Assembler::fincstp() {
|
2027
|
+
EnsureSpace ensure_space(this);
|
2028
|
+
last_pc_ = pc_;
|
2029
|
+
EMIT(0xD9);
|
2030
|
+
EMIT(0xF7);
|
2031
|
+
}
|
2032
|
+
|
2033
|
+
|
2034
|
+
void Assembler::ffree(int i) {
|
2035
|
+
EnsureSpace ensure_space(this);
|
2036
|
+
last_pc_ = pc_;
|
2037
|
+
emit_farith(0xDD, 0xC0, i);
|
2038
|
+
}
|
2039
|
+
|
2040
|
+
|
2041
|
+
void Assembler::ftst() {
|
2042
|
+
EnsureSpace ensure_space(this);
|
2043
|
+
last_pc_ = pc_;
|
2044
|
+
EMIT(0xD9);
|
2045
|
+
EMIT(0xE4);
|
2046
|
+
}
|
2047
|
+
|
2048
|
+
|
2049
|
+
void Assembler::fucomp(int i) {
|
2050
|
+
EnsureSpace ensure_space(this);
|
2051
|
+
last_pc_ = pc_;
|
2052
|
+
emit_farith(0xDD, 0xE8, i);
|
2053
|
+
}
|
2054
|
+
|
2055
|
+
|
2056
|
+
void Assembler::fucompp() {
|
2057
|
+
EnsureSpace ensure_space(this);
|
2058
|
+
last_pc_ = pc_;
|
2059
|
+
EMIT(0xDA);
|
2060
|
+
EMIT(0xE9);
|
2061
|
+
}
|
2062
|
+
|
2063
|
+
|
2064
|
+
void Assembler::fucomi(int i) {
|
2065
|
+
EnsureSpace ensure_space(this);
|
2066
|
+
last_pc_ = pc_;
|
2067
|
+
EMIT(0xDB);
|
2068
|
+
EMIT(0xE8 + i);
|
2069
|
+
}
|
2070
|
+
|
2071
|
+
|
2072
|
+
void Assembler::fucomip() {
|
2073
|
+
EnsureSpace ensure_space(this);
|
2074
|
+
last_pc_ = pc_;
|
2075
|
+
EMIT(0xDF);
|
2076
|
+
EMIT(0xE9);
|
2077
|
+
}
|
2078
|
+
|
2079
|
+
|
2080
|
+
void Assembler::fcompp() {
|
2081
|
+
EnsureSpace ensure_space(this);
|
2082
|
+
last_pc_ = pc_;
|
2083
|
+
EMIT(0xDE);
|
2084
|
+
EMIT(0xD9);
|
2085
|
+
}
|
2086
|
+
|
2087
|
+
|
2088
|
+
void Assembler::fnstsw_ax() {
|
2089
|
+
EnsureSpace ensure_space(this);
|
2090
|
+
last_pc_ = pc_;
|
2091
|
+
EMIT(0xDF);
|
2092
|
+
EMIT(0xE0);
|
2093
|
+
}
|
2094
|
+
|
2095
|
+
|
2096
|
+
void Assembler::fwait() {
|
2097
|
+
EnsureSpace ensure_space(this);
|
2098
|
+
last_pc_ = pc_;
|
2099
|
+
EMIT(0x9B);
|
2100
|
+
}
|
2101
|
+
|
2102
|
+
|
2103
|
+
void Assembler::frndint() {
|
2104
|
+
EnsureSpace ensure_space(this);
|
2105
|
+
last_pc_ = pc_;
|
2106
|
+
EMIT(0xD9);
|
2107
|
+
EMIT(0xFC);
|
2108
|
+
}
|
2109
|
+
|
2110
|
+
|
2111
|
+
void Assembler::fnclex() {
|
2112
|
+
EnsureSpace ensure_space(this);
|
2113
|
+
last_pc_ = pc_;
|
2114
|
+
EMIT(0xDB);
|
2115
|
+
EMIT(0xE2);
|
2116
|
+
}
|
2117
|
+
|
2118
|
+
|
2119
|
+
void Assembler::sahf() {
|
2120
|
+
EnsureSpace ensure_space(this);
|
2121
|
+
last_pc_ = pc_;
|
2122
|
+
EMIT(0x9E);
|
2123
|
+
}
|
2124
|
+
|
2125
|
+
|
2126
|
+
void Assembler::setcc(Condition cc, Register reg) {
|
2127
|
+
ASSERT(reg.is_byte_register());
|
2128
|
+
EnsureSpace ensure_space(this);
|
2129
|
+
last_pc_ = pc_;
|
2130
|
+
EMIT(0x0F);
|
2131
|
+
EMIT(0x90 | cc);
|
2132
|
+
EMIT(0xC0 | reg.code());
|
2133
|
+
}
|
2134
|
+
|
2135
|
+
|
2136
|
+
void Assembler::cvttss2si(Register dst, const Operand& src) {
|
2137
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2138
|
+
EnsureSpace ensure_space(this);
|
2139
|
+
last_pc_ = pc_;
|
2140
|
+
EMIT(0xF3);
|
2141
|
+
EMIT(0x0F);
|
2142
|
+
EMIT(0x2C);
|
2143
|
+
emit_operand(dst, src);
|
2144
|
+
}
|
2145
|
+
|
2146
|
+
|
2147
|
+
void Assembler::cvttsd2si(Register dst, const Operand& src) {
|
2148
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2149
|
+
EnsureSpace ensure_space(this);
|
2150
|
+
last_pc_ = pc_;
|
2151
|
+
EMIT(0xF2);
|
2152
|
+
EMIT(0x0F);
|
2153
|
+
EMIT(0x2C);
|
2154
|
+
emit_operand(dst, src);
|
2155
|
+
}
|
2156
|
+
|
2157
|
+
|
2158
|
+
void Assembler::cvtsi2sd(XMMRegister dst, const Operand& src) {
|
2159
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2160
|
+
EnsureSpace ensure_space(this);
|
2161
|
+
last_pc_ = pc_;
|
2162
|
+
EMIT(0xF2);
|
2163
|
+
EMIT(0x0F);
|
2164
|
+
EMIT(0x2A);
|
2165
|
+
emit_sse_operand(dst, src);
|
2166
|
+
}
|
2167
|
+
|
2168
|
+
|
2169
|
+
void Assembler::cvtss2sd(XMMRegister dst, XMMRegister src) {
|
2170
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2171
|
+
EnsureSpace ensure_space(this);
|
2172
|
+
last_pc_ = pc_;
|
2173
|
+
EMIT(0xF3);
|
2174
|
+
EMIT(0x0F);
|
2175
|
+
EMIT(0x5A);
|
2176
|
+
emit_sse_operand(dst, src);
|
2177
|
+
}
|
2178
|
+
|
2179
|
+
|
2180
|
+
void Assembler::addsd(XMMRegister dst, XMMRegister src) {
|
2181
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2182
|
+
EnsureSpace ensure_space(this);
|
2183
|
+
last_pc_ = pc_;
|
2184
|
+
EMIT(0xF2);
|
2185
|
+
EMIT(0x0F);
|
2186
|
+
EMIT(0x58);
|
2187
|
+
emit_sse_operand(dst, src);
|
2188
|
+
}
|
2189
|
+
|
2190
|
+
|
2191
|
+
void Assembler::mulsd(XMMRegister dst, XMMRegister src) {
|
2192
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2193
|
+
EnsureSpace ensure_space(this);
|
2194
|
+
last_pc_ = pc_;
|
2195
|
+
EMIT(0xF2);
|
2196
|
+
EMIT(0x0F);
|
2197
|
+
EMIT(0x59);
|
2198
|
+
emit_sse_operand(dst, src);
|
2199
|
+
}
|
2200
|
+
|
2201
|
+
|
2202
|
+
void Assembler::subsd(XMMRegister dst, XMMRegister src) {
|
2203
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2204
|
+
EnsureSpace ensure_space(this);
|
2205
|
+
last_pc_ = pc_;
|
2206
|
+
EMIT(0xF2);
|
2207
|
+
EMIT(0x0F);
|
2208
|
+
EMIT(0x5C);
|
2209
|
+
emit_sse_operand(dst, src);
|
2210
|
+
}
|
2211
|
+
|
2212
|
+
|
2213
|
+
void Assembler::divsd(XMMRegister dst, XMMRegister src) {
|
2214
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2215
|
+
EnsureSpace ensure_space(this);
|
2216
|
+
last_pc_ = pc_;
|
2217
|
+
EMIT(0xF2);
|
2218
|
+
EMIT(0x0F);
|
2219
|
+
EMIT(0x5E);
|
2220
|
+
emit_sse_operand(dst, src);
|
2221
|
+
}
|
2222
|
+
|
2223
|
+
|
2224
|
+
void Assembler::xorpd(XMMRegister dst, XMMRegister src) {
|
2225
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2226
|
+
EnsureSpace ensure_space(this);
|
2227
|
+
last_pc_ = pc_;
|
2228
|
+
EMIT(0x66);
|
2229
|
+
EMIT(0x0F);
|
2230
|
+
EMIT(0x57);
|
2231
|
+
emit_sse_operand(dst, src);
|
2232
|
+
}
|
2233
|
+
|
2234
|
+
|
2235
|
+
void Assembler::sqrtsd(XMMRegister dst, XMMRegister src) {
|
2236
|
+
EnsureSpace ensure_space(this);
|
2237
|
+
last_pc_ = pc_;
|
2238
|
+
EMIT(0xF2);
|
2239
|
+
EMIT(0x0F);
|
2240
|
+
EMIT(0x51);
|
2241
|
+
emit_sse_operand(dst, src);
|
2242
|
+
}
|
2243
|
+
|
2244
|
+
|
2245
|
+
void Assembler::andpd(XMMRegister dst, XMMRegister src) {
|
2246
|
+
EnsureSpace ensure_space(this);
|
2247
|
+
last_pc_ = pc_;
|
2248
|
+
EMIT(0x66);
|
2249
|
+
EMIT(0x0F);
|
2250
|
+
EMIT(0x54);
|
2251
|
+
emit_sse_operand(dst, src);
|
2252
|
+
}
|
2253
|
+
|
2254
|
+
|
2255
|
+
void Assembler::ucomisd(XMMRegister dst, XMMRegister src) {
|
2256
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2257
|
+
EnsureSpace ensure_space(this);
|
2258
|
+
last_pc_ = pc_;
|
2259
|
+
EMIT(0x66);
|
2260
|
+
EMIT(0x0F);
|
2261
|
+
EMIT(0x2E);
|
2262
|
+
emit_sse_operand(dst, src);
|
2263
|
+
}
|
2264
|
+
|
2265
|
+
|
2266
|
+
void Assembler::movmskpd(Register dst, XMMRegister src) {
|
2267
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2268
|
+
EnsureSpace ensure_space(this);
|
2269
|
+
last_pc_ = pc_;
|
2270
|
+
EMIT(0x66);
|
2271
|
+
EMIT(0x0F);
|
2272
|
+
EMIT(0x50);
|
2273
|
+
emit_sse_operand(dst, src);
|
2274
|
+
}
|
2275
|
+
|
2276
|
+
|
2277
|
+
void Assembler::cmpltsd(XMMRegister dst, XMMRegister src) {
|
2278
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2279
|
+
EnsureSpace ensure_space(this);
|
2280
|
+
last_pc_ = pc_;
|
2281
|
+
EMIT(0xF2);
|
2282
|
+
EMIT(0x0F);
|
2283
|
+
EMIT(0xC2);
|
2284
|
+
emit_sse_operand(dst, src);
|
2285
|
+
EMIT(1); // LT == 1
|
2286
|
+
}
|
2287
|
+
|
2288
|
+
|
2289
|
+
void Assembler::movaps(XMMRegister dst, XMMRegister src) {
|
2290
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2291
|
+
EnsureSpace ensure_space(this);
|
2292
|
+
last_pc_ = pc_;
|
2293
|
+
EMIT(0x0F);
|
2294
|
+
EMIT(0x28);
|
2295
|
+
emit_sse_operand(dst, src);
|
2296
|
+
}
|
2297
|
+
|
2298
|
+
|
2299
|
+
void Assembler::movdqa(const Operand& dst, XMMRegister src) {
|
2300
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2301
|
+
EnsureSpace ensure_space(this);
|
2302
|
+
last_pc_ = pc_;
|
2303
|
+
EMIT(0x66);
|
2304
|
+
EMIT(0x0F);
|
2305
|
+
EMIT(0x7F);
|
2306
|
+
emit_sse_operand(src, dst);
|
2307
|
+
}
|
2308
|
+
|
2309
|
+
|
2310
|
+
void Assembler::movdqa(XMMRegister dst, const Operand& src) {
|
2311
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2312
|
+
EnsureSpace ensure_space(this);
|
2313
|
+
last_pc_ = pc_;
|
2314
|
+
EMIT(0x66);
|
2315
|
+
EMIT(0x0F);
|
2316
|
+
EMIT(0x6F);
|
2317
|
+
emit_sse_operand(dst, src);
|
2318
|
+
}
|
2319
|
+
|
2320
|
+
|
2321
|
+
void Assembler::movdqu(const Operand& dst, XMMRegister src ) {
|
2322
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2323
|
+
EnsureSpace ensure_space(this);
|
2324
|
+
last_pc_ = pc_;
|
2325
|
+
EMIT(0xF3);
|
2326
|
+
EMIT(0x0F);
|
2327
|
+
EMIT(0x7F);
|
2328
|
+
emit_sse_operand(src, dst);
|
2329
|
+
}
|
2330
|
+
|
2331
|
+
|
2332
|
+
void Assembler::movdqu(XMMRegister dst, const Operand& src) {
|
2333
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2334
|
+
EnsureSpace ensure_space(this);
|
2335
|
+
last_pc_ = pc_;
|
2336
|
+
EMIT(0xF3);
|
2337
|
+
EMIT(0x0F);
|
2338
|
+
EMIT(0x6F);
|
2339
|
+
emit_sse_operand(dst, src);
|
2340
|
+
}
|
2341
|
+
|
2342
|
+
|
2343
|
+
void Assembler::movntdqa(XMMRegister dst, const Operand& src) {
|
2344
|
+
ASSERT(CpuFeatures::IsEnabled(SSE4_1));
|
2345
|
+
EnsureSpace ensure_space(this);
|
2346
|
+
last_pc_ = pc_;
|
2347
|
+
EMIT(0x66);
|
2348
|
+
EMIT(0x0F);
|
2349
|
+
EMIT(0x38);
|
2350
|
+
EMIT(0x2A);
|
2351
|
+
emit_sse_operand(dst, src);
|
2352
|
+
}
|
2353
|
+
|
2354
|
+
|
2355
|
+
void Assembler::movntdq(const Operand& dst, XMMRegister src) {
|
2356
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2357
|
+
EnsureSpace ensure_space(this);
|
2358
|
+
last_pc_ = pc_;
|
2359
|
+
EMIT(0x66);
|
2360
|
+
EMIT(0x0F);
|
2361
|
+
EMIT(0xE7);
|
2362
|
+
emit_sse_operand(src, dst);
|
2363
|
+
}
|
2364
|
+
|
2365
|
+
|
2366
|
+
void Assembler::prefetch(const Operand& src, int level) {
|
2367
|
+
ASSERT(is_uint2(level));
|
2368
|
+
EnsureSpace ensure_space(this);
|
2369
|
+
last_pc_ = pc_;
|
2370
|
+
EMIT(0x0F);
|
2371
|
+
EMIT(0x18);
|
2372
|
+
XMMRegister code = { level }; // Emit hint number in Reg position of RegR/M.
|
2373
|
+
emit_sse_operand(code, src);
|
2374
|
+
}
|
2375
|
+
|
2376
|
+
|
2377
|
+
void Assembler::movdbl(XMMRegister dst, const Operand& src) {
|
2378
|
+
EnsureSpace ensure_space(this);
|
2379
|
+
last_pc_ = pc_;
|
2380
|
+
movsd(dst, src);
|
2381
|
+
}
|
2382
|
+
|
2383
|
+
|
2384
|
+
void Assembler::movdbl(const Operand& dst, XMMRegister src) {
|
2385
|
+
EnsureSpace ensure_space(this);
|
2386
|
+
last_pc_ = pc_;
|
2387
|
+
movsd(dst, src);
|
2388
|
+
}
|
2389
|
+
|
2390
|
+
|
2391
|
+
void Assembler::movsd(const Operand& dst, XMMRegister src ) {
|
2392
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2393
|
+
EnsureSpace ensure_space(this);
|
2394
|
+
last_pc_ = pc_;
|
2395
|
+
EMIT(0xF2); // double
|
2396
|
+
EMIT(0x0F);
|
2397
|
+
EMIT(0x11); // store
|
2398
|
+
emit_sse_operand(src, dst);
|
2399
|
+
}
|
2400
|
+
|
2401
|
+
|
2402
|
+
void Assembler::movsd(XMMRegister dst, const Operand& src) {
|
2403
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2404
|
+
EnsureSpace ensure_space(this);
|
2405
|
+
last_pc_ = pc_;
|
2406
|
+
EMIT(0xF2); // double
|
2407
|
+
EMIT(0x0F);
|
2408
|
+
EMIT(0x10); // load
|
2409
|
+
emit_sse_operand(dst, src);
|
2410
|
+
}
|
2411
|
+
|
2412
|
+
|
2413
|
+
void Assembler::movsd(XMMRegister dst, XMMRegister src) {
|
2414
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2415
|
+
EnsureSpace ensure_space(this);
|
2416
|
+
last_pc_ = pc_;
|
2417
|
+
EMIT(0xF2);
|
2418
|
+
EMIT(0x0F);
|
2419
|
+
EMIT(0x10);
|
2420
|
+
emit_sse_operand(dst, src);
|
2421
|
+
}
|
2422
|
+
|
2423
|
+
|
2424
|
+
void Assembler::movd(XMMRegister dst, const Operand& src) {
|
2425
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2426
|
+
EnsureSpace ensure_space(this);
|
2427
|
+
last_pc_ = pc_;
|
2428
|
+
EMIT(0x66);
|
2429
|
+
EMIT(0x0F);
|
2430
|
+
EMIT(0x6E);
|
2431
|
+
emit_sse_operand(dst, src);
|
2432
|
+
}
|
2433
|
+
|
2434
|
+
|
2435
|
+
void Assembler::movd(const Operand& dst, XMMRegister src) {
|
2436
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2437
|
+
EnsureSpace ensure_space(this);
|
2438
|
+
last_pc_ = pc_;
|
2439
|
+
EMIT(0x66);
|
2440
|
+
EMIT(0x0F);
|
2441
|
+
EMIT(0x7E);
|
2442
|
+
emit_sse_operand(src, dst);
|
2443
|
+
}
|
2444
|
+
|
2445
|
+
|
2446
|
+
void Assembler::pand(XMMRegister dst, XMMRegister src) {
|
2447
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2448
|
+
EnsureSpace ensure_space(this);
|
2449
|
+
last_pc_ = pc_;
|
2450
|
+
EMIT(0x66);
|
2451
|
+
EMIT(0x0F);
|
2452
|
+
EMIT(0xDB);
|
2453
|
+
emit_sse_operand(dst, src);
|
2454
|
+
}
|
2455
|
+
|
2456
|
+
|
2457
|
+
void Assembler::pxor(XMMRegister dst, XMMRegister src) {
|
2458
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2459
|
+
EnsureSpace ensure_space(this);
|
2460
|
+
last_pc_ = pc_;
|
2461
|
+
EMIT(0x66);
|
2462
|
+
EMIT(0x0F);
|
2463
|
+
EMIT(0xEF);
|
2464
|
+
emit_sse_operand(dst, src);
|
2465
|
+
}
|
2466
|
+
|
2467
|
+
|
2468
|
+
void Assembler::por(XMMRegister dst, XMMRegister src) {
|
2469
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2470
|
+
EnsureSpace ensure_space(this);
|
2471
|
+
last_pc_ = pc_;
|
2472
|
+
EMIT(0x66);
|
2473
|
+
EMIT(0x0F);
|
2474
|
+
EMIT(0xEB);
|
2475
|
+
emit_sse_operand(dst, src);
|
2476
|
+
}
|
2477
|
+
|
2478
|
+
|
2479
|
+
void Assembler::ptest(XMMRegister dst, XMMRegister src) {
|
2480
|
+
ASSERT(CpuFeatures::IsEnabled(SSE4_1));
|
2481
|
+
EnsureSpace ensure_space(this);
|
2482
|
+
last_pc_ = pc_;
|
2483
|
+
EMIT(0x66);
|
2484
|
+
EMIT(0x0F);
|
2485
|
+
EMIT(0x38);
|
2486
|
+
EMIT(0x17);
|
2487
|
+
emit_sse_operand(dst, src);
|
2488
|
+
}
|
2489
|
+
|
2490
|
+
|
2491
|
+
void Assembler::psllq(XMMRegister reg, int8_t shift) {
|
2492
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2493
|
+
EnsureSpace ensure_space(this);
|
2494
|
+
last_pc_ = pc_;
|
2495
|
+
EMIT(0x66);
|
2496
|
+
EMIT(0x0F);
|
2497
|
+
EMIT(0x73);
|
2498
|
+
emit_sse_operand(esi, reg); // esi == 6
|
2499
|
+
EMIT(shift);
|
2500
|
+
}
|
2501
|
+
|
2502
|
+
|
2503
|
+
void Assembler::psllq(XMMRegister dst, XMMRegister src) {
|
2504
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2505
|
+
EnsureSpace ensure_space(this);
|
2506
|
+
last_pc_ = pc_;
|
2507
|
+
EMIT(0x66);
|
2508
|
+
EMIT(0x0F);
|
2509
|
+
EMIT(0xF3);
|
2510
|
+
emit_sse_operand(dst, src);
|
2511
|
+
}
|
2512
|
+
|
2513
|
+
|
2514
|
+
void Assembler::psrlq(XMMRegister reg, int8_t shift) {
|
2515
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2516
|
+
EnsureSpace ensure_space(this);
|
2517
|
+
last_pc_ = pc_;
|
2518
|
+
EMIT(0x66);
|
2519
|
+
EMIT(0x0F);
|
2520
|
+
EMIT(0x73);
|
2521
|
+
emit_sse_operand(edx, reg); // edx == 2
|
2522
|
+
EMIT(shift);
|
2523
|
+
}
|
2524
|
+
|
2525
|
+
|
2526
|
+
void Assembler::psrlq(XMMRegister dst, XMMRegister src) {
|
2527
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2528
|
+
EnsureSpace ensure_space(this);
|
2529
|
+
last_pc_ = pc_;
|
2530
|
+
EMIT(0x66);
|
2531
|
+
EMIT(0x0F);
|
2532
|
+
EMIT(0xD3);
|
2533
|
+
emit_sse_operand(dst, src);
|
2534
|
+
}
|
2535
|
+
|
2536
|
+
|
2537
|
+
void Assembler::pshufd(XMMRegister dst, XMMRegister src, int8_t shuffle) {
|
2538
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2539
|
+
EnsureSpace ensure_space(this);
|
2540
|
+
last_pc_ = pc_;
|
2541
|
+
EMIT(0x66);
|
2542
|
+
EMIT(0x0F);
|
2543
|
+
EMIT(0x70);
|
2544
|
+
emit_sse_operand(dst, src);
|
2545
|
+
EMIT(shuffle);
|
2546
|
+
}
|
2547
|
+
|
2548
|
+
|
2549
|
+
void Assembler::pextrd(const Operand& dst, XMMRegister src, int8_t offset) {
|
2550
|
+
ASSERT(CpuFeatures::IsEnabled(SSE4_1));
|
2551
|
+
EnsureSpace ensure_space(this);
|
2552
|
+
last_pc_ = pc_;
|
2553
|
+
EMIT(0x66);
|
2554
|
+
EMIT(0x0F);
|
2555
|
+
EMIT(0x3A);
|
2556
|
+
EMIT(0x16);
|
2557
|
+
emit_sse_operand(src, dst);
|
2558
|
+
EMIT(offset);
|
2559
|
+
}
|
2560
|
+
|
2561
|
+
|
2562
|
+
void Assembler::pinsrd(XMMRegister dst, const Operand& src, int8_t offset) {
|
2563
|
+
ASSERT(CpuFeatures::IsEnabled(SSE4_1));
|
2564
|
+
EnsureSpace ensure_space(this);
|
2565
|
+
last_pc_ = pc_;
|
2566
|
+
EMIT(0x66);
|
2567
|
+
EMIT(0x0F);
|
2568
|
+
EMIT(0x3A);
|
2569
|
+
EMIT(0x22);
|
2570
|
+
emit_sse_operand(dst, src);
|
2571
|
+
EMIT(offset);
|
2572
|
+
}
|
2573
|
+
|
2574
|
+
|
2575
|
+
void Assembler::emit_sse_operand(XMMRegister reg, const Operand& adr) {
|
2576
|
+
Register ireg = { reg.code() };
|
2577
|
+
emit_operand(ireg, adr);
|
2578
|
+
}
|
2579
|
+
|
2580
|
+
|
2581
|
+
void Assembler::emit_sse_operand(XMMRegister dst, XMMRegister src) {
|
2582
|
+
EMIT(0xC0 | dst.code() << 3 | src.code());
|
2583
|
+
}
|
2584
|
+
|
2585
|
+
|
2586
|
+
void Assembler::emit_sse_operand(Register dst, XMMRegister src) {
|
2587
|
+
EMIT(0xC0 | dst.code() << 3 | src.code());
|
2588
|
+
}
|
2589
|
+
|
2590
|
+
|
2591
|
+
void Assembler::Print() {
|
2592
|
+
Disassembler::Decode(stdout, buffer_, pc_);
|
2593
|
+
}
|
2594
|
+
|
2595
|
+
|
2596
|
+
void Assembler::RecordJSReturn() {
|
2597
|
+
positions_recorder()->WriteRecordedPositions();
|
2598
|
+
EnsureSpace ensure_space(this);
|
2599
|
+
RecordRelocInfo(RelocInfo::JS_RETURN);
|
2600
|
+
}
|
2601
|
+
|
2602
|
+
|
2603
|
+
void Assembler::RecordDebugBreakSlot() {
|
2604
|
+
positions_recorder()->WriteRecordedPositions();
|
2605
|
+
EnsureSpace ensure_space(this);
|
2606
|
+
RecordRelocInfo(RelocInfo::DEBUG_BREAK_SLOT);
|
2607
|
+
}
|
2608
|
+
|
2609
|
+
|
2610
|
+
void Assembler::RecordComment(const char* msg, bool force) {
|
2611
|
+
if (FLAG_code_comments || force) {
|
2612
|
+
EnsureSpace ensure_space(this);
|
2613
|
+
RecordRelocInfo(RelocInfo::COMMENT, reinterpret_cast<intptr_t>(msg));
|
2614
|
+
}
|
2615
|
+
}
|
2616
|
+
|
2617
|
+
|
2618
|
+
void Assembler::GrowBuffer() {
|
2619
|
+
ASSERT(overflow());
|
2620
|
+
if (!own_buffer_) FATAL("external code buffer is too small");
|
2621
|
+
|
2622
|
+
// Compute new buffer size.
|
2623
|
+
CodeDesc desc; // the new buffer
|
2624
|
+
if (buffer_size_ < 4*KB) {
|
2625
|
+
desc.buffer_size = 4*KB;
|
2626
|
+
} else {
|
2627
|
+
desc.buffer_size = 2*buffer_size_;
|
2628
|
+
}
|
2629
|
+
// Some internal data structures overflow for very large buffers,
|
2630
|
+
// they must ensure that kMaximalBufferSize is not too large.
|
2631
|
+
if ((desc.buffer_size > kMaximalBufferSize) ||
|
2632
|
+
(desc.buffer_size > Heap::MaxOldGenerationSize())) {
|
2633
|
+
V8::FatalProcessOutOfMemory("Assembler::GrowBuffer");
|
2634
|
+
}
|
2635
|
+
|
2636
|
+
// Setup new buffer.
|
2637
|
+
desc.buffer = NewArray<byte>(desc.buffer_size);
|
2638
|
+
desc.instr_size = pc_offset();
|
2639
|
+
desc.reloc_size = (buffer_ + buffer_size_) - (reloc_info_writer.pos());
|
2640
|
+
|
2641
|
+
// Clear the buffer in debug mode. Use 'int3' instructions to make
|
2642
|
+
// sure to get into problems if we ever run uninitialized code.
|
2643
|
+
#ifdef DEBUG
|
2644
|
+
memset(desc.buffer, 0xCC, desc.buffer_size);
|
2645
|
+
#endif
|
2646
|
+
|
2647
|
+
// Copy the data.
|
2648
|
+
int pc_delta = desc.buffer - buffer_;
|
2649
|
+
int rc_delta = (desc.buffer + desc.buffer_size) - (buffer_ + buffer_size_);
|
2650
|
+
memmove(desc.buffer, buffer_, desc.instr_size);
|
2651
|
+
memmove(rc_delta + reloc_info_writer.pos(),
|
2652
|
+
reloc_info_writer.pos(), desc.reloc_size);
|
2653
|
+
|
2654
|
+
// Switch buffers.
|
2655
|
+
if (spare_buffer_ == NULL && buffer_size_ == kMinimalBufferSize) {
|
2656
|
+
spare_buffer_ = buffer_;
|
2657
|
+
} else {
|
2658
|
+
DeleteArray(buffer_);
|
2659
|
+
}
|
2660
|
+
buffer_ = desc.buffer;
|
2661
|
+
buffer_size_ = desc.buffer_size;
|
2662
|
+
pc_ += pc_delta;
|
2663
|
+
if (last_pc_ != NULL) {
|
2664
|
+
last_pc_ += pc_delta;
|
2665
|
+
}
|
2666
|
+
reloc_info_writer.Reposition(reloc_info_writer.pos() + rc_delta,
|
2667
|
+
reloc_info_writer.last_pc() + pc_delta);
|
2668
|
+
|
2669
|
+
// Relocate runtime entries.
|
2670
|
+
for (RelocIterator it(desc); !it.done(); it.next()) {
|
2671
|
+
RelocInfo::Mode rmode = it.rinfo()->rmode();
|
2672
|
+
if (rmode == RelocInfo::RUNTIME_ENTRY) {
|
2673
|
+
int32_t* p = reinterpret_cast<int32_t*>(it.rinfo()->pc());
|
2674
|
+
*p -= pc_delta; // relocate entry
|
2675
|
+
} else if (rmode == RelocInfo::INTERNAL_REFERENCE) {
|
2676
|
+
int32_t* p = reinterpret_cast<int32_t*>(it.rinfo()->pc());
|
2677
|
+
if (*p != 0) { // 0 means uninitialized.
|
2678
|
+
*p += pc_delta;
|
2679
|
+
}
|
2680
|
+
}
|
2681
|
+
}
|
2682
|
+
|
2683
|
+
ASSERT(!overflow());
|
2684
|
+
}
|
2685
|
+
|
2686
|
+
|
2687
|
+
void Assembler::emit_arith_b(int op1, int op2, Register dst, int imm8) {
|
2688
|
+
ASSERT(is_uint8(op1) && is_uint8(op2)); // wrong opcode
|
2689
|
+
ASSERT(is_uint8(imm8));
|
2690
|
+
ASSERT((op1 & 0x01) == 0); // should be 8bit operation
|
2691
|
+
EMIT(op1);
|
2692
|
+
EMIT(op2 | dst.code());
|
2693
|
+
EMIT(imm8);
|
2694
|
+
}
|
2695
|
+
|
2696
|
+
|
2697
|
+
void Assembler::emit_arith(int sel, Operand dst, const Immediate& x) {
|
2698
|
+
ASSERT((0 <= sel) && (sel <= 7));
|
2699
|
+
Register ireg = { sel };
|
2700
|
+
if (x.is_int8()) {
|
2701
|
+
EMIT(0x83); // using a sign-extended 8-bit immediate.
|
2702
|
+
emit_operand(ireg, dst);
|
2703
|
+
EMIT(x.x_ & 0xFF);
|
2704
|
+
} else if (dst.is_reg(eax)) {
|
2705
|
+
EMIT((sel << 3) | 0x05); // short form if the destination is eax.
|
2706
|
+
emit(x);
|
2707
|
+
} else {
|
2708
|
+
EMIT(0x81); // using a literal 32-bit immediate.
|
2709
|
+
emit_operand(ireg, dst);
|
2710
|
+
emit(x);
|
2711
|
+
}
|
2712
|
+
}
|
2713
|
+
|
2714
|
+
|
2715
|
+
void Assembler::emit_operand(Register reg, const Operand& adr) {
|
2716
|
+
const unsigned length = adr.len_;
|
2717
|
+
ASSERT(length > 0);
|
2718
|
+
|
2719
|
+
// Emit updated ModRM byte containing the given register.
|
2720
|
+
pc_[0] = (adr.buf_[0] & ~0x38) | (reg.code() << 3);
|
2721
|
+
|
2722
|
+
// Emit the rest of the encoded operand.
|
2723
|
+
for (unsigned i = 1; i < length; i++) pc_[i] = adr.buf_[i];
|
2724
|
+
pc_ += length;
|
2725
|
+
|
2726
|
+
// Emit relocation information if necessary.
|
2727
|
+
if (length >= sizeof(int32_t) && adr.rmode_ != RelocInfo::NONE) {
|
2728
|
+
pc_ -= sizeof(int32_t); // pc_ must be *at* disp32
|
2729
|
+
RecordRelocInfo(adr.rmode_);
|
2730
|
+
pc_ += sizeof(int32_t);
|
2731
|
+
}
|
2732
|
+
}
|
2733
|
+
|
2734
|
+
|
2735
|
+
void Assembler::emit_farith(int b1, int b2, int i) {
|
2736
|
+
ASSERT(is_uint8(b1) && is_uint8(b2)); // wrong opcode
|
2737
|
+
ASSERT(0 <= i && i < 8); // illegal stack offset
|
2738
|
+
EMIT(b1);
|
2739
|
+
EMIT(b2 + i);
|
2740
|
+
}
|
2741
|
+
|
2742
|
+
|
2743
|
+
void Assembler::db(uint8_t data) {
|
2744
|
+
EnsureSpace ensure_space(this);
|
2745
|
+
EMIT(data);
|
2746
|
+
}
|
2747
|
+
|
2748
|
+
|
2749
|
+
void Assembler::dd(uint32_t data) {
|
2750
|
+
EnsureSpace ensure_space(this);
|
2751
|
+
emit(data);
|
2752
|
+
}
|
2753
|
+
|
2754
|
+
|
2755
|
+
void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
|
2756
|
+
ASSERT(rmode != RelocInfo::NONE);
|
2757
|
+
// Don't record external references unless the heap will be serialized.
|
2758
|
+
if (rmode == RelocInfo::EXTERNAL_REFERENCE) {
|
2759
|
+
#ifdef DEBUG
|
2760
|
+
if (!Serializer::enabled()) {
|
2761
|
+
Serializer::TooLateToEnableNow();
|
2762
|
+
}
|
2763
|
+
#endif
|
2764
|
+
if (!Serializer::enabled() && !FLAG_debug_code) {
|
2765
|
+
return;
|
2766
|
+
}
|
2767
|
+
}
|
2768
|
+
RelocInfo rinfo(pc_, rmode, data);
|
2769
|
+
reloc_info_writer.Write(&rinfo);
|
2770
|
+
}
|
2771
|
+
|
2772
|
+
|
2773
|
+
#ifdef GENERATED_CODE_COVERAGE
|
2774
|
+
static FILE* coverage_log = NULL;
|
2775
|
+
|
2776
|
+
|
2777
|
+
static void InitCoverageLog() {
|
2778
|
+
char* file_name = getenv("V8_GENERATED_CODE_COVERAGE_LOG");
|
2779
|
+
if (file_name != NULL) {
|
2780
|
+
coverage_log = fopen(file_name, "aw+");
|
2781
|
+
}
|
2782
|
+
}
|
2783
|
+
|
2784
|
+
|
2785
|
+
void LogGeneratedCodeCoverage(const char* file_line) {
|
2786
|
+
const char* return_address = (&file_line)[-1];
|
2787
|
+
char* push_insn = const_cast<char*>(return_address - 12);
|
2788
|
+
push_insn[0] = 0xeb; // Relative branch insn.
|
2789
|
+
push_insn[1] = 13; // Skip over coverage insns.
|
2790
|
+
if (coverage_log != NULL) {
|
2791
|
+
fprintf(coverage_log, "%s\n", file_line);
|
2792
|
+
fflush(coverage_log);
|
2793
|
+
}
|
2794
|
+
}
|
2795
|
+
|
2796
|
+
#endif
|
2797
|
+
|
2798
|
+
} } // namespace v8::internal
|
2799
|
+
|
2800
|
+
#endif // V8_TARGET_ARCH_IA32
|