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,2756 @@
|
|
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
|
34
|
+
// modified 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_ARM)
|
40
|
+
|
41
|
+
#include "arm/assembler-arm-inl.h"
|
42
|
+
#include "serialize.h"
|
43
|
+
|
44
|
+
namespace v8 {
|
45
|
+
namespace internal {
|
46
|
+
|
47
|
+
// Safe default is no features.
|
48
|
+
unsigned CpuFeatures::supported_ = 0;
|
49
|
+
unsigned CpuFeatures::enabled_ = 0;
|
50
|
+
unsigned CpuFeatures::found_by_runtime_probing_ = 0;
|
51
|
+
|
52
|
+
|
53
|
+
#ifdef __arm__
|
54
|
+
static uint64_t CpuFeaturesImpliedByCompiler() {
|
55
|
+
uint64_t answer = 0;
|
56
|
+
#ifdef CAN_USE_ARMV7_INSTRUCTIONS
|
57
|
+
answer |= 1u << ARMv7;
|
58
|
+
#endif // def CAN_USE_ARMV7_INSTRUCTIONS
|
59
|
+
// If the compiler is allowed to use VFP then we can use VFP too in our code
|
60
|
+
// generation even when generating snapshots. This won't work for cross
|
61
|
+
// compilation.
|
62
|
+
#if defined(__VFP_FP__) && !defined(__SOFTFP__)
|
63
|
+
answer |= 1u << VFP3;
|
64
|
+
#endif // defined(__VFP_FP__) && !defined(__SOFTFP__)
|
65
|
+
#ifdef CAN_USE_VFP_INSTRUCTIONS
|
66
|
+
answer |= 1u << VFP3;
|
67
|
+
#endif // def CAN_USE_VFP_INSTRUCTIONS
|
68
|
+
return answer;
|
69
|
+
}
|
70
|
+
#endif // def __arm__
|
71
|
+
|
72
|
+
|
73
|
+
void CpuFeatures::Probe(bool portable) {
|
74
|
+
#ifndef __arm__
|
75
|
+
// For the simulator=arm build, use VFP when FLAG_enable_vfp3 is enabled.
|
76
|
+
if (FLAG_enable_vfp3) {
|
77
|
+
supported_ |= 1u << VFP3;
|
78
|
+
}
|
79
|
+
// For the simulator=arm build, use ARMv7 when FLAG_enable_armv7 is enabled
|
80
|
+
if (FLAG_enable_armv7) {
|
81
|
+
supported_ |= 1u << ARMv7;
|
82
|
+
}
|
83
|
+
#else // def __arm__
|
84
|
+
if (portable && Serializer::enabled()) {
|
85
|
+
supported_ |= OS::CpuFeaturesImpliedByPlatform();
|
86
|
+
supported_ |= CpuFeaturesImpliedByCompiler();
|
87
|
+
return; // No features if we might serialize.
|
88
|
+
}
|
89
|
+
|
90
|
+
if (OS::ArmCpuHasFeature(VFP3)) {
|
91
|
+
// This implementation also sets the VFP flags if
|
92
|
+
// runtime detection of VFP returns true.
|
93
|
+
supported_ |= 1u << VFP3;
|
94
|
+
found_by_runtime_probing_ |= 1u << VFP3;
|
95
|
+
}
|
96
|
+
|
97
|
+
if (OS::ArmCpuHasFeature(ARMv7)) {
|
98
|
+
supported_ |= 1u << ARMv7;
|
99
|
+
found_by_runtime_probing_ |= 1u << ARMv7;
|
100
|
+
}
|
101
|
+
|
102
|
+
if (!portable) found_by_runtime_probing_ = 0;
|
103
|
+
#endif
|
104
|
+
}
|
105
|
+
|
106
|
+
|
107
|
+
// -----------------------------------------------------------------------------
|
108
|
+
// Implementation of RelocInfo
|
109
|
+
|
110
|
+
const int RelocInfo::kApplyMask = 0;
|
111
|
+
|
112
|
+
|
113
|
+
bool RelocInfo::IsCodedSpecially() {
|
114
|
+
// The deserializer needs to know whether a pointer is specially coded. Being
|
115
|
+
// specially coded on ARM means that it is a movw/movt instruction. We don't
|
116
|
+
// generate those yet.
|
117
|
+
return false;
|
118
|
+
}
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
void RelocInfo::PatchCode(byte* instructions, int instruction_count) {
|
123
|
+
// Patch the code at the current address with the supplied instructions.
|
124
|
+
Instr* pc = reinterpret_cast<Instr*>(pc_);
|
125
|
+
Instr* instr = reinterpret_cast<Instr*>(instructions);
|
126
|
+
for (int i = 0; i < instruction_count; i++) {
|
127
|
+
*(pc + i) = *(instr + i);
|
128
|
+
}
|
129
|
+
|
130
|
+
// Indicate that code has changed.
|
131
|
+
CPU::FlushICache(pc_, instruction_count * Assembler::kInstrSize);
|
132
|
+
}
|
133
|
+
|
134
|
+
|
135
|
+
// Patch the code at the current PC with a call to the target address.
|
136
|
+
// Additional guard instructions can be added if required.
|
137
|
+
void RelocInfo::PatchCodeWithCall(Address target, int guard_bytes) {
|
138
|
+
// Patch the code at the current address with a call to the target.
|
139
|
+
UNIMPLEMENTED();
|
140
|
+
}
|
141
|
+
|
142
|
+
|
143
|
+
// -----------------------------------------------------------------------------
|
144
|
+
// Implementation of Operand and MemOperand
|
145
|
+
// See assembler-arm-inl.h for inlined constructors
|
146
|
+
|
147
|
+
Operand::Operand(Handle<Object> handle) {
|
148
|
+
rm_ = no_reg;
|
149
|
+
// Verify all Objects referred by code are NOT in new space.
|
150
|
+
Object* obj = *handle;
|
151
|
+
ASSERT(!Heap::InNewSpace(obj));
|
152
|
+
if (obj->IsHeapObject()) {
|
153
|
+
imm32_ = reinterpret_cast<intptr_t>(handle.location());
|
154
|
+
rmode_ = RelocInfo::EMBEDDED_OBJECT;
|
155
|
+
} else {
|
156
|
+
// no relocation needed
|
157
|
+
imm32_ = reinterpret_cast<intptr_t>(obj);
|
158
|
+
rmode_ = RelocInfo::NONE;
|
159
|
+
}
|
160
|
+
}
|
161
|
+
|
162
|
+
|
163
|
+
Operand::Operand(Register rm, ShiftOp shift_op, int shift_imm) {
|
164
|
+
ASSERT(is_uint5(shift_imm));
|
165
|
+
ASSERT(shift_op != ROR || shift_imm != 0); // use RRX if you mean it
|
166
|
+
rm_ = rm;
|
167
|
+
rs_ = no_reg;
|
168
|
+
shift_op_ = shift_op;
|
169
|
+
shift_imm_ = shift_imm & 31;
|
170
|
+
if (shift_op == RRX) {
|
171
|
+
// encoded as ROR with shift_imm == 0
|
172
|
+
ASSERT(shift_imm == 0);
|
173
|
+
shift_op_ = ROR;
|
174
|
+
shift_imm_ = 0;
|
175
|
+
}
|
176
|
+
}
|
177
|
+
|
178
|
+
|
179
|
+
Operand::Operand(Register rm, ShiftOp shift_op, Register rs) {
|
180
|
+
ASSERT(shift_op != RRX);
|
181
|
+
rm_ = rm;
|
182
|
+
rs_ = no_reg;
|
183
|
+
shift_op_ = shift_op;
|
184
|
+
rs_ = rs;
|
185
|
+
}
|
186
|
+
|
187
|
+
|
188
|
+
MemOperand::MemOperand(Register rn, int32_t offset, AddrMode am) {
|
189
|
+
rn_ = rn;
|
190
|
+
rm_ = no_reg;
|
191
|
+
offset_ = offset;
|
192
|
+
am_ = am;
|
193
|
+
}
|
194
|
+
|
195
|
+
MemOperand::MemOperand(Register rn, Register rm, AddrMode am) {
|
196
|
+
rn_ = rn;
|
197
|
+
rm_ = rm;
|
198
|
+
shift_op_ = LSL;
|
199
|
+
shift_imm_ = 0;
|
200
|
+
am_ = am;
|
201
|
+
}
|
202
|
+
|
203
|
+
|
204
|
+
MemOperand::MemOperand(Register rn, Register rm,
|
205
|
+
ShiftOp shift_op, int shift_imm, AddrMode am) {
|
206
|
+
ASSERT(is_uint5(shift_imm));
|
207
|
+
rn_ = rn;
|
208
|
+
rm_ = rm;
|
209
|
+
shift_op_ = shift_op;
|
210
|
+
shift_imm_ = shift_imm & 31;
|
211
|
+
am_ = am;
|
212
|
+
}
|
213
|
+
|
214
|
+
|
215
|
+
// -----------------------------------------------------------------------------
|
216
|
+
// Specific instructions, constants, and masks.
|
217
|
+
|
218
|
+
// add(sp, sp, 4) instruction (aka Pop())
|
219
|
+
const Instr kPopInstruction =
|
220
|
+
al | PostIndex | 4 | LeaveCC | I | sp.code() * B16 | sp.code() * B12;
|
221
|
+
// str(r, MemOperand(sp, 4, NegPreIndex), al) instruction (aka push(r))
|
222
|
+
// register r is not encoded.
|
223
|
+
const Instr kPushRegPattern =
|
224
|
+
al | B26 | 4 | NegPreIndex | sp.code() * B16;
|
225
|
+
// ldr(r, MemOperand(sp, 4, PostIndex), al) instruction (aka pop(r))
|
226
|
+
// register r is not encoded.
|
227
|
+
const Instr kPopRegPattern =
|
228
|
+
al | B26 | L | 4 | PostIndex | sp.code() * B16;
|
229
|
+
// mov lr, pc
|
230
|
+
const Instr kMovLrPc = al | MOV | pc.code() | lr.code() * B12;
|
231
|
+
// ldr rd, [pc, #offset]
|
232
|
+
const Instr kLdrPCMask = kCondMask | 15 * B24 | 7 * B20 | 15 * B16;
|
233
|
+
const Instr kLdrPCPattern = al | 5 * B24 | L | pc.code() * B16;
|
234
|
+
// blxcc rm
|
235
|
+
const Instr kBlxRegMask =
|
236
|
+
15 * B24 | 15 * B20 | 15 * B16 | 15 * B12 | 15 * B8 | 15 * B4;
|
237
|
+
const Instr kBlxRegPattern =
|
238
|
+
B24 | B21 | 15 * B16 | 15 * B12 | 15 * B8 | BLX;
|
239
|
+
const Instr kMovMvnMask = 0x6d * B21 | 0xf * B16;
|
240
|
+
const Instr kMovMvnPattern = 0xd * B21;
|
241
|
+
const Instr kMovMvnFlip = B22;
|
242
|
+
const Instr kMovLeaveCCMask = 0xdff * B16;
|
243
|
+
const Instr kMovLeaveCCPattern = 0x1a0 * B16;
|
244
|
+
const Instr kMovwMask = 0xff * B20;
|
245
|
+
const Instr kMovwPattern = 0x30 * B20;
|
246
|
+
const Instr kMovwLeaveCCFlip = 0x5 * B21;
|
247
|
+
const Instr kCmpCmnMask = 0xdd * B20 | 0xf * B12;
|
248
|
+
const Instr kCmpCmnPattern = 0x15 * B20;
|
249
|
+
const Instr kCmpCmnFlip = B21;
|
250
|
+
const Instr kAddSubFlip = 0x6 * B21;
|
251
|
+
const Instr kAndBicFlip = 0xe * B21;
|
252
|
+
|
253
|
+
// A mask for the Rd register for push, pop, ldr, str instructions.
|
254
|
+
const Instr kLdrRegFpOffsetPattern =
|
255
|
+
al | B26 | L | Offset | fp.code() * B16;
|
256
|
+
const Instr kStrRegFpOffsetPattern =
|
257
|
+
al | B26 | Offset | fp.code() * B16;
|
258
|
+
const Instr kLdrRegFpNegOffsetPattern =
|
259
|
+
al | B26 | L | NegOffset | fp.code() * B16;
|
260
|
+
const Instr kStrRegFpNegOffsetPattern =
|
261
|
+
al | B26 | NegOffset | fp.code() * B16;
|
262
|
+
const Instr kLdrStrInstrTypeMask = 0xffff0000;
|
263
|
+
const Instr kLdrStrInstrArgumentMask = 0x0000ffff;
|
264
|
+
const Instr kLdrStrOffsetMask = 0x00000fff;
|
265
|
+
|
266
|
+
|
267
|
+
// Spare buffer.
|
268
|
+
static const int kMinimalBufferSize = 4*KB;
|
269
|
+
static byte* spare_buffer_ = NULL;
|
270
|
+
|
271
|
+
|
272
|
+
Assembler::Assembler(void* buffer, int buffer_size)
|
273
|
+
: positions_recorder_(this),
|
274
|
+
allow_peephole_optimization_(false) {
|
275
|
+
allow_peephole_optimization_ = FLAG_peephole_optimization;
|
276
|
+
if (buffer == NULL) {
|
277
|
+
// Do our own buffer management.
|
278
|
+
if (buffer_size <= kMinimalBufferSize) {
|
279
|
+
buffer_size = kMinimalBufferSize;
|
280
|
+
|
281
|
+
if (spare_buffer_ != NULL) {
|
282
|
+
buffer = spare_buffer_;
|
283
|
+
spare_buffer_ = NULL;
|
284
|
+
}
|
285
|
+
}
|
286
|
+
if (buffer == NULL) {
|
287
|
+
buffer_ = NewArray<byte>(buffer_size);
|
288
|
+
} else {
|
289
|
+
buffer_ = static_cast<byte*>(buffer);
|
290
|
+
}
|
291
|
+
buffer_size_ = buffer_size;
|
292
|
+
own_buffer_ = true;
|
293
|
+
|
294
|
+
} else {
|
295
|
+
// Use externally provided buffer instead.
|
296
|
+
ASSERT(buffer_size > 0);
|
297
|
+
buffer_ = static_cast<byte*>(buffer);
|
298
|
+
buffer_size_ = buffer_size;
|
299
|
+
own_buffer_ = false;
|
300
|
+
}
|
301
|
+
|
302
|
+
// Setup buffer pointers.
|
303
|
+
ASSERT(buffer_ != NULL);
|
304
|
+
pc_ = buffer_;
|
305
|
+
reloc_info_writer.Reposition(buffer_ + buffer_size, pc_);
|
306
|
+
num_prinfo_ = 0;
|
307
|
+
next_buffer_check_ = 0;
|
308
|
+
const_pool_blocked_nesting_ = 0;
|
309
|
+
no_const_pool_before_ = 0;
|
310
|
+
last_const_pool_end_ = 0;
|
311
|
+
last_bound_pos_ = 0;
|
312
|
+
}
|
313
|
+
|
314
|
+
|
315
|
+
Assembler::~Assembler() {
|
316
|
+
ASSERT(const_pool_blocked_nesting_ == 0);
|
317
|
+
if (own_buffer_) {
|
318
|
+
if (spare_buffer_ == NULL && buffer_size_ == kMinimalBufferSize) {
|
319
|
+
spare_buffer_ = buffer_;
|
320
|
+
} else {
|
321
|
+
DeleteArray(buffer_);
|
322
|
+
}
|
323
|
+
}
|
324
|
+
}
|
325
|
+
|
326
|
+
|
327
|
+
void Assembler::GetCode(CodeDesc* desc) {
|
328
|
+
// Emit constant pool if necessary.
|
329
|
+
CheckConstPool(true, false);
|
330
|
+
ASSERT(num_prinfo_ == 0);
|
331
|
+
|
332
|
+
// Setup code descriptor.
|
333
|
+
desc->buffer = buffer_;
|
334
|
+
desc->buffer_size = buffer_size_;
|
335
|
+
desc->instr_size = pc_offset();
|
336
|
+
desc->reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos();
|
337
|
+
}
|
338
|
+
|
339
|
+
|
340
|
+
void Assembler::Align(int m) {
|
341
|
+
ASSERT(m >= 4 && IsPowerOf2(m));
|
342
|
+
while ((pc_offset() & (m - 1)) != 0) {
|
343
|
+
nop();
|
344
|
+
}
|
345
|
+
}
|
346
|
+
|
347
|
+
|
348
|
+
void Assembler::CodeTargetAlign() {
|
349
|
+
// Preferred alignment of jump targets on some ARM chips.
|
350
|
+
Align(8);
|
351
|
+
}
|
352
|
+
|
353
|
+
|
354
|
+
Condition Assembler::GetCondition(Instr instr) {
|
355
|
+
return Instruction::ConditionField(instr);
|
356
|
+
}
|
357
|
+
|
358
|
+
|
359
|
+
bool Assembler::IsBranch(Instr instr) {
|
360
|
+
return (instr & (B27 | B25)) == (B27 | B25);
|
361
|
+
}
|
362
|
+
|
363
|
+
|
364
|
+
int Assembler::GetBranchOffset(Instr instr) {
|
365
|
+
ASSERT(IsBranch(instr));
|
366
|
+
// Take the jump offset in the lower 24 bits, sign extend it and multiply it
|
367
|
+
// with 4 to get the offset in bytes.
|
368
|
+
return ((instr & kImm24Mask) << 8) >> 6;
|
369
|
+
}
|
370
|
+
|
371
|
+
|
372
|
+
bool Assembler::IsLdrRegisterImmediate(Instr instr) {
|
373
|
+
return (instr & (B27 | B26 | B25 | B22 | B20)) == (B26 | B20);
|
374
|
+
}
|
375
|
+
|
376
|
+
|
377
|
+
int Assembler::GetLdrRegisterImmediateOffset(Instr instr) {
|
378
|
+
ASSERT(IsLdrRegisterImmediate(instr));
|
379
|
+
bool positive = (instr & B23) == B23;
|
380
|
+
int offset = instr & kOff12Mask; // Zero extended offset.
|
381
|
+
return positive ? offset : -offset;
|
382
|
+
}
|
383
|
+
|
384
|
+
|
385
|
+
Instr Assembler::SetLdrRegisterImmediateOffset(Instr instr, int offset) {
|
386
|
+
ASSERT(IsLdrRegisterImmediate(instr));
|
387
|
+
bool positive = offset >= 0;
|
388
|
+
if (!positive) offset = -offset;
|
389
|
+
ASSERT(is_uint12(offset));
|
390
|
+
// Set bit indicating whether the offset should be added.
|
391
|
+
instr = (instr & ~B23) | (positive ? B23 : 0);
|
392
|
+
// Set the actual offset.
|
393
|
+
return (instr & ~kOff12Mask) | offset;
|
394
|
+
}
|
395
|
+
|
396
|
+
|
397
|
+
bool Assembler::IsStrRegisterImmediate(Instr instr) {
|
398
|
+
return (instr & (B27 | B26 | B25 | B22 | B20)) == B26;
|
399
|
+
}
|
400
|
+
|
401
|
+
|
402
|
+
Instr Assembler::SetStrRegisterImmediateOffset(Instr instr, int offset) {
|
403
|
+
ASSERT(IsStrRegisterImmediate(instr));
|
404
|
+
bool positive = offset >= 0;
|
405
|
+
if (!positive) offset = -offset;
|
406
|
+
ASSERT(is_uint12(offset));
|
407
|
+
// Set bit indicating whether the offset should be added.
|
408
|
+
instr = (instr & ~B23) | (positive ? B23 : 0);
|
409
|
+
// Set the actual offset.
|
410
|
+
return (instr & ~kOff12Mask) | offset;
|
411
|
+
}
|
412
|
+
|
413
|
+
|
414
|
+
bool Assembler::IsAddRegisterImmediate(Instr instr) {
|
415
|
+
return (instr & (B27 | B26 | B25 | B24 | B23 | B22 | B21)) == (B25 | B23);
|
416
|
+
}
|
417
|
+
|
418
|
+
|
419
|
+
Instr Assembler::SetAddRegisterImmediateOffset(Instr instr, int offset) {
|
420
|
+
ASSERT(IsAddRegisterImmediate(instr));
|
421
|
+
ASSERT(offset >= 0);
|
422
|
+
ASSERT(is_uint12(offset));
|
423
|
+
// Set the offset.
|
424
|
+
return (instr & ~kOff12Mask) | offset;
|
425
|
+
}
|
426
|
+
|
427
|
+
|
428
|
+
Register Assembler::GetRd(Instr instr) {
|
429
|
+
Register reg;
|
430
|
+
reg.code_ = Instruction::RdValue(instr);
|
431
|
+
return reg;
|
432
|
+
}
|
433
|
+
|
434
|
+
|
435
|
+
Register Assembler::GetRn(Instr instr) {
|
436
|
+
Register reg;
|
437
|
+
reg.code_ = Instruction::RnValue(instr);
|
438
|
+
return reg;
|
439
|
+
}
|
440
|
+
|
441
|
+
|
442
|
+
Register Assembler::GetRm(Instr instr) {
|
443
|
+
Register reg;
|
444
|
+
reg.code_ = Instruction::RmValue(instr);
|
445
|
+
return reg;
|
446
|
+
}
|
447
|
+
|
448
|
+
|
449
|
+
bool Assembler::IsPush(Instr instr) {
|
450
|
+
return ((instr & ~kRdMask) == kPushRegPattern);
|
451
|
+
}
|
452
|
+
|
453
|
+
|
454
|
+
bool Assembler::IsPop(Instr instr) {
|
455
|
+
return ((instr & ~kRdMask) == kPopRegPattern);
|
456
|
+
}
|
457
|
+
|
458
|
+
|
459
|
+
bool Assembler::IsStrRegFpOffset(Instr instr) {
|
460
|
+
return ((instr & kLdrStrInstrTypeMask) == kStrRegFpOffsetPattern);
|
461
|
+
}
|
462
|
+
|
463
|
+
|
464
|
+
bool Assembler::IsLdrRegFpOffset(Instr instr) {
|
465
|
+
return ((instr & kLdrStrInstrTypeMask) == kLdrRegFpOffsetPattern);
|
466
|
+
}
|
467
|
+
|
468
|
+
|
469
|
+
bool Assembler::IsStrRegFpNegOffset(Instr instr) {
|
470
|
+
return ((instr & kLdrStrInstrTypeMask) == kStrRegFpNegOffsetPattern);
|
471
|
+
}
|
472
|
+
|
473
|
+
|
474
|
+
bool Assembler::IsLdrRegFpNegOffset(Instr instr) {
|
475
|
+
return ((instr & kLdrStrInstrTypeMask) == kLdrRegFpNegOffsetPattern);
|
476
|
+
}
|
477
|
+
|
478
|
+
|
479
|
+
bool Assembler::IsLdrPcImmediateOffset(Instr instr) {
|
480
|
+
// Check the instruction is indeed a
|
481
|
+
// ldr<cond> <Rd>, [pc +/- offset_12].
|
482
|
+
return (instr & (kLdrPCMask & ~kCondMask)) == 0x051f0000;
|
483
|
+
}
|
484
|
+
|
485
|
+
|
486
|
+
bool Assembler::IsTstImmediate(Instr instr) {
|
487
|
+
return (instr & (B27 | B26 | I | kOpCodeMask | S | kRdMask)) ==
|
488
|
+
(I | TST | S);
|
489
|
+
}
|
490
|
+
|
491
|
+
|
492
|
+
bool Assembler::IsCmpRegister(Instr instr) {
|
493
|
+
return (instr & (B27 | B26 | I | kOpCodeMask | S | kRdMask | B4)) ==
|
494
|
+
(CMP | S);
|
495
|
+
}
|
496
|
+
|
497
|
+
|
498
|
+
bool Assembler::IsCmpImmediate(Instr instr) {
|
499
|
+
return (instr & (B27 | B26 | I | kOpCodeMask | S | kRdMask)) ==
|
500
|
+
(I | CMP | S);
|
501
|
+
}
|
502
|
+
|
503
|
+
|
504
|
+
Register Assembler::GetCmpImmediateRegister(Instr instr) {
|
505
|
+
ASSERT(IsCmpImmediate(instr));
|
506
|
+
return GetRn(instr);
|
507
|
+
}
|
508
|
+
|
509
|
+
|
510
|
+
int Assembler::GetCmpImmediateRawImmediate(Instr instr) {
|
511
|
+
ASSERT(IsCmpImmediate(instr));
|
512
|
+
return instr & kOff12Mask;
|
513
|
+
}
|
514
|
+
|
515
|
+
// Labels refer to positions in the (to be) generated code.
|
516
|
+
// There are bound, linked, and unused labels.
|
517
|
+
//
|
518
|
+
// Bound labels refer to known positions in the already
|
519
|
+
// generated code. pos() is the position the label refers to.
|
520
|
+
//
|
521
|
+
// Linked labels refer to unknown positions in the code
|
522
|
+
// to be generated; pos() is the position of the last
|
523
|
+
// instruction using the label.
|
524
|
+
|
525
|
+
|
526
|
+
// The link chain is terminated by a negative code position (must be aligned)
|
527
|
+
const int kEndOfChain = -4;
|
528
|
+
|
529
|
+
|
530
|
+
int Assembler::target_at(int pos) {
|
531
|
+
Instr instr = instr_at(pos);
|
532
|
+
if ((instr & ~kImm24Mask) == 0) {
|
533
|
+
// Emitted label constant, not part of a branch.
|
534
|
+
return instr - (Code::kHeaderSize - kHeapObjectTag);
|
535
|
+
}
|
536
|
+
ASSERT((instr & 7*B25) == 5*B25); // b, bl, or blx imm24
|
537
|
+
int imm26 = ((instr & kImm24Mask) << 8) >> 6;
|
538
|
+
if ((Instruction::ConditionField(instr) == kSpecialCondition) &&
|
539
|
+
((instr & B24) != 0)) {
|
540
|
+
// blx uses bit 24 to encode bit 2 of imm26
|
541
|
+
imm26 += 2;
|
542
|
+
}
|
543
|
+
return pos + kPcLoadDelta + imm26;
|
544
|
+
}
|
545
|
+
|
546
|
+
|
547
|
+
void Assembler::target_at_put(int pos, int target_pos) {
|
548
|
+
Instr instr = instr_at(pos);
|
549
|
+
if ((instr & ~kImm24Mask) == 0) {
|
550
|
+
ASSERT(target_pos == kEndOfChain || target_pos >= 0);
|
551
|
+
// Emitted label constant, not part of a branch.
|
552
|
+
// Make label relative to Code* of generated Code object.
|
553
|
+
instr_at_put(pos, target_pos + (Code::kHeaderSize - kHeapObjectTag));
|
554
|
+
return;
|
555
|
+
}
|
556
|
+
int imm26 = target_pos - (pos + kPcLoadDelta);
|
557
|
+
ASSERT((instr & 7*B25) == 5*B25); // b, bl, or blx imm24
|
558
|
+
if (Instruction::ConditionField(instr) == kSpecialCondition) {
|
559
|
+
// blx uses bit 24 to encode bit 2 of imm26
|
560
|
+
ASSERT((imm26 & 1) == 0);
|
561
|
+
instr = (instr & ~(B24 | kImm24Mask)) | ((imm26 & 2) >> 1)*B24;
|
562
|
+
} else {
|
563
|
+
ASSERT((imm26 & 3) == 0);
|
564
|
+
instr &= ~kImm24Mask;
|
565
|
+
}
|
566
|
+
int imm24 = imm26 >> 2;
|
567
|
+
ASSERT(is_int24(imm24));
|
568
|
+
instr_at_put(pos, instr | (imm24 & kImm24Mask));
|
569
|
+
}
|
570
|
+
|
571
|
+
|
572
|
+
void Assembler::print(Label* L) {
|
573
|
+
if (L->is_unused()) {
|
574
|
+
PrintF("unused label\n");
|
575
|
+
} else if (L->is_bound()) {
|
576
|
+
PrintF("bound label to %d\n", L->pos());
|
577
|
+
} else if (L->is_linked()) {
|
578
|
+
Label l = *L;
|
579
|
+
PrintF("unbound label");
|
580
|
+
while (l.is_linked()) {
|
581
|
+
PrintF("@ %d ", l.pos());
|
582
|
+
Instr instr = instr_at(l.pos());
|
583
|
+
if ((instr & ~kImm24Mask) == 0) {
|
584
|
+
PrintF("value\n");
|
585
|
+
} else {
|
586
|
+
ASSERT((instr & 7*B25) == 5*B25); // b, bl, or blx
|
587
|
+
Condition cond = Instruction::ConditionField(instr);
|
588
|
+
const char* b;
|
589
|
+
const char* c;
|
590
|
+
if (cond == kSpecialCondition) {
|
591
|
+
b = "blx";
|
592
|
+
c = "";
|
593
|
+
} else {
|
594
|
+
if ((instr & B24) != 0)
|
595
|
+
b = "bl";
|
596
|
+
else
|
597
|
+
b = "b";
|
598
|
+
|
599
|
+
switch (cond) {
|
600
|
+
case eq: c = "eq"; break;
|
601
|
+
case ne: c = "ne"; break;
|
602
|
+
case hs: c = "hs"; break;
|
603
|
+
case lo: c = "lo"; break;
|
604
|
+
case mi: c = "mi"; break;
|
605
|
+
case pl: c = "pl"; break;
|
606
|
+
case vs: c = "vs"; break;
|
607
|
+
case vc: c = "vc"; break;
|
608
|
+
case hi: c = "hi"; break;
|
609
|
+
case ls: c = "ls"; break;
|
610
|
+
case ge: c = "ge"; break;
|
611
|
+
case lt: c = "lt"; break;
|
612
|
+
case gt: c = "gt"; break;
|
613
|
+
case le: c = "le"; break;
|
614
|
+
case al: c = ""; break;
|
615
|
+
default:
|
616
|
+
c = "";
|
617
|
+
UNREACHABLE();
|
618
|
+
}
|
619
|
+
}
|
620
|
+
PrintF("%s%s\n", b, c);
|
621
|
+
}
|
622
|
+
next(&l);
|
623
|
+
}
|
624
|
+
} else {
|
625
|
+
PrintF("label in inconsistent state (pos = %d)\n", L->pos_);
|
626
|
+
}
|
627
|
+
}
|
628
|
+
|
629
|
+
|
630
|
+
void Assembler::bind_to(Label* L, int pos) {
|
631
|
+
ASSERT(0 <= pos && pos <= pc_offset()); // must have a valid binding position
|
632
|
+
while (L->is_linked()) {
|
633
|
+
int fixup_pos = L->pos();
|
634
|
+
next(L); // call next before overwriting link with target at fixup_pos
|
635
|
+
target_at_put(fixup_pos, pos);
|
636
|
+
}
|
637
|
+
L->bind_to(pos);
|
638
|
+
|
639
|
+
// Keep track of the last bound label so we don't eliminate any instructions
|
640
|
+
// before a bound label.
|
641
|
+
if (pos > last_bound_pos_)
|
642
|
+
last_bound_pos_ = pos;
|
643
|
+
}
|
644
|
+
|
645
|
+
|
646
|
+
void Assembler::link_to(Label* L, Label* appendix) {
|
647
|
+
if (appendix->is_linked()) {
|
648
|
+
if (L->is_linked()) {
|
649
|
+
// Append appendix to L's list.
|
650
|
+
int fixup_pos;
|
651
|
+
int link = L->pos();
|
652
|
+
do {
|
653
|
+
fixup_pos = link;
|
654
|
+
link = target_at(fixup_pos);
|
655
|
+
} while (link > 0);
|
656
|
+
ASSERT(link == kEndOfChain);
|
657
|
+
target_at_put(fixup_pos, appendix->pos());
|
658
|
+
} else {
|
659
|
+
// L is empty, simply use appendix.
|
660
|
+
*L = *appendix;
|
661
|
+
}
|
662
|
+
}
|
663
|
+
appendix->Unuse(); // appendix should not be used anymore
|
664
|
+
}
|
665
|
+
|
666
|
+
|
667
|
+
void Assembler::bind(Label* L) {
|
668
|
+
ASSERT(!L->is_bound()); // label can only be bound once
|
669
|
+
bind_to(L, pc_offset());
|
670
|
+
}
|
671
|
+
|
672
|
+
|
673
|
+
void Assembler::next(Label* L) {
|
674
|
+
ASSERT(L->is_linked());
|
675
|
+
int link = target_at(L->pos());
|
676
|
+
if (link > 0) {
|
677
|
+
L->link_to(link);
|
678
|
+
} else {
|
679
|
+
ASSERT(link == kEndOfChain);
|
680
|
+
L->Unuse();
|
681
|
+
}
|
682
|
+
}
|
683
|
+
|
684
|
+
|
685
|
+
static Instr EncodeMovwImmediate(uint32_t immediate) {
|
686
|
+
ASSERT(immediate < 0x10000);
|
687
|
+
return ((immediate & 0xf000) << 4) | (immediate & 0xfff);
|
688
|
+
}
|
689
|
+
|
690
|
+
|
691
|
+
// Low-level code emission routines depending on the addressing mode.
|
692
|
+
// If this returns true then you have to use the rotate_imm and immed_8
|
693
|
+
// that it returns, because it may have already changed the instruction
|
694
|
+
// to match them!
|
695
|
+
static bool fits_shifter(uint32_t imm32,
|
696
|
+
uint32_t* rotate_imm,
|
697
|
+
uint32_t* immed_8,
|
698
|
+
Instr* instr) {
|
699
|
+
// imm32 must be unsigned.
|
700
|
+
for (int rot = 0; rot < 16; rot++) {
|
701
|
+
uint32_t imm8 = (imm32 << 2*rot) | (imm32 >> (32 - 2*rot));
|
702
|
+
if ((imm8 <= 0xff)) {
|
703
|
+
*rotate_imm = rot;
|
704
|
+
*immed_8 = imm8;
|
705
|
+
return true;
|
706
|
+
}
|
707
|
+
}
|
708
|
+
// If the opcode is one with a complementary version and the complementary
|
709
|
+
// immediate fits, change the opcode.
|
710
|
+
if (instr != NULL) {
|
711
|
+
if ((*instr & kMovMvnMask) == kMovMvnPattern) {
|
712
|
+
if (fits_shifter(~imm32, rotate_imm, immed_8, NULL)) {
|
713
|
+
*instr ^= kMovMvnFlip;
|
714
|
+
return true;
|
715
|
+
} else if ((*instr & kMovLeaveCCMask) == kMovLeaveCCPattern) {
|
716
|
+
if (CpuFeatures::IsSupported(ARMv7)) {
|
717
|
+
if (imm32 < 0x10000) {
|
718
|
+
*instr ^= kMovwLeaveCCFlip;
|
719
|
+
*instr |= EncodeMovwImmediate(imm32);
|
720
|
+
*rotate_imm = *immed_8 = 0; // Not used for movw.
|
721
|
+
return true;
|
722
|
+
}
|
723
|
+
}
|
724
|
+
}
|
725
|
+
} else if ((*instr & kCmpCmnMask) == kCmpCmnPattern) {
|
726
|
+
if (fits_shifter(-imm32, rotate_imm, immed_8, NULL)) {
|
727
|
+
*instr ^= kCmpCmnFlip;
|
728
|
+
return true;
|
729
|
+
}
|
730
|
+
} else {
|
731
|
+
Instr alu_insn = (*instr & kALUMask);
|
732
|
+
if (alu_insn == ADD ||
|
733
|
+
alu_insn == SUB) {
|
734
|
+
if (fits_shifter(-imm32, rotate_imm, immed_8, NULL)) {
|
735
|
+
*instr ^= kAddSubFlip;
|
736
|
+
return true;
|
737
|
+
}
|
738
|
+
} else if (alu_insn == AND ||
|
739
|
+
alu_insn == BIC) {
|
740
|
+
if (fits_shifter(~imm32, rotate_imm, immed_8, NULL)) {
|
741
|
+
*instr ^= kAndBicFlip;
|
742
|
+
return true;
|
743
|
+
}
|
744
|
+
}
|
745
|
+
}
|
746
|
+
}
|
747
|
+
return false;
|
748
|
+
}
|
749
|
+
|
750
|
+
|
751
|
+
// We have to use the temporary register for things that can be relocated even
|
752
|
+
// if they can be encoded in the ARM's 12 bits of immediate-offset instruction
|
753
|
+
// space. There is no guarantee that the relocated location can be similarly
|
754
|
+
// encoded.
|
755
|
+
bool Operand::must_use_constant_pool() const {
|
756
|
+
if (rmode_ == RelocInfo::EXTERNAL_REFERENCE) {
|
757
|
+
#ifdef DEBUG
|
758
|
+
if (!Serializer::enabled()) {
|
759
|
+
Serializer::TooLateToEnableNow();
|
760
|
+
}
|
761
|
+
#endif // def DEBUG
|
762
|
+
return Serializer::enabled();
|
763
|
+
} else if (rmode_ == RelocInfo::NONE) {
|
764
|
+
return false;
|
765
|
+
}
|
766
|
+
return true;
|
767
|
+
}
|
768
|
+
|
769
|
+
|
770
|
+
bool Operand::is_single_instruction() const {
|
771
|
+
if (rm_.is_valid()) return true;
|
772
|
+
if (must_use_constant_pool()) return false;
|
773
|
+
uint32_t dummy1, dummy2;
|
774
|
+
return fits_shifter(imm32_, &dummy1, &dummy2, NULL);
|
775
|
+
}
|
776
|
+
|
777
|
+
|
778
|
+
void Assembler::addrmod1(Instr instr,
|
779
|
+
Register rn,
|
780
|
+
Register rd,
|
781
|
+
const Operand& x) {
|
782
|
+
CheckBuffer();
|
783
|
+
ASSERT((instr & ~(kCondMask | kOpCodeMask | S)) == 0);
|
784
|
+
if (!x.rm_.is_valid()) {
|
785
|
+
// Immediate.
|
786
|
+
uint32_t rotate_imm;
|
787
|
+
uint32_t immed_8;
|
788
|
+
if (x.must_use_constant_pool() ||
|
789
|
+
!fits_shifter(x.imm32_, &rotate_imm, &immed_8, &instr)) {
|
790
|
+
// The immediate operand cannot be encoded as a shifter operand, so load
|
791
|
+
// it first to register ip and change the original instruction to use ip.
|
792
|
+
// However, if the original instruction is a 'mov rd, x' (not setting the
|
793
|
+
// condition code), then replace it with a 'ldr rd, [pc]'.
|
794
|
+
CHECK(!rn.is(ip)); // rn should never be ip, or will be trashed
|
795
|
+
Condition cond = Instruction::ConditionField(instr);
|
796
|
+
if ((instr & ~kCondMask) == 13*B21) { // mov, S not set
|
797
|
+
if (x.must_use_constant_pool() || !CpuFeatures::IsSupported(ARMv7)) {
|
798
|
+
RecordRelocInfo(x.rmode_, x.imm32_);
|
799
|
+
ldr(rd, MemOperand(pc, 0), cond);
|
800
|
+
} else {
|
801
|
+
// Will probably use movw, will certainly not use constant pool.
|
802
|
+
mov(rd, Operand(x.imm32_ & 0xffff), LeaveCC, cond);
|
803
|
+
movt(rd, static_cast<uint32_t>(x.imm32_) >> 16, cond);
|
804
|
+
}
|
805
|
+
} else {
|
806
|
+
// If this is not a mov or mvn instruction we may still be able to avoid
|
807
|
+
// a constant pool entry by using mvn or movw.
|
808
|
+
if (!x.must_use_constant_pool() &&
|
809
|
+
(instr & kMovMvnMask) != kMovMvnPattern) {
|
810
|
+
mov(ip, x, LeaveCC, cond);
|
811
|
+
} else {
|
812
|
+
RecordRelocInfo(x.rmode_, x.imm32_);
|
813
|
+
ldr(ip, MemOperand(pc, 0), cond);
|
814
|
+
}
|
815
|
+
addrmod1(instr, rn, rd, Operand(ip));
|
816
|
+
}
|
817
|
+
return;
|
818
|
+
}
|
819
|
+
instr |= I | rotate_imm*B8 | immed_8;
|
820
|
+
} else if (!x.rs_.is_valid()) {
|
821
|
+
// Immediate shift.
|
822
|
+
instr |= x.shift_imm_*B7 | x.shift_op_ | x.rm_.code();
|
823
|
+
} else {
|
824
|
+
// Register shift.
|
825
|
+
ASSERT(!rn.is(pc) && !rd.is(pc) && !x.rm_.is(pc) && !x.rs_.is(pc));
|
826
|
+
instr |= x.rs_.code()*B8 | x.shift_op_ | B4 | x.rm_.code();
|
827
|
+
}
|
828
|
+
emit(instr | rn.code()*B16 | rd.code()*B12);
|
829
|
+
if (rn.is(pc) || x.rm_.is(pc)) {
|
830
|
+
// Block constant pool emission for one instruction after reading pc.
|
831
|
+
BlockConstPoolBefore(pc_offset() + kInstrSize);
|
832
|
+
}
|
833
|
+
}
|
834
|
+
|
835
|
+
|
836
|
+
void Assembler::addrmod2(Instr instr, Register rd, const MemOperand& x) {
|
837
|
+
ASSERT((instr & ~(kCondMask | B | L)) == B26);
|
838
|
+
int am = x.am_;
|
839
|
+
if (!x.rm_.is_valid()) {
|
840
|
+
// Immediate offset.
|
841
|
+
int offset_12 = x.offset_;
|
842
|
+
if (offset_12 < 0) {
|
843
|
+
offset_12 = -offset_12;
|
844
|
+
am ^= U;
|
845
|
+
}
|
846
|
+
if (!is_uint12(offset_12)) {
|
847
|
+
// Immediate offset cannot be encoded, load it first to register ip
|
848
|
+
// rn (and rd in a load) should never be ip, or will be trashed.
|
849
|
+
ASSERT(!x.rn_.is(ip) && ((instr & L) == L || !rd.is(ip)));
|
850
|
+
mov(ip, Operand(x.offset_), LeaveCC, Instruction::ConditionField(instr));
|
851
|
+
addrmod2(instr, rd, MemOperand(x.rn_, ip, x.am_));
|
852
|
+
return;
|
853
|
+
}
|
854
|
+
ASSERT(offset_12 >= 0); // no masking needed
|
855
|
+
instr |= offset_12;
|
856
|
+
} else {
|
857
|
+
// Register offset (shift_imm_ and shift_op_ are 0) or scaled
|
858
|
+
// register offset the constructors make sure than both shift_imm_
|
859
|
+
// and shift_op_ are initialized.
|
860
|
+
ASSERT(!x.rm_.is(pc));
|
861
|
+
instr |= B25 | x.shift_imm_*B7 | x.shift_op_ | x.rm_.code();
|
862
|
+
}
|
863
|
+
ASSERT((am & (P|W)) == P || !x.rn_.is(pc)); // no pc base with writeback
|
864
|
+
emit(instr | am | x.rn_.code()*B16 | rd.code()*B12);
|
865
|
+
}
|
866
|
+
|
867
|
+
|
868
|
+
void Assembler::addrmod3(Instr instr, Register rd, const MemOperand& x) {
|
869
|
+
ASSERT((instr & ~(kCondMask | L | S6 | H)) == (B4 | B7));
|
870
|
+
ASSERT(x.rn_.is_valid());
|
871
|
+
int am = x.am_;
|
872
|
+
if (!x.rm_.is_valid()) {
|
873
|
+
// Immediate offset.
|
874
|
+
int offset_8 = x.offset_;
|
875
|
+
if (offset_8 < 0) {
|
876
|
+
offset_8 = -offset_8;
|
877
|
+
am ^= U;
|
878
|
+
}
|
879
|
+
if (!is_uint8(offset_8)) {
|
880
|
+
// Immediate offset cannot be encoded, load it first to register ip
|
881
|
+
// rn (and rd in a load) should never be ip, or will be trashed.
|
882
|
+
ASSERT(!x.rn_.is(ip) && ((instr & L) == L || !rd.is(ip)));
|
883
|
+
mov(ip, Operand(x.offset_), LeaveCC, Instruction::ConditionField(instr));
|
884
|
+
addrmod3(instr, rd, MemOperand(x.rn_, ip, x.am_));
|
885
|
+
return;
|
886
|
+
}
|
887
|
+
ASSERT(offset_8 >= 0); // no masking needed
|
888
|
+
instr |= B | (offset_8 >> 4)*B8 | (offset_8 & 0xf);
|
889
|
+
} else if (x.shift_imm_ != 0) {
|
890
|
+
// Scaled register offset not supported, load index first
|
891
|
+
// rn (and rd in a load) should never be ip, or will be trashed.
|
892
|
+
ASSERT(!x.rn_.is(ip) && ((instr & L) == L || !rd.is(ip)));
|
893
|
+
mov(ip, Operand(x.rm_, x.shift_op_, x.shift_imm_), LeaveCC,
|
894
|
+
Instruction::ConditionField(instr));
|
895
|
+
addrmod3(instr, rd, MemOperand(x.rn_, ip, x.am_));
|
896
|
+
return;
|
897
|
+
} else {
|
898
|
+
// Register offset.
|
899
|
+
ASSERT((am & (P|W)) == P || !x.rm_.is(pc)); // no pc index with writeback
|
900
|
+
instr |= x.rm_.code();
|
901
|
+
}
|
902
|
+
ASSERT((am & (P|W)) == P || !x.rn_.is(pc)); // no pc base with writeback
|
903
|
+
emit(instr | am | x.rn_.code()*B16 | rd.code()*B12);
|
904
|
+
}
|
905
|
+
|
906
|
+
|
907
|
+
void Assembler::addrmod4(Instr instr, Register rn, RegList rl) {
|
908
|
+
ASSERT((instr & ~(kCondMask | P | U | W | L)) == B27);
|
909
|
+
ASSERT(rl != 0);
|
910
|
+
ASSERT(!rn.is(pc));
|
911
|
+
emit(instr | rn.code()*B16 | rl);
|
912
|
+
}
|
913
|
+
|
914
|
+
|
915
|
+
void Assembler::addrmod5(Instr instr, CRegister crd, const MemOperand& x) {
|
916
|
+
// Unindexed addressing is not encoded by this function.
|
917
|
+
ASSERT_EQ((B27 | B26),
|
918
|
+
(instr & ~(kCondMask | kCoprocessorMask | P | U | N | W | L)));
|
919
|
+
ASSERT(x.rn_.is_valid() && !x.rm_.is_valid());
|
920
|
+
int am = x.am_;
|
921
|
+
int offset_8 = x.offset_;
|
922
|
+
ASSERT((offset_8 & 3) == 0); // offset must be an aligned word offset
|
923
|
+
offset_8 >>= 2;
|
924
|
+
if (offset_8 < 0) {
|
925
|
+
offset_8 = -offset_8;
|
926
|
+
am ^= U;
|
927
|
+
}
|
928
|
+
ASSERT(is_uint8(offset_8)); // unsigned word offset must fit in a byte
|
929
|
+
ASSERT((am & (P|W)) == P || !x.rn_.is(pc)); // no pc base with writeback
|
930
|
+
|
931
|
+
// Post-indexed addressing requires W == 1; different than in addrmod2/3.
|
932
|
+
if ((am & P) == 0)
|
933
|
+
am |= W;
|
934
|
+
|
935
|
+
ASSERT(offset_8 >= 0); // no masking needed
|
936
|
+
emit(instr | am | x.rn_.code()*B16 | crd.code()*B12 | offset_8);
|
937
|
+
}
|
938
|
+
|
939
|
+
|
940
|
+
int Assembler::branch_offset(Label* L, bool jump_elimination_allowed) {
|
941
|
+
int target_pos;
|
942
|
+
if (L->is_bound()) {
|
943
|
+
target_pos = L->pos();
|
944
|
+
} else {
|
945
|
+
if (L->is_linked()) {
|
946
|
+
target_pos = L->pos(); // L's link
|
947
|
+
} else {
|
948
|
+
target_pos = kEndOfChain;
|
949
|
+
}
|
950
|
+
L->link_to(pc_offset());
|
951
|
+
}
|
952
|
+
|
953
|
+
// Block the emission of the constant pool, since the branch instruction must
|
954
|
+
// be emitted at the pc offset recorded by the label.
|
955
|
+
BlockConstPoolBefore(pc_offset() + kInstrSize);
|
956
|
+
return target_pos - (pc_offset() + kPcLoadDelta);
|
957
|
+
}
|
958
|
+
|
959
|
+
|
960
|
+
void Assembler::label_at_put(Label* L, int at_offset) {
|
961
|
+
int target_pos;
|
962
|
+
if (L->is_bound()) {
|
963
|
+
target_pos = L->pos();
|
964
|
+
} else {
|
965
|
+
if (L->is_linked()) {
|
966
|
+
target_pos = L->pos(); // L's link
|
967
|
+
} else {
|
968
|
+
target_pos = kEndOfChain;
|
969
|
+
}
|
970
|
+
L->link_to(at_offset);
|
971
|
+
instr_at_put(at_offset, target_pos + (Code::kHeaderSize - kHeapObjectTag));
|
972
|
+
}
|
973
|
+
}
|
974
|
+
|
975
|
+
|
976
|
+
// Branch instructions.
|
977
|
+
void Assembler::b(int branch_offset, Condition cond) {
|
978
|
+
ASSERT((branch_offset & 3) == 0);
|
979
|
+
int imm24 = branch_offset >> 2;
|
980
|
+
ASSERT(is_int24(imm24));
|
981
|
+
emit(cond | B27 | B25 | (imm24 & kImm24Mask));
|
982
|
+
|
983
|
+
if (cond == al) {
|
984
|
+
// Dead code is a good location to emit the constant pool.
|
985
|
+
CheckConstPool(false, false);
|
986
|
+
}
|
987
|
+
}
|
988
|
+
|
989
|
+
|
990
|
+
void Assembler::bl(int branch_offset, Condition cond) {
|
991
|
+
positions_recorder()->WriteRecordedPositions();
|
992
|
+
ASSERT((branch_offset & 3) == 0);
|
993
|
+
int imm24 = branch_offset >> 2;
|
994
|
+
ASSERT(is_int24(imm24));
|
995
|
+
emit(cond | B27 | B25 | B24 | (imm24 & kImm24Mask));
|
996
|
+
}
|
997
|
+
|
998
|
+
|
999
|
+
void Assembler::blx(int branch_offset) { // v5 and above
|
1000
|
+
positions_recorder()->WriteRecordedPositions();
|
1001
|
+
ASSERT((branch_offset & 1) == 0);
|
1002
|
+
int h = ((branch_offset & 2) >> 1)*B24;
|
1003
|
+
int imm24 = branch_offset >> 2;
|
1004
|
+
ASSERT(is_int24(imm24));
|
1005
|
+
emit(kSpecialCondition | B27 | B25 | h | (imm24 & kImm24Mask));
|
1006
|
+
}
|
1007
|
+
|
1008
|
+
|
1009
|
+
void Assembler::blx(Register target, Condition cond) { // v5 and above
|
1010
|
+
positions_recorder()->WriteRecordedPositions();
|
1011
|
+
ASSERT(!target.is(pc));
|
1012
|
+
emit(cond | B24 | B21 | 15*B16 | 15*B12 | 15*B8 | BLX | target.code());
|
1013
|
+
}
|
1014
|
+
|
1015
|
+
|
1016
|
+
void Assembler::bx(Register target, Condition cond) { // v5 and above, plus v4t
|
1017
|
+
positions_recorder()->WriteRecordedPositions();
|
1018
|
+
ASSERT(!target.is(pc)); // use of pc is actually allowed, but discouraged
|
1019
|
+
emit(cond | B24 | B21 | 15*B16 | 15*B12 | 15*B8 | BX | target.code());
|
1020
|
+
}
|
1021
|
+
|
1022
|
+
|
1023
|
+
// Data-processing instructions.
|
1024
|
+
|
1025
|
+
void Assembler::and_(Register dst, Register src1, const Operand& src2,
|
1026
|
+
SBit s, Condition cond) {
|
1027
|
+
addrmod1(cond | AND | s, src1, dst, src2);
|
1028
|
+
}
|
1029
|
+
|
1030
|
+
|
1031
|
+
void Assembler::eor(Register dst, Register src1, const Operand& src2,
|
1032
|
+
SBit s, Condition cond) {
|
1033
|
+
addrmod1(cond | EOR | s, src1, dst, src2);
|
1034
|
+
}
|
1035
|
+
|
1036
|
+
|
1037
|
+
void Assembler::sub(Register dst, Register src1, const Operand& src2,
|
1038
|
+
SBit s, Condition cond) {
|
1039
|
+
addrmod1(cond | SUB | s, src1, dst, src2);
|
1040
|
+
}
|
1041
|
+
|
1042
|
+
|
1043
|
+
void Assembler::rsb(Register dst, Register src1, const Operand& src2,
|
1044
|
+
SBit s, Condition cond) {
|
1045
|
+
addrmod1(cond | RSB | s, src1, dst, src2);
|
1046
|
+
}
|
1047
|
+
|
1048
|
+
|
1049
|
+
void Assembler::add(Register dst, Register src1, const Operand& src2,
|
1050
|
+
SBit s, Condition cond) {
|
1051
|
+
addrmod1(cond | ADD | s, src1, dst, src2);
|
1052
|
+
|
1053
|
+
// Eliminate pattern: push(r), pop()
|
1054
|
+
// str(src, MemOperand(sp, 4, NegPreIndex), al);
|
1055
|
+
// add(sp, sp, Operand(kPointerSize));
|
1056
|
+
// Both instructions can be eliminated.
|
1057
|
+
if (can_peephole_optimize(2) &&
|
1058
|
+
// Pattern.
|
1059
|
+
instr_at(pc_ - 1 * kInstrSize) == kPopInstruction &&
|
1060
|
+
(instr_at(pc_ - 2 * kInstrSize) & ~kRdMask) == kPushRegPattern) {
|
1061
|
+
pc_ -= 2 * kInstrSize;
|
1062
|
+
if (FLAG_print_peephole_optimization) {
|
1063
|
+
PrintF("%x push(reg)/pop() eliminated\n", pc_offset());
|
1064
|
+
}
|
1065
|
+
}
|
1066
|
+
}
|
1067
|
+
|
1068
|
+
|
1069
|
+
void Assembler::adc(Register dst, Register src1, const Operand& src2,
|
1070
|
+
SBit s, Condition cond) {
|
1071
|
+
addrmod1(cond | ADC | s, src1, dst, src2);
|
1072
|
+
}
|
1073
|
+
|
1074
|
+
|
1075
|
+
void Assembler::sbc(Register dst, Register src1, const Operand& src2,
|
1076
|
+
SBit s, Condition cond) {
|
1077
|
+
addrmod1(cond | SBC | s, src1, dst, src2);
|
1078
|
+
}
|
1079
|
+
|
1080
|
+
|
1081
|
+
void Assembler::rsc(Register dst, Register src1, const Operand& src2,
|
1082
|
+
SBit s, Condition cond) {
|
1083
|
+
addrmod1(cond | RSC | s, src1, dst, src2);
|
1084
|
+
}
|
1085
|
+
|
1086
|
+
|
1087
|
+
void Assembler::tst(Register src1, const Operand& src2, Condition cond) {
|
1088
|
+
addrmod1(cond | TST | S, src1, r0, src2);
|
1089
|
+
}
|
1090
|
+
|
1091
|
+
|
1092
|
+
void Assembler::teq(Register src1, const Operand& src2, Condition cond) {
|
1093
|
+
addrmod1(cond | TEQ | S, src1, r0, src2);
|
1094
|
+
}
|
1095
|
+
|
1096
|
+
|
1097
|
+
void Assembler::cmp(Register src1, const Operand& src2, Condition cond) {
|
1098
|
+
addrmod1(cond | CMP | S, src1, r0, src2);
|
1099
|
+
}
|
1100
|
+
|
1101
|
+
|
1102
|
+
void Assembler::cmp_raw_immediate(
|
1103
|
+
Register src, int raw_immediate, Condition cond) {
|
1104
|
+
ASSERT(is_uint12(raw_immediate));
|
1105
|
+
emit(cond | I | CMP | S | src.code() << 16 | raw_immediate);
|
1106
|
+
}
|
1107
|
+
|
1108
|
+
|
1109
|
+
void Assembler::cmn(Register src1, const Operand& src2, Condition cond) {
|
1110
|
+
addrmod1(cond | CMN | S, src1, r0, src2);
|
1111
|
+
}
|
1112
|
+
|
1113
|
+
|
1114
|
+
void Assembler::orr(Register dst, Register src1, const Operand& src2,
|
1115
|
+
SBit s, Condition cond) {
|
1116
|
+
addrmod1(cond | ORR | s, src1, dst, src2);
|
1117
|
+
}
|
1118
|
+
|
1119
|
+
|
1120
|
+
void Assembler::mov(Register dst, const Operand& src, SBit s, Condition cond) {
|
1121
|
+
if (dst.is(pc)) {
|
1122
|
+
positions_recorder()->WriteRecordedPositions();
|
1123
|
+
}
|
1124
|
+
// Don't allow nop instructions in the form mov rn, rn to be generated using
|
1125
|
+
// the mov instruction. They must be generated using nop(int/NopMarkerTypes)
|
1126
|
+
// or MarkCode(int/NopMarkerTypes) pseudo instructions.
|
1127
|
+
ASSERT(!(src.is_reg() && src.rm().is(dst) && s == LeaveCC && cond == al));
|
1128
|
+
addrmod1(cond | MOV | s, r0, dst, src);
|
1129
|
+
}
|
1130
|
+
|
1131
|
+
|
1132
|
+
void Assembler::movw(Register reg, uint32_t immediate, Condition cond) {
|
1133
|
+
ASSERT(immediate < 0x10000);
|
1134
|
+
mov(reg, Operand(immediate), LeaveCC, cond);
|
1135
|
+
}
|
1136
|
+
|
1137
|
+
|
1138
|
+
void Assembler::movt(Register reg, uint32_t immediate, Condition cond) {
|
1139
|
+
emit(cond | 0x34*B20 | reg.code()*B12 | EncodeMovwImmediate(immediate));
|
1140
|
+
}
|
1141
|
+
|
1142
|
+
|
1143
|
+
void Assembler::bic(Register dst, Register src1, const Operand& src2,
|
1144
|
+
SBit s, Condition cond) {
|
1145
|
+
addrmod1(cond | BIC | s, src1, dst, src2);
|
1146
|
+
}
|
1147
|
+
|
1148
|
+
|
1149
|
+
void Assembler::mvn(Register dst, const Operand& src, SBit s, Condition cond) {
|
1150
|
+
addrmod1(cond | MVN | s, r0, dst, src);
|
1151
|
+
}
|
1152
|
+
|
1153
|
+
|
1154
|
+
// Multiply instructions.
|
1155
|
+
void Assembler::mla(Register dst, Register src1, Register src2, Register srcA,
|
1156
|
+
SBit s, Condition cond) {
|
1157
|
+
ASSERT(!dst.is(pc) && !src1.is(pc) && !src2.is(pc) && !srcA.is(pc));
|
1158
|
+
emit(cond | A | s | dst.code()*B16 | srcA.code()*B12 |
|
1159
|
+
src2.code()*B8 | B7 | B4 | src1.code());
|
1160
|
+
}
|
1161
|
+
|
1162
|
+
|
1163
|
+
void Assembler::mul(Register dst, Register src1, Register src2,
|
1164
|
+
SBit s, Condition cond) {
|
1165
|
+
ASSERT(!dst.is(pc) && !src1.is(pc) && !src2.is(pc));
|
1166
|
+
// dst goes in bits 16-19 for this instruction!
|
1167
|
+
emit(cond | s | dst.code()*B16 | src2.code()*B8 | B7 | B4 | src1.code());
|
1168
|
+
}
|
1169
|
+
|
1170
|
+
|
1171
|
+
void Assembler::smlal(Register dstL,
|
1172
|
+
Register dstH,
|
1173
|
+
Register src1,
|
1174
|
+
Register src2,
|
1175
|
+
SBit s,
|
1176
|
+
Condition cond) {
|
1177
|
+
ASSERT(!dstL.is(pc) && !dstH.is(pc) && !src1.is(pc) && !src2.is(pc));
|
1178
|
+
ASSERT(!dstL.is(dstH));
|
1179
|
+
emit(cond | B23 | B22 | A | s | dstH.code()*B16 | dstL.code()*B12 |
|
1180
|
+
src2.code()*B8 | B7 | B4 | src1.code());
|
1181
|
+
}
|
1182
|
+
|
1183
|
+
|
1184
|
+
void Assembler::smull(Register dstL,
|
1185
|
+
Register dstH,
|
1186
|
+
Register src1,
|
1187
|
+
Register src2,
|
1188
|
+
SBit s,
|
1189
|
+
Condition cond) {
|
1190
|
+
ASSERT(!dstL.is(pc) && !dstH.is(pc) && !src1.is(pc) && !src2.is(pc));
|
1191
|
+
ASSERT(!dstL.is(dstH));
|
1192
|
+
emit(cond | B23 | B22 | s | dstH.code()*B16 | dstL.code()*B12 |
|
1193
|
+
src2.code()*B8 | B7 | B4 | src1.code());
|
1194
|
+
}
|
1195
|
+
|
1196
|
+
|
1197
|
+
void Assembler::umlal(Register dstL,
|
1198
|
+
Register dstH,
|
1199
|
+
Register src1,
|
1200
|
+
Register src2,
|
1201
|
+
SBit s,
|
1202
|
+
Condition cond) {
|
1203
|
+
ASSERT(!dstL.is(pc) && !dstH.is(pc) && !src1.is(pc) && !src2.is(pc));
|
1204
|
+
ASSERT(!dstL.is(dstH));
|
1205
|
+
emit(cond | B23 | A | s | dstH.code()*B16 | dstL.code()*B12 |
|
1206
|
+
src2.code()*B8 | B7 | B4 | src1.code());
|
1207
|
+
}
|
1208
|
+
|
1209
|
+
|
1210
|
+
void Assembler::umull(Register dstL,
|
1211
|
+
Register dstH,
|
1212
|
+
Register src1,
|
1213
|
+
Register src2,
|
1214
|
+
SBit s,
|
1215
|
+
Condition cond) {
|
1216
|
+
ASSERT(!dstL.is(pc) && !dstH.is(pc) && !src1.is(pc) && !src2.is(pc));
|
1217
|
+
ASSERT(!dstL.is(dstH));
|
1218
|
+
emit(cond | B23 | s | dstH.code()*B16 | dstL.code()*B12 |
|
1219
|
+
src2.code()*B8 | B7 | B4 | src1.code());
|
1220
|
+
}
|
1221
|
+
|
1222
|
+
|
1223
|
+
// Miscellaneous arithmetic instructions.
|
1224
|
+
void Assembler::clz(Register dst, Register src, Condition cond) {
|
1225
|
+
// v5 and above.
|
1226
|
+
ASSERT(!dst.is(pc) && !src.is(pc));
|
1227
|
+
emit(cond | B24 | B22 | B21 | 15*B16 | dst.code()*B12 |
|
1228
|
+
15*B8 | CLZ | src.code());
|
1229
|
+
}
|
1230
|
+
|
1231
|
+
|
1232
|
+
// Saturating instructions.
|
1233
|
+
|
1234
|
+
// Unsigned saturate.
|
1235
|
+
void Assembler::usat(Register dst,
|
1236
|
+
int satpos,
|
1237
|
+
const Operand& src,
|
1238
|
+
Condition cond) {
|
1239
|
+
// v6 and above.
|
1240
|
+
ASSERT(CpuFeatures::IsSupported(ARMv7));
|
1241
|
+
ASSERT(!dst.is(pc) && !src.rm_.is(pc));
|
1242
|
+
ASSERT((satpos >= 0) && (satpos <= 31));
|
1243
|
+
ASSERT((src.shift_op_ == ASR) || (src.shift_op_ == LSL));
|
1244
|
+
ASSERT(src.rs_.is(no_reg));
|
1245
|
+
|
1246
|
+
int sh = 0;
|
1247
|
+
if (src.shift_op_ == ASR) {
|
1248
|
+
sh = 1;
|
1249
|
+
}
|
1250
|
+
|
1251
|
+
emit(cond | 0x6*B24 | 0xe*B20 | satpos*B16 | dst.code()*B12 |
|
1252
|
+
src.shift_imm_*B7 | sh*B6 | 0x1*B4 | src.rm_.code());
|
1253
|
+
}
|
1254
|
+
|
1255
|
+
|
1256
|
+
// Bitfield manipulation instructions.
|
1257
|
+
|
1258
|
+
// Unsigned bit field extract.
|
1259
|
+
// Extracts #width adjacent bits from position #lsb in a register, and
|
1260
|
+
// writes them to the low bits of a destination register.
|
1261
|
+
// ubfx dst, src, #lsb, #width
|
1262
|
+
void Assembler::ubfx(Register dst,
|
1263
|
+
Register src,
|
1264
|
+
int lsb,
|
1265
|
+
int width,
|
1266
|
+
Condition cond) {
|
1267
|
+
// v7 and above.
|
1268
|
+
ASSERT(CpuFeatures::IsSupported(ARMv7));
|
1269
|
+
ASSERT(!dst.is(pc) && !src.is(pc));
|
1270
|
+
ASSERT((lsb >= 0) && (lsb <= 31));
|
1271
|
+
ASSERT((width >= 1) && (width <= (32 - lsb)));
|
1272
|
+
emit(cond | 0xf*B23 | B22 | B21 | (width - 1)*B16 | dst.code()*B12 |
|
1273
|
+
lsb*B7 | B6 | B4 | src.code());
|
1274
|
+
}
|
1275
|
+
|
1276
|
+
|
1277
|
+
// Signed bit field extract.
|
1278
|
+
// Extracts #width adjacent bits from position #lsb in a register, and
|
1279
|
+
// writes them to the low bits of a destination register. The extracted
|
1280
|
+
// value is sign extended to fill the destination register.
|
1281
|
+
// sbfx dst, src, #lsb, #width
|
1282
|
+
void Assembler::sbfx(Register dst,
|
1283
|
+
Register src,
|
1284
|
+
int lsb,
|
1285
|
+
int width,
|
1286
|
+
Condition cond) {
|
1287
|
+
// v7 and above.
|
1288
|
+
ASSERT(CpuFeatures::IsSupported(ARMv7));
|
1289
|
+
ASSERT(!dst.is(pc) && !src.is(pc));
|
1290
|
+
ASSERT((lsb >= 0) && (lsb <= 31));
|
1291
|
+
ASSERT((width >= 1) && (width <= (32 - lsb)));
|
1292
|
+
emit(cond | 0xf*B23 | B21 | (width - 1)*B16 | dst.code()*B12 |
|
1293
|
+
lsb*B7 | B6 | B4 | src.code());
|
1294
|
+
}
|
1295
|
+
|
1296
|
+
|
1297
|
+
// Bit field clear.
|
1298
|
+
// Sets #width adjacent bits at position #lsb in the destination register
|
1299
|
+
// to zero, preserving the value of the other bits.
|
1300
|
+
// bfc dst, #lsb, #width
|
1301
|
+
void Assembler::bfc(Register dst, int lsb, int width, Condition cond) {
|
1302
|
+
// v7 and above.
|
1303
|
+
ASSERT(CpuFeatures::IsSupported(ARMv7));
|
1304
|
+
ASSERT(!dst.is(pc));
|
1305
|
+
ASSERT((lsb >= 0) && (lsb <= 31));
|
1306
|
+
ASSERT((width >= 1) && (width <= (32 - lsb)));
|
1307
|
+
int msb = lsb + width - 1;
|
1308
|
+
emit(cond | 0x1f*B22 | msb*B16 | dst.code()*B12 | lsb*B7 | B4 | 0xf);
|
1309
|
+
}
|
1310
|
+
|
1311
|
+
|
1312
|
+
// Bit field insert.
|
1313
|
+
// Inserts #width adjacent bits from the low bits of the source register
|
1314
|
+
// into position #lsb of the destination register.
|
1315
|
+
// bfi dst, src, #lsb, #width
|
1316
|
+
void Assembler::bfi(Register dst,
|
1317
|
+
Register src,
|
1318
|
+
int lsb,
|
1319
|
+
int width,
|
1320
|
+
Condition cond) {
|
1321
|
+
// v7 and above.
|
1322
|
+
ASSERT(CpuFeatures::IsSupported(ARMv7));
|
1323
|
+
ASSERT(!dst.is(pc) && !src.is(pc));
|
1324
|
+
ASSERT((lsb >= 0) && (lsb <= 31));
|
1325
|
+
ASSERT((width >= 1) && (width <= (32 - lsb)));
|
1326
|
+
int msb = lsb + width - 1;
|
1327
|
+
emit(cond | 0x1f*B22 | msb*B16 | dst.code()*B12 | lsb*B7 | B4 |
|
1328
|
+
src.code());
|
1329
|
+
}
|
1330
|
+
|
1331
|
+
|
1332
|
+
// Status register access instructions.
|
1333
|
+
void Assembler::mrs(Register dst, SRegister s, Condition cond) {
|
1334
|
+
ASSERT(!dst.is(pc));
|
1335
|
+
emit(cond | B24 | s | 15*B16 | dst.code()*B12);
|
1336
|
+
}
|
1337
|
+
|
1338
|
+
|
1339
|
+
void Assembler::msr(SRegisterFieldMask fields, const Operand& src,
|
1340
|
+
Condition cond) {
|
1341
|
+
ASSERT(fields >= B16 && fields < B20); // at least one field set
|
1342
|
+
Instr instr;
|
1343
|
+
if (!src.rm_.is_valid()) {
|
1344
|
+
// Immediate.
|
1345
|
+
uint32_t rotate_imm;
|
1346
|
+
uint32_t immed_8;
|
1347
|
+
if (src.must_use_constant_pool() ||
|
1348
|
+
!fits_shifter(src.imm32_, &rotate_imm, &immed_8, NULL)) {
|
1349
|
+
// Immediate operand cannot be encoded, load it first to register ip.
|
1350
|
+
RecordRelocInfo(src.rmode_, src.imm32_);
|
1351
|
+
ldr(ip, MemOperand(pc, 0), cond);
|
1352
|
+
msr(fields, Operand(ip), cond);
|
1353
|
+
return;
|
1354
|
+
}
|
1355
|
+
instr = I | rotate_imm*B8 | immed_8;
|
1356
|
+
} else {
|
1357
|
+
ASSERT(!src.rs_.is_valid() && src.shift_imm_ == 0); // only rm allowed
|
1358
|
+
instr = src.rm_.code();
|
1359
|
+
}
|
1360
|
+
emit(cond | instr | B24 | B21 | fields | 15*B12);
|
1361
|
+
}
|
1362
|
+
|
1363
|
+
|
1364
|
+
// Load/Store instructions.
|
1365
|
+
void Assembler::ldr(Register dst, const MemOperand& src, Condition cond) {
|
1366
|
+
if (dst.is(pc)) {
|
1367
|
+
positions_recorder()->WriteRecordedPositions();
|
1368
|
+
}
|
1369
|
+
addrmod2(cond | B26 | L, dst, src);
|
1370
|
+
|
1371
|
+
// Eliminate pattern: push(ry), pop(rx)
|
1372
|
+
// str(ry, MemOperand(sp, 4, NegPreIndex), al)
|
1373
|
+
// ldr(rx, MemOperand(sp, 4, PostIndex), al)
|
1374
|
+
// Both instructions can be eliminated if ry = rx.
|
1375
|
+
// If ry != rx, a register copy from ry to rx is inserted
|
1376
|
+
// after eliminating the push and the pop instructions.
|
1377
|
+
if (can_peephole_optimize(2)) {
|
1378
|
+
Instr push_instr = instr_at(pc_ - 2 * kInstrSize);
|
1379
|
+
Instr pop_instr = instr_at(pc_ - 1 * kInstrSize);
|
1380
|
+
|
1381
|
+
if (IsPush(push_instr) && IsPop(pop_instr)) {
|
1382
|
+
if (Instruction::RdValue(pop_instr) != Instruction::RdValue(push_instr)) {
|
1383
|
+
// For consecutive push and pop on different registers,
|
1384
|
+
// we delete both the push & pop and insert a register move.
|
1385
|
+
// push ry, pop rx --> mov rx, ry
|
1386
|
+
Register reg_pushed, reg_popped;
|
1387
|
+
reg_pushed = GetRd(push_instr);
|
1388
|
+
reg_popped = GetRd(pop_instr);
|
1389
|
+
pc_ -= 2 * kInstrSize;
|
1390
|
+
// Insert a mov instruction, which is better than a pair of push & pop
|
1391
|
+
mov(reg_popped, reg_pushed);
|
1392
|
+
if (FLAG_print_peephole_optimization) {
|
1393
|
+
PrintF("%x push/pop (diff reg) replaced by a reg move\n",
|
1394
|
+
pc_offset());
|
1395
|
+
}
|
1396
|
+
} else {
|
1397
|
+
// For consecutive push and pop on the same register,
|
1398
|
+
// both the push and the pop can be deleted.
|
1399
|
+
pc_ -= 2 * kInstrSize;
|
1400
|
+
if (FLAG_print_peephole_optimization) {
|
1401
|
+
PrintF("%x push/pop (same reg) eliminated\n", pc_offset());
|
1402
|
+
}
|
1403
|
+
}
|
1404
|
+
}
|
1405
|
+
}
|
1406
|
+
|
1407
|
+
if (can_peephole_optimize(2)) {
|
1408
|
+
Instr str_instr = instr_at(pc_ - 2 * kInstrSize);
|
1409
|
+
Instr ldr_instr = instr_at(pc_ - 1 * kInstrSize);
|
1410
|
+
|
1411
|
+
if ((IsStrRegFpOffset(str_instr) &&
|
1412
|
+
IsLdrRegFpOffset(ldr_instr)) ||
|
1413
|
+
(IsStrRegFpNegOffset(str_instr) &&
|
1414
|
+
IsLdrRegFpNegOffset(ldr_instr))) {
|
1415
|
+
if ((ldr_instr & kLdrStrInstrArgumentMask) ==
|
1416
|
+
(str_instr & kLdrStrInstrArgumentMask)) {
|
1417
|
+
// Pattern: Ldr/str same fp+offset, same register.
|
1418
|
+
//
|
1419
|
+
// The following:
|
1420
|
+
// str rx, [fp, #-12]
|
1421
|
+
// ldr rx, [fp, #-12]
|
1422
|
+
//
|
1423
|
+
// Becomes:
|
1424
|
+
// str rx, [fp, #-12]
|
1425
|
+
|
1426
|
+
pc_ -= 1 * kInstrSize;
|
1427
|
+
if (FLAG_print_peephole_optimization) {
|
1428
|
+
PrintF("%x str/ldr (fp + same offset), same reg\n", pc_offset());
|
1429
|
+
}
|
1430
|
+
} else if ((ldr_instr & kLdrStrOffsetMask) ==
|
1431
|
+
(str_instr & kLdrStrOffsetMask)) {
|
1432
|
+
// Pattern: Ldr/str same fp+offset, different register.
|
1433
|
+
//
|
1434
|
+
// The following:
|
1435
|
+
// str rx, [fp, #-12]
|
1436
|
+
// ldr ry, [fp, #-12]
|
1437
|
+
//
|
1438
|
+
// Becomes:
|
1439
|
+
// str rx, [fp, #-12]
|
1440
|
+
// mov ry, rx
|
1441
|
+
|
1442
|
+
Register reg_stored, reg_loaded;
|
1443
|
+
reg_stored = GetRd(str_instr);
|
1444
|
+
reg_loaded = GetRd(ldr_instr);
|
1445
|
+
pc_ -= 1 * kInstrSize;
|
1446
|
+
// Insert a mov instruction, which is better than ldr.
|
1447
|
+
mov(reg_loaded, reg_stored);
|
1448
|
+
if (FLAG_print_peephole_optimization) {
|
1449
|
+
PrintF("%x str/ldr (fp + same offset), diff reg \n", pc_offset());
|
1450
|
+
}
|
1451
|
+
}
|
1452
|
+
}
|
1453
|
+
}
|
1454
|
+
|
1455
|
+
if (can_peephole_optimize(3)) {
|
1456
|
+
Instr mem_write_instr = instr_at(pc_ - 3 * kInstrSize);
|
1457
|
+
Instr ldr_instr = instr_at(pc_ - 2 * kInstrSize);
|
1458
|
+
Instr mem_read_instr = instr_at(pc_ - 1 * kInstrSize);
|
1459
|
+
if (IsPush(mem_write_instr) &&
|
1460
|
+
IsPop(mem_read_instr)) {
|
1461
|
+
if ((IsLdrRegFpOffset(ldr_instr) ||
|
1462
|
+
IsLdrRegFpNegOffset(ldr_instr))) {
|
1463
|
+
if (Instruction::RdValue(mem_write_instr) ==
|
1464
|
+
Instruction::RdValue(mem_read_instr)) {
|
1465
|
+
// Pattern: push & pop from/to same register,
|
1466
|
+
// with a fp+offset ldr in between
|
1467
|
+
//
|
1468
|
+
// The following:
|
1469
|
+
// str rx, [sp, #-4]!
|
1470
|
+
// ldr rz, [fp, #-24]
|
1471
|
+
// ldr rx, [sp], #+4
|
1472
|
+
//
|
1473
|
+
// Becomes:
|
1474
|
+
// if(rx == rz)
|
1475
|
+
// delete all
|
1476
|
+
// else
|
1477
|
+
// ldr rz, [fp, #-24]
|
1478
|
+
|
1479
|
+
if (Instruction::RdValue(mem_write_instr) ==
|
1480
|
+
Instruction::RdValue(ldr_instr)) {
|
1481
|
+
pc_ -= 3 * kInstrSize;
|
1482
|
+
} else {
|
1483
|
+
pc_ -= 3 * kInstrSize;
|
1484
|
+
// Reinsert back the ldr rz.
|
1485
|
+
emit(ldr_instr);
|
1486
|
+
}
|
1487
|
+
if (FLAG_print_peephole_optimization) {
|
1488
|
+
PrintF("%x push/pop -dead ldr fp+offset in middle\n", pc_offset());
|
1489
|
+
}
|
1490
|
+
} else {
|
1491
|
+
// Pattern: push & pop from/to different registers
|
1492
|
+
// with a fp+offset ldr in between
|
1493
|
+
//
|
1494
|
+
// The following:
|
1495
|
+
// str rx, [sp, #-4]!
|
1496
|
+
// ldr rz, [fp, #-24]
|
1497
|
+
// ldr ry, [sp], #+4
|
1498
|
+
//
|
1499
|
+
// Becomes:
|
1500
|
+
// if(ry == rz)
|
1501
|
+
// mov ry, rx;
|
1502
|
+
// else if(rx != rz)
|
1503
|
+
// ldr rz, [fp, #-24]
|
1504
|
+
// mov ry, rx
|
1505
|
+
// else if((ry != rz) || (rx == rz)) becomes:
|
1506
|
+
// mov ry, rx
|
1507
|
+
// ldr rz, [fp, #-24]
|
1508
|
+
|
1509
|
+
Register reg_pushed, reg_popped;
|
1510
|
+
if (Instruction::RdValue(mem_read_instr) ==
|
1511
|
+
Instruction::RdValue(ldr_instr)) {
|
1512
|
+
reg_pushed = GetRd(mem_write_instr);
|
1513
|
+
reg_popped = GetRd(mem_read_instr);
|
1514
|
+
pc_ -= 3 * kInstrSize;
|
1515
|
+
mov(reg_popped, reg_pushed);
|
1516
|
+
} else if (Instruction::RdValue(mem_write_instr) !=
|
1517
|
+
Instruction::RdValue(ldr_instr)) {
|
1518
|
+
reg_pushed = GetRd(mem_write_instr);
|
1519
|
+
reg_popped = GetRd(mem_read_instr);
|
1520
|
+
pc_ -= 3 * kInstrSize;
|
1521
|
+
emit(ldr_instr);
|
1522
|
+
mov(reg_popped, reg_pushed);
|
1523
|
+
} else if ((Instruction::RdValue(mem_read_instr) !=
|
1524
|
+
Instruction::RdValue(ldr_instr)) ||
|
1525
|
+
(Instruction::RdValue(mem_write_instr) ==
|
1526
|
+
Instruction::RdValue(ldr_instr))) {
|
1527
|
+
reg_pushed = GetRd(mem_write_instr);
|
1528
|
+
reg_popped = GetRd(mem_read_instr);
|
1529
|
+
pc_ -= 3 * kInstrSize;
|
1530
|
+
mov(reg_popped, reg_pushed);
|
1531
|
+
emit(ldr_instr);
|
1532
|
+
}
|
1533
|
+
if (FLAG_print_peephole_optimization) {
|
1534
|
+
PrintF("%x push/pop (ldr fp+off in middle)\n", pc_offset());
|
1535
|
+
}
|
1536
|
+
}
|
1537
|
+
}
|
1538
|
+
}
|
1539
|
+
}
|
1540
|
+
}
|
1541
|
+
|
1542
|
+
|
1543
|
+
void Assembler::str(Register src, const MemOperand& dst, Condition cond) {
|
1544
|
+
addrmod2(cond | B26, src, dst);
|
1545
|
+
|
1546
|
+
// Eliminate pattern: pop(), push(r)
|
1547
|
+
// add sp, sp, #4 LeaveCC, al; str r, [sp, #-4], al
|
1548
|
+
// -> str r, [sp, 0], al
|
1549
|
+
if (can_peephole_optimize(2) &&
|
1550
|
+
// Pattern.
|
1551
|
+
instr_at(pc_ - 1 * kInstrSize) == (kPushRegPattern | src.code() * B12) &&
|
1552
|
+
instr_at(pc_ - 2 * kInstrSize) == kPopInstruction) {
|
1553
|
+
pc_ -= 2 * kInstrSize;
|
1554
|
+
emit(al | B26 | 0 | Offset | sp.code() * B16 | src.code() * B12);
|
1555
|
+
if (FLAG_print_peephole_optimization) {
|
1556
|
+
PrintF("%x pop()/push(reg) eliminated\n", pc_offset());
|
1557
|
+
}
|
1558
|
+
}
|
1559
|
+
}
|
1560
|
+
|
1561
|
+
|
1562
|
+
void Assembler::ldrb(Register dst, const MemOperand& src, Condition cond) {
|
1563
|
+
addrmod2(cond | B26 | B | L, dst, src);
|
1564
|
+
}
|
1565
|
+
|
1566
|
+
|
1567
|
+
void Assembler::strb(Register src, const MemOperand& dst, Condition cond) {
|
1568
|
+
addrmod2(cond | B26 | B, src, dst);
|
1569
|
+
}
|
1570
|
+
|
1571
|
+
|
1572
|
+
void Assembler::ldrh(Register dst, const MemOperand& src, Condition cond) {
|
1573
|
+
addrmod3(cond | L | B7 | H | B4, dst, src);
|
1574
|
+
}
|
1575
|
+
|
1576
|
+
|
1577
|
+
void Assembler::strh(Register src, const MemOperand& dst, Condition cond) {
|
1578
|
+
addrmod3(cond | B7 | H | B4, src, dst);
|
1579
|
+
}
|
1580
|
+
|
1581
|
+
|
1582
|
+
void Assembler::ldrsb(Register dst, const MemOperand& src, Condition cond) {
|
1583
|
+
addrmod3(cond | L | B7 | S6 | B4, dst, src);
|
1584
|
+
}
|
1585
|
+
|
1586
|
+
|
1587
|
+
void Assembler::ldrsh(Register dst, const MemOperand& src, Condition cond) {
|
1588
|
+
addrmod3(cond | L | B7 | S6 | H | B4, dst, src);
|
1589
|
+
}
|
1590
|
+
|
1591
|
+
|
1592
|
+
void Assembler::ldrd(Register dst1, Register dst2,
|
1593
|
+
const MemOperand& src, Condition cond) {
|
1594
|
+
ASSERT(CpuFeatures::IsEnabled(ARMv7));
|
1595
|
+
ASSERT(src.rm().is(no_reg));
|
1596
|
+
ASSERT(!dst1.is(lr)); // r14.
|
1597
|
+
ASSERT_EQ(0, dst1.code() % 2);
|
1598
|
+
ASSERT_EQ(dst1.code() + 1, dst2.code());
|
1599
|
+
addrmod3(cond | B7 | B6 | B4, dst1, src);
|
1600
|
+
}
|
1601
|
+
|
1602
|
+
|
1603
|
+
void Assembler::strd(Register src1, Register src2,
|
1604
|
+
const MemOperand& dst, Condition cond) {
|
1605
|
+
ASSERT(dst.rm().is(no_reg));
|
1606
|
+
ASSERT(!src1.is(lr)); // r14.
|
1607
|
+
ASSERT_EQ(0, src1.code() % 2);
|
1608
|
+
ASSERT_EQ(src1.code() + 1, src2.code());
|
1609
|
+
ASSERT(CpuFeatures::IsEnabled(ARMv7));
|
1610
|
+
addrmod3(cond | B7 | B6 | B5 | B4, src1, dst);
|
1611
|
+
}
|
1612
|
+
|
1613
|
+
// Load/Store multiple instructions.
|
1614
|
+
void Assembler::ldm(BlockAddrMode am,
|
1615
|
+
Register base,
|
1616
|
+
RegList dst,
|
1617
|
+
Condition cond) {
|
1618
|
+
// ABI stack constraint: ldmxx base, {..sp..} base != sp is not restartable.
|
1619
|
+
ASSERT(base.is(sp) || (dst & sp.bit()) == 0);
|
1620
|
+
|
1621
|
+
addrmod4(cond | B27 | am | L, base, dst);
|
1622
|
+
|
1623
|
+
// Emit the constant pool after a function return implemented by ldm ..{..pc}.
|
1624
|
+
if (cond == al && (dst & pc.bit()) != 0) {
|
1625
|
+
// There is a slight chance that the ldm instruction was actually a call,
|
1626
|
+
// in which case it would be wrong to return into the constant pool; we
|
1627
|
+
// recognize this case by checking if the emission of the pool was blocked
|
1628
|
+
// at the pc of the ldm instruction by a mov lr, pc instruction; if this is
|
1629
|
+
// the case, we emit a jump over the pool.
|
1630
|
+
CheckConstPool(true, no_const_pool_before_ == pc_offset() - kInstrSize);
|
1631
|
+
}
|
1632
|
+
}
|
1633
|
+
|
1634
|
+
|
1635
|
+
void Assembler::stm(BlockAddrMode am,
|
1636
|
+
Register base,
|
1637
|
+
RegList src,
|
1638
|
+
Condition cond) {
|
1639
|
+
addrmod4(cond | B27 | am, base, src);
|
1640
|
+
}
|
1641
|
+
|
1642
|
+
|
1643
|
+
// Exception-generating instructions and debugging support.
|
1644
|
+
// Stops with a non-negative code less than kNumOfWatchedStops support
|
1645
|
+
// enabling/disabling and a counter feature. See simulator-arm.h .
|
1646
|
+
void Assembler::stop(const char* msg, Condition cond, int32_t code) {
|
1647
|
+
#ifndef __arm__
|
1648
|
+
ASSERT(code >= kDefaultStopCode);
|
1649
|
+
// The Simulator will handle the stop instruction and get the message address.
|
1650
|
+
// It expects to find the address just after the svc instruction.
|
1651
|
+
BlockConstPoolFor(2);
|
1652
|
+
if (code >= 0) {
|
1653
|
+
svc(kStopCode + code, cond);
|
1654
|
+
} else {
|
1655
|
+
svc(kStopCode + kMaxStopCode, cond);
|
1656
|
+
}
|
1657
|
+
emit(reinterpret_cast<Instr>(msg));
|
1658
|
+
#else // def __arm__
|
1659
|
+
#ifdef CAN_USE_ARMV5_INSTRUCTIONS
|
1660
|
+
if (cond != al) {
|
1661
|
+
Label skip;
|
1662
|
+
b(&skip, NegateCondition(cond));
|
1663
|
+
bkpt(0);
|
1664
|
+
bind(&skip);
|
1665
|
+
} else {
|
1666
|
+
bkpt(0);
|
1667
|
+
}
|
1668
|
+
#else // ndef CAN_USE_ARMV5_INSTRUCTIONS
|
1669
|
+
svc(0x9f0001, cond);
|
1670
|
+
#endif // ndef CAN_USE_ARMV5_INSTRUCTIONS
|
1671
|
+
#endif // def __arm__
|
1672
|
+
}
|
1673
|
+
|
1674
|
+
|
1675
|
+
void Assembler::bkpt(uint32_t imm16) { // v5 and above
|
1676
|
+
ASSERT(is_uint16(imm16));
|
1677
|
+
emit(al | B24 | B21 | (imm16 >> 4)*B8 | BKPT | (imm16 & 0xf));
|
1678
|
+
}
|
1679
|
+
|
1680
|
+
|
1681
|
+
void Assembler::svc(uint32_t imm24, Condition cond) {
|
1682
|
+
ASSERT(is_uint24(imm24));
|
1683
|
+
emit(cond | 15*B24 | imm24);
|
1684
|
+
}
|
1685
|
+
|
1686
|
+
|
1687
|
+
// Coprocessor instructions.
|
1688
|
+
void Assembler::cdp(Coprocessor coproc,
|
1689
|
+
int opcode_1,
|
1690
|
+
CRegister crd,
|
1691
|
+
CRegister crn,
|
1692
|
+
CRegister crm,
|
1693
|
+
int opcode_2,
|
1694
|
+
Condition cond) {
|
1695
|
+
ASSERT(is_uint4(opcode_1) && is_uint3(opcode_2));
|
1696
|
+
emit(cond | B27 | B26 | B25 | (opcode_1 & 15)*B20 | crn.code()*B16 |
|
1697
|
+
crd.code()*B12 | coproc*B8 | (opcode_2 & 7)*B5 | crm.code());
|
1698
|
+
}
|
1699
|
+
|
1700
|
+
|
1701
|
+
void Assembler::cdp2(Coprocessor coproc,
|
1702
|
+
int opcode_1,
|
1703
|
+
CRegister crd,
|
1704
|
+
CRegister crn,
|
1705
|
+
CRegister crm,
|
1706
|
+
int opcode_2) { // v5 and above
|
1707
|
+
cdp(coproc, opcode_1, crd, crn, crm, opcode_2, kSpecialCondition);
|
1708
|
+
}
|
1709
|
+
|
1710
|
+
|
1711
|
+
void Assembler::mcr(Coprocessor coproc,
|
1712
|
+
int opcode_1,
|
1713
|
+
Register rd,
|
1714
|
+
CRegister crn,
|
1715
|
+
CRegister crm,
|
1716
|
+
int opcode_2,
|
1717
|
+
Condition cond) {
|
1718
|
+
ASSERT(is_uint3(opcode_1) && is_uint3(opcode_2));
|
1719
|
+
emit(cond | B27 | B26 | B25 | (opcode_1 & 7)*B21 | crn.code()*B16 |
|
1720
|
+
rd.code()*B12 | coproc*B8 | (opcode_2 & 7)*B5 | B4 | crm.code());
|
1721
|
+
}
|
1722
|
+
|
1723
|
+
|
1724
|
+
void Assembler::mcr2(Coprocessor coproc,
|
1725
|
+
int opcode_1,
|
1726
|
+
Register rd,
|
1727
|
+
CRegister crn,
|
1728
|
+
CRegister crm,
|
1729
|
+
int opcode_2) { // v5 and above
|
1730
|
+
mcr(coproc, opcode_1, rd, crn, crm, opcode_2, kSpecialCondition);
|
1731
|
+
}
|
1732
|
+
|
1733
|
+
|
1734
|
+
void Assembler::mrc(Coprocessor coproc,
|
1735
|
+
int opcode_1,
|
1736
|
+
Register rd,
|
1737
|
+
CRegister crn,
|
1738
|
+
CRegister crm,
|
1739
|
+
int opcode_2,
|
1740
|
+
Condition cond) {
|
1741
|
+
ASSERT(is_uint3(opcode_1) && is_uint3(opcode_2));
|
1742
|
+
emit(cond | B27 | B26 | B25 | (opcode_1 & 7)*B21 | L | crn.code()*B16 |
|
1743
|
+
rd.code()*B12 | coproc*B8 | (opcode_2 & 7)*B5 | B4 | crm.code());
|
1744
|
+
}
|
1745
|
+
|
1746
|
+
|
1747
|
+
void Assembler::mrc2(Coprocessor coproc,
|
1748
|
+
int opcode_1,
|
1749
|
+
Register rd,
|
1750
|
+
CRegister crn,
|
1751
|
+
CRegister crm,
|
1752
|
+
int opcode_2) { // v5 and above
|
1753
|
+
mrc(coproc, opcode_1, rd, crn, crm, opcode_2, kSpecialCondition);
|
1754
|
+
}
|
1755
|
+
|
1756
|
+
|
1757
|
+
void Assembler::ldc(Coprocessor coproc,
|
1758
|
+
CRegister crd,
|
1759
|
+
const MemOperand& src,
|
1760
|
+
LFlag l,
|
1761
|
+
Condition cond) {
|
1762
|
+
addrmod5(cond | B27 | B26 | l | L | coproc*B8, crd, src);
|
1763
|
+
}
|
1764
|
+
|
1765
|
+
|
1766
|
+
void Assembler::ldc(Coprocessor coproc,
|
1767
|
+
CRegister crd,
|
1768
|
+
Register rn,
|
1769
|
+
int option,
|
1770
|
+
LFlag l,
|
1771
|
+
Condition cond) {
|
1772
|
+
// Unindexed addressing.
|
1773
|
+
ASSERT(is_uint8(option));
|
1774
|
+
emit(cond | B27 | B26 | U | l | L | rn.code()*B16 | crd.code()*B12 |
|
1775
|
+
coproc*B8 | (option & 255));
|
1776
|
+
}
|
1777
|
+
|
1778
|
+
|
1779
|
+
void Assembler::ldc2(Coprocessor coproc,
|
1780
|
+
CRegister crd,
|
1781
|
+
const MemOperand& src,
|
1782
|
+
LFlag l) { // v5 and above
|
1783
|
+
ldc(coproc, crd, src, l, kSpecialCondition);
|
1784
|
+
}
|
1785
|
+
|
1786
|
+
|
1787
|
+
void Assembler::ldc2(Coprocessor coproc,
|
1788
|
+
CRegister crd,
|
1789
|
+
Register rn,
|
1790
|
+
int option,
|
1791
|
+
LFlag l) { // v5 and above
|
1792
|
+
ldc(coproc, crd, rn, option, l, kSpecialCondition);
|
1793
|
+
}
|
1794
|
+
|
1795
|
+
|
1796
|
+
void Assembler::stc(Coprocessor coproc,
|
1797
|
+
CRegister crd,
|
1798
|
+
const MemOperand& dst,
|
1799
|
+
LFlag l,
|
1800
|
+
Condition cond) {
|
1801
|
+
addrmod5(cond | B27 | B26 | l | coproc*B8, crd, dst);
|
1802
|
+
}
|
1803
|
+
|
1804
|
+
|
1805
|
+
void Assembler::stc(Coprocessor coproc,
|
1806
|
+
CRegister crd,
|
1807
|
+
Register rn,
|
1808
|
+
int option,
|
1809
|
+
LFlag l,
|
1810
|
+
Condition cond) {
|
1811
|
+
// Unindexed addressing.
|
1812
|
+
ASSERT(is_uint8(option));
|
1813
|
+
emit(cond | B27 | B26 | U | l | rn.code()*B16 | crd.code()*B12 |
|
1814
|
+
coproc*B8 | (option & 255));
|
1815
|
+
}
|
1816
|
+
|
1817
|
+
|
1818
|
+
void Assembler::stc2(Coprocessor
|
1819
|
+
coproc, CRegister crd,
|
1820
|
+
const MemOperand& dst,
|
1821
|
+
LFlag l) { // v5 and above
|
1822
|
+
stc(coproc, crd, dst, l, kSpecialCondition);
|
1823
|
+
}
|
1824
|
+
|
1825
|
+
|
1826
|
+
void Assembler::stc2(Coprocessor coproc,
|
1827
|
+
CRegister crd,
|
1828
|
+
Register rn,
|
1829
|
+
int option,
|
1830
|
+
LFlag l) { // v5 and above
|
1831
|
+
stc(coproc, crd, rn, option, l, kSpecialCondition);
|
1832
|
+
}
|
1833
|
+
|
1834
|
+
|
1835
|
+
// Support for VFP.
|
1836
|
+
|
1837
|
+
void Assembler::vldr(const DwVfpRegister dst,
|
1838
|
+
const Register base,
|
1839
|
+
int offset,
|
1840
|
+
const Condition cond) {
|
1841
|
+
// Ddst = MEM(Rbase + offset).
|
1842
|
+
// Instruction details available in ARM DDI 0406A, A8-628.
|
1843
|
+
// cond(31-28) | 1101(27-24)| U001(23-20) | Rbase(19-16) |
|
1844
|
+
// Vdst(15-12) | 1011(11-8) | offset
|
1845
|
+
ASSERT(CpuFeatures::IsEnabled(VFP3));
|
1846
|
+
int u = 1;
|
1847
|
+
if (offset < 0) {
|
1848
|
+
offset = -offset;
|
1849
|
+
u = 0;
|
1850
|
+
}
|
1851
|
+
|
1852
|
+
ASSERT(offset >= 0);
|
1853
|
+
if ((offset % 4) == 0 && (offset / 4) < 256) {
|
1854
|
+
emit(cond | u*B23 | 0xD1*B20 | base.code()*B16 | dst.code()*B12 |
|
1855
|
+
0xB*B8 | ((offset / 4) & 255));
|
1856
|
+
} else {
|
1857
|
+
// Larger offsets must be handled by computing the correct address
|
1858
|
+
// in the ip register.
|
1859
|
+
ASSERT(!base.is(ip));
|
1860
|
+
if (u == 1) {
|
1861
|
+
add(ip, base, Operand(offset));
|
1862
|
+
} else {
|
1863
|
+
sub(ip, base, Operand(offset));
|
1864
|
+
}
|
1865
|
+
emit(cond | 0xD1*B20 | ip.code()*B16 | dst.code()*B12 | 0xB*B8);
|
1866
|
+
}
|
1867
|
+
}
|
1868
|
+
|
1869
|
+
|
1870
|
+
void Assembler::vldr(const DwVfpRegister dst,
|
1871
|
+
const MemOperand& operand,
|
1872
|
+
const Condition cond) {
|
1873
|
+
ASSERT(!operand.rm().is_valid());
|
1874
|
+
ASSERT(operand.am_ == Offset);
|
1875
|
+
vldr(dst, operand.rn(), operand.offset(), cond);
|
1876
|
+
}
|
1877
|
+
|
1878
|
+
|
1879
|
+
void Assembler::vldr(const SwVfpRegister dst,
|
1880
|
+
const Register base,
|
1881
|
+
int offset,
|
1882
|
+
const Condition cond) {
|
1883
|
+
// Sdst = MEM(Rbase + offset).
|
1884
|
+
// Instruction details available in ARM DDI 0406A, A8-628.
|
1885
|
+
// cond(31-28) | 1101(27-24)| U001(23-20) | Rbase(19-16) |
|
1886
|
+
// Vdst(15-12) | 1010(11-8) | offset
|
1887
|
+
ASSERT(CpuFeatures::IsEnabled(VFP3));
|
1888
|
+
int u = 1;
|
1889
|
+
if (offset < 0) {
|
1890
|
+
offset = -offset;
|
1891
|
+
u = 0;
|
1892
|
+
}
|
1893
|
+
int sd, d;
|
1894
|
+
dst.split_code(&sd, &d);
|
1895
|
+
ASSERT(offset >= 0);
|
1896
|
+
|
1897
|
+
if ((offset % 4) == 0 && (offset / 4) < 256) {
|
1898
|
+
emit(cond | u*B23 | d*B22 | 0xD1*B20 | base.code()*B16 | sd*B12 |
|
1899
|
+
0xA*B8 | ((offset / 4) & 255));
|
1900
|
+
} else {
|
1901
|
+
// Larger offsets must be handled by computing the correct address
|
1902
|
+
// in the ip register.
|
1903
|
+
ASSERT(!base.is(ip));
|
1904
|
+
if (u == 1) {
|
1905
|
+
add(ip, base, Operand(offset));
|
1906
|
+
} else {
|
1907
|
+
sub(ip, base, Operand(offset));
|
1908
|
+
}
|
1909
|
+
emit(cond | d*B22 | 0xD1*B20 | ip.code()*B16 | sd*B12 | 0xA*B8);
|
1910
|
+
}
|
1911
|
+
}
|
1912
|
+
|
1913
|
+
|
1914
|
+
void Assembler::vldr(const SwVfpRegister dst,
|
1915
|
+
const MemOperand& operand,
|
1916
|
+
const Condition cond) {
|
1917
|
+
ASSERT(!operand.rm().is_valid());
|
1918
|
+
ASSERT(operand.am_ == Offset);
|
1919
|
+
vldr(dst, operand.rn(), operand.offset(), cond);
|
1920
|
+
}
|
1921
|
+
|
1922
|
+
|
1923
|
+
void Assembler::vstr(const DwVfpRegister src,
|
1924
|
+
const Register base,
|
1925
|
+
int offset,
|
1926
|
+
const Condition cond) {
|
1927
|
+
// MEM(Rbase + offset) = Dsrc.
|
1928
|
+
// Instruction details available in ARM DDI 0406A, A8-786.
|
1929
|
+
// cond(31-28) | 1101(27-24)| U000(23-20) | | Rbase(19-16) |
|
1930
|
+
// Vsrc(15-12) | 1011(11-8) | (offset/4)
|
1931
|
+
ASSERT(CpuFeatures::IsEnabled(VFP3));
|
1932
|
+
int u = 1;
|
1933
|
+
if (offset < 0) {
|
1934
|
+
offset = -offset;
|
1935
|
+
u = 0;
|
1936
|
+
}
|
1937
|
+
ASSERT(offset >= 0);
|
1938
|
+
if ((offset % 4) == 0 && (offset / 4) < 256) {
|
1939
|
+
emit(cond | u*B23 | 0xD0*B20 | base.code()*B16 | src.code()*B12 |
|
1940
|
+
0xB*B8 | ((offset / 4) & 255));
|
1941
|
+
} else {
|
1942
|
+
// Larger offsets must be handled by computing the correct address
|
1943
|
+
// in the ip register.
|
1944
|
+
ASSERT(!base.is(ip));
|
1945
|
+
if (u == 1) {
|
1946
|
+
add(ip, base, Operand(offset));
|
1947
|
+
} else {
|
1948
|
+
sub(ip, base, Operand(offset));
|
1949
|
+
}
|
1950
|
+
emit(cond | 0xD0*B20 | ip.code()*B16 | src.code()*B12 | 0xB*B8);
|
1951
|
+
}
|
1952
|
+
}
|
1953
|
+
|
1954
|
+
|
1955
|
+
void Assembler::vstr(const DwVfpRegister src,
|
1956
|
+
const MemOperand& operand,
|
1957
|
+
const Condition cond) {
|
1958
|
+
ASSERT(!operand.rm().is_valid());
|
1959
|
+
ASSERT(operand.am_ == Offset);
|
1960
|
+
vstr(src, operand.rn(), operand.offset(), cond);
|
1961
|
+
}
|
1962
|
+
|
1963
|
+
|
1964
|
+
void Assembler::vstr(const SwVfpRegister src,
|
1965
|
+
const Register base,
|
1966
|
+
int offset,
|
1967
|
+
const Condition cond) {
|
1968
|
+
// MEM(Rbase + offset) = SSrc.
|
1969
|
+
// Instruction details available in ARM DDI 0406A, A8-786.
|
1970
|
+
// cond(31-28) | 1101(27-24)| U000(23-20) | Rbase(19-16) |
|
1971
|
+
// Vdst(15-12) | 1010(11-8) | (offset/4)
|
1972
|
+
ASSERT(CpuFeatures::IsEnabled(VFP3));
|
1973
|
+
int u = 1;
|
1974
|
+
if (offset < 0) {
|
1975
|
+
offset = -offset;
|
1976
|
+
u = 0;
|
1977
|
+
}
|
1978
|
+
int sd, d;
|
1979
|
+
src.split_code(&sd, &d);
|
1980
|
+
ASSERT(offset >= 0);
|
1981
|
+
if ((offset % 4) == 0 && (offset / 4) < 256) {
|
1982
|
+
emit(cond | u*B23 | d*B22 | 0xD0*B20 | base.code()*B16 | sd*B12 |
|
1983
|
+
0xA*B8 | ((offset / 4) & 255));
|
1984
|
+
} else {
|
1985
|
+
// Larger offsets must be handled by computing the correct address
|
1986
|
+
// in the ip register.
|
1987
|
+
ASSERT(!base.is(ip));
|
1988
|
+
if (u == 1) {
|
1989
|
+
add(ip, base, Operand(offset));
|
1990
|
+
} else {
|
1991
|
+
sub(ip, base, Operand(offset));
|
1992
|
+
}
|
1993
|
+
emit(cond | d*B22 | 0xD0*B20 | ip.code()*B16 | sd*B12 | 0xA*B8);
|
1994
|
+
}
|
1995
|
+
}
|
1996
|
+
|
1997
|
+
|
1998
|
+
void Assembler::vstr(const SwVfpRegister src,
|
1999
|
+
const MemOperand& operand,
|
2000
|
+
const Condition cond) {
|
2001
|
+
ASSERT(!operand.rm().is_valid());
|
2002
|
+
ASSERT(operand.am_ == Offset);
|
2003
|
+
vldr(src, operand.rn(), operand.offset(), cond);
|
2004
|
+
}
|
2005
|
+
|
2006
|
+
|
2007
|
+
static void DoubleAsTwoUInt32(double d, uint32_t* lo, uint32_t* hi) {
|
2008
|
+
uint64_t i;
|
2009
|
+
memcpy(&i, &d, 8);
|
2010
|
+
|
2011
|
+
*lo = i & 0xffffffff;
|
2012
|
+
*hi = i >> 32;
|
2013
|
+
}
|
2014
|
+
|
2015
|
+
// Only works for little endian floating point formats.
|
2016
|
+
// We don't support VFP on the mixed endian floating point platform.
|
2017
|
+
static bool FitsVMOVDoubleImmediate(double d, uint32_t *encoding) {
|
2018
|
+
ASSERT(CpuFeatures::IsEnabled(VFP3));
|
2019
|
+
|
2020
|
+
// VMOV can accept an immediate of the form:
|
2021
|
+
//
|
2022
|
+
// +/- m * 2^(-n) where 16 <= m <= 31 and 0 <= n <= 7
|
2023
|
+
//
|
2024
|
+
// The immediate is encoded using an 8-bit quantity, comprised of two
|
2025
|
+
// 4-bit fields. For an 8-bit immediate of the form:
|
2026
|
+
//
|
2027
|
+
// [abcdefgh]
|
2028
|
+
//
|
2029
|
+
// where a is the MSB and h is the LSB, an immediate 64-bit double can be
|
2030
|
+
// created of the form:
|
2031
|
+
//
|
2032
|
+
// [aBbbbbbb,bbcdefgh,00000000,00000000,
|
2033
|
+
// 00000000,00000000,00000000,00000000]
|
2034
|
+
//
|
2035
|
+
// where B = ~b.
|
2036
|
+
//
|
2037
|
+
|
2038
|
+
uint32_t lo, hi;
|
2039
|
+
DoubleAsTwoUInt32(d, &lo, &hi);
|
2040
|
+
|
2041
|
+
// The most obvious constraint is the long block of zeroes.
|
2042
|
+
if ((lo != 0) || ((hi & 0xffff) != 0)) {
|
2043
|
+
return false;
|
2044
|
+
}
|
2045
|
+
|
2046
|
+
// Bits 62:55 must be all clear or all set.
|
2047
|
+
if (((hi & 0x3fc00000) != 0) && ((hi & 0x3fc00000) != 0x3fc00000)) {
|
2048
|
+
return false;
|
2049
|
+
}
|
2050
|
+
|
2051
|
+
// Bit 63 must be NOT bit 62.
|
2052
|
+
if (((hi ^ (hi << 1)) & (0x40000000)) == 0) {
|
2053
|
+
return false;
|
2054
|
+
}
|
2055
|
+
|
2056
|
+
// Create the encoded immediate in the form:
|
2057
|
+
// [00000000,0000abcd,00000000,0000efgh]
|
2058
|
+
*encoding = (hi >> 16) & 0xf; // Low nybble.
|
2059
|
+
*encoding |= (hi >> 4) & 0x70000; // Low three bits of the high nybble.
|
2060
|
+
*encoding |= (hi >> 12) & 0x80000; // Top bit of the high nybble.
|
2061
|
+
|
2062
|
+
return true;
|
2063
|
+
}
|
2064
|
+
|
2065
|
+
|
2066
|
+
void Assembler::vmov(const DwVfpRegister dst,
|
2067
|
+
double imm,
|
2068
|
+
const Condition cond) {
|
2069
|
+
// Dd = immediate
|
2070
|
+
// Instruction details available in ARM DDI 0406B, A8-640.
|
2071
|
+
ASSERT(CpuFeatures::IsEnabled(VFP3));
|
2072
|
+
|
2073
|
+
uint32_t enc;
|
2074
|
+
if (FitsVMOVDoubleImmediate(imm, &enc)) {
|
2075
|
+
// The double can be encoded in the instruction.
|
2076
|
+
emit(cond | 0xE*B24 | 0xB*B20 | dst.code()*B12 | 0xB*B8 | enc);
|
2077
|
+
} else {
|
2078
|
+
// Synthesise the double from ARM immediates. This could be implemented
|
2079
|
+
// using vldr from a constant pool.
|
2080
|
+
uint32_t lo, hi;
|
2081
|
+
DoubleAsTwoUInt32(imm, &lo, &hi);
|
2082
|
+
|
2083
|
+
if (lo == hi) {
|
2084
|
+
// If the lo and hi parts of the double are equal, the literal is easier
|
2085
|
+
// to create. This is the case with 0.0.
|
2086
|
+
mov(ip, Operand(lo));
|
2087
|
+
vmov(dst, ip, ip);
|
2088
|
+
} else {
|
2089
|
+
// Move the low part of the double into the lower of the corresponsing S
|
2090
|
+
// registers of D register dst.
|
2091
|
+
mov(ip, Operand(lo));
|
2092
|
+
vmov(dst.low(), ip, cond);
|
2093
|
+
|
2094
|
+
// Move the high part of the double into the higher of the corresponsing S
|
2095
|
+
// registers of D register dst.
|
2096
|
+
mov(ip, Operand(hi));
|
2097
|
+
vmov(dst.high(), ip, cond);
|
2098
|
+
}
|
2099
|
+
}
|
2100
|
+
}
|
2101
|
+
|
2102
|
+
|
2103
|
+
void Assembler::vmov(const SwVfpRegister dst,
|
2104
|
+
const SwVfpRegister src,
|
2105
|
+
const Condition cond) {
|
2106
|
+
// Sd = Sm
|
2107
|
+
// Instruction details available in ARM DDI 0406B, A8-642.
|
2108
|
+
ASSERT(CpuFeatures::IsEnabled(VFP3));
|
2109
|
+
int sd, d, sm, m;
|
2110
|
+
dst.split_code(&sd, &d);
|
2111
|
+
src.split_code(&sm, &m);
|
2112
|
+
emit(cond | 0xE*B24 | d*B22 | 0xB*B20 | sd*B12 | 0xA*B8 | B6 | m*B5 | sm);
|
2113
|
+
}
|
2114
|
+
|
2115
|
+
|
2116
|
+
void Assembler::vmov(const DwVfpRegister dst,
|
2117
|
+
const DwVfpRegister src,
|
2118
|
+
const Condition cond) {
|
2119
|
+
// Dd = Dm
|
2120
|
+
// Instruction details available in ARM DDI 0406B, A8-642.
|
2121
|
+
ASSERT(CpuFeatures::IsEnabled(VFP3));
|
2122
|
+
emit(cond | 0xE*B24 | 0xB*B20 |
|
2123
|
+
dst.code()*B12 | 0x5*B9 | B8 | B6 | src.code());
|
2124
|
+
}
|
2125
|
+
|
2126
|
+
|
2127
|
+
void Assembler::vmov(const DwVfpRegister dst,
|
2128
|
+
const Register src1,
|
2129
|
+
const Register src2,
|
2130
|
+
const Condition cond) {
|
2131
|
+
// Dm = <Rt,Rt2>.
|
2132
|
+
// Instruction details available in ARM DDI 0406A, A8-646.
|
2133
|
+
// cond(31-28) | 1100(27-24)| 010(23-21) | op=0(20) | Rt2(19-16) |
|
2134
|
+
// Rt(15-12) | 1011(11-8) | 00(7-6) | M(5) | 1(4) | Vm
|
2135
|
+
ASSERT(CpuFeatures::IsEnabled(VFP3));
|
2136
|
+
ASSERT(!src1.is(pc) && !src2.is(pc));
|
2137
|
+
emit(cond | 0xC*B24 | B22 | src2.code()*B16 |
|
2138
|
+
src1.code()*B12 | 0xB*B8 | B4 | dst.code());
|
2139
|
+
}
|
2140
|
+
|
2141
|
+
|
2142
|
+
void Assembler::vmov(const Register dst1,
|
2143
|
+
const Register dst2,
|
2144
|
+
const DwVfpRegister src,
|
2145
|
+
const Condition cond) {
|
2146
|
+
// <Rt,Rt2> = Dm.
|
2147
|
+
// Instruction details available in ARM DDI 0406A, A8-646.
|
2148
|
+
// cond(31-28) | 1100(27-24)| 010(23-21) | op=1(20) | Rt2(19-16) |
|
2149
|
+
// Rt(15-12) | 1011(11-8) | 00(7-6) | M(5) | 1(4) | Vm
|
2150
|
+
ASSERT(CpuFeatures::IsEnabled(VFP3));
|
2151
|
+
ASSERT(!dst1.is(pc) && !dst2.is(pc));
|
2152
|
+
emit(cond | 0xC*B24 | B22 | B20 | dst2.code()*B16 |
|
2153
|
+
dst1.code()*B12 | 0xB*B8 | B4 | src.code());
|
2154
|
+
}
|
2155
|
+
|
2156
|
+
|
2157
|
+
void Assembler::vmov(const SwVfpRegister dst,
|
2158
|
+
const Register src,
|
2159
|
+
const Condition cond) {
|
2160
|
+
// Sn = Rt.
|
2161
|
+
// Instruction details available in ARM DDI 0406A, A8-642.
|
2162
|
+
// cond(31-28) | 1110(27-24)| 000(23-21) | op=0(20) | Vn(19-16) |
|
2163
|
+
// Rt(15-12) | 1010(11-8) | N(7)=0 | 00(6-5) | 1(4) | 0000(3-0)
|
2164
|
+
ASSERT(CpuFeatures::IsEnabled(VFP3));
|
2165
|
+
ASSERT(!src.is(pc));
|
2166
|
+
int sn, n;
|
2167
|
+
dst.split_code(&sn, &n);
|
2168
|
+
emit(cond | 0xE*B24 | sn*B16 | src.code()*B12 | 0xA*B8 | n*B7 | B4);
|
2169
|
+
}
|
2170
|
+
|
2171
|
+
|
2172
|
+
void Assembler::vmov(const Register dst,
|
2173
|
+
const SwVfpRegister src,
|
2174
|
+
const Condition cond) {
|
2175
|
+
// Rt = Sn.
|
2176
|
+
// Instruction details available in ARM DDI 0406A, A8-642.
|
2177
|
+
// cond(31-28) | 1110(27-24)| 000(23-21) | op=1(20) | Vn(19-16) |
|
2178
|
+
// Rt(15-12) | 1010(11-8) | N(7)=0 | 00(6-5) | 1(4) | 0000(3-0)
|
2179
|
+
ASSERT(CpuFeatures::IsEnabled(VFP3));
|
2180
|
+
ASSERT(!dst.is(pc));
|
2181
|
+
int sn, n;
|
2182
|
+
src.split_code(&sn, &n);
|
2183
|
+
emit(cond | 0xE*B24 | B20 | sn*B16 | dst.code()*B12 | 0xA*B8 | n*B7 | B4);
|
2184
|
+
}
|
2185
|
+
|
2186
|
+
|
2187
|
+
// Type of data to read from or write to VFP register.
|
2188
|
+
// Used as specifier in generic vcvt instruction.
|
2189
|
+
enum VFPType { S32, U32, F32, F64 };
|
2190
|
+
|
2191
|
+
|
2192
|
+
static bool IsSignedVFPType(VFPType type) {
|
2193
|
+
switch (type) {
|
2194
|
+
case S32:
|
2195
|
+
return true;
|
2196
|
+
case U32:
|
2197
|
+
return false;
|
2198
|
+
default:
|
2199
|
+
UNREACHABLE();
|
2200
|
+
return false;
|
2201
|
+
}
|
2202
|
+
}
|
2203
|
+
|
2204
|
+
|
2205
|
+
static bool IsIntegerVFPType(VFPType type) {
|
2206
|
+
switch (type) {
|
2207
|
+
case S32:
|
2208
|
+
case U32:
|
2209
|
+
return true;
|
2210
|
+
case F32:
|
2211
|
+
case F64:
|
2212
|
+
return false;
|
2213
|
+
default:
|
2214
|
+
UNREACHABLE();
|
2215
|
+
return false;
|
2216
|
+
}
|
2217
|
+
}
|
2218
|
+
|
2219
|
+
|
2220
|
+
static bool IsDoubleVFPType(VFPType type) {
|
2221
|
+
switch (type) {
|
2222
|
+
case F32:
|
2223
|
+
return false;
|
2224
|
+
case F64:
|
2225
|
+
return true;
|
2226
|
+
default:
|
2227
|
+
UNREACHABLE();
|
2228
|
+
return false;
|
2229
|
+
}
|
2230
|
+
}
|
2231
|
+
|
2232
|
+
|
2233
|
+
// Split five bit reg_code based on size of reg_type.
|
2234
|
+
// 32-bit register codes are Vm:M
|
2235
|
+
// 64-bit register codes are M:Vm
|
2236
|
+
// where Vm is four bits, and M is a single bit.
|
2237
|
+
static void SplitRegCode(VFPType reg_type,
|
2238
|
+
int reg_code,
|
2239
|
+
int* vm,
|
2240
|
+
int* m) {
|
2241
|
+
ASSERT((reg_code >= 0) && (reg_code <= 31));
|
2242
|
+
if (IsIntegerVFPType(reg_type) || !IsDoubleVFPType(reg_type)) {
|
2243
|
+
// 32 bit type.
|
2244
|
+
*m = reg_code & 0x1;
|
2245
|
+
*vm = reg_code >> 1;
|
2246
|
+
} else {
|
2247
|
+
// 64 bit type.
|
2248
|
+
*m = (reg_code & 0x10) >> 4;
|
2249
|
+
*vm = reg_code & 0x0F;
|
2250
|
+
}
|
2251
|
+
}
|
2252
|
+
|
2253
|
+
|
2254
|
+
// Encode vcvt.src_type.dst_type instruction.
|
2255
|
+
static Instr EncodeVCVT(const VFPType dst_type,
|
2256
|
+
const int dst_code,
|
2257
|
+
const VFPType src_type,
|
2258
|
+
const int src_code,
|
2259
|
+
VFPConversionMode mode,
|
2260
|
+
const Condition cond) {
|
2261
|
+
ASSERT(src_type != dst_type);
|
2262
|
+
int D, Vd, M, Vm;
|
2263
|
+
SplitRegCode(src_type, src_code, &Vm, &M);
|
2264
|
+
SplitRegCode(dst_type, dst_code, &Vd, &D);
|
2265
|
+
|
2266
|
+
if (IsIntegerVFPType(dst_type) || IsIntegerVFPType(src_type)) {
|
2267
|
+
// Conversion between IEEE floating point and 32-bit integer.
|
2268
|
+
// Instruction details available in ARM DDI 0406B, A8.6.295.
|
2269
|
+
// cond(31-28) | 11101(27-23)| D(22) | 11(21-20) | 1(19) | opc2(18-16) |
|
2270
|
+
// Vd(15-12) | 101(11-9) | sz(8) | op(7) | 1(6) | M(5) | 0(4) | Vm(3-0)
|
2271
|
+
ASSERT(!IsIntegerVFPType(dst_type) || !IsIntegerVFPType(src_type));
|
2272
|
+
|
2273
|
+
int sz, opc2, op;
|
2274
|
+
|
2275
|
+
if (IsIntegerVFPType(dst_type)) {
|
2276
|
+
opc2 = IsSignedVFPType(dst_type) ? 0x5 : 0x4;
|
2277
|
+
sz = IsDoubleVFPType(src_type) ? 0x1 : 0x0;
|
2278
|
+
op = mode;
|
2279
|
+
} else {
|
2280
|
+
ASSERT(IsIntegerVFPType(src_type));
|
2281
|
+
opc2 = 0x0;
|
2282
|
+
sz = IsDoubleVFPType(dst_type) ? 0x1 : 0x0;
|
2283
|
+
op = IsSignedVFPType(src_type) ? 0x1 : 0x0;
|
2284
|
+
}
|
2285
|
+
|
2286
|
+
return (cond | 0xE*B24 | B23 | D*B22 | 0x3*B20 | B19 | opc2*B16 |
|
2287
|
+
Vd*B12 | 0x5*B9 | sz*B8 | op*B7 | B6 | M*B5 | Vm);
|
2288
|
+
} else {
|
2289
|
+
// Conversion between IEEE double and single precision.
|
2290
|
+
// Instruction details available in ARM DDI 0406B, A8.6.298.
|
2291
|
+
// cond(31-28) | 11101(27-23)| D(22) | 11(21-20) | 0111(19-16) |
|
2292
|
+
// Vd(15-12) | 101(11-9) | sz(8) | 1(7) | 1(6) | M(5) | 0(4) | Vm(3-0)
|
2293
|
+
int sz = IsDoubleVFPType(src_type) ? 0x1 : 0x0;
|
2294
|
+
return (cond | 0xE*B24 | B23 | D*B22 | 0x3*B20 | 0x7*B16 |
|
2295
|
+
Vd*B12 | 0x5*B9 | sz*B8 | B7 | B6 | M*B5 | Vm);
|
2296
|
+
}
|
2297
|
+
}
|
2298
|
+
|
2299
|
+
|
2300
|
+
void Assembler::vcvt_f64_s32(const DwVfpRegister dst,
|
2301
|
+
const SwVfpRegister src,
|
2302
|
+
VFPConversionMode mode,
|
2303
|
+
const Condition cond) {
|
2304
|
+
ASSERT(CpuFeatures::IsEnabled(VFP3));
|
2305
|
+
emit(EncodeVCVT(F64, dst.code(), S32, src.code(), mode, cond));
|
2306
|
+
}
|
2307
|
+
|
2308
|
+
|
2309
|
+
void Assembler::vcvt_f32_s32(const SwVfpRegister dst,
|
2310
|
+
const SwVfpRegister src,
|
2311
|
+
VFPConversionMode mode,
|
2312
|
+
const Condition cond) {
|
2313
|
+
ASSERT(CpuFeatures::IsEnabled(VFP3));
|
2314
|
+
emit(EncodeVCVT(F32, dst.code(), S32, src.code(), mode, cond));
|
2315
|
+
}
|
2316
|
+
|
2317
|
+
|
2318
|
+
void Assembler::vcvt_f64_u32(const DwVfpRegister dst,
|
2319
|
+
const SwVfpRegister src,
|
2320
|
+
VFPConversionMode mode,
|
2321
|
+
const Condition cond) {
|
2322
|
+
ASSERT(CpuFeatures::IsEnabled(VFP3));
|
2323
|
+
emit(EncodeVCVT(F64, dst.code(), U32, src.code(), mode, cond));
|
2324
|
+
}
|
2325
|
+
|
2326
|
+
|
2327
|
+
void Assembler::vcvt_s32_f64(const SwVfpRegister dst,
|
2328
|
+
const DwVfpRegister src,
|
2329
|
+
VFPConversionMode mode,
|
2330
|
+
const Condition cond) {
|
2331
|
+
ASSERT(CpuFeatures::IsEnabled(VFP3));
|
2332
|
+
emit(EncodeVCVT(S32, dst.code(), F64, src.code(), mode, cond));
|
2333
|
+
}
|
2334
|
+
|
2335
|
+
|
2336
|
+
void Assembler::vcvt_u32_f64(const SwVfpRegister dst,
|
2337
|
+
const DwVfpRegister src,
|
2338
|
+
VFPConversionMode mode,
|
2339
|
+
const Condition cond) {
|
2340
|
+
ASSERT(CpuFeatures::IsEnabled(VFP3));
|
2341
|
+
emit(EncodeVCVT(U32, dst.code(), F64, src.code(), mode, cond));
|
2342
|
+
}
|
2343
|
+
|
2344
|
+
|
2345
|
+
void Assembler::vcvt_f64_f32(const DwVfpRegister dst,
|
2346
|
+
const SwVfpRegister src,
|
2347
|
+
VFPConversionMode mode,
|
2348
|
+
const Condition cond) {
|
2349
|
+
ASSERT(CpuFeatures::IsEnabled(VFP3));
|
2350
|
+
emit(EncodeVCVT(F64, dst.code(), F32, src.code(), mode, cond));
|
2351
|
+
}
|
2352
|
+
|
2353
|
+
|
2354
|
+
void Assembler::vcvt_f32_f64(const SwVfpRegister dst,
|
2355
|
+
const DwVfpRegister src,
|
2356
|
+
VFPConversionMode mode,
|
2357
|
+
const Condition cond) {
|
2358
|
+
ASSERT(CpuFeatures::IsEnabled(VFP3));
|
2359
|
+
emit(EncodeVCVT(F32, dst.code(), F64, src.code(), mode, cond));
|
2360
|
+
}
|
2361
|
+
|
2362
|
+
|
2363
|
+
void Assembler::vabs(const DwVfpRegister dst,
|
2364
|
+
const DwVfpRegister src,
|
2365
|
+
const Condition cond) {
|
2366
|
+
emit(cond | 0xE*B24 | 0xB*B20 | dst.code()*B12 |
|
2367
|
+
0x5*B9 | B8 | 0x3*B6 | src.code());
|
2368
|
+
}
|
2369
|
+
|
2370
|
+
|
2371
|
+
void Assembler::vadd(const DwVfpRegister dst,
|
2372
|
+
const DwVfpRegister src1,
|
2373
|
+
const DwVfpRegister src2,
|
2374
|
+
const Condition cond) {
|
2375
|
+
// Dd = vadd(Dn, Dm) double precision floating point addition.
|
2376
|
+
// Dd = D:Vd; Dm=M:Vm; Dn=N:Vm.
|
2377
|
+
// Instruction details available in ARM DDI 0406A, A8-536.
|
2378
|
+
// cond(31-28) | 11100(27-23)| D=?(22) | 11(21-20) | Vn(19-16) |
|
2379
|
+
// Vd(15-12) | 101(11-9) | sz(8)=1 | N(7)=0 | 0(6) | M=?(5) | 0(4) | Vm(3-0)
|
2380
|
+
ASSERT(CpuFeatures::IsEnabled(VFP3));
|
2381
|
+
emit(cond | 0xE*B24 | 0x3*B20 | src1.code()*B16 |
|
2382
|
+
dst.code()*B12 | 0x5*B9 | B8 | src2.code());
|
2383
|
+
}
|
2384
|
+
|
2385
|
+
|
2386
|
+
void Assembler::vsub(const DwVfpRegister dst,
|
2387
|
+
const DwVfpRegister src1,
|
2388
|
+
const DwVfpRegister src2,
|
2389
|
+
const Condition cond) {
|
2390
|
+
// Dd = vsub(Dn, Dm) double precision floating point subtraction.
|
2391
|
+
// Dd = D:Vd; Dm=M:Vm; Dn=N:Vm.
|
2392
|
+
// Instruction details available in ARM DDI 0406A, A8-784.
|
2393
|
+
// cond(31-28) | 11100(27-23)| D=?(22) | 11(21-20) | Vn(19-16) |
|
2394
|
+
// Vd(15-12) | 101(11-9) | sz(8)=1 | N(7)=0 | 1(6) | M=?(5) | 0(4) | Vm(3-0)
|
2395
|
+
ASSERT(CpuFeatures::IsEnabled(VFP3));
|
2396
|
+
emit(cond | 0xE*B24 | 0x3*B20 | src1.code()*B16 |
|
2397
|
+
dst.code()*B12 | 0x5*B9 | B8 | B6 | src2.code());
|
2398
|
+
}
|
2399
|
+
|
2400
|
+
|
2401
|
+
void Assembler::vmul(const DwVfpRegister dst,
|
2402
|
+
const DwVfpRegister src1,
|
2403
|
+
const DwVfpRegister src2,
|
2404
|
+
const Condition cond) {
|
2405
|
+
// Dd = vmul(Dn, Dm) double precision floating point multiplication.
|
2406
|
+
// Dd = D:Vd; Dm=M:Vm; Dn=N:Vm.
|
2407
|
+
// Instruction details available in ARM DDI 0406A, A8-784.
|
2408
|
+
// cond(31-28) | 11100(27-23)| D=?(22) | 10(21-20) | Vn(19-16) |
|
2409
|
+
// Vd(15-12) | 101(11-9) | sz(8)=1 | N(7)=0 | 0(6) | M=?(5) | 0(4) | Vm(3-0)
|
2410
|
+
ASSERT(CpuFeatures::IsEnabled(VFP3));
|
2411
|
+
emit(cond | 0xE*B24 | 0x2*B20 | src1.code()*B16 |
|
2412
|
+
dst.code()*B12 | 0x5*B9 | B8 | src2.code());
|
2413
|
+
}
|
2414
|
+
|
2415
|
+
|
2416
|
+
void Assembler::vdiv(const DwVfpRegister dst,
|
2417
|
+
const DwVfpRegister src1,
|
2418
|
+
const DwVfpRegister src2,
|
2419
|
+
const Condition cond) {
|
2420
|
+
// Dd = vdiv(Dn, Dm) double precision floating point division.
|
2421
|
+
// Dd = D:Vd; Dm=M:Vm; Dn=N:Vm.
|
2422
|
+
// Instruction details available in ARM DDI 0406A, A8-584.
|
2423
|
+
// cond(31-28) | 11101(27-23)| D=?(22) | 00(21-20) | Vn(19-16) |
|
2424
|
+
// Vd(15-12) | 101(11-9) | sz(8)=1 | N(7)=? | 0(6) | M=?(5) | 0(4) | Vm(3-0)
|
2425
|
+
ASSERT(CpuFeatures::IsEnabled(VFP3));
|
2426
|
+
emit(cond | 0xE*B24 | B23 | src1.code()*B16 |
|
2427
|
+
dst.code()*B12 | 0x5*B9 | B8 | src2.code());
|
2428
|
+
}
|
2429
|
+
|
2430
|
+
|
2431
|
+
void Assembler::vcmp(const DwVfpRegister src1,
|
2432
|
+
const DwVfpRegister src2,
|
2433
|
+
const Condition cond) {
|
2434
|
+
// vcmp(Dd, Dm) double precision floating point comparison.
|
2435
|
+
// Instruction details available in ARM DDI 0406A, A8-570.
|
2436
|
+
// cond(31-28) | 11101 (27-23)| D=?(22) | 11 (21-20) | 0100 (19-16) |
|
2437
|
+
// Vd(15-12) | 101(11-9) | sz(8)=1 | E(7)=0 | 1(6) | M(5)=? | 0(4) | Vm(3-0)
|
2438
|
+
ASSERT(CpuFeatures::IsEnabled(VFP3));
|
2439
|
+
emit(cond | 0xE*B24 |B23 | 0x3*B20 | B18 |
|
2440
|
+
src1.code()*B12 | 0x5*B9 | B8 | B6 | src2.code());
|
2441
|
+
}
|
2442
|
+
|
2443
|
+
|
2444
|
+
void Assembler::vcmp(const DwVfpRegister src1,
|
2445
|
+
const double src2,
|
2446
|
+
const Condition cond) {
|
2447
|
+
// vcmp(Dd, Dm) double precision floating point comparison.
|
2448
|
+
// Instruction details available in ARM DDI 0406A, A8-570.
|
2449
|
+
// cond(31-28) | 11101 (27-23)| D=?(22) | 11 (21-20) | 0101 (19-16) |
|
2450
|
+
// Vd(15-12) | 101(11-9) | sz(8)=1 | E(7)=0 | 1(6) | M(5)=? | 0(4) | 0000(3-0)
|
2451
|
+
ASSERT(CpuFeatures::IsEnabled(VFP3));
|
2452
|
+
ASSERT(src2 == 0.0);
|
2453
|
+
emit(cond | 0xE*B24 |B23 | 0x3*B20 | B18 | B16 |
|
2454
|
+
src1.code()*B12 | 0x5*B9 | B8 | B6);
|
2455
|
+
}
|
2456
|
+
|
2457
|
+
|
2458
|
+
void Assembler::vmsr(Register dst, Condition cond) {
|
2459
|
+
// Instruction details available in ARM DDI 0406A, A8-652.
|
2460
|
+
// cond(31-28) | 1110 (27-24) | 1110(23-20)| 0001 (19-16) |
|
2461
|
+
// Rt(15-12) | 1010 (11-8) | 0(7) | 00 (6-5) | 1(4) | 0000(3-0)
|
2462
|
+
ASSERT(CpuFeatures::IsEnabled(VFP3));
|
2463
|
+
emit(cond | 0xE*B24 | 0xE*B20 | B16 |
|
2464
|
+
dst.code()*B12 | 0xA*B8 | B4);
|
2465
|
+
}
|
2466
|
+
|
2467
|
+
|
2468
|
+
void Assembler::vmrs(Register dst, Condition cond) {
|
2469
|
+
// Instruction details available in ARM DDI 0406A, A8-652.
|
2470
|
+
// cond(31-28) | 1110 (27-24) | 1111(23-20)| 0001 (19-16) |
|
2471
|
+
// Rt(15-12) | 1010 (11-8) | 0(7) | 00 (6-5) | 1(4) | 0000(3-0)
|
2472
|
+
ASSERT(CpuFeatures::IsEnabled(VFP3));
|
2473
|
+
emit(cond | 0xE*B24 | 0xF*B20 | B16 |
|
2474
|
+
dst.code()*B12 | 0xA*B8 | B4);
|
2475
|
+
}
|
2476
|
+
|
2477
|
+
|
2478
|
+
void Assembler::vsqrt(const DwVfpRegister dst,
|
2479
|
+
const DwVfpRegister src,
|
2480
|
+
const Condition cond) {
|
2481
|
+
// cond(31-28) | 11101 (27-23)| D=?(22) | 11 (21-20) | 0001 (19-16) |
|
2482
|
+
// Vd(15-12) | 101(11-9) | sz(8)=1 | 11 (7-6) | M(5)=? | 0(4) | Vm(3-0)
|
2483
|
+
ASSERT(CpuFeatures::IsEnabled(VFP3));
|
2484
|
+
emit(cond | 0xE*B24 | B23 | 0x3*B20 | B16 |
|
2485
|
+
dst.code()*B12 | 0x5*B9 | B8 | 3*B6 | src.code());
|
2486
|
+
}
|
2487
|
+
|
2488
|
+
|
2489
|
+
// Pseudo instructions.
|
2490
|
+
void Assembler::nop(int type) {
|
2491
|
+
// This is mov rx, rx.
|
2492
|
+
ASSERT(0 <= type && type <= 14); // mov pc, pc is not a nop.
|
2493
|
+
emit(al | 13*B21 | type*B12 | type);
|
2494
|
+
}
|
2495
|
+
|
2496
|
+
|
2497
|
+
bool Assembler::IsNop(Instr instr, int type) {
|
2498
|
+
// Check for mov rx, rx where x = type.
|
2499
|
+
ASSERT(0 <= type && type <= 14); // mov pc, pc is not a nop.
|
2500
|
+
return instr == (al | 13*B21 | type*B12 | type);
|
2501
|
+
}
|
2502
|
+
|
2503
|
+
|
2504
|
+
bool Assembler::ImmediateFitsAddrMode1Instruction(int32_t imm32) {
|
2505
|
+
uint32_t dummy1;
|
2506
|
+
uint32_t dummy2;
|
2507
|
+
return fits_shifter(imm32, &dummy1, &dummy2, NULL);
|
2508
|
+
}
|
2509
|
+
|
2510
|
+
|
2511
|
+
void Assembler::BlockConstPoolFor(int instructions) {
|
2512
|
+
BlockConstPoolBefore(pc_offset() + instructions * kInstrSize);
|
2513
|
+
}
|
2514
|
+
|
2515
|
+
|
2516
|
+
// Debugging.
|
2517
|
+
void Assembler::RecordJSReturn() {
|
2518
|
+
positions_recorder()->WriteRecordedPositions();
|
2519
|
+
CheckBuffer();
|
2520
|
+
RecordRelocInfo(RelocInfo::JS_RETURN);
|
2521
|
+
}
|
2522
|
+
|
2523
|
+
|
2524
|
+
void Assembler::RecordDebugBreakSlot() {
|
2525
|
+
positions_recorder()->WriteRecordedPositions();
|
2526
|
+
CheckBuffer();
|
2527
|
+
RecordRelocInfo(RelocInfo::DEBUG_BREAK_SLOT);
|
2528
|
+
}
|
2529
|
+
|
2530
|
+
|
2531
|
+
void Assembler::RecordComment(const char* msg) {
|
2532
|
+
if (FLAG_code_comments) {
|
2533
|
+
CheckBuffer();
|
2534
|
+
RecordRelocInfo(RelocInfo::COMMENT, reinterpret_cast<intptr_t>(msg));
|
2535
|
+
}
|
2536
|
+
}
|
2537
|
+
|
2538
|
+
|
2539
|
+
void Assembler::GrowBuffer() {
|
2540
|
+
if (!own_buffer_) FATAL("external code buffer is too small");
|
2541
|
+
|
2542
|
+
// Compute new buffer size.
|
2543
|
+
CodeDesc desc; // the new buffer
|
2544
|
+
if (buffer_size_ < 4*KB) {
|
2545
|
+
desc.buffer_size = 4*KB;
|
2546
|
+
} else if (buffer_size_ < 1*MB) {
|
2547
|
+
desc.buffer_size = 2*buffer_size_;
|
2548
|
+
} else {
|
2549
|
+
desc.buffer_size = buffer_size_ + 1*MB;
|
2550
|
+
}
|
2551
|
+
CHECK_GT(desc.buffer_size, 0); // no overflow
|
2552
|
+
|
2553
|
+
// Setup new buffer.
|
2554
|
+
desc.buffer = NewArray<byte>(desc.buffer_size);
|
2555
|
+
|
2556
|
+
desc.instr_size = pc_offset();
|
2557
|
+
desc.reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos();
|
2558
|
+
|
2559
|
+
// Copy the data.
|
2560
|
+
int pc_delta = desc.buffer - buffer_;
|
2561
|
+
int rc_delta = (desc.buffer + desc.buffer_size) - (buffer_ + buffer_size_);
|
2562
|
+
memmove(desc.buffer, buffer_, desc.instr_size);
|
2563
|
+
memmove(reloc_info_writer.pos() + rc_delta,
|
2564
|
+
reloc_info_writer.pos(), desc.reloc_size);
|
2565
|
+
|
2566
|
+
// Switch buffers.
|
2567
|
+
DeleteArray(buffer_);
|
2568
|
+
buffer_ = desc.buffer;
|
2569
|
+
buffer_size_ = desc.buffer_size;
|
2570
|
+
pc_ += pc_delta;
|
2571
|
+
reloc_info_writer.Reposition(reloc_info_writer.pos() + rc_delta,
|
2572
|
+
reloc_info_writer.last_pc() + pc_delta);
|
2573
|
+
|
2574
|
+
// None of our relocation types are pc relative pointing outside the code
|
2575
|
+
// buffer nor pc absolute pointing inside the code buffer, so there is no need
|
2576
|
+
// to relocate any emitted relocation entries.
|
2577
|
+
|
2578
|
+
// Relocate pending relocation entries.
|
2579
|
+
for (int i = 0; i < num_prinfo_; i++) {
|
2580
|
+
RelocInfo& rinfo = prinfo_[i];
|
2581
|
+
ASSERT(rinfo.rmode() != RelocInfo::COMMENT &&
|
2582
|
+
rinfo.rmode() != RelocInfo::POSITION);
|
2583
|
+
if (rinfo.rmode() != RelocInfo::JS_RETURN) {
|
2584
|
+
rinfo.set_pc(rinfo.pc() + pc_delta);
|
2585
|
+
}
|
2586
|
+
}
|
2587
|
+
}
|
2588
|
+
|
2589
|
+
|
2590
|
+
void Assembler::db(uint8_t data) {
|
2591
|
+
// No relocation info should be pending while using db. db is used
|
2592
|
+
// to write pure data with no pointers and the constant pool should
|
2593
|
+
// be emitted before using db.
|
2594
|
+
ASSERT(num_prinfo_ == 0);
|
2595
|
+
CheckBuffer();
|
2596
|
+
*reinterpret_cast<uint8_t*>(pc_) = data;
|
2597
|
+
pc_ += sizeof(uint8_t);
|
2598
|
+
}
|
2599
|
+
|
2600
|
+
|
2601
|
+
void Assembler::dd(uint32_t data) {
|
2602
|
+
// No relocation info should be pending while using dd. dd is used
|
2603
|
+
// to write pure data with no pointers and the constant pool should
|
2604
|
+
// be emitted before using dd.
|
2605
|
+
ASSERT(num_prinfo_ == 0);
|
2606
|
+
CheckBuffer();
|
2607
|
+
*reinterpret_cast<uint32_t*>(pc_) = data;
|
2608
|
+
pc_ += sizeof(uint32_t);
|
2609
|
+
}
|
2610
|
+
|
2611
|
+
|
2612
|
+
void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
|
2613
|
+
RelocInfo rinfo(pc_, rmode, data); // we do not try to reuse pool constants
|
2614
|
+
if (rmode >= RelocInfo::JS_RETURN && rmode <= RelocInfo::DEBUG_BREAK_SLOT) {
|
2615
|
+
// Adjust code for new modes.
|
2616
|
+
ASSERT(RelocInfo::IsDebugBreakSlot(rmode)
|
2617
|
+
|| RelocInfo::IsJSReturn(rmode)
|
2618
|
+
|| RelocInfo::IsComment(rmode)
|
2619
|
+
|| RelocInfo::IsPosition(rmode));
|
2620
|
+
// These modes do not need an entry in the constant pool.
|
2621
|
+
} else {
|
2622
|
+
ASSERT(num_prinfo_ < kMaxNumPRInfo);
|
2623
|
+
prinfo_[num_prinfo_++] = rinfo;
|
2624
|
+
// Make sure the constant pool is not emitted in place of the next
|
2625
|
+
// instruction for which we just recorded relocation info.
|
2626
|
+
BlockConstPoolBefore(pc_offset() + kInstrSize);
|
2627
|
+
}
|
2628
|
+
if (rinfo.rmode() != RelocInfo::NONE) {
|
2629
|
+
// Don't record external references unless the heap will be serialized.
|
2630
|
+
if (rmode == RelocInfo::EXTERNAL_REFERENCE) {
|
2631
|
+
#ifdef DEBUG
|
2632
|
+
if (!Serializer::enabled()) {
|
2633
|
+
Serializer::TooLateToEnableNow();
|
2634
|
+
}
|
2635
|
+
#endif
|
2636
|
+
if (!Serializer::enabled() && !FLAG_debug_code) {
|
2637
|
+
return;
|
2638
|
+
}
|
2639
|
+
}
|
2640
|
+
ASSERT(buffer_space() >= kMaxRelocSize); // too late to grow buffer here
|
2641
|
+
reloc_info_writer.Write(&rinfo);
|
2642
|
+
}
|
2643
|
+
}
|
2644
|
+
|
2645
|
+
|
2646
|
+
void Assembler::CheckConstPool(bool force_emit, bool require_jump) {
|
2647
|
+
// Calculate the offset of the next check. It will be overwritten
|
2648
|
+
// when a const pool is generated or when const pools are being
|
2649
|
+
// blocked for a specific range.
|
2650
|
+
next_buffer_check_ = pc_offset() + kCheckConstInterval;
|
2651
|
+
|
2652
|
+
// There is nothing to do if there are no pending relocation info entries.
|
2653
|
+
if (num_prinfo_ == 0) return;
|
2654
|
+
|
2655
|
+
// We emit a constant pool at regular intervals of about kDistBetweenPools
|
2656
|
+
// or when requested by parameter force_emit (e.g. after each function).
|
2657
|
+
// We prefer not to emit a jump unless the max distance is reached or if we
|
2658
|
+
// are running low on slots, which can happen if a lot of constants are being
|
2659
|
+
// emitted (e.g. --debug-code and many static references).
|
2660
|
+
int dist = pc_offset() - last_const_pool_end_;
|
2661
|
+
if (!force_emit && dist < kMaxDistBetweenPools &&
|
2662
|
+
(require_jump || dist < kDistBetweenPools) &&
|
2663
|
+
// TODO(1236125): Cleanup the "magic" number below. We know that
|
2664
|
+
// the code generation will test every kCheckConstIntervalInst.
|
2665
|
+
// Thus we are safe as long as we generate less than 7 constant
|
2666
|
+
// entries per instruction.
|
2667
|
+
(num_prinfo_ < (kMaxNumPRInfo - (7 * kCheckConstIntervalInst)))) {
|
2668
|
+
return;
|
2669
|
+
}
|
2670
|
+
|
2671
|
+
// If we did not return by now, we need to emit the constant pool soon.
|
2672
|
+
|
2673
|
+
// However, some small sequences of instructions must not be broken up by the
|
2674
|
+
// insertion of a constant pool; such sequences are protected by setting
|
2675
|
+
// either const_pool_blocked_nesting_ or no_const_pool_before_, which are
|
2676
|
+
// both checked here. Also, recursive calls to CheckConstPool are blocked by
|
2677
|
+
// no_const_pool_before_.
|
2678
|
+
if (const_pool_blocked_nesting_ > 0 || pc_offset() < no_const_pool_before_) {
|
2679
|
+
// Emission is currently blocked; make sure we try again as soon as
|
2680
|
+
// possible.
|
2681
|
+
if (const_pool_blocked_nesting_ > 0) {
|
2682
|
+
next_buffer_check_ = pc_offset() + kInstrSize;
|
2683
|
+
} else {
|
2684
|
+
next_buffer_check_ = no_const_pool_before_;
|
2685
|
+
}
|
2686
|
+
|
2687
|
+
// Something is wrong if emission is forced and blocked at the same time.
|
2688
|
+
ASSERT(!force_emit);
|
2689
|
+
return;
|
2690
|
+
}
|
2691
|
+
|
2692
|
+
int jump_instr = require_jump ? kInstrSize : 0;
|
2693
|
+
|
2694
|
+
// Check that the code buffer is large enough before emitting the constant
|
2695
|
+
// pool and relocation information (include the jump over the pool and the
|
2696
|
+
// constant pool marker).
|
2697
|
+
int max_needed_space =
|
2698
|
+
jump_instr + kInstrSize + num_prinfo_*(kInstrSize + kMaxRelocSize);
|
2699
|
+
while (buffer_space() <= (max_needed_space + kGap)) GrowBuffer();
|
2700
|
+
|
2701
|
+
// Block recursive calls to CheckConstPool.
|
2702
|
+
BlockConstPoolBefore(pc_offset() + jump_instr + kInstrSize +
|
2703
|
+
num_prinfo_*kInstrSize);
|
2704
|
+
// Don't bother to check for the emit calls below.
|
2705
|
+
next_buffer_check_ = no_const_pool_before_;
|
2706
|
+
|
2707
|
+
// Emit jump over constant pool if necessary.
|
2708
|
+
Label after_pool;
|
2709
|
+
if (require_jump) b(&after_pool);
|
2710
|
+
|
2711
|
+
RecordComment("[ Constant Pool");
|
2712
|
+
|
2713
|
+
// Put down constant pool marker "Undefined instruction" as specified by
|
2714
|
+
// A3.1 Instruction set encoding.
|
2715
|
+
emit(0x03000000 | num_prinfo_);
|
2716
|
+
|
2717
|
+
// Emit constant pool entries.
|
2718
|
+
for (int i = 0; i < num_prinfo_; i++) {
|
2719
|
+
RelocInfo& rinfo = prinfo_[i];
|
2720
|
+
ASSERT(rinfo.rmode() != RelocInfo::COMMENT &&
|
2721
|
+
rinfo.rmode() != RelocInfo::POSITION &&
|
2722
|
+
rinfo.rmode() != RelocInfo::STATEMENT_POSITION);
|
2723
|
+
Instr instr = instr_at(rinfo.pc());
|
2724
|
+
|
2725
|
+
// Instruction to patch must be a ldr/str [pc, #offset].
|
2726
|
+
// P and U set, B and W clear, Rn == pc, offset12 still 0.
|
2727
|
+
ASSERT((instr & (7*B25 | P | U | B | W | 15*B16 | kOff12Mask)) ==
|
2728
|
+
(2*B25 | P | U | pc.code()*B16));
|
2729
|
+
int delta = pc_ - rinfo.pc() - 8;
|
2730
|
+
ASSERT(delta >= -4); // instr could be ldr pc, [pc, #-4] followed by targ32
|
2731
|
+
if (delta < 0) {
|
2732
|
+
instr &= ~U;
|
2733
|
+
delta = -delta;
|
2734
|
+
}
|
2735
|
+
ASSERT(is_uint12(delta));
|
2736
|
+
instr_at_put(rinfo.pc(), instr + delta);
|
2737
|
+
emit(rinfo.data());
|
2738
|
+
}
|
2739
|
+
num_prinfo_ = 0;
|
2740
|
+
last_const_pool_end_ = pc_offset();
|
2741
|
+
|
2742
|
+
RecordComment("]");
|
2743
|
+
|
2744
|
+
if (after_pool.is_linked()) {
|
2745
|
+
bind(&after_pool);
|
2746
|
+
}
|
2747
|
+
|
2748
|
+
// Since a constant pool was just emitted, move the check offset forward by
|
2749
|
+
// the standard interval.
|
2750
|
+
next_buffer_check_ = pc_offset() + kCheckConstInterval;
|
2751
|
+
}
|
2752
|
+
|
2753
|
+
|
2754
|
+
} } // namespace v8::internal
|
2755
|
+
|
2756
|
+
#endif // V8_TARGET_ARCH_ARM
|