therubyracer 0.9.0beta2 → 0.9.0beta3
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/.gitmodules +3 -0
- data/ext/v8/upstream/Makefile +1 -2
- data/ext/v8/upstream/v8/.gitignore +33 -0
- data/ext/v8/upstream/v8/AUTHORS +42 -0
- data/ext/v8/upstream/v8/ChangeLog +2663 -0
- data/ext/v8/upstream/{3.1.8 → v8}/LICENSE +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/LICENSE.strongtalk +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/LICENSE.v8 +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/LICENSE.valgrind +0 -0
- data/ext/v8/upstream/v8/SConstruct +1473 -0
- data/ext/v8/upstream/{3.1.8 → v8}/build/README.txt +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/build/all.gyp +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/build/armu.gypi +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/build/common.gypi +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/build/gyp_v8 +0 -0
- data/ext/v8/upstream/v8/include/v8-debug.h +394 -0
- data/ext/v8/upstream/v8/include/v8-preparser.h +116 -0
- data/ext/v8/upstream/v8/include/v8-profiler.h +505 -0
- data/ext/v8/upstream/v8/include/v8-testing.h +104 -0
- data/ext/v8/upstream/v8/include/v8.h +4000 -0
- data/ext/v8/upstream/{3.1.8 → v8}/include/v8stdint.h +0 -0
- data/ext/v8/upstream/v8/preparser/SConscript +38 -0
- data/ext/v8/upstream/v8/preparser/preparser-process.cc +169 -0
- data/ext/v8/upstream/v8/src/SConscript +380 -0
- data/ext/v8/upstream/v8/src/accessors.cc +766 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/accessors.h +0 -0
- data/ext/v8/upstream/v8/src/allocation-inl.h +49 -0
- data/ext/v8/upstream/v8/src/allocation.cc +122 -0
- data/ext/v8/upstream/v8/src/allocation.h +143 -0
- data/ext/v8/upstream/v8/src/api.cc +5678 -0
- data/ext/v8/upstream/v8/src/api.h +572 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/apinatives.js +0 -0
- data/ext/v8/upstream/v8/src/apiutils.h +73 -0
- data/ext/v8/upstream/v8/src/arguments.h +116 -0
- data/ext/v8/upstream/v8/src/arm/assembler-arm-inl.h +353 -0
- data/ext/v8/upstream/v8/src/arm/assembler-arm.cc +2877 -0
- data/ext/v8/upstream/v8/src/arm/assembler-arm.h +1382 -0
- data/ext/v8/upstream/v8/src/arm/builtins-arm.cc +1634 -0
- data/ext/v8/upstream/v8/src/arm/code-stubs-arm.cc +6917 -0
- data/ext/v8/upstream/v8/src/arm/code-stubs-arm.h +623 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/arm/codegen-arm-inl.h +0 -0
- data/ext/v8/upstream/v8/src/arm/codegen-arm.cc +7437 -0
- data/ext/v8/upstream/v8/src/arm/codegen-arm.h +595 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/arm/constants-arm.cc +0 -0
- data/ext/v8/upstream/v8/src/arm/constants-arm.h +778 -0
- data/ext/v8/upstream/v8/src/arm/cpu-arm.cc +149 -0
- data/ext/v8/upstream/v8/src/arm/debug-arm.cc +317 -0
- data/ext/v8/upstream/v8/src/arm/deoptimizer-arm.cc +737 -0
- data/ext/v8/upstream/v8/src/arm/disasm-arm.cc +1503 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/arm/frames-arm.cc +0 -0
- data/ext/v8/upstream/v8/src/arm/frames-arm.h +168 -0
- data/ext/v8/upstream/v8/src/arm/full-codegen-arm.cc +4374 -0
- data/ext/v8/upstream/v8/src/arm/ic-arm.cc +1793 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/arm/jump-target-arm.cc +0 -0
- data/ext/v8/upstream/v8/src/arm/lithium-arm.cc +2120 -0
- data/ext/v8/upstream/v8/src/arm/lithium-arm.h +2179 -0
- data/ext/v8/upstream/v8/src/arm/lithium-codegen-arm.cc +4132 -0
- data/ext/v8/upstream/v8/src/arm/lithium-codegen-arm.h +329 -0
- data/ext/v8/upstream/v8/src/arm/lithium-gap-resolver-arm.cc +305 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/arm/lithium-gap-resolver-arm.h +0 -0
- data/ext/v8/upstream/v8/src/arm/macro-assembler-arm.cc +2939 -0
- data/ext/v8/upstream/v8/src/arm/macro-assembler-arm.h +1071 -0
- data/ext/v8/upstream/v8/src/arm/regexp-macro-assembler-arm.cc +1287 -0
- data/ext/v8/upstream/v8/src/arm/regexp-macro-assembler-arm.h +253 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/arm/register-allocator-arm-inl.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/arm/register-allocator-arm.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/arm/register-allocator-arm.h +0 -0
- data/ext/v8/upstream/v8/src/arm/simulator-arm.cc +3288 -0
- data/ext/v8/upstream/v8/src/arm/simulator-arm.h +413 -0
- data/ext/v8/upstream/v8/src/arm/stub-cache-arm.cc +4034 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/arm/virtual-frame-arm-inl.h +0 -0
- data/ext/v8/upstream/v8/src/arm/virtual-frame-arm.cc +843 -0
- data/ext/v8/upstream/v8/src/arm/virtual-frame-arm.h +523 -0
- data/ext/v8/upstream/v8/src/array.js +1249 -0
- data/ext/v8/upstream/v8/src/assembler.cc +1067 -0
- data/ext/v8/upstream/v8/src/assembler.h +823 -0
- data/ext/v8/upstream/v8/src/ast-inl.h +112 -0
- data/ext/v8/upstream/v8/src/ast.cc +1078 -0
- data/ext/v8/upstream/v8/src/ast.h +2234 -0
- data/ext/v8/upstream/v8/src/atomicops.h +167 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/atomicops_internals_arm_gcc.h +0 -0
- data/ext/v8/upstream/v8/src/atomicops_internals_mips_gcc.h +169 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/atomicops_internals_x86_gcc.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/atomicops_internals_x86_gcc.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/atomicops_internals_x86_macosx.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/atomicops_internals_x86_msvc.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/bignum-dtoa.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/bignum-dtoa.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/bignum.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/bignum.h +0 -0
- data/ext/v8/upstream/v8/src/bootstrapper.cc +2138 -0
- data/ext/v8/upstream/v8/src/bootstrapper.h +185 -0
- data/ext/v8/upstream/v8/src/builtins.cc +1708 -0
- data/ext/v8/upstream/v8/src/builtins.h +368 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/bytecodes-irregexp.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/cached-powers.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/cached-powers.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/char-predicates-inl.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/char-predicates.h +0 -0
- data/ext/v8/upstream/v8/src/checks.cc +110 -0
- data/ext/v8/upstream/v8/src/checks.h +296 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/circular-queue-inl.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/circular-queue.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/circular-queue.h +0 -0
- data/ext/v8/upstream/v8/src/code-stubs.cc +240 -0
- data/ext/v8/upstream/v8/src/code-stubs.h +971 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/code.h +0 -0
- data/ext/v8/upstream/v8/src/codegen-inl.h +68 -0
- data/ext/v8/upstream/v8/src/codegen.cc +505 -0
- data/ext/v8/upstream/v8/src/codegen.h +245 -0
- data/ext/v8/upstream/v8/src/compilation-cache.cc +540 -0
- data/ext/v8/upstream/v8/src/compilation-cache.h +287 -0
- data/ext/v8/upstream/v8/src/compiler.cc +792 -0
- data/ext/v8/upstream/v8/src/compiler.h +307 -0
- data/ext/v8/upstream/v8/src/contexts.cc +327 -0
- data/ext/v8/upstream/v8/src/contexts.h +382 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/conversions-inl.h +0 -0
- data/ext/v8/upstream/v8/src/conversions.cc +1125 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/conversions.h +0 -0
- data/ext/v8/upstream/v8/src/counters.cc +93 -0
- data/ext/v8/upstream/v8/src/counters.h +254 -0
- data/ext/v8/upstream/v8/src/cpu-profiler-inl.h +101 -0
- data/ext/v8/upstream/v8/src/cpu-profiler.cc +606 -0
- data/ext/v8/upstream/v8/src/cpu-profiler.h +305 -0
- data/ext/v8/upstream/v8/src/cpu.h +67 -0
- data/ext/v8/upstream/v8/src/d8-debug.cc +367 -0
- data/ext/v8/upstream/v8/src/d8-debug.h +158 -0
- data/ext/v8/upstream/v8/src/d8-posix.cc +695 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/d8-readline.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/d8-windows.cc +0 -0
- data/ext/v8/upstream/v8/src/d8.cc +796 -0
- data/ext/v8/upstream/v8/src/d8.gyp +88 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/d8.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/d8.js +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/data-flow.cc +0 -0
- data/ext/v8/upstream/v8/src/data-flow.h +379 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/date.js +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/dateparser-inl.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/dateparser.cc +0 -0
- data/ext/v8/upstream/v8/src/dateparser.h +265 -0
- data/ext/v8/upstream/v8/src/debug-agent.cc +447 -0
- data/ext/v8/upstream/v8/src/debug-agent.h +129 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/debug-debugger.js +0 -0
- data/ext/v8/upstream/v8/src/debug.cc +3188 -0
- data/ext/v8/upstream/v8/src/debug.h +1055 -0
- data/ext/v8/upstream/v8/src/deoptimizer.cc +1296 -0
- data/ext/v8/upstream/v8/src/deoptimizer.h +629 -0
- data/ext/v8/upstream/v8/src/disasm.h +80 -0
- data/ext/v8/upstream/v8/src/disassembler.cc +339 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/disassembler.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/diy-fp.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/diy-fp.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/double.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/dtoa.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/dtoa.h +0 -0
- data/ext/v8/upstream/v8/src/execution.cc +791 -0
- data/ext/v8/upstream/v8/src/execution.h +291 -0
- data/ext/v8/upstream/v8/src/extensions/experimental/break-iterator.cc +250 -0
- data/ext/v8/upstream/v8/src/extensions/experimental/break-iterator.h +89 -0
- data/ext/v8/upstream/v8/src/extensions/experimental/experimental.gyp +55 -0
- data/ext/v8/upstream/v8/src/extensions/experimental/i18n-extension.cc +284 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/extensions/experimental/i18n-extension.h +0 -0
- data/ext/v8/upstream/v8/src/extensions/externalize-string-extension.cc +141 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/extensions/externalize-string-extension.h +0 -0
- data/ext/v8/upstream/v8/src/extensions/gc-extension.cc +58 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/extensions/gc-extension.h +0 -0
- data/ext/v8/upstream/v8/src/factory.cc +1194 -0
- data/ext/v8/upstream/v8/src/factory.h +436 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/fast-dtoa.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/fast-dtoa.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/fixed-dtoa.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/fixed-dtoa.h +0 -0
- data/ext/v8/upstream/v8/src/flag-definitions.h +556 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/flags.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/flags.h +0 -0
- data/ext/v8/upstream/v8/src/frame-element.cc +37 -0
- data/ext/v8/upstream/v8/src/frame-element.h +269 -0
- data/ext/v8/upstream/v8/src/frames-inl.h +236 -0
- data/ext/v8/upstream/v8/src/frames.cc +1273 -0
- data/ext/v8/upstream/v8/src/frames.h +854 -0
- data/ext/v8/upstream/v8/src/full-codegen.cc +1385 -0
- data/ext/v8/upstream/v8/src/full-codegen.h +753 -0
- data/ext/v8/upstream/v8/src/func-name-inferrer.cc +91 -0
- data/ext/v8/upstream/v8/src/func-name-inferrer.h +111 -0
- data/ext/v8/upstream/v8/src/gdb-jit.cc +1548 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/gdb-jit.h +0 -0
- data/ext/v8/upstream/v8/src/global-handles.cc +596 -0
- data/ext/v8/upstream/v8/src/global-handles.h +239 -0
- data/ext/v8/upstream/v8/src/globals.h +325 -0
- data/ext/v8/upstream/v8/src/handles-inl.h +177 -0
- data/ext/v8/upstream/v8/src/handles.cc +965 -0
- data/ext/v8/upstream/v8/src/handles.h +372 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/hashmap.cc +0 -0
- data/ext/v8/upstream/v8/src/hashmap.h +121 -0
- data/ext/v8/upstream/v8/src/heap-inl.h +703 -0
- data/ext/v8/upstream/v8/src/heap-profiler.cc +1173 -0
- data/ext/v8/upstream/v8/src/heap-profiler.h +396 -0
- data/ext/v8/upstream/v8/src/heap.cc +5856 -0
- data/ext/v8/upstream/v8/src/heap.h +2264 -0
- data/ext/v8/upstream/v8/src/hydrogen-instructions.cc +1639 -0
- data/ext/v8/upstream/v8/src/hydrogen-instructions.h +3657 -0
- data/ext/v8/upstream/v8/src/hydrogen.cc +6011 -0
- data/ext/v8/upstream/v8/src/hydrogen.h +1137 -0
- data/ext/v8/upstream/v8/src/ia32/assembler-ia32-inl.h +430 -0
- data/ext/v8/upstream/v8/src/ia32/assembler-ia32.cc +2846 -0
- data/ext/v8/upstream/v8/src/ia32/assembler-ia32.h +1159 -0
- data/ext/v8/upstream/v8/src/ia32/builtins-ia32.cc +1596 -0
- data/ext/v8/upstream/v8/src/ia32/code-stubs-ia32.cc +6549 -0
- data/ext/v8/upstream/v8/src/ia32/code-stubs-ia32.h +495 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/codegen-ia32-inl.h +0 -0
- data/ext/v8/upstream/v8/src/ia32/codegen-ia32.cc +10385 -0
- data/ext/v8/upstream/v8/src/ia32/codegen-ia32.h +801 -0
- data/ext/v8/upstream/v8/src/ia32/cpu-ia32.cc +88 -0
- data/ext/v8/upstream/v8/src/ia32/debug-ia32.cc +312 -0
- data/ext/v8/upstream/v8/src/ia32/deoptimizer-ia32.cc +774 -0
- data/ext/v8/upstream/v8/src/ia32/disasm-ia32.cc +1620 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/frames-ia32.cc +0 -0
- data/ext/v8/upstream/v8/src/ia32/frames-ia32.h +140 -0
- data/ext/v8/upstream/v8/src/ia32/full-codegen-ia32.cc +4357 -0
- data/ext/v8/upstream/v8/src/ia32/ic-ia32.cc +1779 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/jump-target-ia32.cc +0 -0
- data/ext/v8/upstream/v8/src/ia32/lithium-codegen-ia32.cc +4158 -0
- data/ext/v8/upstream/v8/src/ia32/lithium-codegen-ia32.h +318 -0
- data/ext/v8/upstream/v8/src/ia32/lithium-gap-resolver-ia32.cc +466 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/lithium-gap-resolver-ia32.h +0 -0
- data/ext/v8/upstream/v8/src/ia32/lithium-ia32.cc +2181 -0
- data/ext/v8/upstream/v8/src/ia32/lithium-ia32.h +2235 -0
- data/ext/v8/upstream/v8/src/ia32/macro-assembler-ia32.cc +2056 -0
- data/ext/v8/upstream/v8/src/ia32/macro-assembler-ia32.h +807 -0
- data/ext/v8/upstream/v8/src/ia32/regexp-macro-assembler-ia32.cc +1264 -0
- data/ext/v8/upstream/v8/src/ia32/regexp-macro-assembler-ia32.h +216 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/register-allocator-ia32-inl.h +0 -0
- data/ext/v8/upstream/v8/src/ia32/register-allocator-ia32.cc +157 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/register-allocator-ia32.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/simulator-ia32.cc +0 -0
- data/ext/v8/upstream/v8/src/ia32/simulator-ia32.h +72 -0
- data/ext/v8/upstream/v8/src/ia32/stub-cache-ia32.cc +3711 -0
- data/ext/v8/upstream/v8/src/ia32/virtual-frame-ia32.cc +1366 -0
- data/ext/v8/upstream/v8/src/ia32/virtual-frame-ia32.h +650 -0
- data/ext/v8/upstream/v8/src/ic-inl.h +130 -0
- data/ext/v8/upstream/v8/src/ic.cc +2389 -0
- data/ext/v8/upstream/v8/src/ic.h +675 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/inspector.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/inspector.h +0 -0
- data/ext/v8/upstream/v8/src/interpreter-irregexp.cc +659 -0
- data/ext/v8/upstream/v8/src/interpreter-irregexp.h +49 -0
- data/ext/v8/upstream/v8/src/isolate.cc +883 -0
- data/ext/v8/upstream/v8/src/isolate.h +1306 -0
- data/ext/v8/upstream/v8/src/json.js +342 -0
- data/ext/v8/upstream/v8/src/jsregexp.cc +5371 -0
- data/ext/v8/upstream/v8/src/jsregexp.h +1483 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/jump-target-heavy-inl.h +0 -0
- data/ext/v8/upstream/v8/src/jump-target-heavy.cc +427 -0
- data/ext/v8/upstream/v8/src/jump-target-heavy.h +238 -0
- data/ext/v8/upstream/v8/src/jump-target-inl.h +48 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/jump-target-light-inl.h +0 -0
- data/ext/v8/upstream/v8/src/jump-target-light.cc +111 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/jump-target-light.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/jump-target.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/jump-target.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/list-inl.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/list.h +0 -0
- data/ext/v8/upstream/v8/src/lithium-allocator-inl.h +142 -0
- data/ext/v8/upstream/v8/src/lithium-allocator.cc +2105 -0
- data/ext/v8/upstream/v8/src/lithium-allocator.h +630 -0
- data/ext/v8/upstream/v8/src/lithium.cc +169 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/lithium.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/liveedit-debugger.js +0 -0
- data/ext/v8/upstream/v8/src/liveedit.cc +1693 -0
- data/ext/v8/upstream/v8/src/liveedit.h +179 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/liveobjectlist-inl.h +0 -0
- data/ext/v8/upstream/v8/src/liveobjectlist.cc +2589 -0
- data/ext/v8/upstream/v8/src/liveobjectlist.h +322 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/log-inl.h +0 -0
- data/ext/v8/upstream/v8/src/log-utils.cc +423 -0
- data/ext/v8/upstream/v8/src/log-utils.h +229 -0
- data/ext/v8/upstream/v8/src/log.cc +1666 -0
- data/ext/v8/upstream/v8/src/log.h +446 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/macro-assembler.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/macros.py +0 -0
- data/ext/v8/upstream/v8/src/mark-compact.cc +3092 -0
- data/ext/v8/upstream/v8/src/mark-compact.h +506 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/math.js +0 -0
- data/ext/v8/upstream/v8/src/messages.cc +166 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/messages.h +0 -0
- data/ext/v8/upstream/v8/src/messages.js +1090 -0
- data/ext/v8/upstream/v8/src/mips/assembler-mips-inl.h +335 -0
- data/ext/v8/upstream/v8/src/mips/assembler-mips.cc +2093 -0
- data/ext/v8/upstream/v8/src/mips/assembler-mips.h +1066 -0
- data/ext/v8/upstream/v8/src/mips/builtins-mips.cc +148 -0
- data/ext/v8/upstream/v8/src/mips/code-stubs-mips.cc +752 -0
- data/ext/v8/upstream/v8/src/mips/code-stubs-mips.h +511 -0
- data/ext/v8/upstream/v8/src/mips/codegen-mips-inl.h +64 -0
- data/ext/v8/upstream/v8/src/mips/codegen-mips.cc +1213 -0
- data/ext/v8/upstream/v8/src/mips/codegen-mips.h +633 -0
- data/ext/v8/upstream/v8/src/mips/constants-mips.cc +352 -0
- data/ext/v8/upstream/v8/src/mips/constants-mips.h +723 -0
- data/ext/v8/upstream/v8/src/mips/cpu-mips.cc +90 -0
- data/ext/v8/upstream/v8/src/mips/debug-mips.cc +155 -0
- data/ext/v8/upstream/v8/src/mips/deoptimizer-mips.cc +91 -0
- data/ext/v8/upstream/v8/src/mips/disasm-mips.cc +1023 -0
- data/ext/v8/upstream/v8/src/mips/frames-mips.cc +48 -0
- data/ext/v8/upstream/v8/src/mips/frames-mips.h +179 -0
- data/ext/v8/upstream/v8/src/mips/full-codegen-mips.cc +727 -0
- data/ext/v8/upstream/v8/src/mips/ic-mips.cc +244 -0
- data/ext/v8/upstream/v8/src/mips/jump-target-mips.cc +80 -0
- data/ext/v8/upstream/v8/src/mips/lithium-codegen-mips.h +65 -0
- data/ext/v8/upstream/v8/src/mips/lithium-mips.h +304 -0
- data/ext/v8/upstream/v8/src/mips/macro-assembler-mips.cc +3327 -0
- data/ext/v8/upstream/v8/src/mips/macro-assembler-mips.h +1058 -0
- data/ext/v8/upstream/v8/src/mips/regexp-macro-assembler-mips.cc +478 -0
- data/ext/v8/upstream/v8/src/mips/regexp-macro-assembler-mips.h +250 -0
- data/ext/v8/upstream/v8/src/mips/register-allocator-mips-inl.h +134 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/mips/register-allocator-mips.cc +0 -0
- data/ext/v8/upstream/v8/src/mips/register-allocator-mips.h +47 -0
- data/ext/v8/upstream/v8/src/mips/simulator-mips.cc +2438 -0
- data/ext/v8/upstream/v8/src/mips/simulator-mips.h +394 -0
- data/ext/v8/upstream/v8/src/mips/stub-cache-mips.cc +601 -0
- data/ext/v8/upstream/v8/src/mips/virtual-frame-mips-inl.h +58 -0
- data/ext/v8/upstream/v8/src/mips/virtual-frame-mips.cc +307 -0
- data/ext/v8/upstream/v8/src/mips/virtual-frame-mips.h +530 -0
- data/ext/v8/upstream/v8/src/mirror-debugger.js +2381 -0
- data/ext/v8/upstream/v8/src/mksnapshot.cc +256 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/natives.h +0 -0
- data/ext/v8/upstream/v8/src/objects-debug.cc +722 -0
- data/ext/v8/upstream/v8/src/objects-inl.h +4166 -0
- data/ext/v8/upstream/v8/src/objects-printer.cc +801 -0
- data/ext/v8/upstream/v8/src/objects-visiting.cc +142 -0
- data/ext/v8/upstream/v8/src/objects-visiting.h +422 -0
- data/ext/v8/upstream/v8/src/objects.cc +10296 -0
- data/ext/v8/upstream/v8/src/objects.h +6662 -0
- data/ext/v8/upstream/v8/src/parser.cc +5168 -0
- data/ext/v8/upstream/v8/src/parser.h +823 -0
- data/ext/v8/upstream/v8/src/platform-cygwin.cc +811 -0
- data/ext/v8/upstream/v8/src/platform-freebsd.cc +854 -0
- data/ext/v8/upstream/v8/src/platform-linux.cc +1120 -0
- data/ext/v8/upstream/v8/src/platform-macos.cc +865 -0
- data/ext/v8/upstream/v8/src/platform-nullos.cc +504 -0
- data/ext/v8/upstream/v8/src/platform-openbsd.cc +672 -0
- data/ext/v8/upstream/v8/src/platform-posix.cc +424 -0
- data/ext/v8/upstream/v8/src/platform-solaris.cc +796 -0
- data/ext/v8/upstream/v8/src/platform-tls-mac.h +62 -0
- data/ext/v8/upstream/v8/src/platform-tls-win32.h +62 -0
- data/ext/v8/upstream/v8/src/platform-tls.h +50 -0
- data/ext/v8/upstream/v8/src/platform-win32.cc +2072 -0
- data/ext/v8/upstream/v8/src/platform.h +693 -0
- data/ext/v8/upstream/v8/src/preparse-data.cc +185 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/preparse-data.h +0 -0
- data/ext/v8/upstream/v8/src/preparser-api.cc +219 -0
- data/ext/v8/upstream/v8/src/preparser.cc +1205 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/preparser.h +0 -0
- data/ext/v8/upstream/v8/src/prettyprinter.cc +1530 -0
- data/ext/v8/upstream/v8/src/prettyprinter.h +223 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/profile-generator-inl.h +0 -0
- data/ext/v8/upstream/v8/src/profile-generator.cc +3095 -0
- data/ext/v8/upstream/v8/src/profile-generator.h +1125 -0
- data/ext/v8/upstream/v8/src/property.cc +102 -0
- data/ext/v8/upstream/v8/src/property.h +348 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/regexp-macro-assembler-irregexp-inl.h +0 -0
- data/ext/v8/upstream/v8/src/regexp-macro-assembler-irregexp.cc +470 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/regexp-macro-assembler-irregexp.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/regexp-macro-assembler-tracer.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/regexp-macro-assembler-tracer.h +0 -0
- data/ext/v8/upstream/v8/src/regexp-macro-assembler.cc +266 -0
- data/ext/v8/upstream/v8/src/regexp-macro-assembler.h +236 -0
- data/ext/v8/upstream/v8/src/regexp-stack.cc +111 -0
- data/ext/v8/upstream/v8/src/regexp-stack.h +147 -0
- data/ext/v8/upstream/v8/src/regexp.js +483 -0
- data/ext/v8/upstream/v8/src/register-allocator-inl.h +141 -0
- data/ext/v8/upstream/v8/src/register-allocator.cc +98 -0
- data/ext/v8/upstream/v8/src/register-allocator.h +310 -0
- data/ext/v8/upstream/v8/src/rewriter.cc +1024 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/rewriter.h +0 -0
- data/ext/v8/upstream/v8/src/runtime-profiler.cc +478 -0
- data/ext/v8/upstream/v8/src/runtime-profiler.h +192 -0
- data/ext/v8/upstream/v8/src/runtime.cc +11949 -0
- data/ext/v8/upstream/v8/src/runtime.h +643 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/runtime.js +0 -0
- data/ext/v8/upstream/v8/src/safepoint-table.cc +256 -0
- data/ext/v8/upstream/v8/src/safepoint-table.h +269 -0
- data/ext/v8/upstream/v8/src/scanner-base.cc +964 -0
- data/ext/v8/upstream/v8/src/scanner-base.h +664 -0
- data/ext/v8/upstream/v8/src/scanner.cc +584 -0
- data/ext/v8/upstream/v8/src/scanner.h +196 -0
- data/ext/v8/upstream/v8/src/scopeinfo.cc +631 -0
- data/ext/v8/upstream/v8/src/scopeinfo.h +249 -0
- data/ext/v8/upstream/v8/src/scopes.cc +1093 -0
- data/ext/v8/upstream/v8/src/scopes.h +508 -0
- data/ext/v8/upstream/v8/src/serialize.cc +1574 -0
- data/ext/v8/upstream/v8/src/serialize.h +589 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/shell.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/simulator.h +0 -0
- data/ext/v8/upstream/v8/src/small-pointer-list.h +163 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/smart-pointer.h +0 -0
- data/ext/v8/upstream/v8/src/snapshot-common.cc +82 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/snapshot-empty.cc +0 -0
- data/ext/v8/upstream/v8/src/snapshot.h +73 -0
- data/ext/v8/upstream/v8/src/spaces-inl.h +529 -0
- data/ext/v8/upstream/v8/src/spaces.cc +3147 -0
- data/ext/v8/upstream/v8/src/spaces.h +2368 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/splay-tree-inl.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/splay-tree.h +0 -0
- data/ext/v8/upstream/v8/src/string-search.cc +41 -0
- data/ext/v8/upstream/v8/src/string-search.h +568 -0
- data/ext/v8/upstream/v8/src/string-stream.cc +592 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/string-stream.h +0 -0
- data/ext/v8/upstream/v8/src/string.js +915 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/strtod.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/strtod.h +0 -0
- data/ext/v8/upstream/v8/src/stub-cache.cc +1940 -0
- data/ext/v8/upstream/v8/src/stub-cache.h +866 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/third_party/valgrind/valgrind.h +0 -0
- data/ext/v8/upstream/v8/src/token.cc +63 -0
- data/ext/v8/upstream/v8/src/token.h +288 -0
- data/ext/v8/upstream/v8/src/top.cc +983 -0
- data/ext/v8/upstream/v8/src/type-info.cc +472 -0
- data/ext/v8/upstream/v8/src/type-info.h +290 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/unbound-queue-inl.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/unbound-queue.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/unicode-inl.h +0 -0
- data/ext/v8/upstream/v8/src/unicode.cc +1624 -0
- data/ext/v8/upstream/v8/src/unicode.h +280 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/uri.js +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/utils.cc +0 -0
- data/ext/v8/upstream/v8/src/utils.h +796 -0
- data/ext/v8/upstream/v8/src/v8-counters.cc +62 -0
- data/ext/v8/upstream/v8/src/v8-counters.h +311 -0
- data/ext/v8/upstream/v8/src/v8.cc +215 -0
- data/ext/v8/upstream/v8/src/v8.h +130 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/v8checks.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/v8dll-main.cc +0 -0
- data/ext/v8/upstream/v8/src/v8globals.h +486 -0
- data/ext/v8/upstream/{3.1.8/src/memory.h → v8/src/v8memory.h} +0 -0
- data/ext/v8/upstream/v8/src/v8natives.js +1293 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/v8preparserdll-main.cc +0 -0
- data/ext/v8/upstream/v8/src/v8threads.cc +453 -0
- data/ext/v8/upstream/v8/src/v8threads.h +164 -0
- data/ext/v8/upstream/v8/src/v8utils.h +317 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/variables.cc +0 -0
- data/ext/v8/upstream/v8/src/variables.h +212 -0
- data/ext/v8/upstream/v8/src/version.cc +116 -0
- data/ext/v8/upstream/v8/src/version.h +68 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/virtual-frame-heavy-inl.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/virtual-frame-heavy.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/virtual-frame-inl.h +0 -0
- data/ext/v8/upstream/v8/src/virtual-frame-light-inl.h +171 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/virtual-frame-light.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/virtual-frame.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/virtual-frame.h +0 -0
- data/ext/v8/upstream/v8/src/vm-state-inl.h +138 -0
- data/ext/v8/upstream/v8/src/vm-state.h +70 -0
- data/ext/v8/upstream/v8/src/win32-headers.h +96 -0
- data/ext/v8/upstream/v8/src/x64/assembler-x64-inl.h +456 -0
- data/ext/v8/upstream/v8/src/x64/assembler-x64.cc +2954 -0
- data/ext/v8/upstream/v8/src/x64/assembler-x64.h +1630 -0
- data/ext/v8/upstream/v8/src/x64/builtins-x64.cc +1493 -0
- data/ext/v8/upstream/v8/src/x64/code-stubs-x64.cc +5132 -0
- data/ext/v8/upstream/v8/src/x64/code-stubs-x64.h +477 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/x64/codegen-x64-inl.h +0 -0
- data/ext/v8/upstream/v8/src/x64/codegen-x64.cc +8843 -0
- data/ext/v8/upstream/v8/src/x64/codegen-x64.h +753 -0
- data/ext/v8/upstream/v8/src/x64/cpu-x64.cc +88 -0
- data/ext/v8/upstream/v8/src/x64/debug-x64.cc +318 -0
- data/ext/v8/upstream/v8/src/x64/deoptimizer-x64.cc +815 -0
- data/ext/v8/upstream/v8/src/x64/disasm-x64.cc +1752 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/x64/frames-x64.cc +0 -0
- data/ext/v8/upstream/v8/src/x64/frames-x64.h +130 -0
- data/ext/v8/upstream/v8/src/x64/full-codegen-x64.cc +4339 -0
- data/ext/v8/upstream/v8/src/x64/ic-x64.cc +1752 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/x64/jump-target-x64.cc +0 -0
- data/ext/v8/upstream/v8/src/x64/lithium-codegen-x64.cc +3970 -0
- data/ext/v8/upstream/v8/src/x64/lithium-codegen-x64.h +318 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/x64/lithium-gap-resolver-x64.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/x64/lithium-gap-resolver-x64.h +0 -0
- data/ext/v8/upstream/v8/src/x64/lithium-x64.cc +2115 -0
- data/ext/v8/upstream/v8/src/x64/lithium-x64.h +2161 -0
- data/ext/v8/upstream/v8/src/x64/macro-assembler-x64.cc +2911 -0
- data/ext/v8/upstream/v8/src/x64/macro-assembler-x64.h +1984 -0
- data/ext/v8/upstream/v8/src/x64/regexp-macro-assembler-x64.cc +1398 -0
- data/ext/v8/upstream/v8/src/x64/regexp-macro-assembler-x64.h +282 -0
- data/ext/v8/upstream/v8/src/x64/register-allocator-x64-inl.h +87 -0
- data/ext/v8/upstream/v8/src/x64/register-allocator-x64.cc +95 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/x64/register-allocator-x64.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/x64/simulator-x64.cc +0 -0
- data/ext/v8/upstream/v8/src/x64/simulator-x64.h +71 -0
- data/ext/v8/upstream/v8/src/x64/stub-cache-x64.cc +3460 -0
- data/ext/v8/upstream/v8/src/x64/virtual-frame-x64.cc +1296 -0
- data/ext/v8/upstream/v8/src/x64/virtual-frame-x64.h +597 -0
- data/ext/v8/upstream/v8/src/zone-inl.h +129 -0
- data/ext/v8/upstream/v8/src/zone.cc +196 -0
- data/ext/v8/upstream/v8/src/zone.h +236 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/codemap.js +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/consarray.js +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/csvparser.js +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/disasm.py +0 -0
- data/ext/v8/upstream/v8/tools/freebsd-tick-processor +10 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/gc-nvp-trace-processor.py +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/generate-ten-powers.scm +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/grokdump.py +0 -0
- data/ext/v8/upstream/v8/tools/gyp/v8.gyp +844 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/js2c.py +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/jsmin.py +0 -0
- data/ext/v8/upstream/v8/tools/linux-tick-processor +35 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/ll_prof.py +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/logreader.js +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/mac-nm +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/mac-tick-processor +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/oom_dump/README +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/oom_dump/SConstruct +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/oom_dump/oom_dump.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/presubmit.py +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/process-heap-prof.py +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/profile.js +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/profile_view.js +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/run-valgrind.py +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/splaytree.js +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/stats-viewer.py +0 -0
- data/ext/v8/upstream/v8/tools/test.py +1490 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/tickprocessor-driver.js +0 -0
- data/ext/v8/upstream/v8/tools/tickprocessor.js +877 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/utils.py +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/README.txt +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/arm.vsprops +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/common.vsprops +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/d8.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/d8_arm.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/d8_x64.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/d8js2c.cmd +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/debug.vsprops +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/ia32.vsprops +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/js2c.cmd +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/release.vsprops +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8.sln +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_arm.sln +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_arm.vcproj +0 -0
- data/ext/v8/upstream/v8/tools/visual_studio/v8_base.vcproj +1308 -0
- data/ext/v8/upstream/v8/tools/visual_studio/v8_base_arm.vcproj +1238 -0
- data/ext/v8/upstream/v8/tools/visual_studio/v8_base_x64.vcproj +1300 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_cctest.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_cctest_arm.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_cctest_x64.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_mksnapshot.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_mksnapshot_x64.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_process_sample.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_process_sample_arm.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_process_sample_x64.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_shell_sample.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_shell_sample_arm.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_shell_sample_x64.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_snapshot.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_snapshot_cc.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_snapshot_cc_x64.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_snapshot_x64.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_x64.sln +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_x64.vcproj +0 -0
- data/ext/v8/upstream/v8/tools/visual_studio/x64.vsprops +18 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/windows-tick-processor.bat +0 -0
- data/ext/v8/v8_callbacks.cpp +52 -92
- data/ext/v8/v8_date.cpp +2 -3
- data/ext/v8/v8_object.cpp +4 -0
- data/ext/v8/v8_template.cpp +2 -2
- data/ext/v8/v8_try_catch.cpp +8 -38
- data/lib/v8/version.rb +1 -1
- data/spec/ext/ext_spec_helper.rb +2 -20
- data/spec/ext/object_spec.rb +0 -12
- data/spec/ext/try_catch_spec.rb +29 -1
- data/spec/spec_helper.rb +1 -0
- data/spec/v8/portal/proxies_spec.rb +1 -84
- data/specmem/handle_memspec.rb +41 -0
- data/specmem/object_memspec.rb +16 -0
- data/specmem/proxies_memspec.rb +86 -0
- data/specmem/spec_helper.rb +24 -0
- data/therubyracer.gemspec +7 -2
- metadata +564 -541
- data/ext/v8/upstream/3.1.8/.gitignore +0 -31
- data/ext/v8/upstream/3.1.8/AUTHORS +0 -40
- data/ext/v8/upstream/3.1.8/ChangeLog +0 -2566
- data/ext/v8/upstream/3.1.8/SConstruct +0 -1192
- data/ext/v8/upstream/3.1.8/include/v8-debug.h +0 -384
- data/ext/v8/upstream/3.1.8/include/v8-preparser.h +0 -116
- data/ext/v8/upstream/3.1.8/include/v8-profiler.h +0 -426
- data/ext/v8/upstream/3.1.8/include/v8-testing.h +0 -99
- data/ext/v8/upstream/3.1.8/include/v8.h +0 -3846
- data/ext/v8/upstream/3.1.8/preparser/preparser-process.cc +0 -206
- data/ext/v8/upstream/3.1.8/src/SConscript +0 -356
- data/ext/v8/upstream/3.1.8/src/accessors.cc +0 -907
- data/ext/v8/upstream/3.1.8/src/allocation.cc +0 -204
- data/ext/v8/upstream/3.1.8/src/allocation.h +0 -176
- data/ext/v8/upstream/3.1.8/src/api.cc +0 -5191
- data/ext/v8/upstream/3.1.8/src/api.h +0 -508
- data/ext/v8/upstream/3.1.8/src/apiutils.h +0 -80
- data/ext/v8/upstream/3.1.8/src/arguments.h +0 -105
- data/ext/v8/upstream/3.1.8/src/arm/assembler-arm-inl.h +0 -352
- data/ext/v8/upstream/3.1.8/src/arm/assembler-arm.cc +0 -2756
- data/ext/v8/upstream/3.1.8/src/arm/assembler-arm.h +0 -1294
- data/ext/v8/upstream/3.1.8/src/arm/builtins-arm.cc +0 -1628
- data/ext/v8/upstream/3.1.8/src/arm/code-stubs-arm.cc +0 -6783
- data/ext/v8/upstream/3.1.8/src/arm/code-stubs-arm.h +0 -657
- data/ext/v8/upstream/3.1.8/src/arm/codegen-arm.cc +0 -7403
- data/ext/v8/upstream/3.1.8/src/arm/codegen-arm.h +0 -595
- data/ext/v8/upstream/3.1.8/src/arm/constants-arm.h +0 -769
- data/ext/v8/upstream/3.1.8/src/arm/cpu-arm.cc +0 -147
- data/ext/v8/upstream/3.1.8/src/arm/debug-arm.cc +0 -315
- data/ext/v8/upstream/3.1.8/src/arm/deoptimizer-arm.cc +0 -700
- data/ext/v8/upstream/3.1.8/src/arm/disasm-arm.cc +0 -1439
- data/ext/v8/upstream/3.1.8/src/arm/frames-arm.h +0 -168
- data/ext/v8/upstream/3.1.8/src/arm/full-codegen-arm.cc +0 -4230
- data/ext/v8/upstream/3.1.8/src/arm/ic-arm.cc +0 -1799
- data/ext/v8/upstream/3.1.8/src/arm/lithium-arm.cc +0 -2041
- data/ext/v8/upstream/3.1.8/src/arm/lithium-arm.h +0 -2046
- data/ext/v8/upstream/3.1.8/src/arm/lithium-codegen-arm.cc +0 -3822
- data/ext/v8/upstream/3.1.8/src/arm/lithium-codegen-arm.h +0 -312
- data/ext/v8/upstream/3.1.8/src/arm/lithium-gap-resolver-arm.cc +0 -303
- data/ext/v8/upstream/3.1.8/src/arm/macro-assembler-arm.cc +0 -2701
- data/ext/v8/upstream/3.1.8/src/arm/macro-assembler-arm.h +0 -1015
- data/ext/v8/upstream/3.1.8/src/arm/regexp-macro-assembler-arm.cc +0 -1280
- data/ext/v8/upstream/3.1.8/src/arm/regexp-macro-assembler-arm.h +0 -252
- data/ext/v8/upstream/3.1.8/src/arm/simulator-arm.cc +0 -3165
- data/ext/v8/upstream/3.1.8/src/arm/simulator-arm.h +0 -402
- data/ext/v8/upstream/3.1.8/src/arm/stub-cache-arm.cc +0 -4077
- data/ext/v8/upstream/3.1.8/src/arm/virtual-frame-arm.cc +0 -843
- data/ext/v8/upstream/3.1.8/src/arm/virtual-frame-arm.h +0 -520
- data/ext/v8/upstream/3.1.8/src/array.js +0 -1231
- data/ext/v8/upstream/3.1.8/src/assembler.cc +0 -973
- data/ext/v8/upstream/3.1.8/src/assembler.h +0 -787
- data/ext/v8/upstream/3.1.8/src/ast-inl.h +0 -107
- data/ext/v8/upstream/3.1.8/src/ast.cc +0 -1067
- data/ext/v8/upstream/3.1.8/src/ast.h +0 -2177
- data/ext/v8/upstream/3.1.8/src/atomicops.h +0 -165
- data/ext/v8/upstream/3.1.8/src/bootstrapper.cc +0 -1888
- data/ext/v8/upstream/3.1.8/src/bootstrapper.h +0 -118
- data/ext/v8/upstream/3.1.8/src/builtins.cc +0 -1586
- data/ext/v8/upstream/3.1.8/src/builtins.h +0 -339
- data/ext/v8/upstream/3.1.8/src/checks.cc +0 -110
- data/ext/v8/upstream/3.1.8/src/checks.h +0 -292
- data/ext/v8/upstream/3.1.8/src/code-stubs.cc +0 -230
- data/ext/v8/upstream/3.1.8/src/code-stubs.h +0 -950
- data/ext/v8/upstream/3.1.8/src/codegen-inl.h +0 -64
- data/ext/v8/upstream/3.1.8/src/codegen.cc +0 -495
- data/ext/v8/upstream/3.1.8/src/codegen.h +0 -245
- data/ext/v8/upstream/3.1.8/src/compilation-cache.cc +0 -654
- data/ext/v8/upstream/3.1.8/src/compilation-cache.h +0 -112
- data/ext/v8/upstream/3.1.8/src/compiler.cc +0 -806
- data/ext/v8/upstream/3.1.8/src/compiler.h +0 -290
- data/ext/v8/upstream/3.1.8/src/contexts.cc +0 -320
- data/ext/v8/upstream/3.1.8/src/contexts.h +0 -376
- data/ext/v8/upstream/3.1.8/src/conversions.cc +0 -1069
- data/ext/v8/upstream/3.1.8/src/counters.cc +0 -78
- data/ext/v8/upstream/3.1.8/src/counters.h +0 -242
- data/ext/v8/upstream/3.1.8/src/cpu-profiler-inl.h +0 -100
- data/ext/v8/upstream/3.1.8/src/cpu-profiler.cc +0 -554
- data/ext/v8/upstream/3.1.8/src/cpu-profiler.h +0 -291
- data/ext/v8/upstream/3.1.8/src/cpu.h +0 -65
- data/ext/v8/upstream/3.1.8/src/d8-debug.cc +0 -367
- data/ext/v8/upstream/3.1.8/src/d8-debug.h +0 -157
- data/ext/v8/upstream/3.1.8/src/d8-posix.cc +0 -693
- data/ext/v8/upstream/3.1.8/src/d8.cc +0 -792
- data/ext/v8/upstream/3.1.8/src/d8.gyp +0 -85
- data/ext/v8/upstream/3.1.8/src/data-flow.h +0 -379
- data/ext/v8/upstream/3.1.8/src/dateparser.h +0 -263
- data/ext/v8/upstream/3.1.8/src/debug-agent.cc +0 -446
- data/ext/v8/upstream/3.1.8/src/debug-agent.h +0 -131
- data/ext/v8/upstream/3.1.8/src/debug.cc +0 -3085
- data/ext/v8/upstream/3.1.8/src/debug.h +0 -1025
- data/ext/v8/upstream/3.1.8/src/deoptimizer.cc +0 -1185
- data/ext/v8/upstream/3.1.8/src/deoptimizer.h +0 -529
- data/ext/v8/upstream/3.1.8/src/disasm.h +0 -77
- data/ext/v8/upstream/3.1.8/src/disassembler.cc +0 -338
- data/ext/v8/upstream/3.1.8/src/execution.cc +0 -735
- data/ext/v8/upstream/3.1.8/src/execution.h +0 -322
- data/ext/v8/upstream/3.1.8/src/extensions/experimental/experimental.gyp +0 -53
- data/ext/v8/upstream/3.1.8/src/extensions/experimental/i18n-extension.cc +0 -264
- data/ext/v8/upstream/3.1.8/src/extensions/externalize-string-extension.cc +0 -141
- data/ext/v8/upstream/3.1.8/src/extensions/gc-extension.cc +0 -58
- data/ext/v8/upstream/3.1.8/src/factory.cc +0 -1087
- data/ext/v8/upstream/3.1.8/src/factory.h +0 -432
- data/ext/v8/upstream/3.1.8/src/flag-definitions.h +0 -552
- data/ext/v8/upstream/3.1.8/src/frame-element.cc +0 -42
- data/ext/v8/upstream/3.1.8/src/frame-element.h +0 -277
- data/ext/v8/upstream/3.1.8/src/frames-inl.h +0 -210
- data/ext/v8/upstream/3.1.8/src/frames.cc +0 -1232
- data/ext/v8/upstream/3.1.8/src/frames.h +0 -826
- data/ext/v8/upstream/3.1.8/src/full-codegen.cc +0 -1382
- data/ext/v8/upstream/3.1.8/src/full-codegen.h +0 -751
- data/ext/v8/upstream/3.1.8/src/func-name-inferrer.cc +0 -90
- data/ext/v8/upstream/3.1.8/src/func-name-inferrer.h +0 -111
- data/ext/v8/upstream/3.1.8/src/gdb-jit.cc +0 -1547
- data/ext/v8/upstream/3.1.8/src/global-handles.cc +0 -534
- data/ext/v8/upstream/3.1.8/src/global-handles.h +0 -181
- data/ext/v8/upstream/3.1.8/src/globals.h +0 -325
- data/ext/v8/upstream/3.1.8/src/handles-inl.h +0 -80
- data/ext/v8/upstream/3.1.8/src/handles.cc +0 -910
- data/ext/v8/upstream/3.1.8/src/handles.h +0 -424
- data/ext/v8/upstream/3.1.8/src/hashmap.h +0 -121
- data/ext/v8/upstream/3.1.8/src/heap-inl.h +0 -587
- data/ext/v8/upstream/3.1.8/src/heap-profiler.cc +0 -1128
- data/ext/v8/upstream/3.1.8/src/heap-profiler.h +0 -381
- data/ext/v8/upstream/3.1.8/src/heap.cc +0 -5610
- data/ext/v8/upstream/3.1.8/src/heap.h +0 -2218
- data/ext/v8/upstream/3.1.8/src/hydrogen-instructions.cc +0 -1490
- data/ext/v8/upstream/3.1.8/src/hydrogen-instructions.h +0 -3493
- data/ext/v8/upstream/3.1.8/src/hydrogen.cc +0 -6056
- data/ext/v8/upstream/3.1.8/src/hydrogen.h +0 -1091
- data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32-inl.h +0 -429
- data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32.cc +0 -2800
- data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32.h +0 -1093
- data/ext/v8/upstream/3.1.8/src/ia32/builtins-ia32.cc +0 -1590
- data/ext/v8/upstream/3.1.8/src/ia32/code-stubs-ia32.cc +0 -6624
- data/ext/v8/upstream/3.1.8/src/ia32/code-stubs-ia32.h +0 -536
- data/ext/v8/upstream/3.1.8/src/ia32/codegen-ia32.cc +0 -10354
- data/ext/v8/upstream/3.1.8/src/ia32/codegen-ia32.h +0 -798
- data/ext/v8/upstream/3.1.8/src/ia32/cpu-ia32.cc +0 -87
- data/ext/v8/upstream/3.1.8/src/ia32/debug-ia32.cc +0 -309
- data/ext/v8/upstream/3.1.8/src/ia32/deoptimizer-ia32.cc +0 -664
- data/ext/v8/upstream/3.1.8/src/ia32/disasm-ia32.cc +0 -1597
- data/ext/v8/upstream/3.1.8/src/ia32/frames-ia32.h +0 -140
- data/ext/v8/upstream/3.1.8/src/ia32/full-codegen-ia32.cc +0 -4278
- data/ext/v8/upstream/3.1.8/src/ia32/ic-ia32.cc +0 -1786
- data/ext/v8/upstream/3.1.8/src/ia32/lithium-codegen-ia32.cc +0 -3880
- data/ext/v8/upstream/3.1.8/src/ia32/lithium-codegen-ia32.h +0 -309
- data/ext/v8/upstream/3.1.8/src/ia32/lithium-gap-resolver-ia32.cc +0 -460
- data/ext/v8/upstream/3.1.8/src/ia32/lithium-ia32.cc +0 -2095
- data/ext/v8/upstream/3.1.8/src/ia32/lithium-ia32.h +0 -2127
- data/ext/v8/upstream/3.1.8/src/ia32/macro-assembler-ia32.cc +0 -2031
- data/ext/v8/upstream/3.1.8/src/ia32/macro-assembler-ia32.h +0 -798
- data/ext/v8/upstream/3.1.8/src/ia32/regexp-macro-assembler-ia32.cc +0 -1253
- data/ext/v8/upstream/3.1.8/src/ia32/regexp-macro-assembler-ia32.h +0 -215
- data/ext/v8/upstream/3.1.8/src/ia32/register-allocator-ia32.cc +0 -157
- data/ext/v8/upstream/3.1.8/src/ia32/simulator-ia32.h +0 -72
- data/ext/v8/upstream/3.1.8/src/ia32/stub-cache-ia32.cc +0 -3732
- data/ext/v8/upstream/3.1.8/src/ia32/virtual-frame-ia32.cc +0 -1360
- data/ext/v8/upstream/3.1.8/src/ia32/virtual-frame-ia32.h +0 -646
- data/ext/v8/upstream/3.1.8/src/ic-inl.h +0 -129
- data/ext/v8/upstream/3.1.8/src/ic.cc +0 -2333
- data/ext/v8/upstream/3.1.8/src/ic.h +0 -639
- data/ext/v8/upstream/3.1.8/src/interpreter-irregexp.cc +0 -655
- data/ext/v8/upstream/3.1.8/src/interpreter-irregexp.h +0 -48
- data/ext/v8/upstream/3.1.8/src/json.js +0 -342
- data/ext/v8/upstream/3.1.8/src/jsregexp.cc +0 -5340
- data/ext/v8/upstream/3.1.8/src/jsregexp.h +0 -1484
- data/ext/v8/upstream/3.1.8/src/jump-target-heavy.cc +0 -430
- data/ext/v8/upstream/3.1.8/src/jump-target-heavy.h +0 -244
- data/ext/v8/upstream/3.1.8/src/jump-target-inl.h +0 -48
- data/ext/v8/upstream/3.1.8/src/jump-target-light.cc +0 -111
- data/ext/v8/upstream/3.1.8/src/lithium-allocator-inl.h +0 -140
- data/ext/v8/upstream/3.1.8/src/lithium-allocator.cc +0 -2093
- data/ext/v8/upstream/3.1.8/src/lithium-allocator.h +0 -644
- data/ext/v8/upstream/3.1.8/src/lithium.cc +0 -168
- data/ext/v8/upstream/3.1.8/src/liveedit.cc +0 -1650
- data/ext/v8/upstream/3.1.8/src/liveedit.h +0 -174
- data/ext/v8/upstream/3.1.8/src/liveobjectlist.cc +0 -2527
- data/ext/v8/upstream/3.1.8/src/liveobjectlist.h +0 -322
- data/ext/v8/upstream/3.1.8/src/log-utils.cc +0 -336
- data/ext/v8/upstream/3.1.8/src/log-utils.h +0 -232
- data/ext/v8/upstream/3.1.8/src/log.cc +0 -1608
- data/ext/v8/upstream/3.1.8/src/log.h +0 -379
- data/ext/v8/upstream/3.1.8/src/mark-compact.cc +0 -2957
- data/ext/v8/upstream/3.1.8/src/mark-compact.h +0 -433
- data/ext/v8/upstream/3.1.8/src/messages.cc +0 -164
- data/ext/v8/upstream/3.1.8/src/messages.js +0 -1071
- data/ext/v8/upstream/3.1.8/src/mips/assembler-mips-inl.h +0 -215
- data/ext/v8/upstream/3.1.8/src/mips/assembler-mips.cc +0 -1219
- data/ext/v8/upstream/3.1.8/src/mips/assembler-mips.h +0 -667
- data/ext/v8/upstream/3.1.8/src/mips/builtins-mips.cc +0 -205
- data/ext/v8/upstream/3.1.8/src/mips/codegen-mips-inl.h +0 -70
- data/ext/v8/upstream/3.1.8/src/mips/codegen-mips.cc +0 -1437
- data/ext/v8/upstream/3.1.8/src/mips/codegen-mips.h +0 -431
- data/ext/v8/upstream/3.1.8/src/mips/constants-mips.cc +0 -328
- data/ext/v8/upstream/3.1.8/src/mips/constants-mips.h +0 -525
- data/ext/v8/upstream/3.1.8/src/mips/cpu-mips.cc +0 -73
- data/ext/v8/upstream/3.1.8/src/mips/debug-mips.cc +0 -127
- data/ext/v8/upstream/3.1.8/src/mips/disasm-mips.cc +0 -787
- data/ext/v8/upstream/3.1.8/src/mips/fast-codegen-mips.cc +0 -77
- data/ext/v8/upstream/3.1.8/src/mips/frames-mips.cc +0 -96
- data/ext/v8/upstream/3.1.8/src/mips/frames-mips.h +0 -164
- data/ext/v8/upstream/3.1.8/src/mips/full-codegen-mips.cc +0 -277
- data/ext/v8/upstream/3.1.8/src/mips/ic-mips.cc +0 -208
- data/ext/v8/upstream/3.1.8/src/mips/jump-target-mips.cc +0 -175
- data/ext/v8/upstream/3.1.8/src/mips/macro-assembler-mips.cc +0 -1326
- data/ext/v8/upstream/3.1.8/src/mips/macro-assembler-mips.h +0 -461
- data/ext/v8/upstream/3.1.8/src/mips/register-allocator-mips-inl.h +0 -137
- data/ext/v8/upstream/3.1.8/src/mips/register-allocator-mips.h +0 -46
- data/ext/v8/upstream/3.1.8/src/mips/simulator-mips.cc +0 -1650
- data/ext/v8/upstream/3.1.8/src/mips/simulator-mips.h +0 -311
- data/ext/v8/upstream/3.1.8/src/mips/stub-cache-mips.cc +0 -418
- data/ext/v8/upstream/3.1.8/src/mips/virtual-frame-mips.cc +0 -319
- data/ext/v8/upstream/3.1.8/src/mips/virtual-frame-mips.h +0 -548
- data/ext/v8/upstream/3.1.8/src/mirror-debugger.js +0 -2380
- data/ext/v8/upstream/3.1.8/src/mksnapshot.cc +0 -256
- data/ext/v8/upstream/3.1.8/src/objects-debug.cc +0 -722
- data/ext/v8/upstream/3.1.8/src/objects-inl.h +0 -3946
- data/ext/v8/upstream/3.1.8/src/objects-printer.cc +0 -801
- data/ext/v8/upstream/3.1.8/src/objects-visiting.cc +0 -142
- data/ext/v8/upstream/3.1.8/src/objects-visiting.h +0 -401
- data/ext/v8/upstream/3.1.8/src/objects.cc +0 -10044
- data/ext/v8/upstream/3.1.8/src/objects.h +0 -6571
- data/ext/v8/upstream/3.1.8/src/parser.cc +0 -5165
- data/ext/v8/upstream/3.1.8/src/parser.h +0 -802
- data/ext/v8/upstream/3.1.8/src/platform-cygwin.cc +0 -745
- data/ext/v8/upstream/3.1.8/src/platform-freebsd.cc +0 -702
- data/ext/v8/upstream/3.1.8/src/platform-linux.cc +0 -981
- data/ext/v8/upstream/3.1.8/src/platform-macos.cc +0 -732
- data/ext/v8/upstream/3.1.8/src/platform-nullos.cc +0 -498
- data/ext/v8/upstream/3.1.8/src/platform-openbsd.cc +0 -657
- data/ext/v8/upstream/3.1.8/src/platform-posix.cc +0 -399
- data/ext/v8/upstream/3.1.8/src/platform-solaris.cc +0 -714
- data/ext/v8/upstream/3.1.8/src/platform-win32.cc +0 -1974
- data/ext/v8/upstream/3.1.8/src/platform.h +0 -636
- data/ext/v8/upstream/3.1.8/src/preparse-data.cc +0 -183
- data/ext/v8/upstream/3.1.8/src/preparser-api.cc +0 -213
- data/ext/v8/upstream/3.1.8/src/preparser.cc +0 -1205
- data/ext/v8/upstream/3.1.8/src/prettyprinter.cc +0 -1539
- data/ext/v8/upstream/3.1.8/src/prettyprinter.h +0 -223
- data/ext/v8/upstream/3.1.8/src/profile-generator.cc +0 -2899
- data/ext/v8/upstream/3.1.8/src/profile-generator.h +0 -1151
- data/ext/v8/upstream/3.1.8/src/property.cc +0 -96
- data/ext/v8/upstream/3.1.8/src/property.h +0 -337
- data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler-irregexp.cc +0 -470
- data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler.cc +0 -257
- data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler.h +0 -231
- data/ext/v8/upstream/3.1.8/src/regexp-stack.cc +0 -103
- data/ext/v8/upstream/3.1.8/src/regexp-stack.h +0 -123
- data/ext/v8/upstream/3.1.8/src/regexp.js +0 -483
- data/ext/v8/upstream/3.1.8/src/register-allocator-inl.h +0 -141
- data/ext/v8/upstream/3.1.8/src/register-allocator.cc +0 -104
- data/ext/v8/upstream/3.1.8/src/register-allocator.h +0 -320
- data/ext/v8/upstream/3.1.8/src/rewriter.cc +0 -1023
- data/ext/v8/upstream/3.1.8/src/runtime-profiler.cc +0 -443
- data/ext/v8/upstream/3.1.8/src/runtime-profiler.h +0 -77
- data/ext/v8/upstream/3.1.8/src/runtime.cc +0 -11592
- data/ext/v8/upstream/3.1.8/src/runtime.h +0 -582
- data/ext/v8/upstream/3.1.8/src/safepoint-table.cc +0 -253
- data/ext/v8/upstream/3.1.8/src/safepoint-table.h +0 -263
- data/ext/v8/upstream/3.1.8/src/scanner-base.cc +0 -971
- data/ext/v8/upstream/3.1.8/src/scanner-base.h +0 -653
- data/ext/v8/upstream/3.1.8/src/scanner.cc +0 -586
- data/ext/v8/upstream/3.1.8/src/scanner.h +0 -194
- data/ext/v8/upstream/3.1.8/src/scopeinfo.cc +0 -636
- data/ext/v8/upstream/3.1.8/src/scopeinfo.h +0 -238
- data/ext/v8/upstream/3.1.8/src/scopes.cc +0 -1063
- data/ext/v8/upstream/3.1.8/src/scopes.h +0 -494
- data/ext/v8/upstream/3.1.8/src/serialize.cc +0 -1535
- data/ext/v8/upstream/3.1.8/src/serialize.h +0 -584
- data/ext/v8/upstream/3.1.8/src/snapshot-common.cc +0 -82
- data/ext/v8/upstream/3.1.8/src/snapshot.h +0 -71
- data/ext/v8/upstream/3.1.8/src/spaces-inl.h +0 -524
- data/ext/v8/upstream/3.1.8/src/spaces.cc +0 -3254
- data/ext/v8/upstream/3.1.8/src/spaces.h +0 -2362
- data/ext/v8/upstream/3.1.8/src/string-search.cc +0 -40
- data/ext/v8/upstream/3.1.8/src/string-search.h +0 -567
- data/ext/v8/upstream/3.1.8/src/string-stream.cc +0 -584
- data/ext/v8/upstream/3.1.8/src/string.js +0 -915
- data/ext/v8/upstream/3.1.8/src/stub-cache.cc +0 -1878
- data/ext/v8/upstream/3.1.8/src/stub-cache.h +0 -849
- data/ext/v8/upstream/3.1.8/src/token.cc +0 -63
- data/ext/v8/upstream/3.1.8/src/token.h +0 -288
- data/ext/v8/upstream/3.1.8/src/top.cc +0 -1152
- data/ext/v8/upstream/3.1.8/src/top.h +0 -608
- data/ext/v8/upstream/3.1.8/src/type-info.cc +0 -406
- data/ext/v8/upstream/3.1.8/src/type-info.h +0 -283
- data/ext/v8/upstream/3.1.8/src/unicode.cc +0 -1624
- data/ext/v8/upstream/3.1.8/src/unicode.h +0 -280
- data/ext/v8/upstream/3.1.8/src/utils.h +0 -793
- data/ext/v8/upstream/3.1.8/src/v8-counters.cc +0 -55
- data/ext/v8/upstream/3.1.8/src/v8-counters.h +0 -290
- data/ext/v8/upstream/3.1.8/src/v8.cc +0 -270
- data/ext/v8/upstream/3.1.8/src/v8.h +0 -127
- data/ext/v8/upstream/3.1.8/src/v8globals.h +0 -480
- data/ext/v8/upstream/3.1.8/src/v8natives.js +0 -1252
- data/ext/v8/upstream/3.1.8/src/v8threads.cc +0 -440
- data/ext/v8/upstream/3.1.8/src/v8threads.h +0 -157
- data/ext/v8/upstream/3.1.8/src/v8utils.h +0 -354
- data/ext/v8/upstream/3.1.8/src/variables.h +0 -212
- data/ext/v8/upstream/3.1.8/src/version.cc +0 -95
- data/ext/v8/upstream/3.1.8/src/version.h +0 -64
- data/ext/v8/upstream/3.1.8/src/virtual-frame-light-inl.h +0 -170
- data/ext/v8/upstream/3.1.8/src/vm-state-inl.h +0 -134
- data/ext/v8/upstream/3.1.8/src/vm-state.h +0 -68
- data/ext/v8/upstream/3.1.8/src/win32-headers.h +0 -95
- data/ext/v8/upstream/3.1.8/src/x64/assembler-x64-inl.h +0 -455
- data/ext/v8/upstream/3.1.8/src/x64/assembler-x64.cc +0 -3162
- data/ext/v8/upstream/3.1.8/src/x64/assembler-x64.h +0 -1584
- data/ext/v8/upstream/3.1.8/src/x64/builtins-x64.cc +0 -1492
- data/ext/v8/upstream/3.1.8/src/x64/code-stubs-x64.cc +0 -5150
- data/ext/v8/upstream/3.1.8/src/x64/code-stubs-x64.h +0 -519
- data/ext/v8/upstream/3.1.8/src/x64/codegen-x64.cc +0 -8835
- data/ext/v8/upstream/3.1.8/src/x64/codegen-x64.h +0 -750
- data/ext/v8/upstream/3.1.8/src/x64/cpu-x64.cc +0 -86
- data/ext/v8/upstream/3.1.8/src/x64/debug-x64.cc +0 -316
- data/ext/v8/upstream/3.1.8/src/x64/deoptimizer-x64.cc +0 -781
- data/ext/v8/upstream/3.1.8/src/x64/disasm-x64.cc +0 -1737
- data/ext/v8/upstream/3.1.8/src/x64/frames-x64.h +0 -130
- data/ext/v8/upstream/3.1.8/src/x64/full-codegen-x64.cc +0 -3984
- data/ext/v8/upstream/3.1.8/src/x64/ic-x64.cc +0 -1761
- data/ext/v8/upstream/3.1.8/src/x64/lithium-codegen-x64.cc +0 -3639
- data/ext/v8/upstream/3.1.8/src/x64/lithium-codegen-x64.h +0 -305
- data/ext/v8/upstream/3.1.8/src/x64/lithium-x64.cc +0 -2044
- data/ext/v8/upstream/3.1.8/src/x64/lithium-x64.h +0 -2052
- data/ext/v8/upstream/3.1.8/src/x64/macro-assembler-x64.cc +0 -2660
- data/ext/v8/upstream/3.1.8/src/x64/macro-assembler-x64.h +0 -1852
- data/ext/v8/upstream/3.1.8/src/x64/regexp-macro-assembler-x64.cc +0 -1382
- data/ext/v8/upstream/3.1.8/src/x64/regexp-macro-assembler-x64.h +0 -278
- data/ext/v8/upstream/3.1.8/src/x64/register-allocator-x64-inl.h +0 -87
- data/ext/v8/upstream/3.1.8/src/x64/register-allocator-x64.cc +0 -91
- data/ext/v8/upstream/3.1.8/src/x64/simulator-x64.h +0 -71
- data/ext/v8/upstream/3.1.8/src/x64/stub-cache-x64.cc +0 -3509
- data/ext/v8/upstream/3.1.8/src/x64/virtual-frame-x64.cc +0 -1292
- data/ext/v8/upstream/3.1.8/src/x64/virtual-frame-x64.h +0 -593
- data/ext/v8/upstream/3.1.8/src/zone-inl.h +0 -83
- data/ext/v8/upstream/3.1.8/src/zone.cc +0 -195
- data/ext/v8/upstream/3.1.8/src/zone.h +0 -233
- data/ext/v8/upstream/3.1.8/tools/gyp/v8.gyp +0 -869
- data/ext/v8/upstream/3.1.8/tools/linux-tick-processor +0 -33
- data/ext/v8/upstream/3.1.8/tools/tickprocessor.js +0 -863
- data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base.vcproj +0 -1296
- data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base_arm.vcproj +0 -1234
- data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base_x64.vcproj +0 -1296
- data/ext/v8/upstream/3.1.8/tools/visual_studio/x64.vsprops +0 -17
- data/spec/ext/mem_spec.rb +0 -42
@@ -0,0 +1,318 @@
|
|
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_X64_LITHIUM_CODEGEN_X64_H_
|
29
|
+
#define V8_X64_LITHIUM_CODEGEN_X64_H_
|
30
|
+
|
31
|
+
#include "x64/lithium-x64.h"
|
32
|
+
|
33
|
+
#include "checks.h"
|
34
|
+
#include "deoptimizer.h"
|
35
|
+
#include "safepoint-table.h"
|
36
|
+
#include "scopes.h"
|
37
|
+
#include "x64/lithium-gap-resolver-x64.h"
|
38
|
+
|
39
|
+
namespace v8 {
|
40
|
+
namespace internal {
|
41
|
+
|
42
|
+
// Forward declarations.
|
43
|
+
class LDeferredCode;
|
44
|
+
class SafepointGenerator;
|
45
|
+
|
46
|
+
class LCodeGen BASE_EMBEDDED {
|
47
|
+
public:
|
48
|
+
LCodeGen(LChunk* chunk, MacroAssembler* assembler, CompilationInfo* info)
|
49
|
+
: chunk_(chunk),
|
50
|
+
masm_(assembler),
|
51
|
+
info_(info),
|
52
|
+
current_block_(-1),
|
53
|
+
current_instruction_(-1),
|
54
|
+
instructions_(chunk->instructions()),
|
55
|
+
deoptimizations_(4),
|
56
|
+
jump_table_(4),
|
57
|
+
deoptimization_literals_(8),
|
58
|
+
inlined_function_count_(0),
|
59
|
+
scope_(info->scope()),
|
60
|
+
status_(UNUSED),
|
61
|
+
deferred_(8),
|
62
|
+
osr_pc_offset_(-1),
|
63
|
+
resolver_(this) {
|
64
|
+
PopulateDeoptimizationLiteralsWithInlinedFunctions();
|
65
|
+
}
|
66
|
+
|
67
|
+
// Simple accessors.
|
68
|
+
MacroAssembler* masm() const { return masm_; }
|
69
|
+
CompilationInfo* info() const { return info_; }
|
70
|
+
Isolate* isolate() const { return info_->isolate(); }
|
71
|
+
Factory* factory() const { return isolate()->factory(); }
|
72
|
+
Heap* heap() const { return isolate()->heap(); }
|
73
|
+
|
74
|
+
// Support for converting LOperands to assembler types.
|
75
|
+
Register ToRegister(LOperand* op) const;
|
76
|
+
XMMRegister ToDoubleRegister(LOperand* op) const;
|
77
|
+
bool IsInteger32Constant(LConstantOperand* op) const;
|
78
|
+
int ToInteger32(LConstantOperand* op) const;
|
79
|
+
bool IsTaggedConstant(LConstantOperand* op) const;
|
80
|
+
Handle<Object> ToHandle(LConstantOperand* op) const;
|
81
|
+
Operand ToOperand(LOperand* op) const;
|
82
|
+
|
83
|
+
// Try to generate code for the entire chunk, but it may fail if the
|
84
|
+
// chunk contains constructs we cannot handle. Returns true if the
|
85
|
+
// code generation attempt succeeded.
|
86
|
+
bool GenerateCode();
|
87
|
+
|
88
|
+
// Finish the code by setting stack height, safepoint, and bailout
|
89
|
+
// information on it.
|
90
|
+
void FinishCode(Handle<Code> code);
|
91
|
+
|
92
|
+
// Deferred code support.
|
93
|
+
void DoDeferredNumberTagD(LNumberTagD* instr);
|
94
|
+
void DoDeferredTaggedToI(LTaggedToI* instr);
|
95
|
+
void DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr);
|
96
|
+
void DoDeferredStackCheck(LGoto* instr);
|
97
|
+
void DoDeferredStringCharCodeAt(LStringCharCodeAt* instr);
|
98
|
+
void DoDeferredStringCharFromCode(LStringCharFromCode* instr);
|
99
|
+
void DoDeferredLInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr,
|
100
|
+
Label* map_check);
|
101
|
+
|
102
|
+
// Parallel move support.
|
103
|
+
void DoParallelMove(LParallelMove* move);
|
104
|
+
|
105
|
+
// Emit frame translation commands for an environment.
|
106
|
+
void WriteTranslation(LEnvironment* environment, Translation* translation);
|
107
|
+
|
108
|
+
// Declare methods that deal with the individual node types.
|
109
|
+
#define DECLARE_DO(type) void Do##type(L##type* node);
|
110
|
+
LITHIUM_CONCRETE_INSTRUCTION_LIST(DECLARE_DO)
|
111
|
+
#undef DECLARE_DO
|
112
|
+
|
113
|
+
private:
|
114
|
+
enum Status {
|
115
|
+
UNUSED,
|
116
|
+
GENERATING,
|
117
|
+
DONE,
|
118
|
+
ABORTED
|
119
|
+
};
|
120
|
+
|
121
|
+
bool is_unused() const { return status_ == UNUSED; }
|
122
|
+
bool is_generating() const { return status_ == GENERATING; }
|
123
|
+
bool is_done() const { return status_ == DONE; }
|
124
|
+
bool is_aborted() const { return status_ == ABORTED; }
|
125
|
+
|
126
|
+
int strict_mode_flag() const {
|
127
|
+
return info()->is_strict() ? kStrictMode : kNonStrictMode;
|
128
|
+
}
|
129
|
+
|
130
|
+
LChunk* chunk() const { return chunk_; }
|
131
|
+
Scope* scope() const { return scope_; }
|
132
|
+
HGraph* graph() const { return chunk_->graph(); }
|
133
|
+
|
134
|
+
int GetNextEmittedBlock(int block);
|
135
|
+
LInstruction* GetNextInstruction();
|
136
|
+
|
137
|
+
void EmitClassOfTest(Label* if_true,
|
138
|
+
Label* if_false,
|
139
|
+
Handle<String> class_name,
|
140
|
+
Register input,
|
141
|
+
Register temporary);
|
142
|
+
|
143
|
+
int StackSlotCount() const { return chunk()->spill_slot_count(); }
|
144
|
+
int ParameterCount() const { return scope()->num_parameters(); }
|
145
|
+
|
146
|
+
void Abort(const char* format, ...);
|
147
|
+
void Comment(const char* format, ...);
|
148
|
+
|
149
|
+
void AddDeferredCode(LDeferredCode* code) { deferred_.Add(code); }
|
150
|
+
|
151
|
+
// Code generation passes. Returns true if code generation should
|
152
|
+
// continue.
|
153
|
+
bool GeneratePrologue();
|
154
|
+
bool GenerateBody();
|
155
|
+
bool GenerateDeferredCode();
|
156
|
+
bool GenerateJumpTable();
|
157
|
+
bool GenerateSafepointTable();
|
158
|
+
|
159
|
+
void CallCode(Handle<Code> code,
|
160
|
+
RelocInfo::Mode mode,
|
161
|
+
LInstruction* instr);
|
162
|
+
void CallRuntime(const Runtime::Function* function,
|
163
|
+
int num_arguments,
|
164
|
+
LInstruction* instr);
|
165
|
+
void CallRuntime(Runtime::FunctionId id,
|
166
|
+
int num_arguments,
|
167
|
+
LInstruction* instr) {
|
168
|
+
const Runtime::Function* function = Runtime::FunctionForId(id);
|
169
|
+
CallRuntime(function, num_arguments, instr);
|
170
|
+
}
|
171
|
+
|
172
|
+
// Generate a direct call to a known function. Expects the function
|
173
|
+
// to be in edi.
|
174
|
+
void CallKnownFunction(Handle<JSFunction> function,
|
175
|
+
int arity,
|
176
|
+
LInstruction* instr);
|
177
|
+
|
178
|
+
void LoadHeapObject(Register result, Handle<HeapObject> object);
|
179
|
+
|
180
|
+
void RegisterLazyDeoptimization(LInstruction* instr);
|
181
|
+
void RegisterEnvironmentForDeoptimization(LEnvironment* environment);
|
182
|
+
void DeoptimizeIf(Condition cc, LEnvironment* environment);
|
183
|
+
|
184
|
+
void AddToTranslation(Translation* translation,
|
185
|
+
LOperand* op,
|
186
|
+
bool is_tagged);
|
187
|
+
void PopulateDeoptimizationData(Handle<Code> code);
|
188
|
+
int DefineDeoptimizationLiteral(Handle<Object> literal);
|
189
|
+
|
190
|
+
void PopulateDeoptimizationLiteralsWithInlinedFunctions();
|
191
|
+
|
192
|
+
Register ToRegister(int index) const;
|
193
|
+
XMMRegister ToDoubleRegister(int index) const;
|
194
|
+
|
195
|
+
// Specific math operations - used from DoUnaryMathOperation.
|
196
|
+
void EmitIntegerMathAbs(LUnaryMathOperation* instr);
|
197
|
+
void DoMathAbs(LUnaryMathOperation* instr);
|
198
|
+
void DoMathFloor(LUnaryMathOperation* instr);
|
199
|
+
void DoMathRound(LUnaryMathOperation* instr);
|
200
|
+
void DoMathSqrt(LUnaryMathOperation* instr);
|
201
|
+
void DoMathPowHalf(LUnaryMathOperation* instr);
|
202
|
+
void DoMathLog(LUnaryMathOperation* instr);
|
203
|
+
void DoMathCos(LUnaryMathOperation* instr);
|
204
|
+
void DoMathSin(LUnaryMathOperation* instr);
|
205
|
+
|
206
|
+
// Support for recording safepoint and position information.
|
207
|
+
void RecordSafepoint(LPointerMap* pointers,
|
208
|
+
Safepoint::Kind kind,
|
209
|
+
int arguments,
|
210
|
+
int deoptimization_index);
|
211
|
+
void RecordSafepoint(LPointerMap* pointers, int deoptimization_index);
|
212
|
+
void RecordSafepoint(int deoptimization_index);
|
213
|
+
void RecordSafepointWithRegisters(LPointerMap* pointers,
|
214
|
+
int arguments,
|
215
|
+
int deoptimization_index);
|
216
|
+
void RecordPosition(int position);
|
217
|
+
int LastSafepointEnd() {
|
218
|
+
return static_cast<int>(safepoints_.GetPcAfterGap());
|
219
|
+
}
|
220
|
+
|
221
|
+
static Condition TokenToCondition(Token::Value op, bool is_unsigned);
|
222
|
+
void EmitGoto(int block, LDeferredCode* deferred_stack_check = NULL);
|
223
|
+
void EmitBranch(int left_block, int right_block, Condition cc);
|
224
|
+
void EmitCmpI(LOperand* left, LOperand* right);
|
225
|
+
void EmitNumberUntagD(Register input, XMMRegister result, LEnvironment* env);
|
226
|
+
|
227
|
+
// Emits optimized code for typeof x == "y". Modifies input register.
|
228
|
+
// Returns the condition on which a final split to
|
229
|
+
// true and false label should be made, to optimize fallthrough.
|
230
|
+
Condition EmitTypeofIs(Label* true_label, Label* false_label,
|
231
|
+
Register input, Handle<String> type_name);
|
232
|
+
|
233
|
+
// Emits optimized code for %_IsObject(x). Preserves input register.
|
234
|
+
// Returns the condition on which a final split to
|
235
|
+
// true and false label should be made, to optimize fallthrough.
|
236
|
+
Condition EmitIsObject(Register input,
|
237
|
+
Label* is_not_object,
|
238
|
+
Label* is_object);
|
239
|
+
|
240
|
+
// Emits optimized code for %_IsConstructCall().
|
241
|
+
// Caller should branch on equal condition.
|
242
|
+
void EmitIsConstructCall(Register temp);
|
243
|
+
|
244
|
+
void EmitLoadField(Register result,
|
245
|
+
Register object,
|
246
|
+
Handle<Map> type,
|
247
|
+
Handle<String> name);
|
248
|
+
|
249
|
+
// Emits code for pushing a constant operand.
|
250
|
+
void EmitPushConstantOperand(LOperand* operand);
|
251
|
+
|
252
|
+
struct JumpTableEntry {
|
253
|
+
inline JumpTableEntry(Address entry)
|
254
|
+
: label(),
|
255
|
+
address(entry) { }
|
256
|
+
Label label;
|
257
|
+
Address address;
|
258
|
+
};
|
259
|
+
|
260
|
+
LChunk* const chunk_;
|
261
|
+
MacroAssembler* const masm_;
|
262
|
+
CompilationInfo* const info_;
|
263
|
+
|
264
|
+
int current_block_;
|
265
|
+
int current_instruction_;
|
266
|
+
const ZoneList<LInstruction*>* instructions_;
|
267
|
+
ZoneList<LEnvironment*> deoptimizations_;
|
268
|
+
ZoneList<JumpTableEntry> jump_table_;
|
269
|
+
ZoneList<Handle<Object> > deoptimization_literals_;
|
270
|
+
int inlined_function_count_;
|
271
|
+
Scope* const scope_;
|
272
|
+
Status status_;
|
273
|
+
TranslationBuffer translations_;
|
274
|
+
ZoneList<LDeferredCode*> deferred_;
|
275
|
+
int osr_pc_offset_;
|
276
|
+
|
277
|
+
// Builder that keeps track of safepoints in the code. The table
|
278
|
+
// itself is emitted at the end of the generated code.
|
279
|
+
SafepointTableBuilder safepoints_;
|
280
|
+
|
281
|
+
// Compiler from a set of parallel moves to a sequential list of moves.
|
282
|
+
LGapResolver resolver_;
|
283
|
+
|
284
|
+
friend class LDeferredCode;
|
285
|
+
friend class LEnvironment;
|
286
|
+
friend class SafepointGenerator;
|
287
|
+
DISALLOW_COPY_AND_ASSIGN(LCodeGen);
|
288
|
+
};
|
289
|
+
|
290
|
+
|
291
|
+
class LDeferredCode: public ZoneObject {
|
292
|
+
public:
|
293
|
+
explicit LDeferredCode(LCodeGen* codegen)
|
294
|
+
: codegen_(codegen), external_exit_(NULL) {
|
295
|
+
codegen->AddDeferredCode(this);
|
296
|
+
}
|
297
|
+
|
298
|
+
virtual ~LDeferredCode() { }
|
299
|
+
virtual void Generate() = 0;
|
300
|
+
|
301
|
+
void SetExit(Label *exit) { external_exit_ = exit; }
|
302
|
+
Label* entry() { return &entry_; }
|
303
|
+
Label* exit() { return external_exit_ != NULL ? external_exit_ : &exit_; }
|
304
|
+
|
305
|
+
protected:
|
306
|
+
LCodeGen* codegen() const { return codegen_; }
|
307
|
+
MacroAssembler* masm() const { return codegen_->masm(); }
|
308
|
+
|
309
|
+
private:
|
310
|
+
LCodeGen* codegen_;
|
311
|
+
Label entry_;
|
312
|
+
Label exit_;
|
313
|
+
Label* external_exit_;
|
314
|
+
};
|
315
|
+
|
316
|
+
} } // namespace v8::internal
|
317
|
+
|
318
|
+
#endif // V8_X64_LITHIUM_CODEGEN_X64_H_
|
File without changes
|
File without changes
|
@@ -0,0 +1,2115 @@
|
|
1
|
+
// Copyright 2011 the V8 project authors. All rights reserved.
|
2
|
+
// Redistribution and use in source and binary forms, with or without
|
3
|
+
// modification, are permitted provided that the following conditions are
|
4
|
+
// met:
|
5
|
+
//
|
6
|
+
// * Redistributions of source code must retain the above copyright
|
7
|
+
// notice, this list of conditions and the following disclaimer.
|
8
|
+
// * Redistributions in binary form must reproduce the above
|
9
|
+
// copyright notice, this list of conditions and the following
|
10
|
+
// disclaimer in the documentation and/or other materials provided
|
11
|
+
// with the distribution.
|
12
|
+
// * Neither the name of Google Inc. nor the names of its
|
13
|
+
// contributors may be used to endorse or promote products derived
|
14
|
+
// from this software without specific prior written permission.
|
15
|
+
//
|
16
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
17
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
18
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
19
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
20
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
21
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
22
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
23
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
24
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
25
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
26
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27
|
+
|
28
|
+
#include "v8.h"
|
29
|
+
|
30
|
+
#if defined(V8_TARGET_ARCH_X64)
|
31
|
+
|
32
|
+
#include "lithium-allocator-inl.h"
|
33
|
+
#include "x64/lithium-x64.h"
|
34
|
+
#include "x64/lithium-codegen-x64.h"
|
35
|
+
|
36
|
+
namespace v8 {
|
37
|
+
namespace internal {
|
38
|
+
|
39
|
+
#define DEFINE_COMPILE(type) \
|
40
|
+
void L##type::CompileToNative(LCodeGen* generator) { \
|
41
|
+
generator->Do##type(this); \
|
42
|
+
}
|
43
|
+
LITHIUM_CONCRETE_INSTRUCTION_LIST(DEFINE_COMPILE)
|
44
|
+
#undef DEFINE_COMPILE
|
45
|
+
|
46
|
+
LOsrEntry::LOsrEntry() {
|
47
|
+
for (int i = 0; i < Register::kNumAllocatableRegisters; ++i) {
|
48
|
+
register_spills_[i] = NULL;
|
49
|
+
}
|
50
|
+
for (int i = 0; i < DoubleRegister::kNumAllocatableRegisters; ++i) {
|
51
|
+
double_register_spills_[i] = NULL;
|
52
|
+
}
|
53
|
+
}
|
54
|
+
|
55
|
+
|
56
|
+
void LOsrEntry::MarkSpilledRegister(int allocation_index,
|
57
|
+
LOperand* spill_operand) {
|
58
|
+
ASSERT(spill_operand->IsStackSlot());
|
59
|
+
ASSERT(register_spills_[allocation_index] == NULL);
|
60
|
+
register_spills_[allocation_index] = spill_operand;
|
61
|
+
}
|
62
|
+
|
63
|
+
|
64
|
+
void LOsrEntry::MarkSpilledDoubleRegister(int allocation_index,
|
65
|
+
LOperand* spill_operand) {
|
66
|
+
ASSERT(spill_operand->IsDoubleStackSlot());
|
67
|
+
ASSERT(double_register_spills_[allocation_index] == NULL);
|
68
|
+
double_register_spills_[allocation_index] = spill_operand;
|
69
|
+
}
|
70
|
+
|
71
|
+
|
72
|
+
#ifdef DEBUG
|
73
|
+
void LInstruction::VerifyCall() {
|
74
|
+
// Call instructions can use only fixed registers as
|
75
|
+
// temporaries and outputs because all registers
|
76
|
+
// are blocked by the calling convention.
|
77
|
+
// Inputs must use a fixed register.
|
78
|
+
ASSERT(Output() == NULL ||
|
79
|
+
LUnallocated::cast(Output())->HasFixedPolicy() ||
|
80
|
+
!LUnallocated::cast(Output())->HasRegisterPolicy());
|
81
|
+
for (UseIterator it(this); it.HasNext(); it.Advance()) {
|
82
|
+
LOperand* operand = it.Next();
|
83
|
+
ASSERT(LUnallocated::cast(operand)->HasFixedPolicy() ||
|
84
|
+
!LUnallocated::cast(operand)->HasRegisterPolicy());
|
85
|
+
}
|
86
|
+
for (TempIterator it(this); it.HasNext(); it.Advance()) {
|
87
|
+
LOperand* operand = it.Next();
|
88
|
+
ASSERT(LUnallocated::cast(operand)->HasFixedPolicy() ||
|
89
|
+
!LUnallocated::cast(operand)->HasRegisterPolicy());
|
90
|
+
}
|
91
|
+
}
|
92
|
+
#endif
|
93
|
+
|
94
|
+
|
95
|
+
void LInstruction::PrintTo(StringStream* stream) {
|
96
|
+
stream->Add("%s ", this->Mnemonic());
|
97
|
+
|
98
|
+
PrintOutputOperandTo(stream);
|
99
|
+
|
100
|
+
PrintDataTo(stream);
|
101
|
+
|
102
|
+
if (HasEnvironment()) {
|
103
|
+
stream->Add(" ");
|
104
|
+
environment()->PrintTo(stream);
|
105
|
+
}
|
106
|
+
|
107
|
+
if (HasPointerMap()) {
|
108
|
+
stream->Add(" ");
|
109
|
+
pointer_map()->PrintTo(stream);
|
110
|
+
}
|
111
|
+
}
|
112
|
+
|
113
|
+
|
114
|
+
template<int R, int I, int T>
|
115
|
+
void LTemplateInstruction<R, I, T>::PrintDataTo(StringStream* stream) {
|
116
|
+
stream->Add("= ");
|
117
|
+
inputs_.PrintOperandsTo(stream);
|
118
|
+
}
|
119
|
+
|
120
|
+
|
121
|
+
template<int R, int I, int T>
|
122
|
+
void LTemplateInstruction<R, I, T>::PrintOutputOperandTo(StringStream* stream) {
|
123
|
+
results_.PrintOperandsTo(stream);
|
124
|
+
}
|
125
|
+
|
126
|
+
|
127
|
+
template<typename T, int N>
|
128
|
+
void OperandContainer<T, N>::PrintOperandsTo(StringStream* stream) {
|
129
|
+
for (int i = 0; i < N; i++) {
|
130
|
+
if (i > 0) stream->Add(" ");
|
131
|
+
elems_[i]->PrintTo(stream);
|
132
|
+
}
|
133
|
+
}
|
134
|
+
|
135
|
+
|
136
|
+
void LLabel::PrintDataTo(StringStream* stream) {
|
137
|
+
LGap::PrintDataTo(stream);
|
138
|
+
LLabel* rep = replacement();
|
139
|
+
if (rep != NULL) {
|
140
|
+
stream->Add(" Dead block replaced with B%d", rep->block_id());
|
141
|
+
}
|
142
|
+
}
|
143
|
+
|
144
|
+
|
145
|
+
bool LGap::IsRedundant() const {
|
146
|
+
for (int i = 0; i < 4; i++) {
|
147
|
+
if (parallel_moves_[i] != NULL && !parallel_moves_[i]->IsRedundant()) {
|
148
|
+
return false;
|
149
|
+
}
|
150
|
+
}
|
151
|
+
|
152
|
+
return true;
|
153
|
+
}
|
154
|
+
|
155
|
+
|
156
|
+
void LGap::PrintDataTo(StringStream* stream) {
|
157
|
+
for (int i = 0; i < 4; i++) {
|
158
|
+
stream->Add("(");
|
159
|
+
if (parallel_moves_[i] != NULL) {
|
160
|
+
parallel_moves_[i]->PrintDataTo(stream);
|
161
|
+
}
|
162
|
+
stream->Add(") ");
|
163
|
+
}
|
164
|
+
}
|
165
|
+
|
166
|
+
|
167
|
+
const char* LArithmeticD::Mnemonic() const {
|
168
|
+
switch (op()) {
|
169
|
+
case Token::ADD: return "add-d";
|
170
|
+
case Token::SUB: return "sub-d";
|
171
|
+
case Token::MUL: return "mul-d";
|
172
|
+
case Token::DIV: return "div-d";
|
173
|
+
case Token::MOD: return "mod-d";
|
174
|
+
default:
|
175
|
+
UNREACHABLE();
|
176
|
+
return NULL;
|
177
|
+
}
|
178
|
+
}
|
179
|
+
|
180
|
+
|
181
|
+
const char* LArithmeticT::Mnemonic() const {
|
182
|
+
switch (op()) {
|
183
|
+
case Token::ADD: return "add-t";
|
184
|
+
case Token::SUB: return "sub-t";
|
185
|
+
case Token::MUL: return "mul-t";
|
186
|
+
case Token::MOD: return "mod-t";
|
187
|
+
case Token::DIV: return "div-t";
|
188
|
+
case Token::BIT_AND: return "bit-and-t";
|
189
|
+
case Token::BIT_OR: return "bit-or-t";
|
190
|
+
case Token::BIT_XOR: return "bit-xor-t";
|
191
|
+
case Token::SHL: return "sal-t";
|
192
|
+
case Token::SAR: return "sar-t";
|
193
|
+
case Token::SHR: return "shr-t";
|
194
|
+
default:
|
195
|
+
UNREACHABLE();
|
196
|
+
return NULL;
|
197
|
+
}
|
198
|
+
}
|
199
|
+
|
200
|
+
|
201
|
+
void LGoto::PrintDataTo(StringStream* stream) {
|
202
|
+
stream->Add("B%d", block_id());
|
203
|
+
}
|
204
|
+
|
205
|
+
|
206
|
+
void LBranch::PrintDataTo(StringStream* stream) {
|
207
|
+
stream->Add("B%d | B%d on ", true_block_id(), false_block_id());
|
208
|
+
InputAt(0)->PrintTo(stream);
|
209
|
+
}
|
210
|
+
|
211
|
+
|
212
|
+
void LCmpIDAndBranch::PrintDataTo(StringStream* stream) {
|
213
|
+
stream->Add("if ");
|
214
|
+
InputAt(0)->PrintTo(stream);
|
215
|
+
stream->Add(" %s ", Token::String(op()));
|
216
|
+
InputAt(1)->PrintTo(stream);
|
217
|
+
stream->Add(" then B%d else B%d", true_block_id(), false_block_id());
|
218
|
+
}
|
219
|
+
|
220
|
+
|
221
|
+
void LIsNullAndBranch::PrintDataTo(StringStream* stream) {
|
222
|
+
stream->Add("if ");
|
223
|
+
InputAt(0)->PrintTo(stream);
|
224
|
+
stream->Add(is_strict() ? " === null" : " == null");
|
225
|
+
stream->Add(" then B%d else B%d", true_block_id(), false_block_id());
|
226
|
+
}
|
227
|
+
|
228
|
+
|
229
|
+
void LIsObjectAndBranch::PrintDataTo(StringStream* stream) {
|
230
|
+
stream->Add("if is_object(");
|
231
|
+
InputAt(0)->PrintTo(stream);
|
232
|
+
stream->Add(") then B%d else B%d", true_block_id(), false_block_id());
|
233
|
+
}
|
234
|
+
|
235
|
+
|
236
|
+
void LIsSmiAndBranch::PrintDataTo(StringStream* stream) {
|
237
|
+
stream->Add("if is_smi(");
|
238
|
+
InputAt(0)->PrintTo(stream);
|
239
|
+
stream->Add(") then B%d else B%d", true_block_id(), false_block_id());
|
240
|
+
}
|
241
|
+
|
242
|
+
|
243
|
+
void LHasInstanceTypeAndBranch::PrintDataTo(StringStream* stream) {
|
244
|
+
stream->Add("if has_instance_type(");
|
245
|
+
InputAt(0)->PrintTo(stream);
|
246
|
+
stream->Add(") then B%d else B%d", true_block_id(), false_block_id());
|
247
|
+
}
|
248
|
+
|
249
|
+
|
250
|
+
void LHasCachedArrayIndexAndBranch::PrintDataTo(StringStream* stream) {
|
251
|
+
stream->Add("if has_cached_array_index(");
|
252
|
+
InputAt(0)->PrintTo(stream);
|
253
|
+
stream->Add(") then B%d else B%d", true_block_id(), false_block_id());
|
254
|
+
}
|
255
|
+
|
256
|
+
|
257
|
+
void LClassOfTestAndBranch::PrintDataTo(StringStream* stream) {
|
258
|
+
stream->Add("if class_of_test(");
|
259
|
+
InputAt(0)->PrintTo(stream);
|
260
|
+
stream->Add(", \"%o\") then B%d else B%d",
|
261
|
+
*hydrogen()->class_name(),
|
262
|
+
true_block_id(),
|
263
|
+
false_block_id());
|
264
|
+
}
|
265
|
+
|
266
|
+
|
267
|
+
void LTypeofIs::PrintDataTo(StringStream* stream) {
|
268
|
+
InputAt(0)->PrintTo(stream);
|
269
|
+
stream->Add(" == \"%s\"", *hydrogen()->type_literal()->ToCString());
|
270
|
+
}
|
271
|
+
|
272
|
+
|
273
|
+
void LTypeofIsAndBranch::PrintDataTo(StringStream* stream) {
|
274
|
+
stream->Add("if typeof ");
|
275
|
+
InputAt(0)->PrintTo(stream);
|
276
|
+
stream->Add(" == \"%s\" then B%d else B%d",
|
277
|
+
*hydrogen()->type_literal()->ToCString(),
|
278
|
+
true_block_id(), false_block_id());
|
279
|
+
}
|
280
|
+
|
281
|
+
|
282
|
+
void LCallConstantFunction::PrintDataTo(StringStream* stream) {
|
283
|
+
stream->Add("#%d / ", arity());
|
284
|
+
}
|
285
|
+
|
286
|
+
|
287
|
+
void LUnaryMathOperation::PrintDataTo(StringStream* stream) {
|
288
|
+
stream->Add("/%s ", hydrogen()->OpName());
|
289
|
+
InputAt(0)->PrintTo(stream);
|
290
|
+
}
|
291
|
+
|
292
|
+
|
293
|
+
void LLoadContextSlot::PrintDataTo(StringStream* stream) {
|
294
|
+
InputAt(0)->PrintTo(stream);
|
295
|
+
stream->Add("[%d]", slot_index());
|
296
|
+
}
|
297
|
+
|
298
|
+
|
299
|
+
void LStoreContextSlot::PrintDataTo(StringStream* stream) {
|
300
|
+
InputAt(0)->PrintTo(stream);
|
301
|
+
stream->Add("[%d] <- ", slot_index());
|
302
|
+
InputAt(1)->PrintTo(stream);
|
303
|
+
}
|
304
|
+
|
305
|
+
|
306
|
+
void LCallKeyed::PrintDataTo(StringStream* stream) {
|
307
|
+
stream->Add("[rcx] #%d / ", arity());
|
308
|
+
}
|
309
|
+
|
310
|
+
|
311
|
+
void LCallNamed::PrintDataTo(StringStream* stream) {
|
312
|
+
SmartPointer<char> name_string = name()->ToCString();
|
313
|
+
stream->Add("%s #%d / ", *name_string, arity());
|
314
|
+
}
|
315
|
+
|
316
|
+
|
317
|
+
void LCallGlobal::PrintDataTo(StringStream* stream) {
|
318
|
+
SmartPointer<char> name_string = name()->ToCString();
|
319
|
+
stream->Add("%s #%d / ", *name_string, arity());
|
320
|
+
}
|
321
|
+
|
322
|
+
|
323
|
+
void LCallKnownGlobal::PrintDataTo(StringStream* stream) {
|
324
|
+
stream->Add("#%d / ", arity());
|
325
|
+
}
|
326
|
+
|
327
|
+
|
328
|
+
void LCallNew::PrintDataTo(StringStream* stream) {
|
329
|
+
stream->Add("= ");
|
330
|
+
InputAt(0)->PrintTo(stream);
|
331
|
+
stream->Add(" #%d / ", arity());
|
332
|
+
}
|
333
|
+
|
334
|
+
|
335
|
+
void LClassOfTest::PrintDataTo(StringStream* stream) {
|
336
|
+
stream->Add("= class_of_test(");
|
337
|
+
InputAt(0)->PrintTo(stream);
|
338
|
+
stream->Add(", \"%o\")", *hydrogen()->class_name());
|
339
|
+
}
|
340
|
+
|
341
|
+
|
342
|
+
void LAccessArgumentsAt::PrintDataTo(StringStream* stream) {
|
343
|
+
arguments()->PrintTo(stream);
|
344
|
+
|
345
|
+
stream->Add(" length ");
|
346
|
+
length()->PrintTo(stream);
|
347
|
+
|
348
|
+
stream->Add(" index ");
|
349
|
+
index()->PrintTo(stream);
|
350
|
+
}
|
351
|
+
|
352
|
+
|
353
|
+
int LChunk::GetNextSpillIndex(bool is_double) {
|
354
|
+
return spill_slot_count_++;
|
355
|
+
}
|
356
|
+
|
357
|
+
|
358
|
+
LOperand* LChunk::GetNextSpillSlot(bool is_double) {
|
359
|
+
// All stack slots are Double stack slots on x64.
|
360
|
+
// Alternatively, at some point, start using half-size
|
361
|
+
// stack slots for int32 values.
|
362
|
+
int index = GetNextSpillIndex(is_double);
|
363
|
+
if (is_double) {
|
364
|
+
return LDoubleStackSlot::Create(index);
|
365
|
+
} else {
|
366
|
+
return LStackSlot::Create(index);
|
367
|
+
}
|
368
|
+
}
|
369
|
+
|
370
|
+
|
371
|
+
void LChunk::MarkEmptyBlocks() {
|
372
|
+
HPhase phase("Mark empty blocks", this);
|
373
|
+
for (int i = 0; i < graph()->blocks()->length(); ++i) {
|
374
|
+
HBasicBlock* block = graph()->blocks()->at(i);
|
375
|
+
int first = block->first_instruction_index();
|
376
|
+
int last = block->last_instruction_index();
|
377
|
+
LInstruction* first_instr = instructions()->at(first);
|
378
|
+
LInstruction* last_instr = instructions()->at(last);
|
379
|
+
|
380
|
+
LLabel* label = LLabel::cast(first_instr);
|
381
|
+
if (last_instr->IsGoto()) {
|
382
|
+
LGoto* goto_instr = LGoto::cast(last_instr);
|
383
|
+
if (!goto_instr->include_stack_check() &&
|
384
|
+
label->IsRedundant() &&
|
385
|
+
!label->is_loop_header()) {
|
386
|
+
bool can_eliminate = true;
|
387
|
+
for (int i = first + 1; i < last && can_eliminate; ++i) {
|
388
|
+
LInstruction* cur = instructions()->at(i);
|
389
|
+
if (cur->IsGap()) {
|
390
|
+
LGap* gap = LGap::cast(cur);
|
391
|
+
if (!gap->IsRedundant()) {
|
392
|
+
can_eliminate = false;
|
393
|
+
}
|
394
|
+
} else {
|
395
|
+
can_eliminate = false;
|
396
|
+
}
|
397
|
+
}
|
398
|
+
|
399
|
+
if (can_eliminate) {
|
400
|
+
label->set_replacement(GetLabel(goto_instr->block_id()));
|
401
|
+
}
|
402
|
+
}
|
403
|
+
}
|
404
|
+
}
|
405
|
+
}
|
406
|
+
|
407
|
+
|
408
|
+
void LStoreNamedField::PrintDataTo(StringStream* stream) {
|
409
|
+
object()->PrintTo(stream);
|
410
|
+
stream->Add(".");
|
411
|
+
stream->Add(*String::cast(*name())->ToCString());
|
412
|
+
stream->Add(" <- ");
|
413
|
+
value()->PrintTo(stream);
|
414
|
+
}
|
415
|
+
|
416
|
+
|
417
|
+
void LStoreNamedGeneric::PrintDataTo(StringStream* stream) {
|
418
|
+
object()->PrintTo(stream);
|
419
|
+
stream->Add(".");
|
420
|
+
stream->Add(*String::cast(*name())->ToCString());
|
421
|
+
stream->Add(" <- ");
|
422
|
+
value()->PrintTo(stream);
|
423
|
+
}
|
424
|
+
|
425
|
+
|
426
|
+
void LStoreKeyedFastElement::PrintDataTo(StringStream* stream) {
|
427
|
+
object()->PrintTo(stream);
|
428
|
+
stream->Add("[");
|
429
|
+
key()->PrintTo(stream);
|
430
|
+
stream->Add("] <- ");
|
431
|
+
value()->PrintTo(stream);
|
432
|
+
}
|
433
|
+
|
434
|
+
|
435
|
+
void LStoreKeyedGeneric::PrintDataTo(StringStream* stream) {
|
436
|
+
object()->PrintTo(stream);
|
437
|
+
stream->Add("[");
|
438
|
+
key()->PrintTo(stream);
|
439
|
+
stream->Add("] <- ");
|
440
|
+
value()->PrintTo(stream);
|
441
|
+
}
|
442
|
+
|
443
|
+
|
444
|
+
void LChunk::AddInstruction(LInstruction* instr, HBasicBlock* block) {
|
445
|
+
LGap* gap = new LGap(block);
|
446
|
+
int index = -1;
|
447
|
+
if (instr->IsControl()) {
|
448
|
+
instructions_.Add(gap);
|
449
|
+
index = instructions_.length();
|
450
|
+
instructions_.Add(instr);
|
451
|
+
} else {
|
452
|
+
index = instructions_.length();
|
453
|
+
instructions_.Add(instr);
|
454
|
+
instructions_.Add(gap);
|
455
|
+
}
|
456
|
+
if (instr->HasPointerMap()) {
|
457
|
+
pointer_maps_.Add(instr->pointer_map());
|
458
|
+
instr->pointer_map()->set_lithium_position(index);
|
459
|
+
}
|
460
|
+
}
|
461
|
+
|
462
|
+
|
463
|
+
LConstantOperand* LChunk::DefineConstantOperand(HConstant* constant) {
|
464
|
+
return LConstantOperand::Create(constant->id());
|
465
|
+
}
|
466
|
+
|
467
|
+
|
468
|
+
int LChunk::GetParameterStackSlot(int index) const {
|
469
|
+
// The receiver is at index 0, the first parameter at index 1, so we
|
470
|
+
// shift all parameter indexes down by the number of parameters, and
|
471
|
+
// make sure they end up negative so they are distinguishable from
|
472
|
+
// spill slots.
|
473
|
+
int result = index - info()->scope()->num_parameters() - 1;
|
474
|
+
ASSERT(result < 0);
|
475
|
+
return result;
|
476
|
+
}
|
477
|
+
|
478
|
+
// A parameter relative to ebp in the arguments stub.
|
479
|
+
int LChunk::ParameterAt(int index) {
|
480
|
+
ASSERT(-1 <= index); // -1 is the receiver.
|
481
|
+
return (1 + info()->scope()->num_parameters() - index) *
|
482
|
+
kPointerSize;
|
483
|
+
}
|
484
|
+
|
485
|
+
|
486
|
+
LGap* LChunk::GetGapAt(int index) const {
|
487
|
+
return LGap::cast(instructions_[index]);
|
488
|
+
}
|
489
|
+
|
490
|
+
|
491
|
+
bool LChunk::IsGapAt(int index) const {
|
492
|
+
return instructions_[index]->IsGap();
|
493
|
+
}
|
494
|
+
|
495
|
+
|
496
|
+
int LChunk::NearestGapPos(int index) const {
|
497
|
+
while (!IsGapAt(index)) index--;
|
498
|
+
return index;
|
499
|
+
}
|
500
|
+
|
501
|
+
|
502
|
+
void LChunk::AddGapMove(int index, LOperand* from, LOperand* to) {
|
503
|
+
GetGapAt(index)->GetOrCreateParallelMove(LGap::START)->AddMove(from, to);
|
504
|
+
}
|
505
|
+
|
506
|
+
|
507
|
+
Handle<Object> LChunk::LookupLiteral(LConstantOperand* operand) const {
|
508
|
+
return HConstant::cast(graph_->LookupValue(operand->index()))->handle();
|
509
|
+
}
|
510
|
+
|
511
|
+
|
512
|
+
Representation LChunk::LookupLiteralRepresentation(
|
513
|
+
LConstantOperand* operand) const {
|
514
|
+
return graph_->LookupValue(operand->index())->representation();
|
515
|
+
}
|
516
|
+
|
517
|
+
|
518
|
+
LChunk* LChunkBuilder::Build() {
|
519
|
+
ASSERT(is_unused());
|
520
|
+
chunk_ = new LChunk(info(), graph());
|
521
|
+
HPhase phase("Building chunk", chunk_);
|
522
|
+
status_ = BUILDING;
|
523
|
+
const ZoneList<HBasicBlock*>* blocks = graph()->blocks();
|
524
|
+
for (int i = 0; i < blocks->length(); i++) {
|
525
|
+
HBasicBlock* next = NULL;
|
526
|
+
if (i < blocks->length() - 1) next = blocks->at(i + 1);
|
527
|
+
DoBasicBlock(blocks->at(i), next);
|
528
|
+
if (is_aborted()) return NULL;
|
529
|
+
}
|
530
|
+
status_ = DONE;
|
531
|
+
return chunk_;
|
532
|
+
}
|
533
|
+
|
534
|
+
|
535
|
+
void LChunkBuilder::Abort(const char* format, ...) {
|
536
|
+
if (FLAG_trace_bailout) {
|
537
|
+
SmartPointer<char> name(info()->shared_info()->DebugName()->ToCString());
|
538
|
+
PrintF("Aborting LChunk building in @\"%s\": ", *name);
|
539
|
+
va_list arguments;
|
540
|
+
va_start(arguments, format);
|
541
|
+
OS::VPrint(format, arguments);
|
542
|
+
va_end(arguments);
|
543
|
+
PrintF("\n");
|
544
|
+
}
|
545
|
+
status_ = ABORTED;
|
546
|
+
}
|
547
|
+
|
548
|
+
|
549
|
+
LRegister* LChunkBuilder::ToOperand(Register reg) {
|
550
|
+
return LRegister::Create(Register::ToAllocationIndex(reg));
|
551
|
+
}
|
552
|
+
|
553
|
+
|
554
|
+
LUnallocated* LChunkBuilder::ToUnallocated(Register reg) {
|
555
|
+
return new LUnallocated(LUnallocated::FIXED_REGISTER,
|
556
|
+
Register::ToAllocationIndex(reg));
|
557
|
+
}
|
558
|
+
|
559
|
+
|
560
|
+
LUnallocated* LChunkBuilder::ToUnallocated(XMMRegister reg) {
|
561
|
+
return new LUnallocated(LUnallocated::FIXED_DOUBLE_REGISTER,
|
562
|
+
XMMRegister::ToAllocationIndex(reg));
|
563
|
+
}
|
564
|
+
|
565
|
+
|
566
|
+
LOperand* LChunkBuilder::UseFixed(HValue* value, Register fixed_register) {
|
567
|
+
return Use(value, ToUnallocated(fixed_register));
|
568
|
+
}
|
569
|
+
|
570
|
+
|
571
|
+
LOperand* LChunkBuilder::UseFixedDouble(HValue* value, XMMRegister reg) {
|
572
|
+
return Use(value, ToUnallocated(reg));
|
573
|
+
}
|
574
|
+
|
575
|
+
|
576
|
+
LOperand* LChunkBuilder::UseRegister(HValue* value) {
|
577
|
+
return Use(value, new LUnallocated(LUnallocated::MUST_HAVE_REGISTER));
|
578
|
+
}
|
579
|
+
|
580
|
+
|
581
|
+
LOperand* LChunkBuilder::UseRegisterAtStart(HValue* value) {
|
582
|
+
return Use(value,
|
583
|
+
new LUnallocated(LUnallocated::MUST_HAVE_REGISTER,
|
584
|
+
LUnallocated::USED_AT_START));
|
585
|
+
}
|
586
|
+
|
587
|
+
|
588
|
+
LOperand* LChunkBuilder::UseTempRegister(HValue* value) {
|
589
|
+
return Use(value, new LUnallocated(LUnallocated::WRITABLE_REGISTER));
|
590
|
+
}
|
591
|
+
|
592
|
+
|
593
|
+
LOperand* LChunkBuilder::Use(HValue* value) {
|
594
|
+
return Use(value, new LUnallocated(LUnallocated::NONE));
|
595
|
+
}
|
596
|
+
|
597
|
+
|
598
|
+
LOperand* LChunkBuilder::UseAtStart(HValue* value) {
|
599
|
+
return Use(value, new LUnallocated(LUnallocated::NONE,
|
600
|
+
LUnallocated::USED_AT_START));
|
601
|
+
}
|
602
|
+
|
603
|
+
|
604
|
+
LOperand* LChunkBuilder::UseOrConstant(HValue* value) {
|
605
|
+
return value->IsConstant()
|
606
|
+
? chunk_->DefineConstantOperand(HConstant::cast(value))
|
607
|
+
: Use(value);
|
608
|
+
}
|
609
|
+
|
610
|
+
|
611
|
+
LOperand* LChunkBuilder::UseOrConstantAtStart(HValue* value) {
|
612
|
+
return value->IsConstant()
|
613
|
+
? chunk_->DefineConstantOperand(HConstant::cast(value))
|
614
|
+
: UseAtStart(value);
|
615
|
+
}
|
616
|
+
|
617
|
+
|
618
|
+
LOperand* LChunkBuilder::UseRegisterOrConstant(HValue* value) {
|
619
|
+
return value->IsConstant()
|
620
|
+
? chunk_->DefineConstantOperand(HConstant::cast(value))
|
621
|
+
: UseRegister(value);
|
622
|
+
}
|
623
|
+
|
624
|
+
|
625
|
+
LOperand* LChunkBuilder::UseRegisterOrConstantAtStart(HValue* value) {
|
626
|
+
return value->IsConstant()
|
627
|
+
? chunk_->DefineConstantOperand(HConstant::cast(value))
|
628
|
+
: UseRegisterAtStart(value);
|
629
|
+
}
|
630
|
+
|
631
|
+
|
632
|
+
LOperand* LChunkBuilder::UseAny(HValue* value) {
|
633
|
+
return value->IsConstant()
|
634
|
+
? chunk_->DefineConstantOperand(HConstant::cast(value))
|
635
|
+
: Use(value, new LUnallocated(LUnallocated::ANY));
|
636
|
+
}
|
637
|
+
|
638
|
+
|
639
|
+
LOperand* LChunkBuilder::Use(HValue* value, LUnallocated* operand) {
|
640
|
+
if (value->EmitAtUses()) {
|
641
|
+
HInstruction* instr = HInstruction::cast(value);
|
642
|
+
VisitInstruction(instr);
|
643
|
+
}
|
644
|
+
allocator_->RecordUse(value, operand);
|
645
|
+
return operand;
|
646
|
+
}
|
647
|
+
|
648
|
+
|
649
|
+
template<int I, int T>
|
650
|
+
LInstruction* LChunkBuilder::Define(LTemplateInstruction<1, I, T>* instr,
|
651
|
+
LUnallocated* result) {
|
652
|
+
allocator_->RecordDefinition(current_instruction_, result);
|
653
|
+
instr->set_result(result);
|
654
|
+
return instr;
|
655
|
+
}
|
656
|
+
|
657
|
+
|
658
|
+
template<int I, int T>
|
659
|
+
LInstruction* LChunkBuilder::Define(LTemplateInstruction<1, I, T>* instr) {
|
660
|
+
return Define(instr, new LUnallocated(LUnallocated::NONE));
|
661
|
+
}
|
662
|
+
|
663
|
+
|
664
|
+
template<int I, int T>
|
665
|
+
LInstruction* LChunkBuilder::DefineAsRegister(
|
666
|
+
LTemplateInstruction<1, I, T>* instr) {
|
667
|
+
return Define(instr, new LUnallocated(LUnallocated::MUST_HAVE_REGISTER));
|
668
|
+
}
|
669
|
+
|
670
|
+
|
671
|
+
template<int I, int T>
|
672
|
+
LInstruction* LChunkBuilder::DefineAsSpilled(
|
673
|
+
LTemplateInstruction<1, I, T>* instr,
|
674
|
+
int index) {
|
675
|
+
return Define(instr, new LUnallocated(LUnallocated::FIXED_SLOT, index));
|
676
|
+
}
|
677
|
+
|
678
|
+
|
679
|
+
template<int I, int T>
|
680
|
+
LInstruction* LChunkBuilder::DefineSameAsFirst(
|
681
|
+
LTemplateInstruction<1, I, T>* instr) {
|
682
|
+
return Define(instr, new LUnallocated(LUnallocated::SAME_AS_FIRST_INPUT));
|
683
|
+
}
|
684
|
+
|
685
|
+
|
686
|
+
template<int I, int T>
|
687
|
+
LInstruction* LChunkBuilder::DefineFixed(LTemplateInstruction<1, I, T>* instr,
|
688
|
+
Register reg) {
|
689
|
+
return Define(instr, ToUnallocated(reg));
|
690
|
+
}
|
691
|
+
|
692
|
+
|
693
|
+
template<int I, int T>
|
694
|
+
LInstruction* LChunkBuilder::DefineFixedDouble(
|
695
|
+
LTemplateInstruction<1, I, T>* instr,
|
696
|
+
XMMRegister reg) {
|
697
|
+
return Define(instr, ToUnallocated(reg));
|
698
|
+
}
|
699
|
+
|
700
|
+
|
701
|
+
LInstruction* LChunkBuilder::AssignEnvironment(LInstruction* instr) {
|
702
|
+
HEnvironment* hydrogen_env = current_block_->last_environment();
|
703
|
+
instr->set_environment(CreateEnvironment(hydrogen_env));
|
704
|
+
return instr;
|
705
|
+
}
|
706
|
+
|
707
|
+
|
708
|
+
LInstruction* LChunkBuilder::SetInstructionPendingDeoptimizationEnvironment(
|
709
|
+
LInstruction* instr, int ast_id) {
|
710
|
+
ASSERT(instruction_pending_deoptimization_environment_ == NULL);
|
711
|
+
ASSERT(pending_deoptimization_ast_id_ == AstNode::kNoNumber);
|
712
|
+
instruction_pending_deoptimization_environment_ = instr;
|
713
|
+
pending_deoptimization_ast_id_ = ast_id;
|
714
|
+
return instr;
|
715
|
+
}
|
716
|
+
|
717
|
+
|
718
|
+
void LChunkBuilder::ClearInstructionPendingDeoptimizationEnvironment() {
|
719
|
+
instruction_pending_deoptimization_environment_ = NULL;
|
720
|
+
pending_deoptimization_ast_id_ = AstNode::kNoNumber;
|
721
|
+
}
|
722
|
+
|
723
|
+
|
724
|
+
LInstruction* LChunkBuilder::MarkAsCall(LInstruction* instr,
|
725
|
+
HInstruction* hinstr,
|
726
|
+
CanDeoptimize can_deoptimize) {
|
727
|
+
#ifdef DEBUG
|
728
|
+
instr->VerifyCall();
|
729
|
+
#endif
|
730
|
+
instr->MarkAsCall();
|
731
|
+
instr = AssignPointerMap(instr);
|
732
|
+
|
733
|
+
if (hinstr->HasSideEffects()) {
|
734
|
+
ASSERT(hinstr->next()->IsSimulate());
|
735
|
+
HSimulate* sim = HSimulate::cast(hinstr->next());
|
736
|
+
instr = SetInstructionPendingDeoptimizationEnvironment(
|
737
|
+
instr, sim->ast_id());
|
738
|
+
}
|
739
|
+
|
740
|
+
// If instruction does not have side-effects lazy deoptimization
|
741
|
+
// after the call will try to deoptimize to the point before the call.
|
742
|
+
// Thus we still need to attach environment to this call even if
|
743
|
+
// call sequence can not deoptimize eagerly.
|
744
|
+
bool needs_environment =
|
745
|
+
(can_deoptimize == CAN_DEOPTIMIZE_EAGERLY) || !hinstr->HasSideEffects();
|
746
|
+
if (needs_environment && !instr->HasEnvironment()) {
|
747
|
+
instr = AssignEnvironment(instr);
|
748
|
+
}
|
749
|
+
|
750
|
+
return instr;
|
751
|
+
}
|
752
|
+
|
753
|
+
|
754
|
+
LInstruction* LChunkBuilder::MarkAsSaveDoubles(LInstruction* instr) {
|
755
|
+
instr->MarkAsSaveDoubles();
|
756
|
+
return instr;
|
757
|
+
}
|
758
|
+
|
759
|
+
|
760
|
+
LInstruction* LChunkBuilder::AssignPointerMap(LInstruction* instr) {
|
761
|
+
ASSERT(!instr->HasPointerMap());
|
762
|
+
instr->set_pointer_map(new LPointerMap(position_));
|
763
|
+
return instr;
|
764
|
+
}
|
765
|
+
|
766
|
+
|
767
|
+
LUnallocated* LChunkBuilder::TempRegister() {
|
768
|
+
LUnallocated* operand = new LUnallocated(LUnallocated::MUST_HAVE_REGISTER);
|
769
|
+
allocator_->RecordTemporary(operand);
|
770
|
+
return operand;
|
771
|
+
}
|
772
|
+
|
773
|
+
|
774
|
+
LOperand* LChunkBuilder::FixedTemp(Register reg) {
|
775
|
+
LUnallocated* operand = ToUnallocated(reg);
|
776
|
+
allocator_->RecordTemporary(operand);
|
777
|
+
return operand;
|
778
|
+
}
|
779
|
+
|
780
|
+
|
781
|
+
LOperand* LChunkBuilder::FixedTemp(XMMRegister reg) {
|
782
|
+
LUnallocated* operand = ToUnallocated(reg);
|
783
|
+
allocator_->RecordTemporary(operand);
|
784
|
+
return operand;
|
785
|
+
}
|
786
|
+
|
787
|
+
|
788
|
+
LInstruction* LChunkBuilder::DoBlockEntry(HBlockEntry* instr) {
|
789
|
+
return new LLabel(instr->block());
|
790
|
+
}
|
791
|
+
|
792
|
+
|
793
|
+
LInstruction* LChunkBuilder::DoDeoptimize(HDeoptimize* instr) {
|
794
|
+
return AssignEnvironment(new LDeoptimize);
|
795
|
+
}
|
796
|
+
|
797
|
+
|
798
|
+
LInstruction* LChunkBuilder::DoBit(Token::Value op,
|
799
|
+
HBitwiseBinaryOperation* instr) {
|
800
|
+
if (instr->representation().IsInteger32()) {
|
801
|
+
ASSERT(instr->left()->representation().IsInteger32());
|
802
|
+
ASSERT(instr->right()->representation().IsInteger32());
|
803
|
+
|
804
|
+
LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand());
|
805
|
+
LOperand* right = UseOrConstantAtStart(instr->MostConstantOperand());
|
806
|
+
return DefineSameAsFirst(new LBitI(op, left, right));
|
807
|
+
} else {
|
808
|
+
ASSERT(instr->representation().IsTagged());
|
809
|
+
ASSERT(instr->left()->representation().IsTagged());
|
810
|
+
ASSERT(instr->right()->representation().IsTagged());
|
811
|
+
|
812
|
+
LOperand* left = UseFixed(instr->left(), rdx);
|
813
|
+
LOperand* right = UseFixed(instr->right(), rax);
|
814
|
+
LArithmeticT* result = new LArithmeticT(op, left, right);
|
815
|
+
return MarkAsCall(DefineFixed(result, rax), instr);
|
816
|
+
}
|
817
|
+
}
|
818
|
+
|
819
|
+
|
820
|
+
LInstruction* LChunkBuilder::DoShift(Token::Value op,
|
821
|
+
HBitwiseBinaryOperation* instr) {
|
822
|
+
if (instr->representation().IsTagged()) {
|
823
|
+
ASSERT(instr->left()->representation().IsTagged());
|
824
|
+
ASSERT(instr->right()->representation().IsTagged());
|
825
|
+
|
826
|
+
LOperand* left = UseFixed(instr->left(), rdx);
|
827
|
+
LOperand* right = UseFixed(instr->right(), rax);
|
828
|
+
LArithmeticT* result = new LArithmeticT(op, left, right);
|
829
|
+
return MarkAsCall(DefineFixed(result, rax), instr);
|
830
|
+
}
|
831
|
+
|
832
|
+
ASSERT(instr->representation().IsInteger32());
|
833
|
+
ASSERT(instr->OperandAt(0)->representation().IsInteger32());
|
834
|
+
ASSERT(instr->OperandAt(1)->representation().IsInteger32());
|
835
|
+
LOperand* left = UseRegisterAtStart(instr->OperandAt(0));
|
836
|
+
|
837
|
+
HValue* right_value = instr->OperandAt(1);
|
838
|
+
LOperand* right = NULL;
|
839
|
+
int constant_value = 0;
|
840
|
+
if (right_value->IsConstant()) {
|
841
|
+
HConstant* constant = HConstant::cast(right_value);
|
842
|
+
right = chunk_->DefineConstantOperand(constant);
|
843
|
+
constant_value = constant->Integer32Value() & 0x1f;
|
844
|
+
} else {
|
845
|
+
right = UseFixed(right_value, rcx);
|
846
|
+
}
|
847
|
+
|
848
|
+
// Shift operations can only deoptimize if we do a logical shift
|
849
|
+
// by 0 and the result cannot be truncated to int32.
|
850
|
+
bool can_deopt = (op == Token::SHR && constant_value == 0);
|
851
|
+
if (can_deopt) {
|
852
|
+
bool can_truncate = true;
|
853
|
+
for (int i = 0; i < instr->uses()->length(); i++) {
|
854
|
+
if (!instr->uses()->at(i)->CheckFlag(HValue::kTruncatingToInt32)) {
|
855
|
+
can_truncate = false;
|
856
|
+
break;
|
857
|
+
}
|
858
|
+
}
|
859
|
+
can_deopt = !can_truncate;
|
860
|
+
}
|
861
|
+
|
862
|
+
LShiftI* result = new LShiftI(op, left, right, can_deopt);
|
863
|
+
return can_deopt
|
864
|
+
? AssignEnvironment(DefineSameAsFirst(result))
|
865
|
+
: DefineSameAsFirst(result);
|
866
|
+
}
|
867
|
+
|
868
|
+
|
869
|
+
LInstruction* LChunkBuilder::DoArithmeticD(Token::Value op,
|
870
|
+
HArithmeticBinaryOperation* instr) {
|
871
|
+
ASSERT(instr->representation().IsDouble());
|
872
|
+
ASSERT(instr->left()->representation().IsDouble());
|
873
|
+
ASSERT(instr->right()->representation().IsDouble());
|
874
|
+
ASSERT(op != Token::MOD);
|
875
|
+
LOperand* left = UseRegisterAtStart(instr->left());
|
876
|
+
LOperand* right = UseRegisterAtStart(instr->right());
|
877
|
+
LArithmeticD* result = new LArithmeticD(op, left, right);
|
878
|
+
return DefineSameAsFirst(result);
|
879
|
+
}
|
880
|
+
|
881
|
+
|
882
|
+
LInstruction* LChunkBuilder::DoArithmeticT(Token::Value op,
|
883
|
+
HArithmeticBinaryOperation* instr) {
|
884
|
+
ASSERT(op == Token::ADD ||
|
885
|
+
op == Token::DIV ||
|
886
|
+
op == Token::MOD ||
|
887
|
+
op == Token::MUL ||
|
888
|
+
op == Token::SUB);
|
889
|
+
HValue* left = instr->left();
|
890
|
+
HValue* right = instr->right();
|
891
|
+
ASSERT(left->representation().IsTagged());
|
892
|
+
ASSERT(right->representation().IsTagged());
|
893
|
+
LOperand* left_operand = UseFixed(left, rdx);
|
894
|
+
LOperand* right_operand = UseFixed(right, rax);
|
895
|
+
LArithmeticT* result = new LArithmeticT(op, left_operand, right_operand);
|
896
|
+
return MarkAsCall(DefineFixed(result, rax), instr);
|
897
|
+
}
|
898
|
+
|
899
|
+
|
900
|
+
void LChunkBuilder::DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block) {
|
901
|
+
ASSERT(is_building());
|
902
|
+
current_block_ = block;
|
903
|
+
next_block_ = next_block;
|
904
|
+
if (block->IsStartBlock()) {
|
905
|
+
block->UpdateEnvironment(graph_->start_environment());
|
906
|
+
argument_count_ = 0;
|
907
|
+
} else if (block->predecessors()->length() == 1) {
|
908
|
+
// We have a single predecessor => copy environment and outgoing
|
909
|
+
// argument count from the predecessor.
|
910
|
+
ASSERT(block->phis()->length() == 0);
|
911
|
+
HBasicBlock* pred = block->predecessors()->at(0);
|
912
|
+
HEnvironment* last_environment = pred->last_environment();
|
913
|
+
ASSERT(last_environment != NULL);
|
914
|
+
// Only copy the environment, if it is later used again.
|
915
|
+
if (pred->end()->SecondSuccessor() == NULL) {
|
916
|
+
ASSERT(pred->end()->FirstSuccessor() == block);
|
917
|
+
} else {
|
918
|
+
if (pred->end()->FirstSuccessor()->block_id() > block->block_id() ||
|
919
|
+
pred->end()->SecondSuccessor()->block_id() > block->block_id()) {
|
920
|
+
last_environment = last_environment->Copy();
|
921
|
+
}
|
922
|
+
}
|
923
|
+
block->UpdateEnvironment(last_environment);
|
924
|
+
ASSERT(pred->argument_count() >= 0);
|
925
|
+
argument_count_ = pred->argument_count();
|
926
|
+
} else {
|
927
|
+
// We are at a state join => process phis.
|
928
|
+
HBasicBlock* pred = block->predecessors()->at(0);
|
929
|
+
// No need to copy the environment, it cannot be used later.
|
930
|
+
HEnvironment* last_environment = pred->last_environment();
|
931
|
+
for (int i = 0; i < block->phis()->length(); ++i) {
|
932
|
+
HPhi* phi = block->phis()->at(i);
|
933
|
+
last_environment->SetValueAt(phi->merged_index(), phi);
|
934
|
+
}
|
935
|
+
for (int i = 0; i < block->deleted_phis()->length(); ++i) {
|
936
|
+
last_environment->SetValueAt(block->deleted_phis()->at(i),
|
937
|
+
graph_->GetConstantUndefined());
|
938
|
+
}
|
939
|
+
block->UpdateEnvironment(last_environment);
|
940
|
+
// Pick up the outgoing argument count of one of the predecessors.
|
941
|
+
argument_count_ = pred->argument_count();
|
942
|
+
}
|
943
|
+
HInstruction* current = block->first();
|
944
|
+
int start = chunk_->instructions()->length();
|
945
|
+
while (current != NULL && !is_aborted()) {
|
946
|
+
// Code for constants in registers is generated lazily.
|
947
|
+
if (!current->EmitAtUses()) {
|
948
|
+
VisitInstruction(current);
|
949
|
+
}
|
950
|
+
current = current->next();
|
951
|
+
}
|
952
|
+
int end = chunk_->instructions()->length() - 1;
|
953
|
+
if (end >= start) {
|
954
|
+
block->set_first_instruction_index(start);
|
955
|
+
block->set_last_instruction_index(end);
|
956
|
+
}
|
957
|
+
block->set_argument_count(argument_count_);
|
958
|
+
next_block_ = NULL;
|
959
|
+
current_block_ = NULL;
|
960
|
+
}
|
961
|
+
|
962
|
+
|
963
|
+
void LChunkBuilder::VisitInstruction(HInstruction* current) {
|
964
|
+
HInstruction* old_current = current_instruction_;
|
965
|
+
current_instruction_ = current;
|
966
|
+
if (current->has_position()) position_ = current->position();
|
967
|
+
LInstruction* instr = current->CompileToLithium(this);
|
968
|
+
|
969
|
+
if (instr != NULL) {
|
970
|
+
if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) {
|
971
|
+
instr = AssignPointerMap(instr);
|
972
|
+
}
|
973
|
+
if (FLAG_stress_environments && !instr->HasEnvironment()) {
|
974
|
+
instr = AssignEnvironment(instr);
|
975
|
+
}
|
976
|
+
if (current->IsTest() && !instr->IsGoto()) {
|
977
|
+
ASSERT(instr->IsControl());
|
978
|
+
HTest* test = HTest::cast(current);
|
979
|
+
instr->set_hydrogen_value(test->value());
|
980
|
+
HBasicBlock* first = test->FirstSuccessor();
|
981
|
+
HBasicBlock* second = test->SecondSuccessor();
|
982
|
+
ASSERT(first != NULL && second != NULL);
|
983
|
+
instr->SetBranchTargets(first->block_id(), second->block_id());
|
984
|
+
} else {
|
985
|
+
instr->set_hydrogen_value(current);
|
986
|
+
}
|
987
|
+
|
988
|
+
chunk_->AddInstruction(instr, current_block_);
|
989
|
+
}
|
990
|
+
current_instruction_ = old_current;
|
991
|
+
}
|
992
|
+
|
993
|
+
|
994
|
+
LEnvironment* LChunkBuilder::CreateEnvironment(HEnvironment* hydrogen_env) {
|
995
|
+
if (hydrogen_env == NULL) return NULL;
|
996
|
+
|
997
|
+
LEnvironment* outer = CreateEnvironment(hydrogen_env->outer());
|
998
|
+
int ast_id = hydrogen_env->ast_id();
|
999
|
+
ASSERT(ast_id != AstNode::kNoNumber);
|
1000
|
+
int value_count = hydrogen_env->length();
|
1001
|
+
LEnvironment* result = new LEnvironment(hydrogen_env->closure(),
|
1002
|
+
ast_id,
|
1003
|
+
hydrogen_env->parameter_count(),
|
1004
|
+
argument_count_,
|
1005
|
+
value_count,
|
1006
|
+
outer);
|
1007
|
+
int argument_index = 0;
|
1008
|
+
for (int i = 0; i < value_count; ++i) {
|
1009
|
+
HValue* value = hydrogen_env->values()->at(i);
|
1010
|
+
LOperand* op = NULL;
|
1011
|
+
if (value->IsArgumentsObject()) {
|
1012
|
+
op = NULL;
|
1013
|
+
} else if (value->IsPushArgument()) {
|
1014
|
+
op = new LArgument(argument_index++);
|
1015
|
+
} else {
|
1016
|
+
op = UseAny(value);
|
1017
|
+
}
|
1018
|
+
result->AddValue(op, value->representation());
|
1019
|
+
}
|
1020
|
+
|
1021
|
+
return result;
|
1022
|
+
}
|
1023
|
+
|
1024
|
+
|
1025
|
+
LInstruction* LChunkBuilder::DoGoto(HGoto* instr) {
|
1026
|
+
LGoto* result = new LGoto(instr->FirstSuccessor()->block_id(),
|
1027
|
+
instr->include_stack_check());
|
1028
|
+
return (instr->include_stack_check())
|
1029
|
+
? AssignPointerMap(result)
|
1030
|
+
: result;
|
1031
|
+
}
|
1032
|
+
|
1033
|
+
|
1034
|
+
LInstruction* LChunkBuilder::DoTest(HTest* instr) {
|
1035
|
+
HValue* v = instr->value();
|
1036
|
+
if (v->EmitAtUses()) {
|
1037
|
+
if (v->IsClassOfTest()) {
|
1038
|
+
HClassOfTest* compare = HClassOfTest::cast(v);
|
1039
|
+
ASSERT(compare->value()->representation().IsTagged());
|
1040
|
+
|
1041
|
+
return new LClassOfTestAndBranch(UseTempRegister(compare->value()),
|
1042
|
+
TempRegister());
|
1043
|
+
} else if (v->IsCompare()) {
|
1044
|
+
HCompare* compare = HCompare::cast(v);
|
1045
|
+
Token::Value op = compare->token();
|
1046
|
+
HValue* left = compare->left();
|
1047
|
+
HValue* right = compare->right();
|
1048
|
+
Representation r = compare->GetInputRepresentation();
|
1049
|
+
if (r.IsInteger32()) {
|
1050
|
+
ASSERT(left->representation().IsInteger32());
|
1051
|
+
ASSERT(right->representation().IsInteger32());
|
1052
|
+
|
1053
|
+
return new LCmpIDAndBranch(UseRegisterAtStart(left),
|
1054
|
+
UseOrConstantAtStart(right));
|
1055
|
+
} else if (r.IsDouble()) {
|
1056
|
+
ASSERT(left->representation().IsDouble());
|
1057
|
+
ASSERT(right->representation().IsDouble());
|
1058
|
+
|
1059
|
+
return new LCmpIDAndBranch(UseRegisterAtStart(left),
|
1060
|
+
UseRegisterAtStart(right));
|
1061
|
+
} else {
|
1062
|
+
ASSERT(left->representation().IsTagged());
|
1063
|
+
ASSERT(right->representation().IsTagged());
|
1064
|
+
bool reversed = op == Token::GT || op == Token::LTE;
|
1065
|
+
LOperand* left_operand = UseFixed(left, reversed ? rax : rdx);
|
1066
|
+
LOperand* right_operand = UseFixed(right, reversed ? rdx : rax);
|
1067
|
+
LCmpTAndBranch* result = new LCmpTAndBranch(left_operand,
|
1068
|
+
right_operand);
|
1069
|
+
return MarkAsCall(result, instr);
|
1070
|
+
}
|
1071
|
+
} else if (v->IsIsSmi()) {
|
1072
|
+
HIsSmi* compare = HIsSmi::cast(v);
|
1073
|
+
ASSERT(compare->value()->representation().IsTagged());
|
1074
|
+
|
1075
|
+
return new LIsSmiAndBranch(Use(compare->value()));
|
1076
|
+
} else if (v->IsHasInstanceType()) {
|
1077
|
+
HHasInstanceType* compare = HHasInstanceType::cast(v);
|
1078
|
+
ASSERT(compare->value()->representation().IsTagged());
|
1079
|
+
|
1080
|
+
return new LHasInstanceTypeAndBranch(
|
1081
|
+
UseRegisterAtStart(compare->value()));
|
1082
|
+
} else if (v->IsHasCachedArrayIndex()) {
|
1083
|
+
HHasCachedArrayIndex* compare = HHasCachedArrayIndex::cast(v);
|
1084
|
+
ASSERT(compare->value()->representation().IsTagged());
|
1085
|
+
|
1086
|
+
return new LHasCachedArrayIndexAndBranch(
|
1087
|
+
UseRegisterAtStart(compare->value()));
|
1088
|
+
} else if (v->IsIsNull()) {
|
1089
|
+
HIsNull* compare = HIsNull::cast(v);
|
1090
|
+
ASSERT(compare->value()->representation().IsTagged());
|
1091
|
+
|
1092
|
+
// We only need a temp register for non-strict compare.
|
1093
|
+
LOperand* temp = compare->is_strict() ? NULL : TempRegister();
|
1094
|
+
return new LIsNullAndBranch(UseRegisterAtStart(compare->value()),
|
1095
|
+
temp);
|
1096
|
+
} else if (v->IsIsObject()) {
|
1097
|
+
HIsObject* compare = HIsObject::cast(v);
|
1098
|
+
ASSERT(compare->value()->representation().IsTagged());
|
1099
|
+
return new LIsObjectAndBranch(UseRegisterAtStart(compare->value()));
|
1100
|
+
} else if (v->IsCompareJSObjectEq()) {
|
1101
|
+
HCompareJSObjectEq* compare = HCompareJSObjectEq::cast(v);
|
1102
|
+
return new LCmpJSObjectEqAndBranch(UseRegisterAtStart(compare->left()),
|
1103
|
+
UseRegisterAtStart(compare->right()));
|
1104
|
+
} else if (v->IsInstanceOf()) {
|
1105
|
+
HInstanceOf* instance_of = HInstanceOf::cast(v);
|
1106
|
+
LInstanceOfAndBranch* result =
|
1107
|
+
new LInstanceOfAndBranch(UseFixed(instance_of->left(), rax),
|
1108
|
+
UseFixed(instance_of->right(), rdx));
|
1109
|
+
return MarkAsCall(result, instr);
|
1110
|
+
} else if (v->IsTypeofIs()) {
|
1111
|
+
HTypeofIs* typeof_is = HTypeofIs::cast(v);
|
1112
|
+
return new LTypeofIsAndBranch(UseTempRegister(typeof_is->value()));
|
1113
|
+
} else if (v->IsIsConstructCall()) {
|
1114
|
+
return new LIsConstructCallAndBranch(TempRegister());
|
1115
|
+
} else {
|
1116
|
+
if (v->IsConstant()) {
|
1117
|
+
if (HConstant::cast(v)->handle()->IsTrue()) {
|
1118
|
+
return new LGoto(instr->FirstSuccessor()->block_id());
|
1119
|
+
} else if (HConstant::cast(v)->handle()->IsFalse()) {
|
1120
|
+
return new LGoto(instr->SecondSuccessor()->block_id());
|
1121
|
+
}
|
1122
|
+
}
|
1123
|
+
Abort("Undefined compare before branch");
|
1124
|
+
return NULL;
|
1125
|
+
}
|
1126
|
+
}
|
1127
|
+
return new LBranch(UseRegisterAtStart(v));
|
1128
|
+
}
|
1129
|
+
|
1130
|
+
|
1131
|
+
LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) {
|
1132
|
+
ASSERT(instr->value()->representation().IsTagged());
|
1133
|
+
LOperand* value = UseRegisterAtStart(instr->value());
|
1134
|
+
return new LCmpMapAndBranch(value);
|
1135
|
+
}
|
1136
|
+
|
1137
|
+
|
1138
|
+
LInstruction* LChunkBuilder::DoArgumentsLength(HArgumentsLength* length) {
|
1139
|
+
return DefineAsRegister(new LArgumentsLength(Use(length->value())));
|
1140
|
+
}
|
1141
|
+
|
1142
|
+
|
1143
|
+
LInstruction* LChunkBuilder::DoArgumentsElements(HArgumentsElements* elems) {
|
1144
|
+
return DefineAsRegister(new LArgumentsElements);
|
1145
|
+
}
|
1146
|
+
|
1147
|
+
|
1148
|
+
LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) {
|
1149
|
+
LOperand* left = UseFixed(instr->left(), rax);
|
1150
|
+
LOperand* right = UseFixed(instr->right(), rdx);
|
1151
|
+
LInstanceOf* result = new LInstanceOf(left, right);
|
1152
|
+
return MarkAsCall(DefineFixed(result, rax), instr);
|
1153
|
+
}
|
1154
|
+
|
1155
|
+
|
1156
|
+
LInstruction* LChunkBuilder::DoInstanceOfKnownGlobal(
|
1157
|
+
HInstanceOfKnownGlobal* instr) {
|
1158
|
+
LInstanceOfKnownGlobal* result =
|
1159
|
+
new LInstanceOfKnownGlobal(UseFixed(instr->value(), rax),
|
1160
|
+
FixedTemp(rdi));
|
1161
|
+
return MarkAsCall(DefineFixed(result, rax), instr);
|
1162
|
+
}
|
1163
|
+
|
1164
|
+
|
1165
|
+
LInstruction* LChunkBuilder::DoApplyArguments(HApplyArguments* instr) {
|
1166
|
+
LOperand* function = UseFixed(instr->function(), rdi);
|
1167
|
+
LOperand* receiver = UseFixed(instr->receiver(), rax);
|
1168
|
+
LOperand* length = UseFixed(instr->length(), rbx);
|
1169
|
+
LOperand* elements = UseFixed(instr->elements(), rcx);
|
1170
|
+
LApplyArguments* result = new LApplyArguments(function,
|
1171
|
+
receiver,
|
1172
|
+
length,
|
1173
|
+
elements);
|
1174
|
+
return MarkAsCall(DefineFixed(result, rax), instr, CAN_DEOPTIMIZE_EAGERLY);
|
1175
|
+
}
|
1176
|
+
|
1177
|
+
|
1178
|
+
LInstruction* LChunkBuilder::DoPushArgument(HPushArgument* instr) {
|
1179
|
+
++argument_count_;
|
1180
|
+
LOperand* argument = UseOrConstant(instr->argument());
|
1181
|
+
return new LPushArgument(argument);
|
1182
|
+
}
|
1183
|
+
|
1184
|
+
|
1185
|
+
LInstruction* LChunkBuilder::DoContext(HContext* instr) {
|
1186
|
+
return DefineAsRegister(new LContext);
|
1187
|
+
}
|
1188
|
+
|
1189
|
+
|
1190
|
+
LInstruction* LChunkBuilder::DoOuterContext(HOuterContext* instr) {
|
1191
|
+
LOperand* context = UseRegisterAtStart(instr->value());
|
1192
|
+
return DefineAsRegister(new LOuterContext(context));
|
1193
|
+
}
|
1194
|
+
|
1195
|
+
|
1196
|
+
LInstruction* LChunkBuilder::DoGlobalObject(HGlobalObject* instr) {
|
1197
|
+
return DefineAsRegister(new LGlobalObject);
|
1198
|
+
}
|
1199
|
+
|
1200
|
+
|
1201
|
+
LInstruction* LChunkBuilder::DoGlobalReceiver(HGlobalReceiver* instr) {
|
1202
|
+
LOperand* global_object = UseRegisterAtStart(instr->value());
|
1203
|
+
return DefineAsRegister(new LGlobalReceiver(global_object));
|
1204
|
+
}
|
1205
|
+
|
1206
|
+
|
1207
|
+
LInstruction* LChunkBuilder::DoCallConstantFunction(
|
1208
|
+
HCallConstantFunction* instr) {
|
1209
|
+
argument_count_ -= instr->argument_count();
|
1210
|
+
return MarkAsCall(DefineFixed(new LCallConstantFunction, rax), instr);
|
1211
|
+
}
|
1212
|
+
|
1213
|
+
|
1214
|
+
LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) {
|
1215
|
+
BuiltinFunctionId op = instr->op();
|
1216
|
+
if (op == kMathLog || op == kMathSin || op == kMathCos) {
|
1217
|
+
LOperand* input = UseFixedDouble(instr->value(), xmm1);
|
1218
|
+
LUnaryMathOperation* result = new LUnaryMathOperation(input);
|
1219
|
+
return MarkAsCall(DefineFixedDouble(result, xmm1), instr);
|
1220
|
+
} else {
|
1221
|
+
LOperand* input = UseRegisterAtStart(instr->value());
|
1222
|
+
LUnaryMathOperation* result = new LUnaryMathOperation(input);
|
1223
|
+
switch (op) {
|
1224
|
+
case kMathAbs:
|
1225
|
+
return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result)));
|
1226
|
+
case kMathFloor:
|
1227
|
+
return AssignEnvironment(DefineAsRegister(result));
|
1228
|
+
case kMathRound:
|
1229
|
+
return AssignEnvironment(DefineAsRegister(result));
|
1230
|
+
case kMathSqrt:
|
1231
|
+
return DefineSameAsFirst(result);
|
1232
|
+
case kMathPowHalf:
|
1233
|
+
return DefineSameAsFirst(result);
|
1234
|
+
default:
|
1235
|
+
UNREACHABLE();
|
1236
|
+
return NULL;
|
1237
|
+
}
|
1238
|
+
}
|
1239
|
+
}
|
1240
|
+
|
1241
|
+
|
1242
|
+
LInstruction* LChunkBuilder::DoCallKeyed(HCallKeyed* instr) {
|
1243
|
+
ASSERT(instr->key()->representation().IsTagged());
|
1244
|
+
LOperand* key = UseFixed(instr->key(), rcx);
|
1245
|
+
argument_count_ -= instr->argument_count();
|
1246
|
+
LCallKeyed* result = new LCallKeyed(key);
|
1247
|
+
return MarkAsCall(DefineFixed(result, rax), instr);
|
1248
|
+
}
|
1249
|
+
|
1250
|
+
|
1251
|
+
LInstruction* LChunkBuilder::DoCallNamed(HCallNamed* instr) {
|
1252
|
+
argument_count_ -= instr->argument_count();
|
1253
|
+
return MarkAsCall(DefineFixed(new LCallNamed, rax), instr);
|
1254
|
+
}
|
1255
|
+
|
1256
|
+
|
1257
|
+
LInstruction* LChunkBuilder::DoCallGlobal(HCallGlobal* instr) {
|
1258
|
+
argument_count_ -= instr->argument_count();
|
1259
|
+
return MarkAsCall(DefineFixed(new LCallGlobal, rax), instr);
|
1260
|
+
}
|
1261
|
+
|
1262
|
+
|
1263
|
+
LInstruction* LChunkBuilder::DoCallKnownGlobal(HCallKnownGlobal* instr) {
|
1264
|
+
argument_count_ -= instr->argument_count();
|
1265
|
+
return MarkAsCall(DefineFixed(new LCallKnownGlobal, rax), instr);
|
1266
|
+
}
|
1267
|
+
|
1268
|
+
|
1269
|
+
LInstruction* LChunkBuilder::DoCallNew(HCallNew* instr) {
|
1270
|
+
LOperand* constructor = UseFixed(instr->constructor(), rdi);
|
1271
|
+
argument_count_ -= instr->argument_count();
|
1272
|
+
LCallNew* result = new LCallNew(constructor);
|
1273
|
+
return MarkAsCall(DefineFixed(result, rax), instr);
|
1274
|
+
}
|
1275
|
+
|
1276
|
+
|
1277
|
+
LInstruction* LChunkBuilder::DoCallFunction(HCallFunction* instr) {
|
1278
|
+
argument_count_ -= instr->argument_count();
|
1279
|
+
LCallFunction* result = new LCallFunction();
|
1280
|
+
return MarkAsCall(DefineFixed(result, rax), instr);
|
1281
|
+
}
|
1282
|
+
|
1283
|
+
|
1284
|
+
LInstruction* LChunkBuilder::DoCallRuntime(HCallRuntime* instr) {
|
1285
|
+
argument_count_ -= instr->argument_count();
|
1286
|
+
return MarkAsCall(DefineFixed(new LCallRuntime, rax), instr);
|
1287
|
+
}
|
1288
|
+
|
1289
|
+
|
1290
|
+
LInstruction* LChunkBuilder::DoShr(HShr* instr) {
|
1291
|
+
return DoShift(Token::SHR, instr);
|
1292
|
+
}
|
1293
|
+
|
1294
|
+
|
1295
|
+
LInstruction* LChunkBuilder::DoSar(HSar* instr) {
|
1296
|
+
return DoShift(Token::SAR, instr);
|
1297
|
+
}
|
1298
|
+
|
1299
|
+
|
1300
|
+
LInstruction* LChunkBuilder::DoShl(HShl* instr) {
|
1301
|
+
return DoShift(Token::SHL, instr);
|
1302
|
+
}
|
1303
|
+
|
1304
|
+
|
1305
|
+
LInstruction* LChunkBuilder::DoBitAnd(HBitAnd* instr) {
|
1306
|
+
return DoBit(Token::BIT_AND, instr);
|
1307
|
+
}
|
1308
|
+
|
1309
|
+
|
1310
|
+
LInstruction* LChunkBuilder::DoBitNot(HBitNot* instr) {
|
1311
|
+
ASSERT(instr->value()->representation().IsInteger32());
|
1312
|
+
ASSERT(instr->representation().IsInteger32());
|
1313
|
+
LOperand* input = UseRegisterAtStart(instr->value());
|
1314
|
+
LBitNotI* result = new LBitNotI(input);
|
1315
|
+
return DefineSameAsFirst(result);
|
1316
|
+
}
|
1317
|
+
|
1318
|
+
|
1319
|
+
LInstruction* LChunkBuilder::DoBitOr(HBitOr* instr) {
|
1320
|
+
return DoBit(Token::BIT_OR, instr);
|
1321
|
+
}
|
1322
|
+
|
1323
|
+
|
1324
|
+
LInstruction* LChunkBuilder::DoBitXor(HBitXor* instr) {
|
1325
|
+
return DoBit(Token::BIT_XOR, instr);
|
1326
|
+
}
|
1327
|
+
|
1328
|
+
|
1329
|
+
LInstruction* LChunkBuilder::DoDiv(HDiv* instr) {
|
1330
|
+
if (instr->representation().IsDouble()) {
|
1331
|
+
return DoArithmeticD(Token::DIV, instr);
|
1332
|
+
} else if (instr->representation().IsInteger32()) {
|
1333
|
+
// The temporary operand is necessary to ensure that right is not allocated
|
1334
|
+
// into rdx.
|
1335
|
+
LOperand* temp = FixedTemp(rdx);
|
1336
|
+
LOperand* dividend = UseFixed(instr->left(), rax);
|
1337
|
+
LOperand* divisor = UseRegister(instr->right());
|
1338
|
+
LDivI* result = new LDivI(dividend, divisor, temp);
|
1339
|
+
return AssignEnvironment(DefineFixed(result, rax));
|
1340
|
+
} else {
|
1341
|
+
ASSERT(instr->representation().IsTagged());
|
1342
|
+
return DoArithmeticT(Token::DIV, instr);
|
1343
|
+
}
|
1344
|
+
}
|
1345
|
+
|
1346
|
+
|
1347
|
+
LInstruction* LChunkBuilder::DoMod(HMod* instr) {
|
1348
|
+
if (instr->representation().IsInteger32()) {
|
1349
|
+
ASSERT(instr->left()->representation().IsInteger32());
|
1350
|
+
ASSERT(instr->right()->representation().IsInteger32());
|
1351
|
+
|
1352
|
+
LInstruction* result;
|
1353
|
+
if (instr->HasPowerOf2Divisor()) {
|
1354
|
+
ASSERT(!instr->CheckFlag(HValue::kCanBeDivByZero));
|
1355
|
+
LOperand* value = UseRegisterAtStart(instr->left());
|
1356
|
+
LModI* mod = new LModI(value, UseOrConstant(instr->right()), NULL);
|
1357
|
+
result = DefineSameAsFirst(mod);
|
1358
|
+
} else {
|
1359
|
+
// The temporary operand is necessary to ensure that right is not
|
1360
|
+
// allocated into edx.
|
1361
|
+
LOperand* temp = FixedTemp(rdx);
|
1362
|
+
LOperand* value = UseFixed(instr->left(), rax);
|
1363
|
+
LOperand* divisor = UseRegister(instr->right());
|
1364
|
+
LModI* mod = new LModI(value, divisor, temp);
|
1365
|
+
result = DefineFixed(mod, rdx);
|
1366
|
+
}
|
1367
|
+
|
1368
|
+
return (instr->CheckFlag(HValue::kBailoutOnMinusZero) ||
|
1369
|
+
instr->CheckFlag(HValue::kCanBeDivByZero))
|
1370
|
+
? AssignEnvironment(result)
|
1371
|
+
: result;
|
1372
|
+
} else if (instr->representation().IsTagged()) {
|
1373
|
+
return DoArithmeticT(Token::MOD, instr);
|
1374
|
+
} else {
|
1375
|
+
ASSERT(instr->representation().IsDouble());
|
1376
|
+
// We call a C function for double modulo. It can't trigger a GC.
|
1377
|
+
// We need to use fixed result register for the call.
|
1378
|
+
// TODO(fschneider): Allow any register as input registers.
|
1379
|
+
LOperand* left = UseFixedDouble(instr->left(), xmm2);
|
1380
|
+
LOperand* right = UseFixedDouble(instr->right(), xmm1);
|
1381
|
+
LArithmeticD* result = new LArithmeticD(Token::MOD, left, right);
|
1382
|
+
return MarkAsCall(DefineFixedDouble(result, xmm1), instr);
|
1383
|
+
}
|
1384
|
+
}
|
1385
|
+
|
1386
|
+
|
1387
|
+
LInstruction* LChunkBuilder::DoMul(HMul* instr) {
|
1388
|
+
if (instr->representation().IsInteger32()) {
|
1389
|
+
ASSERT(instr->left()->representation().IsInteger32());
|
1390
|
+
ASSERT(instr->right()->representation().IsInteger32());
|
1391
|
+
LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand());
|
1392
|
+
LOperand* right = UseOrConstant(instr->MostConstantOperand());
|
1393
|
+
LMulI* mul = new LMulI(left, right);
|
1394
|
+
return AssignEnvironment(DefineSameAsFirst(mul));
|
1395
|
+
} else if (instr->representation().IsDouble()) {
|
1396
|
+
return DoArithmeticD(Token::MUL, instr);
|
1397
|
+
} else {
|
1398
|
+
ASSERT(instr->representation().IsTagged());
|
1399
|
+
return DoArithmeticT(Token::MUL, instr);
|
1400
|
+
}
|
1401
|
+
}
|
1402
|
+
|
1403
|
+
|
1404
|
+
LInstruction* LChunkBuilder::DoSub(HSub* instr) {
|
1405
|
+
if (instr->representation().IsInteger32()) {
|
1406
|
+
ASSERT(instr->left()->representation().IsInteger32());
|
1407
|
+
ASSERT(instr->right()->representation().IsInteger32());
|
1408
|
+
LOperand* left = UseRegisterAtStart(instr->left());
|
1409
|
+
LOperand* right = UseOrConstantAtStart(instr->right());
|
1410
|
+
LSubI* sub = new LSubI(left, right);
|
1411
|
+
LInstruction* result = DefineSameAsFirst(sub);
|
1412
|
+
if (instr->CheckFlag(HValue::kCanOverflow)) {
|
1413
|
+
result = AssignEnvironment(result);
|
1414
|
+
}
|
1415
|
+
return result;
|
1416
|
+
} else if (instr->representation().IsDouble()) {
|
1417
|
+
return DoArithmeticD(Token::SUB, instr);
|
1418
|
+
} else {
|
1419
|
+
ASSERT(instr->representation().IsTagged());
|
1420
|
+
return DoArithmeticT(Token::SUB, instr);
|
1421
|
+
}
|
1422
|
+
}
|
1423
|
+
|
1424
|
+
|
1425
|
+
LInstruction* LChunkBuilder::DoAdd(HAdd* instr) {
|
1426
|
+
if (instr->representation().IsInteger32()) {
|
1427
|
+
ASSERT(instr->left()->representation().IsInteger32());
|
1428
|
+
ASSERT(instr->right()->representation().IsInteger32());
|
1429
|
+
LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand());
|
1430
|
+
LOperand* right = UseOrConstantAtStart(instr->MostConstantOperand());
|
1431
|
+
LAddI* add = new LAddI(left, right);
|
1432
|
+
LInstruction* result = DefineSameAsFirst(add);
|
1433
|
+
if (instr->CheckFlag(HValue::kCanOverflow)) {
|
1434
|
+
result = AssignEnvironment(result);
|
1435
|
+
}
|
1436
|
+
return result;
|
1437
|
+
} else if (instr->representation().IsDouble()) {
|
1438
|
+
return DoArithmeticD(Token::ADD, instr);
|
1439
|
+
} else {
|
1440
|
+
ASSERT(instr->representation().IsTagged());
|
1441
|
+
return DoArithmeticT(Token::ADD, instr);
|
1442
|
+
}
|
1443
|
+
return NULL;
|
1444
|
+
}
|
1445
|
+
|
1446
|
+
|
1447
|
+
LInstruction* LChunkBuilder::DoPower(HPower* instr) {
|
1448
|
+
ASSERT(instr->representation().IsDouble());
|
1449
|
+
// We call a C function for double power. It can't trigger a GC.
|
1450
|
+
// We need to use fixed result register for the call.
|
1451
|
+
Representation exponent_type = instr->right()->representation();
|
1452
|
+
ASSERT(instr->left()->representation().IsDouble());
|
1453
|
+
LOperand* left = UseFixedDouble(instr->left(), xmm2);
|
1454
|
+
LOperand* right = exponent_type.IsDouble() ?
|
1455
|
+
UseFixedDouble(instr->right(), xmm1) :
|
1456
|
+
#ifdef _WIN64
|
1457
|
+
UseFixed(instr->right(), rdx);
|
1458
|
+
#else
|
1459
|
+
UseFixed(instr->right(), rdi);
|
1460
|
+
#endif
|
1461
|
+
LPower* result = new LPower(left, right);
|
1462
|
+
return MarkAsCall(DefineFixedDouble(result, xmm1), instr,
|
1463
|
+
CAN_DEOPTIMIZE_EAGERLY);
|
1464
|
+
}
|
1465
|
+
|
1466
|
+
|
1467
|
+
LInstruction* LChunkBuilder::DoCompare(HCompare* instr) {
|
1468
|
+
Token::Value op = instr->token();
|
1469
|
+
Representation r = instr->GetInputRepresentation();
|
1470
|
+
if (r.IsInteger32()) {
|
1471
|
+
ASSERT(instr->left()->representation().IsInteger32());
|
1472
|
+
ASSERT(instr->right()->representation().IsInteger32());
|
1473
|
+
LOperand* left = UseRegisterAtStart(instr->left());
|
1474
|
+
LOperand* right = UseOrConstantAtStart(instr->right());
|
1475
|
+
return DefineAsRegister(new LCmpID(left, right));
|
1476
|
+
} else if (r.IsDouble()) {
|
1477
|
+
ASSERT(instr->left()->representation().IsDouble());
|
1478
|
+
ASSERT(instr->right()->representation().IsDouble());
|
1479
|
+
LOperand* left = UseRegisterAtStart(instr->left());
|
1480
|
+
LOperand* right = UseRegisterAtStart(instr->right());
|
1481
|
+
return DefineAsRegister(new LCmpID(left, right));
|
1482
|
+
} else {
|
1483
|
+
ASSERT(instr->left()->representation().IsTagged());
|
1484
|
+
ASSERT(instr->right()->representation().IsTagged());
|
1485
|
+
bool reversed = (op == Token::GT || op == Token::LTE);
|
1486
|
+
LOperand* left = UseFixed(instr->left(), reversed ? rax : rdx);
|
1487
|
+
LOperand* right = UseFixed(instr->right(), reversed ? rdx : rax);
|
1488
|
+
LCmpT* result = new LCmpT(left, right);
|
1489
|
+
return MarkAsCall(DefineFixed(result, rax), instr);
|
1490
|
+
}
|
1491
|
+
}
|
1492
|
+
|
1493
|
+
|
1494
|
+
LInstruction* LChunkBuilder::DoCompareJSObjectEq(
|
1495
|
+
HCompareJSObjectEq* instr) {
|
1496
|
+
LOperand* left = UseRegisterAtStart(instr->left());
|
1497
|
+
LOperand* right = UseRegisterAtStart(instr->right());
|
1498
|
+
LCmpJSObjectEq* result = new LCmpJSObjectEq(left, right);
|
1499
|
+
return DefineAsRegister(result);
|
1500
|
+
}
|
1501
|
+
|
1502
|
+
|
1503
|
+
LInstruction* LChunkBuilder::DoIsNull(HIsNull* instr) {
|
1504
|
+
ASSERT(instr->value()->representation().IsTagged());
|
1505
|
+
LOperand* value = UseRegisterAtStart(instr->value());
|
1506
|
+
|
1507
|
+
return DefineAsRegister(new LIsNull(value));
|
1508
|
+
}
|
1509
|
+
|
1510
|
+
|
1511
|
+
LInstruction* LChunkBuilder::DoIsObject(HIsObject* instr) {
|
1512
|
+
ASSERT(instr->value()->representation().IsTagged());
|
1513
|
+
LOperand* value = UseRegister(instr->value());
|
1514
|
+
|
1515
|
+
return DefineAsRegister(new LIsObject(value));
|
1516
|
+
}
|
1517
|
+
|
1518
|
+
|
1519
|
+
LInstruction* LChunkBuilder::DoIsSmi(HIsSmi* instr) {
|
1520
|
+
ASSERT(instr->value()->representation().IsTagged());
|
1521
|
+
LOperand* value = UseAtStart(instr->value());
|
1522
|
+
|
1523
|
+
return DefineAsRegister(new LIsSmi(value));
|
1524
|
+
}
|
1525
|
+
|
1526
|
+
|
1527
|
+
LInstruction* LChunkBuilder::DoHasInstanceType(HHasInstanceType* instr) {
|
1528
|
+
ASSERT(instr->value()->representation().IsTagged());
|
1529
|
+
LOperand* value = UseRegisterAtStart(instr->value());
|
1530
|
+
|
1531
|
+
return DefineAsRegister(new LHasInstanceType(value));
|
1532
|
+
}
|
1533
|
+
|
1534
|
+
|
1535
|
+
LInstruction* LChunkBuilder::DoGetCachedArrayIndex(
|
1536
|
+
HGetCachedArrayIndex* instr) {
|
1537
|
+
ASSERT(instr->value()->representation().IsTagged());
|
1538
|
+
LOperand* value = UseRegisterAtStart(instr->value());
|
1539
|
+
|
1540
|
+
return DefineAsRegister(new LGetCachedArrayIndex(value));
|
1541
|
+
}
|
1542
|
+
|
1543
|
+
|
1544
|
+
LInstruction* LChunkBuilder::DoHasCachedArrayIndex(
|
1545
|
+
HHasCachedArrayIndex* instr) {
|
1546
|
+
ASSERT(instr->value()->representation().IsTagged());
|
1547
|
+
LOperand* value = UseRegister(instr->value());
|
1548
|
+
return DefineAsRegister(new LHasCachedArrayIndex(value));
|
1549
|
+
}
|
1550
|
+
|
1551
|
+
|
1552
|
+
LInstruction* LChunkBuilder::DoClassOfTest(HClassOfTest* instr) {
|
1553
|
+
Abort("Unimplemented: %s", "DoClassOfTest");
|
1554
|
+
return NULL;
|
1555
|
+
}
|
1556
|
+
|
1557
|
+
|
1558
|
+
LInstruction* LChunkBuilder::DoJSArrayLength(HJSArrayLength* instr) {
|
1559
|
+
LOperand* array = UseRegisterAtStart(instr->value());
|
1560
|
+
return DefineAsRegister(new LJSArrayLength(array));
|
1561
|
+
}
|
1562
|
+
|
1563
|
+
|
1564
|
+
LInstruction* LChunkBuilder::DoFixedArrayLength(HFixedArrayLength* instr) {
|
1565
|
+
LOperand* array = UseRegisterAtStart(instr->value());
|
1566
|
+
return DefineAsRegister(new LFixedArrayLength(array));
|
1567
|
+
}
|
1568
|
+
|
1569
|
+
|
1570
|
+
LInstruction* LChunkBuilder::DoExternalArrayLength(
|
1571
|
+
HExternalArrayLength* instr) {
|
1572
|
+
LOperand* array = UseRegisterAtStart(instr->value());
|
1573
|
+
return DefineAsRegister(new LExternalArrayLength(array));
|
1574
|
+
}
|
1575
|
+
|
1576
|
+
|
1577
|
+
LInstruction* LChunkBuilder::DoValueOf(HValueOf* instr) {
|
1578
|
+
LOperand* object = UseRegister(instr->value());
|
1579
|
+
LValueOf* result = new LValueOf(object);
|
1580
|
+
return AssignEnvironment(DefineSameAsFirst(result));
|
1581
|
+
}
|
1582
|
+
|
1583
|
+
|
1584
|
+
LInstruction* LChunkBuilder::DoBoundsCheck(HBoundsCheck* instr) {
|
1585
|
+
return AssignEnvironment(new LBoundsCheck(UseRegisterAtStart(instr->index()),
|
1586
|
+
Use(instr->length())));
|
1587
|
+
}
|
1588
|
+
|
1589
|
+
|
1590
|
+
LInstruction* LChunkBuilder::DoAbnormalExit(HAbnormalExit* instr) {
|
1591
|
+
// The control instruction marking the end of a block that completed
|
1592
|
+
// abruptly (e.g., threw an exception). There is nothing specific to do.
|
1593
|
+
return NULL;
|
1594
|
+
}
|
1595
|
+
|
1596
|
+
|
1597
|
+
LInstruction* LChunkBuilder::DoThrow(HThrow* instr) {
|
1598
|
+
LOperand* value = UseFixed(instr->value(), rax);
|
1599
|
+
return MarkAsCall(new LThrow(value), instr);
|
1600
|
+
}
|
1601
|
+
|
1602
|
+
|
1603
|
+
LInstruction* LChunkBuilder::DoChange(HChange* instr) {
|
1604
|
+
Representation from = instr->from();
|
1605
|
+
Representation to = instr->to();
|
1606
|
+
if (from.IsTagged()) {
|
1607
|
+
if (to.IsDouble()) {
|
1608
|
+
LOperand* value = UseRegister(instr->value());
|
1609
|
+
LNumberUntagD* res = new LNumberUntagD(value);
|
1610
|
+
return AssignEnvironment(DefineAsRegister(res));
|
1611
|
+
} else {
|
1612
|
+
ASSERT(to.IsInteger32());
|
1613
|
+
LOperand* value = UseRegister(instr->value());
|
1614
|
+
bool needs_check = !instr->value()->type().IsSmi();
|
1615
|
+
if (needs_check) {
|
1616
|
+
LOperand* xmm_temp = instr->CanTruncateToInt32() ? NULL
|
1617
|
+
: FixedTemp(xmm1);
|
1618
|
+
LTaggedToI* res = new LTaggedToI(value, xmm_temp);
|
1619
|
+
return AssignEnvironment(DefineSameAsFirst(res));
|
1620
|
+
} else {
|
1621
|
+
return DefineSameAsFirst(new LSmiUntag(value, needs_check));
|
1622
|
+
}
|
1623
|
+
}
|
1624
|
+
} else if (from.IsDouble()) {
|
1625
|
+
if (to.IsTagged()) {
|
1626
|
+
LOperand* value = UseRegister(instr->value());
|
1627
|
+
LOperand* temp = TempRegister();
|
1628
|
+
|
1629
|
+
// Make sure that temp and result_temp are different registers.
|
1630
|
+
LUnallocated* result_temp = TempRegister();
|
1631
|
+
LNumberTagD* result = new LNumberTagD(value, temp);
|
1632
|
+
return AssignPointerMap(Define(result, result_temp));
|
1633
|
+
} else {
|
1634
|
+
ASSERT(to.IsInteger32());
|
1635
|
+
LOperand* value = UseRegister(instr->value());
|
1636
|
+
return AssignEnvironment(DefineAsRegister(new LDoubleToI(value)));
|
1637
|
+
}
|
1638
|
+
} else if (from.IsInteger32()) {
|
1639
|
+
if (to.IsTagged()) {
|
1640
|
+
HValue* val = instr->value();
|
1641
|
+
LOperand* value = UseRegister(val);
|
1642
|
+
if (val->HasRange() && val->range()->IsInSmiRange()) {
|
1643
|
+
return DefineSameAsFirst(new LSmiTag(value));
|
1644
|
+
} else {
|
1645
|
+
LNumberTagI* result = new LNumberTagI(value);
|
1646
|
+
return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result)));
|
1647
|
+
}
|
1648
|
+
} else {
|
1649
|
+
ASSERT(to.IsDouble());
|
1650
|
+
return DefineAsRegister(new LInteger32ToDouble(Use(instr->value())));
|
1651
|
+
}
|
1652
|
+
}
|
1653
|
+
UNREACHABLE();
|
1654
|
+
return NULL;
|
1655
|
+
}
|
1656
|
+
|
1657
|
+
|
1658
|
+
LInstruction* LChunkBuilder::DoCheckNonSmi(HCheckNonSmi* instr) {
|
1659
|
+
LOperand* value = UseRegisterAtStart(instr->value());
|
1660
|
+
return AssignEnvironment(new LCheckNonSmi(value));
|
1661
|
+
}
|
1662
|
+
|
1663
|
+
|
1664
|
+
LInstruction* LChunkBuilder::DoCheckInstanceType(HCheckInstanceType* instr) {
|
1665
|
+
LOperand* value = UseRegisterAtStart(instr->value());
|
1666
|
+
LCheckInstanceType* result = new LCheckInstanceType(value);
|
1667
|
+
return AssignEnvironment(result);
|
1668
|
+
}
|
1669
|
+
|
1670
|
+
|
1671
|
+
LInstruction* LChunkBuilder::DoCheckPrototypeMaps(HCheckPrototypeMaps* instr) {
|
1672
|
+
LOperand* temp = TempRegister();
|
1673
|
+
LCheckPrototypeMaps* result = new LCheckPrototypeMaps(temp);
|
1674
|
+
return AssignEnvironment(result);
|
1675
|
+
}
|
1676
|
+
|
1677
|
+
|
1678
|
+
LInstruction* LChunkBuilder::DoCheckSmi(HCheckSmi* instr) {
|
1679
|
+
LOperand* value = UseRegisterAtStart(instr->value());
|
1680
|
+
return AssignEnvironment(new LCheckSmi(value));
|
1681
|
+
}
|
1682
|
+
|
1683
|
+
|
1684
|
+
LInstruction* LChunkBuilder::DoCheckFunction(HCheckFunction* instr) {
|
1685
|
+
LOperand* value = UseRegisterAtStart(instr->value());
|
1686
|
+
return AssignEnvironment(new LCheckFunction(value));
|
1687
|
+
}
|
1688
|
+
|
1689
|
+
|
1690
|
+
LInstruction* LChunkBuilder::DoCheckMap(HCheckMap* instr) {
|
1691
|
+
LOperand* value = UseRegisterAtStart(instr->value());
|
1692
|
+
LCheckMap* result = new LCheckMap(value);
|
1693
|
+
return AssignEnvironment(result);
|
1694
|
+
}
|
1695
|
+
|
1696
|
+
|
1697
|
+
LInstruction* LChunkBuilder::DoReturn(HReturn* instr) {
|
1698
|
+
return new LReturn(UseFixed(instr->value(), rax));
|
1699
|
+
}
|
1700
|
+
|
1701
|
+
|
1702
|
+
LInstruction* LChunkBuilder::DoConstant(HConstant* instr) {
|
1703
|
+
Representation r = instr->representation();
|
1704
|
+
if (r.IsInteger32()) {
|
1705
|
+
return DefineAsRegister(new LConstantI);
|
1706
|
+
} else if (r.IsDouble()) {
|
1707
|
+
LOperand* temp = TempRegister();
|
1708
|
+
return DefineAsRegister(new LConstantD(temp));
|
1709
|
+
} else if (r.IsTagged()) {
|
1710
|
+
return DefineAsRegister(new LConstantT);
|
1711
|
+
} else {
|
1712
|
+
UNREACHABLE();
|
1713
|
+
return NULL;
|
1714
|
+
}
|
1715
|
+
}
|
1716
|
+
|
1717
|
+
|
1718
|
+
LInstruction* LChunkBuilder::DoLoadGlobalCell(HLoadGlobalCell* instr) {
|
1719
|
+
LLoadGlobalCell* result = new LLoadGlobalCell;
|
1720
|
+
return instr->check_hole_value()
|
1721
|
+
? AssignEnvironment(DefineAsRegister(result))
|
1722
|
+
: DefineAsRegister(result);
|
1723
|
+
}
|
1724
|
+
|
1725
|
+
|
1726
|
+
LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) {
|
1727
|
+
LOperand* global_object = UseFixed(instr->global_object(), rax);
|
1728
|
+
LLoadGlobalGeneric* result = new LLoadGlobalGeneric(global_object);
|
1729
|
+
return MarkAsCall(DefineFixed(result, rax), instr);
|
1730
|
+
}
|
1731
|
+
|
1732
|
+
|
1733
|
+
LInstruction* LChunkBuilder::DoStoreGlobalCell(HStoreGlobalCell* instr) {
|
1734
|
+
LStoreGlobalCell* result =
|
1735
|
+
new LStoreGlobalCell(UseRegister(instr->value()), TempRegister());
|
1736
|
+
return instr->check_hole_value() ? AssignEnvironment(result) : result;
|
1737
|
+
}
|
1738
|
+
|
1739
|
+
|
1740
|
+
LInstruction* LChunkBuilder::DoStoreGlobalGeneric(HStoreGlobalGeneric* instr) {
|
1741
|
+
LOperand* global_object = UseFixed(instr->global_object(), rdx);
|
1742
|
+
LOperand* value = UseFixed(instr->value(), rax);
|
1743
|
+
LStoreGlobalGeneric* result = new LStoreGlobalGeneric(global_object, value);
|
1744
|
+
return MarkAsCall(result, instr);
|
1745
|
+
}
|
1746
|
+
|
1747
|
+
|
1748
|
+
LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) {
|
1749
|
+
LOperand* context = UseRegisterAtStart(instr->value());
|
1750
|
+
return DefineAsRegister(new LLoadContextSlot(context));
|
1751
|
+
}
|
1752
|
+
|
1753
|
+
|
1754
|
+
LInstruction* LChunkBuilder::DoStoreContextSlot(HStoreContextSlot* instr) {
|
1755
|
+
LOperand* context;
|
1756
|
+
LOperand* value;
|
1757
|
+
LOperand* temp;
|
1758
|
+
if (instr->NeedsWriteBarrier()) {
|
1759
|
+
context = UseTempRegister(instr->context());
|
1760
|
+
value = UseTempRegister(instr->value());
|
1761
|
+
temp = TempRegister();
|
1762
|
+
} else {
|
1763
|
+
context = UseRegister(instr->context());
|
1764
|
+
value = UseRegister(instr->value());
|
1765
|
+
temp = NULL;
|
1766
|
+
}
|
1767
|
+
return new LStoreContextSlot(context, value, temp);
|
1768
|
+
}
|
1769
|
+
|
1770
|
+
|
1771
|
+
LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) {
|
1772
|
+
ASSERT(instr->representation().IsTagged());
|
1773
|
+
LOperand* obj = UseRegisterAtStart(instr->object());
|
1774
|
+
return DefineAsRegister(new LLoadNamedField(obj));
|
1775
|
+
}
|
1776
|
+
|
1777
|
+
|
1778
|
+
LInstruction* LChunkBuilder::DoLoadNamedFieldPolymorphic(
|
1779
|
+
HLoadNamedFieldPolymorphic* instr) {
|
1780
|
+
ASSERT(instr->representation().IsTagged());
|
1781
|
+
if (instr->need_generic()) {
|
1782
|
+
LOperand* obj = UseFixed(instr->object(), rax);
|
1783
|
+
LLoadNamedFieldPolymorphic* result = new LLoadNamedFieldPolymorphic(obj);
|
1784
|
+
return MarkAsCall(DefineFixed(result, rax), instr);
|
1785
|
+
} else {
|
1786
|
+
LOperand* obj = UseRegisterAtStart(instr->object());
|
1787
|
+
LLoadNamedFieldPolymorphic* result = new LLoadNamedFieldPolymorphic(obj);
|
1788
|
+
return AssignEnvironment(DefineAsRegister(result));
|
1789
|
+
}
|
1790
|
+
}
|
1791
|
+
|
1792
|
+
|
1793
|
+
LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) {
|
1794
|
+
LOperand* object = UseFixed(instr->object(), rax);
|
1795
|
+
LLoadNamedGeneric* result = new LLoadNamedGeneric(object);
|
1796
|
+
return MarkAsCall(DefineFixed(result, rax), instr);
|
1797
|
+
}
|
1798
|
+
|
1799
|
+
|
1800
|
+
LInstruction* LChunkBuilder::DoLoadFunctionPrototype(
|
1801
|
+
HLoadFunctionPrototype* instr) {
|
1802
|
+
return AssignEnvironment(DefineAsRegister(
|
1803
|
+
new LLoadFunctionPrototype(UseRegister(instr->function()))));
|
1804
|
+
}
|
1805
|
+
|
1806
|
+
|
1807
|
+
LInstruction* LChunkBuilder::DoLoadElements(HLoadElements* instr) {
|
1808
|
+
LOperand* input = UseRegisterAtStart(instr->value());
|
1809
|
+
return DefineAsRegister(new LLoadElements(input));
|
1810
|
+
}
|
1811
|
+
|
1812
|
+
|
1813
|
+
LInstruction* LChunkBuilder::DoLoadExternalArrayPointer(
|
1814
|
+
HLoadExternalArrayPointer* instr) {
|
1815
|
+
LOperand* input = UseRegisterAtStart(instr->value());
|
1816
|
+
return DefineAsRegister(new LLoadExternalArrayPointer(input));
|
1817
|
+
}
|
1818
|
+
|
1819
|
+
|
1820
|
+
LInstruction* LChunkBuilder::DoLoadKeyedFastElement(
|
1821
|
+
HLoadKeyedFastElement* instr) {
|
1822
|
+
ASSERT(instr->representation().IsTagged());
|
1823
|
+
ASSERT(instr->key()->representation().IsInteger32());
|
1824
|
+
LOperand* obj = UseRegisterAtStart(instr->object());
|
1825
|
+
LOperand* key = UseRegisterAtStart(instr->key());
|
1826
|
+
LLoadKeyedFastElement* result = new LLoadKeyedFastElement(obj, key);
|
1827
|
+
return AssignEnvironment(DefineSameAsFirst(result));
|
1828
|
+
}
|
1829
|
+
|
1830
|
+
|
1831
|
+
LInstruction* LChunkBuilder::DoLoadKeyedSpecializedArrayElement(
|
1832
|
+
HLoadKeyedSpecializedArrayElement* instr) {
|
1833
|
+
ExternalArrayType array_type = instr->array_type();
|
1834
|
+
Representation representation(instr->representation());
|
1835
|
+
ASSERT((representation.IsInteger32() && array_type != kExternalFloatArray) ||
|
1836
|
+
(representation.IsDouble() && array_type == kExternalFloatArray));
|
1837
|
+
ASSERT(instr->key()->representation().IsInteger32());
|
1838
|
+
LOperand* external_pointer = UseRegister(instr->external_pointer());
|
1839
|
+
LOperand* key = UseRegister(instr->key());
|
1840
|
+
LLoadKeyedSpecializedArrayElement* result =
|
1841
|
+
new LLoadKeyedSpecializedArrayElement(external_pointer, key);
|
1842
|
+
LInstruction* load_instr = DefineAsRegister(result);
|
1843
|
+
// An unsigned int array load might overflow and cause a deopt, make sure it
|
1844
|
+
// has an environment.
|
1845
|
+
return (array_type == kExternalUnsignedIntArray) ?
|
1846
|
+
AssignEnvironment(load_instr) : load_instr;
|
1847
|
+
}
|
1848
|
+
|
1849
|
+
|
1850
|
+
LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) {
|
1851
|
+
LOperand* object = UseFixed(instr->object(), rdx);
|
1852
|
+
LOperand* key = UseFixed(instr->key(), rax);
|
1853
|
+
|
1854
|
+
LLoadKeyedGeneric* result = new LLoadKeyedGeneric(object, key);
|
1855
|
+
return MarkAsCall(DefineFixed(result, rax), instr);
|
1856
|
+
}
|
1857
|
+
|
1858
|
+
|
1859
|
+
LInstruction* LChunkBuilder::DoStoreKeyedFastElement(
|
1860
|
+
HStoreKeyedFastElement* instr) {
|
1861
|
+
bool needs_write_barrier = instr->NeedsWriteBarrier();
|
1862
|
+
ASSERT(instr->value()->representation().IsTagged());
|
1863
|
+
ASSERT(instr->object()->representation().IsTagged());
|
1864
|
+
ASSERT(instr->key()->representation().IsInteger32());
|
1865
|
+
|
1866
|
+
LOperand* obj = UseTempRegister(instr->object());
|
1867
|
+
LOperand* val = needs_write_barrier
|
1868
|
+
? UseTempRegister(instr->value())
|
1869
|
+
: UseRegisterAtStart(instr->value());
|
1870
|
+
LOperand* key = needs_write_barrier
|
1871
|
+
? UseTempRegister(instr->key())
|
1872
|
+
: UseRegisterOrConstantAtStart(instr->key());
|
1873
|
+
|
1874
|
+
return AssignEnvironment(new LStoreKeyedFastElement(obj, key, val));
|
1875
|
+
}
|
1876
|
+
|
1877
|
+
|
1878
|
+
LInstruction* LChunkBuilder::DoStoreKeyedSpecializedArrayElement(
|
1879
|
+
HStoreKeyedSpecializedArrayElement* instr) {
|
1880
|
+
Representation representation(instr->value()->representation());
|
1881
|
+
ExternalArrayType array_type = instr->array_type();
|
1882
|
+
ASSERT((representation.IsInteger32() && array_type != kExternalFloatArray) ||
|
1883
|
+
(representation.IsDouble() && array_type == kExternalFloatArray));
|
1884
|
+
ASSERT(instr->external_pointer()->representation().IsExternal());
|
1885
|
+
ASSERT(instr->key()->representation().IsInteger32());
|
1886
|
+
|
1887
|
+
LOperand* external_pointer = UseRegister(instr->external_pointer());
|
1888
|
+
bool val_is_temp_register = array_type == kExternalPixelArray ||
|
1889
|
+
array_type == kExternalFloatArray;
|
1890
|
+
LOperand* val = val_is_temp_register
|
1891
|
+
? UseTempRegister(instr->value())
|
1892
|
+
: UseRegister(instr->value());
|
1893
|
+
LOperand* key = UseRegister(instr->key());
|
1894
|
+
|
1895
|
+
return new LStoreKeyedSpecializedArrayElement(external_pointer,
|
1896
|
+
key,
|
1897
|
+
val);
|
1898
|
+
}
|
1899
|
+
|
1900
|
+
|
1901
|
+
LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) {
|
1902
|
+
LOperand* object = UseFixed(instr->object(), rdx);
|
1903
|
+
LOperand* key = UseFixed(instr->key(), rcx);
|
1904
|
+
LOperand* value = UseFixed(instr->value(), rax);
|
1905
|
+
|
1906
|
+
ASSERT(instr->object()->representation().IsTagged());
|
1907
|
+
ASSERT(instr->key()->representation().IsTagged());
|
1908
|
+
ASSERT(instr->value()->representation().IsTagged());
|
1909
|
+
|
1910
|
+
LStoreKeyedGeneric* result = new LStoreKeyedGeneric(object, key, value);
|
1911
|
+
return MarkAsCall(result, instr);
|
1912
|
+
}
|
1913
|
+
|
1914
|
+
|
1915
|
+
LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) {
|
1916
|
+
bool needs_write_barrier = instr->NeedsWriteBarrier();
|
1917
|
+
|
1918
|
+
LOperand* obj = needs_write_barrier
|
1919
|
+
? UseTempRegister(instr->object())
|
1920
|
+
: UseRegisterAtStart(instr->object());
|
1921
|
+
|
1922
|
+
LOperand* val = needs_write_barrier
|
1923
|
+
? UseTempRegister(instr->value())
|
1924
|
+
: UseRegister(instr->value());
|
1925
|
+
|
1926
|
+
// We only need a scratch register if we have a write barrier or we
|
1927
|
+
// have a store into the properties array (not in-object-property).
|
1928
|
+
LOperand* temp = (!instr->is_in_object() || needs_write_barrier)
|
1929
|
+
? TempRegister() : NULL;
|
1930
|
+
|
1931
|
+
return new LStoreNamedField(obj, val, temp);
|
1932
|
+
}
|
1933
|
+
|
1934
|
+
|
1935
|
+
LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) {
|
1936
|
+
LOperand* object = UseFixed(instr->object(), rdx);
|
1937
|
+
LOperand* value = UseFixed(instr->value(), rax);
|
1938
|
+
|
1939
|
+
LStoreNamedGeneric* result = new LStoreNamedGeneric(object, value);
|
1940
|
+
return MarkAsCall(result, instr);
|
1941
|
+
}
|
1942
|
+
|
1943
|
+
|
1944
|
+
LInstruction* LChunkBuilder::DoStringCharCodeAt(HStringCharCodeAt* instr) {
|
1945
|
+
LOperand* string = UseRegister(instr->string());
|
1946
|
+
LOperand* index = UseRegisterOrConstant(instr->index());
|
1947
|
+
LStringCharCodeAt* result = new LStringCharCodeAt(string, index);
|
1948
|
+
return AssignEnvironment(AssignPointerMap(DefineAsRegister(result)));
|
1949
|
+
}
|
1950
|
+
|
1951
|
+
|
1952
|
+
LInstruction* LChunkBuilder::DoStringCharFromCode(HStringCharFromCode* instr) {
|
1953
|
+
LOperand* char_code = UseRegister(instr->value());
|
1954
|
+
LStringCharFromCode* result = new LStringCharFromCode(char_code);
|
1955
|
+
return AssignPointerMap(DefineAsRegister(result));
|
1956
|
+
}
|
1957
|
+
|
1958
|
+
|
1959
|
+
LInstruction* LChunkBuilder::DoStringLength(HStringLength* instr) {
|
1960
|
+
LOperand* string = UseRegisterAtStart(instr->value());
|
1961
|
+
return DefineAsRegister(new LStringLength(string));
|
1962
|
+
}
|
1963
|
+
|
1964
|
+
|
1965
|
+
LInstruction* LChunkBuilder::DoArrayLiteral(HArrayLiteral* instr) {
|
1966
|
+
return MarkAsCall(DefineFixed(new LArrayLiteral, rax), instr);
|
1967
|
+
}
|
1968
|
+
|
1969
|
+
|
1970
|
+
LInstruction* LChunkBuilder::DoObjectLiteral(HObjectLiteral* instr) {
|
1971
|
+
return MarkAsCall(DefineFixed(new LObjectLiteral, rax), instr);
|
1972
|
+
}
|
1973
|
+
|
1974
|
+
|
1975
|
+
LInstruction* LChunkBuilder::DoRegExpLiteral(HRegExpLiteral* instr) {
|
1976
|
+
return MarkAsCall(DefineFixed(new LRegExpLiteral, rax), instr);
|
1977
|
+
}
|
1978
|
+
|
1979
|
+
|
1980
|
+
LInstruction* LChunkBuilder::DoFunctionLiteral(HFunctionLiteral* instr) {
|
1981
|
+
return MarkAsCall(DefineFixed(new LFunctionLiteral, rax), instr);
|
1982
|
+
}
|
1983
|
+
|
1984
|
+
|
1985
|
+
LInstruction* LChunkBuilder::DoDeleteProperty(HDeleteProperty* instr) {
|
1986
|
+
LDeleteProperty* result =
|
1987
|
+
new LDeleteProperty(Use(instr->object()), UseOrConstant(instr->key()));
|
1988
|
+
return MarkAsCall(DefineFixed(result, rax), instr);
|
1989
|
+
}
|
1990
|
+
|
1991
|
+
|
1992
|
+
LInstruction* LChunkBuilder::DoOsrEntry(HOsrEntry* instr) {
|
1993
|
+
allocator_->MarkAsOsrEntry();
|
1994
|
+
current_block_->last_environment()->set_ast_id(instr->ast_id());
|
1995
|
+
return AssignEnvironment(new LOsrEntry);
|
1996
|
+
}
|
1997
|
+
|
1998
|
+
|
1999
|
+
LInstruction* LChunkBuilder::DoParameter(HParameter* instr) {
|
2000
|
+
int spill_index = chunk()->GetParameterStackSlot(instr->index());
|
2001
|
+
return DefineAsSpilled(new LParameter, spill_index);
|
2002
|
+
}
|
2003
|
+
|
2004
|
+
|
2005
|
+
LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) {
|
2006
|
+
int spill_index = chunk()->GetNextSpillIndex(false); // Not double-width.
|
2007
|
+
return DefineAsSpilled(new LUnknownOSRValue, spill_index);
|
2008
|
+
}
|
2009
|
+
|
2010
|
+
|
2011
|
+
LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) {
|
2012
|
+
argument_count_ -= instr->argument_count();
|
2013
|
+
return MarkAsCall(DefineFixed(new LCallStub, rax), instr);
|
2014
|
+
}
|
2015
|
+
|
2016
|
+
|
2017
|
+
LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) {
|
2018
|
+
// There are no real uses of the arguments object.
|
2019
|
+
// arguments.length and element access are supported directly on
|
2020
|
+
// stack arguments, and any real arguments object use causes a bailout.
|
2021
|
+
// So this value is never used.
|
2022
|
+
return NULL;
|
2023
|
+
}
|
2024
|
+
|
2025
|
+
|
2026
|
+
LInstruction* LChunkBuilder::DoAccessArgumentsAt(HAccessArgumentsAt* instr) {
|
2027
|
+
LOperand* arguments = UseRegister(instr->arguments());
|
2028
|
+
LOperand* length = UseTempRegister(instr->length());
|
2029
|
+
LOperand* index = Use(instr->index());
|
2030
|
+
LAccessArgumentsAt* result = new LAccessArgumentsAt(arguments, length, index);
|
2031
|
+
return AssignEnvironment(DefineAsRegister(result));
|
2032
|
+
}
|
2033
|
+
|
2034
|
+
|
2035
|
+
LInstruction* LChunkBuilder::DoToFastProperties(HToFastProperties* instr) {
|
2036
|
+
LOperand* object = UseFixed(instr->value(), rax);
|
2037
|
+
LToFastProperties* result = new LToFastProperties(object);
|
2038
|
+
return MarkAsCall(DefineFixed(result, rax), instr);
|
2039
|
+
}
|
2040
|
+
|
2041
|
+
|
2042
|
+
LInstruction* LChunkBuilder::DoTypeof(HTypeof* instr) {
|
2043
|
+
LTypeof* result = new LTypeof(UseAtStart(instr->value()));
|
2044
|
+
return MarkAsCall(DefineFixed(result, rax), instr);
|
2045
|
+
}
|
2046
|
+
|
2047
|
+
|
2048
|
+
LInstruction* LChunkBuilder::DoTypeofIs(HTypeofIs* instr) {
|
2049
|
+
return DefineSameAsFirst(new LTypeofIs(UseRegister(instr->value())));
|
2050
|
+
}
|
2051
|
+
|
2052
|
+
|
2053
|
+
LInstruction* LChunkBuilder::DoIsConstructCall(HIsConstructCall* instr) {
|
2054
|
+
return DefineAsRegister(new LIsConstructCall);
|
2055
|
+
}
|
2056
|
+
|
2057
|
+
|
2058
|
+
LInstruction* LChunkBuilder::DoSimulate(HSimulate* instr) {
|
2059
|
+
HEnvironment* env = current_block_->last_environment();
|
2060
|
+
ASSERT(env != NULL);
|
2061
|
+
|
2062
|
+
env->set_ast_id(instr->ast_id());
|
2063
|
+
|
2064
|
+
env->Drop(instr->pop_count());
|
2065
|
+
for (int i = 0; i < instr->values()->length(); ++i) {
|
2066
|
+
HValue* value = instr->values()->at(i);
|
2067
|
+
if (instr->HasAssignedIndexAt(i)) {
|
2068
|
+
env->Bind(instr->GetAssignedIndexAt(i), value);
|
2069
|
+
} else {
|
2070
|
+
env->Push(value);
|
2071
|
+
}
|
2072
|
+
}
|
2073
|
+
|
2074
|
+
// If there is an instruction pending deoptimization environment create a
|
2075
|
+
// lazy bailout instruction to capture the environment.
|
2076
|
+
if (pending_deoptimization_ast_id_ == instr->ast_id()) {
|
2077
|
+
LLazyBailout* lazy_bailout = new LLazyBailout;
|
2078
|
+
LInstruction* result = AssignEnvironment(lazy_bailout);
|
2079
|
+
instruction_pending_deoptimization_environment_->
|
2080
|
+
set_deoptimization_environment(result->environment());
|
2081
|
+
ClearInstructionPendingDeoptimizationEnvironment();
|
2082
|
+
return result;
|
2083
|
+
}
|
2084
|
+
|
2085
|
+
return NULL;
|
2086
|
+
}
|
2087
|
+
|
2088
|
+
|
2089
|
+
LInstruction* LChunkBuilder::DoStackCheck(HStackCheck* instr) {
|
2090
|
+
return MarkAsCall(new LStackCheck, instr);
|
2091
|
+
}
|
2092
|
+
|
2093
|
+
|
2094
|
+
LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) {
|
2095
|
+
HEnvironment* outer = current_block_->last_environment();
|
2096
|
+
HConstant* undefined = graph()->GetConstantUndefined();
|
2097
|
+
HEnvironment* inner = outer->CopyForInlining(instr->closure(),
|
2098
|
+
instr->function(),
|
2099
|
+
false,
|
2100
|
+
undefined);
|
2101
|
+
current_block_->UpdateEnvironment(inner);
|
2102
|
+
chunk_->AddInlinedClosure(instr->closure());
|
2103
|
+
return NULL;
|
2104
|
+
}
|
2105
|
+
|
2106
|
+
|
2107
|
+
LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) {
|
2108
|
+
HEnvironment* outer = current_block_->last_environment()->outer();
|
2109
|
+
current_block_->UpdateEnvironment(outer);
|
2110
|
+
return NULL;
|
2111
|
+
}
|
2112
|
+
|
2113
|
+
} } // namespace v8::internal
|
2114
|
+
|
2115
|
+
#endif // V8_TARGET_ARCH_X64
|