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
@@ -1,305 +0,0 @@
|
|
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_(chunk->graph()->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
|
-
|
70
|
-
// Support for converting LOperands to assembler types.
|
71
|
-
Register ToRegister(LOperand* op) const;
|
72
|
-
XMMRegister ToDoubleRegister(LOperand* op) const;
|
73
|
-
bool IsInteger32Constant(LConstantOperand* op) const;
|
74
|
-
int ToInteger32(LConstantOperand* op) const;
|
75
|
-
bool IsTaggedConstant(LConstantOperand* op) const;
|
76
|
-
Handle<Object> ToHandle(LConstantOperand* op) const;
|
77
|
-
Operand ToOperand(LOperand* op) const;
|
78
|
-
|
79
|
-
|
80
|
-
// Try to generate code for the entire chunk, but it may fail if the
|
81
|
-
// chunk contains constructs we cannot handle. Returns true if the
|
82
|
-
// code generation attempt succeeded.
|
83
|
-
bool GenerateCode();
|
84
|
-
|
85
|
-
// Finish the code by setting stack height, safepoint, and bailout
|
86
|
-
// information on it.
|
87
|
-
void FinishCode(Handle<Code> code);
|
88
|
-
|
89
|
-
// Deferred code support.
|
90
|
-
void DoDeferredNumberTagD(LNumberTagD* instr);
|
91
|
-
void DoDeferredTaggedToI(LTaggedToI* instr);
|
92
|
-
void DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr);
|
93
|
-
void DoDeferredStackCheck(LGoto* instr);
|
94
|
-
void DoDeferredStringCharCodeAt(LStringCharCodeAt* instr);
|
95
|
-
void DoDeferredLInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr);
|
96
|
-
|
97
|
-
// Parallel move support.
|
98
|
-
void DoParallelMove(LParallelMove* move);
|
99
|
-
|
100
|
-
// Emit frame translation commands for an environment.
|
101
|
-
void WriteTranslation(LEnvironment* environment, Translation* translation);
|
102
|
-
|
103
|
-
// Declare methods that deal with the individual node types.
|
104
|
-
#define DECLARE_DO(type) void Do##type(L##type* node);
|
105
|
-
LITHIUM_CONCRETE_INSTRUCTION_LIST(DECLARE_DO)
|
106
|
-
#undef DECLARE_DO
|
107
|
-
|
108
|
-
private:
|
109
|
-
enum Status {
|
110
|
-
UNUSED,
|
111
|
-
GENERATING,
|
112
|
-
DONE,
|
113
|
-
ABORTED
|
114
|
-
};
|
115
|
-
|
116
|
-
bool is_unused() const { return status_ == UNUSED; }
|
117
|
-
bool is_generating() const { return status_ == GENERATING; }
|
118
|
-
bool is_done() const { return status_ == DONE; }
|
119
|
-
bool is_aborted() const { return status_ == ABORTED; }
|
120
|
-
|
121
|
-
int strict_mode_flag() const {
|
122
|
-
return info_->is_strict() ? kStrictMode : kNonStrictMode;
|
123
|
-
}
|
124
|
-
|
125
|
-
LChunk* chunk() const { return chunk_; }
|
126
|
-
Scope* scope() const { return scope_; }
|
127
|
-
HGraph* graph() const { return chunk_->graph(); }
|
128
|
-
|
129
|
-
int GetNextEmittedBlock(int block);
|
130
|
-
LInstruction* GetNextInstruction();
|
131
|
-
|
132
|
-
void EmitClassOfTest(Label* if_true,
|
133
|
-
Label* if_false,
|
134
|
-
Handle<String> class_name,
|
135
|
-
Register input,
|
136
|
-
Register temporary);
|
137
|
-
|
138
|
-
int StackSlotCount() const { return chunk()->spill_slot_count(); }
|
139
|
-
int ParameterCount() const { return scope()->num_parameters(); }
|
140
|
-
|
141
|
-
void Abort(const char* format, ...);
|
142
|
-
void Comment(const char* format, ...);
|
143
|
-
|
144
|
-
void AddDeferredCode(LDeferredCode* code) { deferred_.Add(code); }
|
145
|
-
|
146
|
-
// Code generation passes. Returns true if code generation should
|
147
|
-
// continue.
|
148
|
-
bool GeneratePrologue();
|
149
|
-
bool GenerateBody();
|
150
|
-
bool GenerateDeferredCode();
|
151
|
-
bool GenerateJumpTable();
|
152
|
-
bool GenerateSafepointTable();
|
153
|
-
|
154
|
-
void CallCode(Handle<Code> code,
|
155
|
-
RelocInfo::Mode mode,
|
156
|
-
LInstruction* instr);
|
157
|
-
void CallRuntime(Runtime::Function* function,
|
158
|
-
int num_arguments,
|
159
|
-
LInstruction* instr);
|
160
|
-
void CallRuntime(Runtime::FunctionId id,
|
161
|
-
int num_arguments,
|
162
|
-
LInstruction* instr) {
|
163
|
-
Runtime::Function* function = Runtime::FunctionForId(id);
|
164
|
-
CallRuntime(function, num_arguments, instr);
|
165
|
-
}
|
166
|
-
|
167
|
-
// Generate a direct call to a known function. Expects the function
|
168
|
-
// to be in edi.
|
169
|
-
void CallKnownFunction(Handle<JSFunction> function,
|
170
|
-
int arity,
|
171
|
-
LInstruction* instr);
|
172
|
-
|
173
|
-
void LoadHeapObject(Register result, Handle<HeapObject> object);
|
174
|
-
|
175
|
-
void RegisterLazyDeoptimization(LInstruction* instr);
|
176
|
-
void RegisterEnvironmentForDeoptimization(LEnvironment* environment);
|
177
|
-
void DeoptimizeIf(Condition cc, LEnvironment* environment);
|
178
|
-
|
179
|
-
void AddToTranslation(Translation* translation,
|
180
|
-
LOperand* op,
|
181
|
-
bool is_tagged);
|
182
|
-
void PopulateDeoptimizationData(Handle<Code> code);
|
183
|
-
int DefineDeoptimizationLiteral(Handle<Object> literal);
|
184
|
-
|
185
|
-
void PopulateDeoptimizationLiteralsWithInlinedFunctions();
|
186
|
-
|
187
|
-
Register ToRegister(int index) const;
|
188
|
-
XMMRegister ToDoubleRegister(int index) const;
|
189
|
-
|
190
|
-
// Specific math operations - used from DoUnaryMathOperation.
|
191
|
-
void EmitIntegerMathAbs(LUnaryMathOperation* instr);
|
192
|
-
void DoMathAbs(LUnaryMathOperation* instr);
|
193
|
-
void DoMathFloor(LUnaryMathOperation* instr);
|
194
|
-
void DoMathRound(LUnaryMathOperation* instr);
|
195
|
-
void DoMathSqrt(LUnaryMathOperation* instr);
|
196
|
-
void DoMathPowHalf(LUnaryMathOperation* instr);
|
197
|
-
void DoMathLog(LUnaryMathOperation* instr);
|
198
|
-
void DoMathCos(LUnaryMathOperation* instr);
|
199
|
-
void DoMathSin(LUnaryMathOperation* instr);
|
200
|
-
|
201
|
-
// Support for recording safepoint and position information.
|
202
|
-
void RecordSafepoint(LPointerMap* pointers,
|
203
|
-
Safepoint::Kind kind,
|
204
|
-
int arguments,
|
205
|
-
int deoptimization_index);
|
206
|
-
void RecordSafepoint(LPointerMap* pointers, int deoptimization_index);
|
207
|
-
void RecordSafepoint(int deoptimization_index);
|
208
|
-
void RecordSafepointWithRegisters(LPointerMap* pointers,
|
209
|
-
int arguments,
|
210
|
-
int deoptimization_index);
|
211
|
-
void RecordPosition(int position);
|
212
|
-
|
213
|
-
static Condition TokenToCondition(Token::Value op, bool is_unsigned);
|
214
|
-
void EmitGoto(int block, LDeferredCode* deferred_stack_check = NULL);
|
215
|
-
void EmitBranch(int left_block, int right_block, Condition cc);
|
216
|
-
void EmitCmpI(LOperand* left, LOperand* right);
|
217
|
-
void EmitNumberUntagD(Register input, XMMRegister result, LEnvironment* env);
|
218
|
-
|
219
|
-
// Emits optimized code for typeof x == "y". Modifies input register.
|
220
|
-
// Returns the condition on which a final split to
|
221
|
-
// true and false label should be made, to optimize fallthrough.
|
222
|
-
Condition EmitTypeofIs(Label* true_label, Label* false_label,
|
223
|
-
Register input, Handle<String> type_name);
|
224
|
-
|
225
|
-
// Emits optimized code for %_IsObject(x). Preserves input register.
|
226
|
-
// Returns the condition on which a final split to
|
227
|
-
// true and false label should be made, to optimize fallthrough.
|
228
|
-
Condition EmitIsObject(Register input,
|
229
|
-
Label* is_not_object,
|
230
|
-
Label* is_object);
|
231
|
-
|
232
|
-
// Emits optimized code for %_IsConstructCall().
|
233
|
-
// Caller should branch on equal condition.
|
234
|
-
void EmitIsConstructCall(Register temp);
|
235
|
-
|
236
|
-
// Emits code for pushing a constant operand.
|
237
|
-
void EmitPushConstantOperand(LOperand* operand);
|
238
|
-
|
239
|
-
struct JumpTableEntry {
|
240
|
-
inline JumpTableEntry(Address address)
|
241
|
-
: label_(),
|
242
|
-
address_(address) { }
|
243
|
-
Label label_;
|
244
|
-
Address address_;
|
245
|
-
};
|
246
|
-
|
247
|
-
LChunk* const chunk_;
|
248
|
-
MacroAssembler* const masm_;
|
249
|
-
CompilationInfo* const info_;
|
250
|
-
|
251
|
-
int current_block_;
|
252
|
-
int current_instruction_;
|
253
|
-
const ZoneList<LInstruction*>* instructions_;
|
254
|
-
ZoneList<LEnvironment*> deoptimizations_;
|
255
|
-
ZoneList<JumpTableEntry*> jump_table_;
|
256
|
-
ZoneList<Handle<Object> > deoptimization_literals_;
|
257
|
-
int inlined_function_count_;
|
258
|
-
Scope* const scope_;
|
259
|
-
Status status_;
|
260
|
-
TranslationBuffer translations_;
|
261
|
-
ZoneList<LDeferredCode*> deferred_;
|
262
|
-
int osr_pc_offset_;
|
263
|
-
|
264
|
-
// Builder that keeps track of safepoints in the code. The table
|
265
|
-
// itself is emitted at the end of the generated code.
|
266
|
-
SafepointTableBuilder safepoints_;
|
267
|
-
|
268
|
-
// Compiler from a set of parallel moves to a sequential list of moves.
|
269
|
-
LGapResolver resolver_;
|
270
|
-
|
271
|
-
friend class LDeferredCode;
|
272
|
-
friend class LEnvironment;
|
273
|
-
friend class SafepointGenerator;
|
274
|
-
DISALLOW_COPY_AND_ASSIGN(LCodeGen);
|
275
|
-
};
|
276
|
-
|
277
|
-
|
278
|
-
class LDeferredCode: public ZoneObject {
|
279
|
-
public:
|
280
|
-
explicit LDeferredCode(LCodeGen* codegen)
|
281
|
-
: codegen_(codegen), external_exit_(NULL) {
|
282
|
-
codegen->AddDeferredCode(this);
|
283
|
-
}
|
284
|
-
|
285
|
-
virtual ~LDeferredCode() { }
|
286
|
-
virtual void Generate() = 0;
|
287
|
-
|
288
|
-
void SetExit(Label *exit) { external_exit_ = exit; }
|
289
|
-
Label* entry() { return &entry_; }
|
290
|
-
Label* exit() { return external_exit_ != NULL ? external_exit_ : &exit_; }
|
291
|
-
|
292
|
-
protected:
|
293
|
-
LCodeGen* codegen() const { return codegen_; }
|
294
|
-
MacroAssembler* masm() const { return codegen_->masm(); }
|
295
|
-
|
296
|
-
private:
|
297
|
-
LCodeGen* codegen_;
|
298
|
-
Label entry_;
|
299
|
-
Label exit_;
|
300
|
-
Label* external_exit_;
|
301
|
-
};
|
302
|
-
|
303
|
-
} } // namespace v8::internal
|
304
|
-
|
305
|
-
#endif // V8_X64_LITHIUM_CODEGEN_X64_H_
|
@@ -1,2044 +0,0 @@
|
|
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 - graph()->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 + graph()->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(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> debug_name = graph()->debug_name()->ToCString();
|
538
|
-
PrintF("Aborting LChunk building in @\"%s\": ", *debug_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
|
-
if (op == Token::MOD) {
|
875
|
-
Abort("Unimplemented: %s", "DoArithmeticD MOD");
|
876
|
-
}
|
877
|
-
LOperand* left = UseRegisterAtStart(instr->left());
|
878
|
-
LOperand* right = UseRegisterAtStart(instr->right());
|
879
|
-
LArithmeticD* result = new LArithmeticD(op, left, right);
|
880
|
-
return DefineSameAsFirst(result);
|
881
|
-
}
|
882
|
-
|
883
|
-
|
884
|
-
LInstruction* LChunkBuilder::DoArithmeticT(Token::Value op,
|
885
|
-
HArithmeticBinaryOperation* instr) {
|
886
|
-
ASSERT(op == Token::ADD ||
|
887
|
-
op == Token::DIV ||
|
888
|
-
op == Token::MOD ||
|
889
|
-
op == Token::MUL ||
|
890
|
-
op == Token::SUB);
|
891
|
-
HValue* left = instr->left();
|
892
|
-
HValue* right = instr->right();
|
893
|
-
ASSERT(left->representation().IsTagged());
|
894
|
-
ASSERT(right->representation().IsTagged());
|
895
|
-
LOperand* left_operand = UseFixed(left, rdx);
|
896
|
-
LOperand* right_operand = UseFixed(right, rax);
|
897
|
-
LArithmeticT* result = new LArithmeticT(op, left_operand, right_operand);
|
898
|
-
return MarkAsCall(DefineFixed(result, rax), instr);
|
899
|
-
}
|
900
|
-
|
901
|
-
|
902
|
-
void LChunkBuilder::DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block) {
|
903
|
-
ASSERT(is_building());
|
904
|
-
current_block_ = block;
|
905
|
-
next_block_ = next_block;
|
906
|
-
if (block->IsStartBlock()) {
|
907
|
-
block->UpdateEnvironment(graph_->start_environment());
|
908
|
-
argument_count_ = 0;
|
909
|
-
} else if (block->predecessors()->length() == 1) {
|
910
|
-
// We have a single predecessor => copy environment and outgoing
|
911
|
-
// argument count from the predecessor.
|
912
|
-
ASSERT(block->phis()->length() == 0);
|
913
|
-
HBasicBlock* pred = block->predecessors()->at(0);
|
914
|
-
HEnvironment* last_environment = pred->last_environment();
|
915
|
-
ASSERT(last_environment != NULL);
|
916
|
-
// Only copy the environment, if it is later used again.
|
917
|
-
if (pred->end()->SecondSuccessor() == NULL) {
|
918
|
-
ASSERT(pred->end()->FirstSuccessor() == block);
|
919
|
-
} else {
|
920
|
-
if (pred->end()->FirstSuccessor()->block_id() > block->block_id() ||
|
921
|
-
pred->end()->SecondSuccessor()->block_id() > block->block_id()) {
|
922
|
-
last_environment = last_environment->Copy();
|
923
|
-
}
|
924
|
-
}
|
925
|
-
block->UpdateEnvironment(last_environment);
|
926
|
-
ASSERT(pred->argument_count() >= 0);
|
927
|
-
argument_count_ = pred->argument_count();
|
928
|
-
} else {
|
929
|
-
// We are at a state join => process phis.
|
930
|
-
HBasicBlock* pred = block->predecessors()->at(0);
|
931
|
-
// No need to copy the environment, it cannot be used later.
|
932
|
-
HEnvironment* last_environment = pred->last_environment();
|
933
|
-
for (int i = 0; i < block->phis()->length(); ++i) {
|
934
|
-
HPhi* phi = block->phis()->at(i);
|
935
|
-
last_environment->SetValueAt(phi->merged_index(), phi);
|
936
|
-
}
|
937
|
-
for (int i = 0; i < block->deleted_phis()->length(); ++i) {
|
938
|
-
last_environment->SetValueAt(block->deleted_phis()->at(i),
|
939
|
-
graph_->GetConstantUndefined());
|
940
|
-
}
|
941
|
-
block->UpdateEnvironment(last_environment);
|
942
|
-
// Pick up the outgoing argument count of one of the predecessors.
|
943
|
-
argument_count_ = pred->argument_count();
|
944
|
-
}
|
945
|
-
HInstruction* current = block->first();
|
946
|
-
int start = chunk_->instructions()->length();
|
947
|
-
while (current != NULL && !is_aborted()) {
|
948
|
-
// Code for constants in registers is generated lazily.
|
949
|
-
if (!current->EmitAtUses()) {
|
950
|
-
VisitInstruction(current);
|
951
|
-
}
|
952
|
-
current = current->next();
|
953
|
-
}
|
954
|
-
int end = chunk_->instructions()->length() - 1;
|
955
|
-
if (end >= start) {
|
956
|
-
block->set_first_instruction_index(start);
|
957
|
-
block->set_last_instruction_index(end);
|
958
|
-
}
|
959
|
-
block->set_argument_count(argument_count_);
|
960
|
-
next_block_ = NULL;
|
961
|
-
current_block_ = NULL;
|
962
|
-
}
|
963
|
-
|
964
|
-
|
965
|
-
void LChunkBuilder::VisitInstruction(HInstruction* current) {
|
966
|
-
HInstruction* old_current = current_instruction_;
|
967
|
-
current_instruction_ = current;
|
968
|
-
if (current->has_position()) position_ = current->position();
|
969
|
-
LInstruction* instr = current->CompileToLithium(this);
|
970
|
-
|
971
|
-
if (instr != NULL) {
|
972
|
-
if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) {
|
973
|
-
instr = AssignPointerMap(instr);
|
974
|
-
}
|
975
|
-
if (FLAG_stress_environments && !instr->HasEnvironment()) {
|
976
|
-
instr = AssignEnvironment(instr);
|
977
|
-
}
|
978
|
-
if (current->IsTest() && !instr->IsGoto()) {
|
979
|
-
ASSERT(instr->IsControl());
|
980
|
-
HTest* test = HTest::cast(current);
|
981
|
-
instr->set_hydrogen_value(test->value());
|
982
|
-
HBasicBlock* first = test->FirstSuccessor();
|
983
|
-
HBasicBlock* second = test->SecondSuccessor();
|
984
|
-
ASSERT(first != NULL && second != NULL);
|
985
|
-
instr->SetBranchTargets(first->block_id(), second->block_id());
|
986
|
-
} else {
|
987
|
-
instr->set_hydrogen_value(current);
|
988
|
-
}
|
989
|
-
|
990
|
-
chunk_->AddInstruction(instr, current_block_);
|
991
|
-
}
|
992
|
-
current_instruction_ = old_current;
|
993
|
-
}
|
994
|
-
|
995
|
-
|
996
|
-
LEnvironment* LChunkBuilder::CreateEnvironment(HEnvironment* hydrogen_env) {
|
997
|
-
if (hydrogen_env == NULL) return NULL;
|
998
|
-
|
999
|
-
LEnvironment* outer = CreateEnvironment(hydrogen_env->outer());
|
1000
|
-
int ast_id = hydrogen_env->ast_id();
|
1001
|
-
ASSERT(ast_id != AstNode::kNoNumber);
|
1002
|
-
int value_count = hydrogen_env->length();
|
1003
|
-
LEnvironment* result = new LEnvironment(hydrogen_env->closure(),
|
1004
|
-
ast_id,
|
1005
|
-
hydrogen_env->parameter_count(),
|
1006
|
-
argument_count_,
|
1007
|
-
value_count,
|
1008
|
-
outer);
|
1009
|
-
int argument_index = 0;
|
1010
|
-
for (int i = 0; i < value_count; ++i) {
|
1011
|
-
HValue* value = hydrogen_env->values()->at(i);
|
1012
|
-
LOperand* op = NULL;
|
1013
|
-
if (value->IsArgumentsObject()) {
|
1014
|
-
op = NULL;
|
1015
|
-
} else if (value->IsPushArgument()) {
|
1016
|
-
op = new LArgument(argument_index++);
|
1017
|
-
} else {
|
1018
|
-
op = UseAny(value);
|
1019
|
-
}
|
1020
|
-
result->AddValue(op, value->representation());
|
1021
|
-
}
|
1022
|
-
|
1023
|
-
return result;
|
1024
|
-
}
|
1025
|
-
|
1026
|
-
|
1027
|
-
LInstruction* LChunkBuilder::DoGoto(HGoto* instr) {
|
1028
|
-
LGoto* result = new LGoto(instr->FirstSuccessor()->block_id(),
|
1029
|
-
instr->include_stack_check());
|
1030
|
-
return (instr->include_stack_check())
|
1031
|
-
? AssignPointerMap(result)
|
1032
|
-
: result;
|
1033
|
-
}
|
1034
|
-
|
1035
|
-
|
1036
|
-
LInstruction* LChunkBuilder::DoTest(HTest* instr) {
|
1037
|
-
HValue* v = instr->value();
|
1038
|
-
if (v->EmitAtUses()) {
|
1039
|
-
if (v->IsClassOfTest()) {
|
1040
|
-
HClassOfTest* compare = HClassOfTest::cast(v);
|
1041
|
-
ASSERT(compare->value()->representation().IsTagged());
|
1042
|
-
|
1043
|
-
return new LClassOfTestAndBranch(UseTempRegister(compare->value()),
|
1044
|
-
TempRegister());
|
1045
|
-
} else if (v->IsCompare()) {
|
1046
|
-
HCompare* compare = HCompare::cast(v);
|
1047
|
-
Token::Value op = compare->token();
|
1048
|
-
HValue* left = compare->left();
|
1049
|
-
HValue* right = compare->right();
|
1050
|
-
Representation r = compare->GetInputRepresentation();
|
1051
|
-
if (r.IsInteger32()) {
|
1052
|
-
ASSERT(left->representation().IsInteger32());
|
1053
|
-
ASSERT(right->representation().IsInteger32());
|
1054
|
-
|
1055
|
-
return new LCmpIDAndBranch(UseRegisterAtStart(left),
|
1056
|
-
UseOrConstantAtStart(right));
|
1057
|
-
} else if (r.IsDouble()) {
|
1058
|
-
ASSERT(left->representation().IsDouble());
|
1059
|
-
ASSERT(right->representation().IsDouble());
|
1060
|
-
|
1061
|
-
return new LCmpIDAndBranch(UseRegisterAtStart(left),
|
1062
|
-
UseRegisterAtStart(right));
|
1063
|
-
} else {
|
1064
|
-
ASSERT(left->representation().IsTagged());
|
1065
|
-
ASSERT(right->representation().IsTagged());
|
1066
|
-
bool reversed = op == Token::GT || op == Token::LTE;
|
1067
|
-
LOperand* left_operand = UseFixed(left, reversed ? rax : rdx);
|
1068
|
-
LOperand* right_operand = UseFixed(right, reversed ? rdx : rax);
|
1069
|
-
LCmpTAndBranch* result = new LCmpTAndBranch(left_operand,
|
1070
|
-
right_operand);
|
1071
|
-
return MarkAsCall(result, instr);
|
1072
|
-
}
|
1073
|
-
} else if (v->IsIsSmi()) {
|
1074
|
-
HIsSmi* compare = HIsSmi::cast(v);
|
1075
|
-
ASSERT(compare->value()->representation().IsTagged());
|
1076
|
-
|
1077
|
-
return new LIsSmiAndBranch(Use(compare->value()));
|
1078
|
-
} else if (v->IsHasInstanceType()) {
|
1079
|
-
HHasInstanceType* compare = HHasInstanceType::cast(v);
|
1080
|
-
ASSERT(compare->value()->representation().IsTagged());
|
1081
|
-
|
1082
|
-
return new LHasInstanceTypeAndBranch(
|
1083
|
-
UseRegisterAtStart(compare->value()));
|
1084
|
-
} else if (v->IsHasCachedArrayIndex()) {
|
1085
|
-
HHasCachedArrayIndex* compare = HHasCachedArrayIndex::cast(v);
|
1086
|
-
ASSERT(compare->value()->representation().IsTagged());
|
1087
|
-
|
1088
|
-
return new LHasCachedArrayIndexAndBranch(
|
1089
|
-
UseRegisterAtStart(compare->value()));
|
1090
|
-
} else if (v->IsIsNull()) {
|
1091
|
-
HIsNull* compare = HIsNull::cast(v);
|
1092
|
-
ASSERT(compare->value()->representation().IsTagged());
|
1093
|
-
|
1094
|
-
// We only need a temp register for non-strict compare.
|
1095
|
-
LOperand* temp = compare->is_strict() ? NULL : TempRegister();
|
1096
|
-
return new LIsNullAndBranch(UseRegisterAtStart(compare->value()),
|
1097
|
-
temp);
|
1098
|
-
} else if (v->IsIsObject()) {
|
1099
|
-
HIsObject* compare = HIsObject::cast(v);
|
1100
|
-
ASSERT(compare->value()->representation().IsTagged());
|
1101
|
-
return new LIsObjectAndBranch(UseRegisterAtStart(compare->value()));
|
1102
|
-
} else if (v->IsCompareJSObjectEq()) {
|
1103
|
-
HCompareJSObjectEq* compare = HCompareJSObjectEq::cast(v);
|
1104
|
-
return new LCmpJSObjectEqAndBranch(UseRegisterAtStart(compare->left()),
|
1105
|
-
UseRegisterAtStart(compare->right()));
|
1106
|
-
} else if (v->IsInstanceOf()) {
|
1107
|
-
HInstanceOf* instance_of = HInstanceOf::cast(v);
|
1108
|
-
LInstanceOfAndBranch* result =
|
1109
|
-
new LInstanceOfAndBranch(UseFixed(instance_of->left(), rax),
|
1110
|
-
UseFixed(instance_of->right(), rdx));
|
1111
|
-
return MarkAsCall(result, instr);
|
1112
|
-
} else if (v->IsTypeofIs()) {
|
1113
|
-
HTypeofIs* typeof_is = HTypeofIs::cast(v);
|
1114
|
-
return new LTypeofIsAndBranch(UseTempRegister(typeof_is->value()));
|
1115
|
-
} else if (v->IsIsConstructCall()) {
|
1116
|
-
return new LIsConstructCallAndBranch(TempRegister());
|
1117
|
-
} else {
|
1118
|
-
if (v->IsConstant()) {
|
1119
|
-
if (HConstant::cast(v)->handle()->IsTrue()) {
|
1120
|
-
return new LGoto(instr->FirstSuccessor()->block_id());
|
1121
|
-
} else if (HConstant::cast(v)->handle()->IsFalse()) {
|
1122
|
-
return new LGoto(instr->SecondSuccessor()->block_id());
|
1123
|
-
}
|
1124
|
-
}
|
1125
|
-
Abort("Undefined compare before branch");
|
1126
|
-
return NULL;
|
1127
|
-
}
|
1128
|
-
}
|
1129
|
-
return new LBranch(UseRegisterAtStart(v));
|
1130
|
-
}
|
1131
|
-
|
1132
|
-
|
1133
|
-
LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) {
|
1134
|
-
ASSERT(instr->value()->representation().IsTagged());
|
1135
|
-
LOperand* value = UseRegisterAtStart(instr->value());
|
1136
|
-
return new LCmpMapAndBranch(value);
|
1137
|
-
}
|
1138
|
-
|
1139
|
-
|
1140
|
-
LInstruction* LChunkBuilder::DoArgumentsLength(HArgumentsLength* length) {
|
1141
|
-
return DefineAsRegister(new LArgumentsLength(Use(length->value())));
|
1142
|
-
}
|
1143
|
-
|
1144
|
-
|
1145
|
-
LInstruction* LChunkBuilder::DoArgumentsElements(HArgumentsElements* elems) {
|
1146
|
-
return DefineAsRegister(new LArgumentsElements);
|
1147
|
-
}
|
1148
|
-
|
1149
|
-
|
1150
|
-
LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) {
|
1151
|
-
LOperand* left = UseFixed(instr->left(), rax);
|
1152
|
-
LOperand* right = UseFixed(instr->right(), rdx);
|
1153
|
-
LInstanceOf* result = new LInstanceOf(left, right);
|
1154
|
-
return MarkAsCall(DefineFixed(result, rax), instr);
|
1155
|
-
}
|
1156
|
-
|
1157
|
-
|
1158
|
-
LInstruction* LChunkBuilder::DoInstanceOfKnownGlobal(
|
1159
|
-
HInstanceOfKnownGlobal* instr) {
|
1160
|
-
LInstanceOfKnownGlobal* result =
|
1161
|
-
new LInstanceOfKnownGlobal(UseFixed(instr->value(), rax));
|
1162
|
-
return MarkAsCall(DefineFixed(result, rax), instr);
|
1163
|
-
}
|
1164
|
-
|
1165
|
-
|
1166
|
-
LInstruction* LChunkBuilder::DoApplyArguments(HApplyArguments* instr) {
|
1167
|
-
LOperand* function = UseFixed(instr->function(), rdi);
|
1168
|
-
LOperand* receiver = UseFixed(instr->receiver(), rax);
|
1169
|
-
LOperand* length = UseFixed(instr->length(), rbx);
|
1170
|
-
LOperand* elements = UseFixed(instr->elements(), rcx);
|
1171
|
-
LApplyArguments* result = new LApplyArguments(function,
|
1172
|
-
receiver,
|
1173
|
-
length,
|
1174
|
-
elements);
|
1175
|
-
return MarkAsCall(DefineFixed(result, rax), instr, CAN_DEOPTIMIZE_EAGERLY);
|
1176
|
-
}
|
1177
|
-
|
1178
|
-
|
1179
|
-
LInstruction* LChunkBuilder::DoPushArgument(HPushArgument* instr) {
|
1180
|
-
++argument_count_;
|
1181
|
-
LOperand* argument = UseOrConstant(instr->argument());
|
1182
|
-
return new LPushArgument(argument);
|
1183
|
-
}
|
1184
|
-
|
1185
|
-
|
1186
|
-
LInstruction* LChunkBuilder::DoContext(HContext* instr) {
|
1187
|
-
return DefineAsRegister(new LContext);
|
1188
|
-
}
|
1189
|
-
|
1190
|
-
|
1191
|
-
LInstruction* LChunkBuilder::DoOuterContext(HOuterContext* instr) {
|
1192
|
-
LOperand* context = UseRegisterAtStart(instr->value());
|
1193
|
-
return DefineAsRegister(new LOuterContext(context));
|
1194
|
-
}
|
1195
|
-
|
1196
|
-
|
1197
|
-
LInstruction* LChunkBuilder::DoGlobalObject(HGlobalObject* instr) {
|
1198
|
-
return DefineAsRegister(new LGlobalObject);
|
1199
|
-
}
|
1200
|
-
|
1201
|
-
|
1202
|
-
LInstruction* LChunkBuilder::DoGlobalReceiver(HGlobalReceiver* instr) {
|
1203
|
-
return DefineAsRegister(new LGlobalReceiver);
|
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
|
-
// The temporary operand is necessary to ensure that right is not allocated
|
1352
|
-
// into edx.
|
1353
|
-
LOperand* temp = FixedTemp(rdx);
|
1354
|
-
LOperand* value = UseFixed(instr->left(), rax);
|
1355
|
-
LOperand* divisor = UseRegister(instr->right());
|
1356
|
-
LModI* mod = new LModI(value, divisor, temp);
|
1357
|
-
LInstruction* result = DefineFixed(mod, rdx);
|
1358
|
-
return (instr->CheckFlag(HValue::kBailoutOnMinusZero) ||
|
1359
|
-
instr->CheckFlag(HValue::kCanBeDivByZero))
|
1360
|
-
? AssignEnvironment(result)
|
1361
|
-
: result;
|
1362
|
-
} else if (instr->representation().IsTagged()) {
|
1363
|
-
return DoArithmeticT(Token::MOD, instr);
|
1364
|
-
} else {
|
1365
|
-
ASSERT(instr->representation().IsDouble());
|
1366
|
-
// We call a C function for double modulo. It can't trigger a GC.
|
1367
|
-
// We need to use fixed result register for the call.
|
1368
|
-
// TODO(fschneider): Allow any register as input registers.
|
1369
|
-
LOperand* left = UseFixedDouble(instr->left(), xmm1);
|
1370
|
-
LOperand* right = UseFixedDouble(instr->right(), xmm2);
|
1371
|
-
LArithmeticD* result = new LArithmeticD(Token::MOD, left, right);
|
1372
|
-
return MarkAsCall(DefineFixedDouble(result, xmm1), instr);
|
1373
|
-
}
|
1374
|
-
}
|
1375
|
-
|
1376
|
-
|
1377
|
-
LInstruction* LChunkBuilder::DoMul(HMul* instr) {
|
1378
|
-
if (instr->representation().IsInteger32()) {
|
1379
|
-
ASSERT(instr->left()->representation().IsInteger32());
|
1380
|
-
ASSERT(instr->right()->representation().IsInteger32());
|
1381
|
-
LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand());
|
1382
|
-
LOperand* right = UseOrConstant(instr->MostConstantOperand());
|
1383
|
-
LMulI* mul = new LMulI(left, right);
|
1384
|
-
return AssignEnvironment(DefineSameAsFirst(mul));
|
1385
|
-
} else if (instr->representation().IsDouble()) {
|
1386
|
-
return DoArithmeticD(Token::MUL, instr);
|
1387
|
-
} else {
|
1388
|
-
ASSERT(instr->representation().IsTagged());
|
1389
|
-
return DoArithmeticT(Token::MUL, instr);
|
1390
|
-
}
|
1391
|
-
}
|
1392
|
-
|
1393
|
-
|
1394
|
-
LInstruction* LChunkBuilder::DoSub(HSub* instr) {
|
1395
|
-
if (instr->representation().IsInteger32()) {
|
1396
|
-
ASSERT(instr->left()->representation().IsInteger32());
|
1397
|
-
ASSERT(instr->right()->representation().IsInteger32());
|
1398
|
-
LOperand* left = UseRegisterAtStart(instr->left());
|
1399
|
-
LOperand* right = UseOrConstantAtStart(instr->right());
|
1400
|
-
LSubI* sub = new LSubI(left, right);
|
1401
|
-
LInstruction* result = DefineSameAsFirst(sub);
|
1402
|
-
if (instr->CheckFlag(HValue::kCanOverflow)) {
|
1403
|
-
result = AssignEnvironment(result);
|
1404
|
-
}
|
1405
|
-
return result;
|
1406
|
-
} else if (instr->representation().IsDouble()) {
|
1407
|
-
return DoArithmeticD(Token::SUB, instr);
|
1408
|
-
} else {
|
1409
|
-
ASSERT(instr->representation().IsTagged());
|
1410
|
-
return DoArithmeticT(Token::SUB, instr);
|
1411
|
-
}
|
1412
|
-
}
|
1413
|
-
|
1414
|
-
|
1415
|
-
LInstruction* LChunkBuilder::DoAdd(HAdd* instr) {
|
1416
|
-
if (instr->representation().IsInteger32()) {
|
1417
|
-
ASSERT(instr->left()->representation().IsInteger32());
|
1418
|
-
ASSERT(instr->right()->representation().IsInteger32());
|
1419
|
-
LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand());
|
1420
|
-
LOperand* right = UseOrConstantAtStart(instr->MostConstantOperand());
|
1421
|
-
LAddI* add = new LAddI(left, right);
|
1422
|
-
LInstruction* result = DefineSameAsFirst(add);
|
1423
|
-
if (instr->CheckFlag(HValue::kCanOverflow)) {
|
1424
|
-
result = AssignEnvironment(result);
|
1425
|
-
}
|
1426
|
-
return result;
|
1427
|
-
} else if (instr->representation().IsDouble()) {
|
1428
|
-
return DoArithmeticD(Token::ADD, instr);
|
1429
|
-
} else {
|
1430
|
-
ASSERT(instr->representation().IsTagged());
|
1431
|
-
return DoArithmeticT(Token::ADD, instr);
|
1432
|
-
}
|
1433
|
-
return NULL;
|
1434
|
-
}
|
1435
|
-
|
1436
|
-
|
1437
|
-
LInstruction* LChunkBuilder::DoPower(HPower* instr) {
|
1438
|
-
ASSERT(instr->representation().IsDouble());
|
1439
|
-
// We call a C function for double power. It can't trigger a GC.
|
1440
|
-
// We need to use fixed result register for the call.
|
1441
|
-
Representation exponent_type = instr->right()->representation();
|
1442
|
-
ASSERT(instr->left()->representation().IsDouble());
|
1443
|
-
LOperand* left = UseFixedDouble(instr->left(), xmm2);
|
1444
|
-
LOperand* right = exponent_type.IsDouble() ?
|
1445
|
-
UseFixedDouble(instr->right(), xmm1) :
|
1446
|
-
#ifdef _WIN64
|
1447
|
-
UseFixed(instr->right(), rdx);
|
1448
|
-
#else
|
1449
|
-
UseFixed(instr->right(), rdi);
|
1450
|
-
#endif
|
1451
|
-
LPower* result = new LPower(left, right);
|
1452
|
-
return MarkAsCall(DefineFixedDouble(result, xmm1), instr,
|
1453
|
-
CAN_DEOPTIMIZE_EAGERLY);
|
1454
|
-
}
|
1455
|
-
|
1456
|
-
|
1457
|
-
LInstruction* LChunkBuilder::DoCompare(HCompare* instr) {
|
1458
|
-
Token::Value op = instr->token();
|
1459
|
-
Representation r = instr->GetInputRepresentation();
|
1460
|
-
if (r.IsInteger32()) {
|
1461
|
-
ASSERT(instr->left()->representation().IsInteger32());
|
1462
|
-
ASSERT(instr->right()->representation().IsInteger32());
|
1463
|
-
LOperand* left = UseRegisterAtStart(instr->left());
|
1464
|
-
LOperand* right = UseOrConstantAtStart(instr->right());
|
1465
|
-
return DefineAsRegister(new LCmpID(left, right));
|
1466
|
-
} else if (r.IsDouble()) {
|
1467
|
-
ASSERT(instr->left()->representation().IsDouble());
|
1468
|
-
ASSERT(instr->right()->representation().IsDouble());
|
1469
|
-
LOperand* left = UseRegisterAtStart(instr->left());
|
1470
|
-
LOperand* right = UseRegisterAtStart(instr->right());
|
1471
|
-
return DefineAsRegister(new LCmpID(left, right));
|
1472
|
-
} else {
|
1473
|
-
ASSERT(instr->left()->representation().IsTagged());
|
1474
|
-
ASSERT(instr->right()->representation().IsTagged());
|
1475
|
-
bool reversed = (op == Token::GT || op == Token::LTE);
|
1476
|
-
LOperand* left = UseFixed(instr->left(), reversed ? rax : rdx);
|
1477
|
-
LOperand* right = UseFixed(instr->right(), reversed ? rdx : rax);
|
1478
|
-
LCmpT* result = new LCmpT(left, right);
|
1479
|
-
return MarkAsCall(DefineFixed(result, rax), instr);
|
1480
|
-
}
|
1481
|
-
}
|
1482
|
-
|
1483
|
-
|
1484
|
-
LInstruction* LChunkBuilder::DoCompareJSObjectEq(
|
1485
|
-
HCompareJSObjectEq* instr) {
|
1486
|
-
LOperand* left = UseRegisterAtStart(instr->left());
|
1487
|
-
LOperand* right = UseRegisterAtStart(instr->right());
|
1488
|
-
LCmpJSObjectEq* result = new LCmpJSObjectEq(left, right);
|
1489
|
-
return DefineAsRegister(result);
|
1490
|
-
}
|
1491
|
-
|
1492
|
-
|
1493
|
-
LInstruction* LChunkBuilder::DoIsNull(HIsNull* instr) {
|
1494
|
-
ASSERT(instr->value()->representation().IsTagged());
|
1495
|
-
LOperand* value = UseRegisterAtStart(instr->value());
|
1496
|
-
|
1497
|
-
return DefineAsRegister(new LIsNull(value));
|
1498
|
-
}
|
1499
|
-
|
1500
|
-
|
1501
|
-
LInstruction* LChunkBuilder::DoIsObject(HIsObject* instr) {
|
1502
|
-
ASSERT(instr->value()->representation().IsTagged());
|
1503
|
-
LOperand* value = UseRegister(instr->value());
|
1504
|
-
|
1505
|
-
return DefineAsRegister(new LIsObject(value));
|
1506
|
-
}
|
1507
|
-
|
1508
|
-
|
1509
|
-
LInstruction* LChunkBuilder::DoIsSmi(HIsSmi* instr) {
|
1510
|
-
ASSERT(instr->value()->representation().IsTagged());
|
1511
|
-
LOperand* value = UseAtStart(instr->value());
|
1512
|
-
|
1513
|
-
return DefineAsRegister(new LIsSmi(value));
|
1514
|
-
}
|
1515
|
-
|
1516
|
-
|
1517
|
-
LInstruction* LChunkBuilder::DoHasInstanceType(HHasInstanceType* instr) {
|
1518
|
-
ASSERT(instr->value()->representation().IsTagged());
|
1519
|
-
LOperand* value = UseRegisterAtStart(instr->value());
|
1520
|
-
|
1521
|
-
return DefineAsRegister(new LHasInstanceType(value));
|
1522
|
-
}
|
1523
|
-
|
1524
|
-
|
1525
|
-
LInstruction* LChunkBuilder::DoGetCachedArrayIndex(
|
1526
|
-
HGetCachedArrayIndex* instr) {
|
1527
|
-
Abort("Unimplemented: %s", "DoGetCachedArrayIndex");
|
1528
|
-
return NULL;
|
1529
|
-
}
|
1530
|
-
|
1531
|
-
|
1532
|
-
LInstruction* LChunkBuilder::DoHasCachedArrayIndex(
|
1533
|
-
HHasCachedArrayIndex* instr) {
|
1534
|
-
ASSERT(instr->value()->representation().IsTagged());
|
1535
|
-
LOperand* value = UseRegister(instr->value());
|
1536
|
-
return DefineAsRegister(new LHasCachedArrayIndex(value));
|
1537
|
-
}
|
1538
|
-
|
1539
|
-
|
1540
|
-
LInstruction* LChunkBuilder::DoClassOfTest(HClassOfTest* instr) {
|
1541
|
-
Abort("Unimplemented: %s", "DoClassOfTest");
|
1542
|
-
return NULL;
|
1543
|
-
}
|
1544
|
-
|
1545
|
-
|
1546
|
-
LInstruction* LChunkBuilder::DoJSArrayLength(HJSArrayLength* instr) {
|
1547
|
-
LOperand* array = UseRegisterAtStart(instr->value());
|
1548
|
-
return DefineAsRegister(new LJSArrayLength(array));
|
1549
|
-
}
|
1550
|
-
|
1551
|
-
|
1552
|
-
LInstruction* LChunkBuilder::DoFixedArrayLength(HFixedArrayLength* instr) {
|
1553
|
-
LOperand* array = UseRegisterAtStart(instr->value());
|
1554
|
-
return DefineAsRegister(new LFixedArrayLength(array));
|
1555
|
-
}
|
1556
|
-
|
1557
|
-
|
1558
|
-
LInstruction* LChunkBuilder::DoPixelArrayLength(HPixelArrayLength* instr) {
|
1559
|
-
LOperand* array = UseRegisterAtStart(instr->value());
|
1560
|
-
return DefineAsRegister(new LPixelArrayLength(array));
|
1561
|
-
}
|
1562
|
-
|
1563
|
-
|
1564
|
-
LInstruction* LChunkBuilder::DoValueOf(HValueOf* instr) {
|
1565
|
-
LOperand* object = UseRegister(instr->value());
|
1566
|
-
LValueOf* result = new LValueOf(object);
|
1567
|
-
return AssignEnvironment(DefineSameAsFirst(result));
|
1568
|
-
}
|
1569
|
-
|
1570
|
-
|
1571
|
-
LInstruction* LChunkBuilder::DoBoundsCheck(HBoundsCheck* instr) {
|
1572
|
-
return AssignEnvironment(new LBoundsCheck(UseRegisterAtStart(instr->index()),
|
1573
|
-
Use(instr->length())));
|
1574
|
-
}
|
1575
|
-
|
1576
|
-
|
1577
|
-
LInstruction* LChunkBuilder::DoAbnormalExit(HAbnormalExit* instr) {
|
1578
|
-
// The control instruction marking the end of a block that completed
|
1579
|
-
// abruptly (e.g., threw an exception). There is nothing specific to do.
|
1580
|
-
return NULL;
|
1581
|
-
}
|
1582
|
-
|
1583
|
-
|
1584
|
-
LInstruction* LChunkBuilder::DoThrow(HThrow* instr) {
|
1585
|
-
LOperand* value = UseFixed(instr->value(), rax);
|
1586
|
-
return MarkAsCall(new LThrow(value), instr);
|
1587
|
-
}
|
1588
|
-
|
1589
|
-
|
1590
|
-
LInstruction* LChunkBuilder::DoChange(HChange* instr) {
|
1591
|
-
Representation from = instr->from();
|
1592
|
-
Representation to = instr->to();
|
1593
|
-
if (from.IsTagged()) {
|
1594
|
-
if (to.IsDouble()) {
|
1595
|
-
LOperand* value = UseRegister(instr->value());
|
1596
|
-
LNumberUntagD* res = new LNumberUntagD(value);
|
1597
|
-
return AssignEnvironment(DefineAsRegister(res));
|
1598
|
-
} else {
|
1599
|
-
ASSERT(to.IsInteger32());
|
1600
|
-
LOperand* value = UseRegister(instr->value());
|
1601
|
-
bool needs_check = !instr->value()->type().IsSmi();
|
1602
|
-
if (needs_check) {
|
1603
|
-
LOperand* xmm_temp =
|
1604
|
-
(instr->CanTruncateToInt32() && CpuFeatures::IsSupported(SSE3))
|
1605
|
-
? NULL
|
1606
|
-
: FixedTemp(xmm1);
|
1607
|
-
LTaggedToI* res = new LTaggedToI(value, xmm_temp);
|
1608
|
-
return AssignEnvironment(DefineSameAsFirst(res));
|
1609
|
-
} else {
|
1610
|
-
return DefineSameAsFirst(new LSmiUntag(value, needs_check));
|
1611
|
-
}
|
1612
|
-
}
|
1613
|
-
} else if (from.IsDouble()) {
|
1614
|
-
if (to.IsTagged()) {
|
1615
|
-
LOperand* value = UseRegister(instr->value());
|
1616
|
-
LOperand* temp = TempRegister();
|
1617
|
-
|
1618
|
-
// Make sure that temp and result_temp are different registers.
|
1619
|
-
LUnallocated* result_temp = TempRegister();
|
1620
|
-
LNumberTagD* result = new LNumberTagD(value, temp);
|
1621
|
-
return AssignPointerMap(Define(result, result_temp));
|
1622
|
-
} else {
|
1623
|
-
ASSERT(to.IsInteger32());
|
1624
|
-
LOperand* value = UseRegister(instr->value());
|
1625
|
-
return AssignEnvironment(DefineAsRegister(new LDoubleToI(value)));
|
1626
|
-
}
|
1627
|
-
} else if (from.IsInteger32()) {
|
1628
|
-
if (to.IsTagged()) {
|
1629
|
-
HValue* val = instr->value();
|
1630
|
-
LOperand* value = UseRegister(val);
|
1631
|
-
if (val->HasRange() && val->range()->IsInSmiRange()) {
|
1632
|
-
return DefineSameAsFirst(new LSmiTag(value));
|
1633
|
-
} else {
|
1634
|
-
LNumberTagI* result = new LNumberTagI(value);
|
1635
|
-
return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result)));
|
1636
|
-
}
|
1637
|
-
} else {
|
1638
|
-
ASSERT(to.IsDouble());
|
1639
|
-
return DefineAsRegister(new LInteger32ToDouble(Use(instr->value())));
|
1640
|
-
}
|
1641
|
-
}
|
1642
|
-
UNREACHABLE();
|
1643
|
-
return NULL;
|
1644
|
-
}
|
1645
|
-
|
1646
|
-
|
1647
|
-
LInstruction* LChunkBuilder::DoCheckNonSmi(HCheckNonSmi* instr) {
|
1648
|
-
LOperand* value = UseRegisterAtStart(instr->value());
|
1649
|
-
return AssignEnvironment(new LCheckSmi(value, zero));
|
1650
|
-
}
|
1651
|
-
|
1652
|
-
|
1653
|
-
LInstruction* LChunkBuilder::DoCheckInstanceType(HCheckInstanceType* instr) {
|
1654
|
-
LOperand* value = UseRegisterAtStart(instr->value());
|
1655
|
-
LCheckInstanceType* result = new LCheckInstanceType(value);
|
1656
|
-
return AssignEnvironment(result);
|
1657
|
-
}
|
1658
|
-
|
1659
|
-
|
1660
|
-
LInstruction* LChunkBuilder::DoCheckPrototypeMaps(HCheckPrototypeMaps* instr) {
|
1661
|
-
LOperand* temp = TempRegister();
|
1662
|
-
LCheckPrototypeMaps* result = new LCheckPrototypeMaps(temp);
|
1663
|
-
return AssignEnvironment(result);
|
1664
|
-
}
|
1665
|
-
|
1666
|
-
|
1667
|
-
LInstruction* LChunkBuilder::DoCheckSmi(HCheckSmi* instr) {
|
1668
|
-
LOperand* value = UseRegisterAtStart(instr->value());
|
1669
|
-
return AssignEnvironment(new LCheckSmi(value, not_zero));
|
1670
|
-
}
|
1671
|
-
|
1672
|
-
|
1673
|
-
LInstruction* LChunkBuilder::DoCheckFunction(HCheckFunction* instr) {
|
1674
|
-
LOperand* value = UseRegisterAtStart(instr->value());
|
1675
|
-
return AssignEnvironment(new LCheckFunction(value));
|
1676
|
-
}
|
1677
|
-
|
1678
|
-
|
1679
|
-
LInstruction* LChunkBuilder::DoCheckMap(HCheckMap* instr) {
|
1680
|
-
LOperand* value = UseRegisterAtStart(instr->value());
|
1681
|
-
LCheckMap* result = new LCheckMap(value);
|
1682
|
-
return AssignEnvironment(result);
|
1683
|
-
}
|
1684
|
-
|
1685
|
-
|
1686
|
-
LInstruction* LChunkBuilder::DoReturn(HReturn* instr) {
|
1687
|
-
return new LReturn(UseFixed(instr->value(), rax));
|
1688
|
-
}
|
1689
|
-
|
1690
|
-
|
1691
|
-
LInstruction* LChunkBuilder::DoConstant(HConstant* instr) {
|
1692
|
-
Representation r = instr->representation();
|
1693
|
-
if (r.IsInteger32()) {
|
1694
|
-
return DefineAsRegister(new LConstantI);
|
1695
|
-
} else if (r.IsDouble()) {
|
1696
|
-
LOperand* temp = TempRegister();
|
1697
|
-
return DefineAsRegister(new LConstantD(temp));
|
1698
|
-
} else if (r.IsTagged()) {
|
1699
|
-
return DefineAsRegister(new LConstantT);
|
1700
|
-
} else {
|
1701
|
-
UNREACHABLE();
|
1702
|
-
return NULL;
|
1703
|
-
}
|
1704
|
-
}
|
1705
|
-
|
1706
|
-
|
1707
|
-
LInstruction* LChunkBuilder::DoLoadGlobal(HLoadGlobal* instr) {
|
1708
|
-
LLoadGlobal* result = new LLoadGlobal;
|
1709
|
-
return instr->check_hole_value()
|
1710
|
-
? AssignEnvironment(DefineAsRegister(result))
|
1711
|
-
: DefineAsRegister(result);
|
1712
|
-
}
|
1713
|
-
|
1714
|
-
|
1715
|
-
LInstruction* LChunkBuilder::DoStoreGlobal(HStoreGlobal* instr) {
|
1716
|
-
LStoreGlobal* result = new LStoreGlobal(UseRegister(instr->value()),
|
1717
|
-
TempRegister());
|
1718
|
-
return instr->check_hole_value() ? AssignEnvironment(result) : result;
|
1719
|
-
}
|
1720
|
-
|
1721
|
-
|
1722
|
-
LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) {
|
1723
|
-
LOperand* context = UseRegisterAtStart(instr->value());
|
1724
|
-
return DefineAsRegister(new LLoadContextSlot(context));
|
1725
|
-
}
|
1726
|
-
|
1727
|
-
|
1728
|
-
LInstruction* LChunkBuilder::DoStoreContextSlot(HStoreContextSlot* instr) {
|
1729
|
-
Abort("Unimplemented: DoStoreContextSlot"); // Temporarily disabled (whesse).
|
1730
|
-
LOperand* context;
|
1731
|
-
LOperand* value;
|
1732
|
-
if (instr->NeedsWriteBarrier()) {
|
1733
|
-
context = UseTempRegister(instr->context());
|
1734
|
-
value = UseTempRegister(instr->value());
|
1735
|
-
} else {
|
1736
|
-
context = UseRegister(instr->context());
|
1737
|
-
value = UseRegister(instr->value());
|
1738
|
-
}
|
1739
|
-
return new LStoreContextSlot(context, value);
|
1740
|
-
}
|
1741
|
-
|
1742
|
-
|
1743
|
-
LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) {
|
1744
|
-
ASSERT(instr->representation().IsTagged());
|
1745
|
-
LOperand* obj = UseRegisterAtStart(instr->object());
|
1746
|
-
return DefineAsRegister(new LLoadNamedField(obj));
|
1747
|
-
}
|
1748
|
-
|
1749
|
-
|
1750
|
-
LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) {
|
1751
|
-
LOperand* object = UseFixed(instr->object(), rax);
|
1752
|
-
LLoadNamedGeneric* result = new LLoadNamedGeneric(object);
|
1753
|
-
return MarkAsCall(DefineFixed(result, rax), instr);
|
1754
|
-
}
|
1755
|
-
|
1756
|
-
|
1757
|
-
LInstruction* LChunkBuilder::DoLoadFunctionPrototype(
|
1758
|
-
HLoadFunctionPrototype* instr) {
|
1759
|
-
return AssignEnvironment(DefineAsRegister(
|
1760
|
-
new LLoadFunctionPrototype(UseRegister(instr->function()))));
|
1761
|
-
}
|
1762
|
-
|
1763
|
-
|
1764
|
-
LInstruction* LChunkBuilder::DoLoadElements(HLoadElements* instr) {
|
1765
|
-
LOperand* input = UseRegisterAtStart(instr->value());
|
1766
|
-
return DefineAsRegister(new LLoadElements(input));
|
1767
|
-
}
|
1768
|
-
|
1769
|
-
|
1770
|
-
LInstruction* LChunkBuilder::DoLoadPixelArrayExternalPointer(
|
1771
|
-
HLoadPixelArrayExternalPointer* instr) {
|
1772
|
-
LOperand* input = UseRegisterAtStart(instr->value());
|
1773
|
-
return DefineAsRegister(new LLoadPixelArrayExternalPointer(input));
|
1774
|
-
}
|
1775
|
-
|
1776
|
-
|
1777
|
-
LInstruction* LChunkBuilder::DoLoadKeyedFastElement(
|
1778
|
-
HLoadKeyedFastElement* instr) {
|
1779
|
-
ASSERT(instr->representation().IsTagged());
|
1780
|
-
ASSERT(instr->key()->representation().IsInteger32());
|
1781
|
-
LOperand* obj = UseRegisterAtStart(instr->object());
|
1782
|
-
LOperand* key = UseRegisterAtStart(instr->key());
|
1783
|
-
LLoadKeyedFastElement* result = new LLoadKeyedFastElement(obj, key);
|
1784
|
-
return AssignEnvironment(DefineSameAsFirst(result));
|
1785
|
-
}
|
1786
|
-
|
1787
|
-
|
1788
|
-
LInstruction* LChunkBuilder::DoLoadPixelArrayElement(
|
1789
|
-
HLoadPixelArrayElement* instr) {
|
1790
|
-
ASSERT(instr->representation().IsInteger32());
|
1791
|
-
ASSERT(instr->key()->representation().IsInteger32());
|
1792
|
-
LOperand* external_pointer =
|
1793
|
-
UseRegisterAtStart(instr->external_pointer());
|
1794
|
-
LOperand* key = UseRegisterAtStart(instr->key());
|
1795
|
-
LLoadPixelArrayElement* result =
|
1796
|
-
new LLoadPixelArrayElement(external_pointer, key);
|
1797
|
-
return DefineSameAsFirst(result);
|
1798
|
-
}
|
1799
|
-
|
1800
|
-
|
1801
|
-
LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) {
|
1802
|
-
LOperand* object = UseFixed(instr->object(), rdx);
|
1803
|
-
LOperand* key = UseFixed(instr->key(), rax);
|
1804
|
-
|
1805
|
-
LLoadKeyedGeneric* result = new LLoadKeyedGeneric(object, key);
|
1806
|
-
return MarkAsCall(DefineFixed(result, rax), instr);
|
1807
|
-
}
|
1808
|
-
|
1809
|
-
|
1810
|
-
LInstruction* LChunkBuilder::DoStoreKeyedFastElement(
|
1811
|
-
HStoreKeyedFastElement* instr) {
|
1812
|
-
bool needs_write_barrier = instr->NeedsWriteBarrier();
|
1813
|
-
ASSERT(instr->value()->representation().IsTagged());
|
1814
|
-
ASSERT(instr->object()->representation().IsTagged());
|
1815
|
-
ASSERT(instr->key()->representation().IsInteger32());
|
1816
|
-
|
1817
|
-
LOperand* obj = UseTempRegister(instr->object());
|
1818
|
-
LOperand* val = needs_write_barrier
|
1819
|
-
? UseTempRegister(instr->value())
|
1820
|
-
: UseRegisterAtStart(instr->value());
|
1821
|
-
LOperand* key = needs_write_barrier
|
1822
|
-
? UseTempRegister(instr->key())
|
1823
|
-
: UseRegisterOrConstantAtStart(instr->key());
|
1824
|
-
|
1825
|
-
return AssignEnvironment(new LStoreKeyedFastElement(obj, key, val));
|
1826
|
-
}
|
1827
|
-
|
1828
|
-
|
1829
|
-
LInstruction* LChunkBuilder::DoStorePixelArrayElement(
|
1830
|
-
HStorePixelArrayElement* instr) {
|
1831
|
-
ASSERT(instr->value()->representation().IsInteger32());
|
1832
|
-
ASSERT(instr->external_pointer()->representation().IsExternal());
|
1833
|
-
ASSERT(instr->key()->representation().IsInteger32());
|
1834
|
-
|
1835
|
-
LOperand* external_pointer = UseRegister(instr->external_pointer());
|
1836
|
-
LOperand* val = UseTempRegister(instr->value());
|
1837
|
-
LOperand* key = UseRegister(instr->key());
|
1838
|
-
|
1839
|
-
return new LStorePixelArrayElement(external_pointer, key, val);
|
1840
|
-
}
|
1841
|
-
|
1842
|
-
|
1843
|
-
LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) {
|
1844
|
-
LOperand* object = UseFixed(instr->object(), rdx);
|
1845
|
-
LOperand* key = UseFixed(instr->key(), rcx);
|
1846
|
-
LOperand* value = UseFixed(instr->value(), rax);
|
1847
|
-
|
1848
|
-
ASSERT(instr->object()->representation().IsTagged());
|
1849
|
-
ASSERT(instr->key()->representation().IsTagged());
|
1850
|
-
ASSERT(instr->value()->representation().IsTagged());
|
1851
|
-
|
1852
|
-
LStoreKeyedGeneric* result = new LStoreKeyedGeneric(object, key, value);
|
1853
|
-
return MarkAsCall(result, instr);
|
1854
|
-
}
|
1855
|
-
|
1856
|
-
|
1857
|
-
LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) {
|
1858
|
-
bool needs_write_barrier = instr->NeedsWriteBarrier();
|
1859
|
-
|
1860
|
-
LOperand* obj = needs_write_barrier
|
1861
|
-
? UseTempRegister(instr->object())
|
1862
|
-
: UseRegisterAtStart(instr->object());
|
1863
|
-
|
1864
|
-
LOperand* val = needs_write_barrier
|
1865
|
-
? UseTempRegister(instr->value())
|
1866
|
-
: UseRegister(instr->value());
|
1867
|
-
|
1868
|
-
// We only need a scratch register if we have a write barrier or we
|
1869
|
-
// have a store into the properties array (not in-object-property).
|
1870
|
-
LOperand* temp = (!instr->is_in_object() || needs_write_barrier)
|
1871
|
-
? TempRegister() : NULL;
|
1872
|
-
|
1873
|
-
return new LStoreNamedField(obj, val, temp);
|
1874
|
-
}
|
1875
|
-
|
1876
|
-
|
1877
|
-
LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) {
|
1878
|
-
LOperand* object = UseFixed(instr->object(), rdx);
|
1879
|
-
LOperand* value = UseFixed(instr->value(), rax);
|
1880
|
-
|
1881
|
-
LStoreNamedGeneric* result = new LStoreNamedGeneric(object, value);
|
1882
|
-
return MarkAsCall(result, instr);
|
1883
|
-
}
|
1884
|
-
|
1885
|
-
|
1886
|
-
LInstruction* LChunkBuilder::DoStringCharCodeAt(HStringCharCodeAt* instr) {
|
1887
|
-
LOperand* string = UseRegister(instr->string());
|
1888
|
-
LOperand* index = UseRegisterOrConstant(instr->index());
|
1889
|
-
LStringCharCodeAt* result = new LStringCharCodeAt(string, index);
|
1890
|
-
return AssignEnvironment(AssignPointerMap(DefineAsRegister(result)));
|
1891
|
-
}
|
1892
|
-
|
1893
|
-
|
1894
|
-
LInstruction* LChunkBuilder::DoStringLength(HStringLength* instr) {
|
1895
|
-
LOperand* string = UseRegisterAtStart(instr->value());
|
1896
|
-
return DefineAsRegister(new LStringLength(string));
|
1897
|
-
}
|
1898
|
-
|
1899
|
-
|
1900
|
-
LInstruction* LChunkBuilder::DoArrayLiteral(HArrayLiteral* instr) {
|
1901
|
-
return MarkAsCall(DefineFixed(new LArrayLiteral, rax), instr);
|
1902
|
-
}
|
1903
|
-
|
1904
|
-
|
1905
|
-
LInstruction* LChunkBuilder::DoObjectLiteral(HObjectLiteral* instr) {
|
1906
|
-
return MarkAsCall(DefineFixed(new LObjectLiteral, rax), instr);
|
1907
|
-
}
|
1908
|
-
|
1909
|
-
|
1910
|
-
LInstruction* LChunkBuilder::DoRegExpLiteral(HRegExpLiteral* instr) {
|
1911
|
-
return MarkAsCall(DefineFixed(new LRegExpLiteral, rax), instr);
|
1912
|
-
}
|
1913
|
-
|
1914
|
-
|
1915
|
-
LInstruction* LChunkBuilder::DoFunctionLiteral(HFunctionLiteral* instr) {
|
1916
|
-
return MarkAsCall(DefineFixed(new LFunctionLiteral, rax), instr);
|
1917
|
-
}
|
1918
|
-
|
1919
|
-
|
1920
|
-
LInstruction* LChunkBuilder::DoDeleteProperty(HDeleteProperty* instr) {
|
1921
|
-
LDeleteProperty* result =
|
1922
|
-
new LDeleteProperty(Use(instr->object()), UseOrConstant(instr->key()));
|
1923
|
-
return MarkAsCall(DefineFixed(result, rax), instr);
|
1924
|
-
}
|
1925
|
-
|
1926
|
-
|
1927
|
-
LInstruction* LChunkBuilder::DoOsrEntry(HOsrEntry* instr) {
|
1928
|
-
allocator_->MarkAsOsrEntry();
|
1929
|
-
current_block_->last_environment()->set_ast_id(instr->ast_id());
|
1930
|
-
return AssignEnvironment(new LOsrEntry);
|
1931
|
-
}
|
1932
|
-
|
1933
|
-
|
1934
|
-
LInstruction* LChunkBuilder::DoParameter(HParameter* instr) {
|
1935
|
-
int spill_index = chunk()->GetParameterStackSlot(instr->index());
|
1936
|
-
return DefineAsSpilled(new LParameter, spill_index);
|
1937
|
-
}
|
1938
|
-
|
1939
|
-
|
1940
|
-
LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) {
|
1941
|
-
int spill_index = chunk()->GetNextSpillIndex(false); // Not double-width.
|
1942
|
-
return DefineAsSpilled(new LUnknownOSRValue, spill_index);
|
1943
|
-
}
|
1944
|
-
|
1945
|
-
|
1946
|
-
LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) {
|
1947
|
-
argument_count_ -= instr->argument_count();
|
1948
|
-
return MarkAsCall(DefineFixed(new LCallStub, rax), instr);
|
1949
|
-
}
|
1950
|
-
|
1951
|
-
|
1952
|
-
LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) {
|
1953
|
-
// There are no real uses of the arguments object.
|
1954
|
-
// arguments.length and element access are supported directly on
|
1955
|
-
// stack arguments, and any real arguments object use causes a bailout.
|
1956
|
-
// So this value is never used.
|
1957
|
-
return NULL;
|
1958
|
-
}
|
1959
|
-
|
1960
|
-
|
1961
|
-
LInstruction* LChunkBuilder::DoAccessArgumentsAt(HAccessArgumentsAt* instr) {
|
1962
|
-
LOperand* arguments = UseRegister(instr->arguments());
|
1963
|
-
LOperand* length = UseTempRegister(instr->length());
|
1964
|
-
LOperand* index = Use(instr->index());
|
1965
|
-
LAccessArgumentsAt* result = new LAccessArgumentsAt(arguments, length, index);
|
1966
|
-
return AssignEnvironment(DefineAsRegister(result));
|
1967
|
-
}
|
1968
|
-
|
1969
|
-
|
1970
|
-
LInstruction* LChunkBuilder::DoTypeof(HTypeof* instr) {
|
1971
|
-
LTypeof* result = new LTypeof(UseAtStart(instr->value()));
|
1972
|
-
return MarkAsCall(DefineFixed(result, rax), instr);
|
1973
|
-
}
|
1974
|
-
|
1975
|
-
|
1976
|
-
LInstruction* LChunkBuilder::DoTypeofIs(HTypeofIs* instr) {
|
1977
|
-
return DefineSameAsFirst(new LTypeofIs(UseRegister(instr->value())));
|
1978
|
-
}
|
1979
|
-
|
1980
|
-
|
1981
|
-
LInstruction* LChunkBuilder::DoIsConstructCall(HIsConstructCall* instr) {
|
1982
|
-
return DefineAsRegister(new LIsConstructCall);
|
1983
|
-
}
|
1984
|
-
|
1985
|
-
|
1986
|
-
LInstruction* LChunkBuilder::DoSimulate(HSimulate* instr) {
|
1987
|
-
HEnvironment* env = current_block_->last_environment();
|
1988
|
-
ASSERT(env != NULL);
|
1989
|
-
|
1990
|
-
env->set_ast_id(instr->ast_id());
|
1991
|
-
|
1992
|
-
env->Drop(instr->pop_count());
|
1993
|
-
for (int i = 0; i < instr->values()->length(); ++i) {
|
1994
|
-
HValue* value = instr->values()->at(i);
|
1995
|
-
if (instr->HasAssignedIndexAt(i)) {
|
1996
|
-
env->Bind(instr->GetAssignedIndexAt(i), value);
|
1997
|
-
} else {
|
1998
|
-
env->Push(value);
|
1999
|
-
}
|
2000
|
-
}
|
2001
|
-
ASSERT(env->length() == instr->environment_length());
|
2002
|
-
|
2003
|
-
// If there is an instruction pending deoptimization environment create a
|
2004
|
-
// lazy bailout instruction to capture the environment.
|
2005
|
-
if (pending_deoptimization_ast_id_ == instr->ast_id()) {
|
2006
|
-
LLazyBailout* lazy_bailout = new LLazyBailout;
|
2007
|
-
LInstruction* result = AssignEnvironment(lazy_bailout);
|
2008
|
-
instruction_pending_deoptimization_environment_->
|
2009
|
-
set_deoptimization_environment(result->environment());
|
2010
|
-
ClearInstructionPendingDeoptimizationEnvironment();
|
2011
|
-
return result;
|
2012
|
-
}
|
2013
|
-
|
2014
|
-
return NULL;
|
2015
|
-
}
|
2016
|
-
|
2017
|
-
|
2018
|
-
LInstruction* LChunkBuilder::DoStackCheck(HStackCheck* instr) {
|
2019
|
-
return MarkAsCall(new LStackCheck, instr);
|
2020
|
-
}
|
2021
|
-
|
2022
|
-
|
2023
|
-
LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) {
|
2024
|
-
HEnvironment* outer = current_block_->last_environment();
|
2025
|
-
HConstant* undefined = graph()->GetConstantUndefined();
|
2026
|
-
HEnvironment* inner = outer->CopyForInlining(instr->closure(),
|
2027
|
-
instr->function(),
|
2028
|
-
false,
|
2029
|
-
undefined);
|
2030
|
-
current_block_->UpdateEnvironment(inner);
|
2031
|
-
chunk_->AddInlinedClosure(instr->closure());
|
2032
|
-
return NULL;
|
2033
|
-
}
|
2034
|
-
|
2035
|
-
|
2036
|
-
LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) {
|
2037
|
-
HEnvironment* outer = current_block_->last_environment()->outer();
|
2038
|
-
current_block_->UpdateEnvironment(outer);
|
2039
|
-
return NULL;
|
2040
|
-
}
|
2041
|
-
|
2042
|
-
} } // namespace v8::internal
|
2043
|
-
|
2044
|
-
#endif // V8_TARGET_ARCH_X64
|