therubyracer 0.9.0beta2 → 0.9.0beta3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of therubyracer might be problematic. Click here for more details.
- data/.gitmodules +3 -0
- data/ext/v8/upstream/Makefile +1 -2
- data/ext/v8/upstream/v8/.gitignore +33 -0
- data/ext/v8/upstream/v8/AUTHORS +42 -0
- data/ext/v8/upstream/v8/ChangeLog +2663 -0
- data/ext/v8/upstream/{3.1.8 → v8}/LICENSE +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/LICENSE.strongtalk +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/LICENSE.v8 +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/LICENSE.valgrind +0 -0
- data/ext/v8/upstream/v8/SConstruct +1473 -0
- data/ext/v8/upstream/{3.1.8 → v8}/build/README.txt +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/build/all.gyp +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/build/armu.gypi +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/build/common.gypi +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/build/gyp_v8 +0 -0
- data/ext/v8/upstream/v8/include/v8-debug.h +394 -0
- data/ext/v8/upstream/v8/include/v8-preparser.h +116 -0
- data/ext/v8/upstream/v8/include/v8-profiler.h +505 -0
- data/ext/v8/upstream/v8/include/v8-testing.h +104 -0
- data/ext/v8/upstream/v8/include/v8.h +4000 -0
- data/ext/v8/upstream/{3.1.8 → v8}/include/v8stdint.h +0 -0
- data/ext/v8/upstream/v8/preparser/SConscript +38 -0
- data/ext/v8/upstream/v8/preparser/preparser-process.cc +169 -0
- data/ext/v8/upstream/v8/src/SConscript +380 -0
- data/ext/v8/upstream/v8/src/accessors.cc +766 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/accessors.h +0 -0
- data/ext/v8/upstream/v8/src/allocation-inl.h +49 -0
- data/ext/v8/upstream/v8/src/allocation.cc +122 -0
- data/ext/v8/upstream/v8/src/allocation.h +143 -0
- data/ext/v8/upstream/v8/src/api.cc +5678 -0
- data/ext/v8/upstream/v8/src/api.h +572 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/apinatives.js +0 -0
- data/ext/v8/upstream/v8/src/apiutils.h +73 -0
- data/ext/v8/upstream/v8/src/arguments.h +116 -0
- data/ext/v8/upstream/v8/src/arm/assembler-arm-inl.h +353 -0
- data/ext/v8/upstream/v8/src/arm/assembler-arm.cc +2877 -0
- data/ext/v8/upstream/v8/src/arm/assembler-arm.h +1382 -0
- data/ext/v8/upstream/v8/src/arm/builtins-arm.cc +1634 -0
- data/ext/v8/upstream/v8/src/arm/code-stubs-arm.cc +6917 -0
- data/ext/v8/upstream/v8/src/arm/code-stubs-arm.h +623 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/arm/codegen-arm-inl.h +0 -0
- data/ext/v8/upstream/v8/src/arm/codegen-arm.cc +7437 -0
- data/ext/v8/upstream/v8/src/arm/codegen-arm.h +595 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/arm/constants-arm.cc +0 -0
- data/ext/v8/upstream/v8/src/arm/constants-arm.h +778 -0
- data/ext/v8/upstream/v8/src/arm/cpu-arm.cc +149 -0
- data/ext/v8/upstream/v8/src/arm/debug-arm.cc +317 -0
- data/ext/v8/upstream/v8/src/arm/deoptimizer-arm.cc +737 -0
- data/ext/v8/upstream/v8/src/arm/disasm-arm.cc +1503 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/arm/frames-arm.cc +0 -0
- data/ext/v8/upstream/v8/src/arm/frames-arm.h +168 -0
- data/ext/v8/upstream/v8/src/arm/full-codegen-arm.cc +4374 -0
- data/ext/v8/upstream/v8/src/arm/ic-arm.cc +1793 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/arm/jump-target-arm.cc +0 -0
- data/ext/v8/upstream/v8/src/arm/lithium-arm.cc +2120 -0
- data/ext/v8/upstream/v8/src/arm/lithium-arm.h +2179 -0
- data/ext/v8/upstream/v8/src/arm/lithium-codegen-arm.cc +4132 -0
- data/ext/v8/upstream/v8/src/arm/lithium-codegen-arm.h +329 -0
- data/ext/v8/upstream/v8/src/arm/lithium-gap-resolver-arm.cc +305 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/arm/lithium-gap-resolver-arm.h +0 -0
- data/ext/v8/upstream/v8/src/arm/macro-assembler-arm.cc +2939 -0
- data/ext/v8/upstream/v8/src/arm/macro-assembler-arm.h +1071 -0
- data/ext/v8/upstream/v8/src/arm/regexp-macro-assembler-arm.cc +1287 -0
- data/ext/v8/upstream/v8/src/arm/regexp-macro-assembler-arm.h +253 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/arm/register-allocator-arm-inl.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/arm/register-allocator-arm.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/arm/register-allocator-arm.h +0 -0
- data/ext/v8/upstream/v8/src/arm/simulator-arm.cc +3288 -0
- data/ext/v8/upstream/v8/src/arm/simulator-arm.h +413 -0
- data/ext/v8/upstream/v8/src/arm/stub-cache-arm.cc +4034 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/arm/virtual-frame-arm-inl.h +0 -0
- data/ext/v8/upstream/v8/src/arm/virtual-frame-arm.cc +843 -0
- data/ext/v8/upstream/v8/src/arm/virtual-frame-arm.h +523 -0
- data/ext/v8/upstream/v8/src/array.js +1249 -0
- data/ext/v8/upstream/v8/src/assembler.cc +1067 -0
- data/ext/v8/upstream/v8/src/assembler.h +823 -0
- data/ext/v8/upstream/v8/src/ast-inl.h +112 -0
- data/ext/v8/upstream/v8/src/ast.cc +1078 -0
- data/ext/v8/upstream/v8/src/ast.h +2234 -0
- data/ext/v8/upstream/v8/src/atomicops.h +167 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/atomicops_internals_arm_gcc.h +0 -0
- data/ext/v8/upstream/v8/src/atomicops_internals_mips_gcc.h +169 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/atomicops_internals_x86_gcc.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/atomicops_internals_x86_gcc.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/atomicops_internals_x86_macosx.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/atomicops_internals_x86_msvc.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/bignum-dtoa.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/bignum-dtoa.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/bignum.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/bignum.h +0 -0
- data/ext/v8/upstream/v8/src/bootstrapper.cc +2138 -0
- data/ext/v8/upstream/v8/src/bootstrapper.h +185 -0
- data/ext/v8/upstream/v8/src/builtins.cc +1708 -0
- data/ext/v8/upstream/v8/src/builtins.h +368 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/bytecodes-irregexp.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/cached-powers.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/cached-powers.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/char-predicates-inl.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/char-predicates.h +0 -0
- data/ext/v8/upstream/v8/src/checks.cc +110 -0
- data/ext/v8/upstream/v8/src/checks.h +296 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/circular-queue-inl.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/circular-queue.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/circular-queue.h +0 -0
- data/ext/v8/upstream/v8/src/code-stubs.cc +240 -0
- data/ext/v8/upstream/v8/src/code-stubs.h +971 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/code.h +0 -0
- data/ext/v8/upstream/v8/src/codegen-inl.h +68 -0
- data/ext/v8/upstream/v8/src/codegen.cc +505 -0
- data/ext/v8/upstream/v8/src/codegen.h +245 -0
- data/ext/v8/upstream/v8/src/compilation-cache.cc +540 -0
- data/ext/v8/upstream/v8/src/compilation-cache.h +287 -0
- data/ext/v8/upstream/v8/src/compiler.cc +792 -0
- data/ext/v8/upstream/v8/src/compiler.h +307 -0
- data/ext/v8/upstream/v8/src/contexts.cc +327 -0
- data/ext/v8/upstream/v8/src/contexts.h +382 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/conversions-inl.h +0 -0
- data/ext/v8/upstream/v8/src/conversions.cc +1125 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/conversions.h +0 -0
- data/ext/v8/upstream/v8/src/counters.cc +93 -0
- data/ext/v8/upstream/v8/src/counters.h +254 -0
- data/ext/v8/upstream/v8/src/cpu-profiler-inl.h +101 -0
- data/ext/v8/upstream/v8/src/cpu-profiler.cc +606 -0
- data/ext/v8/upstream/v8/src/cpu-profiler.h +305 -0
- data/ext/v8/upstream/v8/src/cpu.h +67 -0
- data/ext/v8/upstream/v8/src/d8-debug.cc +367 -0
- data/ext/v8/upstream/v8/src/d8-debug.h +158 -0
- data/ext/v8/upstream/v8/src/d8-posix.cc +695 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/d8-readline.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/d8-windows.cc +0 -0
- data/ext/v8/upstream/v8/src/d8.cc +796 -0
- data/ext/v8/upstream/v8/src/d8.gyp +88 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/d8.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/d8.js +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/data-flow.cc +0 -0
- data/ext/v8/upstream/v8/src/data-flow.h +379 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/date.js +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/dateparser-inl.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/dateparser.cc +0 -0
- data/ext/v8/upstream/v8/src/dateparser.h +265 -0
- data/ext/v8/upstream/v8/src/debug-agent.cc +447 -0
- data/ext/v8/upstream/v8/src/debug-agent.h +129 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/debug-debugger.js +0 -0
- data/ext/v8/upstream/v8/src/debug.cc +3188 -0
- data/ext/v8/upstream/v8/src/debug.h +1055 -0
- data/ext/v8/upstream/v8/src/deoptimizer.cc +1296 -0
- data/ext/v8/upstream/v8/src/deoptimizer.h +629 -0
- data/ext/v8/upstream/v8/src/disasm.h +80 -0
- data/ext/v8/upstream/v8/src/disassembler.cc +339 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/disassembler.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/diy-fp.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/diy-fp.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/double.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/dtoa.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/dtoa.h +0 -0
- data/ext/v8/upstream/v8/src/execution.cc +791 -0
- data/ext/v8/upstream/v8/src/execution.h +291 -0
- data/ext/v8/upstream/v8/src/extensions/experimental/break-iterator.cc +250 -0
- data/ext/v8/upstream/v8/src/extensions/experimental/break-iterator.h +89 -0
- data/ext/v8/upstream/v8/src/extensions/experimental/experimental.gyp +55 -0
- data/ext/v8/upstream/v8/src/extensions/experimental/i18n-extension.cc +284 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/extensions/experimental/i18n-extension.h +0 -0
- data/ext/v8/upstream/v8/src/extensions/externalize-string-extension.cc +141 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/extensions/externalize-string-extension.h +0 -0
- data/ext/v8/upstream/v8/src/extensions/gc-extension.cc +58 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/extensions/gc-extension.h +0 -0
- data/ext/v8/upstream/v8/src/factory.cc +1194 -0
- data/ext/v8/upstream/v8/src/factory.h +436 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/fast-dtoa.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/fast-dtoa.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/fixed-dtoa.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/fixed-dtoa.h +0 -0
- data/ext/v8/upstream/v8/src/flag-definitions.h +556 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/flags.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/flags.h +0 -0
- data/ext/v8/upstream/v8/src/frame-element.cc +37 -0
- data/ext/v8/upstream/v8/src/frame-element.h +269 -0
- data/ext/v8/upstream/v8/src/frames-inl.h +236 -0
- data/ext/v8/upstream/v8/src/frames.cc +1273 -0
- data/ext/v8/upstream/v8/src/frames.h +854 -0
- data/ext/v8/upstream/v8/src/full-codegen.cc +1385 -0
- data/ext/v8/upstream/v8/src/full-codegen.h +753 -0
- data/ext/v8/upstream/v8/src/func-name-inferrer.cc +91 -0
- data/ext/v8/upstream/v8/src/func-name-inferrer.h +111 -0
- data/ext/v8/upstream/v8/src/gdb-jit.cc +1548 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/gdb-jit.h +0 -0
- data/ext/v8/upstream/v8/src/global-handles.cc +596 -0
- data/ext/v8/upstream/v8/src/global-handles.h +239 -0
- data/ext/v8/upstream/v8/src/globals.h +325 -0
- data/ext/v8/upstream/v8/src/handles-inl.h +177 -0
- data/ext/v8/upstream/v8/src/handles.cc +965 -0
- data/ext/v8/upstream/v8/src/handles.h +372 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/hashmap.cc +0 -0
- data/ext/v8/upstream/v8/src/hashmap.h +121 -0
- data/ext/v8/upstream/v8/src/heap-inl.h +703 -0
- data/ext/v8/upstream/v8/src/heap-profiler.cc +1173 -0
- data/ext/v8/upstream/v8/src/heap-profiler.h +396 -0
- data/ext/v8/upstream/v8/src/heap.cc +5856 -0
- data/ext/v8/upstream/v8/src/heap.h +2264 -0
- data/ext/v8/upstream/v8/src/hydrogen-instructions.cc +1639 -0
- data/ext/v8/upstream/v8/src/hydrogen-instructions.h +3657 -0
- data/ext/v8/upstream/v8/src/hydrogen.cc +6011 -0
- data/ext/v8/upstream/v8/src/hydrogen.h +1137 -0
- data/ext/v8/upstream/v8/src/ia32/assembler-ia32-inl.h +430 -0
- data/ext/v8/upstream/v8/src/ia32/assembler-ia32.cc +2846 -0
- data/ext/v8/upstream/v8/src/ia32/assembler-ia32.h +1159 -0
- data/ext/v8/upstream/v8/src/ia32/builtins-ia32.cc +1596 -0
- data/ext/v8/upstream/v8/src/ia32/code-stubs-ia32.cc +6549 -0
- data/ext/v8/upstream/v8/src/ia32/code-stubs-ia32.h +495 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/codegen-ia32-inl.h +0 -0
- data/ext/v8/upstream/v8/src/ia32/codegen-ia32.cc +10385 -0
- data/ext/v8/upstream/v8/src/ia32/codegen-ia32.h +801 -0
- data/ext/v8/upstream/v8/src/ia32/cpu-ia32.cc +88 -0
- data/ext/v8/upstream/v8/src/ia32/debug-ia32.cc +312 -0
- data/ext/v8/upstream/v8/src/ia32/deoptimizer-ia32.cc +774 -0
- data/ext/v8/upstream/v8/src/ia32/disasm-ia32.cc +1620 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/frames-ia32.cc +0 -0
- data/ext/v8/upstream/v8/src/ia32/frames-ia32.h +140 -0
- data/ext/v8/upstream/v8/src/ia32/full-codegen-ia32.cc +4357 -0
- data/ext/v8/upstream/v8/src/ia32/ic-ia32.cc +1779 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/jump-target-ia32.cc +0 -0
- data/ext/v8/upstream/v8/src/ia32/lithium-codegen-ia32.cc +4158 -0
- data/ext/v8/upstream/v8/src/ia32/lithium-codegen-ia32.h +318 -0
- data/ext/v8/upstream/v8/src/ia32/lithium-gap-resolver-ia32.cc +466 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/lithium-gap-resolver-ia32.h +0 -0
- data/ext/v8/upstream/v8/src/ia32/lithium-ia32.cc +2181 -0
- data/ext/v8/upstream/v8/src/ia32/lithium-ia32.h +2235 -0
- data/ext/v8/upstream/v8/src/ia32/macro-assembler-ia32.cc +2056 -0
- data/ext/v8/upstream/v8/src/ia32/macro-assembler-ia32.h +807 -0
- data/ext/v8/upstream/v8/src/ia32/regexp-macro-assembler-ia32.cc +1264 -0
- data/ext/v8/upstream/v8/src/ia32/regexp-macro-assembler-ia32.h +216 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/register-allocator-ia32-inl.h +0 -0
- data/ext/v8/upstream/v8/src/ia32/register-allocator-ia32.cc +157 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/register-allocator-ia32.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/ia32/simulator-ia32.cc +0 -0
- data/ext/v8/upstream/v8/src/ia32/simulator-ia32.h +72 -0
- data/ext/v8/upstream/v8/src/ia32/stub-cache-ia32.cc +3711 -0
- data/ext/v8/upstream/v8/src/ia32/virtual-frame-ia32.cc +1366 -0
- data/ext/v8/upstream/v8/src/ia32/virtual-frame-ia32.h +650 -0
- data/ext/v8/upstream/v8/src/ic-inl.h +130 -0
- data/ext/v8/upstream/v8/src/ic.cc +2389 -0
- data/ext/v8/upstream/v8/src/ic.h +675 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/inspector.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/inspector.h +0 -0
- data/ext/v8/upstream/v8/src/interpreter-irregexp.cc +659 -0
- data/ext/v8/upstream/v8/src/interpreter-irregexp.h +49 -0
- data/ext/v8/upstream/v8/src/isolate.cc +883 -0
- data/ext/v8/upstream/v8/src/isolate.h +1306 -0
- data/ext/v8/upstream/v8/src/json.js +342 -0
- data/ext/v8/upstream/v8/src/jsregexp.cc +5371 -0
- data/ext/v8/upstream/v8/src/jsregexp.h +1483 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/jump-target-heavy-inl.h +0 -0
- data/ext/v8/upstream/v8/src/jump-target-heavy.cc +427 -0
- data/ext/v8/upstream/v8/src/jump-target-heavy.h +238 -0
- data/ext/v8/upstream/v8/src/jump-target-inl.h +48 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/jump-target-light-inl.h +0 -0
- data/ext/v8/upstream/v8/src/jump-target-light.cc +111 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/jump-target-light.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/jump-target.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/jump-target.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/list-inl.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/list.h +0 -0
- data/ext/v8/upstream/v8/src/lithium-allocator-inl.h +142 -0
- data/ext/v8/upstream/v8/src/lithium-allocator.cc +2105 -0
- data/ext/v8/upstream/v8/src/lithium-allocator.h +630 -0
- data/ext/v8/upstream/v8/src/lithium.cc +169 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/lithium.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/liveedit-debugger.js +0 -0
- data/ext/v8/upstream/v8/src/liveedit.cc +1693 -0
- data/ext/v8/upstream/v8/src/liveedit.h +179 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/liveobjectlist-inl.h +0 -0
- data/ext/v8/upstream/v8/src/liveobjectlist.cc +2589 -0
- data/ext/v8/upstream/v8/src/liveobjectlist.h +322 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/log-inl.h +0 -0
- data/ext/v8/upstream/v8/src/log-utils.cc +423 -0
- data/ext/v8/upstream/v8/src/log-utils.h +229 -0
- data/ext/v8/upstream/v8/src/log.cc +1666 -0
- data/ext/v8/upstream/v8/src/log.h +446 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/macro-assembler.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/macros.py +0 -0
- data/ext/v8/upstream/v8/src/mark-compact.cc +3092 -0
- data/ext/v8/upstream/v8/src/mark-compact.h +506 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/math.js +0 -0
- data/ext/v8/upstream/v8/src/messages.cc +166 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/messages.h +0 -0
- data/ext/v8/upstream/v8/src/messages.js +1090 -0
- data/ext/v8/upstream/v8/src/mips/assembler-mips-inl.h +335 -0
- data/ext/v8/upstream/v8/src/mips/assembler-mips.cc +2093 -0
- data/ext/v8/upstream/v8/src/mips/assembler-mips.h +1066 -0
- data/ext/v8/upstream/v8/src/mips/builtins-mips.cc +148 -0
- data/ext/v8/upstream/v8/src/mips/code-stubs-mips.cc +752 -0
- data/ext/v8/upstream/v8/src/mips/code-stubs-mips.h +511 -0
- data/ext/v8/upstream/v8/src/mips/codegen-mips-inl.h +64 -0
- data/ext/v8/upstream/v8/src/mips/codegen-mips.cc +1213 -0
- data/ext/v8/upstream/v8/src/mips/codegen-mips.h +633 -0
- data/ext/v8/upstream/v8/src/mips/constants-mips.cc +352 -0
- data/ext/v8/upstream/v8/src/mips/constants-mips.h +723 -0
- data/ext/v8/upstream/v8/src/mips/cpu-mips.cc +90 -0
- data/ext/v8/upstream/v8/src/mips/debug-mips.cc +155 -0
- data/ext/v8/upstream/v8/src/mips/deoptimizer-mips.cc +91 -0
- data/ext/v8/upstream/v8/src/mips/disasm-mips.cc +1023 -0
- data/ext/v8/upstream/v8/src/mips/frames-mips.cc +48 -0
- data/ext/v8/upstream/v8/src/mips/frames-mips.h +179 -0
- data/ext/v8/upstream/v8/src/mips/full-codegen-mips.cc +727 -0
- data/ext/v8/upstream/v8/src/mips/ic-mips.cc +244 -0
- data/ext/v8/upstream/v8/src/mips/jump-target-mips.cc +80 -0
- data/ext/v8/upstream/v8/src/mips/lithium-codegen-mips.h +65 -0
- data/ext/v8/upstream/v8/src/mips/lithium-mips.h +304 -0
- data/ext/v8/upstream/v8/src/mips/macro-assembler-mips.cc +3327 -0
- data/ext/v8/upstream/v8/src/mips/macro-assembler-mips.h +1058 -0
- data/ext/v8/upstream/v8/src/mips/regexp-macro-assembler-mips.cc +478 -0
- data/ext/v8/upstream/v8/src/mips/regexp-macro-assembler-mips.h +250 -0
- data/ext/v8/upstream/v8/src/mips/register-allocator-mips-inl.h +134 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/mips/register-allocator-mips.cc +0 -0
- data/ext/v8/upstream/v8/src/mips/register-allocator-mips.h +47 -0
- data/ext/v8/upstream/v8/src/mips/simulator-mips.cc +2438 -0
- data/ext/v8/upstream/v8/src/mips/simulator-mips.h +394 -0
- data/ext/v8/upstream/v8/src/mips/stub-cache-mips.cc +601 -0
- data/ext/v8/upstream/v8/src/mips/virtual-frame-mips-inl.h +58 -0
- data/ext/v8/upstream/v8/src/mips/virtual-frame-mips.cc +307 -0
- data/ext/v8/upstream/v8/src/mips/virtual-frame-mips.h +530 -0
- data/ext/v8/upstream/v8/src/mirror-debugger.js +2381 -0
- data/ext/v8/upstream/v8/src/mksnapshot.cc +256 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/natives.h +0 -0
- data/ext/v8/upstream/v8/src/objects-debug.cc +722 -0
- data/ext/v8/upstream/v8/src/objects-inl.h +4166 -0
- data/ext/v8/upstream/v8/src/objects-printer.cc +801 -0
- data/ext/v8/upstream/v8/src/objects-visiting.cc +142 -0
- data/ext/v8/upstream/v8/src/objects-visiting.h +422 -0
- data/ext/v8/upstream/v8/src/objects.cc +10296 -0
- data/ext/v8/upstream/v8/src/objects.h +6662 -0
- data/ext/v8/upstream/v8/src/parser.cc +5168 -0
- data/ext/v8/upstream/v8/src/parser.h +823 -0
- data/ext/v8/upstream/v8/src/platform-cygwin.cc +811 -0
- data/ext/v8/upstream/v8/src/platform-freebsd.cc +854 -0
- data/ext/v8/upstream/v8/src/platform-linux.cc +1120 -0
- data/ext/v8/upstream/v8/src/platform-macos.cc +865 -0
- data/ext/v8/upstream/v8/src/platform-nullos.cc +504 -0
- data/ext/v8/upstream/v8/src/platform-openbsd.cc +672 -0
- data/ext/v8/upstream/v8/src/platform-posix.cc +424 -0
- data/ext/v8/upstream/v8/src/platform-solaris.cc +796 -0
- data/ext/v8/upstream/v8/src/platform-tls-mac.h +62 -0
- data/ext/v8/upstream/v8/src/platform-tls-win32.h +62 -0
- data/ext/v8/upstream/v8/src/platform-tls.h +50 -0
- data/ext/v8/upstream/v8/src/platform-win32.cc +2072 -0
- data/ext/v8/upstream/v8/src/platform.h +693 -0
- data/ext/v8/upstream/v8/src/preparse-data.cc +185 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/preparse-data.h +0 -0
- data/ext/v8/upstream/v8/src/preparser-api.cc +219 -0
- data/ext/v8/upstream/v8/src/preparser.cc +1205 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/preparser.h +0 -0
- data/ext/v8/upstream/v8/src/prettyprinter.cc +1530 -0
- data/ext/v8/upstream/v8/src/prettyprinter.h +223 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/profile-generator-inl.h +0 -0
- data/ext/v8/upstream/v8/src/profile-generator.cc +3095 -0
- data/ext/v8/upstream/v8/src/profile-generator.h +1125 -0
- data/ext/v8/upstream/v8/src/property.cc +102 -0
- data/ext/v8/upstream/v8/src/property.h +348 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/regexp-macro-assembler-irregexp-inl.h +0 -0
- data/ext/v8/upstream/v8/src/regexp-macro-assembler-irregexp.cc +470 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/regexp-macro-assembler-irregexp.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/regexp-macro-assembler-tracer.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/regexp-macro-assembler-tracer.h +0 -0
- data/ext/v8/upstream/v8/src/regexp-macro-assembler.cc +266 -0
- data/ext/v8/upstream/v8/src/regexp-macro-assembler.h +236 -0
- data/ext/v8/upstream/v8/src/regexp-stack.cc +111 -0
- data/ext/v8/upstream/v8/src/regexp-stack.h +147 -0
- data/ext/v8/upstream/v8/src/regexp.js +483 -0
- data/ext/v8/upstream/v8/src/register-allocator-inl.h +141 -0
- data/ext/v8/upstream/v8/src/register-allocator.cc +98 -0
- data/ext/v8/upstream/v8/src/register-allocator.h +310 -0
- data/ext/v8/upstream/v8/src/rewriter.cc +1024 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/rewriter.h +0 -0
- data/ext/v8/upstream/v8/src/runtime-profiler.cc +478 -0
- data/ext/v8/upstream/v8/src/runtime-profiler.h +192 -0
- data/ext/v8/upstream/v8/src/runtime.cc +11949 -0
- data/ext/v8/upstream/v8/src/runtime.h +643 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/runtime.js +0 -0
- data/ext/v8/upstream/v8/src/safepoint-table.cc +256 -0
- data/ext/v8/upstream/v8/src/safepoint-table.h +269 -0
- data/ext/v8/upstream/v8/src/scanner-base.cc +964 -0
- data/ext/v8/upstream/v8/src/scanner-base.h +664 -0
- data/ext/v8/upstream/v8/src/scanner.cc +584 -0
- data/ext/v8/upstream/v8/src/scanner.h +196 -0
- data/ext/v8/upstream/v8/src/scopeinfo.cc +631 -0
- data/ext/v8/upstream/v8/src/scopeinfo.h +249 -0
- data/ext/v8/upstream/v8/src/scopes.cc +1093 -0
- data/ext/v8/upstream/v8/src/scopes.h +508 -0
- data/ext/v8/upstream/v8/src/serialize.cc +1574 -0
- data/ext/v8/upstream/v8/src/serialize.h +589 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/shell.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/simulator.h +0 -0
- data/ext/v8/upstream/v8/src/small-pointer-list.h +163 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/smart-pointer.h +0 -0
- data/ext/v8/upstream/v8/src/snapshot-common.cc +82 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/snapshot-empty.cc +0 -0
- data/ext/v8/upstream/v8/src/snapshot.h +73 -0
- data/ext/v8/upstream/v8/src/spaces-inl.h +529 -0
- data/ext/v8/upstream/v8/src/spaces.cc +3147 -0
- data/ext/v8/upstream/v8/src/spaces.h +2368 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/splay-tree-inl.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/splay-tree.h +0 -0
- data/ext/v8/upstream/v8/src/string-search.cc +41 -0
- data/ext/v8/upstream/v8/src/string-search.h +568 -0
- data/ext/v8/upstream/v8/src/string-stream.cc +592 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/string-stream.h +0 -0
- data/ext/v8/upstream/v8/src/string.js +915 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/strtod.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/strtod.h +0 -0
- data/ext/v8/upstream/v8/src/stub-cache.cc +1940 -0
- data/ext/v8/upstream/v8/src/stub-cache.h +866 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/third_party/valgrind/valgrind.h +0 -0
- data/ext/v8/upstream/v8/src/token.cc +63 -0
- data/ext/v8/upstream/v8/src/token.h +288 -0
- data/ext/v8/upstream/v8/src/top.cc +983 -0
- data/ext/v8/upstream/v8/src/type-info.cc +472 -0
- data/ext/v8/upstream/v8/src/type-info.h +290 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/unbound-queue-inl.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/unbound-queue.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/unicode-inl.h +0 -0
- data/ext/v8/upstream/v8/src/unicode.cc +1624 -0
- data/ext/v8/upstream/v8/src/unicode.h +280 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/uri.js +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/utils.cc +0 -0
- data/ext/v8/upstream/v8/src/utils.h +796 -0
- data/ext/v8/upstream/v8/src/v8-counters.cc +62 -0
- data/ext/v8/upstream/v8/src/v8-counters.h +311 -0
- data/ext/v8/upstream/v8/src/v8.cc +215 -0
- data/ext/v8/upstream/v8/src/v8.h +130 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/v8checks.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/v8dll-main.cc +0 -0
- data/ext/v8/upstream/v8/src/v8globals.h +486 -0
- data/ext/v8/upstream/{3.1.8/src/memory.h → v8/src/v8memory.h} +0 -0
- data/ext/v8/upstream/v8/src/v8natives.js +1293 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/v8preparserdll-main.cc +0 -0
- data/ext/v8/upstream/v8/src/v8threads.cc +453 -0
- data/ext/v8/upstream/v8/src/v8threads.h +164 -0
- data/ext/v8/upstream/v8/src/v8utils.h +317 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/variables.cc +0 -0
- data/ext/v8/upstream/v8/src/variables.h +212 -0
- data/ext/v8/upstream/v8/src/version.cc +116 -0
- data/ext/v8/upstream/v8/src/version.h +68 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/virtual-frame-heavy-inl.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/virtual-frame-heavy.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/virtual-frame-inl.h +0 -0
- data/ext/v8/upstream/v8/src/virtual-frame-light-inl.h +171 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/virtual-frame-light.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/virtual-frame.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/virtual-frame.h +0 -0
- data/ext/v8/upstream/v8/src/vm-state-inl.h +138 -0
- data/ext/v8/upstream/v8/src/vm-state.h +70 -0
- data/ext/v8/upstream/v8/src/win32-headers.h +96 -0
- data/ext/v8/upstream/v8/src/x64/assembler-x64-inl.h +456 -0
- data/ext/v8/upstream/v8/src/x64/assembler-x64.cc +2954 -0
- data/ext/v8/upstream/v8/src/x64/assembler-x64.h +1630 -0
- data/ext/v8/upstream/v8/src/x64/builtins-x64.cc +1493 -0
- data/ext/v8/upstream/v8/src/x64/code-stubs-x64.cc +5132 -0
- data/ext/v8/upstream/v8/src/x64/code-stubs-x64.h +477 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/x64/codegen-x64-inl.h +0 -0
- data/ext/v8/upstream/v8/src/x64/codegen-x64.cc +8843 -0
- data/ext/v8/upstream/v8/src/x64/codegen-x64.h +753 -0
- data/ext/v8/upstream/v8/src/x64/cpu-x64.cc +88 -0
- data/ext/v8/upstream/v8/src/x64/debug-x64.cc +318 -0
- data/ext/v8/upstream/v8/src/x64/deoptimizer-x64.cc +815 -0
- data/ext/v8/upstream/v8/src/x64/disasm-x64.cc +1752 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/x64/frames-x64.cc +0 -0
- data/ext/v8/upstream/v8/src/x64/frames-x64.h +130 -0
- data/ext/v8/upstream/v8/src/x64/full-codegen-x64.cc +4339 -0
- data/ext/v8/upstream/v8/src/x64/ic-x64.cc +1752 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/x64/jump-target-x64.cc +0 -0
- data/ext/v8/upstream/v8/src/x64/lithium-codegen-x64.cc +3970 -0
- data/ext/v8/upstream/v8/src/x64/lithium-codegen-x64.h +318 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/x64/lithium-gap-resolver-x64.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/x64/lithium-gap-resolver-x64.h +0 -0
- data/ext/v8/upstream/v8/src/x64/lithium-x64.cc +2115 -0
- data/ext/v8/upstream/v8/src/x64/lithium-x64.h +2161 -0
- data/ext/v8/upstream/v8/src/x64/macro-assembler-x64.cc +2911 -0
- data/ext/v8/upstream/v8/src/x64/macro-assembler-x64.h +1984 -0
- data/ext/v8/upstream/v8/src/x64/regexp-macro-assembler-x64.cc +1398 -0
- data/ext/v8/upstream/v8/src/x64/regexp-macro-assembler-x64.h +282 -0
- data/ext/v8/upstream/v8/src/x64/register-allocator-x64-inl.h +87 -0
- data/ext/v8/upstream/v8/src/x64/register-allocator-x64.cc +95 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/x64/register-allocator-x64.h +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/src/x64/simulator-x64.cc +0 -0
- data/ext/v8/upstream/v8/src/x64/simulator-x64.h +71 -0
- data/ext/v8/upstream/v8/src/x64/stub-cache-x64.cc +3460 -0
- data/ext/v8/upstream/v8/src/x64/virtual-frame-x64.cc +1296 -0
- data/ext/v8/upstream/v8/src/x64/virtual-frame-x64.h +597 -0
- data/ext/v8/upstream/v8/src/zone-inl.h +129 -0
- data/ext/v8/upstream/v8/src/zone.cc +196 -0
- data/ext/v8/upstream/v8/src/zone.h +236 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/codemap.js +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/consarray.js +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/csvparser.js +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/disasm.py +0 -0
- data/ext/v8/upstream/v8/tools/freebsd-tick-processor +10 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/gc-nvp-trace-processor.py +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/generate-ten-powers.scm +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/grokdump.py +0 -0
- data/ext/v8/upstream/v8/tools/gyp/v8.gyp +844 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/js2c.py +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/jsmin.py +0 -0
- data/ext/v8/upstream/v8/tools/linux-tick-processor +35 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/ll_prof.py +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/logreader.js +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/mac-nm +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/mac-tick-processor +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/oom_dump/README +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/oom_dump/SConstruct +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/oom_dump/oom_dump.cc +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/presubmit.py +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/process-heap-prof.py +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/profile.js +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/profile_view.js +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/run-valgrind.py +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/splaytree.js +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/stats-viewer.py +0 -0
- data/ext/v8/upstream/v8/tools/test.py +1490 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/tickprocessor-driver.js +0 -0
- data/ext/v8/upstream/v8/tools/tickprocessor.js +877 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/utils.py +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/README.txt +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/arm.vsprops +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/common.vsprops +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/d8.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/d8_arm.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/d8_x64.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/d8js2c.cmd +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/debug.vsprops +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/ia32.vsprops +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/js2c.cmd +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/release.vsprops +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8.sln +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_arm.sln +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_arm.vcproj +0 -0
- data/ext/v8/upstream/v8/tools/visual_studio/v8_base.vcproj +1308 -0
- data/ext/v8/upstream/v8/tools/visual_studio/v8_base_arm.vcproj +1238 -0
- data/ext/v8/upstream/v8/tools/visual_studio/v8_base_x64.vcproj +1300 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_cctest.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_cctest_arm.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_cctest_x64.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_mksnapshot.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_mksnapshot_x64.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_process_sample.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_process_sample_arm.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_process_sample_x64.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_shell_sample.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_shell_sample_arm.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_shell_sample_x64.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_snapshot.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_snapshot_cc.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_snapshot_cc_x64.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_snapshot_x64.vcproj +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_x64.sln +0 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/visual_studio/v8_x64.vcproj +0 -0
- data/ext/v8/upstream/v8/tools/visual_studio/x64.vsprops +18 -0
- data/ext/v8/upstream/{3.1.8 → v8}/tools/windows-tick-processor.bat +0 -0
- data/ext/v8/v8_callbacks.cpp +52 -92
- data/ext/v8/v8_date.cpp +2 -3
- data/ext/v8/v8_object.cpp +4 -0
- data/ext/v8/v8_template.cpp +2 -2
- data/ext/v8/v8_try_catch.cpp +8 -38
- data/lib/v8/version.rb +1 -1
- data/spec/ext/ext_spec_helper.rb +2 -20
- data/spec/ext/object_spec.rb +0 -12
- data/spec/ext/try_catch_spec.rb +29 -1
- data/spec/spec_helper.rb +1 -0
- data/spec/v8/portal/proxies_spec.rb +1 -84
- data/specmem/handle_memspec.rb +41 -0
- data/specmem/object_memspec.rb +16 -0
- data/specmem/proxies_memspec.rb +86 -0
- data/specmem/spec_helper.rb +24 -0
- data/therubyracer.gemspec +7 -2
- metadata +564 -541
- data/ext/v8/upstream/3.1.8/.gitignore +0 -31
- data/ext/v8/upstream/3.1.8/AUTHORS +0 -40
- data/ext/v8/upstream/3.1.8/ChangeLog +0 -2566
- data/ext/v8/upstream/3.1.8/SConstruct +0 -1192
- data/ext/v8/upstream/3.1.8/include/v8-debug.h +0 -384
- data/ext/v8/upstream/3.1.8/include/v8-preparser.h +0 -116
- data/ext/v8/upstream/3.1.8/include/v8-profiler.h +0 -426
- data/ext/v8/upstream/3.1.8/include/v8-testing.h +0 -99
- data/ext/v8/upstream/3.1.8/include/v8.h +0 -3846
- data/ext/v8/upstream/3.1.8/preparser/preparser-process.cc +0 -206
- data/ext/v8/upstream/3.1.8/src/SConscript +0 -356
- data/ext/v8/upstream/3.1.8/src/accessors.cc +0 -907
- data/ext/v8/upstream/3.1.8/src/allocation.cc +0 -204
- data/ext/v8/upstream/3.1.8/src/allocation.h +0 -176
- data/ext/v8/upstream/3.1.8/src/api.cc +0 -5191
- data/ext/v8/upstream/3.1.8/src/api.h +0 -508
- data/ext/v8/upstream/3.1.8/src/apiutils.h +0 -80
- data/ext/v8/upstream/3.1.8/src/arguments.h +0 -105
- data/ext/v8/upstream/3.1.8/src/arm/assembler-arm-inl.h +0 -352
- data/ext/v8/upstream/3.1.8/src/arm/assembler-arm.cc +0 -2756
- data/ext/v8/upstream/3.1.8/src/arm/assembler-arm.h +0 -1294
- data/ext/v8/upstream/3.1.8/src/arm/builtins-arm.cc +0 -1628
- data/ext/v8/upstream/3.1.8/src/arm/code-stubs-arm.cc +0 -6783
- data/ext/v8/upstream/3.1.8/src/arm/code-stubs-arm.h +0 -657
- data/ext/v8/upstream/3.1.8/src/arm/codegen-arm.cc +0 -7403
- data/ext/v8/upstream/3.1.8/src/arm/codegen-arm.h +0 -595
- data/ext/v8/upstream/3.1.8/src/arm/constants-arm.h +0 -769
- data/ext/v8/upstream/3.1.8/src/arm/cpu-arm.cc +0 -147
- data/ext/v8/upstream/3.1.8/src/arm/debug-arm.cc +0 -315
- data/ext/v8/upstream/3.1.8/src/arm/deoptimizer-arm.cc +0 -700
- data/ext/v8/upstream/3.1.8/src/arm/disasm-arm.cc +0 -1439
- data/ext/v8/upstream/3.1.8/src/arm/frames-arm.h +0 -168
- data/ext/v8/upstream/3.1.8/src/arm/full-codegen-arm.cc +0 -4230
- data/ext/v8/upstream/3.1.8/src/arm/ic-arm.cc +0 -1799
- data/ext/v8/upstream/3.1.8/src/arm/lithium-arm.cc +0 -2041
- data/ext/v8/upstream/3.1.8/src/arm/lithium-arm.h +0 -2046
- data/ext/v8/upstream/3.1.8/src/arm/lithium-codegen-arm.cc +0 -3822
- data/ext/v8/upstream/3.1.8/src/arm/lithium-codegen-arm.h +0 -312
- data/ext/v8/upstream/3.1.8/src/arm/lithium-gap-resolver-arm.cc +0 -303
- data/ext/v8/upstream/3.1.8/src/arm/macro-assembler-arm.cc +0 -2701
- data/ext/v8/upstream/3.1.8/src/arm/macro-assembler-arm.h +0 -1015
- data/ext/v8/upstream/3.1.8/src/arm/regexp-macro-assembler-arm.cc +0 -1280
- data/ext/v8/upstream/3.1.8/src/arm/regexp-macro-assembler-arm.h +0 -252
- data/ext/v8/upstream/3.1.8/src/arm/simulator-arm.cc +0 -3165
- data/ext/v8/upstream/3.1.8/src/arm/simulator-arm.h +0 -402
- data/ext/v8/upstream/3.1.8/src/arm/stub-cache-arm.cc +0 -4077
- data/ext/v8/upstream/3.1.8/src/arm/virtual-frame-arm.cc +0 -843
- data/ext/v8/upstream/3.1.8/src/arm/virtual-frame-arm.h +0 -520
- data/ext/v8/upstream/3.1.8/src/array.js +0 -1231
- data/ext/v8/upstream/3.1.8/src/assembler.cc +0 -973
- data/ext/v8/upstream/3.1.8/src/assembler.h +0 -787
- data/ext/v8/upstream/3.1.8/src/ast-inl.h +0 -107
- data/ext/v8/upstream/3.1.8/src/ast.cc +0 -1067
- data/ext/v8/upstream/3.1.8/src/ast.h +0 -2177
- data/ext/v8/upstream/3.1.8/src/atomicops.h +0 -165
- data/ext/v8/upstream/3.1.8/src/bootstrapper.cc +0 -1888
- data/ext/v8/upstream/3.1.8/src/bootstrapper.h +0 -118
- data/ext/v8/upstream/3.1.8/src/builtins.cc +0 -1586
- data/ext/v8/upstream/3.1.8/src/builtins.h +0 -339
- data/ext/v8/upstream/3.1.8/src/checks.cc +0 -110
- data/ext/v8/upstream/3.1.8/src/checks.h +0 -292
- data/ext/v8/upstream/3.1.8/src/code-stubs.cc +0 -230
- data/ext/v8/upstream/3.1.8/src/code-stubs.h +0 -950
- data/ext/v8/upstream/3.1.8/src/codegen-inl.h +0 -64
- data/ext/v8/upstream/3.1.8/src/codegen.cc +0 -495
- data/ext/v8/upstream/3.1.8/src/codegen.h +0 -245
- data/ext/v8/upstream/3.1.8/src/compilation-cache.cc +0 -654
- data/ext/v8/upstream/3.1.8/src/compilation-cache.h +0 -112
- data/ext/v8/upstream/3.1.8/src/compiler.cc +0 -806
- data/ext/v8/upstream/3.1.8/src/compiler.h +0 -290
- data/ext/v8/upstream/3.1.8/src/contexts.cc +0 -320
- data/ext/v8/upstream/3.1.8/src/contexts.h +0 -376
- data/ext/v8/upstream/3.1.8/src/conversions.cc +0 -1069
- data/ext/v8/upstream/3.1.8/src/counters.cc +0 -78
- data/ext/v8/upstream/3.1.8/src/counters.h +0 -242
- data/ext/v8/upstream/3.1.8/src/cpu-profiler-inl.h +0 -100
- data/ext/v8/upstream/3.1.8/src/cpu-profiler.cc +0 -554
- data/ext/v8/upstream/3.1.8/src/cpu-profiler.h +0 -291
- data/ext/v8/upstream/3.1.8/src/cpu.h +0 -65
- data/ext/v8/upstream/3.1.8/src/d8-debug.cc +0 -367
- data/ext/v8/upstream/3.1.8/src/d8-debug.h +0 -157
- data/ext/v8/upstream/3.1.8/src/d8-posix.cc +0 -693
- data/ext/v8/upstream/3.1.8/src/d8.cc +0 -792
- data/ext/v8/upstream/3.1.8/src/d8.gyp +0 -85
- data/ext/v8/upstream/3.1.8/src/data-flow.h +0 -379
- data/ext/v8/upstream/3.1.8/src/dateparser.h +0 -263
- data/ext/v8/upstream/3.1.8/src/debug-agent.cc +0 -446
- data/ext/v8/upstream/3.1.8/src/debug-agent.h +0 -131
- data/ext/v8/upstream/3.1.8/src/debug.cc +0 -3085
- data/ext/v8/upstream/3.1.8/src/debug.h +0 -1025
- data/ext/v8/upstream/3.1.8/src/deoptimizer.cc +0 -1185
- data/ext/v8/upstream/3.1.8/src/deoptimizer.h +0 -529
- data/ext/v8/upstream/3.1.8/src/disasm.h +0 -77
- data/ext/v8/upstream/3.1.8/src/disassembler.cc +0 -338
- data/ext/v8/upstream/3.1.8/src/execution.cc +0 -735
- data/ext/v8/upstream/3.1.8/src/execution.h +0 -322
- data/ext/v8/upstream/3.1.8/src/extensions/experimental/experimental.gyp +0 -53
- data/ext/v8/upstream/3.1.8/src/extensions/experimental/i18n-extension.cc +0 -264
- data/ext/v8/upstream/3.1.8/src/extensions/externalize-string-extension.cc +0 -141
- data/ext/v8/upstream/3.1.8/src/extensions/gc-extension.cc +0 -58
- data/ext/v8/upstream/3.1.8/src/factory.cc +0 -1087
- data/ext/v8/upstream/3.1.8/src/factory.h +0 -432
- data/ext/v8/upstream/3.1.8/src/flag-definitions.h +0 -552
- data/ext/v8/upstream/3.1.8/src/frame-element.cc +0 -42
- data/ext/v8/upstream/3.1.8/src/frame-element.h +0 -277
- data/ext/v8/upstream/3.1.8/src/frames-inl.h +0 -210
- data/ext/v8/upstream/3.1.8/src/frames.cc +0 -1232
- data/ext/v8/upstream/3.1.8/src/frames.h +0 -826
- data/ext/v8/upstream/3.1.8/src/full-codegen.cc +0 -1382
- data/ext/v8/upstream/3.1.8/src/full-codegen.h +0 -751
- data/ext/v8/upstream/3.1.8/src/func-name-inferrer.cc +0 -90
- data/ext/v8/upstream/3.1.8/src/func-name-inferrer.h +0 -111
- data/ext/v8/upstream/3.1.8/src/gdb-jit.cc +0 -1547
- data/ext/v8/upstream/3.1.8/src/global-handles.cc +0 -534
- data/ext/v8/upstream/3.1.8/src/global-handles.h +0 -181
- data/ext/v8/upstream/3.1.8/src/globals.h +0 -325
- data/ext/v8/upstream/3.1.8/src/handles-inl.h +0 -80
- data/ext/v8/upstream/3.1.8/src/handles.cc +0 -910
- data/ext/v8/upstream/3.1.8/src/handles.h +0 -424
- data/ext/v8/upstream/3.1.8/src/hashmap.h +0 -121
- data/ext/v8/upstream/3.1.8/src/heap-inl.h +0 -587
- data/ext/v8/upstream/3.1.8/src/heap-profiler.cc +0 -1128
- data/ext/v8/upstream/3.1.8/src/heap-profiler.h +0 -381
- data/ext/v8/upstream/3.1.8/src/heap.cc +0 -5610
- data/ext/v8/upstream/3.1.8/src/heap.h +0 -2218
- data/ext/v8/upstream/3.1.8/src/hydrogen-instructions.cc +0 -1490
- data/ext/v8/upstream/3.1.8/src/hydrogen-instructions.h +0 -3493
- data/ext/v8/upstream/3.1.8/src/hydrogen.cc +0 -6056
- data/ext/v8/upstream/3.1.8/src/hydrogen.h +0 -1091
- data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32-inl.h +0 -429
- data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32.cc +0 -2800
- data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32.h +0 -1093
- data/ext/v8/upstream/3.1.8/src/ia32/builtins-ia32.cc +0 -1590
- data/ext/v8/upstream/3.1.8/src/ia32/code-stubs-ia32.cc +0 -6624
- data/ext/v8/upstream/3.1.8/src/ia32/code-stubs-ia32.h +0 -536
- data/ext/v8/upstream/3.1.8/src/ia32/codegen-ia32.cc +0 -10354
- data/ext/v8/upstream/3.1.8/src/ia32/codegen-ia32.h +0 -798
- data/ext/v8/upstream/3.1.8/src/ia32/cpu-ia32.cc +0 -87
- data/ext/v8/upstream/3.1.8/src/ia32/debug-ia32.cc +0 -309
- data/ext/v8/upstream/3.1.8/src/ia32/deoptimizer-ia32.cc +0 -664
- data/ext/v8/upstream/3.1.8/src/ia32/disasm-ia32.cc +0 -1597
- data/ext/v8/upstream/3.1.8/src/ia32/frames-ia32.h +0 -140
- data/ext/v8/upstream/3.1.8/src/ia32/full-codegen-ia32.cc +0 -4278
- data/ext/v8/upstream/3.1.8/src/ia32/ic-ia32.cc +0 -1786
- data/ext/v8/upstream/3.1.8/src/ia32/lithium-codegen-ia32.cc +0 -3880
- data/ext/v8/upstream/3.1.8/src/ia32/lithium-codegen-ia32.h +0 -309
- data/ext/v8/upstream/3.1.8/src/ia32/lithium-gap-resolver-ia32.cc +0 -460
- data/ext/v8/upstream/3.1.8/src/ia32/lithium-ia32.cc +0 -2095
- data/ext/v8/upstream/3.1.8/src/ia32/lithium-ia32.h +0 -2127
- data/ext/v8/upstream/3.1.8/src/ia32/macro-assembler-ia32.cc +0 -2031
- data/ext/v8/upstream/3.1.8/src/ia32/macro-assembler-ia32.h +0 -798
- data/ext/v8/upstream/3.1.8/src/ia32/regexp-macro-assembler-ia32.cc +0 -1253
- data/ext/v8/upstream/3.1.8/src/ia32/regexp-macro-assembler-ia32.h +0 -215
- data/ext/v8/upstream/3.1.8/src/ia32/register-allocator-ia32.cc +0 -157
- data/ext/v8/upstream/3.1.8/src/ia32/simulator-ia32.h +0 -72
- data/ext/v8/upstream/3.1.8/src/ia32/stub-cache-ia32.cc +0 -3732
- data/ext/v8/upstream/3.1.8/src/ia32/virtual-frame-ia32.cc +0 -1360
- data/ext/v8/upstream/3.1.8/src/ia32/virtual-frame-ia32.h +0 -646
- data/ext/v8/upstream/3.1.8/src/ic-inl.h +0 -129
- data/ext/v8/upstream/3.1.8/src/ic.cc +0 -2333
- data/ext/v8/upstream/3.1.8/src/ic.h +0 -639
- data/ext/v8/upstream/3.1.8/src/interpreter-irregexp.cc +0 -655
- data/ext/v8/upstream/3.1.8/src/interpreter-irregexp.h +0 -48
- data/ext/v8/upstream/3.1.8/src/json.js +0 -342
- data/ext/v8/upstream/3.1.8/src/jsregexp.cc +0 -5340
- data/ext/v8/upstream/3.1.8/src/jsregexp.h +0 -1484
- data/ext/v8/upstream/3.1.8/src/jump-target-heavy.cc +0 -430
- data/ext/v8/upstream/3.1.8/src/jump-target-heavy.h +0 -244
- data/ext/v8/upstream/3.1.8/src/jump-target-inl.h +0 -48
- data/ext/v8/upstream/3.1.8/src/jump-target-light.cc +0 -111
- data/ext/v8/upstream/3.1.8/src/lithium-allocator-inl.h +0 -140
- data/ext/v8/upstream/3.1.8/src/lithium-allocator.cc +0 -2093
- data/ext/v8/upstream/3.1.8/src/lithium-allocator.h +0 -644
- data/ext/v8/upstream/3.1.8/src/lithium.cc +0 -168
- data/ext/v8/upstream/3.1.8/src/liveedit.cc +0 -1650
- data/ext/v8/upstream/3.1.8/src/liveedit.h +0 -174
- data/ext/v8/upstream/3.1.8/src/liveobjectlist.cc +0 -2527
- data/ext/v8/upstream/3.1.8/src/liveobjectlist.h +0 -322
- data/ext/v8/upstream/3.1.8/src/log-utils.cc +0 -336
- data/ext/v8/upstream/3.1.8/src/log-utils.h +0 -232
- data/ext/v8/upstream/3.1.8/src/log.cc +0 -1608
- data/ext/v8/upstream/3.1.8/src/log.h +0 -379
- data/ext/v8/upstream/3.1.8/src/mark-compact.cc +0 -2957
- data/ext/v8/upstream/3.1.8/src/mark-compact.h +0 -433
- data/ext/v8/upstream/3.1.8/src/messages.cc +0 -164
- data/ext/v8/upstream/3.1.8/src/messages.js +0 -1071
- data/ext/v8/upstream/3.1.8/src/mips/assembler-mips-inl.h +0 -215
- data/ext/v8/upstream/3.1.8/src/mips/assembler-mips.cc +0 -1219
- data/ext/v8/upstream/3.1.8/src/mips/assembler-mips.h +0 -667
- data/ext/v8/upstream/3.1.8/src/mips/builtins-mips.cc +0 -205
- data/ext/v8/upstream/3.1.8/src/mips/codegen-mips-inl.h +0 -70
- data/ext/v8/upstream/3.1.8/src/mips/codegen-mips.cc +0 -1437
- data/ext/v8/upstream/3.1.8/src/mips/codegen-mips.h +0 -431
- data/ext/v8/upstream/3.1.8/src/mips/constants-mips.cc +0 -328
- data/ext/v8/upstream/3.1.8/src/mips/constants-mips.h +0 -525
- data/ext/v8/upstream/3.1.8/src/mips/cpu-mips.cc +0 -73
- data/ext/v8/upstream/3.1.8/src/mips/debug-mips.cc +0 -127
- data/ext/v8/upstream/3.1.8/src/mips/disasm-mips.cc +0 -787
- data/ext/v8/upstream/3.1.8/src/mips/fast-codegen-mips.cc +0 -77
- data/ext/v8/upstream/3.1.8/src/mips/frames-mips.cc +0 -96
- data/ext/v8/upstream/3.1.8/src/mips/frames-mips.h +0 -164
- data/ext/v8/upstream/3.1.8/src/mips/full-codegen-mips.cc +0 -277
- data/ext/v8/upstream/3.1.8/src/mips/ic-mips.cc +0 -208
- data/ext/v8/upstream/3.1.8/src/mips/jump-target-mips.cc +0 -175
- data/ext/v8/upstream/3.1.8/src/mips/macro-assembler-mips.cc +0 -1326
- data/ext/v8/upstream/3.1.8/src/mips/macro-assembler-mips.h +0 -461
- data/ext/v8/upstream/3.1.8/src/mips/register-allocator-mips-inl.h +0 -137
- data/ext/v8/upstream/3.1.8/src/mips/register-allocator-mips.h +0 -46
- data/ext/v8/upstream/3.1.8/src/mips/simulator-mips.cc +0 -1650
- data/ext/v8/upstream/3.1.8/src/mips/simulator-mips.h +0 -311
- data/ext/v8/upstream/3.1.8/src/mips/stub-cache-mips.cc +0 -418
- data/ext/v8/upstream/3.1.8/src/mips/virtual-frame-mips.cc +0 -319
- data/ext/v8/upstream/3.1.8/src/mips/virtual-frame-mips.h +0 -548
- data/ext/v8/upstream/3.1.8/src/mirror-debugger.js +0 -2380
- data/ext/v8/upstream/3.1.8/src/mksnapshot.cc +0 -256
- data/ext/v8/upstream/3.1.8/src/objects-debug.cc +0 -722
- data/ext/v8/upstream/3.1.8/src/objects-inl.h +0 -3946
- data/ext/v8/upstream/3.1.8/src/objects-printer.cc +0 -801
- data/ext/v8/upstream/3.1.8/src/objects-visiting.cc +0 -142
- data/ext/v8/upstream/3.1.8/src/objects-visiting.h +0 -401
- data/ext/v8/upstream/3.1.8/src/objects.cc +0 -10044
- data/ext/v8/upstream/3.1.8/src/objects.h +0 -6571
- data/ext/v8/upstream/3.1.8/src/parser.cc +0 -5165
- data/ext/v8/upstream/3.1.8/src/parser.h +0 -802
- data/ext/v8/upstream/3.1.8/src/platform-cygwin.cc +0 -745
- data/ext/v8/upstream/3.1.8/src/platform-freebsd.cc +0 -702
- data/ext/v8/upstream/3.1.8/src/platform-linux.cc +0 -981
- data/ext/v8/upstream/3.1.8/src/platform-macos.cc +0 -732
- data/ext/v8/upstream/3.1.8/src/platform-nullos.cc +0 -498
- data/ext/v8/upstream/3.1.8/src/platform-openbsd.cc +0 -657
- data/ext/v8/upstream/3.1.8/src/platform-posix.cc +0 -399
- data/ext/v8/upstream/3.1.8/src/platform-solaris.cc +0 -714
- data/ext/v8/upstream/3.1.8/src/platform-win32.cc +0 -1974
- data/ext/v8/upstream/3.1.8/src/platform.h +0 -636
- data/ext/v8/upstream/3.1.8/src/preparse-data.cc +0 -183
- data/ext/v8/upstream/3.1.8/src/preparser-api.cc +0 -213
- data/ext/v8/upstream/3.1.8/src/preparser.cc +0 -1205
- data/ext/v8/upstream/3.1.8/src/prettyprinter.cc +0 -1539
- data/ext/v8/upstream/3.1.8/src/prettyprinter.h +0 -223
- data/ext/v8/upstream/3.1.8/src/profile-generator.cc +0 -2899
- data/ext/v8/upstream/3.1.8/src/profile-generator.h +0 -1151
- data/ext/v8/upstream/3.1.8/src/property.cc +0 -96
- data/ext/v8/upstream/3.1.8/src/property.h +0 -337
- data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler-irregexp.cc +0 -470
- data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler.cc +0 -257
- data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler.h +0 -231
- data/ext/v8/upstream/3.1.8/src/regexp-stack.cc +0 -103
- data/ext/v8/upstream/3.1.8/src/regexp-stack.h +0 -123
- data/ext/v8/upstream/3.1.8/src/regexp.js +0 -483
- data/ext/v8/upstream/3.1.8/src/register-allocator-inl.h +0 -141
- data/ext/v8/upstream/3.1.8/src/register-allocator.cc +0 -104
- data/ext/v8/upstream/3.1.8/src/register-allocator.h +0 -320
- data/ext/v8/upstream/3.1.8/src/rewriter.cc +0 -1023
- data/ext/v8/upstream/3.1.8/src/runtime-profiler.cc +0 -443
- data/ext/v8/upstream/3.1.8/src/runtime-profiler.h +0 -77
- data/ext/v8/upstream/3.1.8/src/runtime.cc +0 -11592
- data/ext/v8/upstream/3.1.8/src/runtime.h +0 -582
- data/ext/v8/upstream/3.1.8/src/safepoint-table.cc +0 -253
- data/ext/v8/upstream/3.1.8/src/safepoint-table.h +0 -263
- data/ext/v8/upstream/3.1.8/src/scanner-base.cc +0 -971
- data/ext/v8/upstream/3.1.8/src/scanner-base.h +0 -653
- data/ext/v8/upstream/3.1.8/src/scanner.cc +0 -586
- data/ext/v8/upstream/3.1.8/src/scanner.h +0 -194
- data/ext/v8/upstream/3.1.8/src/scopeinfo.cc +0 -636
- data/ext/v8/upstream/3.1.8/src/scopeinfo.h +0 -238
- data/ext/v8/upstream/3.1.8/src/scopes.cc +0 -1063
- data/ext/v8/upstream/3.1.8/src/scopes.h +0 -494
- data/ext/v8/upstream/3.1.8/src/serialize.cc +0 -1535
- data/ext/v8/upstream/3.1.8/src/serialize.h +0 -584
- data/ext/v8/upstream/3.1.8/src/snapshot-common.cc +0 -82
- data/ext/v8/upstream/3.1.8/src/snapshot.h +0 -71
- data/ext/v8/upstream/3.1.8/src/spaces-inl.h +0 -524
- data/ext/v8/upstream/3.1.8/src/spaces.cc +0 -3254
- data/ext/v8/upstream/3.1.8/src/spaces.h +0 -2362
- data/ext/v8/upstream/3.1.8/src/string-search.cc +0 -40
- data/ext/v8/upstream/3.1.8/src/string-search.h +0 -567
- data/ext/v8/upstream/3.1.8/src/string-stream.cc +0 -584
- data/ext/v8/upstream/3.1.8/src/string.js +0 -915
- data/ext/v8/upstream/3.1.8/src/stub-cache.cc +0 -1878
- data/ext/v8/upstream/3.1.8/src/stub-cache.h +0 -849
- data/ext/v8/upstream/3.1.8/src/token.cc +0 -63
- data/ext/v8/upstream/3.1.8/src/token.h +0 -288
- data/ext/v8/upstream/3.1.8/src/top.cc +0 -1152
- data/ext/v8/upstream/3.1.8/src/top.h +0 -608
- data/ext/v8/upstream/3.1.8/src/type-info.cc +0 -406
- data/ext/v8/upstream/3.1.8/src/type-info.h +0 -283
- data/ext/v8/upstream/3.1.8/src/unicode.cc +0 -1624
- data/ext/v8/upstream/3.1.8/src/unicode.h +0 -280
- data/ext/v8/upstream/3.1.8/src/utils.h +0 -793
- data/ext/v8/upstream/3.1.8/src/v8-counters.cc +0 -55
- data/ext/v8/upstream/3.1.8/src/v8-counters.h +0 -290
- data/ext/v8/upstream/3.1.8/src/v8.cc +0 -270
- data/ext/v8/upstream/3.1.8/src/v8.h +0 -127
- data/ext/v8/upstream/3.1.8/src/v8globals.h +0 -480
- data/ext/v8/upstream/3.1.8/src/v8natives.js +0 -1252
- data/ext/v8/upstream/3.1.8/src/v8threads.cc +0 -440
- data/ext/v8/upstream/3.1.8/src/v8threads.h +0 -157
- data/ext/v8/upstream/3.1.8/src/v8utils.h +0 -354
- data/ext/v8/upstream/3.1.8/src/variables.h +0 -212
- data/ext/v8/upstream/3.1.8/src/version.cc +0 -95
- data/ext/v8/upstream/3.1.8/src/version.h +0 -64
- data/ext/v8/upstream/3.1.8/src/virtual-frame-light-inl.h +0 -170
- data/ext/v8/upstream/3.1.8/src/vm-state-inl.h +0 -134
- data/ext/v8/upstream/3.1.8/src/vm-state.h +0 -68
- data/ext/v8/upstream/3.1.8/src/win32-headers.h +0 -95
- data/ext/v8/upstream/3.1.8/src/x64/assembler-x64-inl.h +0 -455
- data/ext/v8/upstream/3.1.8/src/x64/assembler-x64.cc +0 -3162
- data/ext/v8/upstream/3.1.8/src/x64/assembler-x64.h +0 -1584
- data/ext/v8/upstream/3.1.8/src/x64/builtins-x64.cc +0 -1492
- data/ext/v8/upstream/3.1.8/src/x64/code-stubs-x64.cc +0 -5150
- data/ext/v8/upstream/3.1.8/src/x64/code-stubs-x64.h +0 -519
- data/ext/v8/upstream/3.1.8/src/x64/codegen-x64.cc +0 -8835
- data/ext/v8/upstream/3.1.8/src/x64/codegen-x64.h +0 -750
- data/ext/v8/upstream/3.1.8/src/x64/cpu-x64.cc +0 -86
- data/ext/v8/upstream/3.1.8/src/x64/debug-x64.cc +0 -316
- data/ext/v8/upstream/3.1.8/src/x64/deoptimizer-x64.cc +0 -781
- data/ext/v8/upstream/3.1.8/src/x64/disasm-x64.cc +0 -1737
- data/ext/v8/upstream/3.1.8/src/x64/frames-x64.h +0 -130
- data/ext/v8/upstream/3.1.8/src/x64/full-codegen-x64.cc +0 -3984
- data/ext/v8/upstream/3.1.8/src/x64/ic-x64.cc +0 -1761
- data/ext/v8/upstream/3.1.8/src/x64/lithium-codegen-x64.cc +0 -3639
- data/ext/v8/upstream/3.1.8/src/x64/lithium-codegen-x64.h +0 -305
- data/ext/v8/upstream/3.1.8/src/x64/lithium-x64.cc +0 -2044
- data/ext/v8/upstream/3.1.8/src/x64/lithium-x64.h +0 -2052
- data/ext/v8/upstream/3.1.8/src/x64/macro-assembler-x64.cc +0 -2660
- data/ext/v8/upstream/3.1.8/src/x64/macro-assembler-x64.h +0 -1852
- data/ext/v8/upstream/3.1.8/src/x64/regexp-macro-assembler-x64.cc +0 -1382
- data/ext/v8/upstream/3.1.8/src/x64/regexp-macro-assembler-x64.h +0 -278
- data/ext/v8/upstream/3.1.8/src/x64/register-allocator-x64-inl.h +0 -87
- data/ext/v8/upstream/3.1.8/src/x64/register-allocator-x64.cc +0 -91
- data/ext/v8/upstream/3.1.8/src/x64/simulator-x64.h +0 -71
- data/ext/v8/upstream/3.1.8/src/x64/stub-cache-x64.cc +0 -3509
- data/ext/v8/upstream/3.1.8/src/x64/virtual-frame-x64.cc +0 -1292
- data/ext/v8/upstream/3.1.8/src/x64/virtual-frame-x64.h +0 -593
- data/ext/v8/upstream/3.1.8/src/zone-inl.h +0 -83
- data/ext/v8/upstream/3.1.8/src/zone.cc +0 -195
- data/ext/v8/upstream/3.1.8/src/zone.h +0 -233
- data/ext/v8/upstream/3.1.8/tools/gyp/v8.gyp +0 -869
- data/ext/v8/upstream/3.1.8/tools/linux-tick-processor +0 -33
- data/ext/v8/upstream/3.1.8/tools/tickprocessor.js +0 -863
- data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base.vcproj +0 -1296
- data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base_arm.vcproj +0 -1234
- data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base_x64.vcproj +0 -1296
- data/ext/v8/upstream/3.1.8/tools/visual_studio/x64.vsprops +0 -17
- data/spec/ext/mem_spec.rb +0 -42
@@ -1,165 +0,0 @@
|
|
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
|
-
// The routines exported by this module are subtle. If you use them, even if
|
29
|
-
// you get the code right, it will depend on careful reasoning about atomicity
|
30
|
-
// and memory ordering; it will be less readable, and harder to maintain. If
|
31
|
-
// you plan to use these routines, you should have a good reason, such as solid
|
32
|
-
// evidence that performance would otherwise suffer, or there being no
|
33
|
-
// alternative. You should assume only properties explicitly guaranteed by the
|
34
|
-
// specifications in this file. You are almost certainly _not_ writing code
|
35
|
-
// just for the x86; if you assume x86 semantics, x86 hardware bugs and
|
36
|
-
// implementations on other archtectures will cause your code to break. If you
|
37
|
-
// do not know what you are doing, avoid these routines, and use a Mutex.
|
38
|
-
//
|
39
|
-
// It is incorrect to make direct assignments to/from an atomic variable.
|
40
|
-
// You should use one of the Load or Store routines. The NoBarrier
|
41
|
-
// versions are provided when no barriers are needed:
|
42
|
-
// NoBarrier_Store()
|
43
|
-
// NoBarrier_Load()
|
44
|
-
// Although there are currently no compiler enforcement, you are encouraged
|
45
|
-
// to use these.
|
46
|
-
//
|
47
|
-
|
48
|
-
#ifndef V8_ATOMICOPS_H_
|
49
|
-
#define V8_ATOMICOPS_H_
|
50
|
-
|
51
|
-
#include "../include/v8.h"
|
52
|
-
#include "globals.h"
|
53
|
-
|
54
|
-
namespace v8 {
|
55
|
-
namespace internal {
|
56
|
-
|
57
|
-
typedef int32_t Atomic32;
|
58
|
-
#ifdef V8_HOST_ARCH_64_BIT
|
59
|
-
// We need to be able to go between Atomic64 and AtomicWord implicitly. This
|
60
|
-
// means Atomic64 and AtomicWord should be the same type on 64-bit.
|
61
|
-
#if defined(__APPLE__)
|
62
|
-
// MacOS is an exception to the implicit conversion rule above,
|
63
|
-
// because it uses long for intptr_t.
|
64
|
-
typedef int64_t Atomic64;
|
65
|
-
#else
|
66
|
-
typedef intptr_t Atomic64;
|
67
|
-
#endif
|
68
|
-
#endif
|
69
|
-
|
70
|
-
// Use AtomicWord for a machine-sized pointer. It will use the Atomic32 or
|
71
|
-
// Atomic64 routines below, depending on your architecture.
|
72
|
-
typedef intptr_t AtomicWord;
|
73
|
-
|
74
|
-
// Atomically execute:
|
75
|
-
// result = *ptr;
|
76
|
-
// if (*ptr == old_value)
|
77
|
-
// *ptr = new_value;
|
78
|
-
// return result;
|
79
|
-
//
|
80
|
-
// I.e., replace "*ptr" with "new_value" if "*ptr" used to be "old_value".
|
81
|
-
// Always return the old value of "*ptr"
|
82
|
-
//
|
83
|
-
// This routine implies no memory barriers.
|
84
|
-
Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
|
85
|
-
Atomic32 old_value,
|
86
|
-
Atomic32 new_value);
|
87
|
-
|
88
|
-
// Atomically store new_value into *ptr, returning the previous value held in
|
89
|
-
// *ptr. This routine implies no memory barriers.
|
90
|
-
Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr, Atomic32 new_value);
|
91
|
-
|
92
|
-
// Atomically increment *ptr by "increment". Returns the new value of
|
93
|
-
// *ptr with the increment applied. This routine implies no memory barriers.
|
94
|
-
Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr, Atomic32 increment);
|
95
|
-
|
96
|
-
Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
|
97
|
-
Atomic32 increment);
|
98
|
-
|
99
|
-
// These following lower-level operations are typically useful only to people
|
100
|
-
// implementing higher-level synchronization operations like spinlocks,
|
101
|
-
// mutexes, and condition-variables. They combine CompareAndSwap(), a load, or
|
102
|
-
// a store with appropriate memory-ordering instructions. "Acquire" operations
|
103
|
-
// ensure that no later memory access can be reordered ahead of the operation.
|
104
|
-
// "Release" operations ensure that no previous memory access can be reordered
|
105
|
-
// after the operation. "Barrier" operations have both "Acquire" and "Release"
|
106
|
-
// semantics. A MemoryBarrier() has "Barrier" semantics, but does no memory
|
107
|
-
// access.
|
108
|
-
Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr,
|
109
|
-
Atomic32 old_value,
|
110
|
-
Atomic32 new_value);
|
111
|
-
Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr,
|
112
|
-
Atomic32 old_value,
|
113
|
-
Atomic32 new_value);
|
114
|
-
|
115
|
-
void MemoryBarrier();
|
116
|
-
void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value);
|
117
|
-
void Acquire_Store(volatile Atomic32* ptr, Atomic32 value);
|
118
|
-
void Release_Store(volatile Atomic32* ptr, Atomic32 value);
|
119
|
-
|
120
|
-
Atomic32 NoBarrier_Load(volatile const Atomic32* ptr);
|
121
|
-
Atomic32 Acquire_Load(volatile const Atomic32* ptr);
|
122
|
-
Atomic32 Release_Load(volatile const Atomic32* ptr);
|
123
|
-
|
124
|
-
// 64-bit atomic operations (only available on 64-bit processors).
|
125
|
-
#ifdef V8_HOST_ARCH_64_BIT
|
126
|
-
Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr,
|
127
|
-
Atomic64 old_value,
|
128
|
-
Atomic64 new_value);
|
129
|
-
Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr, Atomic64 new_value);
|
130
|
-
Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr, Atomic64 increment);
|
131
|
-
Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr, Atomic64 increment);
|
132
|
-
|
133
|
-
Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr,
|
134
|
-
Atomic64 old_value,
|
135
|
-
Atomic64 new_value);
|
136
|
-
Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr,
|
137
|
-
Atomic64 old_value,
|
138
|
-
Atomic64 new_value);
|
139
|
-
void NoBarrier_Store(volatile Atomic64* ptr, Atomic64 value);
|
140
|
-
void Acquire_Store(volatile Atomic64* ptr, Atomic64 value);
|
141
|
-
void Release_Store(volatile Atomic64* ptr, Atomic64 value);
|
142
|
-
Atomic64 NoBarrier_Load(volatile const Atomic64* ptr);
|
143
|
-
Atomic64 Acquire_Load(volatile const Atomic64* ptr);
|
144
|
-
Atomic64 Release_Load(volatile const Atomic64* ptr);
|
145
|
-
#endif // V8_HOST_ARCH_64_BIT
|
146
|
-
|
147
|
-
} } // namespace v8::internal
|
148
|
-
|
149
|
-
// Include our platform specific implementation.
|
150
|
-
#if defined(_MSC_VER) && \
|
151
|
-
(defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_X64))
|
152
|
-
#include "atomicops_internals_x86_msvc.h"
|
153
|
-
#elif defined(__APPLE__) && \
|
154
|
-
(defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_X64))
|
155
|
-
#include "atomicops_internals_x86_macosx.h"
|
156
|
-
#elif defined(__GNUC__) && \
|
157
|
-
(defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_X64))
|
158
|
-
#include "atomicops_internals_x86_gcc.h"
|
159
|
-
#elif defined(__GNUC__) && defined(V8_HOST_ARCH_ARM)
|
160
|
-
#include "atomicops_internals_arm_gcc.h"
|
161
|
-
#else
|
162
|
-
#error "Atomic operations are not supported on your platform"
|
163
|
-
#endif
|
164
|
-
|
165
|
-
#endif // V8_ATOMICOPS_H_
|
@@ -1,1888 +0,0 @@
|
|
1
|
-
// Copyright 2006-2008 the V8 project authors. All rights reserved.
|
2
|
-
// Redistribution and use in source and binary forms, with or without
|
3
|
-
// modification, are permitted provided that the following conditions are
|
4
|
-
// met:
|
5
|
-
//
|
6
|
-
// * Redistributions of source code must retain the above copyright
|
7
|
-
// notice, this list of conditions and the following disclaimer.
|
8
|
-
// * Redistributions in binary form must reproduce the above
|
9
|
-
// copyright notice, this list of conditions and the following
|
10
|
-
// disclaimer in the documentation and/or other materials provided
|
11
|
-
// with the distribution.
|
12
|
-
// * Neither the name of Google Inc. nor the names of its
|
13
|
-
// contributors may be used to endorse or promote products derived
|
14
|
-
// from this software without specific prior written permission.
|
15
|
-
//
|
16
|
-
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
17
|
-
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
18
|
-
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
19
|
-
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
20
|
-
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
21
|
-
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
22
|
-
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
23
|
-
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
24
|
-
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
25
|
-
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
26
|
-
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27
|
-
|
28
|
-
#include "v8.h"
|
29
|
-
|
30
|
-
#include "accessors.h"
|
31
|
-
#include "api.h"
|
32
|
-
#include "bootstrapper.h"
|
33
|
-
#include "compiler.h"
|
34
|
-
#include "debug.h"
|
35
|
-
#include "execution.h"
|
36
|
-
#include "global-handles.h"
|
37
|
-
#include "macro-assembler.h"
|
38
|
-
#include "natives.h"
|
39
|
-
#include "objects-visiting.h"
|
40
|
-
#include "snapshot.h"
|
41
|
-
#include "extensions/externalize-string-extension.h"
|
42
|
-
#include "extensions/gc-extension.h"
|
43
|
-
|
44
|
-
namespace v8 {
|
45
|
-
namespace internal {
|
46
|
-
|
47
|
-
// A SourceCodeCache uses a FixedArray to store pairs of
|
48
|
-
// (AsciiString*, JSFunction*), mapping names of native code files
|
49
|
-
// (runtime.js, etc.) to precompiled functions. Instead of mapping
|
50
|
-
// names to functions it might make sense to let the JS2C tool
|
51
|
-
// generate an index for each native JS file.
|
52
|
-
class SourceCodeCache BASE_EMBEDDED {
|
53
|
-
public:
|
54
|
-
explicit SourceCodeCache(Script::Type type): type_(type), cache_(NULL) { }
|
55
|
-
|
56
|
-
void Initialize(bool create_heap_objects) {
|
57
|
-
cache_ = create_heap_objects ? Heap::empty_fixed_array() : NULL;
|
58
|
-
}
|
59
|
-
|
60
|
-
void Iterate(ObjectVisitor* v) {
|
61
|
-
v->VisitPointer(BitCast<Object**>(&cache_));
|
62
|
-
}
|
63
|
-
|
64
|
-
|
65
|
-
bool Lookup(Vector<const char> name, Handle<SharedFunctionInfo>* handle) {
|
66
|
-
for (int i = 0; i < cache_->length(); i+=2) {
|
67
|
-
SeqAsciiString* str = SeqAsciiString::cast(cache_->get(i));
|
68
|
-
if (str->IsEqualTo(name)) {
|
69
|
-
*handle = Handle<SharedFunctionInfo>(
|
70
|
-
SharedFunctionInfo::cast(cache_->get(i + 1)));
|
71
|
-
return true;
|
72
|
-
}
|
73
|
-
}
|
74
|
-
return false;
|
75
|
-
}
|
76
|
-
|
77
|
-
|
78
|
-
void Add(Vector<const char> name, Handle<SharedFunctionInfo> shared) {
|
79
|
-
HandleScope scope;
|
80
|
-
int length = cache_->length();
|
81
|
-
Handle<FixedArray> new_array =
|
82
|
-
Factory::NewFixedArray(length + 2, TENURED);
|
83
|
-
cache_->CopyTo(0, *new_array, 0, cache_->length());
|
84
|
-
cache_ = *new_array;
|
85
|
-
Handle<String> str = Factory::NewStringFromAscii(name, TENURED);
|
86
|
-
cache_->set(length, *str);
|
87
|
-
cache_->set(length + 1, *shared);
|
88
|
-
Script::cast(shared->script())->set_type(Smi::FromInt(type_));
|
89
|
-
}
|
90
|
-
|
91
|
-
private:
|
92
|
-
Script::Type type_;
|
93
|
-
FixedArray* cache_;
|
94
|
-
DISALLOW_COPY_AND_ASSIGN(SourceCodeCache);
|
95
|
-
};
|
96
|
-
|
97
|
-
static SourceCodeCache extensions_cache(Script::TYPE_EXTENSION);
|
98
|
-
// This is for delete, not delete[].
|
99
|
-
static List<char*>* delete_these_non_arrays_on_tear_down = NULL;
|
100
|
-
// This is for delete[]
|
101
|
-
static List<char*>* delete_these_arrays_on_tear_down = NULL;
|
102
|
-
|
103
|
-
|
104
|
-
NativesExternalStringResource::NativesExternalStringResource(const char* source)
|
105
|
-
: data_(source), length_(StrLength(source)) {
|
106
|
-
if (delete_these_non_arrays_on_tear_down == NULL) {
|
107
|
-
delete_these_non_arrays_on_tear_down = new List<char*>(2);
|
108
|
-
}
|
109
|
-
// The resources are small objects and we only make a fixed number of
|
110
|
-
// them, but let's clean them up on exit for neatness.
|
111
|
-
delete_these_non_arrays_on_tear_down->
|
112
|
-
Add(reinterpret_cast<char*>(this));
|
113
|
-
}
|
114
|
-
|
115
|
-
|
116
|
-
Handle<String> Bootstrapper::NativesSourceLookup(int index) {
|
117
|
-
ASSERT(0 <= index && index < Natives::GetBuiltinsCount());
|
118
|
-
if (Heap::natives_source_cache()->get(index)->IsUndefined()) {
|
119
|
-
if (!Snapshot::IsEnabled() || FLAG_new_snapshot) {
|
120
|
-
// We can use external strings for the natives.
|
121
|
-
NativesExternalStringResource* resource =
|
122
|
-
new NativesExternalStringResource(
|
123
|
-
Natives::GetScriptSource(index).start());
|
124
|
-
Handle<String> source_code =
|
125
|
-
Factory::NewExternalStringFromAscii(resource);
|
126
|
-
Heap::natives_source_cache()->set(index, *source_code);
|
127
|
-
} else {
|
128
|
-
// Old snapshot code can't cope with external strings at all.
|
129
|
-
Handle<String> source_code =
|
130
|
-
Factory::NewStringFromAscii(Natives::GetScriptSource(index));
|
131
|
-
Heap::natives_source_cache()->set(index, *source_code);
|
132
|
-
}
|
133
|
-
}
|
134
|
-
Handle<Object> cached_source(Heap::natives_source_cache()->get(index));
|
135
|
-
return Handle<String>::cast(cached_source);
|
136
|
-
}
|
137
|
-
|
138
|
-
|
139
|
-
void Bootstrapper::Initialize(bool create_heap_objects) {
|
140
|
-
extensions_cache.Initialize(create_heap_objects);
|
141
|
-
GCExtension::Register();
|
142
|
-
ExternalizeStringExtension::Register();
|
143
|
-
}
|
144
|
-
|
145
|
-
|
146
|
-
char* Bootstrapper::AllocateAutoDeletedArray(int bytes) {
|
147
|
-
char* memory = new char[bytes];
|
148
|
-
if (memory != NULL) {
|
149
|
-
if (delete_these_arrays_on_tear_down == NULL) {
|
150
|
-
delete_these_arrays_on_tear_down = new List<char*>(2);
|
151
|
-
}
|
152
|
-
delete_these_arrays_on_tear_down->Add(memory);
|
153
|
-
}
|
154
|
-
return memory;
|
155
|
-
}
|
156
|
-
|
157
|
-
|
158
|
-
void Bootstrapper::TearDown() {
|
159
|
-
if (delete_these_non_arrays_on_tear_down != NULL) {
|
160
|
-
int len = delete_these_non_arrays_on_tear_down->length();
|
161
|
-
ASSERT(len < 20); // Don't use this mechanism for unbounded allocations.
|
162
|
-
for (int i = 0; i < len; i++) {
|
163
|
-
delete delete_these_non_arrays_on_tear_down->at(i);
|
164
|
-
delete_these_non_arrays_on_tear_down->at(i) = NULL;
|
165
|
-
}
|
166
|
-
delete delete_these_non_arrays_on_tear_down;
|
167
|
-
delete_these_non_arrays_on_tear_down = NULL;
|
168
|
-
}
|
169
|
-
|
170
|
-
if (delete_these_arrays_on_tear_down != NULL) {
|
171
|
-
int len = delete_these_arrays_on_tear_down->length();
|
172
|
-
ASSERT(len < 1000); // Don't use this mechanism for unbounded allocations.
|
173
|
-
for (int i = 0; i < len; i++) {
|
174
|
-
delete[] delete_these_arrays_on_tear_down->at(i);
|
175
|
-
delete_these_arrays_on_tear_down->at(i) = NULL;
|
176
|
-
}
|
177
|
-
delete delete_these_arrays_on_tear_down;
|
178
|
-
delete_these_arrays_on_tear_down = NULL;
|
179
|
-
}
|
180
|
-
|
181
|
-
extensions_cache.Initialize(false); // Yes, symmetrical
|
182
|
-
}
|
183
|
-
|
184
|
-
|
185
|
-
class Genesis BASE_EMBEDDED {
|
186
|
-
public:
|
187
|
-
Genesis(Handle<Object> global_object,
|
188
|
-
v8::Handle<v8::ObjectTemplate> global_template,
|
189
|
-
v8::ExtensionConfiguration* extensions);
|
190
|
-
~Genesis() { }
|
191
|
-
|
192
|
-
Handle<Context> result() { return result_; }
|
193
|
-
|
194
|
-
Genesis* previous() { return previous_; }
|
195
|
-
|
196
|
-
private:
|
197
|
-
Handle<Context> global_context_;
|
198
|
-
|
199
|
-
// There may be more than one active genesis object: When GC is
|
200
|
-
// triggered during environment creation there may be weak handle
|
201
|
-
// processing callbacks which may create new environments.
|
202
|
-
Genesis* previous_;
|
203
|
-
|
204
|
-
Handle<Context> global_context() { return global_context_; }
|
205
|
-
|
206
|
-
// Creates some basic objects. Used for creating a context from scratch.
|
207
|
-
void CreateRoots();
|
208
|
-
// Creates the empty function. Used for creating a context from scratch.
|
209
|
-
Handle<JSFunction> CreateEmptyFunction();
|
210
|
-
// Creates the global objects using the global and the template passed in
|
211
|
-
// through the API. We call this regardless of whether we are building a
|
212
|
-
// context from scratch or using a deserialized one from the partial snapshot
|
213
|
-
// but in the latter case we don't use the objects it produces directly, as
|
214
|
-
// we have to used the deserialized ones that are linked together with the
|
215
|
-
// rest of the context snapshot.
|
216
|
-
Handle<JSGlobalProxy> CreateNewGlobals(
|
217
|
-
v8::Handle<v8::ObjectTemplate> global_template,
|
218
|
-
Handle<Object> global_object,
|
219
|
-
Handle<GlobalObject>* global_proxy_out);
|
220
|
-
// Hooks the given global proxy into the context. If the context was created
|
221
|
-
// by deserialization then this will unhook the global proxy that was
|
222
|
-
// deserialized, leaving the GC to pick it up.
|
223
|
-
void HookUpGlobalProxy(Handle<GlobalObject> inner_global,
|
224
|
-
Handle<JSGlobalProxy> global_proxy);
|
225
|
-
// Similarly, we want to use the inner global that has been created by the
|
226
|
-
// templates passed through the API. The inner global from the snapshot is
|
227
|
-
// detached from the other objects in the snapshot.
|
228
|
-
void HookUpInnerGlobal(Handle<GlobalObject> inner_global);
|
229
|
-
// New context initialization. Used for creating a context from scratch.
|
230
|
-
void InitializeGlobal(Handle<GlobalObject> inner_global,
|
231
|
-
Handle<JSFunction> empty_function);
|
232
|
-
// Installs the contents of the native .js files on the global objects.
|
233
|
-
// Used for creating a context from scratch.
|
234
|
-
void InstallNativeFunctions();
|
235
|
-
bool InstallNatives();
|
236
|
-
void InstallBuiltinFunctionIds();
|
237
|
-
void InstallJSFunctionResultCaches();
|
238
|
-
void InitializeNormalizedMapCaches();
|
239
|
-
// Used both for deserialized and from-scratch contexts to add the extensions
|
240
|
-
// provided.
|
241
|
-
static bool InstallExtensions(Handle<Context> global_context,
|
242
|
-
v8::ExtensionConfiguration* extensions);
|
243
|
-
static bool InstallExtension(const char* name);
|
244
|
-
static bool InstallExtension(v8::RegisteredExtension* current);
|
245
|
-
static void InstallSpecialObjects(Handle<Context> global_context);
|
246
|
-
bool InstallJSBuiltins(Handle<JSBuiltinsObject> builtins);
|
247
|
-
bool ConfigureApiObject(Handle<JSObject> object,
|
248
|
-
Handle<ObjectTemplateInfo> object_template);
|
249
|
-
bool ConfigureGlobalObjects(v8::Handle<v8::ObjectTemplate> global_template);
|
250
|
-
|
251
|
-
// Migrates all properties from the 'from' object to the 'to'
|
252
|
-
// object and overrides the prototype in 'to' with the one from
|
253
|
-
// 'from'.
|
254
|
-
void TransferObject(Handle<JSObject> from, Handle<JSObject> to);
|
255
|
-
void TransferNamedProperties(Handle<JSObject> from, Handle<JSObject> to);
|
256
|
-
void TransferIndexedProperties(Handle<JSObject> from, Handle<JSObject> to);
|
257
|
-
|
258
|
-
enum PrototypePropertyMode {
|
259
|
-
DONT_ADD_PROTOTYPE,
|
260
|
-
ADD_READONLY_PROTOTYPE,
|
261
|
-
ADD_WRITEABLE_PROTOTYPE
|
262
|
-
};
|
263
|
-
Handle<DescriptorArray> ComputeFunctionInstanceDescriptor(
|
264
|
-
PrototypePropertyMode prototypeMode);
|
265
|
-
void MakeFunctionInstancePrototypeWritable();
|
266
|
-
|
267
|
-
static bool CompileBuiltin(int index);
|
268
|
-
static bool CompileNative(Vector<const char> name, Handle<String> source);
|
269
|
-
static bool CompileScriptCached(Vector<const char> name,
|
270
|
-
Handle<String> source,
|
271
|
-
SourceCodeCache* cache,
|
272
|
-
v8::Extension* extension,
|
273
|
-
Handle<Context> top_context,
|
274
|
-
bool use_runtime_context);
|
275
|
-
|
276
|
-
Handle<Context> result_;
|
277
|
-
Handle<JSFunction> empty_function_;
|
278
|
-
BootstrapperActive active_;
|
279
|
-
friend class Bootstrapper;
|
280
|
-
};
|
281
|
-
|
282
|
-
|
283
|
-
void Bootstrapper::Iterate(ObjectVisitor* v) {
|
284
|
-
extensions_cache.Iterate(v);
|
285
|
-
v->Synchronize("Extensions");
|
286
|
-
}
|
287
|
-
|
288
|
-
|
289
|
-
Handle<Context> Bootstrapper::CreateEnvironment(
|
290
|
-
Handle<Object> global_object,
|
291
|
-
v8::Handle<v8::ObjectTemplate> global_template,
|
292
|
-
v8::ExtensionConfiguration* extensions) {
|
293
|
-
HandleScope scope;
|
294
|
-
Handle<Context> env;
|
295
|
-
Genesis genesis(global_object, global_template, extensions);
|
296
|
-
env = genesis.result();
|
297
|
-
if (!env.is_null()) {
|
298
|
-
if (InstallExtensions(env, extensions)) {
|
299
|
-
return env;
|
300
|
-
}
|
301
|
-
}
|
302
|
-
return Handle<Context>();
|
303
|
-
}
|
304
|
-
|
305
|
-
|
306
|
-
static void SetObjectPrototype(Handle<JSObject> object, Handle<Object> proto) {
|
307
|
-
// object.__proto__ = proto;
|
308
|
-
Handle<Map> old_to_map = Handle<Map>(object->map());
|
309
|
-
Handle<Map> new_to_map = Factory::CopyMapDropTransitions(old_to_map);
|
310
|
-
new_to_map->set_prototype(*proto);
|
311
|
-
object->set_map(*new_to_map);
|
312
|
-
}
|
313
|
-
|
314
|
-
|
315
|
-
void Bootstrapper::DetachGlobal(Handle<Context> env) {
|
316
|
-
JSGlobalProxy::cast(env->global_proxy())->set_context(*Factory::null_value());
|
317
|
-
SetObjectPrototype(Handle<JSObject>(env->global_proxy()),
|
318
|
-
Factory::null_value());
|
319
|
-
env->set_global_proxy(env->global());
|
320
|
-
env->global()->set_global_receiver(env->global());
|
321
|
-
}
|
322
|
-
|
323
|
-
|
324
|
-
void Bootstrapper::ReattachGlobal(Handle<Context> env,
|
325
|
-
Handle<Object> global_object) {
|
326
|
-
ASSERT(global_object->IsJSGlobalProxy());
|
327
|
-
Handle<JSGlobalProxy> global = Handle<JSGlobalProxy>::cast(global_object);
|
328
|
-
env->global()->set_global_receiver(*global);
|
329
|
-
env->set_global_proxy(*global);
|
330
|
-
SetObjectPrototype(global, Handle<JSObject>(env->global()));
|
331
|
-
global->set_context(*env);
|
332
|
-
}
|
333
|
-
|
334
|
-
|
335
|
-
static Handle<JSFunction> InstallFunction(Handle<JSObject> target,
|
336
|
-
const char* name,
|
337
|
-
InstanceType type,
|
338
|
-
int instance_size,
|
339
|
-
Handle<JSObject> prototype,
|
340
|
-
Builtins::Name call,
|
341
|
-
bool is_ecma_native) {
|
342
|
-
Handle<String> symbol = Factory::LookupAsciiSymbol(name);
|
343
|
-
Handle<Code> call_code = Handle<Code>(Builtins::builtin(call));
|
344
|
-
Handle<JSFunction> function = prototype.is_null() ?
|
345
|
-
Factory::NewFunctionWithoutPrototype(symbol, call_code) :
|
346
|
-
Factory::NewFunctionWithPrototype(symbol,
|
347
|
-
type,
|
348
|
-
instance_size,
|
349
|
-
prototype,
|
350
|
-
call_code,
|
351
|
-
is_ecma_native);
|
352
|
-
SetLocalPropertyNoThrow(target, symbol, function, DONT_ENUM);
|
353
|
-
if (is_ecma_native) {
|
354
|
-
function->shared()->set_instance_class_name(*symbol);
|
355
|
-
}
|
356
|
-
return function;
|
357
|
-
}
|
358
|
-
|
359
|
-
|
360
|
-
Handle<DescriptorArray> Genesis::ComputeFunctionInstanceDescriptor(
|
361
|
-
PrototypePropertyMode prototypeMode) {
|
362
|
-
Handle<DescriptorArray> result = Factory::empty_descriptor_array();
|
363
|
-
|
364
|
-
if (prototypeMode != DONT_ADD_PROTOTYPE) {
|
365
|
-
PropertyAttributes attributes = static_cast<PropertyAttributes>(
|
366
|
-
DONT_ENUM |
|
367
|
-
DONT_DELETE |
|
368
|
-
(prototypeMode == ADD_READONLY_PROTOTYPE ? READ_ONLY : 0));
|
369
|
-
result =
|
370
|
-
Factory::CopyAppendProxyDescriptor(
|
371
|
-
result,
|
372
|
-
Factory::prototype_symbol(),
|
373
|
-
Factory::NewProxy(&Accessors::FunctionPrototype),
|
374
|
-
attributes);
|
375
|
-
}
|
376
|
-
|
377
|
-
PropertyAttributes attributes =
|
378
|
-
static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY);
|
379
|
-
// Add length.
|
380
|
-
result =
|
381
|
-
Factory::CopyAppendProxyDescriptor(
|
382
|
-
result,
|
383
|
-
Factory::length_symbol(),
|
384
|
-
Factory::NewProxy(&Accessors::FunctionLength),
|
385
|
-
attributes);
|
386
|
-
|
387
|
-
// Add name.
|
388
|
-
result =
|
389
|
-
Factory::CopyAppendProxyDescriptor(
|
390
|
-
result,
|
391
|
-
Factory::name_symbol(),
|
392
|
-
Factory::NewProxy(&Accessors::FunctionName),
|
393
|
-
attributes);
|
394
|
-
|
395
|
-
// Add arguments.
|
396
|
-
result =
|
397
|
-
Factory::CopyAppendProxyDescriptor(
|
398
|
-
result,
|
399
|
-
Factory::arguments_symbol(),
|
400
|
-
Factory::NewProxy(&Accessors::FunctionArguments),
|
401
|
-
attributes);
|
402
|
-
|
403
|
-
// Add caller.
|
404
|
-
result =
|
405
|
-
Factory::CopyAppendProxyDescriptor(
|
406
|
-
result,
|
407
|
-
Factory::caller_symbol(),
|
408
|
-
Factory::NewProxy(&Accessors::FunctionCaller),
|
409
|
-
attributes);
|
410
|
-
|
411
|
-
return result;
|
412
|
-
}
|
413
|
-
|
414
|
-
|
415
|
-
Handle<JSFunction> Genesis::CreateEmptyFunction() {
|
416
|
-
// Allocate the map for function instances.
|
417
|
-
Handle<Map> fm = Factory::NewMap(JS_FUNCTION_TYPE, JSFunction::kSize);
|
418
|
-
global_context()->set_function_instance_map(*fm);
|
419
|
-
// Please note that the prototype property for function instances must be
|
420
|
-
// writable.
|
421
|
-
Handle<DescriptorArray> function_map_descriptors =
|
422
|
-
ComputeFunctionInstanceDescriptor(ADD_WRITEABLE_PROTOTYPE);
|
423
|
-
fm->set_instance_descriptors(*function_map_descriptors);
|
424
|
-
fm->set_function_with_prototype(true);
|
425
|
-
|
426
|
-
// Functions with this map will not have a 'prototype' property, and
|
427
|
-
// can not be used as constructors.
|
428
|
-
Handle<Map> function_without_prototype_map =
|
429
|
-
Factory::NewMap(JS_FUNCTION_TYPE, JSFunction::kSize);
|
430
|
-
global_context()->set_function_without_prototype_map(
|
431
|
-
*function_without_prototype_map);
|
432
|
-
Handle<DescriptorArray> function_without_prototype_map_descriptors =
|
433
|
-
ComputeFunctionInstanceDescriptor(DONT_ADD_PROTOTYPE);
|
434
|
-
function_without_prototype_map->set_instance_descriptors(
|
435
|
-
*function_without_prototype_map_descriptors);
|
436
|
-
function_without_prototype_map->set_function_with_prototype(false);
|
437
|
-
|
438
|
-
// Allocate the function map first and then patch the prototype later
|
439
|
-
fm = Factory::NewMap(JS_FUNCTION_TYPE, JSFunction::kSize);
|
440
|
-
global_context()->set_function_map(*fm);
|
441
|
-
function_map_descriptors =
|
442
|
-
ComputeFunctionInstanceDescriptor(ADD_READONLY_PROTOTYPE);
|
443
|
-
fm->set_instance_descriptors(*function_map_descriptors);
|
444
|
-
fm->set_function_with_prototype(true);
|
445
|
-
|
446
|
-
Handle<String> object_name = Handle<String>(Heap::Object_symbol());
|
447
|
-
|
448
|
-
{ // --- O b j e c t ---
|
449
|
-
Handle<JSFunction> object_fun =
|
450
|
-
Factory::NewFunction(object_name, Factory::null_value());
|
451
|
-
Handle<Map> object_function_map =
|
452
|
-
Factory::NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize);
|
453
|
-
object_fun->set_initial_map(*object_function_map);
|
454
|
-
object_function_map->set_constructor(*object_fun);
|
455
|
-
|
456
|
-
global_context()->set_object_function(*object_fun);
|
457
|
-
|
458
|
-
// Allocate a new prototype for the object function.
|
459
|
-
Handle<JSObject> prototype = Factory::NewJSObject(Top::object_function(),
|
460
|
-
TENURED);
|
461
|
-
|
462
|
-
global_context()->set_initial_object_prototype(*prototype);
|
463
|
-
SetPrototype(object_fun, prototype);
|
464
|
-
object_function_map->
|
465
|
-
set_instance_descriptors(Heap::empty_descriptor_array());
|
466
|
-
}
|
467
|
-
|
468
|
-
// Allocate the empty function as the prototype for function ECMAScript
|
469
|
-
// 262 15.3.4.
|
470
|
-
Handle<String> symbol = Factory::LookupAsciiSymbol("Empty");
|
471
|
-
Handle<JSFunction> empty_function =
|
472
|
-
Factory::NewFunctionWithoutPrototype(symbol);
|
473
|
-
|
474
|
-
// --- E m p t y ---
|
475
|
-
Handle<Code> code =
|
476
|
-
Handle<Code>(Builtins::builtin(Builtins::EmptyFunction));
|
477
|
-
empty_function->set_code(*code);
|
478
|
-
empty_function->shared()->set_code(*code);
|
479
|
-
Handle<String> source = Factory::NewStringFromAscii(CStrVector("() {}"));
|
480
|
-
Handle<Script> script = Factory::NewScript(source);
|
481
|
-
script->set_type(Smi::FromInt(Script::TYPE_NATIVE));
|
482
|
-
empty_function->shared()->set_script(*script);
|
483
|
-
empty_function->shared()->set_start_position(0);
|
484
|
-
empty_function->shared()->set_end_position(source->length());
|
485
|
-
empty_function->shared()->DontAdaptArguments();
|
486
|
-
global_context()->function_map()->set_prototype(*empty_function);
|
487
|
-
global_context()->function_instance_map()->set_prototype(*empty_function);
|
488
|
-
global_context()->function_without_prototype_map()->
|
489
|
-
set_prototype(*empty_function);
|
490
|
-
|
491
|
-
// Allocate the function map first and then patch the prototype later
|
492
|
-
Handle<Map> empty_fm = Factory::CopyMapDropDescriptors(
|
493
|
-
function_without_prototype_map);
|
494
|
-
empty_fm->set_instance_descriptors(
|
495
|
-
*function_without_prototype_map_descriptors);
|
496
|
-
empty_fm->set_prototype(global_context()->object_function()->prototype());
|
497
|
-
empty_function->set_map(*empty_fm);
|
498
|
-
return empty_function;
|
499
|
-
}
|
500
|
-
|
501
|
-
|
502
|
-
static void AddToWeakGlobalContextList(Context* context) {
|
503
|
-
ASSERT(context->IsGlobalContext());
|
504
|
-
#ifdef DEBUG
|
505
|
-
{ // NOLINT
|
506
|
-
ASSERT(context->get(Context::NEXT_CONTEXT_LINK)->IsUndefined());
|
507
|
-
// Check that context is not in the list yet.
|
508
|
-
for (Object* current = Heap::global_contexts_list();
|
509
|
-
!current->IsUndefined();
|
510
|
-
current = Context::cast(current)->get(Context::NEXT_CONTEXT_LINK)) {
|
511
|
-
ASSERT(current != context);
|
512
|
-
}
|
513
|
-
}
|
514
|
-
#endif
|
515
|
-
context->set(Context::NEXT_CONTEXT_LINK, Heap::global_contexts_list());
|
516
|
-
Heap::set_global_contexts_list(context);
|
517
|
-
}
|
518
|
-
|
519
|
-
|
520
|
-
void Genesis::CreateRoots() {
|
521
|
-
// Allocate the global context FixedArray first and then patch the
|
522
|
-
// closure and extension object later (we need the empty function
|
523
|
-
// and the global object, but in order to create those, we need the
|
524
|
-
// global context).
|
525
|
-
global_context_ =
|
526
|
-
Handle<Context>::cast(
|
527
|
-
GlobalHandles::Create(*Factory::NewGlobalContext()));
|
528
|
-
AddToWeakGlobalContextList(*global_context_);
|
529
|
-
Top::set_context(*global_context());
|
530
|
-
|
531
|
-
// Allocate the message listeners object.
|
532
|
-
{
|
533
|
-
v8::NeanderArray listeners;
|
534
|
-
global_context()->set_message_listeners(*listeners.value());
|
535
|
-
}
|
536
|
-
}
|
537
|
-
|
538
|
-
|
539
|
-
Handle<JSGlobalProxy> Genesis::CreateNewGlobals(
|
540
|
-
v8::Handle<v8::ObjectTemplate> global_template,
|
541
|
-
Handle<Object> global_object,
|
542
|
-
Handle<GlobalObject>* inner_global_out) {
|
543
|
-
// The argument global_template aka data is an ObjectTemplateInfo.
|
544
|
-
// It has a constructor pointer that points at global_constructor which is a
|
545
|
-
// FunctionTemplateInfo.
|
546
|
-
// The global_constructor is used to create or reinitialize the global_proxy.
|
547
|
-
// The global_constructor also has a prototype_template pointer that points at
|
548
|
-
// js_global_template which is an ObjectTemplateInfo.
|
549
|
-
// That in turn has a constructor pointer that points at
|
550
|
-
// js_global_constructor which is a FunctionTemplateInfo.
|
551
|
-
// js_global_constructor is used to make js_global_function
|
552
|
-
// js_global_function is used to make the new inner_global.
|
553
|
-
//
|
554
|
-
// --- G l o b a l ---
|
555
|
-
// Step 1: Create a fresh inner JSGlobalObject.
|
556
|
-
Handle<JSFunction> js_global_function;
|
557
|
-
Handle<ObjectTemplateInfo> js_global_template;
|
558
|
-
if (!global_template.IsEmpty()) {
|
559
|
-
// Get prototype template of the global_template.
|
560
|
-
Handle<ObjectTemplateInfo> data =
|
561
|
-
v8::Utils::OpenHandle(*global_template);
|
562
|
-
Handle<FunctionTemplateInfo> global_constructor =
|
563
|
-
Handle<FunctionTemplateInfo>(
|
564
|
-
FunctionTemplateInfo::cast(data->constructor()));
|
565
|
-
Handle<Object> proto_template(global_constructor->prototype_template());
|
566
|
-
if (!proto_template->IsUndefined()) {
|
567
|
-
js_global_template =
|
568
|
-
Handle<ObjectTemplateInfo>::cast(proto_template);
|
569
|
-
}
|
570
|
-
}
|
571
|
-
|
572
|
-
if (js_global_template.is_null()) {
|
573
|
-
Handle<String> name = Handle<String>(Heap::empty_symbol());
|
574
|
-
Handle<Code> code = Handle<Code>(Builtins::builtin(Builtins::Illegal));
|
575
|
-
js_global_function =
|
576
|
-
Factory::NewFunction(name, JS_GLOBAL_OBJECT_TYPE,
|
577
|
-
JSGlobalObject::kSize, code, true);
|
578
|
-
// Change the constructor property of the prototype of the
|
579
|
-
// hidden global function to refer to the Object function.
|
580
|
-
Handle<JSObject> prototype =
|
581
|
-
Handle<JSObject>(
|
582
|
-
JSObject::cast(js_global_function->instance_prototype()));
|
583
|
-
SetLocalPropertyNoThrow(
|
584
|
-
prototype, Factory::constructor_symbol(), Top::object_function(), NONE);
|
585
|
-
} else {
|
586
|
-
Handle<FunctionTemplateInfo> js_global_constructor(
|
587
|
-
FunctionTemplateInfo::cast(js_global_template->constructor()));
|
588
|
-
js_global_function =
|
589
|
-
Factory::CreateApiFunction(js_global_constructor,
|
590
|
-
Factory::InnerGlobalObject);
|
591
|
-
}
|
592
|
-
|
593
|
-
js_global_function->initial_map()->set_is_hidden_prototype();
|
594
|
-
Handle<GlobalObject> inner_global =
|
595
|
-
Factory::NewGlobalObject(js_global_function);
|
596
|
-
if (inner_global_out != NULL) {
|
597
|
-
*inner_global_out = inner_global;
|
598
|
-
}
|
599
|
-
|
600
|
-
// Step 2: create or re-initialize the global proxy object.
|
601
|
-
Handle<JSFunction> global_proxy_function;
|
602
|
-
if (global_template.IsEmpty()) {
|
603
|
-
Handle<String> name = Handle<String>(Heap::empty_symbol());
|
604
|
-
Handle<Code> code = Handle<Code>(Builtins::builtin(Builtins::Illegal));
|
605
|
-
global_proxy_function =
|
606
|
-
Factory::NewFunction(name, JS_GLOBAL_PROXY_TYPE,
|
607
|
-
JSGlobalProxy::kSize, code, true);
|
608
|
-
} else {
|
609
|
-
Handle<ObjectTemplateInfo> data =
|
610
|
-
v8::Utils::OpenHandle(*global_template);
|
611
|
-
Handle<FunctionTemplateInfo> global_constructor(
|
612
|
-
FunctionTemplateInfo::cast(data->constructor()));
|
613
|
-
global_proxy_function =
|
614
|
-
Factory::CreateApiFunction(global_constructor,
|
615
|
-
Factory::OuterGlobalObject);
|
616
|
-
}
|
617
|
-
|
618
|
-
Handle<String> global_name = Factory::LookupAsciiSymbol("global");
|
619
|
-
global_proxy_function->shared()->set_instance_class_name(*global_name);
|
620
|
-
global_proxy_function->initial_map()->set_is_access_check_needed(true);
|
621
|
-
|
622
|
-
// Set global_proxy.__proto__ to js_global after ConfigureGlobalObjects
|
623
|
-
// Return the global proxy.
|
624
|
-
|
625
|
-
if (global_object.location() != NULL) {
|
626
|
-
ASSERT(global_object->IsJSGlobalProxy());
|
627
|
-
return ReinitializeJSGlobalProxy(
|
628
|
-
global_proxy_function,
|
629
|
-
Handle<JSGlobalProxy>::cast(global_object));
|
630
|
-
} else {
|
631
|
-
return Handle<JSGlobalProxy>::cast(
|
632
|
-
Factory::NewJSObject(global_proxy_function, TENURED));
|
633
|
-
}
|
634
|
-
}
|
635
|
-
|
636
|
-
|
637
|
-
void Genesis::HookUpGlobalProxy(Handle<GlobalObject> inner_global,
|
638
|
-
Handle<JSGlobalProxy> global_proxy) {
|
639
|
-
// Set the global context for the global object.
|
640
|
-
inner_global->set_global_context(*global_context());
|
641
|
-
inner_global->set_global_receiver(*global_proxy);
|
642
|
-
global_proxy->set_context(*global_context());
|
643
|
-
global_context()->set_global_proxy(*global_proxy);
|
644
|
-
}
|
645
|
-
|
646
|
-
|
647
|
-
void Genesis::HookUpInnerGlobal(Handle<GlobalObject> inner_global) {
|
648
|
-
Handle<GlobalObject> inner_global_from_snapshot(
|
649
|
-
GlobalObject::cast(global_context_->extension()));
|
650
|
-
Handle<JSBuiltinsObject> builtins_global(global_context_->builtins());
|
651
|
-
global_context_->set_extension(*inner_global);
|
652
|
-
global_context_->set_global(*inner_global);
|
653
|
-
global_context_->set_security_token(*inner_global);
|
654
|
-
static const PropertyAttributes attributes =
|
655
|
-
static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE);
|
656
|
-
ForceSetProperty(builtins_global,
|
657
|
-
Factory::LookupAsciiSymbol("global"),
|
658
|
-
inner_global,
|
659
|
-
attributes);
|
660
|
-
// Setup the reference from the global object to the builtins object.
|
661
|
-
JSGlobalObject::cast(*inner_global)->set_builtins(*builtins_global);
|
662
|
-
TransferNamedProperties(inner_global_from_snapshot, inner_global);
|
663
|
-
TransferIndexedProperties(inner_global_from_snapshot, inner_global);
|
664
|
-
}
|
665
|
-
|
666
|
-
|
667
|
-
// This is only called if we are not using snapshots. The equivalent
|
668
|
-
// work in the snapshot case is done in HookUpInnerGlobal.
|
669
|
-
void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
|
670
|
-
Handle<JSFunction> empty_function) {
|
671
|
-
// --- G l o b a l C o n t e x t ---
|
672
|
-
// Use the empty function as closure (no scope info).
|
673
|
-
global_context()->set_closure(*empty_function);
|
674
|
-
global_context()->set_fcontext(*global_context());
|
675
|
-
global_context()->set_previous(NULL);
|
676
|
-
// Set extension and global object.
|
677
|
-
global_context()->set_extension(*inner_global);
|
678
|
-
global_context()->set_global(*inner_global);
|
679
|
-
// Security setup: Set the security token of the global object to
|
680
|
-
// its the inner global. This makes the security check between two
|
681
|
-
// different contexts fail by default even in case of global
|
682
|
-
// object reinitialization.
|
683
|
-
global_context()->set_security_token(*inner_global);
|
684
|
-
|
685
|
-
Handle<String> object_name = Handle<String>(Heap::Object_symbol());
|
686
|
-
SetLocalPropertyNoThrow(inner_global, object_name,
|
687
|
-
Top::object_function(), DONT_ENUM);
|
688
|
-
|
689
|
-
Handle<JSObject> global = Handle<JSObject>(global_context()->global());
|
690
|
-
|
691
|
-
// Install global Function object
|
692
|
-
InstallFunction(global, "Function", JS_FUNCTION_TYPE, JSFunction::kSize,
|
693
|
-
empty_function, Builtins::Illegal, true); // ECMA native.
|
694
|
-
|
695
|
-
{ // --- A r r a y ---
|
696
|
-
Handle<JSFunction> array_function =
|
697
|
-
InstallFunction(global, "Array", JS_ARRAY_TYPE, JSArray::kSize,
|
698
|
-
Top::initial_object_prototype(), Builtins::ArrayCode,
|
699
|
-
true);
|
700
|
-
array_function->shared()->set_construct_stub(
|
701
|
-
Builtins::builtin(Builtins::ArrayConstructCode));
|
702
|
-
array_function->shared()->DontAdaptArguments();
|
703
|
-
|
704
|
-
// This seems a bit hackish, but we need to make sure Array.length
|
705
|
-
// is 1.
|
706
|
-
array_function->shared()->set_length(1);
|
707
|
-
Handle<DescriptorArray> array_descriptors =
|
708
|
-
Factory::CopyAppendProxyDescriptor(
|
709
|
-
Factory::empty_descriptor_array(),
|
710
|
-
Factory::length_symbol(),
|
711
|
-
Factory::NewProxy(&Accessors::ArrayLength),
|
712
|
-
static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE));
|
713
|
-
|
714
|
-
// Cache the fast JavaScript array map
|
715
|
-
global_context()->set_js_array_map(array_function->initial_map());
|
716
|
-
global_context()->js_array_map()->set_instance_descriptors(
|
717
|
-
*array_descriptors);
|
718
|
-
// array_function is used internally. JS code creating array object should
|
719
|
-
// search for the 'Array' property on the global object and use that one
|
720
|
-
// as the constructor. 'Array' property on a global object can be
|
721
|
-
// overwritten by JS code.
|
722
|
-
global_context()->set_array_function(*array_function);
|
723
|
-
}
|
724
|
-
|
725
|
-
{ // --- N u m b e r ---
|
726
|
-
Handle<JSFunction> number_fun =
|
727
|
-
InstallFunction(global, "Number", JS_VALUE_TYPE, JSValue::kSize,
|
728
|
-
Top::initial_object_prototype(), Builtins::Illegal,
|
729
|
-
true);
|
730
|
-
global_context()->set_number_function(*number_fun);
|
731
|
-
}
|
732
|
-
|
733
|
-
{ // --- B o o l e a n ---
|
734
|
-
Handle<JSFunction> boolean_fun =
|
735
|
-
InstallFunction(global, "Boolean", JS_VALUE_TYPE, JSValue::kSize,
|
736
|
-
Top::initial_object_prototype(), Builtins::Illegal,
|
737
|
-
true);
|
738
|
-
global_context()->set_boolean_function(*boolean_fun);
|
739
|
-
}
|
740
|
-
|
741
|
-
{ // --- S t r i n g ---
|
742
|
-
Handle<JSFunction> string_fun =
|
743
|
-
InstallFunction(global, "String", JS_VALUE_TYPE, JSValue::kSize,
|
744
|
-
Top::initial_object_prototype(), Builtins::Illegal,
|
745
|
-
true);
|
746
|
-
string_fun->shared()->set_construct_stub(
|
747
|
-
Builtins::builtin(Builtins::StringConstructCode));
|
748
|
-
global_context()->set_string_function(*string_fun);
|
749
|
-
// Add 'length' property to strings.
|
750
|
-
Handle<DescriptorArray> string_descriptors =
|
751
|
-
Factory::CopyAppendProxyDescriptor(
|
752
|
-
Factory::empty_descriptor_array(),
|
753
|
-
Factory::length_symbol(),
|
754
|
-
Factory::NewProxy(&Accessors::StringLength),
|
755
|
-
static_cast<PropertyAttributes>(DONT_ENUM |
|
756
|
-
DONT_DELETE |
|
757
|
-
READ_ONLY));
|
758
|
-
|
759
|
-
Handle<Map> string_map =
|
760
|
-
Handle<Map>(global_context()->string_function()->initial_map());
|
761
|
-
string_map->set_instance_descriptors(*string_descriptors);
|
762
|
-
}
|
763
|
-
|
764
|
-
{ // --- D a t e ---
|
765
|
-
// Builtin functions for Date.prototype.
|
766
|
-
Handle<JSFunction> date_fun =
|
767
|
-
InstallFunction(global, "Date", JS_VALUE_TYPE, JSValue::kSize,
|
768
|
-
Top::initial_object_prototype(), Builtins::Illegal,
|
769
|
-
true);
|
770
|
-
|
771
|
-
global_context()->set_date_function(*date_fun);
|
772
|
-
}
|
773
|
-
|
774
|
-
|
775
|
-
{ // -- R e g E x p
|
776
|
-
// Builtin functions for RegExp.prototype.
|
777
|
-
Handle<JSFunction> regexp_fun =
|
778
|
-
InstallFunction(global, "RegExp", JS_REGEXP_TYPE, JSRegExp::kSize,
|
779
|
-
Top::initial_object_prototype(), Builtins::Illegal,
|
780
|
-
true);
|
781
|
-
global_context()->set_regexp_function(*regexp_fun);
|
782
|
-
|
783
|
-
ASSERT(regexp_fun->has_initial_map());
|
784
|
-
Handle<Map> initial_map(regexp_fun->initial_map());
|
785
|
-
|
786
|
-
ASSERT_EQ(0, initial_map->inobject_properties());
|
787
|
-
|
788
|
-
Handle<DescriptorArray> descriptors = Factory::NewDescriptorArray(5);
|
789
|
-
PropertyAttributes final =
|
790
|
-
static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY);
|
791
|
-
int enum_index = 0;
|
792
|
-
{
|
793
|
-
// ECMA-262, section 15.10.7.1.
|
794
|
-
FieldDescriptor field(Heap::source_symbol(),
|
795
|
-
JSRegExp::kSourceFieldIndex,
|
796
|
-
final,
|
797
|
-
enum_index++);
|
798
|
-
descriptors->Set(0, &field);
|
799
|
-
}
|
800
|
-
{
|
801
|
-
// ECMA-262, section 15.10.7.2.
|
802
|
-
FieldDescriptor field(Heap::global_symbol(),
|
803
|
-
JSRegExp::kGlobalFieldIndex,
|
804
|
-
final,
|
805
|
-
enum_index++);
|
806
|
-
descriptors->Set(1, &field);
|
807
|
-
}
|
808
|
-
{
|
809
|
-
// ECMA-262, section 15.10.7.3.
|
810
|
-
FieldDescriptor field(Heap::ignore_case_symbol(),
|
811
|
-
JSRegExp::kIgnoreCaseFieldIndex,
|
812
|
-
final,
|
813
|
-
enum_index++);
|
814
|
-
descriptors->Set(2, &field);
|
815
|
-
}
|
816
|
-
{
|
817
|
-
// ECMA-262, section 15.10.7.4.
|
818
|
-
FieldDescriptor field(Heap::multiline_symbol(),
|
819
|
-
JSRegExp::kMultilineFieldIndex,
|
820
|
-
final,
|
821
|
-
enum_index++);
|
822
|
-
descriptors->Set(3, &field);
|
823
|
-
}
|
824
|
-
{
|
825
|
-
// ECMA-262, section 15.10.7.5.
|
826
|
-
PropertyAttributes writable =
|
827
|
-
static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE);
|
828
|
-
FieldDescriptor field(Heap::last_index_symbol(),
|
829
|
-
JSRegExp::kLastIndexFieldIndex,
|
830
|
-
writable,
|
831
|
-
enum_index++);
|
832
|
-
descriptors->Set(4, &field);
|
833
|
-
}
|
834
|
-
descriptors->SetNextEnumerationIndex(enum_index);
|
835
|
-
descriptors->Sort();
|
836
|
-
|
837
|
-
initial_map->set_inobject_properties(5);
|
838
|
-
initial_map->set_pre_allocated_property_fields(5);
|
839
|
-
initial_map->set_unused_property_fields(0);
|
840
|
-
initial_map->set_instance_size(
|
841
|
-
initial_map->instance_size() + 5 * kPointerSize);
|
842
|
-
initial_map->set_instance_descriptors(*descriptors);
|
843
|
-
initial_map->set_visitor_id(StaticVisitorBase::GetVisitorId(*initial_map));
|
844
|
-
}
|
845
|
-
|
846
|
-
{ // -- J S O N
|
847
|
-
Handle<String> name = Factory::NewStringFromAscii(CStrVector("JSON"));
|
848
|
-
Handle<JSFunction> cons = Factory::NewFunction(
|
849
|
-
name,
|
850
|
-
Factory::the_hole_value());
|
851
|
-
cons->SetInstancePrototype(global_context()->initial_object_prototype());
|
852
|
-
cons->SetInstanceClassName(*name);
|
853
|
-
Handle<JSObject> json_object = Factory::NewJSObject(cons, TENURED);
|
854
|
-
ASSERT(json_object->IsJSObject());
|
855
|
-
SetLocalPropertyNoThrow(global, name, json_object, DONT_ENUM);
|
856
|
-
global_context()->set_json_object(*json_object);
|
857
|
-
}
|
858
|
-
|
859
|
-
{ // --- arguments_boilerplate_
|
860
|
-
// Make sure we can recognize argument objects at runtime.
|
861
|
-
// This is done by introducing an anonymous function with
|
862
|
-
// class_name equals 'Arguments'.
|
863
|
-
Handle<String> symbol = Factory::LookupAsciiSymbol("Arguments");
|
864
|
-
Handle<Code> code = Handle<Code>(Builtins::builtin(Builtins::Illegal));
|
865
|
-
Handle<JSObject> prototype =
|
866
|
-
Handle<JSObject>(
|
867
|
-
JSObject::cast(global_context()->object_function()->prototype()));
|
868
|
-
|
869
|
-
Handle<JSFunction> function =
|
870
|
-
Factory::NewFunctionWithPrototype(symbol,
|
871
|
-
JS_OBJECT_TYPE,
|
872
|
-
JSObject::kHeaderSize,
|
873
|
-
prototype,
|
874
|
-
code,
|
875
|
-
false);
|
876
|
-
ASSERT(!function->has_initial_map());
|
877
|
-
function->shared()->set_instance_class_name(*symbol);
|
878
|
-
function->shared()->set_expected_nof_properties(2);
|
879
|
-
Handle<JSObject> result = Factory::NewJSObject(function);
|
880
|
-
|
881
|
-
global_context()->set_arguments_boilerplate(*result);
|
882
|
-
// Note: callee must be added as the first property and
|
883
|
-
// length must be added as the second property.
|
884
|
-
SetLocalPropertyNoThrow(result, Factory::callee_symbol(),
|
885
|
-
Factory::undefined_value(),
|
886
|
-
DONT_ENUM);
|
887
|
-
SetLocalPropertyNoThrow(result, Factory::length_symbol(),
|
888
|
-
Factory::undefined_value(),
|
889
|
-
DONT_ENUM);
|
890
|
-
|
891
|
-
#ifdef DEBUG
|
892
|
-
LookupResult lookup;
|
893
|
-
result->LocalLookup(Heap::callee_symbol(), &lookup);
|
894
|
-
ASSERT(lookup.IsProperty() && (lookup.type() == FIELD));
|
895
|
-
ASSERT(lookup.GetFieldIndex() == Heap::arguments_callee_index);
|
896
|
-
|
897
|
-
result->LocalLookup(Heap::length_symbol(), &lookup);
|
898
|
-
ASSERT(lookup.IsProperty() && (lookup.type() == FIELD));
|
899
|
-
ASSERT(lookup.GetFieldIndex() == Heap::arguments_length_index);
|
900
|
-
|
901
|
-
ASSERT(result->map()->inobject_properties() > Heap::arguments_callee_index);
|
902
|
-
ASSERT(result->map()->inobject_properties() > Heap::arguments_length_index);
|
903
|
-
|
904
|
-
// Check the state of the object.
|
905
|
-
ASSERT(result->HasFastProperties());
|
906
|
-
ASSERT(result->HasFastElements());
|
907
|
-
#endif
|
908
|
-
}
|
909
|
-
|
910
|
-
{ // --- context extension
|
911
|
-
// Create a function for the context extension objects.
|
912
|
-
Handle<Code> code = Handle<Code>(Builtins::builtin(Builtins::Illegal));
|
913
|
-
Handle<JSFunction> context_extension_fun =
|
914
|
-
Factory::NewFunction(Factory::empty_symbol(),
|
915
|
-
JS_CONTEXT_EXTENSION_OBJECT_TYPE,
|
916
|
-
JSObject::kHeaderSize,
|
917
|
-
code,
|
918
|
-
true);
|
919
|
-
|
920
|
-
Handle<String> name = Factory::LookupAsciiSymbol("context_extension");
|
921
|
-
context_extension_fun->shared()->set_instance_class_name(*name);
|
922
|
-
global_context()->set_context_extension_function(*context_extension_fun);
|
923
|
-
}
|
924
|
-
|
925
|
-
|
926
|
-
{
|
927
|
-
// Setup the call-as-function delegate.
|
928
|
-
Handle<Code> code =
|
929
|
-
Handle<Code>(Builtins::builtin(Builtins::HandleApiCallAsFunction));
|
930
|
-
Handle<JSFunction> delegate =
|
931
|
-
Factory::NewFunction(Factory::empty_symbol(), JS_OBJECT_TYPE,
|
932
|
-
JSObject::kHeaderSize, code, true);
|
933
|
-
global_context()->set_call_as_function_delegate(*delegate);
|
934
|
-
delegate->shared()->DontAdaptArguments();
|
935
|
-
}
|
936
|
-
|
937
|
-
{
|
938
|
-
// Setup the call-as-constructor delegate.
|
939
|
-
Handle<Code> code =
|
940
|
-
Handle<Code>(Builtins::builtin(Builtins::HandleApiCallAsConstructor));
|
941
|
-
Handle<JSFunction> delegate =
|
942
|
-
Factory::NewFunction(Factory::empty_symbol(), JS_OBJECT_TYPE,
|
943
|
-
JSObject::kHeaderSize, code, true);
|
944
|
-
global_context()->set_call_as_constructor_delegate(*delegate);
|
945
|
-
delegate->shared()->DontAdaptArguments();
|
946
|
-
}
|
947
|
-
|
948
|
-
// Initialize the out of memory slot.
|
949
|
-
global_context()->set_out_of_memory(Heap::false_value());
|
950
|
-
|
951
|
-
// Initialize the data slot.
|
952
|
-
global_context()->set_data(Heap::undefined_value());
|
953
|
-
}
|
954
|
-
|
955
|
-
|
956
|
-
bool Genesis::CompileBuiltin(int index) {
|
957
|
-
Vector<const char> name = Natives::GetScriptName(index);
|
958
|
-
Handle<String> source_code = Bootstrapper::NativesSourceLookup(index);
|
959
|
-
return CompileNative(name, source_code);
|
960
|
-
}
|
961
|
-
|
962
|
-
|
963
|
-
bool Genesis::CompileNative(Vector<const char> name, Handle<String> source) {
|
964
|
-
HandleScope scope;
|
965
|
-
#ifdef ENABLE_DEBUGGER_SUPPORT
|
966
|
-
Debugger::set_compiling_natives(true);
|
967
|
-
#endif
|
968
|
-
bool result = CompileScriptCached(name,
|
969
|
-
source,
|
970
|
-
NULL,
|
971
|
-
NULL,
|
972
|
-
Handle<Context>(Top::context()),
|
973
|
-
true);
|
974
|
-
ASSERT(Top::has_pending_exception() != result);
|
975
|
-
if (!result) Top::clear_pending_exception();
|
976
|
-
#ifdef ENABLE_DEBUGGER_SUPPORT
|
977
|
-
Debugger::set_compiling_natives(false);
|
978
|
-
#endif
|
979
|
-
return result;
|
980
|
-
}
|
981
|
-
|
982
|
-
|
983
|
-
bool Genesis::CompileScriptCached(Vector<const char> name,
|
984
|
-
Handle<String> source,
|
985
|
-
SourceCodeCache* cache,
|
986
|
-
v8::Extension* extension,
|
987
|
-
Handle<Context> top_context,
|
988
|
-
bool use_runtime_context) {
|
989
|
-
HandleScope scope;
|
990
|
-
Handle<SharedFunctionInfo> function_info;
|
991
|
-
|
992
|
-
// If we can't find the function in the cache, we compile a new
|
993
|
-
// function and insert it into the cache.
|
994
|
-
if (cache == NULL || !cache->Lookup(name, &function_info)) {
|
995
|
-
ASSERT(source->IsAsciiRepresentation());
|
996
|
-
Handle<String> script_name = Factory::NewStringFromUtf8(name);
|
997
|
-
function_info = Compiler::Compile(
|
998
|
-
source,
|
999
|
-
script_name,
|
1000
|
-
0,
|
1001
|
-
0,
|
1002
|
-
extension,
|
1003
|
-
NULL,
|
1004
|
-
Handle<String>::null(),
|
1005
|
-
use_runtime_context ? NATIVES_CODE : NOT_NATIVES_CODE);
|
1006
|
-
if (function_info.is_null()) return false;
|
1007
|
-
if (cache != NULL) cache->Add(name, function_info);
|
1008
|
-
}
|
1009
|
-
|
1010
|
-
// Setup the function context. Conceptually, we should clone the
|
1011
|
-
// function before overwriting the context but since we're in a
|
1012
|
-
// single-threaded environment it is not strictly necessary.
|
1013
|
-
ASSERT(top_context->IsGlobalContext());
|
1014
|
-
Handle<Context> context =
|
1015
|
-
Handle<Context>(use_runtime_context
|
1016
|
-
? Handle<Context>(top_context->runtime_context())
|
1017
|
-
: top_context);
|
1018
|
-
Handle<JSFunction> fun =
|
1019
|
-
Factory::NewFunctionFromSharedFunctionInfo(function_info, context);
|
1020
|
-
|
1021
|
-
// Call function using either the runtime object or the global
|
1022
|
-
// object as the receiver. Provide no parameters.
|
1023
|
-
Handle<Object> receiver =
|
1024
|
-
Handle<Object>(use_runtime_context
|
1025
|
-
? top_context->builtins()
|
1026
|
-
: top_context->global());
|
1027
|
-
bool has_pending_exception;
|
1028
|
-
Handle<Object> result =
|
1029
|
-
Execution::Call(fun, receiver, 0, NULL, &has_pending_exception);
|
1030
|
-
if (has_pending_exception) return false;
|
1031
|
-
return true;
|
1032
|
-
}
|
1033
|
-
|
1034
|
-
|
1035
|
-
#define INSTALL_NATIVE(Type, name, var) \
|
1036
|
-
Handle<String> var##_name = Factory::LookupAsciiSymbol(name); \
|
1037
|
-
global_context()->set_##var(Type::cast( \
|
1038
|
-
global_context()->builtins()->GetPropertyNoExceptionThrown(*var##_name)));
|
1039
|
-
|
1040
|
-
void Genesis::InstallNativeFunctions() {
|
1041
|
-
HandleScope scope;
|
1042
|
-
INSTALL_NATIVE(JSFunction, "CreateDate", create_date_fun);
|
1043
|
-
INSTALL_NATIVE(JSFunction, "ToNumber", to_number_fun);
|
1044
|
-
INSTALL_NATIVE(JSFunction, "ToString", to_string_fun);
|
1045
|
-
INSTALL_NATIVE(JSFunction, "ToDetailString", to_detail_string_fun);
|
1046
|
-
INSTALL_NATIVE(JSFunction, "ToObject", to_object_fun);
|
1047
|
-
INSTALL_NATIVE(JSFunction, "ToInteger", to_integer_fun);
|
1048
|
-
INSTALL_NATIVE(JSFunction, "ToUint32", to_uint32_fun);
|
1049
|
-
INSTALL_NATIVE(JSFunction, "ToInt32", to_int32_fun);
|
1050
|
-
INSTALL_NATIVE(JSFunction, "GlobalEval", global_eval_fun);
|
1051
|
-
INSTALL_NATIVE(JSFunction, "Instantiate", instantiate_fun);
|
1052
|
-
INSTALL_NATIVE(JSFunction, "ConfigureTemplateInstance",
|
1053
|
-
configure_instance_fun);
|
1054
|
-
INSTALL_NATIVE(JSFunction, "GetStackTraceLine", get_stack_trace_line_fun);
|
1055
|
-
INSTALL_NATIVE(JSObject, "functionCache", function_cache);
|
1056
|
-
}
|
1057
|
-
|
1058
|
-
#undef INSTALL_NATIVE
|
1059
|
-
|
1060
|
-
|
1061
|
-
bool Genesis::InstallNatives() {
|
1062
|
-
HandleScope scope;
|
1063
|
-
|
1064
|
-
// Create a function for the builtins object. Allocate space for the
|
1065
|
-
// JavaScript builtins, a reference to the builtins object
|
1066
|
-
// (itself) and a reference to the global_context directly in the object.
|
1067
|
-
Handle<Code> code = Handle<Code>(Builtins::builtin(Builtins::Illegal));
|
1068
|
-
Handle<JSFunction> builtins_fun =
|
1069
|
-
Factory::NewFunction(Factory::empty_symbol(), JS_BUILTINS_OBJECT_TYPE,
|
1070
|
-
JSBuiltinsObject::kSize, code, true);
|
1071
|
-
|
1072
|
-
Handle<String> name = Factory::LookupAsciiSymbol("builtins");
|
1073
|
-
builtins_fun->shared()->set_instance_class_name(*name);
|
1074
|
-
|
1075
|
-
// Allocate the builtins object.
|
1076
|
-
Handle<JSBuiltinsObject> builtins =
|
1077
|
-
Handle<JSBuiltinsObject>::cast(Factory::NewGlobalObject(builtins_fun));
|
1078
|
-
builtins->set_builtins(*builtins);
|
1079
|
-
builtins->set_global_context(*global_context());
|
1080
|
-
builtins->set_global_receiver(*builtins);
|
1081
|
-
|
1082
|
-
// Setup the 'global' properties of the builtins object. The
|
1083
|
-
// 'global' property that refers to the global object is the only
|
1084
|
-
// way to get from code running in the builtins context to the
|
1085
|
-
// global object.
|
1086
|
-
static const PropertyAttributes attributes =
|
1087
|
-
static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE);
|
1088
|
-
Handle<String> global_symbol = Factory::LookupAsciiSymbol("global");
|
1089
|
-
Handle<Object> global_obj(global_context()->global());
|
1090
|
-
SetLocalPropertyNoThrow(builtins, global_symbol, global_obj, attributes);
|
1091
|
-
|
1092
|
-
// Setup the reference from the global object to the builtins object.
|
1093
|
-
JSGlobalObject::cast(global_context()->global())->set_builtins(*builtins);
|
1094
|
-
|
1095
|
-
// Create a bridge function that has context in the global context.
|
1096
|
-
Handle<JSFunction> bridge =
|
1097
|
-
Factory::NewFunction(Factory::empty_symbol(), Factory::undefined_value());
|
1098
|
-
ASSERT(bridge->context() == *Top::global_context());
|
1099
|
-
|
1100
|
-
// Allocate the builtins context.
|
1101
|
-
Handle<Context> context =
|
1102
|
-
Factory::NewFunctionContext(Context::MIN_CONTEXT_SLOTS, bridge);
|
1103
|
-
context->set_global(*builtins); // override builtins global object
|
1104
|
-
|
1105
|
-
global_context()->set_runtime_context(*context);
|
1106
|
-
|
1107
|
-
{ // -- S c r i p t
|
1108
|
-
// Builtin functions for Script.
|
1109
|
-
Handle<JSFunction> script_fun =
|
1110
|
-
InstallFunction(builtins, "Script", JS_VALUE_TYPE, JSValue::kSize,
|
1111
|
-
Top::initial_object_prototype(), Builtins::Illegal,
|
1112
|
-
false);
|
1113
|
-
Handle<JSObject> prototype =
|
1114
|
-
Factory::NewJSObject(Top::object_function(), TENURED);
|
1115
|
-
SetPrototype(script_fun, prototype);
|
1116
|
-
global_context()->set_script_function(*script_fun);
|
1117
|
-
|
1118
|
-
// Add 'source' and 'data' property to scripts.
|
1119
|
-
PropertyAttributes common_attributes =
|
1120
|
-
static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY);
|
1121
|
-
Handle<Proxy> proxy_source = Factory::NewProxy(&Accessors::ScriptSource);
|
1122
|
-
Handle<DescriptorArray> script_descriptors =
|
1123
|
-
Factory::CopyAppendProxyDescriptor(
|
1124
|
-
Factory::empty_descriptor_array(),
|
1125
|
-
Factory::LookupAsciiSymbol("source"),
|
1126
|
-
proxy_source,
|
1127
|
-
common_attributes);
|
1128
|
-
Handle<Proxy> proxy_name = Factory::NewProxy(&Accessors::ScriptName);
|
1129
|
-
script_descriptors =
|
1130
|
-
Factory::CopyAppendProxyDescriptor(
|
1131
|
-
script_descriptors,
|
1132
|
-
Factory::LookupAsciiSymbol("name"),
|
1133
|
-
proxy_name,
|
1134
|
-
common_attributes);
|
1135
|
-
Handle<Proxy> proxy_id = Factory::NewProxy(&Accessors::ScriptId);
|
1136
|
-
script_descriptors =
|
1137
|
-
Factory::CopyAppendProxyDescriptor(
|
1138
|
-
script_descriptors,
|
1139
|
-
Factory::LookupAsciiSymbol("id"),
|
1140
|
-
proxy_id,
|
1141
|
-
common_attributes);
|
1142
|
-
Handle<Proxy> proxy_line_offset =
|
1143
|
-
Factory::NewProxy(&Accessors::ScriptLineOffset);
|
1144
|
-
script_descriptors =
|
1145
|
-
Factory::CopyAppendProxyDescriptor(
|
1146
|
-
script_descriptors,
|
1147
|
-
Factory::LookupAsciiSymbol("line_offset"),
|
1148
|
-
proxy_line_offset,
|
1149
|
-
common_attributes);
|
1150
|
-
Handle<Proxy> proxy_column_offset =
|
1151
|
-
Factory::NewProxy(&Accessors::ScriptColumnOffset);
|
1152
|
-
script_descriptors =
|
1153
|
-
Factory::CopyAppendProxyDescriptor(
|
1154
|
-
script_descriptors,
|
1155
|
-
Factory::LookupAsciiSymbol("column_offset"),
|
1156
|
-
proxy_column_offset,
|
1157
|
-
common_attributes);
|
1158
|
-
Handle<Proxy> proxy_data = Factory::NewProxy(&Accessors::ScriptData);
|
1159
|
-
script_descriptors =
|
1160
|
-
Factory::CopyAppendProxyDescriptor(
|
1161
|
-
script_descriptors,
|
1162
|
-
Factory::LookupAsciiSymbol("data"),
|
1163
|
-
proxy_data,
|
1164
|
-
common_attributes);
|
1165
|
-
Handle<Proxy> proxy_type = Factory::NewProxy(&Accessors::ScriptType);
|
1166
|
-
script_descriptors =
|
1167
|
-
Factory::CopyAppendProxyDescriptor(
|
1168
|
-
script_descriptors,
|
1169
|
-
Factory::LookupAsciiSymbol("type"),
|
1170
|
-
proxy_type,
|
1171
|
-
common_attributes);
|
1172
|
-
Handle<Proxy> proxy_compilation_type =
|
1173
|
-
Factory::NewProxy(&Accessors::ScriptCompilationType);
|
1174
|
-
script_descriptors =
|
1175
|
-
Factory::CopyAppendProxyDescriptor(
|
1176
|
-
script_descriptors,
|
1177
|
-
Factory::LookupAsciiSymbol("compilation_type"),
|
1178
|
-
proxy_compilation_type,
|
1179
|
-
common_attributes);
|
1180
|
-
Handle<Proxy> proxy_line_ends =
|
1181
|
-
Factory::NewProxy(&Accessors::ScriptLineEnds);
|
1182
|
-
script_descriptors =
|
1183
|
-
Factory::CopyAppendProxyDescriptor(
|
1184
|
-
script_descriptors,
|
1185
|
-
Factory::LookupAsciiSymbol("line_ends"),
|
1186
|
-
proxy_line_ends,
|
1187
|
-
common_attributes);
|
1188
|
-
Handle<Proxy> proxy_context_data =
|
1189
|
-
Factory::NewProxy(&Accessors::ScriptContextData);
|
1190
|
-
script_descriptors =
|
1191
|
-
Factory::CopyAppendProxyDescriptor(
|
1192
|
-
script_descriptors,
|
1193
|
-
Factory::LookupAsciiSymbol("context_data"),
|
1194
|
-
proxy_context_data,
|
1195
|
-
common_attributes);
|
1196
|
-
Handle<Proxy> proxy_eval_from_script =
|
1197
|
-
Factory::NewProxy(&Accessors::ScriptEvalFromScript);
|
1198
|
-
script_descriptors =
|
1199
|
-
Factory::CopyAppendProxyDescriptor(
|
1200
|
-
script_descriptors,
|
1201
|
-
Factory::LookupAsciiSymbol("eval_from_script"),
|
1202
|
-
proxy_eval_from_script,
|
1203
|
-
common_attributes);
|
1204
|
-
Handle<Proxy> proxy_eval_from_script_position =
|
1205
|
-
Factory::NewProxy(&Accessors::ScriptEvalFromScriptPosition);
|
1206
|
-
script_descriptors =
|
1207
|
-
Factory::CopyAppendProxyDescriptor(
|
1208
|
-
script_descriptors,
|
1209
|
-
Factory::LookupAsciiSymbol("eval_from_script_position"),
|
1210
|
-
proxy_eval_from_script_position,
|
1211
|
-
common_attributes);
|
1212
|
-
Handle<Proxy> proxy_eval_from_function_name =
|
1213
|
-
Factory::NewProxy(&Accessors::ScriptEvalFromFunctionName);
|
1214
|
-
script_descriptors =
|
1215
|
-
Factory::CopyAppendProxyDescriptor(
|
1216
|
-
script_descriptors,
|
1217
|
-
Factory::LookupAsciiSymbol("eval_from_function_name"),
|
1218
|
-
proxy_eval_from_function_name,
|
1219
|
-
common_attributes);
|
1220
|
-
|
1221
|
-
Handle<Map> script_map = Handle<Map>(script_fun->initial_map());
|
1222
|
-
script_map->set_instance_descriptors(*script_descriptors);
|
1223
|
-
|
1224
|
-
// Allocate the empty script.
|
1225
|
-
Handle<Script> script = Factory::NewScript(Factory::empty_string());
|
1226
|
-
script->set_type(Smi::FromInt(Script::TYPE_NATIVE));
|
1227
|
-
Heap::public_set_empty_script(*script);
|
1228
|
-
}
|
1229
|
-
{
|
1230
|
-
// Builtin function for OpaqueReference -- a JSValue-based object,
|
1231
|
-
// that keeps its field isolated from JavaScript code. It may store
|
1232
|
-
// objects, that JavaScript code may not access.
|
1233
|
-
Handle<JSFunction> opaque_reference_fun =
|
1234
|
-
InstallFunction(builtins, "OpaqueReference", JS_VALUE_TYPE,
|
1235
|
-
JSValue::kSize, Top::initial_object_prototype(),
|
1236
|
-
Builtins::Illegal, false);
|
1237
|
-
Handle<JSObject> prototype =
|
1238
|
-
Factory::NewJSObject(Top::object_function(), TENURED);
|
1239
|
-
SetPrototype(opaque_reference_fun, prototype);
|
1240
|
-
global_context()->set_opaque_reference_function(*opaque_reference_fun);
|
1241
|
-
}
|
1242
|
-
|
1243
|
-
if (FLAG_disable_native_files) {
|
1244
|
-
PrintF("Warning: Running without installed natives!\n");
|
1245
|
-
return true;
|
1246
|
-
}
|
1247
|
-
|
1248
|
-
// Install natives.
|
1249
|
-
for (int i = Natives::GetDebuggerCount();
|
1250
|
-
i < Natives::GetBuiltinsCount();
|
1251
|
-
i++) {
|
1252
|
-
Vector<const char> name = Natives::GetScriptName(i);
|
1253
|
-
if (!CompileBuiltin(i)) return false;
|
1254
|
-
// TODO(ager): We really only need to install the JS builtin
|
1255
|
-
// functions on the builtins object after compiling and running
|
1256
|
-
// runtime.js.
|
1257
|
-
if (!InstallJSBuiltins(builtins)) return false;
|
1258
|
-
}
|
1259
|
-
|
1260
|
-
InstallNativeFunctions();
|
1261
|
-
|
1262
|
-
// Store the map for the string prototype after the natives has been compiled
|
1263
|
-
// and the String function has been setup.
|
1264
|
-
Handle<JSFunction> string_function(global_context()->string_function());
|
1265
|
-
ASSERT(JSObject::cast(
|
1266
|
-
string_function->initial_map()->prototype())->HasFastProperties());
|
1267
|
-
global_context()->set_string_function_prototype_map(
|
1268
|
-
HeapObject::cast(string_function->initial_map()->prototype())->map());
|
1269
|
-
|
1270
|
-
InstallBuiltinFunctionIds();
|
1271
|
-
|
1272
|
-
// Install Function.prototype.call and apply.
|
1273
|
-
{ Handle<String> key = Factory::function_class_symbol();
|
1274
|
-
Handle<JSFunction> function =
|
1275
|
-
Handle<JSFunction>::cast(GetProperty(Top::global(), key));
|
1276
|
-
Handle<JSObject> proto =
|
1277
|
-
Handle<JSObject>(JSObject::cast(function->instance_prototype()));
|
1278
|
-
|
1279
|
-
// Install the call and the apply functions.
|
1280
|
-
Handle<JSFunction> call =
|
1281
|
-
InstallFunction(proto, "call", JS_OBJECT_TYPE, JSObject::kHeaderSize,
|
1282
|
-
Handle<JSObject>::null(),
|
1283
|
-
Builtins::FunctionCall,
|
1284
|
-
false);
|
1285
|
-
Handle<JSFunction> apply =
|
1286
|
-
InstallFunction(proto, "apply", JS_OBJECT_TYPE, JSObject::kHeaderSize,
|
1287
|
-
Handle<JSObject>::null(),
|
1288
|
-
Builtins::FunctionApply,
|
1289
|
-
false);
|
1290
|
-
|
1291
|
-
// Make sure that Function.prototype.call appears to be compiled.
|
1292
|
-
// The code will never be called, but inline caching for call will
|
1293
|
-
// only work if it appears to be compiled.
|
1294
|
-
call->shared()->DontAdaptArguments();
|
1295
|
-
ASSERT(call->is_compiled());
|
1296
|
-
|
1297
|
-
// Set the expected parameters for apply to 2; required by builtin.
|
1298
|
-
apply->shared()->set_formal_parameter_count(2);
|
1299
|
-
|
1300
|
-
// Set the lengths for the functions to satisfy ECMA-262.
|
1301
|
-
call->shared()->set_length(1);
|
1302
|
-
apply->shared()->set_length(2);
|
1303
|
-
}
|
1304
|
-
|
1305
|
-
// Create a constructor for RegExp results (a variant of Array that
|
1306
|
-
// predefines the two properties index and match).
|
1307
|
-
{
|
1308
|
-
// RegExpResult initial map.
|
1309
|
-
|
1310
|
-
// Find global.Array.prototype to inherit from.
|
1311
|
-
Handle<JSFunction> array_constructor(global_context()->array_function());
|
1312
|
-
Handle<JSObject> array_prototype(
|
1313
|
-
JSObject::cast(array_constructor->instance_prototype()));
|
1314
|
-
|
1315
|
-
// Add initial map.
|
1316
|
-
Handle<Map> initial_map =
|
1317
|
-
Factory::NewMap(JS_ARRAY_TYPE, JSRegExpResult::kSize);
|
1318
|
-
initial_map->set_constructor(*array_constructor);
|
1319
|
-
|
1320
|
-
// Set prototype on map.
|
1321
|
-
initial_map->set_non_instance_prototype(false);
|
1322
|
-
initial_map->set_prototype(*array_prototype);
|
1323
|
-
|
1324
|
-
// Update map with length accessor from Array and add "index" and "input".
|
1325
|
-
Handle<Map> array_map(global_context()->js_array_map());
|
1326
|
-
Handle<DescriptorArray> array_descriptors(
|
1327
|
-
array_map->instance_descriptors());
|
1328
|
-
ASSERT_EQ(1, array_descriptors->number_of_descriptors());
|
1329
|
-
|
1330
|
-
Handle<DescriptorArray> reresult_descriptors =
|
1331
|
-
Factory::NewDescriptorArray(3);
|
1332
|
-
|
1333
|
-
reresult_descriptors->CopyFrom(0, *array_descriptors, 0);
|
1334
|
-
|
1335
|
-
int enum_index = 0;
|
1336
|
-
{
|
1337
|
-
FieldDescriptor index_field(Heap::index_symbol(),
|
1338
|
-
JSRegExpResult::kIndexIndex,
|
1339
|
-
NONE,
|
1340
|
-
enum_index++);
|
1341
|
-
reresult_descriptors->Set(1, &index_field);
|
1342
|
-
}
|
1343
|
-
|
1344
|
-
{
|
1345
|
-
FieldDescriptor input_field(Heap::input_symbol(),
|
1346
|
-
JSRegExpResult::kInputIndex,
|
1347
|
-
NONE,
|
1348
|
-
enum_index++);
|
1349
|
-
reresult_descriptors->Set(2, &input_field);
|
1350
|
-
}
|
1351
|
-
reresult_descriptors->Sort();
|
1352
|
-
|
1353
|
-
initial_map->set_inobject_properties(2);
|
1354
|
-
initial_map->set_pre_allocated_property_fields(2);
|
1355
|
-
initial_map->set_unused_property_fields(0);
|
1356
|
-
initial_map->set_instance_descriptors(*reresult_descriptors);
|
1357
|
-
|
1358
|
-
global_context()->set_regexp_result_map(*initial_map);
|
1359
|
-
}
|
1360
|
-
|
1361
|
-
#ifdef DEBUG
|
1362
|
-
builtins->Verify();
|
1363
|
-
#endif
|
1364
|
-
|
1365
|
-
return true;
|
1366
|
-
}
|
1367
|
-
|
1368
|
-
|
1369
|
-
static Handle<JSObject> ResolveBuiltinIdHolder(
|
1370
|
-
Handle<Context> global_context,
|
1371
|
-
const char* holder_expr) {
|
1372
|
-
Handle<GlobalObject> global(global_context->global());
|
1373
|
-
const char* period_pos = strchr(holder_expr, '.');
|
1374
|
-
if (period_pos == NULL) {
|
1375
|
-
return Handle<JSObject>::cast(
|
1376
|
-
GetProperty(global, Factory::LookupAsciiSymbol(holder_expr)));
|
1377
|
-
}
|
1378
|
-
ASSERT_EQ(".prototype", period_pos);
|
1379
|
-
Vector<const char> property(holder_expr,
|
1380
|
-
static_cast<int>(period_pos - holder_expr));
|
1381
|
-
Handle<JSFunction> function = Handle<JSFunction>::cast(
|
1382
|
-
GetProperty(global, Factory::LookupSymbol(property)));
|
1383
|
-
return Handle<JSObject>(JSObject::cast(function->prototype()));
|
1384
|
-
}
|
1385
|
-
|
1386
|
-
|
1387
|
-
static void InstallBuiltinFunctionId(Handle<JSObject> holder,
|
1388
|
-
const char* function_name,
|
1389
|
-
BuiltinFunctionId id) {
|
1390
|
-
Handle<String> name = Factory::LookupAsciiSymbol(function_name);
|
1391
|
-
Object* function_object = holder->GetProperty(*name)->ToObjectUnchecked();
|
1392
|
-
Handle<JSFunction> function(JSFunction::cast(function_object));
|
1393
|
-
function->shared()->set_function_data(Smi::FromInt(id));
|
1394
|
-
}
|
1395
|
-
|
1396
|
-
|
1397
|
-
void Genesis::InstallBuiltinFunctionIds() {
|
1398
|
-
HandleScope scope;
|
1399
|
-
#define INSTALL_BUILTIN_ID(holder_expr, fun_name, name) \
|
1400
|
-
{ \
|
1401
|
-
Handle<JSObject> holder = ResolveBuiltinIdHolder( \
|
1402
|
-
global_context(), #holder_expr); \
|
1403
|
-
BuiltinFunctionId id = k##name; \
|
1404
|
-
InstallBuiltinFunctionId(holder, #fun_name, id); \
|
1405
|
-
}
|
1406
|
-
FUNCTIONS_WITH_ID_LIST(INSTALL_BUILTIN_ID)
|
1407
|
-
#undef INSTALL_BUILTIN_ID
|
1408
|
-
}
|
1409
|
-
|
1410
|
-
|
1411
|
-
// Do not forget to update macros.py with named constant
|
1412
|
-
// of cache id.
|
1413
|
-
#define JSFUNCTION_RESULT_CACHE_LIST(F) \
|
1414
|
-
F(16, global_context()->regexp_function())
|
1415
|
-
|
1416
|
-
|
1417
|
-
static FixedArray* CreateCache(int size, JSFunction* factory) {
|
1418
|
-
// Caches are supposed to live for a long time, allocate in old space.
|
1419
|
-
int array_size = JSFunctionResultCache::kEntriesIndex + 2 * size;
|
1420
|
-
// Cannot use cast as object is not fully initialized yet.
|
1421
|
-
JSFunctionResultCache* cache = reinterpret_cast<JSFunctionResultCache*>(
|
1422
|
-
*Factory::NewFixedArrayWithHoles(array_size, TENURED));
|
1423
|
-
cache->set(JSFunctionResultCache::kFactoryIndex, factory);
|
1424
|
-
cache->MakeZeroSize();
|
1425
|
-
return cache;
|
1426
|
-
}
|
1427
|
-
|
1428
|
-
|
1429
|
-
void Genesis::InstallJSFunctionResultCaches() {
|
1430
|
-
const int kNumberOfCaches = 0 +
|
1431
|
-
#define F(size, func) + 1
|
1432
|
-
JSFUNCTION_RESULT_CACHE_LIST(F)
|
1433
|
-
#undef F
|
1434
|
-
;
|
1435
|
-
|
1436
|
-
Handle<FixedArray> caches = Factory::NewFixedArray(kNumberOfCaches, TENURED);
|
1437
|
-
|
1438
|
-
int index = 0;
|
1439
|
-
|
1440
|
-
#define F(size, func) do { \
|
1441
|
-
FixedArray* cache = CreateCache((size), (func)); \
|
1442
|
-
caches->set(index++, cache); \
|
1443
|
-
} while (false)
|
1444
|
-
|
1445
|
-
JSFUNCTION_RESULT_CACHE_LIST(F);
|
1446
|
-
|
1447
|
-
#undef F
|
1448
|
-
|
1449
|
-
global_context()->set_jsfunction_result_caches(*caches);
|
1450
|
-
}
|
1451
|
-
|
1452
|
-
|
1453
|
-
void Genesis::InitializeNormalizedMapCaches() {
|
1454
|
-
Handle<FixedArray> array(
|
1455
|
-
Factory::NewFixedArray(NormalizedMapCache::kEntries, TENURED));
|
1456
|
-
global_context()->set_normalized_map_cache(NormalizedMapCache::cast(*array));
|
1457
|
-
}
|
1458
|
-
|
1459
|
-
|
1460
|
-
int BootstrapperActive::nesting_ = 0;
|
1461
|
-
|
1462
|
-
|
1463
|
-
bool Bootstrapper::InstallExtensions(Handle<Context> global_context,
|
1464
|
-
v8::ExtensionConfiguration* extensions) {
|
1465
|
-
BootstrapperActive active;
|
1466
|
-
SaveContext saved_context;
|
1467
|
-
Top::set_context(*global_context);
|
1468
|
-
if (!Genesis::InstallExtensions(global_context, extensions)) return false;
|
1469
|
-
Genesis::InstallSpecialObjects(global_context);
|
1470
|
-
return true;
|
1471
|
-
}
|
1472
|
-
|
1473
|
-
|
1474
|
-
void Genesis::InstallSpecialObjects(Handle<Context> global_context) {
|
1475
|
-
HandleScope scope;
|
1476
|
-
Handle<JSGlobalObject> js_global(
|
1477
|
-
JSGlobalObject::cast(global_context->global()));
|
1478
|
-
// Expose the natives in global if a name for it is specified.
|
1479
|
-
if (FLAG_expose_natives_as != NULL && strlen(FLAG_expose_natives_as) != 0) {
|
1480
|
-
Handle<String> natives_string =
|
1481
|
-
Factory::LookupAsciiSymbol(FLAG_expose_natives_as);
|
1482
|
-
SetLocalPropertyNoThrow(js_global, natives_string,
|
1483
|
-
Handle<JSObject>(js_global->builtins()), DONT_ENUM);
|
1484
|
-
}
|
1485
|
-
|
1486
|
-
Handle<Object> Error = GetProperty(js_global, "Error");
|
1487
|
-
if (Error->IsJSObject()) {
|
1488
|
-
Handle<String> name = Factory::LookupAsciiSymbol("stackTraceLimit");
|
1489
|
-
SetLocalPropertyNoThrow(Handle<JSObject>::cast(Error),
|
1490
|
-
name,
|
1491
|
-
Handle<Smi>(Smi::FromInt(FLAG_stack_trace_limit)),
|
1492
|
-
NONE);
|
1493
|
-
}
|
1494
|
-
|
1495
|
-
#ifdef ENABLE_DEBUGGER_SUPPORT
|
1496
|
-
// Expose the debug global object in global if a name for it is specified.
|
1497
|
-
if (FLAG_expose_debug_as != NULL && strlen(FLAG_expose_debug_as) != 0) {
|
1498
|
-
// If loading fails we just bail out without installing the
|
1499
|
-
// debugger but without tanking the whole context.
|
1500
|
-
if (!Debug::Load()) return;
|
1501
|
-
// Set the security token for the debugger context to the same as
|
1502
|
-
// the shell global context to allow calling between these (otherwise
|
1503
|
-
// exposing debug global object doesn't make much sense).
|
1504
|
-
Debug::debug_context()->set_security_token(
|
1505
|
-
global_context->security_token());
|
1506
|
-
|
1507
|
-
Handle<String> debug_string =
|
1508
|
-
Factory::LookupAsciiSymbol(FLAG_expose_debug_as);
|
1509
|
-
Handle<Object> global_proxy(Debug::debug_context()->global_proxy());
|
1510
|
-
SetLocalPropertyNoThrow(js_global, debug_string, global_proxy, DONT_ENUM);
|
1511
|
-
}
|
1512
|
-
#endif
|
1513
|
-
}
|
1514
|
-
|
1515
|
-
|
1516
|
-
bool Genesis::InstallExtensions(Handle<Context> global_context,
|
1517
|
-
v8::ExtensionConfiguration* extensions) {
|
1518
|
-
// Clear coloring of extension list
|
1519
|
-
v8::RegisteredExtension* current = v8::RegisteredExtension::first_extension();
|
1520
|
-
while (current != NULL) {
|
1521
|
-
current->set_state(v8::UNVISITED);
|
1522
|
-
current = current->next();
|
1523
|
-
}
|
1524
|
-
// Install auto extensions.
|
1525
|
-
current = v8::RegisteredExtension::first_extension();
|
1526
|
-
while (current != NULL) {
|
1527
|
-
if (current->extension()->auto_enable())
|
1528
|
-
InstallExtension(current);
|
1529
|
-
current = current->next();
|
1530
|
-
}
|
1531
|
-
|
1532
|
-
if (FLAG_expose_gc) InstallExtension("v8/gc");
|
1533
|
-
if (FLAG_expose_externalize_string) InstallExtension("v8/externalize");
|
1534
|
-
|
1535
|
-
if (extensions == NULL) return true;
|
1536
|
-
// Install required extensions
|
1537
|
-
int count = v8::ImplementationUtilities::GetNameCount(extensions);
|
1538
|
-
const char** names = v8::ImplementationUtilities::GetNames(extensions);
|
1539
|
-
for (int i = 0; i < count; i++) {
|
1540
|
-
if (!InstallExtension(names[i]))
|
1541
|
-
return false;
|
1542
|
-
}
|
1543
|
-
|
1544
|
-
return true;
|
1545
|
-
}
|
1546
|
-
|
1547
|
-
|
1548
|
-
// Installs a named extension. This methods is unoptimized and does
|
1549
|
-
// not scale well if we want to support a large number of extensions.
|
1550
|
-
bool Genesis::InstallExtension(const char* name) {
|
1551
|
-
v8::RegisteredExtension* current = v8::RegisteredExtension::first_extension();
|
1552
|
-
// Loop until we find the relevant extension
|
1553
|
-
while (current != NULL) {
|
1554
|
-
if (strcmp(name, current->extension()->name()) == 0) break;
|
1555
|
-
current = current->next();
|
1556
|
-
}
|
1557
|
-
// Didn't find the extension; fail.
|
1558
|
-
if (current == NULL) {
|
1559
|
-
v8::Utils::ReportApiFailure(
|
1560
|
-
"v8::Context::New()", "Cannot find required extension");
|
1561
|
-
return false;
|
1562
|
-
}
|
1563
|
-
return InstallExtension(current);
|
1564
|
-
}
|
1565
|
-
|
1566
|
-
|
1567
|
-
bool Genesis::InstallExtension(v8::RegisteredExtension* current) {
|
1568
|
-
HandleScope scope;
|
1569
|
-
|
1570
|
-
if (current->state() == v8::INSTALLED) return true;
|
1571
|
-
// The current node has already been visited so there must be a
|
1572
|
-
// cycle in the dependency graph; fail.
|
1573
|
-
if (current->state() == v8::VISITED) {
|
1574
|
-
v8::Utils::ReportApiFailure(
|
1575
|
-
"v8::Context::New()", "Circular extension dependency");
|
1576
|
-
return false;
|
1577
|
-
}
|
1578
|
-
ASSERT(current->state() == v8::UNVISITED);
|
1579
|
-
current->set_state(v8::VISITED);
|
1580
|
-
v8::Extension* extension = current->extension();
|
1581
|
-
// Install the extension's dependencies
|
1582
|
-
for (int i = 0; i < extension->dependency_count(); i++) {
|
1583
|
-
if (!InstallExtension(extension->dependencies()[i])) return false;
|
1584
|
-
}
|
1585
|
-
Vector<const char> source = CStrVector(extension->source());
|
1586
|
-
Handle<String> source_code = Factory::NewStringFromAscii(source);
|
1587
|
-
bool result = CompileScriptCached(CStrVector(extension->name()),
|
1588
|
-
source_code,
|
1589
|
-
&extensions_cache,
|
1590
|
-
extension,
|
1591
|
-
Handle<Context>(Top::context()),
|
1592
|
-
false);
|
1593
|
-
ASSERT(Top::has_pending_exception() != result);
|
1594
|
-
if (!result) {
|
1595
|
-
Top::clear_pending_exception();
|
1596
|
-
}
|
1597
|
-
current->set_state(v8::INSTALLED);
|
1598
|
-
return result;
|
1599
|
-
}
|
1600
|
-
|
1601
|
-
|
1602
|
-
bool Genesis::InstallJSBuiltins(Handle<JSBuiltinsObject> builtins) {
|
1603
|
-
HandleScope scope;
|
1604
|
-
for (int i = 0; i < Builtins::NumberOfJavaScriptBuiltins(); i++) {
|
1605
|
-
Builtins::JavaScript id = static_cast<Builtins::JavaScript>(i);
|
1606
|
-
Handle<String> name = Factory::LookupAsciiSymbol(Builtins::GetName(id));
|
1607
|
-
Object* function_object = builtins->GetPropertyNoExceptionThrown(*name);
|
1608
|
-
Handle<JSFunction> function
|
1609
|
-
= Handle<JSFunction>(JSFunction::cast(function_object));
|
1610
|
-
builtins->set_javascript_builtin(id, *function);
|
1611
|
-
Handle<SharedFunctionInfo> shared
|
1612
|
-
= Handle<SharedFunctionInfo>(function->shared());
|
1613
|
-
if (!EnsureCompiled(shared, CLEAR_EXCEPTION)) return false;
|
1614
|
-
// Set the code object on the function object.
|
1615
|
-
function->ReplaceCode(function->shared()->code());
|
1616
|
-
builtins->set_javascript_builtin_code(id, shared->code());
|
1617
|
-
}
|
1618
|
-
return true;
|
1619
|
-
}
|
1620
|
-
|
1621
|
-
|
1622
|
-
bool Genesis::ConfigureGlobalObjects(
|
1623
|
-
v8::Handle<v8::ObjectTemplate> global_proxy_template) {
|
1624
|
-
Handle<JSObject> global_proxy(
|
1625
|
-
JSObject::cast(global_context()->global_proxy()));
|
1626
|
-
Handle<JSObject> inner_global(JSObject::cast(global_context()->global()));
|
1627
|
-
|
1628
|
-
if (!global_proxy_template.IsEmpty()) {
|
1629
|
-
// Configure the global proxy object.
|
1630
|
-
Handle<ObjectTemplateInfo> proxy_data =
|
1631
|
-
v8::Utils::OpenHandle(*global_proxy_template);
|
1632
|
-
if (!ConfigureApiObject(global_proxy, proxy_data)) return false;
|
1633
|
-
|
1634
|
-
// Configure the inner global object.
|
1635
|
-
Handle<FunctionTemplateInfo> proxy_constructor(
|
1636
|
-
FunctionTemplateInfo::cast(proxy_data->constructor()));
|
1637
|
-
if (!proxy_constructor->prototype_template()->IsUndefined()) {
|
1638
|
-
Handle<ObjectTemplateInfo> inner_data(
|
1639
|
-
ObjectTemplateInfo::cast(proxy_constructor->prototype_template()));
|
1640
|
-
if (!ConfigureApiObject(inner_global, inner_data)) return false;
|
1641
|
-
}
|
1642
|
-
}
|
1643
|
-
|
1644
|
-
SetObjectPrototype(global_proxy, inner_global);
|
1645
|
-
return true;
|
1646
|
-
}
|
1647
|
-
|
1648
|
-
|
1649
|
-
bool Genesis::ConfigureApiObject(Handle<JSObject> object,
|
1650
|
-
Handle<ObjectTemplateInfo> object_template) {
|
1651
|
-
ASSERT(!object_template.is_null());
|
1652
|
-
ASSERT(object->IsInstanceOf(
|
1653
|
-
FunctionTemplateInfo::cast(object_template->constructor())));
|
1654
|
-
|
1655
|
-
bool pending_exception = false;
|
1656
|
-
Handle<JSObject> obj =
|
1657
|
-
Execution::InstantiateObject(object_template, &pending_exception);
|
1658
|
-
if (pending_exception) {
|
1659
|
-
ASSERT(Top::has_pending_exception());
|
1660
|
-
Top::clear_pending_exception();
|
1661
|
-
return false;
|
1662
|
-
}
|
1663
|
-
TransferObject(obj, object);
|
1664
|
-
return true;
|
1665
|
-
}
|
1666
|
-
|
1667
|
-
|
1668
|
-
void Genesis::TransferNamedProperties(Handle<JSObject> from,
|
1669
|
-
Handle<JSObject> to) {
|
1670
|
-
if (from->HasFastProperties()) {
|
1671
|
-
Handle<DescriptorArray> descs =
|
1672
|
-
Handle<DescriptorArray>(from->map()->instance_descriptors());
|
1673
|
-
for (int i = 0; i < descs->number_of_descriptors(); i++) {
|
1674
|
-
PropertyDetails details = PropertyDetails(descs->GetDetails(i));
|
1675
|
-
switch (details.type()) {
|
1676
|
-
case FIELD: {
|
1677
|
-
HandleScope inner;
|
1678
|
-
Handle<String> key = Handle<String>(descs->GetKey(i));
|
1679
|
-
int index = descs->GetFieldIndex(i);
|
1680
|
-
Handle<Object> value = Handle<Object>(from->FastPropertyAt(index));
|
1681
|
-
SetLocalPropertyNoThrow(to, key, value, details.attributes());
|
1682
|
-
break;
|
1683
|
-
}
|
1684
|
-
case CONSTANT_FUNCTION: {
|
1685
|
-
HandleScope inner;
|
1686
|
-
Handle<String> key = Handle<String>(descs->GetKey(i));
|
1687
|
-
Handle<JSFunction> fun =
|
1688
|
-
Handle<JSFunction>(descs->GetConstantFunction(i));
|
1689
|
-
SetLocalPropertyNoThrow(to, key, fun, details.attributes());
|
1690
|
-
break;
|
1691
|
-
}
|
1692
|
-
case CALLBACKS: {
|
1693
|
-
LookupResult result;
|
1694
|
-
to->LocalLookup(descs->GetKey(i), &result);
|
1695
|
-
// If the property is already there we skip it
|
1696
|
-
if (result.IsProperty()) continue;
|
1697
|
-
HandleScope inner;
|
1698
|
-
ASSERT(!to->HasFastProperties());
|
1699
|
-
// Add to dictionary.
|
1700
|
-
Handle<String> key = Handle<String>(descs->GetKey(i));
|
1701
|
-
Handle<Object> callbacks(descs->GetCallbacksObject(i));
|
1702
|
-
PropertyDetails d =
|
1703
|
-
PropertyDetails(details.attributes(), CALLBACKS, details.index());
|
1704
|
-
SetNormalizedProperty(to, key, callbacks, d);
|
1705
|
-
break;
|
1706
|
-
}
|
1707
|
-
case MAP_TRANSITION:
|
1708
|
-
case CONSTANT_TRANSITION:
|
1709
|
-
case NULL_DESCRIPTOR:
|
1710
|
-
// Ignore non-properties.
|
1711
|
-
break;
|
1712
|
-
case NORMAL:
|
1713
|
-
// Do not occur since the from object has fast properties.
|
1714
|
-
case INTERCEPTOR:
|
1715
|
-
// No element in instance descriptors have interceptor type.
|
1716
|
-
UNREACHABLE();
|
1717
|
-
break;
|
1718
|
-
}
|
1719
|
-
}
|
1720
|
-
} else {
|
1721
|
-
Handle<StringDictionary> properties =
|
1722
|
-
Handle<StringDictionary>(from->property_dictionary());
|
1723
|
-
int capacity = properties->Capacity();
|
1724
|
-
for (int i = 0; i < capacity; i++) {
|
1725
|
-
Object* raw_key(properties->KeyAt(i));
|
1726
|
-
if (properties->IsKey(raw_key)) {
|
1727
|
-
ASSERT(raw_key->IsString());
|
1728
|
-
// If the property is already there we skip it.
|
1729
|
-
LookupResult result;
|
1730
|
-
to->LocalLookup(String::cast(raw_key), &result);
|
1731
|
-
if (result.IsProperty()) continue;
|
1732
|
-
// Set the property.
|
1733
|
-
Handle<String> key = Handle<String>(String::cast(raw_key));
|
1734
|
-
Handle<Object> value = Handle<Object>(properties->ValueAt(i));
|
1735
|
-
if (value->IsJSGlobalPropertyCell()) {
|
1736
|
-
value = Handle<Object>(JSGlobalPropertyCell::cast(*value)->value());
|
1737
|
-
}
|
1738
|
-
PropertyDetails details = properties->DetailsAt(i);
|
1739
|
-
SetLocalPropertyNoThrow(to, key, value, details.attributes());
|
1740
|
-
}
|
1741
|
-
}
|
1742
|
-
}
|
1743
|
-
}
|
1744
|
-
|
1745
|
-
|
1746
|
-
void Genesis::TransferIndexedProperties(Handle<JSObject> from,
|
1747
|
-
Handle<JSObject> to) {
|
1748
|
-
// Cloning the elements array is sufficient.
|
1749
|
-
Handle<FixedArray> from_elements =
|
1750
|
-
Handle<FixedArray>(FixedArray::cast(from->elements()));
|
1751
|
-
Handle<FixedArray> to_elements = Factory::CopyFixedArray(from_elements);
|
1752
|
-
to->set_elements(*to_elements);
|
1753
|
-
}
|
1754
|
-
|
1755
|
-
|
1756
|
-
void Genesis::TransferObject(Handle<JSObject> from, Handle<JSObject> to) {
|
1757
|
-
HandleScope outer;
|
1758
|
-
|
1759
|
-
ASSERT(!from->IsJSArray());
|
1760
|
-
ASSERT(!to->IsJSArray());
|
1761
|
-
|
1762
|
-
TransferNamedProperties(from, to);
|
1763
|
-
TransferIndexedProperties(from, to);
|
1764
|
-
|
1765
|
-
// Transfer the prototype (new map is needed).
|
1766
|
-
Handle<Map> old_to_map = Handle<Map>(to->map());
|
1767
|
-
Handle<Map> new_to_map = Factory::CopyMapDropTransitions(old_to_map);
|
1768
|
-
new_to_map->set_prototype(from->map()->prototype());
|
1769
|
-
to->set_map(*new_to_map);
|
1770
|
-
}
|
1771
|
-
|
1772
|
-
|
1773
|
-
void Genesis::MakeFunctionInstancePrototypeWritable() {
|
1774
|
-
// Make a new function map so all future functions
|
1775
|
-
// will have settable and enumerable prototype properties.
|
1776
|
-
HandleScope scope;
|
1777
|
-
|
1778
|
-
Handle<DescriptorArray> function_map_descriptors =
|
1779
|
-
ComputeFunctionInstanceDescriptor(ADD_WRITEABLE_PROTOTYPE);
|
1780
|
-
Handle<Map> fm = Factory::CopyMapDropDescriptors(Top::function_map());
|
1781
|
-
fm->set_instance_descriptors(*function_map_descriptors);
|
1782
|
-
fm->set_function_with_prototype(true);
|
1783
|
-
Top::context()->global_context()->set_function_map(*fm);
|
1784
|
-
}
|
1785
|
-
|
1786
|
-
|
1787
|
-
Genesis::Genesis(Handle<Object> global_object,
|
1788
|
-
v8::Handle<v8::ObjectTemplate> global_template,
|
1789
|
-
v8::ExtensionConfiguration* extensions) {
|
1790
|
-
result_ = Handle<Context>::null();
|
1791
|
-
// If V8 isn't running and cannot be initialized, just return.
|
1792
|
-
if (!V8::IsRunning() && !V8::Initialize(NULL)) return;
|
1793
|
-
|
1794
|
-
// Before creating the roots we must save the context and restore it
|
1795
|
-
// on all function exits.
|
1796
|
-
HandleScope scope;
|
1797
|
-
SaveContext saved_context;
|
1798
|
-
|
1799
|
-
Handle<Context> new_context = Snapshot::NewContextFromSnapshot();
|
1800
|
-
if (!new_context.is_null()) {
|
1801
|
-
global_context_ =
|
1802
|
-
Handle<Context>::cast(GlobalHandles::Create(*new_context));
|
1803
|
-
AddToWeakGlobalContextList(*global_context_);
|
1804
|
-
Top::set_context(*global_context_);
|
1805
|
-
i::Counters::contexts_created_by_snapshot.Increment();
|
1806
|
-
JSFunction* empty_function =
|
1807
|
-
JSFunction::cast(global_context_->function_map()->prototype());
|
1808
|
-
empty_function_ = Handle<JSFunction>(empty_function);
|
1809
|
-
Handle<GlobalObject> inner_global;
|
1810
|
-
Handle<JSGlobalProxy> global_proxy =
|
1811
|
-
CreateNewGlobals(global_template,
|
1812
|
-
global_object,
|
1813
|
-
&inner_global);
|
1814
|
-
|
1815
|
-
HookUpGlobalProxy(inner_global, global_proxy);
|
1816
|
-
HookUpInnerGlobal(inner_global);
|
1817
|
-
|
1818
|
-
if (!ConfigureGlobalObjects(global_template)) return;
|
1819
|
-
} else {
|
1820
|
-
// We get here if there was no context snapshot.
|
1821
|
-
CreateRoots();
|
1822
|
-
Handle<JSFunction> empty_function = CreateEmptyFunction();
|
1823
|
-
Handle<GlobalObject> inner_global;
|
1824
|
-
Handle<JSGlobalProxy> global_proxy =
|
1825
|
-
CreateNewGlobals(global_template, global_object, &inner_global);
|
1826
|
-
HookUpGlobalProxy(inner_global, global_proxy);
|
1827
|
-
InitializeGlobal(inner_global, empty_function);
|
1828
|
-
InstallJSFunctionResultCaches();
|
1829
|
-
InitializeNormalizedMapCaches();
|
1830
|
-
if (!InstallNatives()) return;
|
1831
|
-
|
1832
|
-
MakeFunctionInstancePrototypeWritable();
|
1833
|
-
|
1834
|
-
if (!ConfigureGlobalObjects(global_template)) return;
|
1835
|
-
i::Counters::contexts_created_from_scratch.Increment();
|
1836
|
-
}
|
1837
|
-
|
1838
|
-
result_ = global_context_;
|
1839
|
-
}
|
1840
|
-
|
1841
|
-
|
1842
|
-
// Support for thread preemption.
|
1843
|
-
|
1844
|
-
// Reserve space for statics needing saving and restoring.
|
1845
|
-
int Bootstrapper::ArchiveSpacePerThread() {
|
1846
|
-
return BootstrapperActive::ArchiveSpacePerThread();
|
1847
|
-
}
|
1848
|
-
|
1849
|
-
|
1850
|
-
// Archive statics that are thread local.
|
1851
|
-
char* Bootstrapper::ArchiveState(char* to) {
|
1852
|
-
return BootstrapperActive::ArchiveState(to);
|
1853
|
-
}
|
1854
|
-
|
1855
|
-
|
1856
|
-
// Restore statics that are thread local.
|
1857
|
-
char* Bootstrapper::RestoreState(char* from) {
|
1858
|
-
return BootstrapperActive::RestoreState(from);
|
1859
|
-
}
|
1860
|
-
|
1861
|
-
|
1862
|
-
// Called when the top-level V8 mutex is destroyed.
|
1863
|
-
void Bootstrapper::FreeThreadResources() {
|
1864
|
-
ASSERT(!BootstrapperActive::IsActive());
|
1865
|
-
}
|
1866
|
-
|
1867
|
-
|
1868
|
-
// Reserve space for statics needing saving and restoring.
|
1869
|
-
int BootstrapperActive::ArchiveSpacePerThread() {
|
1870
|
-
return sizeof(nesting_);
|
1871
|
-
}
|
1872
|
-
|
1873
|
-
|
1874
|
-
// Archive statics that are thread local.
|
1875
|
-
char* BootstrapperActive::ArchiveState(char* to) {
|
1876
|
-
*reinterpret_cast<int*>(to) = nesting_;
|
1877
|
-
nesting_ = 0;
|
1878
|
-
return to + sizeof(nesting_);
|
1879
|
-
}
|
1880
|
-
|
1881
|
-
|
1882
|
-
// Restore statics that are thread local.
|
1883
|
-
char* BootstrapperActive::RestoreState(char* from) {
|
1884
|
-
nesting_ = *reinterpret_cast<int*>(from);
|
1885
|
-
return from + sizeof(nesting_);
|
1886
|
-
}
|
1887
|
-
|
1888
|
-
} } // namespace v8::internal
|