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