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,84 @@
|
|
1
|
+
// Copyright 2011 the V8 project authors. All rights reserved.
|
2
|
+
// Redistribution and use in source and binary forms, with or without
|
3
|
+
// modification, are permitted provided that the following conditions are
|
4
|
+
// met:
|
5
|
+
//
|
6
|
+
// * Redistributions of source code must retain the above copyright
|
7
|
+
// notice, this list of conditions and the following disclaimer.
|
8
|
+
// * Redistributions in binary form must reproduce the above
|
9
|
+
// copyright notice, this list of conditions and the following
|
10
|
+
// disclaimer in the documentation and/or other materials provided
|
11
|
+
// with the distribution.
|
12
|
+
// * Neither the name of Google Inc. nor the names of its
|
13
|
+
// contributors may be used to endorse or promote products derived
|
14
|
+
// from this software without specific prior written permission.
|
15
|
+
//
|
16
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
17
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
18
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
19
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
20
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
21
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
22
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
23
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
24
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
25
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
26
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27
|
+
|
28
|
+
#ifndef V8_ARM_LITHIUM_GAP_RESOLVER_ARM_H_
|
29
|
+
#define V8_ARM_LITHIUM_GAP_RESOLVER_ARM_H_
|
30
|
+
|
31
|
+
#include "v8.h"
|
32
|
+
|
33
|
+
#include "lithium.h"
|
34
|
+
|
35
|
+
namespace v8 {
|
36
|
+
namespace internal {
|
37
|
+
|
38
|
+
class LCodeGen;
|
39
|
+
class LGapResolver;
|
40
|
+
|
41
|
+
class LGapResolver BASE_EMBEDDED {
|
42
|
+
public:
|
43
|
+
|
44
|
+
explicit LGapResolver(LCodeGen* owner);
|
45
|
+
|
46
|
+
// Resolve a set of parallel moves, emitting assembler instructions.
|
47
|
+
void Resolve(LParallelMove* parallel_move);
|
48
|
+
|
49
|
+
private:
|
50
|
+
// Build the initial list of moves.
|
51
|
+
void BuildInitialMoveList(LParallelMove* parallel_move);
|
52
|
+
|
53
|
+
// Perform the move at the moves_ index in question (possibly requiring
|
54
|
+
// other moves to satisfy dependencies).
|
55
|
+
void PerformMove(int index);
|
56
|
+
|
57
|
+
// If a cycle is found in the series of moves, save the blocking value to
|
58
|
+
// a scratch register. The cycle must be found by hitting the root of the
|
59
|
+
// depth-first search.
|
60
|
+
void BreakCycle(int index);
|
61
|
+
|
62
|
+
// After a cycle has been resolved, restore the value from the scratch
|
63
|
+
// register to its proper destination.
|
64
|
+
void RestoreValue();
|
65
|
+
|
66
|
+
// Emit a move and remove it from the move graph.
|
67
|
+
void EmitMove(int index);
|
68
|
+
|
69
|
+
// Verify the move list before performing moves.
|
70
|
+
void Verify();
|
71
|
+
|
72
|
+
LCodeGen* cgen_;
|
73
|
+
|
74
|
+
// List of moves not yet resolved.
|
75
|
+
ZoneList<LMoveOperands> moves_;
|
76
|
+
|
77
|
+
int root_index_;
|
78
|
+
bool in_cycle_;
|
79
|
+
LOperand* saved_destination_;
|
80
|
+
};
|
81
|
+
|
82
|
+
} } // namespace v8::internal
|
83
|
+
|
84
|
+
#endif // V8_ARM_LITHIUM_GAP_RESOLVER_ARM_H_
|
@@ -0,0 +1,2701 @@
|
|
1
|
+
// Copyright 2011 the V8 project authors. All rights reserved.
|
2
|
+
// Redistribution and use in source and binary forms, with or without
|
3
|
+
// modification, are permitted provided that the following conditions are
|
4
|
+
// met:
|
5
|
+
//
|
6
|
+
// * Redistributions of source code must retain the above copyright
|
7
|
+
// notice, this list of conditions and the following disclaimer.
|
8
|
+
// * Redistributions in binary form must reproduce the above
|
9
|
+
// copyright notice, this list of conditions and the following
|
10
|
+
// disclaimer in the documentation and/or other materials provided
|
11
|
+
// with the distribution.
|
12
|
+
// * Neither the name of Google Inc. nor the names of its
|
13
|
+
// contributors may be used to endorse or promote products derived
|
14
|
+
// from this software without specific prior written permission.
|
15
|
+
//
|
16
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
17
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
18
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
19
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
20
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
21
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
22
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
23
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
24
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
25
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
26
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27
|
+
|
28
|
+
#include <limits.h> // For LONG_MIN, LONG_MAX.
|
29
|
+
|
30
|
+
#include "v8.h"
|
31
|
+
|
32
|
+
#if defined(V8_TARGET_ARCH_ARM)
|
33
|
+
|
34
|
+
#include "bootstrapper.h"
|
35
|
+
#include "codegen-inl.h"
|
36
|
+
#include "debug.h"
|
37
|
+
#include "runtime.h"
|
38
|
+
|
39
|
+
namespace v8 {
|
40
|
+
namespace internal {
|
41
|
+
|
42
|
+
MacroAssembler::MacroAssembler(void* buffer, int size)
|
43
|
+
: Assembler(buffer, size),
|
44
|
+
generating_stub_(false),
|
45
|
+
allow_stub_calls_(true),
|
46
|
+
code_object_(Heap::undefined_value()) {
|
47
|
+
}
|
48
|
+
|
49
|
+
|
50
|
+
// We always generate arm code, never thumb code, even if V8 is compiled to
|
51
|
+
// thumb, so we require inter-working support
|
52
|
+
#if defined(__thumb__) && !defined(USE_THUMB_INTERWORK)
|
53
|
+
#error "flag -mthumb-interwork missing"
|
54
|
+
#endif
|
55
|
+
|
56
|
+
|
57
|
+
// We do not support thumb inter-working with an arm architecture not supporting
|
58
|
+
// the blx instruction (below v5t). If you know what CPU you are compiling for
|
59
|
+
// you can use -march=armv7 or similar.
|
60
|
+
#if defined(USE_THUMB_INTERWORK) && !defined(CAN_USE_THUMB_INSTRUCTIONS)
|
61
|
+
# error "For thumb inter-working we require an architecture which supports blx"
|
62
|
+
#endif
|
63
|
+
|
64
|
+
|
65
|
+
// Using bx does not yield better code, so use it only when required
|
66
|
+
#if defined(USE_THUMB_INTERWORK)
|
67
|
+
#define USE_BX 1
|
68
|
+
#endif
|
69
|
+
|
70
|
+
|
71
|
+
void MacroAssembler::Jump(Register target, Condition cond) {
|
72
|
+
#if USE_BX
|
73
|
+
bx(target, cond);
|
74
|
+
#else
|
75
|
+
mov(pc, Operand(target), LeaveCC, cond);
|
76
|
+
#endif
|
77
|
+
}
|
78
|
+
|
79
|
+
|
80
|
+
void MacroAssembler::Jump(intptr_t target, RelocInfo::Mode rmode,
|
81
|
+
Condition cond) {
|
82
|
+
#if USE_BX
|
83
|
+
mov(ip, Operand(target, rmode), LeaveCC, cond);
|
84
|
+
bx(ip, cond);
|
85
|
+
#else
|
86
|
+
mov(pc, Operand(target, rmode), LeaveCC, cond);
|
87
|
+
#endif
|
88
|
+
}
|
89
|
+
|
90
|
+
|
91
|
+
void MacroAssembler::Jump(byte* target, RelocInfo::Mode rmode,
|
92
|
+
Condition cond) {
|
93
|
+
ASSERT(!RelocInfo::IsCodeTarget(rmode));
|
94
|
+
Jump(reinterpret_cast<intptr_t>(target), rmode, cond);
|
95
|
+
}
|
96
|
+
|
97
|
+
|
98
|
+
void MacroAssembler::Jump(Handle<Code> code, RelocInfo::Mode rmode,
|
99
|
+
Condition cond) {
|
100
|
+
ASSERT(RelocInfo::IsCodeTarget(rmode));
|
101
|
+
// 'code' is always generated ARM code, never THUMB code
|
102
|
+
Jump(reinterpret_cast<intptr_t>(code.location()), rmode, cond);
|
103
|
+
}
|
104
|
+
|
105
|
+
|
106
|
+
void MacroAssembler::Call(Register target, Condition cond) {
|
107
|
+
#if USE_BLX
|
108
|
+
blx(target, cond);
|
109
|
+
#else
|
110
|
+
// set lr for return at current pc + 8
|
111
|
+
mov(lr, Operand(pc), LeaveCC, cond);
|
112
|
+
mov(pc, Operand(target), LeaveCC, cond);
|
113
|
+
#endif
|
114
|
+
}
|
115
|
+
|
116
|
+
|
117
|
+
void MacroAssembler::Call(intptr_t target, RelocInfo::Mode rmode,
|
118
|
+
Condition cond) {
|
119
|
+
#if USE_BLX
|
120
|
+
// On ARMv5 and after the recommended call sequence is:
|
121
|
+
// ldr ip, [pc, #...]
|
122
|
+
// blx ip
|
123
|
+
|
124
|
+
// The two instructions (ldr and blx) could be separated by a constant
|
125
|
+
// pool and the code would still work. The issue comes from the
|
126
|
+
// patching code which expect the ldr to be just above the blx.
|
127
|
+
{ BlockConstPoolScope block_const_pool(this);
|
128
|
+
// Statement positions are expected to be recorded when the target
|
129
|
+
// address is loaded. The mov method will automatically record
|
130
|
+
// positions when pc is the target, since this is not the case here
|
131
|
+
// we have to do it explicitly.
|
132
|
+
positions_recorder()->WriteRecordedPositions();
|
133
|
+
|
134
|
+
mov(ip, Operand(target, rmode), LeaveCC, cond);
|
135
|
+
blx(ip, cond);
|
136
|
+
}
|
137
|
+
|
138
|
+
ASSERT(kCallTargetAddressOffset == 2 * kInstrSize);
|
139
|
+
#else
|
140
|
+
// Set lr for return at current pc + 8.
|
141
|
+
mov(lr, Operand(pc), LeaveCC, cond);
|
142
|
+
// Emit a ldr<cond> pc, [pc + offset of target in constant pool].
|
143
|
+
mov(pc, Operand(target, rmode), LeaveCC, cond);
|
144
|
+
|
145
|
+
ASSERT(kCallTargetAddressOffset == kInstrSize);
|
146
|
+
#endif
|
147
|
+
}
|
148
|
+
|
149
|
+
|
150
|
+
void MacroAssembler::Call(byte* target, RelocInfo::Mode rmode,
|
151
|
+
Condition cond) {
|
152
|
+
ASSERT(!RelocInfo::IsCodeTarget(rmode));
|
153
|
+
Call(reinterpret_cast<intptr_t>(target), rmode, cond);
|
154
|
+
}
|
155
|
+
|
156
|
+
|
157
|
+
void MacroAssembler::Call(Handle<Code> code, RelocInfo::Mode rmode,
|
158
|
+
Condition cond) {
|
159
|
+
ASSERT(RelocInfo::IsCodeTarget(rmode));
|
160
|
+
// 'code' is always generated ARM code, never THUMB code
|
161
|
+
Call(reinterpret_cast<intptr_t>(code.location()), rmode, cond);
|
162
|
+
}
|
163
|
+
|
164
|
+
|
165
|
+
void MacroAssembler::Ret(Condition cond) {
|
166
|
+
#if USE_BX
|
167
|
+
bx(lr, cond);
|
168
|
+
#else
|
169
|
+
mov(pc, Operand(lr), LeaveCC, cond);
|
170
|
+
#endif
|
171
|
+
}
|
172
|
+
|
173
|
+
|
174
|
+
void MacroAssembler::Drop(int count, Condition cond) {
|
175
|
+
if (count > 0) {
|
176
|
+
add(sp, sp, Operand(count * kPointerSize), LeaveCC, cond);
|
177
|
+
}
|
178
|
+
}
|
179
|
+
|
180
|
+
|
181
|
+
void MacroAssembler::Ret(int drop, Condition cond) {
|
182
|
+
Drop(drop, cond);
|
183
|
+
Ret(cond);
|
184
|
+
}
|
185
|
+
|
186
|
+
|
187
|
+
void MacroAssembler::Swap(Register reg1,
|
188
|
+
Register reg2,
|
189
|
+
Register scratch,
|
190
|
+
Condition cond) {
|
191
|
+
if (scratch.is(no_reg)) {
|
192
|
+
eor(reg1, reg1, Operand(reg2), LeaveCC, cond);
|
193
|
+
eor(reg2, reg2, Operand(reg1), LeaveCC, cond);
|
194
|
+
eor(reg1, reg1, Operand(reg2), LeaveCC, cond);
|
195
|
+
} else {
|
196
|
+
mov(scratch, reg1, LeaveCC, cond);
|
197
|
+
mov(reg1, reg2, LeaveCC, cond);
|
198
|
+
mov(reg2, scratch, LeaveCC, cond);
|
199
|
+
}
|
200
|
+
}
|
201
|
+
|
202
|
+
|
203
|
+
void MacroAssembler::Call(Label* target) {
|
204
|
+
bl(target);
|
205
|
+
}
|
206
|
+
|
207
|
+
|
208
|
+
void MacroAssembler::Move(Register dst, Handle<Object> value) {
|
209
|
+
mov(dst, Operand(value));
|
210
|
+
}
|
211
|
+
|
212
|
+
|
213
|
+
void MacroAssembler::Move(Register dst, Register src) {
|
214
|
+
if (!dst.is(src)) {
|
215
|
+
mov(dst, src);
|
216
|
+
}
|
217
|
+
}
|
218
|
+
|
219
|
+
|
220
|
+
void MacroAssembler::And(Register dst, Register src1, const Operand& src2,
|
221
|
+
Condition cond) {
|
222
|
+
if (!src2.is_reg() &&
|
223
|
+
!src2.must_use_constant_pool() &&
|
224
|
+
src2.immediate() == 0) {
|
225
|
+
mov(dst, Operand(0, RelocInfo::NONE), LeaveCC, cond);
|
226
|
+
|
227
|
+
} else if (!src2.is_single_instruction() &&
|
228
|
+
!src2.must_use_constant_pool() &&
|
229
|
+
CpuFeatures::IsSupported(ARMv7) &&
|
230
|
+
IsPowerOf2(src2.immediate() + 1)) {
|
231
|
+
ubfx(dst, src1, 0, WhichPowerOf2(src2.immediate() + 1), cond);
|
232
|
+
|
233
|
+
} else {
|
234
|
+
and_(dst, src1, src2, LeaveCC, cond);
|
235
|
+
}
|
236
|
+
}
|
237
|
+
|
238
|
+
|
239
|
+
void MacroAssembler::Ubfx(Register dst, Register src1, int lsb, int width,
|
240
|
+
Condition cond) {
|
241
|
+
ASSERT(lsb < 32);
|
242
|
+
if (!CpuFeatures::IsSupported(ARMv7)) {
|
243
|
+
int mask = (1 << (width + lsb)) - 1 - ((1 << lsb) - 1);
|
244
|
+
and_(dst, src1, Operand(mask), LeaveCC, cond);
|
245
|
+
if (lsb != 0) {
|
246
|
+
mov(dst, Operand(dst, LSR, lsb), LeaveCC, cond);
|
247
|
+
}
|
248
|
+
} else {
|
249
|
+
ubfx(dst, src1, lsb, width, cond);
|
250
|
+
}
|
251
|
+
}
|
252
|
+
|
253
|
+
|
254
|
+
void MacroAssembler::Sbfx(Register dst, Register src1, int lsb, int width,
|
255
|
+
Condition cond) {
|
256
|
+
ASSERT(lsb < 32);
|
257
|
+
if (!CpuFeatures::IsSupported(ARMv7)) {
|
258
|
+
int mask = (1 << (width + lsb)) - 1 - ((1 << lsb) - 1);
|
259
|
+
and_(dst, src1, Operand(mask), LeaveCC, cond);
|
260
|
+
int shift_up = 32 - lsb - width;
|
261
|
+
int shift_down = lsb + shift_up;
|
262
|
+
if (shift_up != 0) {
|
263
|
+
mov(dst, Operand(dst, LSL, shift_up), LeaveCC, cond);
|
264
|
+
}
|
265
|
+
if (shift_down != 0) {
|
266
|
+
mov(dst, Operand(dst, ASR, shift_down), LeaveCC, cond);
|
267
|
+
}
|
268
|
+
} else {
|
269
|
+
sbfx(dst, src1, lsb, width, cond);
|
270
|
+
}
|
271
|
+
}
|
272
|
+
|
273
|
+
|
274
|
+
void MacroAssembler::Bfi(Register dst,
|
275
|
+
Register src,
|
276
|
+
Register scratch,
|
277
|
+
int lsb,
|
278
|
+
int width,
|
279
|
+
Condition cond) {
|
280
|
+
ASSERT(0 <= lsb && lsb < 32);
|
281
|
+
ASSERT(0 <= width && width < 32);
|
282
|
+
ASSERT(lsb + width < 32);
|
283
|
+
ASSERT(!scratch.is(dst));
|
284
|
+
if (width == 0) return;
|
285
|
+
if (!CpuFeatures::IsSupported(ARMv7)) {
|
286
|
+
int mask = (1 << (width + lsb)) - 1 - ((1 << lsb) - 1);
|
287
|
+
bic(dst, dst, Operand(mask));
|
288
|
+
and_(scratch, src, Operand((1 << width) - 1));
|
289
|
+
mov(scratch, Operand(scratch, LSL, lsb));
|
290
|
+
orr(dst, dst, scratch);
|
291
|
+
} else {
|
292
|
+
bfi(dst, src, lsb, width, cond);
|
293
|
+
}
|
294
|
+
}
|
295
|
+
|
296
|
+
|
297
|
+
void MacroAssembler::Bfc(Register dst, int lsb, int width, Condition cond) {
|
298
|
+
ASSERT(lsb < 32);
|
299
|
+
if (!CpuFeatures::IsSupported(ARMv7)) {
|
300
|
+
int mask = (1 << (width + lsb)) - 1 - ((1 << lsb) - 1);
|
301
|
+
bic(dst, dst, Operand(mask));
|
302
|
+
} else {
|
303
|
+
bfc(dst, lsb, width, cond);
|
304
|
+
}
|
305
|
+
}
|
306
|
+
|
307
|
+
|
308
|
+
void MacroAssembler::Usat(Register dst, int satpos, const Operand& src,
|
309
|
+
Condition cond) {
|
310
|
+
if (!CpuFeatures::IsSupported(ARMv7)) {
|
311
|
+
ASSERT(!dst.is(pc) && !src.rm().is(pc));
|
312
|
+
ASSERT((satpos >= 0) && (satpos <= 31));
|
313
|
+
|
314
|
+
// These asserts are required to ensure compatibility with the ARMv7
|
315
|
+
// implementation.
|
316
|
+
ASSERT((src.shift_op() == ASR) || (src.shift_op() == LSL));
|
317
|
+
ASSERT(src.rs().is(no_reg));
|
318
|
+
|
319
|
+
Label done;
|
320
|
+
int satval = (1 << satpos) - 1;
|
321
|
+
|
322
|
+
if (cond != al) {
|
323
|
+
b(NegateCondition(cond), &done); // Skip saturate if !condition.
|
324
|
+
}
|
325
|
+
if (!(src.is_reg() && dst.is(src.rm()))) {
|
326
|
+
mov(dst, src);
|
327
|
+
}
|
328
|
+
tst(dst, Operand(~satval));
|
329
|
+
b(eq, &done);
|
330
|
+
mov(dst, Operand(0, RelocInfo::NONE), LeaveCC, mi); // 0 if negative.
|
331
|
+
mov(dst, Operand(satval), LeaveCC, pl); // satval if positive.
|
332
|
+
bind(&done);
|
333
|
+
} else {
|
334
|
+
usat(dst, satpos, src, cond);
|
335
|
+
}
|
336
|
+
}
|
337
|
+
|
338
|
+
|
339
|
+
void MacroAssembler::SmiJumpTable(Register index, Vector<Label*> targets) {
|
340
|
+
// Empty the const pool.
|
341
|
+
CheckConstPool(true, true);
|
342
|
+
add(pc, pc, Operand(index,
|
343
|
+
LSL,
|
344
|
+
Instruction::kInstrSizeLog2 - kSmiTagSize));
|
345
|
+
BlockConstPoolBefore(pc_offset() + (targets.length() + 1) * kInstrSize);
|
346
|
+
nop(); // Jump table alignment.
|
347
|
+
for (int i = 0; i < targets.length(); i++) {
|
348
|
+
b(targets[i]);
|
349
|
+
}
|
350
|
+
}
|
351
|
+
|
352
|
+
|
353
|
+
void MacroAssembler::LoadRoot(Register destination,
|
354
|
+
Heap::RootListIndex index,
|
355
|
+
Condition cond) {
|
356
|
+
ldr(destination, MemOperand(roots, index << kPointerSizeLog2), cond);
|
357
|
+
}
|
358
|
+
|
359
|
+
|
360
|
+
void MacroAssembler::StoreRoot(Register source,
|
361
|
+
Heap::RootListIndex index,
|
362
|
+
Condition cond) {
|
363
|
+
str(source, MemOperand(roots, index << kPointerSizeLog2), cond);
|
364
|
+
}
|
365
|
+
|
366
|
+
|
367
|
+
void MacroAssembler::RecordWriteHelper(Register object,
|
368
|
+
Register address,
|
369
|
+
Register scratch) {
|
370
|
+
if (FLAG_debug_code) {
|
371
|
+
// Check that the object is not in new space.
|
372
|
+
Label not_in_new_space;
|
373
|
+
InNewSpace(object, scratch, ne, ¬_in_new_space);
|
374
|
+
Abort("new-space object passed to RecordWriteHelper");
|
375
|
+
bind(¬_in_new_space);
|
376
|
+
}
|
377
|
+
|
378
|
+
// Calculate page address.
|
379
|
+
Bfc(object, 0, kPageSizeBits);
|
380
|
+
|
381
|
+
// Calculate region number.
|
382
|
+
Ubfx(address, address, Page::kRegionSizeLog2,
|
383
|
+
kPageSizeBits - Page::kRegionSizeLog2);
|
384
|
+
|
385
|
+
// Mark region dirty.
|
386
|
+
ldr(scratch, MemOperand(object, Page::kDirtyFlagOffset));
|
387
|
+
mov(ip, Operand(1));
|
388
|
+
orr(scratch, scratch, Operand(ip, LSL, address));
|
389
|
+
str(scratch, MemOperand(object, Page::kDirtyFlagOffset));
|
390
|
+
}
|
391
|
+
|
392
|
+
|
393
|
+
void MacroAssembler::InNewSpace(Register object,
|
394
|
+
Register scratch,
|
395
|
+
Condition cond,
|
396
|
+
Label* branch) {
|
397
|
+
ASSERT(cond == eq || cond == ne);
|
398
|
+
and_(scratch, object, Operand(ExternalReference::new_space_mask()));
|
399
|
+
cmp(scratch, Operand(ExternalReference::new_space_start()));
|
400
|
+
b(cond, branch);
|
401
|
+
}
|
402
|
+
|
403
|
+
|
404
|
+
// Will clobber 4 registers: object, offset, scratch, ip. The
|
405
|
+
// register 'object' contains a heap object pointer. The heap object
|
406
|
+
// tag is shifted away.
|
407
|
+
void MacroAssembler::RecordWrite(Register object,
|
408
|
+
Operand offset,
|
409
|
+
Register scratch0,
|
410
|
+
Register scratch1) {
|
411
|
+
// The compiled code assumes that record write doesn't change the
|
412
|
+
// context register, so we check that none of the clobbered
|
413
|
+
// registers are cp.
|
414
|
+
ASSERT(!object.is(cp) && !scratch0.is(cp) && !scratch1.is(cp));
|
415
|
+
|
416
|
+
Label done;
|
417
|
+
|
418
|
+
// First, test that the object is not in the new space. We cannot set
|
419
|
+
// region marks for new space pages.
|
420
|
+
InNewSpace(object, scratch0, eq, &done);
|
421
|
+
|
422
|
+
// Add offset into the object.
|
423
|
+
add(scratch0, object, offset);
|
424
|
+
|
425
|
+
// Record the actual write.
|
426
|
+
RecordWriteHelper(object, scratch0, scratch1);
|
427
|
+
|
428
|
+
bind(&done);
|
429
|
+
|
430
|
+
// Clobber all input registers when running with the debug-code flag
|
431
|
+
// turned on to provoke errors.
|
432
|
+
if (FLAG_debug_code) {
|
433
|
+
mov(object, Operand(BitCast<int32_t>(kZapValue)));
|
434
|
+
mov(scratch0, Operand(BitCast<int32_t>(kZapValue)));
|
435
|
+
mov(scratch1, Operand(BitCast<int32_t>(kZapValue)));
|
436
|
+
}
|
437
|
+
}
|
438
|
+
|
439
|
+
|
440
|
+
// Will clobber 4 registers: object, address, scratch, ip. The
|
441
|
+
// register 'object' contains a heap object pointer. The heap object
|
442
|
+
// tag is shifted away.
|
443
|
+
void MacroAssembler::RecordWrite(Register object,
|
444
|
+
Register address,
|
445
|
+
Register scratch) {
|
446
|
+
// The compiled code assumes that record write doesn't change the
|
447
|
+
// context register, so we check that none of the clobbered
|
448
|
+
// registers are cp.
|
449
|
+
ASSERT(!object.is(cp) && !address.is(cp) && !scratch.is(cp));
|
450
|
+
|
451
|
+
Label done;
|
452
|
+
|
453
|
+
// First, test that the object is not in the new space. We cannot set
|
454
|
+
// region marks for new space pages.
|
455
|
+
InNewSpace(object, scratch, eq, &done);
|
456
|
+
|
457
|
+
// Record the actual write.
|
458
|
+
RecordWriteHelper(object, address, scratch);
|
459
|
+
|
460
|
+
bind(&done);
|
461
|
+
|
462
|
+
// Clobber all input registers when running with the debug-code flag
|
463
|
+
// turned on to provoke errors.
|
464
|
+
if (FLAG_debug_code) {
|
465
|
+
mov(object, Operand(BitCast<int32_t>(kZapValue)));
|
466
|
+
mov(address, Operand(BitCast<int32_t>(kZapValue)));
|
467
|
+
mov(scratch, Operand(BitCast<int32_t>(kZapValue)));
|
468
|
+
}
|
469
|
+
}
|
470
|
+
|
471
|
+
|
472
|
+
// Push and pop all registers that can hold pointers.
|
473
|
+
void MacroAssembler::PushSafepointRegisters() {
|
474
|
+
// Safepoints expect a block of contiguous register values starting with r0:
|
475
|
+
ASSERT(((1 << kNumSafepointSavedRegisters) - 1) == kSafepointSavedRegisters);
|
476
|
+
// Safepoints expect a block of kNumSafepointRegisters values on the
|
477
|
+
// stack, so adjust the stack for unsaved registers.
|
478
|
+
const int num_unsaved = kNumSafepointRegisters - kNumSafepointSavedRegisters;
|
479
|
+
ASSERT(num_unsaved >= 0);
|
480
|
+
sub(sp, sp, Operand(num_unsaved * kPointerSize));
|
481
|
+
stm(db_w, sp, kSafepointSavedRegisters);
|
482
|
+
}
|
483
|
+
|
484
|
+
|
485
|
+
void MacroAssembler::PopSafepointRegisters() {
|
486
|
+
const int num_unsaved = kNumSafepointRegisters - kNumSafepointSavedRegisters;
|
487
|
+
ldm(ia_w, sp, kSafepointSavedRegisters);
|
488
|
+
add(sp, sp, Operand(num_unsaved * kPointerSize));
|
489
|
+
}
|
490
|
+
|
491
|
+
|
492
|
+
void MacroAssembler::PushSafepointRegistersAndDoubles() {
|
493
|
+
PushSafepointRegisters();
|
494
|
+
sub(sp, sp, Operand(DwVfpRegister::kNumAllocatableRegisters *
|
495
|
+
kDoubleSize));
|
496
|
+
for (int i = 0; i < DwVfpRegister::kNumAllocatableRegisters; i++) {
|
497
|
+
vstr(DwVfpRegister::FromAllocationIndex(i), sp, i * kDoubleSize);
|
498
|
+
}
|
499
|
+
}
|
500
|
+
|
501
|
+
|
502
|
+
void MacroAssembler::PopSafepointRegistersAndDoubles() {
|
503
|
+
for (int i = 0; i < DwVfpRegister::kNumAllocatableRegisters; i++) {
|
504
|
+
vldr(DwVfpRegister::FromAllocationIndex(i), sp, i * kDoubleSize);
|
505
|
+
}
|
506
|
+
add(sp, sp, Operand(DwVfpRegister::kNumAllocatableRegisters *
|
507
|
+
kDoubleSize));
|
508
|
+
PopSafepointRegisters();
|
509
|
+
}
|
510
|
+
|
511
|
+
void MacroAssembler::StoreToSafepointRegistersAndDoublesSlot(Register src,
|
512
|
+
Register dst) {
|
513
|
+
str(src, SafepointRegistersAndDoublesSlot(dst));
|
514
|
+
}
|
515
|
+
|
516
|
+
|
517
|
+
void MacroAssembler::StoreToSafepointRegisterSlot(Register src, Register dst) {
|
518
|
+
str(src, SafepointRegisterSlot(dst));
|
519
|
+
}
|
520
|
+
|
521
|
+
|
522
|
+
void MacroAssembler::LoadFromSafepointRegisterSlot(Register dst, Register src) {
|
523
|
+
ldr(dst, SafepointRegisterSlot(src));
|
524
|
+
}
|
525
|
+
|
526
|
+
|
527
|
+
int MacroAssembler::SafepointRegisterStackIndex(int reg_code) {
|
528
|
+
// The registers are pushed starting with the highest encoding,
|
529
|
+
// which means that lowest encodings are closest to the stack pointer.
|
530
|
+
ASSERT(reg_code >= 0 && reg_code < kNumSafepointRegisters);
|
531
|
+
return reg_code;
|
532
|
+
}
|
533
|
+
|
534
|
+
|
535
|
+
MemOperand MacroAssembler::SafepointRegisterSlot(Register reg) {
|
536
|
+
return MemOperand(sp, SafepointRegisterStackIndex(reg.code()) * kPointerSize);
|
537
|
+
}
|
538
|
+
|
539
|
+
|
540
|
+
MemOperand MacroAssembler::SafepointRegistersAndDoublesSlot(Register reg) {
|
541
|
+
// General purpose registers are pushed last on the stack.
|
542
|
+
int doubles_size = DwVfpRegister::kNumAllocatableRegisters * kDoubleSize;
|
543
|
+
int register_offset = SafepointRegisterStackIndex(reg.code()) * kPointerSize;
|
544
|
+
return MemOperand(sp, doubles_size + register_offset);
|
545
|
+
}
|
546
|
+
|
547
|
+
|
548
|
+
void MacroAssembler::Ldrd(Register dst1, Register dst2,
|
549
|
+
const MemOperand& src, Condition cond) {
|
550
|
+
ASSERT(src.rm().is(no_reg));
|
551
|
+
ASSERT(!dst1.is(lr)); // r14.
|
552
|
+
ASSERT_EQ(0, dst1.code() % 2);
|
553
|
+
ASSERT_EQ(dst1.code() + 1, dst2.code());
|
554
|
+
|
555
|
+
// Generate two ldr instructions if ldrd is not available.
|
556
|
+
if (CpuFeatures::IsSupported(ARMv7)) {
|
557
|
+
CpuFeatures::Scope scope(ARMv7);
|
558
|
+
ldrd(dst1, dst2, src, cond);
|
559
|
+
} else {
|
560
|
+
MemOperand src2(src);
|
561
|
+
src2.set_offset(src2.offset() + 4);
|
562
|
+
if (dst1.is(src.rn())) {
|
563
|
+
ldr(dst2, src2, cond);
|
564
|
+
ldr(dst1, src, cond);
|
565
|
+
} else {
|
566
|
+
ldr(dst1, src, cond);
|
567
|
+
ldr(dst2, src2, cond);
|
568
|
+
}
|
569
|
+
}
|
570
|
+
}
|
571
|
+
|
572
|
+
|
573
|
+
void MacroAssembler::Strd(Register src1, Register src2,
|
574
|
+
const MemOperand& dst, Condition cond) {
|
575
|
+
ASSERT(dst.rm().is(no_reg));
|
576
|
+
ASSERT(!src1.is(lr)); // r14.
|
577
|
+
ASSERT_EQ(0, src1.code() % 2);
|
578
|
+
ASSERT_EQ(src1.code() + 1, src2.code());
|
579
|
+
|
580
|
+
// Generate two str instructions if strd is not available.
|
581
|
+
if (CpuFeatures::IsSupported(ARMv7)) {
|
582
|
+
CpuFeatures::Scope scope(ARMv7);
|
583
|
+
strd(src1, src2, dst, cond);
|
584
|
+
} else {
|
585
|
+
MemOperand dst2(dst);
|
586
|
+
dst2.set_offset(dst2.offset() + 4);
|
587
|
+
str(src1, dst, cond);
|
588
|
+
str(src2, dst2, cond);
|
589
|
+
}
|
590
|
+
}
|
591
|
+
|
592
|
+
|
593
|
+
void MacroAssembler::ClearFPSCRBits(const uint32_t bits_to_clear,
|
594
|
+
const Register scratch,
|
595
|
+
const Condition cond) {
|
596
|
+
vmrs(scratch, cond);
|
597
|
+
bic(scratch, scratch, Operand(bits_to_clear), LeaveCC, cond);
|
598
|
+
vmsr(scratch, cond);
|
599
|
+
}
|
600
|
+
|
601
|
+
|
602
|
+
void MacroAssembler::VFPCompareAndSetFlags(const DwVfpRegister src1,
|
603
|
+
const DwVfpRegister src2,
|
604
|
+
const Condition cond) {
|
605
|
+
// Compare and move FPSCR flags to the normal condition flags.
|
606
|
+
VFPCompareAndLoadFlags(src1, src2, pc, cond);
|
607
|
+
}
|
608
|
+
|
609
|
+
void MacroAssembler::VFPCompareAndSetFlags(const DwVfpRegister src1,
|
610
|
+
const double src2,
|
611
|
+
const Condition cond) {
|
612
|
+
// Compare and move FPSCR flags to the normal condition flags.
|
613
|
+
VFPCompareAndLoadFlags(src1, src2, pc, cond);
|
614
|
+
}
|
615
|
+
|
616
|
+
|
617
|
+
void MacroAssembler::VFPCompareAndLoadFlags(const DwVfpRegister src1,
|
618
|
+
const DwVfpRegister src2,
|
619
|
+
const Register fpscr_flags,
|
620
|
+
const Condition cond) {
|
621
|
+
// Compare and load FPSCR.
|
622
|
+
vcmp(src1, src2, cond);
|
623
|
+
vmrs(fpscr_flags, cond);
|
624
|
+
}
|
625
|
+
|
626
|
+
void MacroAssembler::VFPCompareAndLoadFlags(const DwVfpRegister src1,
|
627
|
+
const double src2,
|
628
|
+
const Register fpscr_flags,
|
629
|
+
const Condition cond) {
|
630
|
+
// Compare and load FPSCR.
|
631
|
+
vcmp(src1, src2, cond);
|
632
|
+
vmrs(fpscr_flags, cond);
|
633
|
+
}
|
634
|
+
|
635
|
+
|
636
|
+
void MacroAssembler::EnterFrame(StackFrame::Type type) {
|
637
|
+
// r0-r3: preserved
|
638
|
+
stm(db_w, sp, cp.bit() | fp.bit() | lr.bit());
|
639
|
+
mov(ip, Operand(Smi::FromInt(type)));
|
640
|
+
push(ip);
|
641
|
+
mov(ip, Operand(CodeObject()));
|
642
|
+
push(ip);
|
643
|
+
add(fp, sp, Operand(3 * kPointerSize)); // Adjust FP to point to saved FP.
|
644
|
+
}
|
645
|
+
|
646
|
+
|
647
|
+
void MacroAssembler::LeaveFrame(StackFrame::Type type) {
|
648
|
+
// r0: preserved
|
649
|
+
// r1: preserved
|
650
|
+
// r2: preserved
|
651
|
+
|
652
|
+
// Drop the execution stack down to the frame pointer and restore
|
653
|
+
// the caller frame pointer and return address.
|
654
|
+
mov(sp, fp);
|
655
|
+
ldm(ia_w, sp, fp.bit() | lr.bit());
|
656
|
+
}
|
657
|
+
|
658
|
+
|
659
|
+
void MacroAssembler::EnterExitFrame(bool save_doubles, int stack_space) {
|
660
|
+
// Setup the frame structure on the stack.
|
661
|
+
ASSERT_EQ(2 * kPointerSize, ExitFrameConstants::kCallerSPDisplacement);
|
662
|
+
ASSERT_EQ(1 * kPointerSize, ExitFrameConstants::kCallerPCOffset);
|
663
|
+
ASSERT_EQ(0 * kPointerSize, ExitFrameConstants::kCallerFPOffset);
|
664
|
+
Push(lr, fp);
|
665
|
+
mov(fp, Operand(sp)); // Setup new frame pointer.
|
666
|
+
// Reserve room for saved entry sp and code object.
|
667
|
+
sub(sp, sp, Operand(2 * kPointerSize));
|
668
|
+
if (FLAG_debug_code) {
|
669
|
+
mov(ip, Operand(0));
|
670
|
+
str(ip, MemOperand(fp, ExitFrameConstants::kSPOffset));
|
671
|
+
}
|
672
|
+
mov(ip, Operand(CodeObject()));
|
673
|
+
str(ip, MemOperand(fp, ExitFrameConstants::kCodeOffset));
|
674
|
+
|
675
|
+
// Save the frame pointer and the context in top.
|
676
|
+
mov(ip, Operand(ExternalReference(Top::k_c_entry_fp_address)));
|
677
|
+
str(fp, MemOperand(ip));
|
678
|
+
mov(ip, Operand(ExternalReference(Top::k_context_address)));
|
679
|
+
str(cp, MemOperand(ip));
|
680
|
+
|
681
|
+
// Optionally save all double registers.
|
682
|
+
if (save_doubles) {
|
683
|
+
sub(sp, sp, Operand(DwVfpRegister::kNumRegisters * kDoubleSize));
|
684
|
+
const int offset = -2 * kPointerSize;
|
685
|
+
for (int i = 0; i < DwVfpRegister::kNumRegisters; i++) {
|
686
|
+
DwVfpRegister reg = DwVfpRegister::from_code(i);
|
687
|
+
vstr(reg, fp, offset - ((i + 1) * kDoubleSize));
|
688
|
+
}
|
689
|
+
// Note that d0 will be accessible at
|
690
|
+
// fp - 2 * kPointerSize - DwVfpRegister::kNumRegisters * kDoubleSize,
|
691
|
+
// since the sp slot and code slot were pushed after the fp.
|
692
|
+
}
|
693
|
+
|
694
|
+
// Reserve place for the return address and stack space and align the frame
|
695
|
+
// preparing for calling the runtime function.
|
696
|
+
const int frame_alignment = MacroAssembler::ActivationFrameAlignment();
|
697
|
+
sub(sp, sp, Operand((stack_space + 1) * kPointerSize));
|
698
|
+
if (frame_alignment > 0) {
|
699
|
+
ASSERT(IsPowerOf2(frame_alignment));
|
700
|
+
and_(sp, sp, Operand(-frame_alignment));
|
701
|
+
}
|
702
|
+
|
703
|
+
// Set the exit frame sp value to point just before the return address
|
704
|
+
// location.
|
705
|
+
add(ip, sp, Operand(kPointerSize));
|
706
|
+
str(ip, MemOperand(fp, ExitFrameConstants::kSPOffset));
|
707
|
+
}
|
708
|
+
|
709
|
+
|
710
|
+
void MacroAssembler::InitializeNewString(Register string,
|
711
|
+
Register length,
|
712
|
+
Heap::RootListIndex map_index,
|
713
|
+
Register scratch1,
|
714
|
+
Register scratch2) {
|
715
|
+
mov(scratch1, Operand(length, LSL, kSmiTagSize));
|
716
|
+
LoadRoot(scratch2, map_index);
|
717
|
+
str(scratch1, FieldMemOperand(string, String::kLengthOffset));
|
718
|
+
mov(scratch1, Operand(String::kEmptyHashField));
|
719
|
+
str(scratch2, FieldMemOperand(string, HeapObject::kMapOffset));
|
720
|
+
str(scratch1, FieldMemOperand(string, String::kHashFieldOffset));
|
721
|
+
}
|
722
|
+
|
723
|
+
|
724
|
+
int MacroAssembler::ActivationFrameAlignment() {
|
725
|
+
#if defined(V8_HOST_ARCH_ARM)
|
726
|
+
// Running on the real platform. Use the alignment as mandated by the local
|
727
|
+
// environment.
|
728
|
+
// Note: This will break if we ever start generating snapshots on one ARM
|
729
|
+
// platform for another ARM platform with a different alignment.
|
730
|
+
return OS::ActivationFrameAlignment();
|
731
|
+
#else // defined(V8_HOST_ARCH_ARM)
|
732
|
+
// If we are using the simulator then we should always align to the expected
|
733
|
+
// alignment. As the simulator is used to generate snapshots we do not know
|
734
|
+
// if the target platform will need alignment, so this is controlled from a
|
735
|
+
// flag.
|
736
|
+
return FLAG_sim_stack_alignment;
|
737
|
+
#endif // defined(V8_HOST_ARCH_ARM)
|
738
|
+
}
|
739
|
+
|
740
|
+
|
741
|
+
void MacroAssembler::LeaveExitFrame(bool save_doubles,
|
742
|
+
Register argument_count) {
|
743
|
+
// Optionally restore all double registers.
|
744
|
+
if (save_doubles) {
|
745
|
+
for (int i = 0; i < DwVfpRegister::kNumRegisters; i++) {
|
746
|
+
DwVfpRegister reg = DwVfpRegister::from_code(i);
|
747
|
+
const int offset = -2 * kPointerSize;
|
748
|
+
vldr(reg, fp, offset - ((i + 1) * kDoubleSize));
|
749
|
+
}
|
750
|
+
}
|
751
|
+
|
752
|
+
// Clear top frame.
|
753
|
+
mov(r3, Operand(0, RelocInfo::NONE));
|
754
|
+
mov(ip, Operand(ExternalReference(Top::k_c_entry_fp_address)));
|
755
|
+
str(r3, MemOperand(ip));
|
756
|
+
|
757
|
+
// Restore current context from top and clear it in debug mode.
|
758
|
+
mov(ip, Operand(ExternalReference(Top::k_context_address)));
|
759
|
+
ldr(cp, MemOperand(ip));
|
760
|
+
#ifdef DEBUG
|
761
|
+
str(r3, MemOperand(ip));
|
762
|
+
#endif
|
763
|
+
|
764
|
+
// Tear down the exit frame, pop the arguments, and return.
|
765
|
+
mov(sp, Operand(fp));
|
766
|
+
ldm(ia_w, sp, fp.bit() | lr.bit());
|
767
|
+
if (argument_count.is_valid()) {
|
768
|
+
add(sp, sp, Operand(argument_count, LSL, kPointerSizeLog2));
|
769
|
+
}
|
770
|
+
}
|
771
|
+
|
772
|
+
void MacroAssembler::GetCFunctionDoubleResult(const DoubleRegister dst) {
|
773
|
+
#if !defined(USE_ARM_EABI)
|
774
|
+
UNREACHABLE();
|
775
|
+
#else
|
776
|
+
vmov(dst, r0, r1);
|
777
|
+
#endif
|
778
|
+
}
|
779
|
+
|
780
|
+
|
781
|
+
void MacroAssembler::InvokePrologue(const ParameterCount& expected,
|
782
|
+
const ParameterCount& actual,
|
783
|
+
Handle<Code> code_constant,
|
784
|
+
Register code_reg,
|
785
|
+
Label* done,
|
786
|
+
InvokeFlag flag,
|
787
|
+
PostCallGenerator* post_call_generator) {
|
788
|
+
bool definitely_matches = false;
|
789
|
+
Label regular_invoke;
|
790
|
+
|
791
|
+
// Check whether the expected and actual arguments count match. If not,
|
792
|
+
// setup registers according to contract with ArgumentsAdaptorTrampoline:
|
793
|
+
// r0: actual arguments count
|
794
|
+
// r1: function (passed through to callee)
|
795
|
+
// r2: expected arguments count
|
796
|
+
// r3: callee code entry
|
797
|
+
|
798
|
+
// The code below is made a lot easier because the calling code already sets
|
799
|
+
// up actual and expected registers according to the contract if values are
|
800
|
+
// passed in registers.
|
801
|
+
ASSERT(actual.is_immediate() || actual.reg().is(r0));
|
802
|
+
ASSERT(expected.is_immediate() || expected.reg().is(r2));
|
803
|
+
ASSERT((!code_constant.is_null() && code_reg.is(no_reg)) || code_reg.is(r3));
|
804
|
+
|
805
|
+
if (expected.is_immediate()) {
|
806
|
+
ASSERT(actual.is_immediate());
|
807
|
+
if (expected.immediate() == actual.immediate()) {
|
808
|
+
definitely_matches = true;
|
809
|
+
} else {
|
810
|
+
mov(r0, Operand(actual.immediate()));
|
811
|
+
const int sentinel = SharedFunctionInfo::kDontAdaptArgumentsSentinel;
|
812
|
+
if (expected.immediate() == sentinel) {
|
813
|
+
// Don't worry about adapting arguments for builtins that
|
814
|
+
// don't want that done. Skip adaption code by making it look
|
815
|
+
// like we have a match between expected and actual number of
|
816
|
+
// arguments.
|
817
|
+
definitely_matches = true;
|
818
|
+
} else {
|
819
|
+
mov(r2, Operand(expected.immediate()));
|
820
|
+
}
|
821
|
+
}
|
822
|
+
} else {
|
823
|
+
if (actual.is_immediate()) {
|
824
|
+
cmp(expected.reg(), Operand(actual.immediate()));
|
825
|
+
b(eq, ®ular_invoke);
|
826
|
+
mov(r0, Operand(actual.immediate()));
|
827
|
+
} else {
|
828
|
+
cmp(expected.reg(), Operand(actual.reg()));
|
829
|
+
b(eq, ®ular_invoke);
|
830
|
+
}
|
831
|
+
}
|
832
|
+
|
833
|
+
if (!definitely_matches) {
|
834
|
+
if (!code_constant.is_null()) {
|
835
|
+
mov(r3, Operand(code_constant));
|
836
|
+
add(r3, r3, Operand(Code::kHeaderSize - kHeapObjectTag));
|
837
|
+
}
|
838
|
+
|
839
|
+
Handle<Code> adaptor =
|
840
|
+
Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline));
|
841
|
+
if (flag == CALL_FUNCTION) {
|
842
|
+
Call(adaptor, RelocInfo::CODE_TARGET);
|
843
|
+
if (post_call_generator != NULL) post_call_generator->Generate();
|
844
|
+
b(done);
|
845
|
+
} else {
|
846
|
+
Jump(adaptor, RelocInfo::CODE_TARGET);
|
847
|
+
}
|
848
|
+
bind(®ular_invoke);
|
849
|
+
}
|
850
|
+
}
|
851
|
+
|
852
|
+
|
853
|
+
void MacroAssembler::InvokeCode(Register code,
|
854
|
+
const ParameterCount& expected,
|
855
|
+
const ParameterCount& actual,
|
856
|
+
InvokeFlag flag,
|
857
|
+
PostCallGenerator* post_call_generator) {
|
858
|
+
Label done;
|
859
|
+
|
860
|
+
InvokePrologue(expected, actual, Handle<Code>::null(), code, &done, flag,
|
861
|
+
post_call_generator);
|
862
|
+
if (flag == CALL_FUNCTION) {
|
863
|
+
Call(code);
|
864
|
+
if (post_call_generator != NULL) post_call_generator->Generate();
|
865
|
+
} else {
|
866
|
+
ASSERT(flag == JUMP_FUNCTION);
|
867
|
+
Jump(code);
|
868
|
+
}
|
869
|
+
|
870
|
+
// Continue here if InvokePrologue does handle the invocation due to
|
871
|
+
// mismatched parameter counts.
|
872
|
+
bind(&done);
|
873
|
+
}
|
874
|
+
|
875
|
+
|
876
|
+
void MacroAssembler::InvokeCode(Handle<Code> code,
|
877
|
+
const ParameterCount& expected,
|
878
|
+
const ParameterCount& actual,
|
879
|
+
RelocInfo::Mode rmode,
|
880
|
+
InvokeFlag flag) {
|
881
|
+
Label done;
|
882
|
+
|
883
|
+
InvokePrologue(expected, actual, code, no_reg, &done, flag);
|
884
|
+
if (flag == CALL_FUNCTION) {
|
885
|
+
Call(code, rmode);
|
886
|
+
} else {
|
887
|
+
Jump(code, rmode);
|
888
|
+
}
|
889
|
+
|
890
|
+
// Continue here if InvokePrologue does handle the invocation due to
|
891
|
+
// mismatched parameter counts.
|
892
|
+
bind(&done);
|
893
|
+
}
|
894
|
+
|
895
|
+
|
896
|
+
void MacroAssembler::InvokeFunction(Register fun,
|
897
|
+
const ParameterCount& actual,
|
898
|
+
InvokeFlag flag,
|
899
|
+
PostCallGenerator* post_call_generator) {
|
900
|
+
// Contract with called JS functions requires that function is passed in r1.
|
901
|
+
ASSERT(fun.is(r1));
|
902
|
+
|
903
|
+
Register expected_reg = r2;
|
904
|
+
Register code_reg = r3;
|
905
|
+
|
906
|
+
ldr(code_reg, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset));
|
907
|
+
ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset));
|
908
|
+
ldr(expected_reg,
|
909
|
+
FieldMemOperand(code_reg,
|
910
|
+
SharedFunctionInfo::kFormalParameterCountOffset));
|
911
|
+
mov(expected_reg, Operand(expected_reg, ASR, kSmiTagSize));
|
912
|
+
ldr(code_reg,
|
913
|
+
FieldMemOperand(r1, JSFunction::kCodeEntryOffset));
|
914
|
+
|
915
|
+
ParameterCount expected(expected_reg);
|
916
|
+
InvokeCode(code_reg, expected, actual, flag, post_call_generator);
|
917
|
+
}
|
918
|
+
|
919
|
+
|
920
|
+
void MacroAssembler::InvokeFunction(JSFunction* function,
|
921
|
+
const ParameterCount& actual,
|
922
|
+
InvokeFlag flag) {
|
923
|
+
ASSERT(function->is_compiled());
|
924
|
+
|
925
|
+
// Get the function and setup the context.
|
926
|
+
mov(r1, Operand(Handle<JSFunction>(function)));
|
927
|
+
ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset));
|
928
|
+
|
929
|
+
// Invoke the cached code.
|
930
|
+
Handle<Code> code(function->code());
|
931
|
+
ParameterCount expected(function->shared()->formal_parameter_count());
|
932
|
+
if (V8::UseCrankshaft()) {
|
933
|
+
// TODO(kasperl): For now, we always call indirectly through the
|
934
|
+
// code field in the function to allow recompilation to take effect
|
935
|
+
// without changing any of the call sites.
|
936
|
+
ldr(r3, FieldMemOperand(r1, JSFunction::kCodeEntryOffset));
|
937
|
+
InvokeCode(r3, expected, actual, flag);
|
938
|
+
} else {
|
939
|
+
InvokeCode(code, expected, actual, RelocInfo::CODE_TARGET, flag);
|
940
|
+
}
|
941
|
+
}
|
942
|
+
|
943
|
+
|
944
|
+
void MacroAssembler::IsObjectJSObjectType(Register heap_object,
|
945
|
+
Register map,
|
946
|
+
Register scratch,
|
947
|
+
Label* fail) {
|
948
|
+
ldr(map, FieldMemOperand(heap_object, HeapObject::kMapOffset));
|
949
|
+
IsInstanceJSObjectType(map, scratch, fail);
|
950
|
+
}
|
951
|
+
|
952
|
+
|
953
|
+
void MacroAssembler::IsInstanceJSObjectType(Register map,
|
954
|
+
Register scratch,
|
955
|
+
Label* fail) {
|
956
|
+
ldrb(scratch, FieldMemOperand(map, Map::kInstanceTypeOffset));
|
957
|
+
cmp(scratch, Operand(FIRST_JS_OBJECT_TYPE));
|
958
|
+
b(lt, fail);
|
959
|
+
cmp(scratch, Operand(LAST_JS_OBJECT_TYPE));
|
960
|
+
b(gt, fail);
|
961
|
+
}
|
962
|
+
|
963
|
+
|
964
|
+
void MacroAssembler::IsObjectJSStringType(Register object,
|
965
|
+
Register scratch,
|
966
|
+
Label* fail) {
|
967
|
+
ASSERT(kNotStringTag != 0);
|
968
|
+
|
969
|
+
ldr(scratch, FieldMemOperand(object, HeapObject::kMapOffset));
|
970
|
+
ldrb(scratch, FieldMemOperand(scratch, Map::kInstanceTypeOffset));
|
971
|
+
tst(scratch, Operand(kIsNotStringMask));
|
972
|
+
b(ne, fail);
|
973
|
+
}
|
974
|
+
|
975
|
+
|
976
|
+
#ifdef ENABLE_DEBUGGER_SUPPORT
|
977
|
+
void MacroAssembler::DebugBreak() {
|
978
|
+
ASSERT(allow_stub_calls());
|
979
|
+
mov(r0, Operand(0, RelocInfo::NONE));
|
980
|
+
mov(r1, Operand(ExternalReference(Runtime::kDebugBreak)));
|
981
|
+
CEntryStub ces(1);
|
982
|
+
Call(ces.GetCode(), RelocInfo::DEBUG_BREAK);
|
983
|
+
}
|
984
|
+
#endif
|
985
|
+
|
986
|
+
|
987
|
+
void MacroAssembler::PushTryHandler(CodeLocation try_location,
|
988
|
+
HandlerType type) {
|
989
|
+
// Adjust this code if not the case.
|
990
|
+
ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize);
|
991
|
+
// The pc (return address) is passed in register lr.
|
992
|
+
if (try_location == IN_JAVASCRIPT) {
|
993
|
+
if (type == TRY_CATCH_HANDLER) {
|
994
|
+
mov(r3, Operand(StackHandler::TRY_CATCH));
|
995
|
+
} else {
|
996
|
+
mov(r3, Operand(StackHandler::TRY_FINALLY));
|
997
|
+
}
|
998
|
+
ASSERT(StackHandlerConstants::kStateOffset == 1 * kPointerSize
|
999
|
+
&& StackHandlerConstants::kFPOffset == 2 * kPointerSize
|
1000
|
+
&& StackHandlerConstants::kPCOffset == 3 * kPointerSize);
|
1001
|
+
stm(db_w, sp, r3.bit() | fp.bit() | lr.bit());
|
1002
|
+
// Save the current handler as the next handler.
|
1003
|
+
mov(r3, Operand(ExternalReference(Top::k_handler_address)));
|
1004
|
+
ldr(r1, MemOperand(r3));
|
1005
|
+
ASSERT(StackHandlerConstants::kNextOffset == 0);
|
1006
|
+
push(r1);
|
1007
|
+
// Link this handler as the new current one.
|
1008
|
+
str(sp, MemOperand(r3));
|
1009
|
+
} else {
|
1010
|
+
// Must preserve r0-r4, r5-r7 are available.
|
1011
|
+
ASSERT(try_location == IN_JS_ENTRY);
|
1012
|
+
// The frame pointer does not point to a JS frame so we save NULL
|
1013
|
+
// for fp. We expect the code throwing an exception to check fp
|
1014
|
+
// before dereferencing it to restore the context.
|
1015
|
+
mov(ip, Operand(0, RelocInfo::NONE)); // To save a NULL frame pointer.
|
1016
|
+
mov(r6, Operand(StackHandler::ENTRY));
|
1017
|
+
ASSERT(StackHandlerConstants::kStateOffset == 1 * kPointerSize
|
1018
|
+
&& StackHandlerConstants::kFPOffset == 2 * kPointerSize
|
1019
|
+
&& StackHandlerConstants::kPCOffset == 3 * kPointerSize);
|
1020
|
+
stm(db_w, sp, r6.bit() | ip.bit() | lr.bit());
|
1021
|
+
// Save the current handler as the next handler.
|
1022
|
+
mov(r7, Operand(ExternalReference(Top::k_handler_address)));
|
1023
|
+
ldr(r6, MemOperand(r7));
|
1024
|
+
ASSERT(StackHandlerConstants::kNextOffset == 0);
|
1025
|
+
push(r6);
|
1026
|
+
// Link this handler as the new current one.
|
1027
|
+
str(sp, MemOperand(r7));
|
1028
|
+
}
|
1029
|
+
}
|
1030
|
+
|
1031
|
+
|
1032
|
+
void MacroAssembler::PopTryHandler() {
|
1033
|
+
ASSERT_EQ(0, StackHandlerConstants::kNextOffset);
|
1034
|
+
pop(r1);
|
1035
|
+
mov(ip, Operand(ExternalReference(Top::k_handler_address)));
|
1036
|
+
add(sp, sp, Operand(StackHandlerConstants::kSize - kPointerSize));
|
1037
|
+
str(r1, MemOperand(ip));
|
1038
|
+
}
|
1039
|
+
|
1040
|
+
|
1041
|
+
void MacroAssembler::Throw(Register value) {
|
1042
|
+
// r0 is expected to hold the exception.
|
1043
|
+
if (!value.is(r0)) {
|
1044
|
+
mov(r0, value);
|
1045
|
+
}
|
1046
|
+
|
1047
|
+
// Adjust this code if not the case.
|
1048
|
+
STATIC_ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize);
|
1049
|
+
|
1050
|
+
// Drop the sp to the top of the handler.
|
1051
|
+
mov(r3, Operand(ExternalReference(Top::k_handler_address)));
|
1052
|
+
ldr(sp, MemOperand(r3));
|
1053
|
+
|
1054
|
+
// Restore the next handler and frame pointer, discard handler state.
|
1055
|
+
STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0);
|
1056
|
+
pop(r2);
|
1057
|
+
str(r2, MemOperand(r3));
|
1058
|
+
STATIC_ASSERT(StackHandlerConstants::kFPOffset == 2 * kPointerSize);
|
1059
|
+
ldm(ia_w, sp, r3.bit() | fp.bit()); // r3: discarded state.
|
1060
|
+
|
1061
|
+
// Before returning we restore the context from the frame pointer if
|
1062
|
+
// not NULL. The frame pointer is NULL in the exception handler of a
|
1063
|
+
// JS entry frame.
|
1064
|
+
cmp(fp, Operand(0, RelocInfo::NONE));
|
1065
|
+
// Set cp to NULL if fp is NULL.
|
1066
|
+
mov(cp, Operand(0, RelocInfo::NONE), LeaveCC, eq);
|
1067
|
+
// Restore cp otherwise.
|
1068
|
+
ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset), ne);
|
1069
|
+
#ifdef DEBUG
|
1070
|
+
if (FLAG_debug_code) {
|
1071
|
+
mov(lr, Operand(pc));
|
1072
|
+
}
|
1073
|
+
#endif
|
1074
|
+
STATIC_ASSERT(StackHandlerConstants::kPCOffset == 3 * kPointerSize);
|
1075
|
+
pop(pc);
|
1076
|
+
}
|
1077
|
+
|
1078
|
+
|
1079
|
+
void MacroAssembler::ThrowUncatchable(UncatchableExceptionType type,
|
1080
|
+
Register value) {
|
1081
|
+
// Adjust this code if not the case.
|
1082
|
+
STATIC_ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize);
|
1083
|
+
|
1084
|
+
// r0 is expected to hold the exception.
|
1085
|
+
if (!value.is(r0)) {
|
1086
|
+
mov(r0, value);
|
1087
|
+
}
|
1088
|
+
|
1089
|
+
// Drop sp to the top stack handler.
|
1090
|
+
mov(r3, Operand(ExternalReference(Top::k_handler_address)));
|
1091
|
+
ldr(sp, MemOperand(r3));
|
1092
|
+
|
1093
|
+
// Unwind the handlers until the ENTRY handler is found.
|
1094
|
+
Label loop, done;
|
1095
|
+
bind(&loop);
|
1096
|
+
// Load the type of the current stack handler.
|
1097
|
+
const int kStateOffset = StackHandlerConstants::kStateOffset;
|
1098
|
+
ldr(r2, MemOperand(sp, kStateOffset));
|
1099
|
+
cmp(r2, Operand(StackHandler::ENTRY));
|
1100
|
+
b(eq, &done);
|
1101
|
+
// Fetch the next handler in the list.
|
1102
|
+
const int kNextOffset = StackHandlerConstants::kNextOffset;
|
1103
|
+
ldr(sp, MemOperand(sp, kNextOffset));
|
1104
|
+
jmp(&loop);
|
1105
|
+
bind(&done);
|
1106
|
+
|
1107
|
+
// Set the top handler address to next handler past the current ENTRY handler.
|
1108
|
+
STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0);
|
1109
|
+
pop(r2);
|
1110
|
+
str(r2, MemOperand(r3));
|
1111
|
+
|
1112
|
+
if (type == OUT_OF_MEMORY) {
|
1113
|
+
// Set external caught exception to false.
|
1114
|
+
ExternalReference external_caught(Top::k_external_caught_exception_address);
|
1115
|
+
mov(r0, Operand(false, RelocInfo::NONE));
|
1116
|
+
mov(r2, Operand(external_caught));
|
1117
|
+
str(r0, MemOperand(r2));
|
1118
|
+
|
1119
|
+
// Set pending exception and r0 to out of memory exception.
|
1120
|
+
Failure* out_of_memory = Failure::OutOfMemoryException();
|
1121
|
+
mov(r0, Operand(reinterpret_cast<int32_t>(out_of_memory)));
|
1122
|
+
mov(r2, Operand(ExternalReference(Top::k_pending_exception_address)));
|
1123
|
+
str(r0, MemOperand(r2));
|
1124
|
+
}
|
1125
|
+
|
1126
|
+
// Stack layout at this point. See also StackHandlerConstants.
|
1127
|
+
// sp -> state (ENTRY)
|
1128
|
+
// fp
|
1129
|
+
// lr
|
1130
|
+
|
1131
|
+
// Discard handler state (r2 is not used) and restore frame pointer.
|
1132
|
+
STATIC_ASSERT(StackHandlerConstants::kFPOffset == 2 * kPointerSize);
|
1133
|
+
ldm(ia_w, sp, r2.bit() | fp.bit()); // r2: discarded state.
|
1134
|
+
// Before returning we restore the context from the frame pointer if
|
1135
|
+
// not NULL. The frame pointer is NULL in the exception handler of a
|
1136
|
+
// JS entry frame.
|
1137
|
+
cmp(fp, Operand(0, RelocInfo::NONE));
|
1138
|
+
// Set cp to NULL if fp is NULL.
|
1139
|
+
mov(cp, Operand(0, RelocInfo::NONE), LeaveCC, eq);
|
1140
|
+
// Restore cp otherwise.
|
1141
|
+
ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset), ne);
|
1142
|
+
#ifdef DEBUG
|
1143
|
+
if (FLAG_debug_code) {
|
1144
|
+
mov(lr, Operand(pc));
|
1145
|
+
}
|
1146
|
+
#endif
|
1147
|
+
STATIC_ASSERT(StackHandlerConstants::kPCOffset == 3 * kPointerSize);
|
1148
|
+
pop(pc);
|
1149
|
+
}
|
1150
|
+
|
1151
|
+
|
1152
|
+
void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg,
|
1153
|
+
Register scratch,
|
1154
|
+
Label* miss) {
|
1155
|
+
Label same_contexts;
|
1156
|
+
|
1157
|
+
ASSERT(!holder_reg.is(scratch));
|
1158
|
+
ASSERT(!holder_reg.is(ip));
|
1159
|
+
ASSERT(!scratch.is(ip));
|
1160
|
+
|
1161
|
+
// Load current lexical context from the stack frame.
|
1162
|
+
ldr(scratch, MemOperand(fp, StandardFrameConstants::kContextOffset));
|
1163
|
+
// In debug mode, make sure the lexical context is set.
|
1164
|
+
#ifdef DEBUG
|
1165
|
+
cmp(scratch, Operand(0, RelocInfo::NONE));
|
1166
|
+
Check(ne, "we should not have an empty lexical context");
|
1167
|
+
#endif
|
1168
|
+
|
1169
|
+
// Load the global context of the current context.
|
1170
|
+
int offset = Context::kHeaderSize + Context::GLOBAL_INDEX * kPointerSize;
|
1171
|
+
ldr(scratch, FieldMemOperand(scratch, offset));
|
1172
|
+
ldr(scratch, FieldMemOperand(scratch, GlobalObject::kGlobalContextOffset));
|
1173
|
+
|
1174
|
+
// Check the context is a global context.
|
1175
|
+
if (FLAG_debug_code) {
|
1176
|
+
// TODO(119): avoid push(holder_reg)/pop(holder_reg)
|
1177
|
+
// Cannot use ip as a temporary in this verification code. Due to the fact
|
1178
|
+
// that ip is clobbered as part of cmp with an object Operand.
|
1179
|
+
push(holder_reg); // Temporarily save holder on the stack.
|
1180
|
+
// Read the first word and compare to the global_context_map.
|
1181
|
+
ldr(holder_reg, FieldMemOperand(scratch, HeapObject::kMapOffset));
|
1182
|
+
LoadRoot(ip, Heap::kGlobalContextMapRootIndex);
|
1183
|
+
cmp(holder_reg, ip);
|
1184
|
+
Check(eq, "JSGlobalObject::global_context should be a global context.");
|
1185
|
+
pop(holder_reg); // Restore holder.
|
1186
|
+
}
|
1187
|
+
|
1188
|
+
// Check if both contexts are the same.
|
1189
|
+
ldr(ip, FieldMemOperand(holder_reg, JSGlobalProxy::kContextOffset));
|
1190
|
+
cmp(scratch, Operand(ip));
|
1191
|
+
b(eq, &same_contexts);
|
1192
|
+
|
1193
|
+
// Check the context is a global context.
|
1194
|
+
if (FLAG_debug_code) {
|
1195
|
+
// TODO(119): avoid push(holder_reg)/pop(holder_reg)
|
1196
|
+
// Cannot use ip as a temporary in this verification code. Due to the fact
|
1197
|
+
// that ip is clobbered as part of cmp with an object Operand.
|
1198
|
+
push(holder_reg); // Temporarily save holder on the stack.
|
1199
|
+
mov(holder_reg, ip); // Move ip to its holding place.
|
1200
|
+
LoadRoot(ip, Heap::kNullValueRootIndex);
|
1201
|
+
cmp(holder_reg, ip);
|
1202
|
+
Check(ne, "JSGlobalProxy::context() should not be null.");
|
1203
|
+
|
1204
|
+
ldr(holder_reg, FieldMemOperand(holder_reg, HeapObject::kMapOffset));
|
1205
|
+
LoadRoot(ip, Heap::kGlobalContextMapRootIndex);
|
1206
|
+
cmp(holder_reg, ip);
|
1207
|
+
Check(eq, "JSGlobalObject::global_context should be a global context.");
|
1208
|
+
// Restore ip is not needed. ip is reloaded below.
|
1209
|
+
pop(holder_reg); // Restore holder.
|
1210
|
+
// Restore ip to holder's context.
|
1211
|
+
ldr(ip, FieldMemOperand(holder_reg, JSGlobalProxy::kContextOffset));
|
1212
|
+
}
|
1213
|
+
|
1214
|
+
// Check that the security token in the calling global object is
|
1215
|
+
// compatible with the security token in the receiving global
|
1216
|
+
// object.
|
1217
|
+
int token_offset = Context::kHeaderSize +
|
1218
|
+
Context::SECURITY_TOKEN_INDEX * kPointerSize;
|
1219
|
+
|
1220
|
+
ldr(scratch, FieldMemOperand(scratch, token_offset));
|
1221
|
+
ldr(ip, FieldMemOperand(ip, token_offset));
|
1222
|
+
cmp(scratch, Operand(ip));
|
1223
|
+
b(ne, miss);
|
1224
|
+
|
1225
|
+
bind(&same_contexts);
|
1226
|
+
}
|
1227
|
+
|
1228
|
+
|
1229
|
+
void MacroAssembler::AllocateInNewSpace(int object_size,
|
1230
|
+
Register result,
|
1231
|
+
Register scratch1,
|
1232
|
+
Register scratch2,
|
1233
|
+
Label* gc_required,
|
1234
|
+
AllocationFlags flags) {
|
1235
|
+
if (!FLAG_inline_new) {
|
1236
|
+
if (FLAG_debug_code) {
|
1237
|
+
// Trash the registers to simulate an allocation failure.
|
1238
|
+
mov(result, Operand(0x7091));
|
1239
|
+
mov(scratch1, Operand(0x7191));
|
1240
|
+
mov(scratch2, Operand(0x7291));
|
1241
|
+
}
|
1242
|
+
jmp(gc_required);
|
1243
|
+
return;
|
1244
|
+
}
|
1245
|
+
|
1246
|
+
ASSERT(!result.is(scratch1));
|
1247
|
+
ASSERT(!result.is(scratch2));
|
1248
|
+
ASSERT(!scratch1.is(scratch2));
|
1249
|
+
|
1250
|
+
// Make object size into bytes.
|
1251
|
+
if ((flags & SIZE_IN_WORDS) != 0) {
|
1252
|
+
object_size *= kPointerSize;
|
1253
|
+
}
|
1254
|
+
ASSERT_EQ(0, object_size & kObjectAlignmentMask);
|
1255
|
+
|
1256
|
+
// Check relative positions of allocation top and limit addresses.
|
1257
|
+
// The values must be adjacent in memory to allow the use of LDM.
|
1258
|
+
// Also, assert that the registers are numbered such that the values
|
1259
|
+
// are loaded in the correct order.
|
1260
|
+
ExternalReference new_space_allocation_top =
|
1261
|
+
ExternalReference::new_space_allocation_top_address();
|
1262
|
+
ExternalReference new_space_allocation_limit =
|
1263
|
+
ExternalReference::new_space_allocation_limit_address();
|
1264
|
+
intptr_t top =
|
1265
|
+
reinterpret_cast<intptr_t>(new_space_allocation_top.address());
|
1266
|
+
intptr_t limit =
|
1267
|
+
reinterpret_cast<intptr_t>(new_space_allocation_limit.address());
|
1268
|
+
ASSERT((limit - top) == kPointerSize);
|
1269
|
+
ASSERT(result.code() < ip.code());
|
1270
|
+
|
1271
|
+
// Set up allocation top address and object size registers.
|
1272
|
+
Register topaddr = scratch1;
|
1273
|
+
Register obj_size_reg = scratch2;
|
1274
|
+
mov(topaddr, Operand(new_space_allocation_top));
|
1275
|
+
mov(obj_size_reg, Operand(object_size));
|
1276
|
+
|
1277
|
+
// This code stores a temporary value in ip. This is OK, as the code below
|
1278
|
+
// does not need ip for implicit literal generation.
|
1279
|
+
if ((flags & RESULT_CONTAINS_TOP) == 0) {
|
1280
|
+
// Load allocation top into result and allocation limit into ip.
|
1281
|
+
ldm(ia, topaddr, result.bit() | ip.bit());
|
1282
|
+
} else {
|
1283
|
+
if (FLAG_debug_code) {
|
1284
|
+
// Assert that result actually contains top on entry. ip is used
|
1285
|
+
// immediately below so this use of ip does not cause difference with
|
1286
|
+
// respect to register content between debug and release mode.
|
1287
|
+
ldr(ip, MemOperand(topaddr));
|
1288
|
+
cmp(result, ip);
|
1289
|
+
Check(eq, "Unexpected allocation top");
|
1290
|
+
}
|
1291
|
+
// Load allocation limit into ip. Result already contains allocation top.
|
1292
|
+
ldr(ip, MemOperand(topaddr, limit - top));
|
1293
|
+
}
|
1294
|
+
|
1295
|
+
// Calculate new top and bail out if new space is exhausted. Use result
|
1296
|
+
// to calculate the new top.
|
1297
|
+
add(scratch2, result, Operand(obj_size_reg), SetCC);
|
1298
|
+
b(cs, gc_required);
|
1299
|
+
cmp(scratch2, Operand(ip));
|
1300
|
+
b(hi, gc_required);
|
1301
|
+
str(scratch2, MemOperand(topaddr));
|
1302
|
+
|
1303
|
+
// Tag object if requested.
|
1304
|
+
if ((flags & TAG_OBJECT) != 0) {
|
1305
|
+
add(result, result, Operand(kHeapObjectTag));
|
1306
|
+
}
|
1307
|
+
}
|
1308
|
+
|
1309
|
+
|
1310
|
+
void MacroAssembler::AllocateInNewSpace(Register object_size,
|
1311
|
+
Register result,
|
1312
|
+
Register scratch1,
|
1313
|
+
Register scratch2,
|
1314
|
+
Label* gc_required,
|
1315
|
+
AllocationFlags flags) {
|
1316
|
+
if (!FLAG_inline_new) {
|
1317
|
+
if (FLAG_debug_code) {
|
1318
|
+
// Trash the registers to simulate an allocation failure.
|
1319
|
+
mov(result, Operand(0x7091));
|
1320
|
+
mov(scratch1, Operand(0x7191));
|
1321
|
+
mov(scratch2, Operand(0x7291));
|
1322
|
+
}
|
1323
|
+
jmp(gc_required);
|
1324
|
+
return;
|
1325
|
+
}
|
1326
|
+
|
1327
|
+
// Assert that the register arguments are different and that none of
|
1328
|
+
// them are ip. ip is used explicitly in the code generated below.
|
1329
|
+
ASSERT(!result.is(scratch1));
|
1330
|
+
ASSERT(!result.is(scratch2));
|
1331
|
+
ASSERT(!scratch1.is(scratch2));
|
1332
|
+
ASSERT(!result.is(ip));
|
1333
|
+
ASSERT(!scratch1.is(ip));
|
1334
|
+
ASSERT(!scratch2.is(ip));
|
1335
|
+
|
1336
|
+
// Check relative positions of allocation top and limit addresses.
|
1337
|
+
// The values must be adjacent in memory to allow the use of LDM.
|
1338
|
+
// Also, assert that the registers are numbered such that the values
|
1339
|
+
// are loaded in the correct order.
|
1340
|
+
ExternalReference new_space_allocation_top =
|
1341
|
+
ExternalReference::new_space_allocation_top_address();
|
1342
|
+
ExternalReference new_space_allocation_limit =
|
1343
|
+
ExternalReference::new_space_allocation_limit_address();
|
1344
|
+
intptr_t top =
|
1345
|
+
reinterpret_cast<intptr_t>(new_space_allocation_top.address());
|
1346
|
+
intptr_t limit =
|
1347
|
+
reinterpret_cast<intptr_t>(new_space_allocation_limit.address());
|
1348
|
+
ASSERT((limit - top) == kPointerSize);
|
1349
|
+
ASSERT(result.code() < ip.code());
|
1350
|
+
|
1351
|
+
// Set up allocation top address.
|
1352
|
+
Register topaddr = scratch1;
|
1353
|
+
mov(topaddr, Operand(new_space_allocation_top));
|
1354
|
+
|
1355
|
+
// This code stores a temporary value in ip. This is OK, as the code below
|
1356
|
+
// does not need ip for implicit literal generation.
|
1357
|
+
if ((flags & RESULT_CONTAINS_TOP) == 0) {
|
1358
|
+
// Load allocation top into result and allocation limit into ip.
|
1359
|
+
ldm(ia, topaddr, result.bit() | ip.bit());
|
1360
|
+
} else {
|
1361
|
+
if (FLAG_debug_code) {
|
1362
|
+
// Assert that result actually contains top on entry. ip is used
|
1363
|
+
// immediately below so this use of ip does not cause difference with
|
1364
|
+
// respect to register content between debug and release mode.
|
1365
|
+
ldr(ip, MemOperand(topaddr));
|
1366
|
+
cmp(result, ip);
|
1367
|
+
Check(eq, "Unexpected allocation top");
|
1368
|
+
}
|
1369
|
+
// Load allocation limit into ip. Result already contains allocation top.
|
1370
|
+
ldr(ip, MemOperand(topaddr, limit - top));
|
1371
|
+
}
|
1372
|
+
|
1373
|
+
// Calculate new top and bail out if new space is exhausted. Use result
|
1374
|
+
// to calculate the new top. Object size may be in words so a shift is
|
1375
|
+
// required to get the number of bytes.
|
1376
|
+
if ((flags & SIZE_IN_WORDS) != 0) {
|
1377
|
+
add(scratch2, result, Operand(object_size, LSL, kPointerSizeLog2), SetCC);
|
1378
|
+
} else {
|
1379
|
+
add(scratch2, result, Operand(object_size), SetCC);
|
1380
|
+
}
|
1381
|
+
b(cs, gc_required);
|
1382
|
+
cmp(scratch2, Operand(ip));
|
1383
|
+
b(hi, gc_required);
|
1384
|
+
|
1385
|
+
// Update allocation top. result temporarily holds the new top.
|
1386
|
+
if (FLAG_debug_code) {
|
1387
|
+
tst(scratch2, Operand(kObjectAlignmentMask));
|
1388
|
+
Check(eq, "Unaligned allocation in new space");
|
1389
|
+
}
|
1390
|
+
str(scratch2, MemOperand(topaddr));
|
1391
|
+
|
1392
|
+
// Tag object if requested.
|
1393
|
+
if ((flags & TAG_OBJECT) != 0) {
|
1394
|
+
add(result, result, Operand(kHeapObjectTag));
|
1395
|
+
}
|
1396
|
+
}
|
1397
|
+
|
1398
|
+
|
1399
|
+
void MacroAssembler::UndoAllocationInNewSpace(Register object,
|
1400
|
+
Register scratch) {
|
1401
|
+
ExternalReference new_space_allocation_top =
|
1402
|
+
ExternalReference::new_space_allocation_top_address();
|
1403
|
+
|
1404
|
+
// Make sure the object has no tag before resetting top.
|
1405
|
+
and_(object, object, Operand(~kHeapObjectTagMask));
|
1406
|
+
#ifdef DEBUG
|
1407
|
+
// Check that the object un-allocated is below the current top.
|
1408
|
+
mov(scratch, Operand(new_space_allocation_top));
|
1409
|
+
ldr(scratch, MemOperand(scratch));
|
1410
|
+
cmp(object, scratch);
|
1411
|
+
Check(lt, "Undo allocation of non allocated memory");
|
1412
|
+
#endif
|
1413
|
+
// Write the address of the object to un-allocate as the current top.
|
1414
|
+
mov(scratch, Operand(new_space_allocation_top));
|
1415
|
+
str(object, MemOperand(scratch));
|
1416
|
+
}
|
1417
|
+
|
1418
|
+
|
1419
|
+
void MacroAssembler::AllocateTwoByteString(Register result,
|
1420
|
+
Register length,
|
1421
|
+
Register scratch1,
|
1422
|
+
Register scratch2,
|
1423
|
+
Register scratch3,
|
1424
|
+
Label* gc_required) {
|
1425
|
+
// Calculate the number of bytes needed for the characters in the string while
|
1426
|
+
// observing object alignment.
|
1427
|
+
ASSERT((SeqTwoByteString::kHeaderSize & kObjectAlignmentMask) == 0);
|
1428
|
+
mov(scratch1, Operand(length, LSL, 1)); // Length in bytes, not chars.
|
1429
|
+
add(scratch1, scratch1,
|
1430
|
+
Operand(kObjectAlignmentMask + SeqTwoByteString::kHeaderSize));
|
1431
|
+
and_(scratch1, scratch1, Operand(~kObjectAlignmentMask));
|
1432
|
+
|
1433
|
+
// Allocate two-byte string in new space.
|
1434
|
+
AllocateInNewSpace(scratch1,
|
1435
|
+
result,
|
1436
|
+
scratch2,
|
1437
|
+
scratch3,
|
1438
|
+
gc_required,
|
1439
|
+
TAG_OBJECT);
|
1440
|
+
|
1441
|
+
// Set the map, length and hash field.
|
1442
|
+
InitializeNewString(result,
|
1443
|
+
length,
|
1444
|
+
Heap::kStringMapRootIndex,
|
1445
|
+
scratch1,
|
1446
|
+
scratch2);
|
1447
|
+
}
|
1448
|
+
|
1449
|
+
|
1450
|
+
void MacroAssembler::AllocateAsciiString(Register result,
|
1451
|
+
Register length,
|
1452
|
+
Register scratch1,
|
1453
|
+
Register scratch2,
|
1454
|
+
Register scratch3,
|
1455
|
+
Label* gc_required) {
|
1456
|
+
// Calculate the number of bytes needed for the characters in the string while
|
1457
|
+
// observing object alignment.
|
1458
|
+
ASSERT((SeqAsciiString::kHeaderSize & kObjectAlignmentMask) == 0);
|
1459
|
+
ASSERT(kCharSize == 1);
|
1460
|
+
add(scratch1, length,
|
1461
|
+
Operand(kObjectAlignmentMask + SeqAsciiString::kHeaderSize));
|
1462
|
+
and_(scratch1, scratch1, Operand(~kObjectAlignmentMask));
|
1463
|
+
|
1464
|
+
// Allocate ASCII string in new space.
|
1465
|
+
AllocateInNewSpace(scratch1,
|
1466
|
+
result,
|
1467
|
+
scratch2,
|
1468
|
+
scratch3,
|
1469
|
+
gc_required,
|
1470
|
+
TAG_OBJECT);
|
1471
|
+
|
1472
|
+
// Set the map, length and hash field.
|
1473
|
+
InitializeNewString(result,
|
1474
|
+
length,
|
1475
|
+
Heap::kAsciiStringMapRootIndex,
|
1476
|
+
scratch1,
|
1477
|
+
scratch2);
|
1478
|
+
}
|
1479
|
+
|
1480
|
+
|
1481
|
+
void MacroAssembler::AllocateTwoByteConsString(Register result,
|
1482
|
+
Register length,
|
1483
|
+
Register scratch1,
|
1484
|
+
Register scratch2,
|
1485
|
+
Label* gc_required) {
|
1486
|
+
AllocateInNewSpace(ConsString::kSize,
|
1487
|
+
result,
|
1488
|
+
scratch1,
|
1489
|
+
scratch2,
|
1490
|
+
gc_required,
|
1491
|
+
TAG_OBJECT);
|
1492
|
+
|
1493
|
+
InitializeNewString(result,
|
1494
|
+
length,
|
1495
|
+
Heap::kConsStringMapRootIndex,
|
1496
|
+
scratch1,
|
1497
|
+
scratch2);
|
1498
|
+
}
|
1499
|
+
|
1500
|
+
|
1501
|
+
void MacroAssembler::AllocateAsciiConsString(Register result,
|
1502
|
+
Register length,
|
1503
|
+
Register scratch1,
|
1504
|
+
Register scratch2,
|
1505
|
+
Label* gc_required) {
|
1506
|
+
AllocateInNewSpace(ConsString::kSize,
|
1507
|
+
result,
|
1508
|
+
scratch1,
|
1509
|
+
scratch2,
|
1510
|
+
gc_required,
|
1511
|
+
TAG_OBJECT);
|
1512
|
+
|
1513
|
+
InitializeNewString(result,
|
1514
|
+
length,
|
1515
|
+
Heap::kConsAsciiStringMapRootIndex,
|
1516
|
+
scratch1,
|
1517
|
+
scratch2);
|
1518
|
+
}
|
1519
|
+
|
1520
|
+
|
1521
|
+
void MacroAssembler::CompareObjectType(Register object,
|
1522
|
+
Register map,
|
1523
|
+
Register type_reg,
|
1524
|
+
InstanceType type) {
|
1525
|
+
ldr(map, FieldMemOperand(object, HeapObject::kMapOffset));
|
1526
|
+
CompareInstanceType(map, type_reg, type);
|
1527
|
+
}
|
1528
|
+
|
1529
|
+
|
1530
|
+
void MacroAssembler::CompareInstanceType(Register map,
|
1531
|
+
Register type_reg,
|
1532
|
+
InstanceType type) {
|
1533
|
+
ldrb(type_reg, FieldMemOperand(map, Map::kInstanceTypeOffset));
|
1534
|
+
cmp(type_reg, Operand(type));
|
1535
|
+
}
|
1536
|
+
|
1537
|
+
|
1538
|
+
void MacroAssembler::CheckMap(Register obj,
|
1539
|
+
Register scratch,
|
1540
|
+
Handle<Map> map,
|
1541
|
+
Label* fail,
|
1542
|
+
bool is_heap_object) {
|
1543
|
+
if (!is_heap_object) {
|
1544
|
+
JumpIfSmi(obj, fail);
|
1545
|
+
}
|
1546
|
+
ldr(scratch, FieldMemOperand(obj, HeapObject::kMapOffset));
|
1547
|
+
mov(ip, Operand(map));
|
1548
|
+
cmp(scratch, ip);
|
1549
|
+
b(ne, fail);
|
1550
|
+
}
|
1551
|
+
|
1552
|
+
|
1553
|
+
void MacroAssembler::CheckMap(Register obj,
|
1554
|
+
Register scratch,
|
1555
|
+
Heap::RootListIndex index,
|
1556
|
+
Label* fail,
|
1557
|
+
bool is_heap_object) {
|
1558
|
+
if (!is_heap_object) {
|
1559
|
+
JumpIfSmi(obj, fail);
|
1560
|
+
}
|
1561
|
+
ldr(scratch, FieldMemOperand(obj, HeapObject::kMapOffset));
|
1562
|
+
LoadRoot(ip, index);
|
1563
|
+
cmp(scratch, ip);
|
1564
|
+
b(ne, fail);
|
1565
|
+
}
|
1566
|
+
|
1567
|
+
|
1568
|
+
void MacroAssembler::TryGetFunctionPrototype(Register function,
|
1569
|
+
Register result,
|
1570
|
+
Register scratch,
|
1571
|
+
Label* miss) {
|
1572
|
+
// Check that the receiver isn't a smi.
|
1573
|
+
JumpIfSmi(function, miss);
|
1574
|
+
|
1575
|
+
// Check that the function really is a function. Load map into result reg.
|
1576
|
+
CompareObjectType(function, result, scratch, JS_FUNCTION_TYPE);
|
1577
|
+
b(ne, miss);
|
1578
|
+
|
1579
|
+
// Make sure that the function has an instance prototype.
|
1580
|
+
Label non_instance;
|
1581
|
+
ldrb(scratch, FieldMemOperand(result, Map::kBitFieldOffset));
|
1582
|
+
tst(scratch, Operand(1 << Map::kHasNonInstancePrototype));
|
1583
|
+
b(ne, &non_instance);
|
1584
|
+
|
1585
|
+
// Get the prototype or initial map from the function.
|
1586
|
+
ldr(result,
|
1587
|
+
FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset));
|
1588
|
+
|
1589
|
+
// If the prototype or initial map is the hole, don't return it and
|
1590
|
+
// simply miss the cache instead. This will allow us to allocate a
|
1591
|
+
// prototype object on-demand in the runtime system.
|
1592
|
+
LoadRoot(ip, Heap::kTheHoleValueRootIndex);
|
1593
|
+
cmp(result, ip);
|
1594
|
+
b(eq, miss);
|
1595
|
+
|
1596
|
+
// If the function does not have an initial map, we're done.
|
1597
|
+
Label done;
|
1598
|
+
CompareObjectType(result, scratch, scratch, MAP_TYPE);
|
1599
|
+
b(ne, &done);
|
1600
|
+
|
1601
|
+
// Get the prototype from the initial map.
|
1602
|
+
ldr(result, FieldMemOperand(result, Map::kPrototypeOffset));
|
1603
|
+
jmp(&done);
|
1604
|
+
|
1605
|
+
// Non-instance prototype: Fetch prototype from constructor field
|
1606
|
+
// in initial map.
|
1607
|
+
bind(&non_instance);
|
1608
|
+
ldr(result, FieldMemOperand(result, Map::kConstructorOffset));
|
1609
|
+
|
1610
|
+
// All done.
|
1611
|
+
bind(&done);
|
1612
|
+
}
|
1613
|
+
|
1614
|
+
|
1615
|
+
void MacroAssembler::CallStub(CodeStub* stub, Condition cond) {
|
1616
|
+
ASSERT(allow_stub_calls()); // Stub calls are not allowed in some stubs.
|
1617
|
+
Call(stub->GetCode(), RelocInfo::CODE_TARGET, cond);
|
1618
|
+
}
|
1619
|
+
|
1620
|
+
|
1621
|
+
void MacroAssembler::TailCallStub(CodeStub* stub, Condition cond) {
|
1622
|
+
ASSERT(allow_stub_calls()); // Stub calls are not allowed in some stubs.
|
1623
|
+
Jump(stub->GetCode(), RelocInfo::CODE_TARGET, cond);
|
1624
|
+
}
|
1625
|
+
|
1626
|
+
|
1627
|
+
MaybeObject* MacroAssembler::TryTailCallStub(CodeStub* stub, Condition cond) {
|
1628
|
+
ASSERT(allow_stub_calls()); // Stub calls are not allowed in some stubs.
|
1629
|
+
Object* result;
|
1630
|
+
{ MaybeObject* maybe_result = stub->TryGetCode();
|
1631
|
+
if (!maybe_result->ToObject(&result)) return maybe_result;
|
1632
|
+
}
|
1633
|
+
Jump(stub->GetCode(), RelocInfo::CODE_TARGET, cond);
|
1634
|
+
return result;
|
1635
|
+
}
|
1636
|
+
|
1637
|
+
|
1638
|
+
static int AddressOffset(ExternalReference ref0, ExternalReference ref1) {
|
1639
|
+
return ref0.address() - ref1.address();
|
1640
|
+
}
|
1641
|
+
|
1642
|
+
|
1643
|
+
MaybeObject* MacroAssembler::TryCallApiFunctionAndReturn(
|
1644
|
+
ExternalReference function, int stack_space) {
|
1645
|
+
ExternalReference next_address =
|
1646
|
+
ExternalReference::handle_scope_next_address();
|
1647
|
+
const int kNextOffset = 0;
|
1648
|
+
const int kLimitOffset = AddressOffset(
|
1649
|
+
ExternalReference::handle_scope_limit_address(),
|
1650
|
+
next_address);
|
1651
|
+
const int kLevelOffset = AddressOffset(
|
1652
|
+
ExternalReference::handle_scope_level_address(),
|
1653
|
+
next_address);
|
1654
|
+
|
1655
|
+
// Allocate HandleScope in callee-save registers.
|
1656
|
+
mov(r7, Operand(next_address));
|
1657
|
+
ldr(r4, MemOperand(r7, kNextOffset));
|
1658
|
+
ldr(r5, MemOperand(r7, kLimitOffset));
|
1659
|
+
ldr(r6, MemOperand(r7, kLevelOffset));
|
1660
|
+
add(r6, r6, Operand(1));
|
1661
|
+
str(r6, MemOperand(r7, kLevelOffset));
|
1662
|
+
|
1663
|
+
// Native call returns to the DirectCEntry stub which redirects to the
|
1664
|
+
// return address pushed on stack (could have moved after GC).
|
1665
|
+
// DirectCEntry stub itself is generated early and never moves.
|
1666
|
+
DirectCEntryStub stub;
|
1667
|
+
stub.GenerateCall(this, function);
|
1668
|
+
|
1669
|
+
Label promote_scheduled_exception;
|
1670
|
+
Label delete_allocated_handles;
|
1671
|
+
Label leave_exit_frame;
|
1672
|
+
|
1673
|
+
// If result is non-zero, dereference to get the result value
|
1674
|
+
// otherwise set it to undefined.
|
1675
|
+
cmp(r0, Operand(0));
|
1676
|
+
LoadRoot(r0, Heap::kUndefinedValueRootIndex, eq);
|
1677
|
+
ldr(r0, MemOperand(r0), ne);
|
1678
|
+
|
1679
|
+
// No more valid handles (the result handle was the last one). Restore
|
1680
|
+
// previous handle scope.
|
1681
|
+
str(r4, MemOperand(r7, kNextOffset));
|
1682
|
+
if (FLAG_debug_code) {
|
1683
|
+
ldr(r1, MemOperand(r7, kLevelOffset));
|
1684
|
+
cmp(r1, r6);
|
1685
|
+
Check(eq, "Unexpected level after return from api call");
|
1686
|
+
}
|
1687
|
+
sub(r6, r6, Operand(1));
|
1688
|
+
str(r6, MemOperand(r7, kLevelOffset));
|
1689
|
+
ldr(ip, MemOperand(r7, kLimitOffset));
|
1690
|
+
cmp(r5, ip);
|
1691
|
+
b(ne, &delete_allocated_handles);
|
1692
|
+
|
1693
|
+
// Check if the function scheduled an exception.
|
1694
|
+
bind(&leave_exit_frame);
|
1695
|
+
LoadRoot(r4, Heap::kTheHoleValueRootIndex);
|
1696
|
+
mov(ip, Operand(ExternalReference::scheduled_exception_address()));
|
1697
|
+
ldr(r5, MemOperand(ip));
|
1698
|
+
cmp(r4, r5);
|
1699
|
+
b(ne, &promote_scheduled_exception);
|
1700
|
+
|
1701
|
+
// LeaveExitFrame expects unwind space to be in a register.
|
1702
|
+
mov(r4, Operand(stack_space));
|
1703
|
+
LeaveExitFrame(false, r4);
|
1704
|
+
mov(pc, lr);
|
1705
|
+
|
1706
|
+
bind(&promote_scheduled_exception);
|
1707
|
+
MaybeObject* result = TryTailCallExternalReference(
|
1708
|
+
ExternalReference(Runtime::kPromoteScheduledException), 0, 1);
|
1709
|
+
if (result->IsFailure()) {
|
1710
|
+
return result;
|
1711
|
+
}
|
1712
|
+
|
1713
|
+
// HandleScope limit has changed. Delete allocated extensions.
|
1714
|
+
bind(&delete_allocated_handles);
|
1715
|
+
str(r5, MemOperand(r7, kLimitOffset));
|
1716
|
+
mov(r4, r0);
|
1717
|
+
PrepareCallCFunction(0, r5);
|
1718
|
+
CallCFunction(ExternalReference::delete_handle_scope_extensions(), 0);
|
1719
|
+
mov(r0, r4);
|
1720
|
+
jmp(&leave_exit_frame);
|
1721
|
+
|
1722
|
+
return result;
|
1723
|
+
}
|
1724
|
+
|
1725
|
+
|
1726
|
+
void MacroAssembler::IllegalOperation(int num_arguments) {
|
1727
|
+
if (num_arguments > 0) {
|
1728
|
+
add(sp, sp, Operand(num_arguments * kPointerSize));
|
1729
|
+
}
|
1730
|
+
LoadRoot(r0, Heap::kUndefinedValueRootIndex);
|
1731
|
+
}
|
1732
|
+
|
1733
|
+
|
1734
|
+
void MacroAssembler::IndexFromHash(Register hash, Register index) {
|
1735
|
+
// If the hash field contains an array index pick it out. The assert checks
|
1736
|
+
// that the constants for the maximum number of digits for an array index
|
1737
|
+
// cached in the hash field and the number of bits reserved for it does not
|
1738
|
+
// conflict.
|
1739
|
+
ASSERT(TenToThe(String::kMaxCachedArrayIndexLength) <
|
1740
|
+
(1 << String::kArrayIndexValueBits));
|
1741
|
+
// We want the smi-tagged index in key. kArrayIndexValueMask has zeros in
|
1742
|
+
// the low kHashShift bits.
|
1743
|
+
STATIC_ASSERT(kSmiTag == 0);
|
1744
|
+
Ubfx(hash, hash, String::kHashShift, String::kArrayIndexValueBits);
|
1745
|
+
mov(index, Operand(hash, LSL, kSmiTagSize));
|
1746
|
+
}
|
1747
|
+
|
1748
|
+
|
1749
|
+
void MacroAssembler::IntegerToDoubleConversionWithVFP3(Register inReg,
|
1750
|
+
Register outHighReg,
|
1751
|
+
Register outLowReg) {
|
1752
|
+
// ARMv7 VFP3 instructions to implement integer to double conversion.
|
1753
|
+
mov(r7, Operand(inReg, ASR, kSmiTagSize));
|
1754
|
+
vmov(s15, r7);
|
1755
|
+
vcvt_f64_s32(d7, s15);
|
1756
|
+
vmov(outLowReg, outHighReg, d7);
|
1757
|
+
}
|
1758
|
+
|
1759
|
+
|
1760
|
+
void MacroAssembler::ObjectToDoubleVFPRegister(Register object,
|
1761
|
+
DwVfpRegister result,
|
1762
|
+
Register scratch1,
|
1763
|
+
Register scratch2,
|
1764
|
+
Register heap_number_map,
|
1765
|
+
SwVfpRegister scratch3,
|
1766
|
+
Label* not_number,
|
1767
|
+
ObjectToDoubleFlags flags) {
|
1768
|
+
Label done;
|
1769
|
+
if ((flags & OBJECT_NOT_SMI) == 0) {
|
1770
|
+
Label not_smi;
|
1771
|
+
JumpIfNotSmi(object, ¬_smi);
|
1772
|
+
// Remove smi tag and convert to double.
|
1773
|
+
mov(scratch1, Operand(object, ASR, kSmiTagSize));
|
1774
|
+
vmov(scratch3, scratch1);
|
1775
|
+
vcvt_f64_s32(result, scratch3);
|
1776
|
+
b(&done);
|
1777
|
+
bind(¬_smi);
|
1778
|
+
}
|
1779
|
+
// Check for heap number and load double value from it.
|
1780
|
+
ldr(scratch1, FieldMemOperand(object, HeapObject::kMapOffset));
|
1781
|
+
sub(scratch2, object, Operand(kHeapObjectTag));
|
1782
|
+
cmp(scratch1, heap_number_map);
|
1783
|
+
b(ne, not_number);
|
1784
|
+
if ((flags & AVOID_NANS_AND_INFINITIES) != 0) {
|
1785
|
+
// If exponent is all ones the number is either a NaN or +/-Infinity.
|
1786
|
+
ldr(scratch1, FieldMemOperand(object, HeapNumber::kExponentOffset));
|
1787
|
+
Sbfx(scratch1,
|
1788
|
+
scratch1,
|
1789
|
+
HeapNumber::kExponentShift,
|
1790
|
+
HeapNumber::kExponentBits);
|
1791
|
+
// All-one value sign extend to -1.
|
1792
|
+
cmp(scratch1, Operand(-1));
|
1793
|
+
b(eq, not_number);
|
1794
|
+
}
|
1795
|
+
vldr(result, scratch2, HeapNumber::kValueOffset);
|
1796
|
+
bind(&done);
|
1797
|
+
}
|
1798
|
+
|
1799
|
+
|
1800
|
+
void MacroAssembler::SmiToDoubleVFPRegister(Register smi,
|
1801
|
+
DwVfpRegister value,
|
1802
|
+
Register scratch1,
|
1803
|
+
SwVfpRegister scratch2) {
|
1804
|
+
mov(scratch1, Operand(smi, ASR, kSmiTagSize));
|
1805
|
+
vmov(scratch2, scratch1);
|
1806
|
+
vcvt_f64_s32(value, scratch2);
|
1807
|
+
}
|
1808
|
+
|
1809
|
+
|
1810
|
+
// Tries to get a signed int32 out of a double precision floating point heap
|
1811
|
+
// number. Rounds towards 0. Branch to 'not_int32' if the double is out of the
|
1812
|
+
// 32bits signed integer range.
|
1813
|
+
void MacroAssembler::ConvertToInt32(Register source,
|
1814
|
+
Register dest,
|
1815
|
+
Register scratch,
|
1816
|
+
Register scratch2,
|
1817
|
+
DwVfpRegister double_scratch,
|
1818
|
+
Label *not_int32) {
|
1819
|
+
if (CpuFeatures::IsSupported(VFP3)) {
|
1820
|
+
CpuFeatures::Scope scope(VFP3);
|
1821
|
+
sub(scratch, source, Operand(kHeapObjectTag));
|
1822
|
+
vldr(double_scratch, scratch, HeapNumber::kValueOffset);
|
1823
|
+
vcvt_s32_f64(double_scratch.low(), double_scratch);
|
1824
|
+
vmov(dest, double_scratch.low());
|
1825
|
+
// Signed vcvt instruction will saturate to the minimum (0x80000000) or
|
1826
|
+
// maximun (0x7fffffff) signed 32bits integer when the double is out of
|
1827
|
+
// range. When substracting one, the minimum signed integer becomes the
|
1828
|
+
// maximun signed integer.
|
1829
|
+
sub(scratch, dest, Operand(1));
|
1830
|
+
cmp(scratch, Operand(LONG_MAX - 1));
|
1831
|
+
// If equal then dest was LONG_MAX, if greater dest was LONG_MIN.
|
1832
|
+
b(ge, not_int32);
|
1833
|
+
} else {
|
1834
|
+
// This code is faster for doubles that are in the ranges -0x7fffffff to
|
1835
|
+
// -0x40000000 or 0x40000000 to 0x7fffffff. This corresponds almost to
|
1836
|
+
// the range of signed int32 values that are not Smis. Jumps to the label
|
1837
|
+
// 'not_int32' if the double isn't in the range -0x80000000.0 to
|
1838
|
+
// 0x80000000.0 (excluding the endpoints).
|
1839
|
+
Label right_exponent, done;
|
1840
|
+
// Get exponent word.
|
1841
|
+
ldr(scratch, FieldMemOperand(source, HeapNumber::kExponentOffset));
|
1842
|
+
// Get exponent alone in scratch2.
|
1843
|
+
Ubfx(scratch2,
|
1844
|
+
scratch,
|
1845
|
+
HeapNumber::kExponentShift,
|
1846
|
+
HeapNumber::kExponentBits);
|
1847
|
+
// Load dest with zero. We use this either for the final shift or
|
1848
|
+
// for the answer.
|
1849
|
+
mov(dest, Operand(0, RelocInfo::NONE));
|
1850
|
+
// Check whether the exponent matches a 32 bit signed int that is not a Smi.
|
1851
|
+
// A non-Smi integer is 1.xxx * 2^30 so the exponent is 30 (biased). This is
|
1852
|
+
// the exponent that we are fastest at and also the highest exponent we can
|
1853
|
+
// handle here.
|
1854
|
+
const uint32_t non_smi_exponent = HeapNumber::kExponentBias + 30;
|
1855
|
+
// The non_smi_exponent, 0x41d, is too big for ARM's immediate field so we
|
1856
|
+
// split it up to avoid a constant pool entry. You can't do that in general
|
1857
|
+
// for cmp because of the overflow flag, but we know the exponent is in the
|
1858
|
+
// range 0-2047 so there is no overflow.
|
1859
|
+
int fudge_factor = 0x400;
|
1860
|
+
sub(scratch2, scratch2, Operand(fudge_factor));
|
1861
|
+
cmp(scratch2, Operand(non_smi_exponent - fudge_factor));
|
1862
|
+
// If we have a match of the int32-but-not-Smi exponent then skip some
|
1863
|
+
// logic.
|
1864
|
+
b(eq, &right_exponent);
|
1865
|
+
// If the exponent is higher than that then go to slow case. This catches
|
1866
|
+
// numbers that don't fit in a signed int32, infinities and NaNs.
|
1867
|
+
b(gt, not_int32);
|
1868
|
+
|
1869
|
+
// We know the exponent is smaller than 30 (biased). If it is less than
|
1870
|
+
// 0 (biased) then the number is smaller in magnitude than 1.0 * 2^0, ie
|
1871
|
+
// it rounds to zero.
|
1872
|
+
const uint32_t zero_exponent = HeapNumber::kExponentBias + 0;
|
1873
|
+
sub(scratch2, scratch2, Operand(zero_exponent - fudge_factor), SetCC);
|
1874
|
+
// Dest already has a Smi zero.
|
1875
|
+
b(lt, &done);
|
1876
|
+
|
1877
|
+
// We have an exponent between 0 and 30 in scratch2. Subtract from 30 to
|
1878
|
+
// get how much to shift down.
|
1879
|
+
rsb(dest, scratch2, Operand(30));
|
1880
|
+
|
1881
|
+
bind(&right_exponent);
|
1882
|
+
// Get the top bits of the mantissa.
|
1883
|
+
and_(scratch2, scratch, Operand(HeapNumber::kMantissaMask));
|
1884
|
+
// Put back the implicit 1.
|
1885
|
+
orr(scratch2, scratch2, Operand(1 << HeapNumber::kExponentShift));
|
1886
|
+
// Shift up the mantissa bits to take up the space the exponent used to
|
1887
|
+
// take. We just orred in the implicit bit so that took care of one and
|
1888
|
+
// we want to leave the sign bit 0 so we subtract 2 bits from the shift
|
1889
|
+
// distance.
|
1890
|
+
const int shift_distance = HeapNumber::kNonMantissaBitsInTopWord - 2;
|
1891
|
+
mov(scratch2, Operand(scratch2, LSL, shift_distance));
|
1892
|
+
// Put sign in zero flag.
|
1893
|
+
tst(scratch, Operand(HeapNumber::kSignMask));
|
1894
|
+
// Get the second half of the double. For some exponents we don't
|
1895
|
+
// actually need this because the bits get shifted out again, but
|
1896
|
+
// it's probably slower to test than just to do it.
|
1897
|
+
ldr(scratch, FieldMemOperand(source, HeapNumber::kMantissaOffset));
|
1898
|
+
// Shift down 22 bits to get the last 10 bits.
|
1899
|
+
orr(scratch, scratch2, Operand(scratch, LSR, 32 - shift_distance));
|
1900
|
+
// Move down according to the exponent.
|
1901
|
+
mov(dest, Operand(scratch, LSR, dest));
|
1902
|
+
// Fix sign if sign bit was set.
|
1903
|
+
rsb(dest, dest, Operand(0, RelocInfo::NONE), LeaveCC, ne);
|
1904
|
+
bind(&done);
|
1905
|
+
}
|
1906
|
+
}
|
1907
|
+
|
1908
|
+
|
1909
|
+
void MacroAssembler::EmitVFPTruncate(VFPRoundingMode rounding_mode,
|
1910
|
+
SwVfpRegister result,
|
1911
|
+
DwVfpRegister double_input,
|
1912
|
+
Register scratch1,
|
1913
|
+
Register scratch2,
|
1914
|
+
CheckForInexactConversion check_inexact) {
|
1915
|
+
ASSERT(CpuFeatures::IsSupported(VFP3));
|
1916
|
+
CpuFeatures::Scope scope(VFP3);
|
1917
|
+
Register prev_fpscr = scratch1;
|
1918
|
+
Register scratch = scratch2;
|
1919
|
+
|
1920
|
+
int32_t check_inexact_conversion =
|
1921
|
+
(check_inexact == kCheckForInexactConversion) ? kVFPInexactExceptionBit : 0;
|
1922
|
+
|
1923
|
+
// Set custom FPCSR:
|
1924
|
+
// - Set rounding mode.
|
1925
|
+
// - Clear vfp cumulative exception flags.
|
1926
|
+
// - Make sure Flush-to-zero mode control bit is unset.
|
1927
|
+
vmrs(prev_fpscr);
|
1928
|
+
bic(scratch,
|
1929
|
+
prev_fpscr,
|
1930
|
+
Operand(kVFPExceptionMask |
|
1931
|
+
check_inexact_conversion |
|
1932
|
+
kVFPRoundingModeMask |
|
1933
|
+
kVFPFlushToZeroMask));
|
1934
|
+
// 'Round To Nearest' is encoded by 0b00 so no bits need to be set.
|
1935
|
+
if (rounding_mode != kRoundToNearest) {
|
1936
|
+
orr(scratch, scratch, Operand(rounding_mode));
|
1937
|
+
}
|
1938
|
+
vmsr(scratch);
|
1939
|
+
|
1940
|
+
// Convert the argument to an integer.
|
1941
|
+
vcvt_s32_f64(result,
|
1942
|
+
double_input,
|
1943
|
+
(rounding_mode == kRoundToZero) ? kDefaultRoundToZero
|
1944
|
+
: kFPSCRRounding);
|
1945
|
+
|
1946
|
+
// Retrieve FPSCR.
|
1947
|
+
vmrs(scratch);
|
1948
|
+
// Restore FPSCR.
|
1949
|
+
vmsr(prev_fpscr);
|
1950
|
+
// Check for vfp exceptions.
|
1951
|
+
tst(scratch, Operand(kVFPExceptionMask | check_inexact_conversion));
|
1952
|
+
}
|
1953
|
+
|
1954
|
+
|
1955
|
+
void MacroAssembler::GetLeastBitsFromSmi(Register dst,
|
1956
|
+
Register src,
|
1957
|
+
int num_least_bits) {
|
1958
|
+
if (CpuFeatures::IsSupported(ARMv7)) {
|
1959
|
+
ubfx(dst, src, kSmiTagSize, num_least_bits);
|
1960
|
+
} else {
|
1961
|
+
mov(dst, Operand(src, ASR, kSmiTagSize));
|
1962
|
+
and_(dst, dst, Operand((1 << num_least_bits) - 1));
|
1963
|
+
}
|
1964
|
+
}
|
1965
|
+
|
1966
|
+
|
1967
|
+
void MacroAssembler::GetLeastBitsFromInt32(Register dst,
|
1968
|
+
Register src,
|
1969
|
+
int num_least_bits) {
|
1970
|
+
and_(dst, src, Operand((1 << num_least_bits) - 1));
|
1971
|
+
}
|
1972
|
+
|
1973
|
+
|
1974
|
+
void MacroAssembler::CallRuntime(Runtime::Function* f, int num_arguments) {
|
1975
|
+
// All parameters are on the stack. r0 has the return value after call.
|
1976
|
+
|
1977
|
+
// If the expected number of arguments of the runtime function is
|
1978
|
+
// constant, we check that the actual number of arguments match the
|
1979
|
+
// expectation.
|
1980
|
+
if (f->nargs >= 0 && f->nargs != num_arguments) {
|
1981
|
+
IllegalOperation(num_arguments);
|
1982
|
+
return;
|
1983
|
+
}
|
1984
|
+
|
1985
|
+
// TODO(1236192): Most runtime routines don't need the number of
|
1986
|
+
// arguments passed in because it is constant. At some point we
|
1987
|
+
// should remove this need and make the runtime routine entry code
|
1988
|
+
// smarter.
|
1989
|
+
mov(r0, Operand(num_arguments));
|
1990
|
+
mov(r1, Operand(ExternalReference(f)));
|
1991
|
+
CEntryStub stub(1);
|
1992
|
+
CallStub(&stub);
|
1993
|
+
}
|
1994
|
+
|
1995
|
+
|
1996
|
+
void MacroAssembler::CallRuntime(Runtime::FunctionId fid, int num_arguments) {
|
1997
|
+
CallRuntime(Runtime::FunctionForId(fid), num_arguments);
|
1998
|
+
}
|
1999
|
+
|
2000
|
+
|
2001
|
+
void MacroAssembler::CallRuntimeSaveDoubles(Runtime::FunctionId id) {
|
2002
|
+
Runtime::Function* function = Runtime::FunctionForId(id);
|
2003
|
+
mov(r0, Operand(function->nargs));
|
2004
|
+
mov(r1, Operand(ExternalReference(function)));
|
2005
|
+
CEntryStub stub(1);
|
2006
|
+
stub.SaveDoubles();
|
2007
|
+
CallStub(&stub);
|
2008
|
+
}
|
2009
|
+
|
2010
|
+
|
2011
|
+
void MacroAssembler::CallExternalReference(const ExternalReference& ext,
|
2012
|
+
int num_arguments) {
|
2013
|
+
mov(r0, Operand(num_arguments));
|
2014
|
+
mov(r1, Operand(ext));
|
2015
|
+
|
2016
|
+
CEntryStub stub(1);
|
2017
|
+
CallStub(&stub);
|
2018
|
+
}
|
2019
|
+
|
2020
|
+
|
2021
|
+
void MacroAssembler::TailCallExternalReference(const ExternalReference& ext,
|
2022
|
+
int num_arguments,
|
2023
|
+
int result_size) {
|
2024
|
+
// TODO(1236192): Most runtime routines don't need the number of
|
2025
|
+
// arguments passed in because it is constant. At some point we
|
2026
|
+
// should remove this need and make the runtime routine entry code
|
2027
|
+
// smarter.
|
2028
|
+
mov(r0, Operand(num_arguments));
|
2029
|
+
JumpToExternalReference(ext);
|
2030
|
+
}
|
2031
|
+
|
2032
|
+
|
2033
|
+
MaybeObject* MacroAssembler::TryTailCallExternalReference(
|
2034
|
+
const ExternalReference& ext, int num_arguments, int result_size) {
|
2035
|
+
// TODO(1236192): Most runtime routines don't need the number of
|
2036
|
+
// arguments passed in because it is constant. At some point we
|
2037
|
+
// should remove this need and make the runtime routine entry code
|
2038
|
+
// smarter.
|
2039
|
+
mov(r0, Operand(num_arguments));
|
2040
|
+
return TryJumpToExternalReference(ext);
|
2041
|
+
}
|
2042
|
+
|
2043
|
+
|
2044
|
+
void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid,
|
2045
|
+
int num_arguments,
|
2046
|
+
int result_size) {
|
2047
|
+
TailCallExternalReference(ExternalReference(fid), num_arguments, result_size);
|
2048
|
+
}
|
2049
|
+
|
2050
|
+
|
2051
|
+
void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin) {
|
2052
|
+
#if defined(__thumb__)
|
2053
|
+
// Thumb mode builtin.
|
2054
|
+
ASSERT((reinterpret_cast<intptr_t>(builtin.address()) & 1) == 1);
|
2055
|
+
#endif
|
2056
|
+
mov(r1, Operand(builtin));
|
2057
|
+
CEntryStub stub(1);
|
2058
|
+
Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
|
2059
|
+
}
|
2060
|
+
|
2061
|
+
|
2062
|
+
MaybeObject* MacroAssembler::TryJumpToExternalReference(
|
2063
|
+
const ExternalReference& builtin) {
|
2064
|
+
#if defined(__thumb__)
|
2065
|
+
// Thumb mode builtin.
|
2066
|
+
ASSERT((reinterpret_cast<intptr_t>(builtin.address()) & 1) == 1);
|
2067
|
+
#endif
|
2068
|
+
mov(r1, Operand(builtin));
|
2069
|
+
CEntryStub stub(1);
|
2070
|
+
return TryTailCallStub(&stub);
|
2071
|
+
}
|
2072
|
+
|
2073
|
+
|
2074
|
+
void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id,
|
2075
|
+
InvokeJSFlags flags,
|
2076
|
+
PostCallGenerator* post_call_generator) {
|
2077
|
+
GetBuiltinEntry(r2, id);
|
2078
|
+
if (flags == CALL_JS) {
|
2079
|
+
Call(r2);
|
2080
|
+
if (post_call_generator != NULL) post_call_generator->Generate();
|
2081
|
+
} else {
|
2082
|
+
ASSERT(flags == JUMP_JS);
|
2083
|
+
Jump(r2);
|
2084
|
+
}
|
2085
|
+
}
|
2086
|
+
|
2087
|
+
|
2088
|
+
void MacroAssembler::GetBuiltinFunction(Register target,
|
2089
|
+
Builtins::JavaScript id) {
|
2090
|
+
// Load the builtins object into target register.
|
2091
|
+
ldr(target, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX)));
|
2092
|
+
ldr(target, FieldMemOperand(target, GlobalObject::kBuiltinsOffset));
|
2093
|
+
// Load the JavaScript builtin function from the builtins object.
|
2094
|
+
ldr(target, FieldMemOperand(target,
|
2095
|
+
JSBuiltinsObject::OffsetOfFunctionWithId(id)));
|
2096
|
+
}
|
2097
|
+
|
2098
|
+
|
2099
|
+
void MacroAssembler::GetBuiltinEntry(Register target, Builtins::JavaScript id) {
|
2100
|
+
ASSERT(!target.is(r1));
|
2101
|
+
GetBuiltinFunction(r1, id);
|
2102
|
+
// Load the code entry point from the builtins object.
|
2103
|
+
ldr(target, FieldMemOperand(r1, JSFunction::kCodeEntryOffset));
|
2104
|
+
}
|
2105
|
+
|
2106
|
+
|
2107
|
+
void MacroAssembler::SetCounter(StatsCounter* counter, int value,
|
2108
|
+
Register scratch1, Register scratch2) {
|
2109
|
+
if (FLAG_native_code_counters && counter->Enabled()) {
|
2110
|
+
mov(scratch1, Operand(value));
|
2111
|
+
mov(scratch2, Operand(ExternalReference(counter)));
|
2112
|
+
str(scratch1, MemOperand(scratch2));
|
2113
|
+
}
|
2114
|
+
}
|
2115
|
+
|
2116
|
+
|
2117
|
+
void MacroAssembler::IncrementCounter(StatsCounter* counter, int value,
|
2118
|
+
Register scratch1, Register scratch2) {
|
2119
|
+
ASSERT(value > 0);
|
2120
|
+
if (FLAG_native_code_counters && counter->Enabled()) {
|
2121
|
+
mov(scratch2, Operand(ExternalReference(counter)));
|
2122
|
+
ldr(scratch1, MemOperand(scratch2));
|
2123
|
+
add(scratch1, scratch1, Operand(value));
|
2124
|
+
str(scratch1, MemOperand(scratch2));
|
2125
|
+
}
|
2126
|
+
}
|
2127
|
+
|
2128
|
+
|
2129
|
+
void MacroAssembler::DecrementCounter(StatsCounter* counter, int value,
|
2130
|
+
Register scratch1, Register scratch2) {
|
2131
|
+
ASSERT(value > 0);
|
2132
|
+
if (FLAG_native_code_counters && counter->Enabled()) {
|
2133
|
+
mov(scratch2, Operand(ExternalReference(counter)));
|
2134
|
+
ldr(scratch1, MemOperand(scratch2));
|
2135
|
+
sub(scratch1, scratch1, Operand(value));
|
2136
|
+
str(scratch1, MemOperand(scratch2));
|
2137
|
+
}
|
2138
|
+
}
|
2139
|
+
|
2140
|
+
|
2141
|
+
void MacroAssembler::Assert(Condition cond, const char* msg) {
|
2142
|
+
if (FLAG_debug_code)
|
2143
|
+
Check(cond, msg);
|
2144
|
+
}
|
2145
|
+
|
2146
|
+
|
2147
|
+
void MacroAssembler::AssertRegisterIsRoot(Register reg,
|
2148
|
+
Heap::RootListIndex index) {
|
2149
|
+
if (FLAG_debug_code) {
|
2150
|
+
LoadRoot(ip, index);
|
2151
|
+
cmp(reg, ip);
|
2152
|
+
Check(eq, "Register did not match expected root");
|
2153
|
+
}
|
2154
|
+
}
|
2155
|
+
|
2156
|
+
|
2157
|
+
void MacroAssembler::AssertFastElements(Register elements) {
|
2158
|
+
if (FLAG_debug_code) {
|
2159
|
+
ASSERT(!elements.is(ip));
|
2160
|
+
Label ok;
|
2161
|
+
push(elements);
|
2162
|
+
ldr(elements, FieldMemOperand(elements, HeapObject::kMapOffset));
|
2163
|
+
LoadRoot(ip, Heap::kFixedArrayMapRootIndex);
|
2164
|
+
cmp(elements, ip);
|
2165
|
+
b(eq, &ok);
|
2166
|
+
LoadRoot(ip, Heap::kFixedCOWArrayMapRootIndex);
|
2167
|
+
cmp(elements, ip);
|
2168
|
+
b(eq, &ok);
|
2169
|
+
Abort("JSObject with fast elements map has slow elements");
|
2170
|
+
bind(&ok);
|
2171
|
+
pop(elements);
|
2172
|
+
}
|
2173
|
+
}
|
2174
|
+
|
2175
|
+
|
2176
|
+
void MacroAssembler::Check(Condition cond, const char* msg) {
|
2177
|
+
Label L;
|
2178
|
+
b(cond, &L);
|
2179
|
+
Abort(msg);
|
2180
|
+
// will not return here
|
2181
|
+
bind(&L);
|
2182
|
+
}
|
2183
|
+
|
2184
|
+
|
2185
|
+
void MacroAssembler::Abort(const char* msg) {
|
2186
|
+
Label abort_start;
|
2187
|
+
bind(&abort_start);
|
2188
|
+
// We want to pass the msg string like a smi to avoid GC
|
2189
|
+
// problems, however msg is not guaranteed to be aligned
|
2190
|
+
// properly. Instead, we pass an aligned pointer that is
|
2191
|
+
// a proper v8 smi, but also pass the alignment difference
|
2192
|
+
// from the real pointer as a smi.
|
2193
|
+
intptr_t p1 = reinterpret_cast<intptr_t>(msg);
|
2194
|
+
intptr_t p0 = (p1 & ~kSmiTagMask) + kSmiTag;
|
2195
|
+
ASSERT(reinterpret_cast<Object*>(p0)->IsSmi());
|
2196
|
+
#ifdef DEBUG
|
2197
|
+
if (msg != NULL) {
|
2198
|
+
RecordComment("Abort message: ");
|
2199
|
+
RecordComment(msg);
|
2200
|
+
}
|
2201
|
+
#endif
|
2202
|
+
// Disable stub call restrictions to always allow calls to abort.
|
2203
|
+
AllowStubCallsScope allow_scope(this, true);
|
2204
|
+
|
2205
|
+
mov(r0, Operand(p0));
|
2206
|
+
push(r0);
|
2207
|
+
mov(r0, Operand(Smi::FromInt(p1 - p0)));
|
2208
|
+
push(r0);
|
2209
|
+
CallRuntime(Runtime::kAbort, 2);
|
2210
|
+
// will not return here
|
2211
|
+
if (is_const_pool_blocked()) {
|
2212
|
+
// If the calling code cares about the exact number of
|
2213
|
+
// instructions generated, we insert padding here to keep the size
|
2214
|
+
// of the Abort macro constant.
|
2215
|
+
static const int kExpectedAbortInstructions = 10;
|
2216
|
+
int abort_instructions = InstructionsGeneratedSince(&abort_start);
|
2217
|
+
ASSERT(abort_instructions <= kExpectedAbortInstructions);
|
2218
|
+
while (abort_instructions++ < kExpectedAbortInstructions) {
|
2219
|
+
nop();
|
2220
|
+
}
|
2221
|
+
}
|
2222
|
+
}
|
2223
|
+
|
2224
|
+
|
2225
|
+
void MacroAssembler::LoadContext(Register dst, int context_chain_length) {
|
2226
|
+
if (context_chain_length > 0) {
|
2227
|
+
// Move up the chain of contexts to the context containing the slot.
|
2228
|
+
ldr(dst, MemOperand(cp, Context::SlotOffset(Context::CLOSURE_INDEX)));
|
2229
|
+
// Load the function context (which is the incoming, outer context).
|
2230
|
+
ldr(dst, FieldMemOperand(dst, JSFunction::kContextOffset));
|
2231
|
+
for (int i = 1; i < context_chain_length; i++) {
|
2232
|
+
ldr(dst, MemOperand(dst, Context::SlotOffset(Context::CLOSURE_INDEX)));
|
2233
|
+
ldr(dst, FieldMemOperand(dst, JSFunction::kContextOffset));
|
2234
|
+
}
|
2235
|
+
} else {
|
2236
|
+
// Slot is in the current function context. Move it into the
|
2237
|
+
// destination register in case we store into it (the write barrier
|
2238
|
+
// cannot be allowed to destroy the context in esi).
|
2239
|
+
mov(dst, cp);
|
2240
|
+
}
|
2241
|
+
|
2242
|
+
// We should not have found a 'with' context by walking the context chain
|
2243
|
+
// (i.e., the static scope chain and runtime context chain do not agree).
|
2244
|
+
// A variable occurring in such a scope should have slot type LOOKUP and
|
2245
|
+
// not CONTEXT.
|
2246
|
+
if (FLAG_debug_code) {
|
2247
|
+
ldr(ip, MemOperand(dst, Context::SlotOffset(Context::FCONTEXT_INDEX)));
|
2248
|
+
cmp(dst, ip);
|
2249
|
+
Check(eq, "Yo dawg, I heard you liked function contexts "
|
2250
|
+
"so I put function contexts in all your contexts");
|
2251
|
+
}
|
2252
|
+
}
|
2253
|
+
|
2254
|
+
|
2255
|
+
void MacroAssembler::LoadGlobalFunction(int index, Register function) {
|
2256
|
+
// Load the global or builtins object from the current context.
|
2257
|
+
ldr(function, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX)));
|
2258
|
+
// Load the global context from the global or builtins object.
|
2259
|
+
ldr(function, FieldMemOperand(function,
|
2260
|
+
GlobalObject::kGlobalContextOffset));
|
2261
|
+
// Load the function from the global context.
|
2262
|
+
ldr(function, MemOperand(function, Context::SlotOffset(index)));
|
2263
|
+
}
|
2264
|
+
|
2265
|
+
|
2266
|
+
void MacroAssembler::LoadGlobalFunctionInitialMap(Register function,
|
2267
|
+
Register map,
|
2268
|
+
Register scratch) {
|
2269
|
+
// Load the initial map. The global functions all have initial maps.
|
2270
|
+
ldr(map, FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset));
|
2271
|
+
if (FLAG_debug_code) {
|
2272
|
+
Label ok, fail;
|
2273
|
+
CheckMap(map, scratch, Heap::kMetaMapRootIndex, &fail, false);
|
2274
|
+
b(&ok);
|
2275
|
+
bind(&fail);
|
2276
|
+
Abort("Global functions must have initial map");
|
2277
|
+
bind(&ok);
|
2278
|
+
}
|
2279
|
+
}
|
2280
|
+
|
2281
|
+
|
2282
|
+
void MacroAssembler::JumpIfNotPowerOfTwoOrZero(
|
2283
|
+
Register reg,
|
2284
|
+
Register scratch,
|
2285
|
+
Label* not_power_of_two_or_zero) {
|
2286
|
+
sub(scratch, reg, Operand(1), SetCC);
|
2287
|
+
b(mi, not_power_of_two_or_zero);
|
2288
|
+
tst(scratch, reg);
|
2289
|
+
b(ne, not_power_of_two_or_zero);
|
2290
|
+
}
|
2291
|
+
|
2292
|
+
|
2293
|
+
void MacroAssembler::JumpIfNotBothSmi(Register reg1,
|
2294
|
+
Register reg2,
|
2295
|
+
Label* on_not_both_smi) {
|
2296
|
+
STATIC_ASSERT(kSmiTag == 0);
|
2297
|
+
tst(reg1, Operand(kSmiTagMask));
|
2298
|
+
tst(reg2, Operand(kSmiTagMask), eq);
|
2299
|
+
b(ne, on_not_both_smi);
|
2300
|
+
}
|
2301
|
+
|
2302
|
+
|
2303
|
+
void MacroAssembler::JumpIfEitherSmi(Register reg1,
|
2304
|
+
Register reg2,
|
2305
|
+
Label* on_either_smi) {
|
2306
|
+
STATIC_ASSERT(kSmiTag == 0);
|
2307
|
+
tst(reg1, Operand(kSmiTagMask));
|
2308
|
+
tst(reg2, Operand(kSmiTagMask), ne);
|
2309
|
+
b(eq, on_either_smi);
|
2310
|
+
}
|
2311
|
+
|
2312
|
+
|
2313
|
+
void MacroAssembler::AbortIfSmi(Register object) {
|
2314
|
+
STATIC_ASSERT(kSmiTag == 0);
|
2315
|
+
tst(object, Operand(kSmiTagMask));
|
2316
|
+
Assert(ne, "Operand is a smi");
|
2317
|
+
}
|
2318
|
+
|
2319
|
+
|
2320
|
+
void MacroAssembler::AbortIfNotSmi(Register object) {
|
2321
|
+
STATIC_ASSERT(kSmiTag == 0);
|
2322
|
+
tst(object, Operand(kSmiTagMask));
|
2323
|
+
Assert(eq, "Operand is not smi");
|
2324
|
+
}
|
2325
|
+
|
2326
|
+
|
2327
|
+
void MacroAssembler::AbortIfNotString(Register object) {
|
2328
|
+
STATIC_ASSERT(kSmiTag == 0);
|
2329
|
+
tst(object, Operand(kSmiTagMask));
|
2330
|
+
Assert(ne, "Operand is not a string");
|
2331
|
+
push(object);
|
2332
|
+
ldr(object, FieldMemOperand(object, HeapObject::kMapOffset));
|
2333
|
+
CompareInstanceType(object, object, FIRST_NONSTRING_TYPE);
|
2334
|
+
pop(object);
|
2335
|
+
Assert(lo, "Operand is not a string");
|
2336
|
+
}
|
2337
|
+
|
2338
|
+
|
2339
|
+
|
2340
|
+
void MacroAssembler::AbortIfNotRootValue(Register src,
|
2341
|
+
Heap::RootListIndex root_value_index,
|
2342
|
+
const char* message) {
|
2343
|
+
ASSERT(!src.is(ip));
|
2344
|
+
LoadRoot(ip, root_value_index);
|
2345
|
+
cmp(src, ip);
|
2346
|
+
Assert(eq, message);
|
2347
|
+
}
|
2348
|
+
|
2349
|
+
|
2350
|
+
void MacroAssembler::JumpIfNotHeapNumber(Register object,
|
2351
|
+
Register heap_number_map,
|
2352
|
+
Register scratch,
|
2353
|
+
Label* on_not_heap_number) {
|
2354
|
+
ldr(scratch, FieldMemOperand(object, HeapObject::kMapOffset));
|
2355
|
+
AssertRegisterIsRoot(heap_number_map, Heap::kHeapNumberMapRootIndex);
|
2356
|
+
cmp(scratch, heap_number_map);
|
2357
|
+
b(ne, on_not_heap_number);
|
2358
|
+
}
|
2359
|
+
|
2360
|
+
|
2361
|
+
void MacroAssembler::JumpIfNonSmisNotBothSequentialAsciiStrings(
|
2362
|
+
Register first,
|
2363
|
+
Register second,
|
2364
|
+
Register scratch1,
|
2365
|
+
Register scratch2,
|
2366
|
+
Label* failure) {
|
2367
|
+
// Test that both first and second are sequential ASCII strings.
|
2368
|
+
// Assume that they are non-smis.
|
2369
|
+
ldr(scratch1, FieldMemOperand(first, HeapObject::kMapOffset));
|
2370
|
+
ldr(scratch2, FieldMemOperand(second, HeapObject::kMapOffset));
|
2371
|
+
ldrb(scratch1, FieldMemOperand(scratch1, Map::kInstanceTypeOffset));
|
2372
|
+
ldrb(scratch2, FieldMemOperand(scratch2, Map::kInstanceTypeOffset));
|
2373
|
+
|
2374
|
+
JumpIfBothInstanceTypesAreNotSequentialAscii(scratch1,
|
2375
|
+
scratch2,
|
2376
|
+
scratch1,
|
2377
|
+
scratch2,
|
2378
|
+
failure);
|
2379
|
+
}
|
2380
|
+
|
2381
|
+
void MacroAssembler::JumpIfNotBothSequentialAsciiStrings(Register first,
|
2382
|
+
Register second,
|
2383
|
+
Register scratch1,
|
2384
|
+
Register scratch2,
|
2385
|
+
Label* failure) {
|
2386
|
+
// Check that neither is a smi.
|
2387
|
+
STATIC_ASSERT(kSmiTag == 0);
|
2388
|
+
and_(scratch1, first, Operand(second));
|
2389
|
+
tst(scratch1, Operand(kSmiTagMask));
|
2390
|
+
b(eq, failure);
|
2391
|
+
JumpIfNonSmisNotBothSequentialAsciiStrings(first,
|
2392
|
+
second,
|
2393
|
+
scratch1,
|
2394
|
+
scratch2,
|
2395
|
+
failure);
|
2396
|
+
}
|
2397
|
+
|
2398
|
+
|
2399
|
+
// Allocates a heap number or jumps to the need_gc label if the young space
|
2400
|
+
// is full and a scavenge is needed.
|
2401
|
+
void MacroAssembler::AllocateHeapNumber(Register result,
|
2402
|
+
Register scratch1,
|
2403
|
+
Register scratch2,
|
2404
|
+
Register heap_number_map,
|
2405
|
+
Label* gc_required) {
|
2406
|
+
// Allocate an object in the heap for the heap number and tag it as a heap
|
2407
|
+
// object.
|
2408
|
+
AllocateInNewSpace(HeapNumber::kSize,
|
2409
|
+
result,
|
2410
|
+
scratch1,
|
2411
|
+
scratch2,
|
2412
|
+
gc_required,
|
2413
|
+
TAG_OBJECT);
|
2414
|
+
|
2415
|
+
// Store heap number map in the allocated object.
|
2416
|
+
AssertRegisterIsRoot(heap_number_map, Heap::kHeapNumberMapRootIndex);
|
2417
|
+
str(heap_number_map, FieldMemOperand(result, HeapObject::kMapOffset));
|
2418
|
+
}
|
2419
|
+
|
2420
|
+
|
2421
|
+
void MacroAssembler::AllocateHeapNumberWithValue(Register result,
|
2422
|
+
DwVfpRegister value,
|
2423
|
+
Register scratch1,
|
2424
|
+
Register scratch2,
|
2425
|
+
Register heap_number_map,
|
2426
|
+
Label* gc_required) {
|
2427
|
+
AllocateHeapNumber(result, scratch1, scratch2, heap_number_map, gc_required);
|
2428
|
+
sub(scratch1, result, Operand(kHeapObjectTag));
|
2429
|
+
vstr(value, scratch1, HeapNumber::kValueOffset);
|
2430
|
+
}
|
2431
|
+
|
2432
|
+
|
2433
|
+
// Copies a fixed number of fields of heap objects from src to dst.
|
2434
|
+
void MacroAssembler::CopyFields(Register dst,
|
2435
|
+
Register src,
|
2436
|
+
RegList temps,
|
2437
|
+
int field_count) {
|
2438
|
+
// At least one bit set in the first 15 registers.
|
2439
|
+
ASSERT((temps & ((1 << 15) - 1)) != 0);
|
2440
|
+
ASSERT((temps & dst.bit()) == 0);
|
2441
|
+
ASSERT((temps & src.bit()) == 0);
|
2442
|
+
// Primitive implementation using only one temporary register.
|
2443
|
+
|
2444
|
+
Register tmp = no_reg;
|
2445
|
+
// Find a temp register in temps list.
|
2446
|
+
for (int i = 0; i < 15; i++) {
|
2447
|
+
if ((temps & (1 << i)) != 0) {
|
2448
|
+
tmp.set_code(i);
|
2449
|
+
break;
|
2450
|
+
}
|
2451
|
+
}
|
2452
|
+
ASSERT(!tmp.is(no_reg));
|
2453
|
+
|
2454
|
+
for (int i = 0; i < field_count; i++) {
|
2455
|
+
ldr(tmp, FieldMemOperand(src, i * kPointerSize));
|
2456
|
+
str(tmp, FieldMemOperand(dst, i * kPointerSize));
|
2457
|
+
}
|
2458
|
+
}
|
2459
|
+
|
2460
|
+
|
2461
|
+
void MacroAssembler::CopyBytes(Register src,
|
2462
|
+
Register dst,
|
2463
|
+
Register length,
|
2464
|
+
Register scratch) {
|
2465
|
+
Label align_loop, align_loop_1, word_loop, byte_loop, byte_loop_1, done;
|
2466
|
+
|
2467
|
+
// Align src before copying in word size chunks.
|
2468
|
+
bind(&align_loop);
|
2469
|
+
cmp(length, Operand(0));
|
2470
|
+
b(eq, &done);
|
2471
|
+
bind(&align_loop_1);
|
2472
|
+
tst(src, Operand(kPointerSize - 1));
|
2473
|
+
b(eq, &word_loop);
|
2474
|
+
ldrb(scratch, MemOperand(src, 1, PostIndex));
|
2475
|
+
strb(scratch, MemOperand(dst, 1, PostIndex));
|
2476
|
+
sub(length, length, Operand(1), SetCC);
|
2477
|
+
b(ne, &byte_loop_1);
|
2478
|
+
|
2479
|
+
// Copy bytes in word size chunks.
|
2480
|
+
bind(&word_loop);
|
2481
|
+
if (FLAG_debug_code) {
|
2482
|
+
tst(src, Operand(kPointerSize - 1));
|
2483
|
+
Assert(eq, "Expecting alignment for CopyBytes");
|
2484
|
+
}
|
2485
|
+
cmp(length, Operand(kPointerSize));
|
2486
|
+
b(lt, &byte_loop);
|
2487
|
+
ldr(scratch, MemOperand(src, kPointerSize, PostIndex));
|
2488
|
+
#if CAN_USE_UNALIGNED_ACCESSES
|
2489
|
+
str(scratch, MemOperand(dst, kPointerSize, PostIndex));
|
2490
|
+
#else
|
2491
|
+
strb(scratch, MemOperand(dst, 1, PostIndex));
|
2492
|
+
mov(scratch, Operand(scratch, LSR, 8));
|
2493
|
+
strb(scratch, MemOperand(dst, 1, PostIndex));
|
2494
|
+
mov(scratch, Operand(scratch, LSR, 8));
|
2495
|
+
strb(scratch, MemOperand(dst, 1, PostIndex));
|
2496
|
+
mov(scratch, Operand(scratch, LSR, 8));
|
2497
|
+
strb(scratch, MemOperand(dst, 1, PostIndex));
|
2498
|
+
#endif
|
2499
|
+
sub(length, length, Operand(kPointerSize));
|
2500
|
+
b(&word_loop);
|
2501
|
+
|
2502
|
+
// Copy the last bytes if any left.
|
2503
|
+
bind(&byte_loop);
|
2504
|
+
cmp(length, Operand(0));
|
2505
|
+
b(eq, &done);
|
2506
|
+
bind(&byte_loop_1);
|
2507
|
+
ldrb(scratch, MemOperand(src, 1, PostIndex));
|
2508
|
+
strb(scratch, MemOperand(dst, 1, PostIndex));
|
2509
|
+
sub(length, length, Operand(1), SetCC);
|
2510
|
+
b(ne, &byte_loop_1);
|
2511
|
+
bind(&done);
|
2512
|
+
}
|
2513
|
+
|
2514
|
+
|
2515
|
+
void MacroAssembler::CountLeadingZeros(Register zeros, // Answer.
|
2516
|
+
Register source, // Input.
|
2517
|
+
Register scratch) {
|
2518
|
+
ASSERT(!zeros.is(source) || !source.is(scratch));
|
2519
|
+
ASSERT(!zeros.is(scratch));
|
2520
|
+
ASSERT(!scratch.is(ip));
|
2521
|
+
ASSERT(!source.is(ip));
|
2522
|
+
ASSERT(!zeros.is(ip));
|
2523
|
+
#ifdef CAN_USE_ARMV5_INSTRUCTIONS
|
2524
|
+
clz(zeros, source); // This instruction is only supported after ARM5.
|
2525
|
+
#else
|
2526
|
+
mov(zeros, Operand(0, RelocInfo::NONE));
|
2527
|
+
Move(scratch, source);
|
2528
|
+
// Top 16.
|
2529
|
+
tst(scratch, Operand(0xffff0000));
|
2530
|
+
add(zeros, zeros, Operand(16), LeaveCC, eq);
|
2531
|
+
mov(scratch, Operand(scratch, LSL, 16), LeaveCC, eq);
|
2532
|
+
// Top 8.
|
2533
|
+
tst(scratch, Operand(0xff000000));
|
2534
|
+
add(zeros, zeros, Operand(8), LeaveCC, eq);
|
2535
|
+
mov(scratch, Operand(scratch, LSL, 8), LeaveCC, eq);
|
2536
|
+
// Top 4.
|
2537
|
+
tst(scratch, Operand(0xf0000000));
|
2538
|
+
add(zeros, zeros, Operand(4), LeaveCC, eq);
|
2539
|
+
mov(scratch, Operand(scratch, LSL, 4), LeaveCC, eq);
|
2540
|
+
// Top 2.
|
2541
|
+
tst(scratch, Operand(0xc0000000));
|
2542
|
+
add(zeros, zeros, Operand(2), LeaveCC, eq);
|
2543
|
+
mov(scratch, Operand(scratch, LSL, 2), LeaveCC, eq);
|
2544
|
+
// Top bit.
|
2545
|
+
tst(scratch, Operand(0x80000000u));
|
2546
|
+
add(zeros, zeros, Operand(1), LeaveCC, eq);
|
2547
|
+
#endif
|
2548
|
+
}
|
2549
|
+
|
2550
|
+
|
2551
|
+
void MacroAssembler::JumpIfBothInstanceTypesAreNotSequentialAscii(
|
2552
|
+
Register first,
|
2553
|
+
Register second,
|
2554
|
+
Register scratch1,
|
2555
|
+
Register scratch2,
|
2556
|
+
Label* failure) {
|
2557
|
+
int kFlatAsciiStringMask =
|
2558
|
+
kIsNotStringMask | kStringEncodingMask | kStringRepresentationMask;
|
2559
|
+
int kFlatAsciiStringTag = ASCII_STRING_TYPE;
|
2560
|
+
and_(scratch1, first, Operand(kFlatAsciiStringMask));
|
2561
|
+
and_(scratch2, second, Operand(kFlatAsciiStringMask));
|
2562
|
+
cmp(scratch1, Operand(kFlatAsciiStringTag));
|
2563
|
+
// Ignore second test if first test failed.
|
2564
|
+
cmp(scratch2, Operand(kFlatAsciiStringTag), eq);
|
2565
|
+
b(ne, failure);
|
2566
|
+
}
|
2567
|
+
|
2568
|
+
|
2569
|
+
void MacroAssembler::JumpIfInstanceTypeIsNotSequentialAscii(Register type,
|
2570
|
+
Register scratch,
|
2571
|
+
Label* failure) {
|
2572
|
+
int kFlatAsciiStringMask =
|
2573
|
+
kIsNotStringMask | kStringEncodingMask | kStringRepresentationMask;
|
2574
|
+
int kFlatAsciiStringTag = ASCII_STRING_TYPE;
|
2575
|
+
and_(scratch, type, Operand(kFlatAsciiStringMask));
|
2576
|
+
cmp(scratch, Operand(kFlatAsciiStringTag));
|
2577
|
+
b(ne, failure);
|
2578
|
+
}
|
2579
|
+
|
2580
|
+
|
2581
|
+
void MacroAssembler::PrepareCallCFunction(int num_arguments, Register scratch) {
|
2582
|
+
int frame_alignment = ActivationFrameAlignment();
|
2583
|
+
// Up to four simple arguments are passed in registers r0..r3.
|
2584
|
+
int stack_passed_arguments = (num_arguments <= 4) ? 0 : num_arguments - 4;
|
2585
|
+
if (frame_alignment > kPointerSize) {
|
2586
|
+
// Make stack end at alignment and make room for num_arguments - 4 words
|
2587
|
+
// and the original value of sp.
|
2588
|
+
mov(scratch, sp);
|
2589
|
+
sub(sp, sp, Operand((stack_passed_arguments + 1) * kPointerSize));
|
2590
|
+
ASSERT(IsPowerOf2(frame_alignment));
|
2591
|
+
and_(sp, sp, Operand(-frame_alignment));
|
2592
|
+
str(scratch, MemOperand(sp, stack_passed_arguments * kPointerSize));
|
2593
|
+
} else {
|
2594
|
+
sub(sp, sp, Operand(stack_passed_arguments * kPointerSize));
|
2595
|
+
}
|
2596
|
+
}
|
2597
|
+
|
2598
|
+
|
2599
|
+
void MacroAssembler::CallCFunction(ExternalReference function,
|
2600
|
+
int num_arguments) {
|
2601
|
+
mov(ip, Operand(function));
|
2602
|
+
CallCFunction(ip, num_arguments);
|
2603
|
+
}
|
2604
|
+
|
2605
|
+
|
2606
|
+
void MacroAssembler::CallCFunction(Register function, int num_arguments) {
|
2607
|
+
// Make sure that the stack is aligned before calling a C function unless
|
2608
|
+
// running in the simulator. The simulator has its own alignment check which
|
2609
|
+
// provides more information.
|
2610
|
+
#if defined(V8_HOST_ARCH_ARM)
|
2611
|
+
if (FLAG_debug_code) {
|
2612
|
+
int frame_alignment = OS::ActivationFrameAlignment();
|
2613
|
+
int frame_alignment_mask = frame_alignment - 1;
|
2614
|
+
if (frame_alignment > kPointerSize) {
|
2615
|
+
ASSERT(IsPowerOf2(frame_alignment));
|
2616
|
+
Label alignment_as_expected;
|
2617
|
+
tst(sp, Operand(frame_alignment_mask));
|
2618
|
+
b(eq, &alignment_as_expected);
|
2619
|
+
// Don't use Check here, as it will call Runtime_Abort possibly
|
2620
|
+
// re-entering here.
|
2621
|
+
stop("Unexpected alignment");
|
2622
|
+
bind(&alignment_as_expected);
|
2623
|
+
}
|
2624
|
+
}
|
2625
|
+
#endif
|
2626
|
+
|
2627
|
+
// Just call directly. The function called cannot cause a GC, or
|
2628
|
+
// allow preemption, so the return address in the link register
|
2629
|
+
// stays correct.
|
2630
|
+
Call(function);
|
2631
|
+
int stack_passed_arguments = (num_arguments <= 4) ? 0 : num_arguments - 4;
|
2632
|
+
if (OS::ActivationFrameAlignment() > kPointerSize) {
|
2633
|
+
ldr(sp, MemOperand(sp, stack_passed_arguments * kPointerSize));
|
2634
|
+
} else {
|
2635
|
+
add(sp, sp, Operand(stack_passed_arguments * sizeof(kPointerSize)));
|
2636
|
+
}
|
2637
|
+
}
|
2638
|
+
|
2639
|
+
|
2640
|
+
void MacroAssembler::GetRelocatedValueLocation(Register ldr_location,
|
2641
|
+
Register result) {
|
2642
|
+
const uint32_t kLdrOffsetMask = (1 << 12) - 1;
|
2643
|
+
const int32_t kPCRegOffset = 2 * kPointerSize;
|
2644
|
+
ldr(result, MemOperand(ldr_location));
|
2645
|
+
if (FLAG_debug_code) {
|
2646
|
+
// Check that the instruction is a ldr reg, [pc + offset] .
|
2647
|
+
and_(result, result, Operand(kLdrPCPattern));
|
2648
|
+
cmp(result, Operand(kLdrPCPattern));
|
2649
|
+
Check(eq, "The instruction to patch should be a load from pc.");
|
2650
|
+
// Result was clobbered. Restore it.
|
2651
|
+
ldr(result, MemOperand(ldr_location));
|
2652
|
+
}
|
2653
|
+
// Get the address of the constant.
|
2654
|
+
and_(result, result, Operand(kLdrOffsetMask));
|
2655
|
+
add(result, ldr_location, Operand(result));
|
2656
|
+
add(result, result, Operand(kPCRegOffset));
|
2657
|
+
}
|
2658
|
+
|
2659
|
+
|
2660
|
+
CodePatcher::CodePatcher(byte* address, int instructions)
|
2661
|
+
: address_(address),
|
2662
|
+
instructions_(instructions),
|
2663
|
+
size_(instructions * Assembler::kInstrSize),
|
2664
|
+
masm_(address, size_ + Assembler::kGap) {
|
2665
|
+
// Create a new macro assembler pointing to the address of the code to patch.
|
2666
|
+
// The size is adjusted with kGap on order for the assembler to generate size
|
2667
|
+
// bytes of instructions without failing with buffer size constraints.
|
2668
|
+
ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap);
|
2669
|
+
}
|
2670
|
+
|
2671
|
+
|
2672
|
+
CodePatcher::~CodePatcher() {
|
2673
|
+
// Indicate that code has changed.
|
2674
|
+
CPU::FlushICache(address_, size_);
|
2675
|
+
|
2676
|
+
// Check that the code was patched as expected.
|
2677
|
+
ASSERT(masm_.pc_ == address_ + size_);
|
2678
|
+
ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap);
|
2679
|
+
}
|
2680
|
+
|
2681
|
+
|
2682
|
+
void CodePatcher::Emit(Instr instr) {
|
2683
|
+
masm()->emit(instr);
|
2684
|
+
}
|
2685
|
+
|
2686
|
+
|
2687
|
+
void CodePatcher::Emit(Address addr) {
|
2688
|
+
masm()->emit(reinterpret_cast<Instr>(addr));
|
2689
|
+
}
|
2690
|
+
|
2691
|
+
|
2692
|
+
void CodePatcher::EmitCondition(Condition cond) {
|
2693
|
+
Instr instr = Assembler::instr_at(masm_.pc_);
|
2694
|
+
instr = (instr & ~kCondMask) | cond;
|
2695
|
+
masm_.emit(instr);
|
2696
|
+
}
|
2697
|
+
|
2698
|
+
|
2699
|
+
} } // namespace v8::internal
|
2700
|
+
|
2701
|
+
#endif // V8_TARGET_ARCH_ARM
|