therubyracer 0.9.0beta2 → 0.9.0beta3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of therubyracer might be problematic. Click here for more details.
- data/.gitmodules +3 -0
- data/ext/v8/upstream/Makefile +1 -2
- data/ext/v8/upstream/v8/.gitignore +33 -0
- data/ext/v8/upstream/v8/AUTHORS +42 -0
- data/ext/v8/upstream/v8/ChangeLog +2663 -0
- data/ext/v8/upstream/{3.1.8 → v8}/LICENSE +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/LICENSE.strongtalk +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/LICENSE.v8 +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/LICENSE.valgrind +0 -0
- data/ext/v8/upstream/v8/SConstruct +1473 -0
- data/ext/v8/upstream/{3.1.8 → v8}/build/README.txt +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/build/all.gyp +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/build/armu.gypi +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/build/common.gypi +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/build/gyp_v8 +0 -0
- data/ext/v8/upstream/v8/include/v8-debug.h +394 -0
- data/ext/v8/upstream/v8/include/v8-preparser.h +116 -0
- data/ext/v8/upstream/v8/include/v8-profiler.h +505 -0
- data/ext/v8/upstream/v8/include/v8-testing.h +104 -0
- data/ext/v8/upstream/v8/include/v8.h +4000 -0
- data/ext/v8/upstream/{3.1.8 → v8}/include/v8stdint.h +0 -0
- data/ext/v8/upstream/v8/preparser/SConscript +38 -0
- data/ext/v8/upstream/v8/preparser/preparser-process.cc +169 -0
- data/ext/v8/upstream/v8/src/SConscript +380 -0
- data/ext/v8/upstream/v8/src/accessors.cc +766 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/accessors.h +0 -0
- data/ext/v8/upstream/v8/src/allocation-inl.h +49 -0
- data/ext/v8/upstream/v8/src/allocation.cc +122 -0
- data/ext/v8/upstream/v8/src/allocation.h +143 -0
- data/ext/v8/upstream/v8/src/api.cc +5678 -0
- data/ext/v8/upstream/v8/src/api.h +572 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/apinatives.js +0 -0
- data/ext/v8/upstream/v8/src/apiutils.h +73 -0
- data/ext/v8/upstream/v8/src/arguments.h +116 -0
- data/ext/v8/upstream/v8/src/arm/assembler-arm-inl.h +353 -0
- data/ext/v8/upstream/v8/src/arm/assembler-arm.cc +2877 -0
- data/ext/v8/upstream/v8/src/arm/assembler-arm.h +1382 -0
- data/ext/v8/upstream/v8/src/arm/builtins-arm.cc +1634 -0
- data/ext/v8/upstream/v8/src/arm/code-stubs-arm.cc +6917 -0
- data/ext/v8/upstream/v8/src/arm/code-stubs-arm.h +623 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/arm/codegen-arm-inl.h +0 -0
- data/ext/v8/upstream/v8/src/arm/codegen-arm.cc +7437 -0
- data/ext/v8/upstream/v8/src/arm/codegen-arm.h +595 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/arm/constants-arm.cc +0 -0
- data/ext/v8/upstream/v8/src/arm/constants-arm.h +778 -0
- data/ext/v8/upstream/v8/src/arm/cpu-arm.cc +149 -0
- data/ext/v8/upstream/v8/src/arm/debug-arm.cc +317 -0
- data/ext/v8/upstream/v8/src/arm/deoptimizer-arm.cc +737 -0
- data/ext/v8/upstream/v8/src/arm/disasm-arm.cc +1503 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/arm/frames-arm.cc +0 -0
- data/ext/v8/upstream/v8/src/arm/frames-arm.h +168 -0
- data/ext/v8/upstream/v8/src/arm/full-codegen-arm.cc +4374 -0
- data/ext/v8/upstream/v8/src/arm/ic-arm.cc +1793 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/arm/jump-target-arm.cc +0 -0
- data/ext/v8/upstream/v8/src/arm/lithium-arm.cc +2120 -0
- data/ext/v8/upstream/v8/src/arm/lithium-arm.h +2179 -0
- data/ext/v8/upstream/v8/src/arm/lithium-codegen-arm.cc +4132 -0
- data/ext/v8/upstream/v8/src/arm/lithium-codegen-arm.h +329 -0
- data/ext/v8/upstream/v8/src/arm/lithium-gap-resolver-arm.cc +305 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/arm/lithium-gap-resolver-arm.h +0 -0
- data/ext/v8/upstream/v8/src/arm/macro-assembler-arm.cc +2939 -0
- data/ext/v8/upstream/v8/src/arm/macro-assembler-arm.h +1071 -0
- data/ext/v8/upstream/v8/src/arm/regexp-macro-assembler-arm.cc +1287 -0
- data/ext/v8/upstream/v8/src/arm/regexp-macro-assembler-arm.h +253 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/arm/register-allocator-arm-inl.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/arm/register-allocator-arm.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/arm/register-allocator-arm.h +0 -0
- data/ext/v8/upstream/v8/src/arm/simulator-arm.cc +3288 -0
- data/ext/v8/upstream/v8/src/arm/simulator-arm.h +413 -0
- data/ext/v8/upstream/v8/src/arm/stub-cache-arm.cc +4034 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/arm/virtual-frame-arm-inl.h +0 -0
- data/ext/v8/upstream/v8/src/arm/virtual-frame-arm.cc +843 -0
- data/ext/v8/upstream/v8/src/arm/virtual-frame-arm.h +523 -0
- data/ext/v8/upstream/v8/src/array.js +1249 -0
- data/ext/v8/upstream/v8/src/assembler.cc +1067 -0
- data/ext/v8/upstream/v8/src/assembler.h +823 -0
- data/ext/v8/upstream/v8/src/ast-inl.h +112 -0
- data/ext/v8/upstream/v8/src/ast.cc +1078 -0
- data/ext/v8/upstream/v8/src/ast.h +2234 -0
- data/ext/v8/upstream/v8/src/atomicops.h +167 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/atomicops_internals_arm_gcc.h +0 -0
- data/ext/v8/upstream/v8/src/atomicops_internals_mips_gcc.h +169 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/atomicops_internals_x86_gcc.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/atomicops_internals_x86_gcc.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/atomicops_internals_x86_macosx.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/atomicops_internals_x86_msvc.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/bignum-dtoa.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/bignum-dtoa.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/bignum.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/bignum.h +0 -0
- data/ext/v8/upstream/v8/src/bootstrapper.cc +2138 -0
- data/ext/v8/upstream/v8/src/bootstrapper.h +185 -0
- data/ext/v8/upstream/v8/src/builtins.cc +1708 -0
- data/ext/v8/upstream/v8/src/builtins.h +368 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/bytecodes-irregexp.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/cached-powers.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/cached-powers.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/char-predicates-inl.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/char-predicates.h +0 -0
- data/ext/v8/upstream/v8/src/checks.cc +110 -0
- data/ext/v8/upstream/v8/src/checks.h +296 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/circular-queue-inl.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/circular-queue.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/circular-queue.h +0 -0
- data/ext/v8/upstream/v8/src/code-stubs.cc +240 -0
- data/ext/v8/upstream/v8/src/code-stubs.h +971 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/code.h +0 -0
- data/ext/v8/upstream/v8/src/codegen-inl.h +68 -0
- data/ext/v8/upstream/v8/src/codegen.cc +505 -0
- data/ext/v8/upstream/v8/src/codegen.h +245 -0
- data/ext/v8/upstream/v8/src/compilation-cache.cc +540 -0
- data/ext/v8/upstream/v8/src/compilation-cache.h +287 -0
- data/ext/v8/upstream/v8/src/compiler.cc +792 -0
- data/ext/v8/upstream/v8/src/compiler.h +307 -0
- data/ext/v8/upstream/v8/src/contexts.cc +327 -0
- data/ext/v8/upstream/v8/src/contexts.h +382 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/conversions-inl.h +0 -0
- data/ext/v8/upstream/v8/src/conversions.cc +1125 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/conversions.h +0 -0
- data/ext/v8/upstream/v8/src/counters.cc +93 -0
- data/ext/v8/upstream/v8/src/counters.h +254 -0
- data/ext/v8/upstream/v8/src/cpu-profiler-inl.h +101 -0
- data/ext/v8/upstream/v8/src/cpu-profiler.cc +606 -0
- data/ext/v8/upstream/v8/src/cpu-profiler.h +305 -0
- data/ext/v8/upstream/v8/src/cpu.h +67 -0
- data/ext/v8/upstream/v8/src/d8-debug.cc +367 -0
- data/ext/v8/upstream/v8/src/d8-debug.h +158 -0
- data/ext/v8/upstream/v8/src/d8-posix.cc +695 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/d8-readline.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/d8-windows.cc +0 -0
- data/ext/v8/upstream/v8/src/d8.cc +796 -0
- data/ext/v8/upstream/v8/src/d8.gyp +88 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/d8.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/d8.js +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/data-flow.cc +0 -0
- data/ext/v8/upstream/v8/src/data-flow.h +379 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/date.js +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/dateparser-inl.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/dateparser.cc +0 -0
- data/ext/v8/upstream/v8/src/dateparser.h +265 -0
- data/ext/v8/upstream/v8/src/debug-agent.cc +447 -0
- data/ext/v8/upstream/v8/src/debug-agent.h +129 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/debug-debugger.js +0 -0
- data/ext/v8/upstream/v8/src/debug.cc +3188 -0
- data/ext/v8/upstream/v8/src/debug.h +1055 -0
- data/ext/v8/upstream/v8/src/deoptimizer.cc +1296 -0
- data/ext/v8/upstream/v8/src/deoptimizer.h +629 -0
- data/ext/v8/upstream/v8/src/disasm.h +80 -0
- data/ext/v8/upstream/v8/src/disassembler.cc +339 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/disassembler.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/diy-fp.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/diy-fp.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/double.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/dtoa.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/dtoa.h +0 -0
- data/ext/v8/upstream/v8/src/execution.cc +791 -0
- data/ext/v8/upstream/v8/src/execution.h +291 -0
- data/ext/v8/upstream/v8/src/extensions/experimental/break-iterator.cc +250 -0
- data/ext/v8/upstream/v8/src/extensions/experimental/break-iterator.h +89 -0
- data/ext/v8/upstream/v8/src/extensions/experimental/experimental.gyp +55 -0
- data/ext/v8/upstream/v8/src/extensions/experimental/i18n-extension.cc +284 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/extensions/experimental/i18n-extension.h +0 -0
- data/ext/v8/upstream/v8/src/extensions/externalize-string-extension.cc +141 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/extensions/externalize-string-extension.h +0 -0
- data/ext/v8/upstream/v8/src/extensions/gc-extension.cc +58 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/extensions/gc-extension.h +0 -0
- data/ext/v8/upstream/v8/src/factory.cc +1194 -0
- data/ext/v8/upstream/v8/src/factory.h +436 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/fast-dtoa.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/fast-dtoa.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/fixed-dtoa.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/fixed-dtoa.h +0 -0
- data/ext/v8/upstream/v8/src/flag-definitions.h +556 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/flags.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/flags.h +0 -0
- data/ext/v8/upstream/v8/src/frame-element.cc +37 -0
- data/ext/v8/upstream/v8/src/frame-element.h +269 -0
- data/ext/v8/upstream/v8/src/frames-inl.h +236 -0
- data/ext/v8/upstream/v8/src/frames.cc +1273 -0
- data/ext/v8/upstream/v8/src/frames.h +854 -0
- data/ext/v8/upstream/v8/src/full-codegen.cc +1385 -0
- data/ext/v8/upstream/v8/src/full-codegen.h +753 -0
- data/ext/v8/upstream/v8/src/func-name-inferrer.cc +91 -0
- data/ext/v8/upstream/v8/src/func-name-inferrer.h +111 -0
- data/ext/v8/upstream/v8/src/gdb-jit.cc +1548 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/gdb-jit.h +0 -0
- data/ext/v8/upstream/v8/src/global-handles.cc +596 -0
- data/ext/v8/upstream/v8/src/global-handles.h +239 -0
- data/ext/v8/upstream/v8/src/globals.h +325 -0
- data/ext/v8/upstream/v8/src/handles-inl.h +177 -0
- data/ext/v8/upstream/v8/src/handles.cc +965 -0
- data/ext/v8/upstream/v8/src/handles.h +372 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/hashmap.cc +0 -0
- data/ext/v8/upstream/v8/src/hashmap.h +121 -0
- data/ext/v8/upstream/v8/src/heap-inl.h +703 -0
- data/ext/v8/upstream/v8/src/heap-profiler.cc +1173 -0
- data/ext/v8/upstream/v8/src/heap-profiler.h +396 -0
- data/ext/v8/upstream/v8/src/heap.cc +5856 -0
- data/ext/v8/upstream/v8/src/heap.h +2264 -0
- data/ext/v8/upstream/v8/src/hydrogen-instructions.cc +1639 -0
- data/ext/v8/upstream/v8/src/hydrogen-instructions.h +3657 -0
- data/ext/v8/upstream/v8/src/hydrogen.cc +6011 -0
- data/ext/v8/upstream/v8/src/hydrogen.h +1137 -0
- data/ext/v8/upstream/v8/src/ia32/assembler-ia32-inl.h +430 -0
- data/ext/v8/upstream/v8/src/ia32/assembler-ia32.cc +2846 -0
- data/ext/v8/upstream/v8/src/ia32/assembler-ia32.h +1159 -0
- data/ext/v8/upstream/v8/src/ia32/builtins-ia32.cc +1596 -0
- data/ext/v8/upstream/v8/src/ia32/code-stubs-ia32.cc +6549 -0
- data/ext/v8/upstream/v8/src/ia32/code-stubs-ia32.h +495 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/codegen-ia32-inl.h +0 -0
- data/ext/v8/upstream/v8/src/ia32/codegen-ia32.cc +10385 -0
- data/ext/v8/upstream/v8/src/ia32/codegen-ia32.h +801 -0
- data/ext/v8/upstream/v8/src/ia32/cpu-ia32.cc +88 -0
- data/ext/v8/upstream/v8/src/ia32/debug-ia32.cc +312 -0
- data/ext/v8/upstream/v8/src/ia32/deoptimizer-ia32.cc +774 -0
- data/ext/v8/upstream/v8/src/ia32/disasm-ia32.cc +1620 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/frames-ia32.cc +0 -0
- data/ext/v8/upstream/v8/src/ia32/frames-ia32.h +140 -0
- data/ext/v8/upstream/v8/src/ia32/full-codegen-ia32.cc +4357 -0
- data/ext/v8/upstream/v8/src/ia32/ic-ia32.cc +1779 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/jump-target-ia32.cc +0 -0
- data/ext/v8/upstream/v8/src/ia32/lithium-codegen-ia32.cc +4158 -0
- data/ext/v8/upstream/v8/src/ia32/lithium-codegen-ia32.h +318 -0
- data/ext/v8/upstream/v8/src/ia32/lithium-gap-resolver-ia32.cc +466 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/lithium-gap-resolver-ia32.h +0 -0
- data/ext/v8/upstream/v8/src/ia32/lithium-ia32.cc +2181 -0
- data/ext/v8/upstream/v8/src/ia32/lithium-ia32.h +2235 -0
- data/ext/v8/upstream/v8/src/ia32/macro-assembler-ia32.cc +2056 -0
- data/ext/v8/upstream/v8/src/ia32/macro-assembler-ia32.h +807 -0
- data/ext/v8/upstream/v8/src/ia32/regexp-macro-assembler-ia32.cc +1264 -0
- data/ext/v8/upstream/v8/src/ia32/regexp-macro-assembler-ia32.h +216 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/register-allocator-ia32-inl.h +0 -0
- data/ext/v8/upstream/v8/src/ia32/register-allocator-ia32.cc +157 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/register-allocator-ia32.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/simulator-ia32.cc +0 -0
- data/ext/v8/upstream/v8/src/ia32/simulator-ia32.h +72 -0
- data/ext/v8/upstream/v8/src/ia32/stub-cache-ia32.cc +3711 -0
- data/ext/v8/upstream/v8/src/ia32/virtual-frame-ia32.cc +1366 -0
- data/ext/v8/upstream/v8/src/ia32/virtual-frame-ia32.h +650 -0
- data/ext/v8/upstream/v8/src/ic-inl.h +130 -0
- data/ext/v8/upstream/v8/src/ic.cc +2389 -0
- data/ext/v8/upstream/v8/src/ic.h +675 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/inspector.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/inspector.h +0 -0
- data/ext/v8/upstream/v8/src/interpreter-irregexp.cc +659 -0
- data/ext/v8/upstream/v8/src/interpreter-irregexp.h +49 -0
- data/ext/v8/upstream/v8/src/isolate.cc +883 -0
- data/ext/v8/upstream/v8/src/isolate.h +1306 -0
- data/ext/v8/upstream/v8/src/json.js +342 -0
- data/ext/v8/upstream/v8/src/jsregexp.cc +5371 -0
- data/ext/v8/upstream/v8/src/jsregexp.h +1483 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/jump-target-heavy-inl.h +0 -0
- data/ext/v8/upstream/v8/src/jump-target-heavy.cc +427 -0
- data/ext/v8/upstream/v8/src/jump-target-heavy.h +238 -0
- data/ext/v8/upstream/v8/src/jump-target-inl.h +48 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/jump-target-light-inl.h +0 -0
- data/ext/v8/upstream/v8/src/jump-target-light.cc +111 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/jump-target-light.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/jump-target.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/jump-target.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/list-inl.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/list.h +0 -0
- data/ext/v8/upstream/v8/src/lithium-allocator-inl.h +142 -0
- data/ext/v8/upstream/v8/src/lithium-allocator.cc +2105 -0
- data/ext/v8/upstream/v8/src/lithium-allocator.h +630 -0
- data/ext/v8/upstream/v8/src/lithium.cc +169 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/lithium.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/liveedit-debugger.js +0 -0
- data/ext/v8/upstream/v8/src/liveedit.cc +1693 -0
- data/ext/v8/upstream/v8/src/liveedit.h +179 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/liveobjectlist-inl.h +0 -0
- data/ext/v8/upstream/v8/src/liveobjectlist.cc +2589 -0
- data/ext/v8/upstream/v8/src/liveobjectlist.h +322 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/log-inl.h +0 -0
- data/ext/v8/upstream/v8/src/log-utils.cc +423 -0
- data/ext/v8/upstream/v8/src/log-utils.h +229 -0
- data/ext/v8/upstream/v8/src/log.cc +1666 -0
- data/ext/v8/upstream/v8/src/log.h +446 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/macro-assembler.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/macros.py +0 -0
- data/ext/v8/upstream/v8/src/mark-compact.cc +3092 -0
- data/ext/v8/upstream/v8/src/mark-compact.h +506 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/math.js +0 -0
- data/ext/v8/upstream/v8/src/messages.cc +166 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/messages.h +0 -0
- data/ext/v8/upstream/v8/src/messages.js +1090 -0
- data/ext/v8/upstream/v8/src/mips/assembler-mips-inl.h +335 -0
- data/ext/v8/upstream/v8/src/mips/assembler-mips.cc +2093 -0
- data/ext/v8/upstream/v8/src/mips/assembler-mips.h +1066 -0
- data/ext/v8/upstream/v8/src/mips/builtins-mips.cc +148 -0
- data/ext/v8/upstream/v8/src/mips/code-stubs-mips.cc +752 -0
- data/ext/v8/upstream/v8/src/mips/code-stubs-mips.h +511 -0
- data/ext/v8/upstream/v8/src/mips/codegen-mips-inl.h +64 -0
- data/ext/v8/upstream/v8/src/mips/codegen-mips.cc +1213 -0
- data/ext/v8/upstream/v8/src/mips/codegen-mips.h +633 -0
- data/ext/v8/upstream/v8/src/mips/constants-mips.cc +352 -0
- data/ext/v8/upstream/v8/src/mips/constants-mips.h +723 -0
- data/ext/v8/upstream/v8/src/mips/cpu-mips.cc +90 -0
- data/ext/v8/upstream/v8/src/mips/debug-mips.cc +155 -0
- data/ext/v8/upstream/v8/src/mips/deoptimizer-mips.cc +91 -0
- data/ext/v8/upstream/v8/src/mips/disasm-mips.cc +1023 -0
- data/ext/v8/upstream/v8/src/mips/frames-mips.cc +48 -0
- data/ext/v8/upstream/v8/src/mips/frames-mips.h +179 -0
- data/ext/v8/upstream/v8/src/mips/full-codegen-mips.cc +727 -0
- data/ext/v8/upstream/v8/src/mips/ic-mips.cc +244 -0
- data/ext/v8/upstream/v8/src/mips/jump-target-mips.cc +80 -0
- data/ext/v8/upstream/v8/src/mips/lithium-codegen-mips.h +65 -0
- data/ext/v8/upstream/v8/src/mips/lithium-mips.h +304 -0
- data/ext/v8/upstream/v8/src/mips/macro-assembler-mips.cc +3327 -0
- data/ext/v8/upstream/v8/src/mips/macro-assembler-mips.h +1058 -0
- data/ext/v8/upstream/v8/src/mips/regexp-macro-assembler-mips.cc +478 -0
- data/ext/v8/upstream/v8/src/mips/regexp-macro-assembler-mips.h +250 -0
- data/ext/v8/upstream/v8/src/mips/register-allocator-mips-inl.h +134 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/mips/register-allocator-mips.cc +0 -0
- data/ext/v8/upstream/v8/src/mips/register-allocator-mips.h +47 -0
- data/ext/v8/upstream/v8/src/mips/simulator-mips.cc +2438 -0
- data/ext/v8/upstream/v8/src/mips/simulator-mips.h +394 -0
- data/ext/v8/upstream/v8/src/mips/stub-cache-mips.cc +601 -0
- data/ext/v8/upstream/v8/src/mips/virtual-frame-mips-inl.h +58 -0
- data/ext/v8/upstream/v8/src/mips/virtual-frame-mips.cc +307 -0
- data/ext/v8/upstream/v8/src/mips/virtual-frame-mips.h +530 -0
- data/ext/v8/upstream/v8/src/mirror-debugger.js +2381 -0
- data/ext/v8/upstream/v8/src/mksnapshot.cc +256 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/natives.h +0 -0
- data/ext/v8/upstream/v8/src/objects-debug.cc +722 -0
- data/ext/v8/upstream/v8/src/objects-inl.h +4166 -0
- data/ext/v8/upstream/v8/src/objects-printer.cc +801 -0
- data/ext/v8/upstream/v8/src/objects-visiting.cc +142 -0
- data/ext/v8/upstream/v8/src/objects-visiting.h +422 -0
- data/ext/v8/upstream/v8/src/objects.cc +10296 -0
- data/ext/v8/upstream/v8/src/objects.h +6662 -0
- data/ext/v8/upstream/v8/src/parser.cc +5168 -0
- data/ext/v8/upstream/v8/src/parser.h +823 -0
- data/ext/v8/upstream/v8/src/platform-cygwin.cc +811 -0
- data/ext/v8/upstream/v8/src/platform-freebsd.cc +854 -0
- data/ext/v8/upstream/v8/src/platform-linux.cc +1120 -0
- data/ext/v8/upstream/v8/src/platform-macos.cc +865 -0
- data/ext/v8/upstream/v8/src/platform-nullos.cc +504 -0
- data/ext/v8/upstream/v8/src/platform-openbsd.cc +672 -0
- data/ext/v8/upstream/v8/src/platform-posix.cc +424 -0
- data/ext/v8/upstream/v8/src/platform-solaris.cc +796 -0
- data/ext/v8/upstream/v8/src/platform-tls-mac.h +62 -0
- data/ext/v8/upstream/v8/src/platform-tls-win32.h +62 -0
- data/ext/v8/upstream/v8/src/platform-tls.h +50 -0
- data/ext/v8/upstream/v8/src/platform-win32.cc +2072 -0
- data/ext/v8/upstream/v8/src/platform.h +693 -0
- data/ext/v8/upstream/v8/src/preparse-data.cc +185 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/preparse-data.h +0 -0
- data/ext/v8/upstream/v8/src/preparser-api.cc +219 -0
- data/ext/v8/upstream/v8/src/preparser.cc +1205 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/preparser.h +0 -0
- data/ext/v8/upstream/v8/src/prettyprinter.cc +1530 -0
- data/ext/v8/upstream/v8/src/prettyprinter.h +223 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/profile-generator-inl.h +0 -0
- data/ext/v8/upstream/v8/src/profile-generator.cc +3095 -0
- data/ext/v8/upstream/v8/src/profile-generator.h +1125 -0
- data/ext/v8/upstream/v8/src/property.cc +102 -0
- data/ext/v8/upstream/v8/src/property.h +348 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/regexp-macro-assembler-irregexp-inl.h +0 -0
- data/ext/v8/upstream/v8/src/regexp-macro-assembler-irregexp.cc +470 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/regexp-macro-assembler-irregexp.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/regexp-macro-assembler-tracer.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/regexp-macro-assembler-tracer.h +0 -0
- data/ext/v8/upstream/v8/src/regexp-macro-assembler.cc +266 -0
- data/ext/v8/upstream/v8/src/regexp-macro-assembler.h +236 -0
- data/ext/v8/upstream/v8/src/regexp-stack.cc +111 -0
- data/ext/v8/upstream/v8/src/regexp-stack.h +147 -0
- data/ext/v8/upstream/v8/src/regexp.js +483 -0
- data/ext/v8/upstream/v8/src/register-allocator-inl.h +141 -0
- data/ext/v8/upstream/v8/src/register-allocator.cc +98 -0
- data/ext/v8/upstream/v8/src/register-allocator.h +310 -0
- data/ext/v8/upstream/v8/src/rewriter.cc +1024 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/rewriter.h +0 -0
- data/ext/v8/upstream/v8/src/runtime-profiler.cc +478 -0
- data/ext/v8/upstream/v8/src/runtime-profiler.h +192 -0
- data/ext/v8/upstream/v8/src/runtime.cc +11949 -0
- data/ext/v8/upstream/v8/src/runtime.h +643 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/runtime.js +0 -0
- data/ext/v8/upstream/v8/src/safepoint-table.cc +256 -0
- data/ext/v8/upstream/v8/src/safepoint-table.h +269 -0
- data/ext/v8/upstream/v8/src/scanner-base.cc +964 -0
- data/ext/v8/upstream/v8/src/scanner-base.h +664 -0
- data/ext/v8/upstream/v8/src/scanner.cc +584 -0
- data/ext/v8/upstream/v8/src/scanner.h +196 -0
- data/ext/v8/upstream/v8/src/scopeinfo.cc +631 -0
- data/ext/v8/upstream/v8/src/scopeinfo.h +249 -0
- data/ext/v8/upstream/v8/src/scopes.cc +1093 -0
- data/ext/v8/upstream/v8/src/scopes.h +508 -0
- data/ext/v8/upstream/v8/src/serialize.cc +1574 -0
- data/ext/v8/upstream/v8/src/serialize.h +589 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/shell.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/simulator.h +0 -0
- data/ext/v8/upstream/v8/src/small-pointer-list.h +163 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/smart-pointer.h +0 -0
- data/ext/v8/upstream/v8/src/snapshot-common.cc +82 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/snapshot-empty.cc +0 -0
- data/ext/v8/upstream/v8/src/snapshot.h +73 -0
- data/ext/v8/upstream/v8/src/spaces-inl.h +529 -0
- data/ext/v8/upstream/v8/src/spaces.cc +3147 -0
- data/ext/v8/upstream/v8/src/spaces.h +2368 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/splay-tree-inl.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/splay-tree.h +0 -0
- data/ext/v8/upstream/v8/src/string-search.cc +41 -0
- data/ext/v8/upstream/v8/src/string-search.h +568 -0
- data/ext/v8/upstream/v8/src/string-stream.cc +592 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/string-stream.h +0 -0
- data/ext/v8/upstream/v8/src/string.js +915 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/strtod.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/strtod.h +0 -0
- data/ext/v8/upstream/v8/src/stub-cache.cc +1940 -0
- data/ext/v8/upstream/v8/src/stub-cache.h +866 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/third_party/valgrind/valgrind.h +0 -0
- data/ext/v8/upstream/v8/src/token.cc +63 -0
- data/ext/v8/upstream/v8/src/token.h +288 -0
- data/ext/v8/upstream/v8/src/top.cc +983 -0
- data/ext/v8/upstream/v8/src/type-info.cc +472 -0
- data/ext/v8/upstream/v8/src/type-info.h +290 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/unbound-queue-inl.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/unbound-queue.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/unicode-inl.h +0 -0
- data/ext/v8/upstream/v8/src/unicode.cc +1624 -0
- data/ext/v8/upstream/v8/src/unicode.h +280 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/uri.js +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/utils.cc +0 -0
- data/ext/v8/upstream/v8/src/utils.h +796 -0
- data/ext/v8/upstream/v8/src/v8-counters.cc +62 -0
- data/ext/v8/upstream/v8/src/v8-counters.h +311 -0
- data/ext/v8/upstream/v8/src/v8.cc +215 -0
- data/ext/v8/upstream/v8/src/v8.h +130 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/v8checks.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/v8dll-main.cc +0 -0
- data/ext/v8/upstream/v8/src/v8globals.h +486 -0
- data/ext/v8/upstream/{3.1.8/src/memory.h → v8/src/v8memory.h} +0 -0
- data/ext/v8/upstream/v8/src/v8natives.js +1293 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/v8preparserdll-main.cc +0 -0
- data/ext/v8/upstream/v8/src/v8threads.cc +453 -0
- data/ext/v8/upstream/v8/src/v8threads.h +164 -0
- data/ext/v8/upstream/v8/src/v8utils.h +317 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/variables.cc +0 -0
- data/ext/v8/upstream/v8/src/variables.h +212 -0
- data/ext/v8/upstream/v8/src/version.cc +116 -0
- data/ext/v8/upstream/v8/src/version.h +68 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/virtual-frame-heavy-inl.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/virtual-frame-heavy.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/virtual-frame-inl.h +0 -0
- data/ext/v8/upstream/v8/src/virtual-frame-light-inl.h +171 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/virtual-frame-light.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/virtual-frame.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/virtual-frame.h +0 -0
- data/ext/v8/upstream/v8/src/vm-state-inl.h +138 -0
- data/ext/v8/upstream/v8/src/vm-state.h +70 -0
- data/ext/v8/upstream/v8/src/win32-headers.h +96 -0
- data/ext/v8/upstream/v8/src/x64/assembler-x64-inl.h +456 -0
- data/ext/v8/upstream/v8/src/x64/assembler-x64.cc +2954 -0
- data/ext/v8/upstream/v8/src/x64/assembler-x64.h +1630 -0
- data/ext/v8/upstream/v8/src/x64/builtins-x64.cc +1493 -0
- data/ext/v8/upstream/v8/src/x64/code-stubs-x64.cc +5132 -0
- data/ext/v8/upstream/v8/src/x64/code-stubs-x64.h +477 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/x64/codegen-x64-inl.h +0 -0
- data/ext/v8/upstream/v8/src/x64/codegen-x64.cc +8843 -0
- data/ext/v8/upstream/v8/src/x64/codegen-x64.h +753 -0
- data/ext/v8/upstream/v8/src/x64/cpu-x64.cc +88 -0
- data/ext/v8/upstream/v8/src/x64/debug-x64.cc +318 -0
- data/ext/v8/upstream/v8/src/x64/deoptimizer-x64.cc +815 -0
- data/ext/v8/upstream/v8/src/x64/disasm-x64.cc +1752 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/x64/frames-x64.cc +0 -0
- data/ext/v8/upstream/v8/src/x64/frames-x64.h +130 -0
- data/ext/v8/upstream/v8/src/x64/full-codegen-x64.cc +4339 -0
- data/ext/v8/upstream/v8/src/x64/ic-x64.cc +1752 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/x64/jump-target-x64.cc +0 -0
- data/ext/v8/upstream/v8/src/x64/lithium-codegen-x64.cc +3970 -0
- data/ext/v8/upstream/v8/src/x64/lithium-codegen-x64.h +318 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/x64/lithium-gap-resolver-x64.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/x64/lithium-gap-resolver-x64.h +0 -0
- data/ext/v8/upstream/v8/src/x64/lithium-x64.cc +2115 -0
- data/ext/v8/upstream/v8/src/x64/lithium-x64.h +2161 -0
- data/ext/v8/upstream/v8/src/x64/macro-assembler-x64.cc +2911 -0
- data/ext/v8/upstream/v8/src/x64/macro-assembler-x64.h +1984 -0
- data/ext/v8/upstream/v8/src/x64/regexp-macro-assembler-x64.cc +1398 -0
- data/ext/v8/upstream/v8/src/x64/regexp-macro-assembler-x64.h +282 -0
- data/ext/v8/upstream/v8/src/x64/register-allocator-x64-inl.h +87 -0
- data/ext/v8/upstream/v8/src/x64/register-allocator-x64.cc +95 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/x64/register-allocator-x64.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/x64/simulator-x64.cc +0 -0
- data/ext/v8/upstream/v8/src/x64/simulator-x64.h +71 -0
- data/ext/v8/upstream/v8/src/x64/stub-cache-x64.cc +3460 -0
- data/ext/v8/upstream/v8/src/x64/virtual-frame-x64.cc +1296 -0
- data/ext/v8/upstream/v8/src/x64/virtual-frame-x64.h +597 -0
- data/ext/v8/upstream/v8/src/zone-inl.h +129 -0
- data/ext/v8/upstream/v8/src/zone.cc +196 -0
- data/ext/v8/upstream/v8/src/zone.h +236 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/codemap.js +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/consarray.js +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/csvparser.js +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/disasm.py +0 -0
- data/ext/v8/upstream/v8/tools/freebsd-tick-processor +10 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/gc-nvp-trace-processor.py +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/generate-ten-powers.scm +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/grokdump.py +0 -0
- data/ext/v8/upstream/v8/tools/gyp/v8.gyp +844 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/js2c.py +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/jsmin.py +0 -0
- data/ext/v8/upstream/v8/tools/linux-tick-processor +35 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/ll_prof.py +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/logreader.js +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/mac-nm +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/mac-tick-processor +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/oom_dump/README +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/oom_dump/SConstruct +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/oom_dump/oom_dump.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/presubmit.py +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/process-heap-prof.py +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/profile.js +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/profile_view.js +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/run-valgrind.py +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/splaytree.js +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/stats-viewer.py +0 -0
- data/ext/v8/upstream/v8/tools/test.py +1490 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/tickprocessor-driver.js +0 -0
- data/ext/v8/upstream/v8/tools/tickprocessor.js +877 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/utils.py +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/README.txt +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/arm.vsprops +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/common.vsprops +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/d8.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/d8_arm.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/d8_x64.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/d8js2c.cmd +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/debug.vsprops +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/ia32.vsprops +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/js2c.cmd +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/release.vsprops +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8.sln +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_arm.sln +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_arm.vcproj +0 -0
- data/ext/v8/upstream/v8/tools/visual_studio/v8_base.vcproj +1308 -0
- data/ext/v8/upstream/v8/tools/visual_studio/v8_base_arm.vcproj +1238 -0
- data/ext/v8/upstream/v8/tools/visual_studio/v8_base_x64.vcproj +1300 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_cctest.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_cctest_arm.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_cctest_x64.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_mksnapshot.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_mksnapshot_x64.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_process_sample.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_process_sample_arm.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_process_sample_x64.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_shell_sample.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_shell_sample_arm.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_shell_sample_x64.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_snapshot.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_snapshot_cc.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_snapshot_cc_x64.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_snapshot_x64.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_x64.sln +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_x64.vcproj +0 -0
- data/ext/v8/upstream/v8/tools/visual_studio/x64.vsprops +18 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/windows-tick-processor.bat +0 -0
- data/ext/v8/v8_callbacks.cpp +52 -92
- data/ext/v8/v8_date.cpp +2 -3
- data/ext/v8/v8_object.cpp +4 -0
- data/ext/v8/v8_template.cpp +2 -2
- data/ext/v8/v8_try_catch.cpp +8 -38
- data/lib/v8/version.rb +1 -1
- data/spec/ext/ext_spec_helper.rb +2 -20
- data/spec/ext/object_spec.rb +0 -12
- data/spec/ext/try_catch_spec.rb +29 -1
- data/spec/spec_helper.rb +1 -0
- data/spec/v8/portal/proxies_spec.rb +1 -84
- data/specmem/handle_memspec.rb +41 -0
- data/specmem/object_memspec.rb +16 -0
- data/specmem/proxies_memspec.rb +86 -0
- data/specmem/spec_helper.rb +24 -0
- data/therubyracer.gemspec +7 -2
- metadata +564 -541
- data/ext/v8/upstream/3.1.8/.gitignore +0 -31
- data/ext/v8/upstream/3.1.8/AUTHORS +0 -40
- data/ext/v8/upstream/3.1.8/ChangeLog +0 -2566
- data/ext/v8/upstream/3.1.8/SConstruct +0 -1192
- data/ext/v8/upstream/3.1.8/include/v8-debug.h +0 -384
- data/ext/v8/upstream/3.1.8/include/v8-preparser.h +0 -116
- data/ext/v8/upstream/3.1.8/include/v8-profiler.h +0 -426
- data/ext/v8/upstream/3.1.8/include/v8-testing.h +0 -99
- data/ext/v8/upstream/3.1.8/include/v8.h +0 -3846
- data/ext/v8/upstream/3.1.8/preparser/preparser-process.cc +0 -206
- data/ext/v8/upstream/3.1.8/src/SConscript +0 -356
- data/ext/v8/upstream/3.1.8/src/accessors.cc +0 -907
- data/ext/v8/upstream/3.1.8/src/allocation.cc +0 -204
- data/ext/v8/upstream/3.1.8/src/allocation.h +0 -176
- data/ext/v8/upstream/3.1.8/src/api.cc +0 -5191
- data/ext/v8/upstream/3.1.8/src/api.h +0 -508
- data/ext/v8/upstream/3.1.8/src/apiutils.h +0 -80
- data/ext/v8/upstream/3.1.8/src/arguments.h +0 -105
- data/ext/v8/upstream/3.1.8/src/arm/assembler-arm-inl.h +0 -352
- data/ext/v8/upstream/3.1.8/src/arm/assembler-arm.cc +0 -2756
- data/ext/v8/upstream/3.1.8/src/arm/assembler-arm.h +0 -1294
- data/ext/v8/upstream/3.1.8/src/arm/builtins-arm.cc +0 -1628
- data/ext/v8/upstream/3.1.8/src/arm/code-stubs-arm.cc +0 -6783
- data/ext/v8/upstream/3.1.8/src/arm/code-stubs-arm.h +0 -657
- data/ext/v8/upstream/3.1.8/src/arm/codegen-arm.cc +0 -7403
- data/ext/v8/upstream/3.1.8/src/arm/codegen-arm.h +0 -595
- data/ext/v8/upstream/3.1.8/src/arm/constants-arm.h +0 -769
- data/ext/v8/upstream/3.1.8/src/arm/cpu-arm.cc +0 -147
- data/ext/v8/upstream/3.1.8/src/arm/debug-arm.cc +0 -315
- data/ext/v8/upstream/3.1.8/src/arm/deoptimizer-arm.cc +0 -700
- data/ext/v8/upstream/3.1.8/src/arm/disasm-arm.cc +0 -1439
- data/ext/v8/upstream/3.1.8/src/arm/frames-arm.h +0 -168
- data/ext/v8/upstream/3.1.8/src/arm/full-codegen-arm.cc +0 -4230
- data/ext/v8/upstream/3.1.8/src/arm/ic-arm.cc +0 -1799
- data/ext/v8/upstream/3.1.8/src/arm/lithium-arm.cc +0 -2041
- data/ext/v8/upstream/3.1.8/src/arm/lithium-arm.h +0 -2046
- data/ext/v8/upstream/3.1.8/src/arm/lithium-codegen-arm.cc +0 -3822
- data/ext/v8/upstream/3.1.8/src/arm/lithium-codegen-arm.h +0 -312
- data/ext/v8/upstream/3.1.8/src/arm/lithium-gap-resolver-arm.cc +0 -303
- data/ext/v8/upstream/3.1.8/src/arm/macro-assembler-arm.cc +0 -2701
- data/ext/v8/upstream/3.1.8/src/arm/macro-assembler-arm.h +0 -1015
- data/ext/v8/upstream/3.1.8/src/arm/regexp-macro-assembler-arm.cc +0 -1280
- data/ext/v8/upstream/3.1.8/src/arm/regexp-macro-assembler-arm.h +0 -252
- data/ext/v8/upstream/3.1.8/src/arm/simulator-arm.cc +0 -3165
- data/ext/v8/upstream/3.1.8/src/arm/simulator-arm.h +0 -402
- data/ext/v8/upstream/3.1.8/src/arm/stub-cache-arm.cc +0 -4077
- data/ext/v8/upstream/3.1.8/src/arm/virtual-frame-arm.cc +0 -843
- data/ext/v8/upstream/3.1.8/src/arm/virtual-frame-arm.h +0 -520
- data/ext/v8/upstream/3.1.8/src/array.js +0 -1231
- data/ext/v8/upstream/3.1.8/src/assembler.cc +0 -973
- data/ext/v8/upstream/3.1.8/src/assembler.h +0 -787
- data/ext/v8/upstream/3.1.8/src/ast-inl.h +0 -107
- data/ext/v8/upstream/3.1.8/src/ast.cc +0 -1067
- data/ext/v8/upstream/3.1.8/src/ast.h +0 -2177
- data/ext/v8/upstream/3.1.8/src/atomicops.h +0 -165
- data/ext/v8/upstream/3.1.8/src/bootstrapper.cc +0 -1888
- data/ext/v8/upstream/3.1.8/src/bootstrapper.h +0 -118
- data/ext/v8/upstream/3.1.8/src/builtins.cc +0 -1586
- data/ext/v8/upstream/3.1.8/src/builtins.h +0 -339
- data/ext/v8/upstream/3.1.8/src/checks.cc +0 -110
- data/ext/v8/upstream/3.1.8/src/checks.h +0 -292
- data/ext/v8/upstream/3.1.8/src/code-stubs.cc +0 -230
- data/ext/v8/upstream/3.1.8/src/code-stubs.h +0 -950
- data/ext/v8/upstream/3.1.8/src/codegen-inl.h +0 -64
- data/ext/v8/upstream/3.1.8/src/codegen.cc +0 -495
- data/ext/v8/upstream/3.1.8/src/codegen.h +0 -245
- data/ext/v8/upstream/3.1.8/src/compilation-cache.cc +0 -654
- data/ext/v8/upstream/3.1.8/src/compilation-cache.h +0 -112
- data/ext/v8/upstream/3.1.8/src/compiler.cc +0 -806
- data/ext/v8/upstream/3.1.8/src/compiler.h +0 -290
- data/ext/v8/upstream/3.1.8/src/contexts.cc +0 -320
- data/ext/v8/upstream/3.1.8/src/contexts.h +0 -376
- data/ext/v8/upstream/3.1.8/src/conversions.cc +0 -1069
- data/ext/v8/upstream/3.1.8/src/counters.cc +0 -78
- data/ext/v8/upstream/3.1.8/src/counters.h +0 -242
- data/ext/v8/upstream/3.1.8/src/cpu-profiler-inl.h +0 -100
- data/ext/v8/upstream/3.1.8/src/cpu-profiler.cc +0 -554
- data/ext/v8/upstream/3.1.8/src/cpu-profiler.h +0 -291
- data/ext/v8/upstream/3.1.8/src/cpu.h +0 -65
- data/ext/v8/upstream/3.1.8/src/d8-debug.cc +0 -367
- data/ext/v8/upstream/3.1.8/src/d8-debug.h +0 -157
- data/ext/v8/upstream/3.1.8/src/d8-posix.cc +0 -693
- data/ext/v8/upstream/3.1.8/src/d8.cc +0 -792
- data/ext/v8/upstream/3.1.8/src/d8.gyp +0 -85
- data/ext/v8/upstream/3.1.8/src/data-flow.h +0 -379
- data/ext/v8/upstream/3.1.8/src/dateparser.h +0 -263
- data/ext/v8/upstream/3.1.8/src/debug-agent.cc +0 -446
- data/ext/v8/upstream/3.1.8/src/debug-agent.h +0 -131
- data/ext/v8/upstream/3.1.8/src/debug.cc +0 -3085
- data/ext/v8/upstream/3.1.8/src/debug.h +0 -1025
- data/ext/v8/upstream/3.1.8/src/deoptimizer.cc +0 -1185
- data/ext/v8/upstream/3.1.8/src/deoptimizer.h +0 -529
- data/ext/v8/upstream/3.1.8/src/disasm.h +0 -77
- data/ext/v8/upstream/3.1.8/src/disassembler.cc +0 -338
- data/ext/v8/upstream/3.1.8/src/execution.cc +0 -735
- data/ext/v8/upstream/3.1.8/src/execution.h +0 -322
- data/ext/v8/upstream/3.1.8/src/extensions/experimental/experimental.gyp +0 -53
- data/ext/v8/upstream/3.1.8/src/extensions/experimental/i18n-extension.cc +0 -264
- data/ext/v8/upstream/3.1.8/src/extensions/externalize-string-extension.cc +0 -141
- data/ext/v8/upstream/3.1.8/src/extensions/gc-extension.cc +0 -58
- data/ext/v8/upstream/3.1.8/src/factory.cc +0 -1087
- data/ext/v8/upstream/3.1.8/src/factory.h +0 -432
- data/ext/v8/upstream/3.1.8/src/flag-definitions.h +0 -552
- data/ext/v8/upstream/3.1.8/src/frame-element.cc +0 -42
- data/ext/v8/upstream/3.1.8/src/frame-element.h +0 -277
- data/ext/v8/upstream/3.1.8/src/frames-inl.h +0 -210
- data/ext/v8/upstream/3.1.8/src/frames.cc +0 -1232
- data/ext/v8/upstream/3.1.8/src/frames.h +0 -826
- data/ext/v8/upstream/3.1.8/src/full-codegen.cc +0 -1382
- data/ext/v8/upstream/3.1.8/src/full-codegen.h +0 -751
- data/ext/v8/upstream/3.1.8/src/func-name-inferrer.cc +0 -90
- data/ext/v8/upstream/3.1.8/src/func-name-inferrer.h +0 -111
- data/ext/v8/upstream/3.1.8/src/gdb-jit.cc +0 -1547
- data/ext/v8/upstream/3.1.8/src/global-handles.cc +0 -534
- data/ext/v8/upstream/3.1.8/src/global-handles.h +0 -181
- data/ext/v8/upstream/3.1.8/src/globals.h +0 -325
- data/ext/v8/upstream/3.1.8/src/handles-inl.h +0 -80
- data/ext/v8/upstream/3.1.8/src/handles.cc +0 -910
- data/ext/v8/upstream/3.1.8/src/handles.h +0 -424
- data/ext/v8/upstream/3.1.8/src/hashmap.h +0 -121
- data/ext/v8/upstream/3.1.8/src/heap-inl.h +0 -587
- data/ext/v8/upstream/3.1.8/src/heap-profiler.cc +0 -1128
- data/ext/v8/upstream/3.1.8/src/heap-profiler.h +0 -381
- data/ext/v8/upstream/3.1.8/src/heap.cc +0 -5610
- data/ext/v8/upstream/3.1.8/src/heap.h +0 -2218
- data/ext/v8/upstream/3.1.8/src/hydrogen-instructions.cc +0 -1490
- data/ext/v8/upstream/3.1.8/src/hydrogen-instructions.h +0 -3493
- data/ext/v8/upstream/3.1.8/src/hydrogen.cc +0 -6056
- data/ext/v8/upstream/3.1.8/src/hydrogen.h +0 -1091
- data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32-inl.h +0 -429
- data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32.cc +0 -2800
- data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32.h +0 -1093
- data/ext/v8/upstream/3.1.8/src/ia32/builtins-ia32.cc +0 -1590
- data/ext/v8/upstream/3.1.8/src/ia32/code-stubs-ia32.cc +0 -6624
- data/ext/v8/upstream/3.1.8/src/ia32/code-stubs-ia32.h +0 -536
- data/ext/v8/upstream/3.1.8/src/ia32/codegen-ia32.cc +0 -10354
- data/ext/v8/upstream/3.1.8/src/ia32/codegen-ia32.h +0 -798
- data/ext/v8/upstream/3.1.8/src/ia32/cpu-ia32.cc +0 -87
- data/ext/v8/upstream/3.1.8/src/ia32/debug-ia32.cc +0 -309
- data/ext/v8/upstream/3.1.8/src/ia32/deoptimizer-ia32.cc +0 -664
- data/ext/v8/upstream/3.1.8/src/ia32/disasm-ia32.cc +0 -1597
- data/ext/v8/upstream/3.1.8/src/ia32/frames-ia32.h +0 -140
- data/ext/v8/upstream/3.1.8/src/ia32/full-codegen-ia32.cc +0 -4278
- data/ext/v8/upstream/3.1.8/src/ia32/ic-ia32.cc +0 -1786
- data/ext/v8/upstream/3.1.8/src/ia32/lithium-codegen-ia32.cc +0 -3880
- data/ext/v8/upstream/3.1.8/src/ia32/lithium-codegen-ia32.h +0 -309
- data/ext/v8/upstream/3.1.8/src/ia32/lithium-gap-resolver-ia32.cc +0 -460
- data/ext/v8/upstream/3.1.8/src/ia32/lithium-ia32.cc +0 -2095
- data/ext/v8/upstream/3.1.8/src/ia32/lithium-ia32.h +0 -2127
- data/ext/v8/upstream/3.1.8/src/ia32/macro-assembler-ia32.cc +0 -2031
- data/ext/v8/upstream/3.1.8/src/ia32/macro-assembler-ia32.h +0 -798
- data/ext/v8/upstream/3.1.8/src/ia32/regexp-macro-assembler-ia32.cc +0 -1253
- data/ext/v8/upstream/3.1.8/src/ia32/regexp-macro-assembler-ia32.h +0 -215
- data/ext/v8/upstream/3.1.8/src/ia32/register-allocator-ia32.cc +0 -157
- data/ext/v8/upstream/3.1.8/src/ia32/simulator-ia32.h +0 -72
- data/ext/v8/upstream/3.1.8/src/ia32/stub-cache-ia32.cc +0 -3732
- data/ext/v8/upstream/3.1.8/src/ia32/virtual-frame-ia32.cc +0 -1360
- data/ext/v8/upstream/3.1.8/src/ia32/virtual-frame-ia32.h +0 -646
- data/ext/v8/upstream/3.1.8/src/ic-inl.h +0 -129
- data/ext/v8/upstream/3.1.8/src/ic.cc +0 -2333
- data/ext/v8/upstream/3.1.8/src/ic.h +0 -639
- data/ext/v8/upstream/3.1.8/src/interpreter-irregexp.cc +0 -655
- data/ext/v8/upstream/3.1.8/src/interpreter-irregexp.h +0 -48
- data/ext/v8/upstream/3.1.8/src/json.js +0 -342
- data/ext/v8/upstream/3.1.8/src/jsregexp.cc +0 -5340
- data/ext/v8/upstream/3.1.8/src/jsregexp.h +0 -1484
- data/ext/v8/upstream/3.1.8/src/jump-target-heavy.cc +0 -430
- data/ext/v8/upstream/3.1.8/src/jump-target-heavy.h +0 -244
- data/ext/v8/upstream/3.1.8/src/jump-target-inl.h +0 -48
- data/ext/v8/upstream/3.1.8/src/jump-target-light.cc +0 -111
- data/ext/v8/upstream/3.1.8/src/lithium-allocator-inl.h +0 -140
- data/ext/v8/upstream/3.1.8/src/lithium-allocator.cc +0 -2093
- data/ext/v8/upstream/3.1.8/src/lithium-allocator.h +0 -644
- data/ext/v8/upstream/3.1.8/src/lithium.cc +0 -168
- data/ext/v8/upstream/3.1.8/src/liveedit.cc +0 -1650
- data/ext/v8/upstream/3.1.8/src/liveedit.h +0 -174
- data/ext/v8/upstream/3.1.8/src/liveobjectlist.cc +0 -2527
- data/ext/v8/upstream/3.1.8/src/liveobjectlist.h +0 -322
- data/ext/v8/upstream/3.1.8/src/log-utils.cc +0 -336
- data/ext/v8/upstream/3.1.8/src/log-utils.h +0 -232
- data/ext/v8/upstream/3.1.8/src/log.cc +0 -1608
- data/ext/v8/upstream/3.1.8/src/log.h +0 -379
- data/ext/v8/upstream/3.1.8/src/mark-compact.cc +0 -2957
- data/ext/v8/upstream/3.1.8/src/mark-compact.h +0 -433
- data/ext/v8/upstream/3.1.8/src/messages.cc +0 -164
- data/ext/v8/upstream/3.1.8/src/messages.js +0 -1071
- data/ext/v8/upstream/3.1.8/src/mips/assembler-mips-inl.h +0 -215
- data/ext/v8/upstream/3.1.8/src/mips/assembler-mips.cc +0 -1219
- data/ext/v8/upstream/3.1.8/src/mips/assembler-mips.h +0 -667
- data/ext/v8/upstream/3.1.8/src/mips/builtins-mips.cc +0 -205
- data/ext/v8/upstream/3.1.8/src/mips/codegen-mips-inl.h +0 -70
- data/ext/v8/upstream/3.1.8/src/mips/codegen-mips.cc +0 -1437
- data/ext/v8/upstream/3.1.8/src/mips/codegen-mips.h +0 -431
- data/ext/v8/upstream/3.1.8/src/mips/constants-mips.cc +0 -328
- data/ext/v8/upstream/3.1.8/src/mips/constants-mips.h +0 -525
- data/ext/v8/upstream/3.1.8/src/mips/cpu-mips.cc +0 -73
- data/ext/v8/upstream/3.1.8/src/mips/debug-mips.cc +0 -127
- data/ext/v8/upstream/3.1.8/src/mips/disasm-mips.cc +0 -787
- data/ext/v8/upstream/3.1.8/src/mips/fast-codegen-mips.cc +0 -77
- data/ext/v8/upstream/3.1.8/src/mips/frames-mips.cc +0 -96
- data/ext/v8/upstream/3.1.8/src/mips/frames-mips.h +0 -164
- data/ext/v8/upstream/3.1.8/src/mips/full-codegen-mips.cc +0 -277
- data/ext/v8/upstream/3.1.8/src/mips/ic-mips.cc +0 -208
- data/ext/v8/upstream/3.1.8/src/mips/jump-target-mips.cc +0 -175
- data/ext/v8/upstream/3.1.8/src/mips/macro-assembler-mips.cc +0 -1326
- data/ext/v8/upstream/3.1.8/src/mips/macro-assembler-mips.h +0 -461
- data/ext/v8/upstream/3.1.8/src/mips/register-allocator-mips-inl.h +0 -137
- data/ext/v8/upstream/3.1.8/src/mips/register-allocator-mips.h +0 -46
- data/ext/v8/upstream/3.1.8/src/mips/simulator-mips.cc +0 -1650
- data/ext/v8/upstream/3.1.8/src/mips/simulator-mips.h +0 -311
- data/ext/v8/upstream/3.1.8/src/mips/stub-cache-mips.cc +0 -418
- data/ext/v8/upstream/3.1.8/src/mips/virtual-frame-mips.cc +0 -319
- data/ext/v8/upstream/3.1.8/src/mips/virtual-frame-mips.h +0 -548
- data/ext/v8/upstream/3.1.8/src/mirror-debugger.js +0 -2380
- data/ext/v8/upstream/3.1.8/src/mksnapshot.cc +0 -256
- data/ext/v8/upstream/3.1.8/src/objects-debug.cc +0 -722
- data/ext/v8/upstream/3.1.8/src/objects-inl.h +0 -3946
- data/ext/v8/upstream/3.1.8/src/objects-printer.cc +0 -801
- data/ext/v8/upstream/3.1.8/src/objects-visiting.cc +0 -142
- data/ext/v8/upstream/3.1.8/src/objects-visiting.h +0 -401
- data/ext/v8/upstream/3.1.8/src/objects.cc +0 -10044
- data/ext/v8/upstream/3.1.8/src/objects.h +0 -6571
- data/ext/v8/upstream/3.1.8/src/parser.cc +0 -5165
- data/ext/v8/upstream/3.1.8/src/parser.h +0 -802
- data/ext/v8/upstream/3.1.8/src/platform-cygwin.cc +0 -745
- data/ext/v8/upstream/3.1.8/src/platform-freebsd.cc +0 -702
- data/ext/v8/upstream/3.1.8/src/platform-linux.cc +0 -981
- data/ext/v8/upstream/3.1.8/src/platform-macos.cc +0 -732
- data/ext/v8/upstream/3.1.8/src/platform-nullos.cc +0 -498
- data/ext/v8/upstream/3.1.8/src/platform-openbsd.cc +0 -657
- data/ext/v8/upstream/3.1.8/src/platform-posix.cc +0 -399
- data/ext/v8/upstream/3.1.8/src/platform-solaris.cc +0 -714
- data/ext/v8/upstream/3.1.8/src/platform-win32.cc +0 -1974
- data/ext/v8/upstream/3.1.8/src/platform.h +0 -636
- data/ext/v8/upstream/3.1.8/src/preparse-data.cc +0 -183
- data/ext/v8/upstream/3.1.8/src/preparser-api.cc +0 -213
- data/ext/v8/upstream/3.1.8/src/preparser.cc +0 -1205
- data/ext/v8/upstream/3.1.8/src/prettyprinter.cc +0 -1539
- data/ext/v8/upstream/3.1.8/src/prettyprinter.h +0 -223
- data/ext/v8/upstream/3.1.8/src/profile-generator.cc +0 -2899
- data/ext/v8/upstream/3.1.8/src/profile-generator.h +0 -1151
- data/ext/v8/upstream/3.1.8/src/property.cc +0 -96
- data/ext/v8/upstream/3.1.8/src/property.h +0 -337
- data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler-irregexp.cc +0 -470
- data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler.cc +0 -257
- data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler.h +0 -231
- data/ext/v8/upstream/3.1.8/src/regexp-stack.cc +0 -103
- data/ext/v8/upstream/3.1.8/src/regexp-stack.h +0 -123
- data/ext/v8/upstream/3.1.8/src/regexp.js +0 -483
- data/ext/v8/upstream/3.1.8/src/register-allocator-inl.h +0 -141
- data/ext/v8/upstream/3.1.8/src/register-allocator.cc +0 -104
- data/ext/v8/upstream/3.1.8/src/register-allocator.h +0 -320
- data/ext/v8/upstream/3.1.8/src/rewriter.cc +0 -1023
- data/ext/v8/upstream/3.1.8/src/runtime-profiler.cc +0 -443
- data/ext/v8/upstream/3.1.8/src/runtime-profiler.h +0 -77
- data/ext/v8/upstream/3.1.8/src/runtime.cc +0 -11592
- data/ext/v8/upstream/3.1.8/src/runtime.h +0 -582
- data/ext/v8/upstream/3.1.8/src/safepoint-table.cc +0 -253
- data/ext/v8/upstream/3.1.8/src/safepoint-table.h +0 -263
- data/ext/v8/upstream/3.1.8/src/scanner-base.cc +0 -971
- data/ext/v8/upstream/3.1.8/src/scanner-base.h +0 -653
- data/ext/v8/upstream/3.1.8/src/scanner.cc +0 -586
- data/ext/v8/upstream/3.1.8/src/scanner.h +0 -194
- data/ext/v8/upstream/3.1.8/src/scopeinfo.cc +0 -636
- data/ext/v8/upstream/3.1.8/src/scopeinfo.h +0 -238
- data/ext/v8/upstream/3.1.8/src/scopes.cc +0 -1063
- data/ext/v8/upstream/3.1.8/src/scopes.h +0 -494
- data/ext/v8/upstream/3.1.8/src/serialize.cc +0 -1535
- data/ext/v8/upstream/3.1.8/src/serialize.h +0 -584
- data/ext/v8/upstream/3.1.8/src/snapshot-common.cc +0 -82
- data/ext/v8/upstream/3.1.8/src/snapshot.h +0 -71
- data/ext/v8/upstream/3.1.8/src/spaces-inl.h +0 -524
- data/ext/v8/upstream/3.1.8/src/spaces.cc +0 -3254
- data/ext/v8/upstream/3.1.8/src/spaces.h +0 -2362
- data/ext/v8/upstream/3.1.8/src/string-search.cc +0 -40
- data/ext/v8/upstream/3.1.8/src/string-search.h +0 -567
- data/ext/v8/upstream/3.1.8/src/string-stream.cc +0 -584
- data/ext/v8/upstream/3.1.8/src/string.js +0 -915
- data/ext/v8/upstream/3.1.8/src/stub-cache.cc +0 -1878
- data/ext/v8/upstream/3.1.8/src/stub-cache.h +0 -849
- data/ext/v8/upstream/3.1.8/src/token.cc +0 -63
- data/ext/v8/upstream/3.1.8/src/token.h +0 -288
- data/ext/v8/upstream/3.1.8/src/top.cc +0 -1152
- data/ext/v8/upstream/3.1.8/src/top.h +0 -608
- data/ext/v8/upstream/3.1.8/src/type-info.cc +0 -406
- data/ext/v8/upstream/3.1.8/src/type-info.h +0 -283
- data/ext/v8/upstream/3.1.8/src/unicode.cc +0 -1624
- data/ext/v8/upstream/3.1.8/src/unicode.h +0 -280
- data/ext/v8/upstream/3.1.8/src/utils.h +0 -793
- data/ext/v8/upstream/3.1.8/src/v8-counters.cc +0 -55
- data/ext/v8/upstream/3.1.8/src/v8-counters.h +0 -290
- data/ext/v8/upstream/3.1.8/src/v8.cc +0 -270
- data/ext/v8/upstream/3.1.8/src/v8.h +0 -127
- data/ext/v8/upstream/3.1.8/src/v8globals.h +0 -480
- data/ext/v8/upstream/3.1.8/src/v8natives.js +0 -1252
- data/ext/v8/upstream/3.1.8/src/v8threads.cc +0 -440
- data/ext/v8/upstream/3.1.8/src/v8threads.h +0 -157
- data/ext/v8/upstream/3.1.8/src/v8utils.h +0 -354
- data/ext/v8/upstream/3.1.8/src/variables.h +0 -212
- data/ext/v8/upstream/3.1.8/src/version.cc +0 -95
- data/ext/v8/upstream/3.1.8/src/version.h +0 -64
- data/ext/v8/upstream/3.1.8/src/virtual-frame-light-inl.h +0 -170
- data/ext/v8/upstream/3.1.8/src/vm-state-inl.h +0 -134
- data/ext/v8/upstream/3.1.8/src/vm-state.h +0 -68
- data/ext/v8/upstream/3.1.8/src/win32-headers.h +0 -95
- data/ext/v8/upstream/3.1.8/src/x64/assembler-x64-inl.h +0 -455
- data/ext/v8/upstream/3.1.8/src/x64/assembler-x64.cc +0 -3162
- data/ext/v8/upstream/3.1.8/src/x64/assembler-x64.h +0 -1584
- data/ext/v8/upstream/3.1.8/src/x64/builtins-x64.cc +0 -1492
- data/ext/v8/upstream/3.1.8/src/x64/code-stubs-x64.cc +0 -5150
- data/ext/v8/upstream/3.1.8/src/x64/code-stubs-x64.h +0 -519
- data/ext/v8/upstream/3.1.8/src/x64/codegen-x64.cc +0 -8835
- data/ext/v8/upstream/3.1.8/src/x64/codegen-x64.h +0 -750
- data/ext/v8/upstream/3.1.8/src/x64/cpu-x64.cc +0 -86
- data/ext/v8/upstream/3.1.8/src/x64/debug-x64.cc +0 -316
- data/ext/v8/upstream/3.1.8/src/x64/deoptimizer-x64.cc +0 -781
- data/ext/v8/upstream/3.1.8/src/x64/disasm-x64.cc +0 -1737
- data/ext/v8/upstream/3.1.8/src/x64/frames-x64.h +0 -130
- data/ext/v8/upstream/3.1.8/src/x64/full-codegen-x64.cc +0 -3984
- data/ext/v8/upstream/3.1.8/src/x64/ic-x64.cc +0 -1761
- data/ext/v8/upstream/3.1.8/src/x64/lithium-codegen-x64.cc +0 -3639
- data/ext/v8/upstream/3.1.8/src/x64/lithium-codegen-x64.h +0 -305
- data/ext/v8/upstream/3.1.8/src/x64/lithium-x64.cc +0 -2044
- data/ext/v8/upstream/3.1.8/src/x64/lithium-x64.h +0 -2052
- data/ext/v8/upstream/3.1.8/src/x64/macro-assembler-x64.cc +0 -2660
- data/ext/v8/upstream/3.1.8/src/x64/macro-assembler-x64.h +0 -1852
- data/ext/v8/upstream/3.1.8/src/x64/regexp-macro-assembler-x64.cc +0 -1382
- data/ext/v8/upstream/3.1.8/src/x64/regexp-macro-assembler-x64.h +0 -278
- data/ext/v8/upstream/3.1.8/src/x64/register-allocator-x64-inl.h +0 -87
- data/ext/v8/upstream/3.1.8/src/x64/register-allocator-x64.cc +0 -91
- data/ext/v8/upstream/3.1.8/src/x64/simulator-x64.h +0 -71
- data/ext/v8/upstream/3.1.8/src/x64/stub-cache-x64.cc +0 -3509
- data/ext/v8/upstream/3.1.8/src/x64/virtual-frame-x64.cc +0 -1292
- data/ext/v8/upstream/3.1.8/src/x64/virtual-frame-x64.h +0 -593
- data/ext/v8/upstream/3.1.8/src/zone-inl.h +0 -83
- data/ext/v8/upstream/3.1.8/src/zone.cc +0 -195
- data/ext/v8/upstream/3.1.8/src/zone.h +0 -233
- data/ext/v8/upstream/3.1.8/tools/gyp/v8.gyp +0 -869
- data/ext/v8/upstream/3.1.8/tools/linux-tick-processor +0 -33
- data/ext/v8/upstream/3.1.8/tools/tickprocessor.js +0 -863
- data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base.vcproj +0 -1296
- data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base_arm.vcproj +0 -1234
- data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base_x64.vcproj +0 -1296
- data/ext/v8/upstream/3.1.8/tools/visual_studio/x64.vsprops +0 -17
- data/spec/ext/mem_spec.rb +0 -42
@@ -0,0 +1,2234 @@
|
|
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_AST_H_
|
29
|
+
#define V8_AST_H_
|
30
|
+
|
31
|
+
#include "execution.h"
|
32
|
+
#include "factory.h"
|
33
|
+
#include "jsregexp.h"
|
34
|
+
#include "jump-target.h"
|
35
|
+
#include "runtime.h"
|
36
|
+
#include "token.h"
|
37
|
+
#include "variables.h"
|
38
|
+
|
39
|
+
namespace v8 {
|
40
|
+
namespace internal {
|
41
|
+
|
42
|
+
// The abstract syntax tree is an intermediate, light-weight
|
43
|
+
// representation of the parsed JavaScript code suitable for
|
44
|
+
// compilation to native code.
|
45
|
+
|
46
|
+
// Nodes are allocated in a separate zone, which allows faster
|
47
|
+
// allocation and constant-time deallocation of the entire syntax
|
48
|
+
// tree.
|
49
|
+
|
50
|
+
|
51
|
+
// ----------------------------------------------------------------------------
|
52
|
+
// Nodes of the abstract syntax tree. Only concrete classes are
|
53
|
+
// enumerated here.
|
54
|
+
|
55
|
+
#define STATEMENT_NODE_LIST(V) \
|
56
|
+
V(Block) \
|
57
|
+
V(ExpressionStatement) \
|
58
|
+
V(EmptyStatement) \
|
59
|
+
V(IfStatement) \
|
60
|
+
V(ContinueStatement) \
|
61
|
+
V(BreakStatement) \
|
62
|
+
V(ReturnStatement) \
|
63
|
+
V(WithEnterStatement) \
|
64
|
+
V(WithExitStatement) \
|
65
|
+
V(SwitchStatement) \
|
66
|
+
V(DoWhileStatement) \
|
67
|
+
V(WhileStatement) \
|
68
|
+
V(ForStatement) \
|
69
|
+
V(ForInStatement) \
|
70
|
+
V(TryCatchStatement) \
|
71
|
+
V(TryFinallyStatement) \
|
72
|
+
V(DebuggerStatement)
|
73
|
+
|
74
|
+
#define EXPRESSION_NODE_LIST(V) \
|
75
|
+
V(FunctionLiteral) \
|
76
|
+
V(SharedFunctionInfoLiteral) \
|
77
|
+
V(Conditional) \
|
78
|
+
V(VariableProxy) \
|
79
|
+
V(Literal) \
|
80
|
+
V(RegExpLiteral) \
|
81
|
+
V(ObjectLiteral) \
|
82
|
+
V(ArrayLiteral) \
|
83
|
+
V(CatchExtensionObject) \
|
84
|
+
V(Assignment) \
|
85
|
+
V(Throw) \
|
86
|
+
V(Property) \
|
87
|
+
V(Call) \
|
88
|
+
V(CallNew) \
|
89
|
+
V(CallRuntime) \
|
90
|
+
V(UnaryOperation) \
|
91
|
+
V(IncrementOperation) \
|
92
|
+
V(CountOperation) \
|
93
|
+
V(BinaryOperation) \
|
94
|
+
V(CompareOperation) \
|
95
|
+
V(CompareToNull) \
|
96
|
+
V(ThisFunction)
|
97
|
+
|
98
|
+
#define AST_NODE_LIST(V) \
|
99
|
+
V(Declaration) \
|
100
|
+
STATEMENT_NODE_LIST(V) \
|
101
|
+
EXPRESSION_NODE_LIST(V)
|
102
|
+
|
103
|
+
// Forward declarations
|
104
|
+
class BitVector;
|
105
|
+
class DefinitionInfo;
|
106
|
+
class MaterializedLiteral;
|
107
|
+
class TargetCollector;
|
108
|
+
class TypeFeedbackOracle;
|
109
|
+
|
110
|
+
#define DEF_FORWARD_DECLARATION(type) class type;
|
111
|
+
AST_NODE_LIST(DEF_FORWARD_DECLARATION)
|
112
|
+
#undef DEF_FORWARD_DECLARATION
|
113
|
+
|
114
|
+
|
115
|
+
// Typedef only introduced to avoid unreadable code.
|
116
|
+
// Please do appreciate the required space in "> >".
|
117
|
+
typedef ZoneList<Handle<String> > ZoneStringList;
|
118
|
+
typedef ZoneList<Handle<Object> > ZoneObjectList;
|
119
|
+
|
120
|
+
|
121
|
+
#define DECLARE_NODE_TYPE(type) \
|
122
|
+
virtual void Accept(AstVisitor* v); \
|
123
|
+
virtual AstNode::Type node_type() const { return AstNode::k##type; } \
|
124
|
+
virtual type* As##type() { return this; }
|
125
|
+
|
126
|
+
|
127
|
+
class AstNode: public ZoneObject {
|
128
|
+
public:
|
129
|
+
#define DECLARE_TYPE_ENUM(type) k##type,
|
130
|
+
enum Type {
|
131
|
+
AST_NODE_LIST(DECLARE_TYPE_ENUM)
|
132
|
+
kInvalid = -1
|
133
|
+
};
|
134
|
+
#undef DECLARE_TYPE_ENUM
|
135
|
+
|
136
|
+
static const int kNoNumber = -1;
|
137
|
+
|
138
|
+
AstNode() : id_(GetNextId()) {
|
139
|
+
Isolate* isolate = Isolate::Current();
|
140
|
+
isolate->set_ast_node_count(isolate->ast_node_count() + 1);
|
141
|
+
}
|
142
|
+
|
143
|
+
virtual ~AstNode() { }
|
144
|
+
|
145
|
+
virtual void Accept(AstVisitor* v) = 0;
|
146
|
+
virtual Type node_type() const { return kInvalid; }
|
147
|
+
|
148
|
+
// Type testing & conversion functions overridden by concrete subclasses.
|
149
|
+
#define DECLARE_NODE_FUNCTIONS(type) \
|
150
|
+
virtual type* As##type() { return NULL; }
|
151
|
+
AST_NODE_LIST(DECLARE_NODE_FUNCTIONS)
|
152
|
+
#undef DECLARE_NODE_FUNCTIONS
|
153
|
+
|
154
|
+
virtual Statement* AsStatement() { return NULL; }
|
155
|
+
virtual Expression* AsExpression() { return NULL; }
|
156
|
+
virtual TargetCollector* AsTargetCollector() { return NULL; }
|
157
|
+
virtual BreakableStatement* AsBreakableStatement() { return NULL; }
|
158
|
+
virtual IterationStatement* AsIterationStatement() { return NULL; }
|
159
|
+
virtual MaterializedLiteral* AsMaterializedLiteral() { return NULL; }
|
160
|
+
virtual Slot* AsSlot() { return NULL; }
|
161
|
+
|
162
|
+
// True if the node is simple enough for us to inline calls containing it.
|
163
|
+
virtual bool IsInlineable() const { return false; }
|
164
|
+
|
165
|
+
static int Count() { return Isolate::Current()->ast_node_count(); }
|
166
|
+
static void ResetIds() { Isolate::Current()->set_ast_node_id(0); }
|
167
|
+
unsigned id() const { return id_; }
|
168
|
+
|
169
|
+
protected:
|
170
|
+
static unsigned GetNextId() {
|
171
|
+
Isolate* isolate = Isolate::Current();
|
172
|
+
unsigned tmp = isolate->ast_node_id();
|
173
|
+
isolate->set_ast_node_id(tmp + 1);
|
174
|
+
return tmp;
|
175
|
+
}
|
176
|
+
static unsigned ReserveIdRange(int n) {
|
177
|
+
Isolate* isolate = Isolate::Current();
|
178
|
+
unsigned tmp = isolate->ast_node_id();
|
179
|
+
isolate->set_ast_node_id(tmp + n);
|
180
|
+
return tmp;
|
181
|
+
}
|
182
|
+
|
183
|
+
private:
|
184
|
+
unsigned id_;
|
185
|
+
|
186
|
+
friend class CaseClause; // Generates AST IDs.
|
187
|
+
};
|
188
|
+
|
189
|
+
|
190
|
+
class Statement: public AstNode {
|
191
|
+
public:
|
192
|
+
Statement() : statement_pos_(RelocInfo::kNoPosition) {}
|
193
|
+
|
194
|
+
virtual Statement* AsStatement() { return this; }
|
195
|
+
|
196
|
+
virtual Assignment* StatementAsSimpleAssignment() { return NULL; }
|
197
|
+
virtual CountOperation* StatementAsCountOperation() { return NULL; }
|
198
|
+
|
199
|
+
bool IsEmpty() { return AsEmptyStatement() != NULL; }
|
200
|
+
|
201
|
+
void set_statement_pos(int statement_pos) { statement_pos_ = statement_pos; }
|
202
|
+
int statement_pos() const { return statement_pos_; }
|
203
|
+
|
204
|
+
private:
|
205
|
+
int statement_pos_;
|
206
|
+
};
|
207
|
+
|
208
|
+
|
209
|
+
class Expression: public AstNode {
|
210
|
+
public:
|
211
|
+
enum Context {
|
212
|
+
// Not assigned a context yet, or else will not be visited during
|
213
|
+
// code generation.
|
214
|
+
kUninitialized,
|
215
|
+
// Evaluated for its side effects.
|
216
|
+
kEffect,
|
217
|
+
// Evaluated for its value (and side effects).
|
218
|
+
kValue,
|
219
|
+
// Evaluated for control flow (and side effects).
|
220
|
+
kTest
|
221
|
+
};
|
222
|
+
|
223
|
+
Expression() : bitfields_(0) {}
|
224
|
+
|
225
|
+
virtual Expression* AsExpression() { return this; }
|
226
|
+
|
227
|
+
virtual bool IsTrivial() { return false; }
|
228
|
+
virtual bool IsValidLeftHandSide() { return false; }
|
229
|
+
|
230
|
+
// Helpers for ToBoolean conversion.
|
231
|
+
virtual bool ToBooleanIsTrue() { return false; }
|
232
|
+
virtual bool ToBooleanIsFalse() { return false; }
|
233
|
+
|
234
|
+
// Symbols that cannot be parsed as array indices are considered property
|
235
|
+
// names. We do not treat symbols that can be array indexes as property
|
236
|
+
// names because [] for string objects is handled only by keyed ICs.
|
237
|
+
virtual bool IsPropertyName() { return false; }
|
238
|
+
|
239
|
+
// Mark the expression as being compiled as an expression
|
240
|
+
// statement. This is used to transform postfix increments to
|
241
|
+
// (faster) prefix increments.
|
242
|
+
virtual void MarkAsStatement() { /* do nothing */ }
|
243
|
+
|
244
|
+
// True iff the result can be safely overwritten (to avoid allocation).
|
245
|
+
// False for operations that can return one of their operands.
|
246
|
+
virtual bool ResultOverwriteAllowed() { return false; }
|
247
|
+
|
248
|
+
// True iff the expression is a literal represented as a smi.
|
249
|
+
virtual bool IsSmiLiteral() { return false; }
|
250
|
+
|
251
|
+
// Type feedback information for assignments and properties.
|
252
|
+
virtual bool IsMonomorphic() {
|
253
|
+
UNREACHABLE();
|
254
|
+
return false;
|
255
|
+
}
|
256
|
+
virtual bool IsArrayLength() {
|
257
|
+
UNREACHABLE();
|
258
|
+
return false;
|
259
|
+
}
|
260
|
+
virtual ZoneMapList* GetReceiverTypes() {
|
261
|
+
UNREACHABLE();
|
262
|
+
return NULL;
|
263
|
+
}
|
264
|
+
virtual Handle<Map> GetMonomorphicReceiverType() {
|
265
|
+
UNREACHABLE();
|
266
|
+
return Handle<Map>();
|
267
|
+
}
|
268
|
+
|
269
|
+
// Static type information for this expression.
|
270
|
+
StaticType* type() { return &type_; }
|
271
|
+
|
272
|
+
// True if the expression is a loop condition.
|
273
|
+
bool is_loop_condition() const {
|
274
|
+
return LoopConditionField::decode(bitfields_);
|
275
|
+
}
|
276
|
+
void set_is_loop_condition(bool flag) {
|
277
|
+
bitfields_ = (bitfields_ & ~LoopConditionField::mask()) |
|
278
|
+
LoopConditionField::encode(flag);
|
279
|
+
}
|
280
|
+
|
281
|
+
// The value of the expression is guaranteed to be a smi, because the
|
282
|
+
// top operation is a bit operation with a mask, or a shift.
|
283
|
+
bool GuaranteedSmiResult();
|
284
|
+
|
285
|
+
// AST analysis results.
|
286
|
+
void CopyAnalysisResultsFrom(Expression* other);
|
287
|
+
|
288
|
+
// True if the expression rooted at this node can be compiled by the
|
289
|
+
// side-effect free compiler.
|
290
|
+
bool side_effect_free() { return SideEffectFreeField::decode(bitfields_); }
|
291
|
+
void set_side_effect_free(bool is_side_effect_free) {
|
292
|
+
bitfields_ &= ~SideEffectFreeField::mask();
|
293
|
+
bitfields_ |= SideEffectFreeField::encode(is_side_effect_free);
|
294
|
+
}
|
295
|
+
|
296
|
+
// Will the use of this expression treat -0 the same as 0 in all cases?
|
297
|
+
// If so, we can return 0 instead of -0 if we want to, to optimize code.
|
298
|
+
bool no_negative_zero() { return NoNegativeZeroField::decode(bitfields_); }
|
299
|
+
void set_no_negative_zero(bool no_negative_zero) {
|
300
|
+
bitfields_ &= ~NoNegativeZeroField::mask();
|
301
|
+
bitfields_ |= NoNegativeZeroField::encode(no_negative_zero);
|
302
|
+
}
|
303
|
+
|
304
|
+
// Will ToInt32 (ECMA 262-3 9.5) or ToUint32 (ECMA 262-3 9.6)
|
305
|
+
// be applied to the value of this expression?
|
306
|
+
// If so, we may be able to optimize the calculation of the value.
|
307
|
+
bool to_int32() { return ToInt32Field::decode(bitfields_); }
|
308
|
+
void set_to_int32(bool to_int32) {
|
309
|
+
bitfields_ &= ~ToInt32Field::mask();
|
310
|
+
bitfields_ |= ToInt32Field::encode(to_int32);
|
311
|
+
}
|
312
|
+
|
313
|
+
// How many bitwise logical or shift operators are used in this expression?
|
314
|
+
int num_bit_ops() { return NumBitOpsField::decode(bitfields_); }
|
315
|
+
void set_num_bit_ops(int num_bit_ops) {
|
316
|
+
bitfields_ &= ~NumBitOpsField::mask();
|
317
|
+
num_bit_ops = Min(num_bit_ops, kMaxNumBitOps);
|
318
|
+
bitfields_ |= NumBitOpsField::encode(num_bit_ops);
|
319
|
+
}
|
320
|
+
|
321
|
+
private:
|
322
|
+
static const int kMaxNumBitOps = (1 << 5) - 1;
|
323
|
+
|
324
|
+
uint32_t bitfields_;
|
325
|
+
StaticType type_;
|
326
|
+
|
327
|
+
// Using template BitField<type, start, size>.
|
328
|
+
class SideEffectFreeField : public BitField<bool, 0, 1> {};
|
329
|
+
class NoNegativeZeroField : public BitField<bool, 1, 1> {};
|
330
|
+
class ToInt32Field : public BitField<bool, 2, 1> {};
|
331
|
+
class NumBitOpsField : public BitField<int, 3, 5> {};
|
332
|
+
class LoopConditionField: public BitField<bool, 8, 1> {};
|
333
|
+
};
|
334
|
+
|
335
|
+
|
336
|
+
/**
|
337
|
+
* A sentinel used during pre parsing that represents some expression
|
338
|
+
* that is a valid left hand side without having to actually build
|
339
|
+
* the expression.
|
340
|
+
*/
|
341
|
+
class ValidLeftHandSideSentinel: public Expression {
|
342
|
+
public:
|
343
|
+
virtual bool IsValidLeftHandSide() { return true; }
|
344
|
+
virtual void Accept(AstVisitor* v) { UNREACHABLE(); }
|
345
|
+
};
|
346
|
+
|
347
|
+
|
348
|
+
class BreakableStatement: public Statement {
|
349
|
+
public:
|
350
|
+
enum Type {
|
351
|
+
TARGET_FOR_ANONYMOUS,
|
352
|
+
TARGET_FOR_NAMED_ONLY
|
353
|
+
};
|
354
|
+
|
355
|
+
// The labels associated with this statement. May be NULL;
|
356
|
+
// if it is != NULL, guaranteed to contain at least one entry.
|
357
|
+
ZoneStringList* labels() const { return labels_; }
|
358
|
+
|
359
|
+
// Type testing & conversion.
|
360
|
+
virtual BreakableStatement* AsBreakableStatement() { return this; }
|
361
|
+
|
362
|
+
// Code generation
|
363
|
+
BreakTarget* break_target() { return &break_target_; }
|
364
|
+
|
365
|
+
// Testers.
|
366
|
+
bool is_target_for_anonymous() const { return type_ == TARGET_FOR_ANONYMOUS; }
|
367
|
+
|
368
|
+
// Bailout support.
|
369
|
+
int EntryId() const { return entry_id_; }
|
370
|
+
int ExitId() const { return exit_id_; }
|
371
|
+
|
372
|
+
protected:
|
373
|
+
inline BreakableStatement(ZoneStringList* labels, Type type);
|
374
|
+
|
375
|
+
private:
|
376
|
+
ZoneStringList* labels_;
|
377
|
+
Type type_;
|
378
|
+
BreakTarget break_target_;
|
379
|
+
int entry_id_;
|
380
|
+
int exit_id_;
|
381
|
+
};
|
382
|
+
|
383
|
+
|
384
|
+
class Block: public BreakableStatement {
|
385
|
+
public:
|
386
|
+
inline Block(ZoneStringList* labels, int capacity, bool is_initializer_block);
|
387
|
+
|
388
|
+
DECLARE_NODE_TYPE(Block)
|
389
|
+
|
390
|
+
virtual Assignment* StatementAsSimpleAssignment() {
|
391
|
+
if (statements_.length() != 1) return NULL;
|
392
|
+
return statements_[0]->StatementAsSimpleAssignment();
|
393
|
+
}
|
394
|
+
|
395
|
+
virtual CountOperation* StatementAsCountOperation() {
|
396
|
+
if (statements_.length() != 1) return NULL;
|
397
|
+
return statements_[0]->StatementAsCountOperation();
|
398
|
+
}
|
399
|
+
|
400
|
+
virtual bool IsInlineable() const;
|
401
|
+
|
402
|
+
void AddStatement(Statement* statement) { statements_.Add(statement); }
|
403
|
+
|
404
|
+
ZoneList<Statement*>* statements() { return &statements_; }
|
405
|
+
bool is_initializer_block() const { return is_initializer_block_; }
|
406
|
+
|
407
|
+
private:
|
408
|
+
ZoneList<Statement*> statements_;
|
409
|
+
bool is_initializer_block_;
|
410
|
+
};
|
411
|
+
|
412
|
+
|
413
|
+
class Declaration: public AstNode {
|
414
|
+
public:
|
415
|
+
Declaration(VariableProxy* proxy, Variable::Mode mode, FunctionLiteral* fun)
|
416
|
+
: proxy_(proxy),
|
417
|
+
mode_(mode),
|
418
|
+
fun_(fun) {
|
419
|
+
ASSERT(mode == Variable::VAR || mode == Variable::CONST);
|
420
|
+
// At the moment there are no "const functions"'s in JavaScript...
|
421
|
+
ASSERT(fun == NULL || mode == Variable::VAR);
|
422
|
+
}
|
423
|
+
|
424
|
+
DECLARE_NODE_TYPE(Declaration)
|
425
|
+
|
426
|
+
VariableProxy* proxy() const { return proxy_; }
|
427
|
+
Variable::Mode mode() const { return mode_; }
|
428
|
+
FunctionLiteral* fun() const { return fun_; } // may be NULL
|
429
|
+
|
430
|
+
private:
|
431
|
+
VariableProxy* proxy_;
|
432
|
+
Variable::Mode mode_;
|
433
|
+
FunctionLiteral* fun_;
|
434
|
+
};
|
435
|
+
|
436
|
+
|
437
|
+
class IterationStatement: public BreakableStatement {
|
438
|
+
public:
|
439
|
+
// Type testing & conversion.
|
440
|
+
virtual IterationStatement* AsIterationStatement() { return this; }
|
441
|
+
|
442
|
+
Statement* body() const { return body_; }
|
443
|
+
|
444
|
+
// Bailout support.
|
445
|
+
int OsrEntryId() const { return osr_entry_id_; }
|
446
|
+
virtual int ContinueId() const = 0;
|
447
|
+
|
448
|
+
// Code generation
|
449
|
+
BreakTarget* continue_target() { return &continue_target_; }
|
450
|
+
|
451
|
+
protected:
|
452
|
+
explicit inline IterationStatement(ZoneStringList* labels);
|
453
|
+
|
454
|
+
void Initialize(Statement* body) {
|
455
|
+
body_ = body;
|
456
|
+
}
|
457
|
+
|
458
|
+
private:
|
459
|
+
Statement* body_;
|
460
|
+
BreakTarget continue_target_;
|
461
|
+
int osr_entry_id_;
|
462
|
+
};
|
463
|
+
|
464
|
+
|
465
|
+
class DoWhileStatement: public IterationStatement {
|
466
|
+
public:
|
467
|
+
explicit inline DoWhileStatement(ZoneStringList* labels);
|
468
|
+
|
469
|
+
DECLARE_NODE_TYPE(DoWhileStatement)
|
470
|
+
|
471
|
+
void Initialize(Expression* cond, Statement* body) {
|
472
|
+
IterationStatement::Initialize(body);
|
473
|
+
cond_ = cond;
|
474
|
+
}
|
475
|
+
|
476
|
+
Expression* cond() const { return cond_; }
|
477
|
+
|
478
|
+
// Position where condition expression starts. We need it to make
|
479
|
+
// the loop's condition a breakable location.
|
480
|
+
int condition_position() { return condition_position_; }
|
481
|
+
void set_condition_position(int pos) { condition_position_ = pos; }
|
482
|
+
|
483
|
+
// Bailout support.
|
484
|
+
virtual int ContinueId() const { return continue_id_; }
|
485
|
+
int BackEdgeId() const { return back_edge_id_; }
|
486
|
+
|
487
|
+
private:
|
488
|
+
Expression* cond_;
|
489
|
+
int condition_position_;
|
490
|
+
int continue_id_;
|
491
|
+
int back_edge_id_;
|
492
|
+
};
|
493
|
+
|
494
|
+
|
495
|
+
class WhileStatement: public IterationStatement {
|
496
|
+
public:
|
497
|
+
explicit inline WhileStatement(ZoneStringList* labels);
|
498
|
+
|
499
|
+
DECLARE_NODE_TYPE(WhileStatement)
|
500
|
+
|
501
|
+
void Initialize(Expression* cond, Statement* body) {
|
502
|
+
IterationStatement::Initialize(body);
|
503
|
+
cond_ = cond;
|
504
|
+
}
|
505
|
+
|
506
|
+
Expression* cond() const { return cond_; }
|
507
|
+
bool may_have_function_literal() const {
|
508
|
+
return may_have_function_literal_;
|
509
|
+
}
|
510
|
+
void set_may_have_function_literal(bool value) {
|
511
|
+
may_have_function_literal_ = value;
|
512
|
+
}
|
513
|
+
|
514
|
+
// Bailout support.
|
515
|
+
virtual int ContinueId() const { return EntryId(); }
|
516
|
+
int BodyId() const { return body_id_; }
|
517
|
+
|
518
|
+
private:
|
519
|
+
Expression* cond_;
|
520
|
+
// True if there is a function literal subexpression in the condition.
|
521
|
+
bool may_have_function_literal_;
|
522
|
+
int body_id_;
|
523
|
+
};
|
524
|
+
|
525
|
+
|
526
|
+
class ForStatement: public IterationStatement {
|
527
|
+
public:
|
528
|
+
explicit inline ForStatement(ZoneStringList* labels);
|
529
|
+
|
530
|
+
DECLARE_NODE_TYPE(ForStatement)
|
531
|
+
|
532
|
+
void Initialize(Statement* init,
|
533
|
+
Expression* cond,
|
534
|
+
Statement* next,
|
535
|
+
Statement* body) {
|
536
|
+
IterationStatement::Initialize(body);
|
537
|
+
init_ = init;
|
538
|
+
cond_ = cond;
|
539
|
+
next_ = next;
|
540
|
+
}
|
541
|
+
|
542
|
+
Statement* init() const { return init_; }
|
543
|
+
Expression* cond() const { return cond_; }
|
544
|
+
Statement* next() const { return next_; }
|
545
|
+
|
546
|
+
bool may_have_function_literal() const {
|
547
|
+
return may_have_function_literal_;
|
548
|
+
}
|
549
|
+
void set_may_have_function_literal(bool value) {
|
550
|
+
may_have_function_literal_ = value;
|
551
|
+
}
|
552
|
+
|
553
|
+
// Bailout support.
|
554
|
+
virtual int ContinueId() const { return continue_id_; }
|
555
|
+
int BodyId() const { return body_id_; }
|
556
|
+
|
557
|
+
bool is_fast_smi_loop() { return loop_variable_ != NULL; }
|
558
|
+
Variable* loop_variable() { return loop_variable_; }
|
559
|
+
void set_loop_variable(Variable* var) { loop_variable_ = var; }
|
560
|
+
|
561
|
+
private:
|
562
|
+
Statement* init_;
|
563
|
+
Expression* cond_;
|
564
|
+
Statement* next_;
|
565
|
+
// True if there is a function literal subexpression in the condition.
|
566
|
+
bool may_have_function_literal_;
|
567
|
+
Variable* loop_variable_;
|
568
|
+
int continue_id_;
|
569
|
+
int body_id_;
|
570
|
+
};
|
571
|
+
|
572
|
+
|
573
|
+
class ForInStatement: public IterationStatement {
|
574
|
+
public:
|
575
|
+
explicit inline ForInStatement(ZoneStringList* labels);
|
576
|
+
|
577
|
+
DECLARE_NODE_TYPE(ForInStatement)
|
578
|
+
|
579
|
+
void Initialize(Expression* each, Expression* enumerable, Statement* body) {
|
580
|
+
IterationStatement::Initialize(body);
|
581
|
+
each_ = each;
|
582
|
+
enumerable_ = enumerable;
|
583
|
+
}
|
584
|
+
|
585
|
+
Expression* each() const { return each_; }
|
586
|
+
Expression* enumerable() const { return enumerable_; }
|
587
|
+
|
588
|
+
// Bailout support.
|
589
|
+
int AssignmentId() const { return assignment_id_; }
|
590
|
+
virtual int ContinueId() const { return EntryId(); }
|
591
|
+
|
592
|
+
private:
|
593
|
+
Expression* each_;
|
594
|
+
Expression* enumerable_;
|
595
|
+
int assignment_id_;
|
596
|
+
};
|
597
|
+
|
598
|
+
|
599
|
+
class ExpressionStatement: public Statement {
|
600
|
+
public:
|
601
|
+
explicit ExpressionStatement(Expression* expression)
|
602
|
+
: expression_(expression) { }
|
603
|
+
|
604
|
+
DECLARE_NODE_TYPE(ExpressionStatement)
|
605
|
+
|
606
|
+
virtual bool IsInlineable() const;
|
607
|
+
|
608
|
+
virtual Assignment* StatementAsSimpleAssignment();
|
609
|
+
virtual CountOperation* StatementAsCountOperation();
|
610
|
+
|
611
|
+
void set_expression(Expression* e) { expression_ = e; }
|
612
|
+
Expression* expression() const { return expression_; }
|
613
|
+
|
614
|
+
private:
|
615
|
+
Expression* expression_;
|
616
|
+
};
|
617
|
+
|
618
|
+
|
619
|
+
class ContinueStatement: public Statement {
|
620
|
+
public:
|
621
|
+
explicit ContinueStatement(IterationStatement* target)
|
622
|
+
: target_(target) { }
|
623
|
+
|
624
|
+
DECLARE_NODE_TYPE(ContinueStatement)
|
625
|
+
|
626
|
+
IterationStatement* target() const { return target_; }
|
627
|
+
|
628
|
+
private:
|
629
|
+
IterationStatement* target_;
|
630
|
+
};
|
631
|
+
|
632
|
+
|
633
|
+
class BreakStatement: public Statement {
|
634
|
+
public:
|
635
|
+
explicit BreakStatement(BreakableStatement* target)
|
636
|
+
: target_(target) { }
|
637
|
+
|
638
|
+
DECLARE_NODE_TYPE(BreakStatement)
|
639
|
+
|
640
|
+
BreakableStatement* target() const { return target_; }
|
641
|
+
|
642
|
+
private:
|
643
|
+
BreakableStatement* target_;
|
644
|
+
};
|
645
|
+
|
646
|
+
|
647
|
+
class ReturnStatement: public Statement {
|
648
|
+
public:
|
649
|
+
explicit ReturnStatement(Expression* expression)
|
650
|
+
: expression_(expression) { }
|
651
|
+
|
652
|
+
DECLARE_NODE_TYPE(ReturnStatement)
|
653
|
+
|
654
|
+
Expression* expression() const { return expression_; }
|
655
|
+
virtual bool IsInlineable() const;
|
656
|
+
|
657
|
+
private:
|
658
|
+
Expression* expression_;
|
659
|
+
};
|
660
|
+
|
661
|
+
|
662
|
+
class WithEnterStatement: public Statement {
|
663
|
+
public:
|
664
|
+
explicit WithEnterStatement(Expression* expression, bool is_catch_block)
|
665
|
+
: expression_(expression), is_catch_block_(is_catch_block) { }
|
666
|
+
|
667
|
+
DECLARE_NODE_TYPE(WithEnterStatement)
|
668
|
+
|
669
|
+
Expression* expression() const { return expression_; }
|
670
|
+
|
671
|
+
bool is_catch_block() const { return is_catch_block_; }
|
672
|
+
|
673
|
+
private:
|
674
|
+
Expression* expression_;
|
675
|
+
bool is_catch_block_;
|
676
|
+
};
|
677
|
+
|
678
|
+
|
679
|
+
class WithExitStatement: public Statement {
|
680
|
+
public:
|
681
|
+
WithExitStatement() { }
|
682
|
+
|
683
|
+
DECLARE_NODE_TYPE(WithExitStatement)
|
684
|
+
};
|
685
|
+
|
686
|
+
|
687
|
+
class CaseClause: public ZoneObject {
|
688
|
+
public:
|
689
|
+
CaseClause(Expression* label, ZoneList<Statement*>* statements, int pos);
|
690
|
+
|
691
|
+
bool is_default() const { return label_ == NULL; }
|
692
|
+
Expression* label() const {
|
693
|
+
CHECK(!is_default());
|
694
|
+
return label_;
|
695
|
+
}
|
696
|
+
JumpTarget* body_target() { return &body_target_; }
|
697
|
+
ZoneList<Statement*>* statements() const { return statements_; }
|
698
|
+
|
699
|
+
int position() { return position_; }
|
700
|
+
void set_position(int pos) { position_ = pos; }
|
701
|
+
|
702
|
+
int EntryId() { return entry_id_; }
|
703
|
+
|
704
|
+
// Type feedback information.
|
705
|
+
void RecordTypeFeedback(TypeFeedbackOracle* oracle);
|
706
|
+
bool IsSmiCompare() { return compare_type_ == SMI_ONLY; }
|
707
|
+
bool IsObjectCompare() { return compare_type_ == OBJECT_ONLY; }
|
708
|
+
|
709
|
+
private:
|
710
|
+
Expression* label_;
|
711
|
+
JumpTarget body_target_;
|
712
|
+
ZoneList<Statement*>* statements_;
|
713
|
+
int position_;
|
714
|
+
enum CompareTypeFeedback { NONE, SMI_ONLY, OBJECT_ONLY };
|
715
|
+
CompareTypeFeedback compare_type_;
|
716
|
+
int entry_id_;
|
717
|
+
};
|
718
|
+
|
719
|
+
|
720
|
+
class SwitchStatement: public BreakableStatement {
|
721
|
+
public:
|
722
|
+
explicit inline SwitchStatement(ZoneStringList* labels);
|
723
|
+
|
724
|
+
DECLARE_NODE_TYPE(SwitchStatement)
|
725
|
+
|
726
|
+
void Initialize(Expression* tag, ZoneList<CaseClause*>* cases) {
|
727
|
+
tag_ = tag;
|
728
|
+
cases_ = cases;
|
729
|
+
}
|
730
|
+
|
731
|
+
Expression* tag() const { return tag_; }
|
732
|
+
ZoneList<CaseClause*>* cases() const { return cases_; }
|
733
|
+
|
734
|
+
private:
|
735
|
+
Expression* tag_;
|
736
|
+
ZoneList<CaseClause*>* cases_;
|
737
|
+
};
|
738
|
+
|
739
|
+
|
740
|
+
// If-statements always have non-null references to their then- and
|
741
|
+
// else-parts. When parsing if-statements with no explicit else-part,
|
742
|
+
// the parser implicitly creates an empty statement. Use the
|
743
|
+
// HasThenStatement() and HasElseStatement() functions to check if a
|
744
|
+
// given if-statement has a then- or an else-part containing code.
|
745
|
+
class IfStatement: public Statement {
|
746
|
+
public:
|
747
|
+
IfStatement(Expression* condition,
|
748
|
+
Statement* then_statement,
|
749
|
+
Statement* else_statement)
|
750
|
+
: condition_(condition),
|
751
|
+
then_statement_(then_statement),
|
752
|
+
else_statement_(else_statement),
|
753
|
+
then_id_(GetNextId()),
|
754
|
+
else_id_(GetNextId()) {
|
755
|
+
}
|
756
|
+
|
757
|
+
DECLARE_NODE_TYPE(IfStatement)
|
758
|
+
|
759
|
+
virtual bool IsInlineable() const;
|
760
|
+
|
761
|
+
bool HasThenStatement() const { return !then_statement()->IsEmpty(); }
|
762
|
+
bool HasElseStatement() const { return !else_statement()->IsEmpty(); }
|
763
|
+
|
764
|
+
Expression* condition() const { return condition_; }
|
765
|
+
Statement* then_statement() const { return then_statement_; }
|
766
|
+
Statement* else_statement() const { return else_statement_; }
|
767
|
+
|
768
|
+
int ThenId() const { return then_id_; }
|
769
|
+
int ElseId() const { return else_id_; }
|
770
|
+
|
771
|
+
private:
|
772
|
+
Expression* condition_;
|
773
|
+
Statement* then_statement_;
|
774
|
+
Statement* else_statement_;
|
775
|
+
int then_id_;
|
776
|
+
int else_id_;
|
777
|
+
};
|
778
|
+
|
779
|
+
|
780
|
+
// NOTE: TargetCollectors are represented as nodes to fit in the target
|
781
|
+
// stack in the compiler; this should probably be reworked.
|
782
|
+
class TargetCollector: public AstNode {
|
783
|
+
public:
|
784
|
+
explicit TargetCollector(ZoneList<BreakTarget*>* targets)
|
785
|
+
: targets_(targets) {
|
786
|
+
}
|
787
|
+
|
788
|
+
// Adds a jump target to the collector. The collector stores a pointer not
|
789
|
+
// a copy of the target to make binding work, so make sure not to pass in
|
790
|
+
// references to something on the stack.
|
791
|
+
void AddTarget(BreakTarget* target);
|
792
|
+
|
793
|
+
// Virtual behaviour. TargetCollectors are never part of the AST.
|
794
|
+
virtual void Accept(AstVisitor* v) { UNREACHABLE(); }
|
795
|
+
virtual TargetCollector* AsTargetCollector() { return this; }
|
796
|
+
|
797
|
+
ZoneList<BreakTarget*>* targets() { return targets_; }
|
798
|
+
|
799
|
+
private:
|
800
|
+
ZoneList<BreakTarget*>* targets_;
|
801
|
+
};
|
802
|
+
|
803
|
+
|
804
|
+
class TryStatement: public Statement {
|
805
|
+
public:
|
806
|
+
explicit TryStatement(Block* try_block)
|
807
|
+
: try_block_(try_block), escaping_targets_(NULL) { }
|
808
|
+
|
809
|
+
void set_escaping_targets(ZoneList<BreakTarget*>* targets) {
|
810
|
+
escaping_targets_ = targets;
|
811
|
+
}
|
812
|
+
|
813
|
+
Block* try_block() const { return try_block_; }
|
814
|
+
ZoneList<BreakTarget*>* escaping_targets() const { return escaping_targets_; }
|
815
|
+
|
816
|
+
private:
|
817
|
+
Block* try_block_;
|
818
|
+
ZoneList<BreakTarget*>* escaping_targets_;
|
819
|
+
};
|
820
|
+
|
821
|
+
|
822
|
+
class TryCatchStatement: public TryStatement {
|
823
|
+
public:
|
824
|
+
TryCatchStatement(Block* try_block,
|
825
|
+
VariableProxy* catch_var,
|
826
|
+
Block* catch_block)
|
827
|
+
: TryStatement(try_block),
|
828
|
+
catch_var_(catch_var),
|
829
|
+
catch_block_(catch_block) {
|
830
|
+
}
|
831
|
+
|
832
|
+
DECLARE_NODE_TYPE(TryCatchStatement)
|
833
|
+
|
834
|
+
VariableProxy* catch_var() const { return catch_var_; }
|
835
|
+
Block* catch_block() const { return catch_block_; }
|
836
|
+
|
837
|
+
private:
|
838
|
+
VariableProxy* catch_var_;
|
839
|
+
Block* catch_block_;
|
840
|
+
};
|
841
|
+
|
842
|
+
|
843
|
+
class TryFinallyStatement: public TryStatement {
|
844
|
+
public:
|
845
|
+
TryFinallyStatement(Block* try_block, Block* finally_block)
|
846
|
+
: TryStatement(try_block),
|
847
|
+
finally_block_(finally_block) { }
|
848
|
+
|
849
|
+
DECLARE_NODE_TYPE(TryFinallyStatement)
|
850
|
+
|
851
|
+
Block* finally_block() const { return finally_block_; }
|
852
|
+
|
853
|
+
private:
|
854
|
+
Block* finally_block_;
|
855
|
+
};
|
856
|
+
|
857
|
+
|
858
|
+
class DebuggerStatement: public Statement {
|
859
|
+
public:
|
860
|
+
DECLARE_NODE_TYPE(DebuggerStatement)
|
861
|
+
};
|
862
|
+
|
863
|
+
|
864
|
+
class EmptyStatement: public Statement {
|
865
|
+
public:
|
866
|
+
DECLARE_NODE_TYPE(EmptyStatement)
|
867
|
+
|
868
|
+
virtual bool IsInlineable() const { return true; }
|
869
|
+
};
|
870
|
+
|
871
|
+
|
872
|
+
class Literal: public Expression {
|
873
|
+
public:
|
874
|
+
explicit Literal(Handle<Object> handle) : handle_(handle) { }
|
875
|
+
|
876
|
+
DECLARE_NODE_TYPE(Literal)
|
877
|
+
|
878
|
+
virtual bool IsTrivial() { return true; }
|
879
|
+
virtual bool IsInlineable() const { return true; }
|
880
|
+
virtual bool IsSmiLiteral() { return handle_->IsSmi(); }
|
881
|
+
|
882
|
+
// Check if this literal is identical to the other literal.
|
883
|
+
bool IsIdenticalTo(const Literal* other) const {
|
884
|
+
return handle_.is_identical_to(other->handle_);
|
885
|
+
}
|
886
|
+
|
887
|
+
virtual bool IsPropertyName() {
|
888
|
+
if (handle_->IsSymbol()) {
|
889
|
+
uint32_t ignored;
|
890
|
+
return !String::cast(*handle_)->AsArrayIndex(&ignored);
|
891
|
+
}
|
892
|
+
return false;
|
893
|
+
}
|
894
|
+
|
895
|
+
Handle<String> AsPropertyName() {
|
896
|
+
ASSERT(IsPropertyName());
|
897
|
+
return Handle<String>::cast(handle_);
|
898
|
+
}
|
899
|
+
|
900
|
+
virtual bool ToBooleanIsTrue() { return handle_->ToBoolean()->IsTrue(); }
|
901
|
+
virtual bool ToBooleanIsFalse() { return handle_->ToBoolean()->IsFalse(); }
|
902
|
+
|
903
|
+
// Identity testers.
|
904
|
+
bool IsNull() const {
|
905
|
+
ASSERT(!handle_.is_null());
|
906
|
+
return handle_->IsNull();
|
907
|
+
}
|
908
|
+
bool IsTrue() const {
|
909
|
+
ASSERT(!handle_.is_null());
|
910
|
+
return handle_->IsTrue();
|
911
|
+
}
|
912
|
+
bool IsFalse() const {
|
913
|
+
ASSERT(!handle_.is_null());
|
914
|
+
return handle_->IsFalse();
|
915
|
+
}
|
916
|
+
|
917
|
+
Handle<Object> handle() const { return handle_; }
|
918
|
+
|
919
|
+
private:
|
920
|
+
Handle<Object> handle_;
|
921
|
+
};
|
922
|
+
|
923
|
+
|
924
|
+
// Base class for literals that needs space in the corresponding JSFunction.
|
925
|
+
class MaterializedLiteral: public Expression {
|
926
|
+
public:
|
927
|
+
explicit MaterializedLiteral(int literal_index, bool is_simple, int depth)
|
928
|
+
: literal_index_(literal_index), is_simple_(is_simple), depth_(depth) {}
|
929
|
+
|
930
|
+
virtual MaterializedLiteral* AsMaterializedLiteral() { return this; }
|
931
|
+
|
932
|
+
int literal_index() { return literal_index_; }
|
933
|
+
|
934
|
+
// A materialized literal is simple if the values consist of only
|
935
|
+
// constants and simple object and array literals.
|
936
|
+
bool is_simple() const { return is_simple_; }
|
937
|
+
|
938
|
+
int depth() const { return depth_; }
|
939
|
+
|
940
|
+
private:
|
941
|
+
int literal_index_;
|
942
|
+
bool is_simple_;
|
943
|
+
int depth_;
|
944
|
+
};
|
945
|
+
|
946
|
+
|
947
|
+
// An object literal has a boilerplate object that is used
|
948
|
+
// for minimizing the work when constructing it at runtime.
|
949
|
+
class ObjectLiteral: public MaterializedLiteral {
|
950
|
+
public:
|
951
|
+
// Property is used for passing information
|
952
|
+
// about an object literal's properties from the parser
|
953
|
+
// to the code generator.
|
954
|
+
class Property: public ZoneObject {
|
955
|
+
public:
|
956
|
+
enum Kind {
|
957
|
+
CONSTANT, // Property with constant value (compile time).
|
958
|
+
COMPUTED, // Property with computed value (execution time).
|
959
|
+
MATERIALIZED_LITERAL, // Property value is a materialized literal.
|
960
|
+
GETTER, SETTER, // Property is an accessor function.
|
961
|
+
PROTOTYPE // Property is __proto__.
|
962
|
+
};
|
963
|
+
|
964
|
+
Property(Literal* key, Expression* value);
|
965
|
+
Property(bool is_getter, FunctionLiteral* value);
|
966
|
+
|
967
|
+
Literal* key() { return key_; }
|
968
|
+
Expression* value() { return value_; }
|
969
|
+
Kind kind() { return kind_; }
|
970
|
+
|
971
|
+
bool IsCompileTimeValue();
|
972
|
+
|
973
|
+
void set_emit_store(bool emit_store);
|
974
|
+
bool emit_store();
|
975
|
+
|
976
|
+
private:
|
977
|
+
Literal* key_;
|
978
|
+
Expression* value_;
|
979
|
+
Kind kind_;
|
980
|
+
bool emit_store_;
|
981
|
+
};
|
982
|
+
|
983
|
+
ObjectLiteral(Handle<FixedArray> constant_properties,
|
984
|
+
ZoneList<Property*>* properties,
|
985
|
+
int literal_index,
|
986
|
+
bool is_simple,
|
987
|
+
bool fast_elements,
|
988
|
+
int depth,
|
989
|
+
bool has_function)
|
990
|
+
: MaterializedLiteral(literal_index, is_simple, depth),
|
991
|
+
constant_properties_(constant_properties),
|
992
|
+
properties_(properties),
|
993
|
+
fast_elements_(fast_elements),
|
994
|
+
has_function_(has_function) {}
|
995
|
+
|
996
|
+
DECLARE_NODE_TYPE(ObjectLiteral)
|
997
|
+
|
998
|
+
Handle<FixedArray> constant_properties() const {
|
999
|
+
return constant_properties_;
|
1000
|
+
}
|
1001
|
+
ZoneList<Property*>* properties() const { return properties_; }
|
1002
|
+
|
1003
|
+
bool fast_elements() const { return fast_elements_; }
|
1004
|
+
|
1005
|
+
bool has_function() { return has_function_; }
|
1006
|
+
|
1007
|
+
// Mark all computed expressions that are bound to a key that
|
1008
|
+
// is shadowed by a later occurrence of the same key. For the
|
1009
|
+
// marked expressions, no store code is emitted.
|
1010
|
+
void CalculateEmitStore();
|
1011
|
+
|
1012
|
+
enum Flags {
|
1013
|
+
kNoFlags = 0,
|
1014
|
+
kFastElements = 1,
|
1015
|
+
kHasFunction = 1 << 1
|
1016
|
+
};
|
1017
|
+
|
1018
|
+
private:
|
1019
|
+
Handle<FixedArray> constant_properties_;
|
1020
|
+
ZoneList<Property*>* properties_;
|
1021
|
+
bool fast_elements_;
|
1022
|
+
bool has_function_;
|
1023
|
+
};
|
1024
|
+
|
1025
|
+
|
1026
|
+
// Node for capturing a regexp literal.
|
1027
|
+
class RegExpLiteral: public MaterializedLiteral {
|
1028
|
+
public:
|
1029
|
+
RegExpLiteral(Handle<String> pattern,
|
1030
|
+
Handle<String> flags,
|
1031
|
+
int literal_index)
|
1032
|
+
: MaterializedLiteral(literal_index, false, 1),
|
1033
|
+
pattern_(pattern),
|
1034
|
+
flags_(flags) {}
|
1035
|
+
|
1036
|
+
DECLARE_NODE_TYPE(RegExpLiteral)
|
1037
|
+
|
1038
|
+
Handle<String> pattern() const { return pattern_; }
|
1039
|
+
Handle<String> flags() const { return flags_; }
|
1040
|
+
|
1041
|
+
private:
|
1042
|
+
Handle<String> pattern_;
|
1043
|
+
Handle<String> flags_;
|
1044
|
+
};
|
1045
|
+
|
1046
|
+
// An array literal has a literals object that is used
|
1047
|
+
// for minimizing the work when constructing it at runtime.
|
1048
|
+
class ArrayLiteral: public MaterializedLiteral {
|
1049
|
+
public:
|
1050
|
+
ArrayLiteral(Handle<FixedArray> constant_elements,
|
1051
|
+
ZoneList<Expression*>* values,
|
1052
|
+
int literal_index,
|
1053
|
+
bool is_simple,
|
1054
|
+
int depth)
|
1055
|
+
: MaterializedLiteral(literal_index, is_simple, depth),
|
1056
|
+
constant_elements_(constant_elements),
|
1057
|
+
values_(values),
|
1058
|
+
first_element_id_(ReserveIdRange(values->length())) {}
|
1059
|
+
|
1060
|
+
DECLARE_NODE_TYPE(ArrayLiteral)
|
1061
|
+
|
1062
|
+
Handle<FixedArray> constant_elements() const { return constant_elements_; }
|
1063
|
+
ZoneList<Expression*>* values() const { return values_; }
|
1064
|
+
|
1065
|
+
// Return an AST id for an element that is used in simulate instructions.
|
1066
|
+
int GetIdForElement(int i) { return first_element_id_ + i; }
|
1067
|
+
|
1068
|
+
private:
|
1069
|
+
Handle<FixedArray> constant_elements_;
|
1070
|
+
ZoneList<Expression*>* values_;
|
1071
|
+
int first_element_id_;
|
1072
|
+
};
|
1073
|
+
|
1074
|
+
|
1075
|
+
// Node for constructing a context extension object for a catch block.
|
1076
|
+
// The catch context extension object has one property, the catch
|
1077
|
+
// variable, which should be DontDelete.
|
1078
|
+
class CatchExtensionObject: public Expression {
|
1079
|
+
public:
|
1080
|
+
CatchExtensionObject(Literal* key, VariableProxy* value)
|
1081
|
+
: key_(key), value_(value) {
|
1082
|
+
}
|
1083
|
+
|
1084
|
+
DECLARE_NODE_TYPE(CatchExtensionObject)
|
1085
|
+
|
1086
|
+
Literal* key() const { return key_; }
|
1087
|
+
VariableProxy* value() const { return value_; }
|
1088
|
+
|
1089
|
+
private:
|
1090
|
+
Literal* key_;
|
1091
|
+
VariableProxy* value_;
|
1092
|
+
};
|
1093
|
+
|
1094
|
+
|
1095
|
+
class VariableProxy: public Expression {
|
1096
|
+
public:
|
1097
|
+
explicit VariableProxy(Variable* var);
|
1098
|
+
|
1099
|
+
DECLARE_NODE_TYPE(VariableProxy)
|
1100
|
+
|
1101
|
+
// Type testing & conversion
|
1102
|
+
virtual Property* AsProperty() {
|
1103
|
+
return var_ == NULL ? NULL : var_->AsProperty();
|
1104
|
+
}
|
1105
|
+
|
1106
|
+
Variable* AsVariable() {
|
1107
|
+
if (this == NULL || var_ == NULL) return NULL;
|
1108
|
+
Expression* rewrite = var_->rewrite();
|
1109
|
+
if (rewrite == NULL || rewrite->AsSlot() != NULL) return var_;
|
1110
|
+
return NULL;
|
1111
|
+
}
|
1112
|
+
|
1113
|
+
virtual bool IsValidLeftHandSide() {
|
1114
|
+
return var_ == NULL ? true : var_->IsValidLeftHandSide();
|
1115
|
+
}
|
1116
|
+
|
1117
|
+
virtual bool IsTrivial() {
|
1118
|
+
// Reading from a mutable variable is a side effect, but the
|
1119
|
+
// variable for 'this' is immutable.
|
1120
|
+
return is_this_ || is_trivial_;
|
1121
|
+
}
|
1122
|
+
|
1123
|
+
virtual bool IsInlineable() const;
|
1124
|
+
|
1125
|
+
bool IsVariable(Handle<String> n) {
|
1126
|
+
return !is_this() && name().is_identical_to(n);
|
1127
|
+
}
|
1128
|
+
|
1129
|
+
bool IsArguments() {
|
1130
|
+
Variable* variable = AsVariable();
|
1131
|
+
return (variable == NULL) ? false : variable->is_arguments();
|
1132
|
+
}
|
1133
|
+
|
1134
|
+
Handle<String> name() const { return name_; }
|
1135
|
+
Variable* var() const { return var_; }
|
1136
|
+
bool is_this() const { return is_this_; }
|
1137
|
+
bool inside_with() const { return inside_with_; }
|
1138
|
+
int position() const { return position_; }
|
1139
|
+
|
1140
|
+
void MarkAsTrivial() { is_trivial_ = true; }
|
1141
|
+
|
1142
|
+
// Bind this proxy to the variable var.
|
1143
|
+
void BindTo(Variable* var);
|
1144
|
+
|
1145
|
+
protected:
|
1146
|
+
Handle<String> name_;
|
1147
|
+
Variable* var_; // resolved variable, or NULL
|
1148
|
+
bool is_this_;
|
1149
|
+
bool inside_with_;
|
1150
|
+
bool is_trivial_;
|
1151
|
+
int position_;
|
1152
|
+
|
1153
|
+
VariableProxy(Handle<String> name,
|
1154
|
+
bool is_this,
|
1155
|
+
bool inside_with,
|
1156
|
+
int position = RelocInfo::kNoPosition);
|
1157
|
+
explicit VariableProxy(bool is_this);
|
1158
|
+
|
1159
|
+
friend class Scope;
|
1160
|
+
};
|
1161
|
+
|
1162
|
+
|
1163
|
+
class VariableProxySentinel: public VariableProxy {
|
1164
|
+
public:
|
1165
|
+
virtual bool IsValidLeftHandSide() { return !is_this(); }
|
1166
|
+
|
1167
|
+
private:
|
1168
|
+
explicit VariableProxySentinel(bool is_this) : VariableProxy(is_this) { }
|
1169
|
+
|
1170
|
+
friend class AstSentinels;
|
1171
|
+
};
|
1172
|
+
|
1173
|
+
|
1174
|
+
class Slot: public Expression {
|
1175
|
+
public:
|
1176
|
+
enum Type {
|
1177
|
+
// A slot in the parameter section on the stack. index() is
|
1178
|
+
// the parameter index, counting left-to-right, starting at 0.
|
1179
|
+
PARAMETER,
|
1180
|
+
|
1181
|
+
// A slot in the local section on the stack. index() is
|
1182
|
+
// the variable index in the stack frame, starting at 0.
|
1183
|
+
LOCAL,
|
1184
|
+
|
1185
|
+
// An indexed slot in a heap context. index() is the
|
1186
|
+
// variable index in the context object on the heap,
|
1187
|
+
// starting at 0. var()->scope() is the corresponding
|
1188
|
+
// scope.
|
1189
|
+
CONTEXT,
|
1190
|
+
|
1191
|
+
// A named slot in a heap context. var()->name() is the
|
1192
|
+
// variable name in the context object on the heap,
|
1193
|
+
// with lookup starting at the current context. index()
|
1194
|
+
// is invalid.
|
1195
|
+
LOOKUP
|
1196
|
+
};
|
1197
|
+
|
1198
|
+
Slot(Variable* var, Type type, int index)
|
1199
|
+
: var_(var), type_(type), index_(index) {
|
1200
|
+
ASSERT(var != NULL);
|
1201
|
+
}
|
1202
|
+
|
1203
|
+
virtual void Accept(AstVisitor* v);
|
1204
|
+
|
1205
|
+
virtual Slot* AsSlot() { return this; }
|
1206
|
+
|
1207
|
+
bool IsStackAllocated() { return type_ == PARAMETER || type_ == LOCAL; }
|
1208
|
+
|
1209
|
+
// Accessors
|
1210
|
+
Variable* var() const { return var_; }
|
1211
|
+
Type type() const { return type_; }
|
1212
|
+
int index() const { return index_; }
|
1213
|
+
bool is_arguments() const { return var_->is_arguments(); }
|
1214
|
+
|
1215
|
+
private:
|
1216
|
+
Variable* var_;
|
1217
|
+
Type type_;
|
1218
|
+
int index_;
|
1219
|
+
};
|
1220
|
+
|
1221
|
+
|
1222
|
+
class Property: public Expression {
|
1223
|
+
public:
|
1224
|
+
// Synthetic properties are property lookups introduced by the system,
|
1225
|
+
// to objects that aren't visible to the user. Function calls to synthetic
|
1226
|
+
// properties should use the global object as receiver, not the base object
|
1227
|
+
// of the resolved Reference.
|
1228
|
+
enum Type { NORMAL, SYNTHETIC };
|
1229
|
+
Property(Expression* obj, Expression* key, int pos, Type type = NORMAL)
|
1230
|
+
: obj_(obj),
|
1231
|
+
key_(key),
|
1232
|
+
pos_(pos),
|
1233
|
+
type_(type),
|
1234
|
+
receiver_types_(NULL),
|
1235
|
+
is_monomorphic_(false),
|
1236
|
+
is_array_length_(false),
|
1237
|
+
is_string_length_(false),
|
1238
|
+
is_string_access_(false),
|
1239
|
+
is_function_prototype_(false),
|
1240
|
+
is_arguments_access_(false) { }
|
1241
|
+
|
1242
|
+
DECLARE_NODE_TYPE(Property)
|
1243
|
+
|
1244
|
+
virtual bool IsValidLeftHandSide() { return true; }
|
1245
|
+
virtual bool IsInlineable() const;
|
1246
|
+
|
1247
|
+
Expression* obj() const { return obj_; }
|
1248
|
+
Expression* key() const { return key_; }
|
1249
|
+
int position() const { return pos_; }
|
1250
|
+
bool is_synthetic() const { return type_ == SYNTHETIC; }
|
1251
|
+
|
1252
|
+
bool IsStringLength() const { return is_string_length_; }
|
1253
|
+
bool IsStringAccess() const { return is_string_access_; }
|
1254
|
+
bool IsFunctionPrototype() const { return is_function_prototype_; }
|
1255
|
+
|
1256
|
+
// Marks that this is actually an argument rewritten to a keyed property
|
1257
|
+
// accessing the argument through the arguments shadow object.
|
1258
|
+
void set_is_arguments_access(bool is_arguments_access) {
|
1259
|
+
is_arguments_access_ = is_arguments_access;
|
1260
|
+
}
|
1261
|
+
bool is_arguments_access() const { return is_arguments_access_; }
|
1262
|
+
|
1263
|
+
ExternalArrayType GetExternalArrayType() const { return array_type_; }
|
1264
|
+
void SetExternalArrayType(ExternalArrayType array_type) {
|
1265
|
+
array_type_ = array_type;
|
1266
|
+
}
|
1267
|
+
|
1268
|
+
// Type feedback information.
|
1269
|
+
void RecordTypeFeedback(TypeFeedbackOracle* oracle);
|
1270
|
+
virtual bool IsMonomorphic() { return is_monomorphic_; }
|
1271
|
+
virtual ZoneMapList* GetReceiverTypes() { return receiver_types_; }
|
1272
|
+
virtual bool IsArrayLength() { return is_array_length_; }
|
1273
|
+
virtual Handle<Map> GetMonomorphicReceiverType() {
|
1274
|
+
return monomorphic_receiver_type_;
|
1275
|
+
}
|
1276
|
+
|
1277
|
+
private:
|
1278
|
+
Expression* obj_;
|
1279
|
+
Expression* key_;
|
1280
|
+
int pos_;
|
1281
|
+
Type type_;
|
1282
|
+
|
1283
|
+
ZoneMapList* receiver_types_;
|
1284
|
+
bool is_monomorphic_ : 1;
|
1285
|
+
bool is_array_length_ : 1;
|
1286
|
+
bool is_string_length_ : 1;
|
1287
|
+
bool is_string_access_ : 1;
|
1288
|
+
bool is_function_prototype_ : 1;
|
1289
|
+
bool is_arguments_access_ : 1;
|
1290
|
+
Handle<Map> monomorphic_receiver_type_;
|
1291
|
+
ExternalArrayType array_type_;
|
1292
|
+
};
|
1293
|
+
|
1294
|
+
|
1295
|
+
class Call: public Expression {
|
1296
|
+
public:
|
1297
|
+
Call(Expression* expression, ZoneList<Expression*>* arguments, int pos)
|
1298
|
+
: expression_(expression),
|
1299
|
+
arguments_(arguments),
|
1300
|
+
pos_(pos),
|
1301
|
+
is_monomorphic_(false),
|
1302
|
+
check_type_(RECEIVER_MAP_CHECK),
|
1303
|
+
receiver_types_(NULL),
|
1304
|
+
return_id_(GetNextId()) {
|
1305
|
+
}
|
1306
|
+
|
1307
|
+
DECLARE_NODE_TYPE(Call)
|
1308
|
+
|
1309
|
+
virtual bool IsInlineable() const;
|
1310
|
+
|
1311
|
+
Expression* expression() const { return expression_; }
|
1312
|
+
ZoneList<Expression*>* arguments() const { return arguments_; }
|
1313
|
+
int position() { return pos_; }
|
1314
|
+
|
1315
|
+
void RecordTypeFeedback(TypeFeedbackOracle* oracle);
|
1316
|
+
virtual ZoneMapList* GetReceiverTypes() { return receiver_types_; }
|
1317
|
+
virtual bool IsMonomorphic() { return is_monomorphic_; }
|
1318
|
+
CheckType check_type() const { return check_type_; }
|
1319
|
+
Handle<JSFunction> target() { return target_; }
|
1320
|
+
Handle<JSObject> holder() { return holder_; }
|
1321
|
+
Handle<JSGlobalPropertyCell> cell() { return cell_; }
|
1322
|
+
|
1323
|
+
bool ComputeTarget(Handle<Map> type, Handle<String> name);
|
1324
|
+
bool ComputeGlobalTarget(Handle<GlobalObject> global, LookupResult* lookup);
|
1325
|
+
|
1326
|
+
// Bailout support.
|
1327
|
+
int ReturnId() const { return return_id_; }
|
1328
|
+
|
1329
|
+
#ifdef DEBUG
|
1330
|
+
// Used to assert that the FullCodeGenerator records the return site.
|
1331
|
+
bool return_is_recorded_;
|
1332
|
+
#endif
|
1333
|
+
|
1334
|
+
private:
|
1335
|
+
Expression* expression_;
|
1336
|
+
ZoneList<Expression*>* arguments_;
|
1337
|
+
int pos_;
|
1338
|
+
|
1339
|
+
bool is_monomorphic_;
|
1340
|
+
CheckType check_type_;
|
1341
|
+
ZoneMapList* receiver_types_;
|
1342
|
+
Handle<JSFunction> target_;
|
1343
|
+
Handle<JSObject> holder_;
|
1344
|
+
Handle<JSGlobalPropertyCell> cell_;
|
1345
|
+
|
1346
|
+
int return_id_;
|
1347
|
+
};
|
1348
|
+
|
1349
|
+
|
1350
|
+
class AstSentinels {
|
1351
|
+
public:
|
1352
|
+
~AstSentinels() { }
|
1353
|
+
|
1354
|
+
// Returns a property singleton property access on 'this'. Used
|
1355
|
+
// during preparsing.
|
1356
|
+
Property* this_property() { return &this_property_; }
|
1357
|
+
VariableProxySentinel* this_proxy() { return &this_proxy_; }
|
1358
|
+
VariableProxySentinel* identifier_proxy() { return &identifier_proxy_; }
|
1359
|
+
ValidLeftHandSideSentinel* valid_left_hand_side_sentinel() {
|
1360
|
+
return &valid_left_hand_side_sentinel_;
|
1361
|
+
}
|
1362
|
+
Call* call_sentinel() { return &call_sentinel_; }
|
1363
|
+
EmptyStatement* empty_statement() { return &empty_statement_; }
|
1364
|
+
|
1365
|
+
private:
|
1366
|
+
AstSentinels();
|
1367
|
+
VariableProxySentinel this_proxy_;
|
1368
|
+
VariableProxySentinel identifier_proxy_;
|
1369
|
+
ValidLeftHandSideSentinel valid_left_hand_side_sentinel_;
|
1370
|
+
Property this_property_;
|
1371
|
+
Call call_sentinel_;
|
1372
|
+
EmptyStatement empty_statement_;
|
1373
|
+
|
1374
|
+
friend class Isolate;
|
1375
|
+
|
1376
|
+
DISALLOW_COPY_AND_ASSIGN(AstSentinels);
|
1377
|
+
};
|
1378
|
+
|
1379
|
+
|
1380
|
+
class CallNew: public Expression {
|
1381
|
+
public:
|
1382
|
+
CallNew(Expression* expression, ZoneList<Expression*>* arguments, int pos)
|
1383
|
+
: expression_(expression), arguments_(arguments), pos_(pos) { }
|
1384
|
+
|
1385
|
+
DECLARE_NODE_TYPE(CallNew)
|
1386
|
+
|
1387
|
+
virtual bool IsInlineable() const;
|
1388
|
+
|
1389
|
+
Expression* expression() const { return expression_; }
|
1390
|
+
ZoneList<Expression*>* arguments() const { return arguments_; }
|
1391
|
+
int position() { return pos_; }
|
1392
|
+
|
1393
|
+
private:
|
1394
|
+
Expression* expression_;
|
1395
|
+
ZoneList<Expression*>* arguments_;
|
1396
|
+
int pos_;
|
1397
|
+
};
|
1398
|
+
|
1399
|
+
|
1400
|
+
// The CallRuntime class does not represent any official JavaScript
|
1401
|
+
// language construct. Instead it is used to call a C or JS function
|
1402
|
+
// with a set of arguments. This is used from the builtins that are
|
1403
|
+
// implemented in JavaScript (see "v8natives.js").
|
1404
|
+
class CallRuntime: public Expression {
|
1405
|
+
public:
|
1406
|
+
CallRuntime(Handle<String> name,
|
1407
|
+
const Runtime::Function* function,
|
1408
|
+
ZoneList<Expression*>* arguments)
|
1409
|
+
: name_(name), function_(function), arguments_(arguments) { }
|
1410
|
+
|
1411
|
+
DECLARE_NODE_TYPE(CallRuntime)
|
1412
|
+
|
1413
|
+
virtual bool IsInlineable() const;
|
1414
|
+
|
1415
|
+
Handle<String> name() const { return name_; }
|
1416
|
+
const Runtime::Function* function() const { return function_; }
|
1417
|
+
ZoneList<Expression*>* arguments() const { return arguments_; }
|
1418
|
+
bool is_jsruntime() const { return function_ == NULL; }
|
1419
|
+
|
1420
|
+
private:
|
1421
|
+
Handle<String> name_;
|
1422
|
+
const Runtime::Function* function_;
|
1423
|
+
ZoneList<Expression*>* arguments_;
|
1424
|
+
};
|
1425
|
+
|
1426
|
+
|
1427
|
+
class UnaryOperation: public Expression {
|
1428
|
+
public:
|
1429
|
+
UnaryOperation(Token::Value op, Expression* expression)
|
1430
|
+
: op_(op), expression_(expression) {
|
1431
|
+
ASSERT(Token::IsUnaryOp(op));
|
1432
|
+
}
|
1433
|
+
|
1434
|
+
DECLARE_NODE_TYPE(UnaryOperation)
|
1435
|
+
|
1436
|
+
virtual bool IsInlineable() const;
|
1437
|
+
|
1438
|
+
virtual bool ResultOverwriteAllowed();
|
1439
|
+
|
1440
|
+
Token::Value op() const { return op_; }
|
1441
|
+
Expression* expression() const { return expression_; }
|
1442
|
+
|
1443
|
+
private:
|
1444
|
+
Token::Value op_;
|
1445
|
+
Expression* expression_;
|
1446
|
+
};
|
1447
|
+
|
1448
|
+
|
1449
|
+
class BinaryOperation: public Expression {
|
1450
|
+
public:
|
1451
|
+
BinaryOperation(Token::Value op,
|
1452
|
+
Expression* left,
|
1453
|
+
Expression* right,
|
1454
|
+
int pos)
|
1455
|
+
: op_(op), left_(left), right_(right), pos_(pos) {
|
1456
|
+
ASSERT(Token::IsBinaryOp(op));
|
1457
|
+
right_id_ = (op == Token::AND || op == Token::OR)
|
1458
|
+
? static_cast<int>(GetNextId())
|
1459
|
+
: AstNode::kNoNumber;
|
1460
|
+
}
|
1461
|
+
|
1462
|
+
// Create the binary operation corresponding to a compound assignment.
|
1463
|
+
explicit BinaryOperation(Assignment* assignment);
|
1464
|
+
|
1465
|
+
DECLARE_NODE_TYPE(BinaryOperation)
|
1466
|
+
|
1467
|
+
virtual bool IsInlineable() const;
|
1468
|
+
|
1469
|
+
virtual bool ResultOverwriteAllowed();
|
1470
|
+
|
1471
|
+
Token::Value op() const { return op_; }
|
1472
|
+
Expression* left() const { return left_; }
|
1473
|
+
Expression* right() const { return right_; }
|
1474
|
+
int position() const { return pos_; }
|
1475
|
+
|
1476
|
+
// Bailout support.
|
1477
|
+
int RightId() const { return right_id_; }
|
1478
|
+
|
1479
|
+
private:
|
1480
|
+
Token::Value op_;
|
1481
|
+
Expression* left_;
|
1482
|
+
Expression* right_;
|
1483
|
+
int pos_;
|
1484
|
+
// The short-circuit logical operations have an AST ID for their
|
1485
|
+
// right-hand subexpression.
|
1486
|
+
int right_id_;
|
1487
|
+
};
|
1488
|
+
|
1489
|
+
|
1490
|
+
class IncrementOperation: public Expression {
|
1491
|
+
public:
|
1492
|
+
IncrementOperation(Token::Value op, Expression* expr)
|
1493
|
+
: op_(op), expression_(expr) {
|
1494
|
+
ASSERT(Token::IsCountOp(op));
|
1495
|
+
}
|
1496
|
+
|
1497
|
+
DECLARE_NODE_TYPE(IncrementOperation)
|
1498
|
+
|
1499
|
+
Token::Value op() const { return op_; }
|
1500
|
+
bool is_increment() { return op_ == Token::INC; }
|
1501
|
+
Expression* expression() const { return expression_; }
|
1502
|
+
|
1503
|
+
private:
|
1504
|
+
Token::Value op_;
|
1505
|
+
Expression* expression_;
|
1506
|
+
int pos_;
|
1507
|
+
};
|
1508
|
+
|
1509
|
+
|
1510
|
+
class CountOperation: public Expression {
|
1511
|
+
public:
|
1512
|
+
CountOperation(bool is_prefix, IncrementOperation* increment, int pos)
|
1513
|
+
: is_prefix_(is_prefix), increment_(increment), pos_(pos),
|
1514
|
+
assignment_id_(GetNextId()) {
|
1515
|
+
}
|
1516
|
+
|
1517
|
+
DECLARE_NODE_TYPE(CountOperation)
|
1518
|
+
|
1519
|
+
bool is_prefix() const { return is_prefix_; }
|
1520
|
+
bool is_postfix() const { return !is_prefix_; }
|
1521
|
+
|
1522
|
+
Token::Value op() const { return increment_->op(); }
|
1523
|
+
Token::Value binary_op() {
|
1524
|
+
return (op() == Token::INC) ? Token::ADD : Token::SUB;
|
1525
|
+
}
|
1526
|
+
|
1527
|
+
Expression* expression() const { return increment_->expression(); }
|
1528
|
+
IncrementOperation* increment() const { return increment_; }
|
1529
|
+
int position() const { return pos_; }
|
1530
|
+
|
1531
|
+
virtual void MarkAsStatement() { is_prefix_ = true; }
|
1532
|
+
|
1533
|
+
virtual bool IsInlineable() const;
|
1534
|
+
|
1535
|
+
// Bailout support.
|
1536
|
+
int AssignmentId() const { return assignment_id_; }
|
1537
|
+
|
1538
|
+
private:
|
1539
|
+
bool is_prefix_;
|
1540
|
+
IncrementOperation* increment_;
|
1541
|
+
int pos_;
|
1542
|
+
int assignment_id_;
|
1543
|
+
};
|
1544
|
+
|
1545
|
+
|
1546
|
+
class CompareOperation: public Expression {
|
1547
|
+
public:
|
1548
|
+
CompareOperation(Token::Value op,
|
1549
|
+
Expression* left,
|
1550
|
+
Expression* right,
|
1551
|
+
int pos)
|
1552
|
+
: op_(op), left_(left), right_(right), pos_(pos), compare_type_(NONE) {
|
1553
|
+
ASSERT(Token::IsCompareOp(op));
|
1554
|
+
}
|
1555
|
+
|
1556
|
+
DECLARE_NODE_TYPE(CompareOperation)
|
1557
|
+
|
1558
|
+
Token::Value op() const { return op_; }
|
1559
|
+
Expression* left() const { return left_; }
|
1560
|
+
Expression* right() const { return right_; }
|
1561
|
+
int position() const { return pos_; }
|
1562
|
+
|
1563
|
+
virtual bool IsInlineable() const;
|
1564
|
+
|
1565
|
+
// Type feedback information.
|
1566
|
+
void RecordTypeFeedback(TypeFeedbackOracle* oracle);
|
1567
|
+
bool IsSmiCompare() { return compare_type_ == SMI_ONLY; }
|
1568
|
+
bool IsObjectCompare() { return compare_type_ == OBJECT_ONLY; }
|
1569
|
+
|
1570
|
+
private:
|
1571
|
+
Token::Value op_;
|
1572
|
+
Expression* left_;
|
1573
|
+
Expression* right_;
|
1574
|
+
int pos_;
|
1575
|
+
|
1576
|
+
enum CompareTypeFeedback { NONE, SMI_ONLY, OBJECT_ONLY };
|
1577
|
+
CompareTypeFeedback compare_type_;
|
1578
|
+
};
|
1579
|
+
|
1580
|
+
|
1581
|
+
class CompareToNull: public Expression {
|
1582
|
+
public:
|
1583
|
+
CompareToNull(bool is_strict, Expression* expression)
|
1584
|
+
: is_strict_(is_strict), expression_(expression) { }
|
1585
|
+
|
1586
|
+
DECLARE_NODE_TYPE(CompareToNull)
|
1587
|
+
|
1588
|
+
virtual bool IsInlineable() const;
|
1589
|
+
|
1590
|
+
bool is_strict() const { return is_strict_; }
|
1591
|
+
Token::Value op() const { return is_strict_ ? Token::EQ_STRICT : Token::EQ; }
|
1592
|
+
Expression* expression() const { return expression_; }
|
1593
|
+
|
1594
|
+
private:
|
1595
|
+
bool is_strict_;
|
1596
|
+
Expression* expression_;
|
1597
|
+
};
|
1598
|
+
|
1599
|
+
|
1600
|
+
class Conditional: public Expression {
|
1601
|
+
public:
|
1602
|
+
Conditional(Expression* condition,
|
1603
|
+
Expression* then_expression,
|
1604
|
+
Expression* else_expression,
|
1605
|
+
int then_expression_position,
|
1606
|
+
int else_expression_position)
|
1607
|
+
: condition_(condition),
|
1608
|
+
then_expression_(then_expression),
|
1609
|
+
else_expression_(else_expression),
|
1610
|
+
then_expression_position_(then_expression_position),
|
1611
|
+
else_expression_position_(else_expression_position),
|
1612
|
+
then_id_(GetNextId()),
|
1613
|
+
else_id_(GetNextId()) {
|
1614
|
+
}
|
1615
|
+
|
1616
|
+
DECLARE_NODE_TYPE(Conditional)
|
1617
|
+
|
1618
|
+
virtual bool IsInlineable() const;
|
1619
|
+
|
1620
|
+
Expression* condition() const { return condition_; }
|
1621
|
+
Expression* then_expression() const { return then_expression_; }
|
1622
|
+
Expression* else_expression() const { return else_expression_; }
|
1623
|
+
|
1624
|
+
int then_expression_position() const { return then_expression_position_; }
|
1625
|
+
int else_expression_position() const { return else_expression_position_; }
|
1626
|
+
|
1627
|
+
int ThenId() const { return then_id_; }
|
1628
|
+
int ElseId() const { return else_id_; }
|
1629
|
+
|
1630
|
+
private:
|
1631
|
+
Expression* condition_;
|
1632
|
+
Expression* then_expression_;
|
1633
|
+
Expression* else_expression_;
|
1634
|
+
int then_expression_position_;
|
1635
|
+
int else_expression_position_;
|
1636
|
+
int then_id_;
|
1637
|
+
int else_id_;
|
1638
|
+
};
|
1639
|
+
|
1640
|
+
|
1641
|
+
class Assignment: public Expression {
|
1642
|
+
public:
|
1643
|
+
Assignment(Token::Value op, Expression* target, Expression* value, int pos);
|
1644
|
+
|
1645
|
+
DECLARE_NODE_TYPE(Assignment)
|
1646
|
+
|
1647
|
+
virtual bool IsInlineable() const;
|
1648
|
+
|
1649
|
+
Assignment* AsSimpleAssignment() { return !is_compound() ? this : NULL; }
|
1650
|
+
|
1651
|
+
Token::Value binary_op() const;
|
1652
|
+
|
1653
|
+
Token::Value op() const { return op_; }
|
1654
|
+
Expression* target() const { return target_; }
|
1655
|
+
Expression* value() const { return value_; }
|
1656
|
+
int position() { return pos_; }
|
1657
|
+
BinaryOperation* binary_operation() const { return binary_operation_; }
|
1658
|
+
|
1659
|
+
// This check relies on the definition order of token in token.h.
|
1660
|
+
bool is_compound() const { return op() > Token::ASSIGN; }
|
1661
|
+
|
1662
|
+
// An initialization block is a series of statments of the form
|
1663
|
+
// x.y.z.a = ...; x.y.z.b = ...; etc. The parser marks the beginning and
|
1664
|
+
// ending of these blocks to allow for optimizations of initialization
|
1665
|
+
// blocks.
|
1666
|
+
bool starts_initialization_block() { return block_start_; }
|
1667
|
+
bool ends_initialization_block() { return block_end_; }
|
1668
|
+
void mark_block_start() { block_start_ = true; }
|
1669
|
+
void mark_block_end() { block_end_ = true; }
|
1670
|
+
|
1671
|
+
// Type feedback information.
|
1672
|
+
void RecordTypeFeedback(TypeFeedbackOracle* oracle);
|
1673
|
+
virtual bool IsMonomorphic() { return is_monomorphic_; }
|
1674
|
+
virtual ZoneMapList* GetReceiverTypes() { return receiver_types_; }
|
1675
|
+
virtual Handle<Map> GetMonomorphicReceiverType() {
|
1676
|
+
return monomorphic_receiver_type_;
|
1677
|
+
}
|
1678
|
+
ExternalArrayType GetExternalArrayType() const { return array_type_; }
|
1679
|
+
void SetExternalArrayType(ExternalArrayType array_type) {
|
1680
|
+
array_type_ = array_type;
|
1681
|
+
}
|
1682
|
+
|
1683
|
+
// Bailout support.
|
1684
|
+
int CompoundLoadId() const { return compound_load_id_; }
|
1685
|
+
int AssignmentId() const { return assignment_id_; }
|
1686
|
+
|
1687
|
+
private:
|
1688
|
+
Token::Value op_;
|
1689
|
+
Expression* target_;
|
1690
|
+
Expression* value_;
|
1691
|
+
int pos_;
|
1692
|
+
BinaryOperation* binary_operation_;
|
1693
|
+
int compound_load_id_;
|
1694
|
+
int assignment_id_;
|
1695
|
+
|
1696
|
+
bool block_start_;
|
1697
|
+
bool block_end_;
|
1698
|
+
|
1699
|
+
bool is_monomorphic_;
|
1700
|
+
ZoneMapList* receiver_types_;
|
1701
|
+
Handle<Map> monomorphic_receiver_type_;
|
1702
|
+
ExternalArrayType array_type_;
|
1703
|
+
};
|
1704
|
+
|
1705
|
+
|
1706
|
+
class Throw: public Expression {
|
1707
|
+
public:
|
1708
|
+
Throw(Expression* exception, int pos)
|
1709
|
+
: exception_(exception), pos_(pos) {}
|
1710
|
+
|
1711
|
+
DECLARE_NODE_TYPE(Throw)
|
1712
|
+
|
1713
|
+
Expression* exception() const { return exception_; }
|
1714
|
+
int position() const { return pos_; }
|
1715
|
+
|
1716
|
+
private:
|
1717
|
+
Expression* exception_;
|
1718
|
+
int pos_;
|
1719
|
+
};
|
1720
|
+
|
1721
|
+
|
1722
|
+
class FunctionLiteral: public Expression {
|
1723
|
+
public:
|
1724
|
+
FunctionLiteral(Handle<String> name,
|
1725
|
+
Scope* scope,
|
1726
|
+
ZoneList<Statement*>* body,
|
1727
|
+
int materialized_literal_count,
|
1728
|
+
int expected_property_count,
|
1729
|
+
bool has_only_simple_this_property_assignments,
|
1730
|
+
Handle<FixedArray> this_property_assignments,
|
1731
|
+
int num_parameters,
|
1732
|
+
int start_position,
|
1733
|
+
int end_position,
|
1734
|
+
bool is_expression,
|
1735
|
+
bool contains_loops)
|
1736
|
+
: name_(name),
|
1737
|
+
scope_(scope),
|
1738
|
+
body_(body),
|
1739
|
+
materialized_literal_count_(materialized_literal_count),
|
1740
|
+
expected_property_count_(expected_property_count),
|
1741
|
+
has_only_simple_this_property_assignments_(
|
1742
|
+
has_only_simple_this_property_assignments),
|
1743
|
+
this_property_assignments_(this_property_assignments),
|
1744
|
+
num_parameters_(num_parameters),
|
1745
|
+
start_position_(start_position),
|
1746
|
+
end_position_(end_position),
|
1747
|
+
is_expression_(is_expression),
|
1748
|
+
contains_loops_(contains_loops),
|
1749
|
+
function_token_position_(RelocInfo::kNoPosition),
|
1750
|
+
inferred_name_(HEAP->empty_string()),
|
1751
|
+
pretenure_(false) { }
|
1752
|
+
|
1753
|
+
DECLARE_NODE_TYPE(FunctionLiteral)
|
1754
|
+
|
1755
|
+
Handle<String> name() const { return name_; }
|
1756
|
+
Scope* scope() const { return scope_; }
|
1757
|
+
ZoneList<Statement*>* body() const { return body_; }
|
1758
|
+
void set_function_token_position(int pos) { function_token_position_ = pos; }
|
1759
|
+
int function_token_position() const { return function_token_position_; }
|
1760
|
+
int start_position() const { return start_position_; }
|
1761
|
+
int end_position() const { return end_position_; }
|
1762
|
+
bool is_expression() const { return is_expression_; }
|
1763
|
+
bool contains_loops() const { return contains_loops_; }
|
1764
|
+
bool strict_mode() const;
|
1765
|
+
|
1766
|
+
int materialized_literal_count() { return materialized_literal_count_; }
|
1767
|
+
int expected_property_count() { return expected_property_count_; }
|
1768
|
+
bool has_only_simple_this_property_assignments() {
|
1769
|
+
return has_only_simple_this_property_assignments_;
|
1770
|
+
}
|
1771
|
+
Handle<FixedArray> this_property_assignments() {
|
1772
|
+
return this_property_assignments_;
|
1773
|
+
}
|
1774
|
+
int num_parameters() { return num_parameters_; }
|
1775
|
+
|
1776
|
+
bool AllowsLazyCompilation();
|
1777
|
+
|
1778
|
+
Handle<String> debug_name() const {
|
1779
|
+
if (name_->length() > 0) return name_;
|
1780
|
+
return inferred_name();
|
1781
|
+
}
|
1782
|
+
|
1783
|
+
Handle<String> inferred_name() const { return inferred_name_; }
|
1784
|
+
void set_inferred_name(Handle<String> inferred_name) {
|
1785
|
+
inferred_name_ = inferred_name;
|
1786
|
+
}
|
1787
|
+
|
1788
|
+
bool pretenure() { return pretenure_; }
|
1789
|
+
void set_pretenure(bool value) { pretenure_ = value; }
|
1790
|
+
|
1791
|
+
private:
|
1792
|
+
Handle<String> name_;
|
1793
|
+
Scope* scope_;
|
1794
|
+
ZoneList<Statement*>* body_;
|
1795
|
+
int materialized_literal_count_;
|
1796
|
+
int expected_property_count_;
|
1797
|
+
bool has_only_simple_this_property_assignments_;
|
1798
|
+
Handle<FixedArray> this_property_assignments_;
|
1799
|
+
int num_parameters_;
|
1800
|
+
int start_position_;
|
1801
|
+
int end_position_;
|
1802
|
+
bool is_expression_;
|
1803
|
+
bool contains_loops_;
|
1804
|
+
bool strict_mode_;
|
1805
|
+
int function_token_position_;
|
1806
|
+
Handle<String> inferred_name_;
|
1807
|
+
bool pretenure_;
|
1808
|
+
};
|
1809
|
+
|
1810
|
+
|
1811
|
+
class SharedFunctionInfoLiteral: public Expression {
|
1812
|
+
public:
|
1813
|
+
explicit SharedFunctionInfoLiteral(
|
1814
|
+
Handle<SharedFunctionInfo> shared_function_info)
|
1815
|
+
: shared_function_info_(shared_function_info) { }
|
1816
|
+
|
1817
|
+
DECLARE_NODE_TYPE(SharedFunctionInfoLiteral)
|
1818
|
+
|
1819
|
+
Handle<SharedFunctionInfo> shared_function_info() const {
|
1820
|
+
return shared_function_info_;
|
1821
|
+
}
|
1822
|
+
|
1823
|
+
private:
|
1824
|
+
Handle<SharedFunctionInfo> shared_function_info_;
|
1825
|
+
};
|
1826
|
+
|
1827
|
+
|
1828
|
+
class ThisFunction: public Expression {
|
1829
|
+
public:
|
1830
|
+
DECLARE_NODE_TYPE(ThisFunction)
|
1831
|
+
};
|
1832
|
+
|
1833
|
+
|
1834
|
+
// ----------------------------------------------------------------------------
|
1835
|
+
// Regular expressions
|
1836
|
+
|
1837
|
+
|
1838
|
+
class RegExpVisitor BASE_EMBEDDED {
|
1839
|
+
public:
|
1840
|
+
virtual ~RegExpVisitor() { }
|
1841
|
+
#define MAKE_CASE(Name) \
|
1842
|
+
virtual void* Visit##Name(RegExp##Name*, void* data) = 0;
|
1843
|
+
FOR_EACH_REG_EXP_TREE_TYPE(MAKE_CASE)
|
1844
|
+
#undef MAKE_CASE
|
1845
|
+
};
|
1846
|
+
|
1847
|
+
|
1848
|
+
class RegExpTree: public ZoneObject {
|
1849
|
+
public:
|
1850
|
+
static const int kInfinity = kMaxInt;
|
1851
|
+
virtual ~RegExpTree() { }
|
1852
|
+
virtual void* Accept(RegExpVisitor* visitor, void* data) = 0;
|
1853
|
+
virtual RegExpNode* ToNode(RegExpCompiler* compiler,
|
1854
|
+
RegExpNode* on_success) = 0;
|
1855
|
+
virtual bool IsTextElement() { return false; }
|
1856
|
+
virtual bool IsAnchoredAtStart() { return false; }
|
1857
|
+
virtual bool IsAnchoredAtEnd() { return false; }
|
1858
|
+
virtual int min_match() = 0;
|
1859
|
+
virtual int max_match() = 0;
|
1860
|
+
// Returns the interval of registers used for captures within this
|
1861
|
+
// expression.
|
1862
|
+
virtual Interval CaptureRegisters() { return Interval::Empty(); }
|
1863
|
+
virtual void AppendToText(RegExpText* text);
|
1864
|
+
SmartPointer<const char> ToString();
|
1865
|
+
#define MAKE_ASTYPE(Name) \
|
1866
|
+
virtual RegExp##Name* As##Name(); \
|
1867
|
+
virtual bool Is##Name();
|
1868
|
+
FOR_EACH_REG_EXP_TREE_TYPE(MAKE_ASTYPE)
|
1869
|
+
#undef MAKE_ASTYPE
|
1870
|
+
};
|
1871
|
+
|
1872
|
+
|
1873
|
+
class RegExpDisjunction: public RegExpTree {
|
1874
|
+
public:
|
1875
|
+
explicit RegExpDisjunction(ZoneList<RegExpTree*>* alternatives);
|
1876
|
+
virtual void* Accept(RegExpVisitor* visitor, void* data);
|
1877
|
+
virtual RegExpNode* ToNode(RegExpCompiler* compiler,
|
1878
|
+
RegExpNode* on_success);
|
1879
|
+
virtual RegExpDisjunction* AsDisjunction();
|
1880
|
+
virtual Interval CaptureRegisters();
|
1881
|
+
virtual bool IsDisjunction();
|
1882
|
+
virtual bool IsAnchoredAtStart();
|
1883
|
+
virtual bool IsAnchoredAtEnd();
|
1884
|
+
virtual int min_match() { return min_match_; }
|
1885
|
+
virtual int max_match() { return max_match_; }
|
1886
|
+
ZoneList<RegExpTree*>* alternatives() { return alternatives_; }
|
1887
|
+
private:
|
1888
|
+
ZoneList<RegExpTree*>* alternatives_;
|
1889
|
+
int min_match_;
|
1890
|
+
int max_match_;
|
1891
|
+
};
|
1892
|
+
|
1893
|
+
|
1894
|
+
class RegExpAlternative: public RegExpTree {
|
1895
|
+
public:
|
1896
|
+
explicit RegExpAlternative(ZoneList<RegExpTree*>* nodes);
|
1897
|
+
virtual void* Accept(RegExpVisitor* visitor, void* data);
|
1898
|
+
virtual RegExpNode* ToNode(RegExpCompiler* compiler,
|
1899
|
+
RegExpNode* on_success);
|
1900
|
+
virtual RegExpAlternative* AsAlternative();
|
1901
|
+
virtual Interval CaptureRegisters();
|
1902
|
+
virtual bool IsAlternative();
|
1903
|
+
virtual bool IsAnchoredAtStart();
|
1904
|
+
virtual bool IsAnchoredAtEnd();
|
1905
|
+
virtual int min_match() { return min_match_; }
|
1906
|
+
virtual int max_match() { return max_match_; }
|
1907
|
+
ZoneList<RegExpTree*>* nodes() { return nodes_; }
|
1908
|
+
private:
|
1909
|
+
ZoneList<RegExpTree*>* nodes_;
|
1910
|
+
int min_match_;
|
1911
|
+
int max_match_;
|
1912
|
+
};
|
1913
|
+
|
1914
|
+
|
1915
|
+
class RegExpAssertion: public RegExpTree {
|
1916
|
+
public:
|
1917
|
+
enum Type {
|
1918
|
+
START_OF_LINE,
|
1919
|
+
START_OF_INPUT,
|
1920
|
+
END_OF_LINE,
|
1921
|
+
END_OF_INPUT,
|
1922
|
+
BOUNDARY,
|
1923
|
+
NON_BOUNDARY
|
1924
|
+
};
|
1925
|
+
explicit RegExpAssertion(Type type) : type_(type) { }
|
1926
|
+
virtual void* Accept(RegExpVisitor* visitor, void* data);
|
1927
|
+
virtual RegExpNode* ToNode(RegExpCompiler* compiler,
|
1928
|
+
RegExpNode* on_success);
|
1929
|
+
virtual RegExpAssertion* AsAssertion();
|
1930
|
+
virtual bool IsAssertion();
|
1931
|
+
virtual bool IsAnchoredAtStart();
|
1932
|
+
virtual bool IsAnchoredAtEnd();
|
1933
|
+
virtual int min_match() { return 0; }
|
1934
|
+
virtual int max_match() { return 0; }
|
1935
|
+
Type type() { return type_; }
|
1936
|
+
private:
|
1937
|
+
Type type_;
|
1938
|
+
};
|
1939
|
+
|
1940
|
+
|
1941
|
+
class CharacterSet BASE_EMBEDDED {
|
1942
|
+
public:
|
1943
|
+
explicit CharacterSet(uc16 standard_set_type)
|
1944
|
+
: ranges_(NULL),
|
1945
|
+
standard_set_type_(standard_set_type) {}
|
1946
|
+
explicit CharacterSet(ZoneList<CharacterRange>* ranges)
|
1947
|
+
: ranges_(ranges),
|
1948
|
+
standard_set_type_(0) {}
|
1949
|
+
ZoneList<CharacterRange>* ranges();
|
1950
|
+
uc16 standard_set_type() { return standard_set_type_; }
|
1951
|
+
void set_standard_set_type(uc16 special_set_type) {
|
1952
|
+
standard_set_type_ = special_set_type;
|
1953
|
+
}
|
1954
|
+
bool is_standard() { return standard_set_type_ != 0; }
|
1955
|
+
void Canonicalize();
|
1956
|
+
private:
|
1957
|
+
ZoneList<CharacterRange>* ranges_;
|
1958
|
+
// If non-zero, the value represents a standard set (e.g., all whitespace
|
1959
|
+
// characters) without having to expand the ranges.
|
1960
|
+
uc16 standard_set_type_;
|
1961
|
+
};
|
1962
|
+
|
1963
|
+
|
1964
|
+
class RegExpCharacterClass: public RegExpTree {
|
1965
|
+
public:
|
1966
|
+
RegExpCharacterClass(ZoneList<CharacterRange>* ranges, bool is_negated)
|
1967
|
+
: set_(ranges),
|
1968
|
+
is_negated_(is_negated) { }
|
1969
|
+
explicit RegExpCharacterClass(uc16 type)
|
1970
|
+
: set_(type),
|
1971
|
+
is_negated_(false) { }
|
1972
|
+
virtual void* Accept(RegExpVisitor* visitor, void* data);
|
1973
|
+
virtual RegExpNode* ToNode(RegExpCompiler* compiler,
|
1974
|
+
RegExpNode* on_success);
|
1975
|
+
virtual RegExpCharacterClass* AsCharacterClass();
|
1976
|
+
virtual bool IsCharacterClass();
|
1977
|
+
virtual bool IsTextElement() { return true; }
|
1978
|
+
virtual int min_match() { return 1; }
|
1979
|
+
virtual int max_match() { return 1; }
|
1980
|
+
virtual void AppendToText(RegExpText* text);
|
1981
|
+
CharacterSet character_set() { return set_; }
|
1982
|
+
// TODO(lrn): Remove need for complex version if is_standard that
|
1983
|
+
// recognizes a mangled standard set and just do { return set_.is_special(); }
|
1984
|
+
bool is_standard();
|
1985
|
+
// Returns a value representing the standard character set if is_standard()
|
1986
|
+
// returns true.
|
1987
|
+
// Currently used values are:
|
1988
|
+
// s : unicode whitespace
|
1989
|
+
// S : unicode non-whitespace
|
1990
|
+
// w : ASCII word character (digit, letter, underscore)
|
1991
|
+
// W : non-ASCII word character
|
1992
|
+
// d : ASCII digit
|
1993
|
+
// D : non-ASCII digit
|
1994
|
+
// . : non-unicode non-newline
|
1995
|
+
// * : All characters
|
1996
|
+
uc16 standard_type() { return set_.standard_set_type(); }
|
1997
|
+
ZoneList<CharacterRange>* ranges() { return set_.ranges(); }
|
1998
|
+
bool is_negated() { return is_negated_; }
|
1999
|
+
private:
|
2000
|
+
CharacterSet set_;
|
2001
|
+
bool is_negated_;
|
2002
|
+
};
|
2003
|
+
|
2004
|
+
|
2005
|
+
class RegExpAtom: public RegExpTree {
|
2006
|
+
public:
|
2007
|
+
explicit RegExpAtom(Vector<const uc16> data) : data_(data) { }
|
2008
|
+
virtual void* Accept(RegExpVisitor* visitor, void* data);
|
2009
|
+
virtual RegExpNode* ToNode(RegExpCompiler* compiler,
|
2010
|
+
RegExpNode* on_success);
|
2011
|
+
virtual RegExpAtom* AsAtom();
|
2012
|
+
virtual bool IsAtom();
|
2013
|
+
virtual bool IsTextElement() { return true; }
|
2014
|
+
virtual int min_match() { return data_.length(); }
|
2015
|
+
virtual int max_match() { return data_.length(); }
|
2016
|
+
virtual void AppendToText(RegExpText* text);
|
2017
|
+
Vector<const uc16> data() { return data_; }
|
2018
|
+
int length() { return data_.length(); }
|
2019
|
+
private:
|
2020
|
+
Vector<const uc16> data_;
|
2021
|
+
};
|
2022
|
+
|
2023
|
+
|
2024
|
+
class RegExpText: public RegExpTree {
|
2025
|
+
public:
|
2026
|
+
RegExpText() : elements_(2), length_(0) {}
|
2027
|
+
virtual void* Accept(RegExpVisitor* visitor, void* data);
|
2028
|
+
virtual RegExpNode* ToNode(RegExpCompiler* compiler,
|
2029
|
+
RegExpNode* on_success);
|
2030
|
+
virtual RegExpText* AsText();
|
2031
|
+
virtual bool IsText();
|
2032
|
+
virtual bool IsTextElement() { return true; }
|
2033
|
+
virtual int min_match() { return length_; }
|
2034
|
+
virtual int max_match() { return length_; }
|
2035
|
+
virtual void AppendToText(RegExpText* text);
|
2036
|
+
void AddElement(TextElement elm) {
|
2037
|
+
elements_.Add(elm);
|
2038
|
+
length_ += elm.length();
|
2039
|
+
}
|
2040
|
+
ZoneList<TextElement>* elements() { return &elements_; }
|
2041
|
+
private:
|
2042
|
+
ZoneList<TextElement> elements_;
|
2043
|
+
int length_;
|
2044
|
+
};
|
2045
|
+
|
2046
|
+
|
2047
|
+
class RegExpQuantifier: public RegExpTree {
|
2048
|
+
public:
|
2049
|
+
enum Type { GREEDY, NON_GREEDY, POSSESSIVE };
|
2050
|
+
RegExpQuantifier(int min, int max, Type type, RegExpTree* body)
|
2051
|
+
: body_(body),
|
2052
|
+
min_(min),
|
2053
|
+
max_(max),
|
2054
|
+
min_match_(min * body->min_match()),
|
2055
|
+
type_(type) {
|
2056
|
+
if (max > 0 && body->max_match() > kInfinity / max) {
|
2057
|
+
max_match_ = kInfinity;
|
2058
|
+
} else {
|
2059
|
+
max_match_ = max * body->max_match();
|
2060
|
+
}
|
2061
|
+
}
|
2062
|
+
virtual void* Accept(RegExpVisitor* visitor, void* data);
|
2063
|
+
virtual RegExpNode* ToNode(RegExpCompiler* compiler,
|
2064
|
+
RegExpNode* on_success);
|
2065
|
+
static RegExpNode* ToNode(int min,
|
2066
|
+
int max,
|
2067
|
+
bool is_greedy,
|
2068
|
+
RegExpTree* body,
|
2069
|
+
RegExpCompiler* compiler,
|
2070
|
+
RegExpNode* on_success,
|
2071
|
+
bool not_at_start = false);
|
2072
|
+
virtual RegExpQuantifier* AsQuantifier();
|
2073
|
+
virtual Interval CaptureRegisters();
|
2074
|
+
virtual bool IsQuantifier();
|
2075
|
+
virtual int min_match() { return min_match_; }
|
2076
|
+
virtual int max_match() { return max_match_; }
|
2077
|
+
int min() { return min_; }
|
2078
|
+
int max() { return max_; }
|
2079
|
+
bool is_possessive() { return type_ == POSSESSIVE; }
|
2080
|
+
bool is_non_greedy() { return type_ == NON_GREEDY; }
|
2081
|
+
bool is_greedy() { return type_ == GREEDY; }
|
2082
|
+
RegExpTree* body() { return body_; }
|
2083
|
+
private:
|
2084
|
+
RegExpTree* body_;
|
2085
|
+
int min_;
|
2086
|
+
int max_;
|
2087
|
+
int min_match_;
|
2088
|
+
int max_match_;
|
2089
|
+
Type type_;
|
2090
|
+
};
|
2091
|
+
|
2092
|
+
|
2093
|
+
class RegExpCapture: public RegExpTree {
|
2094
|
+
public:
|
2095
|
+
explicit RegExpCapture(RegExpTree* body, int index)
|
2096
|
+
: body_(body), index_(index) { }
|
2097
|
+
virtual void* Accept(RegExpVisitor* visitor, void* data);
|
2098
|
+
virtual RegExpNode* ToNode(RegExpCompiler* compiler,
|
2099
|
+
RegExpNode* on_success);
|
2100
|
+
static RegExpNode* ToNode(RegExpTree* body,
|
2101
|
+
int index,
|
2102
|
+
RegExpCompiler* compiler,
|
2103
|
+
RegExpNode* on_success);
|
2104
|
+
virtual RegExpCapture* AsCapture();
|
2105
|
+
virtual bool IsAnchoredAtStart();
|
2106
|
+
virtual bool IsAnchoredAtEnd();
|
2107
|
+
virtual Interval CaptureRegisters();
|
2108
|
+
virtual bool IsCapture();
|
2109
|
+
virtual int min_match() { return body_->min_match(); }
|
2110
|
+
virtual int max_match() { return body_->max_match(); }
|
2111
|
+
RegExpTree* body() { return body_; }
|
2112
|
+
int index() { return index_; }
|
2113
|
+
static int StartRegister(int index) { return index * 2; }
|
2114
|
+
static int EndRegister(int index) { return index * 2 + 1; }
|
2115
|
+
private:
|
2116
|
+
RegExpTree* body_;
|
2117
|
+
int index_;
|
2118
|
+
};
|
2119
|
+
|
2120
|
+
|
2121
|
+
class RegExpLookahead: public RegExpTree {
|
2122
|
+
public:
|
2123
|
+
RegExpLookahead(RegExpTree* body,
|
2124
|
+
bool is_positive,
|
2125
|
+
int capture_count,
|
2126
|
+
int capture_from)
|
2127
|
+
: body_(body),
|
2128
|
+
is_positive_(is_positive),
|
2129
|
+
capture_count_(capture_count),
|
2130
|
+
capture_from_(capture_from) { }
|
2131
|
+
|
2132
|
+
virtual void* Accept(RegExpVisitor* visitor, void* data);
|
2133
|
+
virtual RegExpNode* ToNode(RegExpCompiler* compiler,
|
2134
|
+
RegExpNode* on_success);
|
2135
|
+
virtual RegExpLookahead* AsLookahead();
|
2136
|
+
virtual Interval CaptureRegisters();
|
2137
|
+
virtual bool IsLookahead();
|
2138
|
+
virtual bool IsAnchoredAtStart();
|
2139
|
+
virtual int min_match() { return 0; }
|
2140
|
+
virtual int max_match() { return 0; }
|
2141
|
+
RegExpTree* body() { return body_; }
|
2142
|
+
bool is_positive() { return is_positive_; }
|
2143
|
+
int capture_count() { return capture_count_; }
|
2144
|
+
int capture_from() { return capture_from_; }
|
2145
|
+
private:
|
2146
|
+
RegExpTree* body_;
|
2147
|
+
bool is_positive_;
|
2148
|
+
int capture_count_;
|
2149
|
+
int capture_from_;
|
2150
|
+
};
|
2151
|
+
|
2152
|
+
|
2153
|
+
class RegExpBackReference: public RegExpTree {
|
2154
|
+
public:
|
2155
|
+
explicit RegExpBackReference(RegExpCapture* capture)
|
2156
|
+
: capture_(capture) { }
|
2157
|
+
virtual void* Accept(RegExpVisitor* visitor, void* data);
|
2158
|
+
virtual RegExpNode* ToNode(RegExpCompiler* compiler,
|
2159
|
+
RegExpNode* on_success);
|
2160
|
+
virtual RegExpBackReference* AsBackReference();
|
2161
|
+
virtual bool IsBackReference();
|
2162
|
+
virtual int min_match() { return 0; }
|
2163
|
+
virtual int max_match() { return capture_->max_match(); }
|
2164
|
+
int index() { return capture_->index(); }
|
2165
|
+
RegExpCapture* capture() { return capture_; }
|
2166
|
+
private:
|
2167
|
+
RegExpCapture* capture_;
|
2168
|
+
};
|
2169
|
+
|
2170
|
+
|
2171
|
+
class RegExpEmpty: public RegExpTree {
|
2172
|
+
public:
|
2173
|
+
RegExpEmpty() { }
|
2174
|
+
virtual void* Accept(RegExpVisitor* visitor, void* data);
|
2175
|
+
virtual RegExpNode* ToNode(RegExpCompiler* compiler,
|
2176
|
+
RegExpNode* on_success);
|
2177
|
+
virtual RegExpEmpty* AsEmpty();
|
2178
|
+
virtual bool IsEmpty();
|
2179
|
+
virtual int min_match() { return 0; }
|
2180
|
+
virtual int max_match() { return 0; }
|
2181
|
+
static RegExpEmpty* GetInstance() { return &kInstance; }
|
2182
|
+
private:
|
2183
|
+
static RegExpEmpty kInstance;
|
2184
|
+
};
|
2185
|
+
|
2186
|
+
|
2187
|
+
// ----------------------------------------------------------------------------
|
2188
|
+
// Basic visitor
|
2189
|
+
// - leaf node visitors are abstract.
|
2190
|
+
|
2191
|
+
class AstVisitor BASE_EMBEDDED {
|
2192
|
+
public:
|
2193
|
+
AstVisitor() : isolate_(Isolate::Current()), stack_overflow_(false) { }
|
2194
|
+
virtual ~AstVisitor() { }
|
2195
|
+
|
2196
|
+
// Stack overflow check and dynamic dispatch.
|
2197
|
+
void Visit(AstNode* node) { if (!CheckStackOverflow()) node->Accept(this); }
|
2198
|
+
|
2199
|
+
// Iteration left-to-right.
|
2200
|
+
virtual void VisitDeclarations(ZoneList<Declaration*>* declarations);
|
2201
|
+
virtual void VisitStatements(ZoneList<Statement*>* statements);
|
2202
|
+
virtual void VisitExpressions(ZoneList<Expression*>* expressions);
|
2203
|
+
|
2204
|
+
// Stack overflow tracking support.
|
2205
|
+
bool HasStackOverflow() const { return stack_overflow_; }
|
2206
|
+
bool CheckStackOverflow();
|
2207
|
+
|
2208
|
+
// If a stack-overflow exception is encountered when visiting a
|
2209
|
+
// node, calling SetStackOverflow will make sure that the visitor
|
2210
|
+
// bails out without visiting more nodes.
|
2211
|
+
void SetStackOverflow() { stack_overflow_ = true; }
|
2212
|
+
void ClearStackOverflow() { stack_overflow_ = false; }
|
2213
|
+
|
2214
|
+
// Nodes not appearing in the AST, including slots.
|
2215
|
+
virtual void VisitSlot(Slot* node) { UNREACHABLE(); }
|
2216
|
+
|
2217
|
+
// Individual AST nodes.
|
2218
|
+
#define DEF_VISIT(type) \
|
2219
|
+
virtual void Visit##type(type* node) = 0;
|
2220
|
+
AST_NODE_LIST(DEF_VISIT)
|
2221
|
+
#undef DEF_VISIT
|
2222
|
+
|
2223
|
+
protected:
|
2224
|
+
Isolate* isolate() { return isolate_; }
|
2225
|
+
|
2226
|
+
private:
|
2227
|
+
Isolate* isolate_;
|
2228
|
+
bool stack_overflow_;
|
2229
|
+
};
|
2230
|
+
|
2231
|
+
|
2232
|
+
} } // namespace v8::internal
|
2233
|
+
|
2234
|
+
#endif // V8_AST_H_
|