therubyracer 0.8.1.pre2 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of therubyracer might be problematic. Click here for more details.
- data/Changelog.md +2 -1
- data/README.md +6 -3
- data/ext/v8/upstream/3.1.8/.gitignore +31 -0
- data/ext/v8/upstream/3.1.8/AUTHORS +40 -0
- data/ext/v8/upstream/3.1.8/ChangeLog +2566 -0
- data/ext/v8/upstream/3.1.8/LICENSE +52 -0
- data/ext/v8/upstream/3.1.8/LICENSE.strongtalk +29 -0
- data/ext/v8/upstream/3.1.8/LICENSE.v8 +26 -0
- data/ext/v8/upstream/3.1.8/LICENSE.valgrind +45 -0
- data/ext/v8/upstream/3.1.8/SConstruct +1192 -0
- data/ext/v8/upstream/3.1.8/build/README.txt +25 -0
- data/ext/v8/upstream/3.1.8/build/all.gyp +18 -0
- data/ext/v8/upstream/3.1.8/build/armu.gypi +32 -0
- data/ext/v8/upstream/3.1.8/build/common.gypi +82 -0
- data/ext/v8/upstream/3.1.8/build/gyp_v8 +145 -0
- data/ext/v8/upstream/3.1.8/include/v8-debug.h +384 -0
- data/ext/v8/upstream/3.1.8/include/v8-preparser.h +116 -0
- data/ext/v8/upstream/3.1.8/include/v8-profiler.h +426 -0
- data/ext/v8/upstream/3.1.8/include/v8-testing.h +99 -0
- data/ext/v8/upstream/3.1.8/include/v8.h +3846 -0
- data/ext/v8/upstream/3.1.8/include/v8stdint.h +53 -0
- data/ext/v8/upstream/3.1.8/preparser/preparser-process.cc +206 -0
- data/ext/v8/upstream/3.1.8/src/SConscript +356 -0
- data/ext/v8/upstream/3.1.8/src/accessors.cc +907 -0
- data/ext/v8/upstream/3.1.8/src/accessors.h +121 -0
- data/ext/v8/upstream/3.1.8/src/allocation.cc +204 -0
- data/ext/v8/upstream/3.1.8/src/allocation.h +176 -0
- data/ext/v8/upstream/3.1.8/src/api.cc +5191 -0
- data/ext/v8/upstream/3.1.8/src/api.h +508 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/apinatives.js +0 -0
- data/ext/v8/upstream/3.1.8/src/apiutils.h +80 -0
- data/ext/v8/upstream/3.1.8/src/arguments.h +105 -0
- data/ext/v8/upstream/3.1.8/src/arm/assembler-arm-inl.h +352 -0
- data/ext/v8/upstream/3.1.8/src/arm/assembler-arm.cc +2756 -0
- data/ext/v8/upstream/3.1.8/src/arm/assembler-arm.h +1294 -0
- data/ext/v8/upstream/3.1.8/src/arm/builtins-arm.cc +1628 -0
- data/ext/v8/upstream/3.1.8/src/arm/code-stubs-arm.cc +6783 -0
- data/ext/v8/upstream/3.1.8/src/arm/code-stubs-arm.h +657 -0
- data/ext/v8/upstream/3.1.8/src/arm/codegen-arm-inl.h +48 -0
- data/ext/v8/upstream/3.1.8/src/arm/codegen-arm.cc +7403 -0
- data/ext/v8/upstream/3.1.8/src/arm/codegen-arm.h +595 -0
- data/ext/v8/upstream/3.1.8/src/arm/constants-arm.cc +152 -0
- data/ext/v8/upstream/3.1.8/src/arm/constants-arm.h +769 -0
- data/ext/v8/upstream/3.1.8/src/arm/cpu-arm.cc +147 -0
- data/ext/v8/upstream/3.1.8/src/arm/debug-arm.cc +315 -0
- data/ext/v8/upstream/3.1.8/src/arm/deoptimizer-arm.cc +700 -0
- data/ext/v8/upstream/3.1.8/src/arm/disasm-arm.cc +1439 -0
- data/ext/v8/upstream/3.1.8/src/arm/frames-arm.cc +45 -0
- data/ext/v8/upstream/3.1.8/src/arm/frames-arm.h +168 -0
- data/ext/v8/upstream/3.1.8/src/arm/full-codegen-arm.cc +4230 -0
- data/ext/v8/upstream/3.1.8/src/arm/ic-arm.cc +1799 -0
- data/ext/v8/upstream/3.1.8/src/arm/jump-target-arm.cc +174 -0
- data/ext/v8/upstream/3.1.8/src/arm/lithium-arm.cc +2041 -0
- data/ext/v8/upstream/3.1.8/src/arm/lithium-arm.h +2046 -0
- data/ext/v8/upstream/3.1.8/src/arm/lithium-codegen-arm.cc +3822 -0
- data/ext/v8/upstream/3.1.8/src/arm/lithium-codegen-arm.h +312 -0
- data/ext/v8/upstream/3.1.8/src/arm/lithium-gap-resolver-arm.cc +303 -0
- data/ext/v8/upstream/3.1.8/src/arm/lithium-gap-resolver-arm.h +84 -0
- data/ext/v8/upstream/3.1.8/src/arm/macro-assembler-arm.cc +2701 -0
- data/ext/v8/upstream/3.1.8/src/arm/macro-assembler-arm.h +1015 -0
- data/ext/v8/upstream/3.1.8/src/arm/regexp-macro-assembler-arm.cc +1280 -0
- data/ext/v8/upstream/3.1.8/src/arm/regexp-macro-assembler-arm.h +252 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/arm/register-allocator-arm-inl.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/arm/register-allocator-arm.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/arm/register-allocator-arm.h +0 -0
- data/ext/v8/upstream/3.1.8/src/arm/simulator-arm.cc +3165 -0
- data/ext/v8/upstream/3.1.8/src/arm/simulator-arm.h +402 -0
- data/ext/v8/upstream/3.1.8/src/arm/stub-cache-arm.cc +4077 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/arm/virtual-frame-arm-inl.h +0 -0
- data/ext/v8/upstream/3.1.8/src/arm/virtual-frame-arm.cc +843 -0
- data/ext/v8/upstream/3.1.8/src/arm/virtual-frame-arm.h +520 -0
- data/ext/v8/upstream/3.1.8/src/array.js +1231 -0
- data/ext/v8/upstream/3.1.8/src/assembler.cc +973 -0
- data/ext/v8/upstream/3.1.8/src/assembler.h +787 -0
- data/ext/v8/upstream/3.1.8/src/ast-inl.h +107 -0
- data/ext/v8/upstream/3.1.8/src/ast.cc +1067 -0
- data/ext/v8/upstream/3.1.8/src/ast.h +2177 -0
- data/ext/v8/upstream/3.1.8/src/atomicops.h +165 -0
- data/ext/v8/upstream/3.1.8/src/atomicops_internals_arm_gcc.h +145 -0
- data/ext/v8/upstream/3.1.8/src/atomicops_internals_x86_gcc.cc +126 -0
- data/ext/v8/upstream/3.1.8/src/atomicops_internals_x86_gcc.h +287 -0
- data/ext/v8/upstream/3.1.8/src/atomicops_internals_x86_macosx.h +301 -0
- data/ext/v8/upstream/3.1.8/src/atomicops_internals_x86_msvc.h +203 -0
- data/ext/v8/upstream/3.1.8/src/bignum-dtoa.cc +655 -0
- data/ext/v8/upstream/3.1.8/src/bignum-dtoa.h +81 -0
- data/ext/v8/upstream/3.1.8/src/bignum.cc +768 -0
- data/ext/v8/upstream/3.1.8/src/bignum.h +140 -0
- data/ext/v8/upstream/3.1.8/src/bootstrapper.cc +1888 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/bootstrapper.h +0 -0
- data/ext/v8/upstream/3.1.8/src/builtins.cc +1586 -0
- data/ext/v8/upstream/3.1.8/src/builtins.h +339 -0
- data/ext/v8/upstream/3.1.8/src/bytecodes-irregexp.h +105 -0
- data/ext/v8/upstream/3.1.8/src/cached-powers.cc +177 -0
- data/ext/v8/upstream/3.1.8/src/cached-powers.h +65 -0
- data/ext/v8/upstream/3.1.8/src/char-predicates-inl.h +94 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/char-predicates.h +0 -0
- data/ext/v8/upstream/3.1.8/src/checks.cc +110 -0
- data/ext/v8/upstream/3.1.8/src/checks.h +292 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/circular-queue-inl.h +0 -0
- data/ext/v8/upstream/3.1.8/src/circular-queue.cc +122 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/circular-queue.h +0 -0
- data/ext/v8/upstream/3.1.8/src/code-stubs.cc +230 -0
- data/ext/v8/upstream/3.1.8/src/code-stubs.h +950 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/code.h +0 -0
- data/ext/v8/upstream/3.1.8/src/codegen-inl.h +64 -0
- data/ext/v8/upstream/3.1.8/src/codegen.cc +495 -0
- data/ext/v8/upstream/3.1.8/src/codegen.h +245 -0
- data/ext/v8/upstream/3.1.8/src/compilation-cache.cc +654 -0
- data/ext/v8/upstream/3.1.8/src/compilation-cache.h +112 -0
- data/ext/v8/upstream/3.1.8/src/compiler.cc +806 -0
- data/ext/v8/upstream/3.1.8/src/compiler.h +290 -0
- data/ext/v8/upstream/3.1.8/src/contexts.cc +320 -0
- data/ext/v8/upstream/3.1.8/src/contexts.h +376 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/conversions-inl.h +0 -0
- data/ext/v8/upstream/3.1.8/src/conversions.cc +1069 -0
- data/ext/v8/upstream/3.1.8/src/conversions.h +122 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/counters.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/counters.h +242 -0
- data/ext/v8/upstream/3.1.8/src/cpu-profiler-inl.h +100 -0
- data/ext/v8/upstream/3.1.8/src/cpu-profiler.cc +554 -0
- data/ext/v8/upstream/3.1.8/src/cpu-profiler.h +291 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/cpu.h +0 -0
- data/ext/v8/upstream/3.1.8/src/d8-debug.cc +367 -0
- data/ext/v8/upstream/3.1.8/src/d8-debug.h +157 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/d8-posix.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/d8-readline.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/d8-windows.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/d8.cc +792 -0
- data/ext/v8/upstream/3.1.8/src/d8.gyp +85 -0
- data/ext/v8/upstream/3.1.8/src/d8.h +231 -0
- data/ext/v8/upstream/3.1.8/src/d8.js +2798 -0
- data/ext/v8/upstream/3.1.8/src/data-flow.cc +545 -0
- data/ext/v8/upstream/3.1.8/src/data-flow.h +379 -0
- data/ext/v8/upstream/3.1.8/src/date.js +1103 -0
- data/ext/v8/upstream/3.1.8/src/dateparser-inl.h +125 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/dateparser.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/dateparser.h +263 -0
- data/ext/v8/upstream/3.1.8/src/debug-agent.cc +446 -0
- data/ext/v8/upstream/3.1.8/src/debug-agent.h +131 -0
- data/ext/v8/upstream/3.1.8/src/debug-debugger.js +2569 -0
- data/ext/v8/upstream/3.1.8/src/debug.cc +3085 -0
- data/ext/v8/upstream/3.1.8/src/debug.h +1025 -0
- data/ext/v8/upstream/3.1.8/src/deoptimizer.cc +1185 -0
- data/ext/v8/upstream/3.1.8/src/deoptimizer.h +529 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/disasm.h +0 -0
- data/ext/v8/upstream/3.1.8/src/disassembler.cc +338 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/disassembler.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/diy-fp.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/diy-fp.h +0 -0
- data/ext/v8/upstream/3.1.8/src/double.h +238 -0
- data/ext/v8/upstream/3.1.8/src/dtoa.cc +103 -0
- data/ext/v8/upstream/3.1.8/src/dtoa.h +85 -0
- data/ext/v8/upstream/3.1.8/src/execution.cc +735 -0
- data/ext/v8/upstream/3.1.8/src/execution.h +322 -0
- data/ext/v8/upstream/3.1.8/src/extensions/experimental/experimental.gyp +53 -0
- data/ext/v8/upstream/3.1.8/src/extensions/experimental/i18n-extension.cc +264 -0
- data/ext/v8/upstream/3.1.8/src/extensions/experimental/i18n-extension.h +64 -0
- data/ext/v8/upstream/3.1.8/src/extensions/externalize-string-extension.cc +141 -0
- data/ext/v8/upstream/3.1.8/src/extensions/externalize-string-extension.h +50 -0
- data/ext/v8/upstream/3.1.8/src/extensions/gc-extension.cc +58 -0
- data/ext/v8/upstream/3.1.8/src/extensions/gc-extension.h +49 -0
- data/ext/v8/upstream/3.1.8/src/factory.cc +1087 -0
- data/ext/v8/upstream/3.1.8/src/factory.h +432 -0
- data/ext/v8/upstream/3.1.8/src/fast-dtoa.cc +736 -0
- data/ext/v8/upstream/3.1.8/src/fast-dtoa.h +83 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/fixed-dtoa.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/fixed-dtoa.h +0 -0
- data/ext/v8/upstream/3.1.8/src/flag-definitions.h +552 -0
- data/ext/v8/upstream/3.1.8/src/flags.cc +551 -0
- data/ext/v8/upstream/3.1.8/src/flags.h +79 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/frame-element.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/frame-element.h +277 -0
- data/ext/v8/upstream/3.1.8/src/frames-inl.h +210 -0
- data/ext/v8/upstream/3.1.8/src/frames.cc +1232 -0
- data/ext/v8/upstream/3.1.8/src/frames.h +826 -0
- data/ext/v8/upstream/3.1.8/src/full-codegen.cc +1382 -0
- data/ext/v8/upstream/3.1.8/src/full-codegen.h +751 -0
- data/ext/v8/upstream/3.1.8/src/func-name-inferrer.cc +90 -0
- data/ext/v8/upstream/3.1.8/src/func-name-inferrer.h +111 -0
- data/ext/v8/upstream/3.1.8/src/gdb-jit.cc +1547 -0
- data/ext/v8/upstream/3.1.8/src/gdb-jit.h +138 -0
- data/ext/v8/upstream/3.1.8/src/global-handles.cc +534 -0
- data/ext/v8/upstream/3.1.8/src/global-handles.h +181 -0
- data/ext/v8/upstream/3.1.8/src/globals.h +325 -0
- data/ext/v8/upstream/3.1.8/src/handles-inl.h +80 -0
- data/ext/v8/upstream/3.1.8/src/handles.cc +910 -0
- data/ext/v8/upstream/3.1.8/src/handles.h +424 -0
- data/ext/v8/upstream/3.1.8/src/hashmap.cc +230 -0
- data/ext/v8/upstream/3.1.8/src/hashmap.h +121 -0
- data/ext/v8/upstream/3.1.8/src/heap-inl.h +587 -0
- data/ext/v8/upstream/3.1.8/src/heap-profiler.cc +1128 -0
- data/ext/v8/upstream/3.1.8/src/heap-profiler.h +381 -0
- data/ext/v8/upstream/3.1.8/src/heap.cc +5610 -0
- data/ext/v8/upstream/3.1.8/src/heap.h +2218 -0
- data/ext/v8/upstream/3.1.8/src/hydrogen-instructions.cc +1490 -0
- data/ext/v8/upstream/3.1.8/src/hydrogen-instructions.h +3493 -0
- data/ext/v8/upstream/3.1.8/src/hydrogen.cc +6056 -0
- data/ext/v8/upstream/3.1.8/src/hydrogen.h +1091 -0
- data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32-inl.h +429 -0
- data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32.cc +2800 -0
- data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32.h +1093 -0
- data/ext/v8/upstream/3.1.8/src/ia32/builtins-ia32.cc +1590 -0
- data/ext/v8/upstream/3.1.8/src/ia32/code-stubs-ia32.cc +6624 -0
- data/ext/v8/upstream/3.1.8/src/ia32/code-stubs-ia32.h +536 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/codegen-ia32-inl.h +0 -0
- data/ext/v8/upstream/3.1.8/src/ia32/codegen-ia32.cc +10354 -0
- data/ext/v8/upstream/3.1.8/src/ia32/codegen-ia32.h +798 -0
- data/ext/v8/upstream/3.1.8/src/ia32/cpu-ia32.cc +87 -0
- data/ext/v8/upstream/3.1.8/src/ia32/debug-ia32.cc +309 -0
- data/ext/v8/upstream/3.1.8/src/ia32/deoptimizer-ia32.cc +664 -0
- data/ext/v8/upstream/3.1.8/src/ia32/disasm-ia32.cc +1597 -0
- data/ext/v8/upstream/3.1.8/src/ia32/frames-ia32.cc +45 -0
- data/ext/v8/upstream/3.1.8/src/ia32/frames-ia32.h +140 -0
- data/ext/v8/upstream/3.1.8/src/ia32/full-codegen-ia32.cc +4278 -0
- data/ext/v8/upstream/3.1.8/src/ia32/ic-ia32.cc +1786 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/jump-target-ia32.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/ia32/lithium-codegen-ia32.cc +3880 -0
- data/ext/v8/upstream/3.1.8/src/ia32/lithium-codegen-ia32.h +309 -0
- data/ext/v8/upstream/3.1.8/src/ia32/lithium-gap-resolver-ia32.cc +460 -0
- data/ext/v8/upstream/3.1.8/src/ia32/lithium-gap-resolver-ia32.h +110 -0
- data/ext/v8/upstream/3.1.8/src/ia32/lithium-ia32.cc +2095 -0
- data/ext/v8/upstream/3.1.8/src/ia32/lithium-ia32.h +2127 -0
- data/ext/v8/upstream/3.1.8/src/ia32/macro-assembler-ia32.cc +2031 -0
- data/ext/v8/upstream/3.1.8/src/ia32/macro-assembler-ia32.h +798 -0
- data/ext/v8/upstream/3.1.8/src/ia32/regexp-macro-assembler-ia32.cc +1253 -0
- data/ext/v8/upstream/3.1.8/src/ia32/regexp-macro-assembler-ia32.h +215 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/register-allocator-ia32-inl.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/register-allocator-ia32.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/register-allocator-ia32.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/simulator-ia32.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/ia32/simulator-ia32.h +72 -0
- data/ext/v8/upstream/3.1.8/src/ia32/stub-cache-ia32.cc +3732 -0
- data/ext/v8/upstream/3.1.8/src/ia32/virtual-frame-ia32.cc +1360 -0
- data/ext/v8/upstream/3.1.8/src/ia32/virtual-frame-ia32.h +646 -0
- data/ext/v8/upstream/3.1.8/src/ic-inl.h +129 -0
- data/ext/v8/upstream/3.1.8/src/ic.cc +2333 -0
- data/ext/v8/upstream/3.1.8/src/ic.h +639 -0
- data/ext/v8/upstream/3.1.8/src/inspector.cc +63 -0
- data/ext/v8/upstream/3.1.8/src/inspector.h +62 -0
- data/ext/v8/upstream/3.1.8/src/interpreter-irregexp.cc +655 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/interpreter-irregexp.h +0 -0
- data/ext/v8/upstream/3.1.8/src/json.js +342 -0
- data/ext/v8/upstream/3.1.8/src/jsregexp.cc +5340 -0
- data/ext/v8/upstream/3.1.8/src/jsregexp.h +1484 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/jump-target-heavy-inl.h +0 -0
- data/ext/v8/upstream/3.1.8/src/jump-target-heavy.cc +430 -0
- data/ext/v8/upstream/3.1.8/src/jump-target-heavy.h +244 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/jump-target-inl.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/jump-target-light-inl.h +0 -0
- data/ext/v8/upstream/3.1.8/src/jump-target-light.cc +111 -0
- data/ext/v8/upstream/3.1.8/src/jump-target-light.h +193 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/jump-target.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/jump-target.h +0 -0
- data/ext/v8/upstream/3.1.8/src/list-inl.h +206 -0
- data/ext/v8/upstream/3.1.8/src/list.h +164 -0
- data/ext/v8/upstream/3.1.8/src/lithium-allocator-inl.h +140 -0
- data/ext/v8/upstream/3.1.8/src/lithium-allocator.cc +2093 -0
- data/ext/v8/upstream/3.1.8/src/lithium-allocator.h +644 -0
- data/ext/v8/upstream/3.1.8/src/lithium.cc +168 -0
- data/ext/v8/upstream/3.1.8/src/lithium.h +592 -0
- data/ext/v8/upstream/3.1.8/src/liveedit-debugger.js +1082 -0
- data/ext/v8/upstream/3.1.8/src/liveedit.cc +1650 -0
- data/ext/v8/upstream/3.1.8/src/liveedit.h +174 -0
- data/ext/v8/upstream/3.1.8/src/liveobjectlist-inl.h +126 -0
- data/ext/v8/upstream/3.1.8/src/liveobjectlist.cc +2527 -0
- data/ext/v8/upstream/3.1.8/src/liveobjectlist.h +322 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/log-inl.h +0 -0
- data/ext/v8/upstream/3.1.8/src/log-utils.cc +336 -0
- data/ext/v8/upstream/3.1.8/src/log-utils.h +232 -0
- data/ext/v8/upstream/3.1.8/src/log.cc +1608 -0
- data/ext/v8/upstream/3.1.8/src/log.h +379 -0
- data/ext/v8/upstream/3.1.8/src/macro-assembler.h +120 -0
- data/ext/v8/upstream/3.1.8/src/macros.py +178 -0
- data/ext/v8/upstream/3.1.8/src/mark-compact.cc +2957 -0
- data/ext/v8/upstream/3.1.8/src/mark-compact.h +433 -0
- data/ext/v8/upstream/3.1.8/src/math.js +264 -0
- data/ext/v8/upstream/3.1.8/src/memory.h +82 -0
- data/ext/v8/upstream/3.1.8/src/messages.cc +164 -0
- data/ext/v8/upstream/3.1.8/src/messages.h +114 -0
- data/ext/v8/upstream/3.1.8/src/messages.js +1071 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/assembler-mips-inl.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/assembler-mips.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/mips/assembler-mips.h +667 -0
- data/ext/v8/upstream/3.1.8/src/mips/builtins-mips.cc +205 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/codegen-mips-inl.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/codegen-mips.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/mips/codegen-mips.h +431 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/constants-mips.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/constants-mips.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/cpu-mips.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/mips/debug-mips.cc +127 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/disasm-mips.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/fast-codegen-mips.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/mips/frames-mips.cc +96 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/frames-mips.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/full-codegen-mips.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/mips/ic-mips.cc +208 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/jump-target-mips.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/macro-assembler-mips.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/macro-assembler-mips.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/register-allocator-mips-inl.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/register-allocator-mips.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/register-allocator-mips.h +0 -0
- data/ext/v8/upstream/3.1.8/src/mips/simulator-mips.cc +1650 -0
- data/ext/v8/upstream/3.1.8/src/mips/simulator-mips.h +311 -0
- data/ext/v8/upstream/3.1.8/src/mips/stub-cache-mips.cc +418 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/virtual-frame-mips.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/virtual-frame-mips.h +0 -0
- data/ext/v8/upstream/3.1.8/src/mirror-debugger.js +2380 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mksnapshot.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/natives.h +0 -0
- data/ext/v8/upstream/3.1.8/src/objects-debug.cc +722 -0
- data/ext/v8/upstream/3.1.8/src/objects-inl.h +3946 -0
- data/ext/v8/upstream/3.1.8/src/objects-printer.cc +801 -0
- data/ext/v8/upstream/3.1.8/src/objects-visiting.cc +142 -0
- data/ext/v8/upstream/3.1.8/src/objects-visiting.h +401 -0
- data/ext/v8/upstream/3.1.8/src/objects.cc +10044 -0
- data/ext/v8/upstream/3.1.8/src/objects.h +6571 -0
- data/ext/v8/upstream/3.1.8/src/parser.cc +5165 -0
- data/ext/v8/upstream/3.1.8/src/parser.h +802 -0
- data/ext/v8/upstream/3.1.8/src/platform-cygwin.cc +745 -0
- data/ext/v8/upstream/3.1.8/src/platform-freebsd.cc +702 -0
- data/ext/v8/upstream/3.1.8/src/platform-linux.cc +981 -0
- data/ext/v8/upstream/3.1.8/src/platform-macos.cc +732 -0
- data/ext/v8/upstream/3.1.8/src/platform-nullos.cc +498 -0
- data/ext/v8/upstream/3.1.8/src/platform-openbsd.cc +657 -0
- data/ext/v8/upstream/3.1.8/src/platform-posix.cc +399 -0
- data/ext/v8/upstream/3.1.8/src/platform-solaris.cc +714 -0
- data/ext/v8/upstream/3.1.8/src/platform-win32.cc +1974 -0
- data/ext/v8/upstream/3.1.8/src/platform.h +636 -0
- data/ext/v8/upstream/3.1.8/src/preparse-data.cc +183 -0
- data/ext/v8/upstream/3.1.8/src/preparse-data.h +249 -0
- data/ext/v8/upstream/3.1.8/src/preparser-api.cc +213 -0
- data/ext/v8/upstream/3.1.8/src/preparser.cc +1205 -0
- data/ext/v8/upstream/3.1.8/src/preparser.h +278 -0
- data/ext/v8/upstream/3.1.8/src/prettyprinter.cc +1539 -0
- data/ext/v8/upstream/3.1.8/src/prettyprinter.h +223 -0
- data/ext/v8/upstream/3.1.8/src/profile-generator-inl.h +128 -0
- data/ext/v8/upstream/3.1.8/src/profile-generator.cc +2899 -0
- data/ext/v8/upstream/3.1.8/src/profile-generator.h +1151 -0
- data/ext/v8/upstream/3.1.8/src/property.cc +96 -0
- data/ext/v8/upstream/3.1.8/src/property.h +337 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/regexp-macro-assembler-irregexp-inl.h +0 -0
- data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler-irregexp.cc +470 -0
- data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler-irregexp.h +142 -0
- data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler-tracer.cc +373 -0
- data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler-tracer.h +104 -0
- data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler.cc +257 -0
- data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler.h +231 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/regexp-stack.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/regexp-stack.h +0 -0
- data/ext/v8/upstream/3.1.8/src/regexp.js +483 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/register-allocator-inl.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/register-allocator.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/register-allocator.h +0 -0
- data/ext/v8/upstream/3.1.8/src/rewriter.cc +1023 -0
- data/ext/v8/upstream/3.1.8/src/rewriter.h +59 -0
- data/ext/v8/upstream/3.1.8/src/runtime-profiler.cc +443 -0
- data/ext/v8/upstream/3.1.8/src/runtime-profiler.h +77 -0
- data/ext/v8/upstream/3.1.8/src/runtime.cc +11592 -0
- data/ext/v8/upstream/3.1.8/src/runtime.h +582 -0
- data/ext/v8/upstream/3.1.8/src/runtime.js +643 -0
- data/ext/v8/upstream/3.1.8/src/safepoint-table.cc +253 -0
- data/ext/v8/upstream/3.1.8/src/safepoint-table.h +263 -0
- data/ext/v8/upstream/3.1.8/src/scanner-base.cc +971 -0
- data/ext/v8/upstream/3.1.8/src/scanner-base.h +653 -0
- data/ext/v8/upstream/3.1.8/src/scanner.cc +586 -0
- data/ext/v8/upstream/3.1.8/src/scanner.h +194 -0
- data/ext/v8/upstream/3.1.8/src/scopeinfo.cc +636 -0
- data/ext/v8/upstream/3.1.8/src/scopeinfo.h +238 -0
- data/ext/v8/upstream/3.1.8/src/scopes.cc +1063 -0
- data/ext/v8/upstream/3.1.8/src/scopes.h +494 -0
- data/ext/v8/upstream/3.1.8/src/serialize.cc +1535 -0
- data/ext/v8/upstream/3.1.8/src/serialize.h +584 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/shell.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/simulator.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/smart-pointer.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/snapshot-common.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/snapshot-empty.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/snapshot.h +0 -0
- data/ext/v8/upstream/3.1.8/src/spaces-inl.h +524 -0
- data/ext/v8/upstream/3.1.8/src/spaces.cc +3254 -0
- data/ext/v8/upstream/3.1.8/src/spaces.h +2362 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/splay-tree-inl.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/splay-tree.h +0 -0
- data/ext/v8/upstream/3.1.8/src/string-search.cc +40 -0
- data/ext/v8/upstream/3.1.8/src/string-search.h +567 -0
- data/ext/v8/upstream/3.1.8/src/string-stream.cc +584 -0
- data/ext/v8/upstream/3.1.8/src/string-stream.h +191 -0
- data/ext/v8/upstream/3.1.8/src/string.js +915 -0
- data/ext/v8/upstream/3.1.8/src/strtod.cc +440 -0
- data/ext/v8/upstream/3.1.8/src/strtod.h +40 -0
- data/ext/v8/upstream/3.1.8/src/stub-cache.cc +1878 -0
- data/ext/v8/upstream/3.1.8/src/stub-cache.h +849 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/third_party/valgrind/valgrind.h +0 -0
- data/ext/v8/upstream/3.1.8/src/token.cc +63 -0
- data/ext/v8/upstream/3.1.8/src/token.h +288 -0
- data/ext/v8/upstream/3.1.8/src/top.cc +1152 -0
- data/ext/v8/upstream/3.1.8/src/top.h +608 -0
- data/ext/v8/upstream/3.1.8/src/type-info.cc +406 -0
- data/ext/v8/upstream/3.1.8/src/type-info.h +283 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/unbound-queue-inl.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/unbound-queue.h +0 -0
- data/ext/v8/upstream/3.1.8/src/unicode-inl.h +238 -0
- data/ext/v8/upstream/3.1.8/src/unicode.cc +1624 -0
- data/ext/v8/upstream/3.1.8/src/unicode.h +280 -0
- data/ext/v8/upstream/3.1.8/src/uri.js +402 -0
- data/ext/v8/upstream/3.1.8/src/utils.cc +371 -0
- data/ext/v8/upstream/3.1.8/src/utils.h +793 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/v8-counters.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/v8-counters.h +290 -0
- data/ext/v8/upstream/3.1.8/src/v8.cc +270 -0
- data/ext/v8/upstream/3.1.8/src/v8.h +127 -0
- data/ext/v8/upstream/3.1.8/src/v8checks.h +64 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/v8dll-main.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/v8globals.h +480 -0
- data/ext/v8/upstream/3.1.8/src/v8natives.js +1252 -0
- data/ext/v8/upstream/3.1.8/src/v8preparserdll-main.cc +39 -0
- data/ext/v8/upstream/3.1.8/src/v8threads.cc +440 -0
- data/ext/v8/upstream/3.1.8/src/v8threads.h +157 -0
- data/ext/v8/upstream/3.1.8/src/v8utils.h +354 -0
- data/ext/v8/upstream/3.1.8/src/variables.cc +132 -0
- data/ext/v8/upstream/3.1.8/src/variables.h +212 -0
- data/ext/v8/upstream/3.1.8/src/version.cc +95 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/version.h +0 -0
- data/ext/v8/upstream/3.1.8/src/virtual-frame-heavy-inl.h +190 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/virtual-frame-heavy.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/virtual-frame-inl.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/virtual-frame-light-inl.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/virtual-frame-light.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/virtual-frame.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/virtual-frame.h +59 -0
- data/ext/v8/upstream/3.1.8/src/vm-state-inl.h +134 -0
- data/ext/v8/upstream/3.1.8/src/vm-state.h +68 -0
- data/ext/v8/upstream/3.1.8/src/win32-headers.h +95 -0
- data/ext/v8/upstream/3.1.8/src/x64/assembler-x64-inl.h +455 -0
- data/ext/v8/upstream/3.1.8/src/x64/assembler-x64.cc +3162 -0
- data/ext/v8/upstream/3.1.8/src/x64/assembler-x64.h +1584 -0
- data/ext/v8/upstream/3.1.8/src/x64/builtins-x64.cc +1492 -0
- data/ext/v8/upstream/3.1.8/src/x64/code-stubs-x64.cc +5150 -0
- data/ext/v8/upstream/3.1.8/src/x64/code-stubs-x64.h +519 -0
- data/ext/v8/upstream/3.1.8/src/x64/codegen-x64-inl.h +46 -0
- data/ext/v8/upstream/3.1.8/src/x64/codegen-x64.cc +8835 -0
- data/ext/v8/upstream/3.1.8/src/x64/codegen-x64.h +750 -0
- data/ext/v8/upstream/3.1.8/src/x64/cpu-x64.cc +86 -0
- data/ext/v8/upstream/3.1.8/src/x64/debug-x64.cc +316 -0
- data/ext/v8/upstream/3.1.8/src/x64/deoptimizer-x64.cc +781 -0
- data/ext/v8/upstream/3.1.8/src/x64/disasm-x64.cc +1737 -0
- data/ext/v8/upstream/3.1.8/src/x64/frames-x64.cc +45 -0
- data/ext/v8/upstream/3.1.8/src/x64/frames-x64.h +130 -0
- data/ext/v8/upstream/3.1.8/src/x64/full-codegen-x64.cc +3984 -0
- data/ext/v8/upstream/3.1.8/src/x64/ic-x64.cc +1761 -0
- data/ext/v8/upstream/3.1.8/src/x64/jump-target-x64.cc +437 -0
- data/ext/v8/upstream/3.1.8/src/x64/lithium-codegen-x64.cc +3639 -0
- data/ext/v8/upstream/3.1.8/src/x64/lithium-codegen-x64.h +305 -0
- data/ext/v8/upstream/3.1.8/src/x64/lithium-gap-resolver-x64.cc +320 -0
- data/ext/v8/upstream/3.1.8/src/x64/lithium-gap-resolver-x64.h +74 -0
- data/ext/v8/upstream/3.1.8/src/x64/lithium-x64.cc +2044 -0
- data/ext/v8/upstream/3.1.8/src/x64/lithium-x64.h +2052 -0
- data/ext/v8/upstream/3.1.8/src/x64/macro-assembler-x64.cc +2660 -0
- data/ext/v8/upstream/3.1.8/src/x64/macro-assembler-x64.h +1852 -0
- data/ext/v8/upstream/3.1.8/src/x64/regexp-macro-assembler-x64.cc +1382 -0
- data/ext/v8/upstream/3.1.8/src/x64/regexp-macro-assembler-x64.h +278 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/x64/register-allocator-x64-inl.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/x64/register-allocator-x64.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/x64/register-allocator-x64.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/x64/simulator-x64.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/x64/simulator-x64.h +71 -0
- data/ext/v8/upstream/3.1.8/src/x64/stub-cache-x64.cc +3509 -0
- data/ext/v8/upstream/3.1.8/src/x64/virtual-frame-x64.cc +1292 -0
- data/ext/v8/upstream/3.1.8/src/x64/virtual-frame-x64.h +593 -0
- data/ext/v8/upstream/3.1.8/src/zone-inl.h +83 -0
- data/ext/v8/upstream/3.1.8/src/zone.cc +195 -0
- data/ext/v8/upstream/3.1.8/src/zone.h +233 -0
- data/ext/v8/upstream/3.1.8/tools/codemap.js +265 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/consarray.js +0 -0
- data/ext/v8/upstream/3.1.8/tools/csvparser.js +78 -0
- data/ext/v8/upstream/3.1.8/tools/disasm.py +92 -0
- data/ext/v8/upstream/3.1.8/tools/gc-nvp-trace-processor.py +328 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/generate-ten-powers.scm +0 -0
- data/ext/v8/upstream/3.1.8/tools/grokdump.py +840 -0
- data/ext/v8/upstream/3.1.8/tools/gyp/v8.gyp +869 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/js2c.py +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/jsmin.py +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/linux-tick-processor +0 -0
- data/ext/v8/upstream/3.1.8/tools/ll_prof.py +919 -0
- data/ext/v8/upstream/3.1.8/tools/logreader.js +185 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/mac-nm +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/mac-tick-processor +0 -0
- data/ext/v8/upstream/3.1.8/tools/oom_dump/README +31 -0
- data/ext/v8/upstream/3.1.8/tools/oom_dump/SConstruct +42 -0
- data/ext/v8/upstream/3.1.8/tools/oom_dump/oom_dump.cc +288 -0
- data/ext/v8/upstream/3.1.8/tools/presubmit.py +305 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/process-heap-prof.py +0 -0
- data/ext/v8/upstream/3.1.8/tools/profile.js +751 -0
- data/ext/v8/upstream/3.1.8/tools/profile_view.js +219 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/run-valgrind.py +0 -0
- data/ext/v8/upstream/3.1.8/tools/splaytree.js +316 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/stats-viewer.py +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/tickprocessor-driver.js +0 -0
- data/ext/v8/upstream/3.1.8/tools/tickprocessor.js +863 -0
- data/ext/v8/upstream/3.1.8/tools/utils.py +96 -0
- data/ext/v8/upstream/3.1.8/tools/visual_studio/README.txt +70 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/arm.vsprops +0 -0
- data/ext/v8/upstream/3.1.8/tools/visual_studio/common.vsprops +34 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/d8.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/d8_arm.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/d8_x64.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/d8js2c.cmd +0 -0
- data/ext/v8/upstream/3.1.8/tools/visual_studio/debug.vsprops +17 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/ia32.vsprops +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/js2c.cmd +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/release.vsprops +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8.sln +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_arm.sln +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_arm.vcproj +0 -0
- data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base.vcproj +1296 -0
- data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base_arm.vcproj +1234 -0
- data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base_x64.vcproj +1296 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_cctest.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_cctest_arm.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_cctest_x64.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_mksnapshot.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_mksnapshot_x64.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_process_sample.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_process_sample_arm.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_process_sample_x64.vcproj +0 -0
- data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_shell_sample.vcproj +147 -0
- data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_shell_sample_arm.vcproj +147 -0
- data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_shell_sample_x64.vcproj +163 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_snapshot.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_snapshot_cc.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_snapshot_cc_x64.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_snapshot_x64.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_x64.sln +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_x64.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/x64.vsprops +0 -0
- data/ext/v8/upstream/3.1.8/tools/windows-tick-processor.bat +30 -0
- data/ext/v8/upstream/Makefile +2 -1
- data/ext/v8/v8_template.cpp +2 -2
- data/lib/v8/version.rb +1 -1
- data/spec/redjs/jsapi_spec.rb +2 -2
- metadata +552 -490
- data/ext/v8/upstream/2.3.3/.gitignore +0 -26
- data/ext/v8/upstream/2.3.3/AUTHORS +0 -31
- data/ext/v8/upstream/2.3.3/ChangeLog +0 -1916
- data/ext/v8/upstream/2.3.3/LICENSE +0 -55
- data/ext/v8/upstream/2.3.3/SConstruct +0 -1154
- data/ext/v8/upstream/2.3.3/include/v8-debug.h +0 -381
- data/ext/v8/upstream/2.3.3/include/v8-profiler.h +0 -353
- data/ext/v8/upstream/2.3.3/include/v8.h +0 -3616
- data/ext/v8/upstream/2.3.3/src/SConscript +0 -330
- data/ext/v8/upstream/2.3.3/src/accessors.cc +0 -661
- data/ext/v8/upstream/2.3.3/src/accessors.h +0 -114
- data/ext/v8/upstream/2.3.3/src/allocation.cc +0 -198
- data/ext/v8/upstream/2.3.3/src/allocation.h +0 -169
- data/ext/v8/upstream/2.3.3/src/api.cc +0 -4795
- data/ext/v8/upstream/2.3.3/src/api.h +0 -485
- data/ext/v8/upstream/2.3.3/src/apiutils.h +0 -69
- data/ext/v8/upstream/2.3.3/src/arguments.h +0 -96
- data/ext/v8/upstream/2.3.3/src/arm/assembler-arm-inl.h +0 -305
- data/ext/v8/upstream/2.3.3/src/arm/assembler-arm.cc +0 -2580
- data/ext/v8/upstream/2.3.3/src/arm/assembler-arm.h +0 -1275
- data/ext/v8/upstream/2.3.3/src/arm/builtins-arm.cc +0 -1320
- data/ext/v8/upstream/2.3.3/src/arm/codegen-arm-inl.h +0 -48
- data/ext/v8/upstream/2.3.3/src/arm/codegen-arm.cc +0 -11398
- data/ext/v8/upstream/2.3.3/src/arm/codegen-arm.h +0 -1102
- data/ext/v8/upstream/2.3.3/src/arm/constants-arm.cc +0 -154
- data/ext/v8/upstream/2.3.3/src/arm/constants-arm.h +0 -388
- data/ext/v8/upstream/2.3.3/src/arm/cpu-arm.cc +0 -142
- data/ext/v8/upstream/2.3.3/src/arm/debug-arm.cc +0 -309
- data/ext/v8/upstream/2.3.3/src/arm/disasm-arm.cc +0 -1459
- data/ext/v8/upstream/2.3.3/src/arm/fast-codegen-arm.cc +0 -241
- data/ext/v8/upstream/2.3.3/src/arm/frames-arm.cc +0 -123
- data/ext/v8/upstream/2.3.3/src/arm/frames-arm.h +0 -162
- data/ext/v8/upstream/2.3.3/src/arm/full-codegen-arm.cc +0 -3178
- data/ext/v8/upstream/2.3.3/src/arm/ic-arm.cc +0 -2258
- data/ext/v8/upstream/2.3.3/src/arm/jump-target-arm.cc +0 -164
- data/ext/v8/upstream/2.3.3/src/arm/macro-assembler-arm.cc +0 -1892
- data/ext/v8/upstream/2.3.3/src/arm/macro-assembler-arm.h +0 -727
- data/ext/v8/upstream/2.3.3/src/arm/regexp-macro-assembler-arm.cc +0 -1261
- data/ext/v8/upstream/2.3.3/src/arm/regexp-macro-assembler-arm.h +0 -266
- data/ext/v8/upstream/2.3.3/src/arm/simulator-arm.cc +0 -2822
- data/ext/v8/upstream/2.3.3/src/arm/simulator-arm.h +0 -361
- data/ext/v8/upstream/2.3.3/src/arm/stub-cache-arm.cc +0 -2387
- data/ext/v8/upstream/2.3.3/src/arm/virtual-frame-arm.cc +0 -834
- data/ext/v8/upstream/2.3.3/src/arm/virtual-frame-arm.h +0 -519
- data/ext/v8/upstream/2.3.3/src/array.js +0 -1127
- data/ext/v8/upstream/2.3.3/src/assembler.cc +0 -801
- data/ext/v8/upstream/2.3.3/src/assembler.h +0 -573
- data/ext/v8/upstream/2.3.3/src/ast-inl.h +0 -81
- data/ext/v8/upstream/2.3.3/src/ast.cc +0 -1152
- data/ext/v8/upstream/2.3.3/src/ast.h +0 -2106
- data/ext/v8/upstream/2.3.3/src/bootstrapper.cc +0 -1819
- data/ext/v8/upstream/2.3.3/src/builtins.cc +0 -1529
- data/ext/v8/upstream/2.3.3/src/builtins.h +0 -263
- data/ext/v8/upstream/2.3.3/src/bytecodes-irregexp.h +0 -104
- data/ext/v8/upstream/2.3.3/src/cached-powers.h +0 -119
- data/ext/v8/upstream/2.3.3/src/char-predicates-inl.h +0 -86
- data/ext/v8/upstream/2.3.3/src/checks.cc +0 -100
- data/ext/v8/upstream/2.3.3/src/checks.h +0 -310
- data/ext/v8/upstream/2.3.3/src/circular-queue.cc +0 -121
- data/ext/v8/upstream/2.3.3/src/code-stubs.cc +0 -177
- data/ext/v8/upstream/2.3.3/src/code-stubs.h +0 -177
- data/ext/v8/upstream/2.3.3/src/codegen-inl.h +0 -60
- data/ext/v8/upstream/2.3.3/src/codegen.cc +0 -516
- data/ext/v8/upstream/2.3.3/src/codegen.h +0 -897
- data/ext/v8/upstream/2.3.3/src/compilation-cache.cc +0 -562
- data/ext/v8/upstream/2.3.3/src/compilation-cache.h +0 -102
- data/ext/v8/upstream/2.3.3/src/compiler.cc +0 -654
- data/ext/v8/upstream/2.3.3/src/compiler.h +0 -299
- data/ext/v8/upstream/2.3.3/src/contexts.cc +0 -256
- data/ext/v8/upstream/2.3.3/src/contexts.h +0 -342
- data/ext/v8/upstream/2.3.3/src/conversions.cc +0 -1119
- data/ext/v8/upstream/2.3.3/src/conversions.h +0 -123
- data/ext/v8/upstream/2.3.3/src/counters.h +0 -239
- data/ext/v8/upstream/2.3.3/src/cpu-profiler-inl.h +0 -100
- data/ext/v8/upstream/2.3.3/src/cpu-profiler.cc +0 -538
- data/ext/v8/upstream/2.3.3/src/cpu-profiler.h +0 -285
- data/ext/v8/upstream/2.3.3/src/d8-debug.cc +0 -356
- data/ext/v8/upstream/2.3.3/src/d8-debug.h +0 -155
- data/ext/v8/upstream/2.3.3/src/d8.cc +0 -783
- data/ext/v8/upstream/2.3.3/src/d8.h +0 -227
- data/ext/v8/upstream/2.3.3/src/d8.js +0 -1683
- data/ext/v8/upstream/2.3.3/src/data-flow.cc +0 -758
- data/ext/v8/upstream/2.3.3/src/data-flow.h +0 -278
- data/ext/v8/upstream/2.3.3/src/date.js +0 -1059
- data/ext/v8/upstream/2.3.3/src/dateparser-inl.h +0 -123
- data/ext/v8/upstream/2.3.3/src/dateparser.h +0 -244
- data/ext/v8/upstream/2.3.3/src/debug-agent.cc +0 -427
- data/ext/v8/upstream/2.3.3/src/debug-agent.h +0 -129
- data/ext/v8/upstream/2.3.3/src/debug-debugger.js +0 -2227
- data/ext/v8/upstream/2.3.3/src/debug.cc +0 -3005
- data/ext/v8/upstream/2.3.3/src/debug.h +0 -993
- data/ext/v8/upstream/2.3.3/src/disassembler.cc +0 -312
- data/ext/v8/upstream/2.3.3/src/double.h +0 -169
- data/ext/v8/upstream/2.3.3/src/dtoa-config.c +0 -92
- data/ext/v8/upstream/2.3.3/src/dtoa.cc +0 -77
- data/ext/v8/upstream/2.3.3/src/dtoa.h +0 -81
- data/ext/v8/upstream/2.3.3/src/execution.cc +0 -809
- data/ext/v8/upstream/2.3.3/src/execution.h +0 -336
- data/ext/v8/upstream/2.3.3/src/factory.cc +0 -1003
- data/ext/v8/upstream/2.3.3/src/factory.h +0 -410
- data/ext/v8/upstream/2.3.3/src/fast-codegen.cc +0 -746
- data/ext/v8/upstream/2.3.3/src/fast-codegen.h +0 -161
- data/ext/v8/upstream/2.3.3/src/fast-dtoa.cc +0 -505
- data/ext/v8/upstream/2.3.3/src/fast-dtoa.h +0 -58
- data/ext/v8/upstream/2.3.3/src/flag-definitions.h +0 -455
- data/ext/v8/upstream/2.3.3/src/flags.cc +0 -551
- data/ext/v8/upstream/2.3.3/src/flags.h +0 -81
- data/ext/v8/upstream/2.3.3/src/flow-graph.cc +0 -763
- data/ext/v8/upstream/2.3.3/src/flow-graph.h +0 -180
- data/ext/v8/upstream/2.3.3/src/frame-element.h +0 -273
- data/ext/v8/upstream/2.3.3/src/frames-inl.h +0 -217
- data/ext/v8/upstream/2.3.3/src/frames.cc +0 -826
- data/ext/v8/upstream/2.3.3/src/frames.h +0 -682
- data/ext/v8/upstream/2.3.3/src/full-codegen.cc +0 -1443
- data/ext/v8/upstream/2.3.3/src/full-codegen.h +0 -548
- data/ext/v8/upstream/2.3.3/src/func-name-inferrer.cc +0 -76
- data/ext/v8/upstream/2.3.3/src/func-name-inferrer.h +0 -135
- data/ext/v8/upstream/2.3.3/src/global-handles.cc +0 -520
- data/ext/v8/upstream/2.3.3/src/global-handles.h +0 -180
- data/ext/v8/upstream/2.3.3/src/globals.h +0 -669
- data/ext/v8/upstream/2.3.3/src/handles-inl.h +0 -76
- data/ext/v8/upstream/2.3.3/src/handles.cc +0 -825
- data/ext/v8/upstream/2.3.3/src/handles.h +0 -393
- data/ext/v8/upstream/2.3.3/src/hashmap.cc +0 -226
- data/ext/v8/upstream/2.3.3/src/hashmap.h +0 -120
- data/ext/v8/upstream/2.3.3/src/heap-inl.h +0 -493
- data/ext/v8/upstream/2.3.3/src/heap-profiler.cc +0 -779
- data/ext/v8/upstream/2.3.3/src/heap-profiler.h +0 -323
- data/ext/v8/upstream/2.3.3/src/heap.cc +0 -4994
- data/ext/v8/upstream/2.3.3/src/heap.h +0 -1984
- data/ext/v8/upstream/2.3.3/src/ia32/assembler-ia32-inl.h +0 -360
- data/ext/v8/upstream/2.3.3/src/ia32/assembler-ia32.cc +0 -2600
- data/ext/v8/upstream/2.3.3/src/ia32/assembler-ia32.h +0 -969
- data/ext/v8/upstream/2.3.3/src/ia32/builtins-ia32.cc +0 -1261
- data/ext/v8/upstream/2.3.3/src/ia32/codegen-ia32.cc +0 -13968
- data/ext/v8/upstream/2.3.3/src/ia32/codegen-ia32.h +0 -1097
- data/ext/v8/upstream/2.3.3/src/ia32/cpu-ia32.cc +0 -83
- data/ext/v8/upstream/2.3.3/src/ia32/debug-ia32.cc +0 -309
- data/ext/v8/upstream/2.3.3/src/ia32/disasm-ia32.cc +0 -1471
- data/ext/v8/upstream/2.3.3/src/ia32/fast-codegen-ia32.cc +0 -954
- data/ext/v8/upstream/2.3.3/src/ia32/fast-codegen-ia32.h +0 -155
- data/ext/v8/upstream/2.3.3/src/ia32/frames-ia32.cc +0 -115
- data/ext/v8/upstream/2.3.3/src/ia32/frames-ia32.h +0 -135
- data/ext/v8/upstream/2.3.3/src/ia32/full-codegen-ia32.cc +0 -3281
- data/ext/v8/upstream/2.3.3/src/ia32/ic-ia32.cc +0 -1966
- data/ext/v8/upstream/2.3.3/src/ia32/macro-assembler-ia32.cc +0 -1610
- data/ext/v8/upstream/2.3.3/src/ia32/macro-assembler-ia32.h +0 -610
- data/ext/v8/upstream/2.3.3/src/ia32/regexp-macro-assembler-ia32.cc +0 -1247
- data/ext/v8/upstream/2.3.3/src/ia32/regexp-macro-assembler-ia32.h +0 -214
- data/ext/v8/upstream/2.3.3/src/ia32/simulator-ia32.h +0 -62
- data/ext/v8/upstream/2.3.3/src/ia32/stub-cache-ia32.cc +0 -2750
- data/ext/v8/upstream/2.3.3/src/ia32/virtual-frame-ia32.cc +0 -1334
- data/ext/v8/upstream/2.3.3/src/ia32/virtual-frame-ia32.h +0 -627
- data/ext/v8/upstream/2.3.3/src/ic-inl.h +0 -120
- data/ext/v8/upstream/2.3.3/src/ic.cc +0 -1827
- data/ext/v8/upstream/2.3.3/src/ic.h +0 -515
- data/ext/v8/upstream/2.3.3/src/interpreter-irregexp.cc +0 -646
- data/ext/v8/upstream/2.3.3/src/json.js +0 -268
- data/ext/v8/upstream/2.3.3/src/jsregexp.cc +0 -5283
- data/ext/v8/upstream/2.3.3/src/jsregexp.h +0 -1463
- data/ext/v8/upstream/2.3.3/src/jump-target-heavy.cc +0 -429
- data/ext/v8/upstream/2.3.3/src/jump-target-heavy.h +0 -244
- data/ext/v8/upstream/2.3.3/src/jump-target-light.cc +0 -110
- data/ext/v8/upstream/2.3.3/src/jump-target-light.h +0 -192
- data/ext/v8/upstream/2.3.3/src/list-inl.h +0 -166
- data/ext/v8/upstream/2.3.3/src/list.h +0 -159
- data/ext/v8/upstream/2.3.3/src/liveedit-debugger.js +0 -1057
- data/ext/v8/upstream/2.3.3/src/liveedit.cc +0 -1480
- data/ext/v8/upstream/2.3.3/src/liveedit.h +0 -170
- data/ext/v8/upstream/2.3.3/src/log-utils.cc +0 -497
- data/ext/v8/upstream/2.3.3/src/log-utils.h +0 -289
- data/ext/v8/upstream/2.3.3/src/log.cc +0 -1561
- data/ext/v8/upstream/2.3.3/src/log.h +0 -384
- data/ext/v8/upstream/2.3.3/src/macro-assembler.h +0 -86
- data/ext/v8/upstream/2.3.3/src/macros.py +0 -177
- data/ext/v8/upstream/2.3.3/src/mark-compact.cc +0 -2330
- data/ext/v8/upstream/2.3.3/src/mark-compact.h +0 -451
- data/ext/v8/upstream/2.3.3/src/math.js +0 -264
- data/ext/v8/upstream/2.3.3/src/memory.h +0 -74
- data/ext/v8/upstream/2.3.3/src/messages.cc +0 -183
- data/ext/v8/upstream/2.3.3/src/messages.h +0 -113
- data/ext/v8/upstream/2.3.3/src/messages.js +0 -982
- data/ext/v8/upstream/2.3.3/src/mips/assembler-mips.h +0 -668
- data/ext/v8/upstream/2.3.3/src/mips/builtins-mips.cc +0 -205
- data/ext/v8/upstream/2.3.3/src/mips/codegen-mips.h +0 -434
- data/ext/v8/upstream/2.3.3/src/mips/debug-mips.cc +0 -131
- data/ext/v8/upstream/2.3.3/src/mips/frames-mips.cc +0 -102
- data/ext/v8/upstream/2.3.3/src/mips/ic-mips.cc +0 -220
- data/ext/v8/upstream/2.3.3/src/mips/simulator-mips.cc +0 -1651
- data/ext/v8/upstream/2.3.3/src/mips/simulator-mips.h +0 -311
- data/ext/v8/upstream/2.3.3/src/mips/stub-cache-mips.cc +0 -403
- data/ext/v8/upstream/2.3.3/src/mirror-debugger.js +0 -2380
- data/ext/v8/upstream/2.3.3/src/objects-debug.cc +0 -1366
- data/ext/v8/upstream/2.3.3/src/objects-inl.h +0 -3333
- data/ext/v8/upstream/2.3.3/src/objects.cc +0 -8820
- data/ext/v8/upstream/2.3.3/src/objects.h +0 -5373
- data/ext/v8/upstream/2.3.3/src/oprofile-agent.cc +0 -108
- data/ext/v8/upstream/2.3.3/src/oprofile-agent.h +0 -77
- data/ext/v8/upstream/2.3.3/src/parser.cc +0 -5207
- data/ext/v8/upstream/2.3.3/src/parser.h +0 -197
- data/ext/v8/upstream/2.3.3/src/platform-freebsd.cc +0 -667
- data/ext/v8/upstream/2.3.3/src/platform-linux.cc +0 -862
- data/ext/v8/upstream/2.3.3/src/platform-macos.cc +0 -665
- data/ext/v8/upstream/2.3.3/src/platform-nullos.cc +0 -454
- data/ext/v8/upstream/2.3.3/src/platform-openbsd.cc +0 -622
- data/ext/v8/upstream/2.3.3/src/platform-posix.cc +0 -362
- data/ext/v8/upstream/2.3.3/src/platform-solaris.cc +0 -653
- data/ext/v8/upstream/2.3.3/src/platform-win32.cc +0 -1911
- data/ext/v8/upstream/2.3.3/src/platform.h +0 -577
- data/ext/v8/upstream/2.3.3/src/powers-ten.h +0 -2461
- data/ext/v8/upstream/2.3.3/src/prettyprinter.cc +0 -1531
- data/ext/v8/upstream/2.3.3/src/prettyprinter.h +0 -221
- data/ext/v8/upstream/2.3.3/src/profile-generator-inl.h +0 -148
- data/ext/v8/upstream/2.3.3/src/profile-generator.cc +0 -1830
- data/ext/v8/upstream/2.3.3/src/profile-generator.h +0 -853
- data/ext/v8/upstream/2.3.3/src/property.cc +0 -96
- data/ext/v8/upstream/2.3.3/src/property.h +0 -315
- data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler-irregexp.cc +0 -464
- data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler-irregexp.h +0 -141
- data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler-tracer.cc +0 -356
- data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler-tracer.h +0 -103
- data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler.cc +0 -261
- data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler.h +0 -228
- data/ext/v8/upstream/2.3.3/src/regexp.js +0 -549
- data/ext/v8/upstream/2.3.3/src/rewriter.cc +0 -1038
- data/ext/v8/upstream/2.3.3/src/rewriter.h +0 -54
- data/ext/v8/upstream/2.3.3/src/runtime.cc +0 -10599
- data/ext/v8/upstream/2.3.3/src/runtime.h +0 -459
- data/ext/v8/upstream/2.3.3/src/runtime.js +0 -629
- data/ext/v8/upstream/2.3.3/src/scanner.cc +0 -1346
- data/ext/v8/upstream/2.3.3/src/scanner.h +0 -503
- data/ext/v8/upstream/2.3.3/src/scopeinfo.cc +0 -637
- data/ext/v8/upstream/2.3.3/src/scopeinfo.h +0 -233
- data/ext/v8/upstream/2.3.3/src/scopes.cc +0 -962
- data/ext/v8/upstream/2.3.3/src/scopes.h +0 -400
- data/ext/v8/upstream/2.3.3/src/serialize.cc +0 -1461
- data/ext/v8/upstream/2.3.3/src/serialize.h +0 -581
- data/ext/v8/upstream/2.3.3/src/spaces-inl.h +0 -483
- data/ext/v8/upstream/2.3.3/src/spaces.cc +0 -2901
- data/ext/v8/upstream/2.3.3/src/spaces.h +0 -2197
- data/ext/v8/upstream/2.3.3/src/string-stream.cc +0 -584
- data/ext/v8/upstream/2.3.3/src/string-stream.h +0 -189
- data/ext/v8/upstream/2.3.3/src/string.js +0 -1006
- data/ext/v8/upstream/2.3.3/src/stub-cache.cc +0 -1379
- data/ext/v8/upstream/2.3.3/src/stub-cache.h +0 -756
- data/ext/v8/upstream/2.3.3/src/third_party/dtoa/COPYING +0 -15
- data/ext/v8/upstream/2.3.3/src/third_party/dtoa/dtoa.c +0 -3334
- data/ext/v8/upstream/2.3.3/src/token.cc +0 -56
- data/ext/v8/upstream/2.3.3/src/token.h +0 -270
- data/ext/v8/upstream/2.3.3/src/top.cc +0 -1067
- data/ext/v8/upstream/2.3.3/src/top.h +0 -463
- data/ext/v8/upstream/2.3.3/src/type-info.cc +0 -53
- data/ext/v8/upstream/2.3.3/src/type-info.h +0 -244
- data/ext/v8/upstream/2.3.3/src/unicode-inl.h +0 -238
- data/ext/v8/upstream/2.3.3/src/unicode.cc +0 -749
- data/ext/v8/upstream/2.3.3/src/unicode.h +0 -279
- data/ext/v8/upstream/2.3.3/src/uri.js +0 -415
- data/ext/v8/upstream/2.3.3/src/utils.cc +0 -285
- data/ext/v8/upstream/2.3.3/src/utils.h +0 -745
- data/ext/v8/upstream/2.3.3/src/v8-counters.h +0 -250
- data/ext/v8/upstream/2.3.3/src/v8.cc +0 -228
- data/ext/v8/upstream/2.3.3/src/v8.h +0 -121
- data/ext/v8/upstream/2.3.3/src/v8natives.js +0 -1188
- data/ext/v8/upstream/2.3.3/src/v8threads.cc +0 -461
- data/ext/v8/upstream/2.3.3/src/v8threads.h +0 -159
- data/ext/v8/upstream/2.3.3/src/variables.cc +0 -119
- data/ext/v8/upstream/2.3.3/src/variables.h +0 -205
- data/ext/v8/upstream/2.3.3/src/version.cc +0 -88
- data/ext/v8/upstream/2.3.3/src/virtual-frame-heavy-inl.h +0 -192
- data/ext/v8/upstream/2.3.3/src/virtual-frame.h +0 -46
- data/ext/v8/upstream/2.3.3/src/vm-state-inl.h +0 -137
- data/ext/v8/upstream/2.3.3/src/vm-state.cc +0 -39
- data/ext/v8/upstream/2.3.3/src/vm-state.h +0 -77
- data/ext/v8/upstream/2.3.3/src/x64/assembler-x64-inl.h +0 -400
- data/ext/v8/upstream/2.3.3/src/x64/assembler-x64.cc +0 -2963
- data/ext/v8/upstream/2.3.3/src/x64/assembler-x64.h +0 -1438
- data/ext/v8/upstream/2.3.3/src/x64/builtins-x64.cc +0 -1296
- data/ext/v8/upstream/2.3.3/src/x64/codegen-x64-inl.h +0 -46
- data/ext/v8/upstream/2.3.3/src/x64/codegen-x64.cc +0 -12491
- data/ext/v8/upstream/2.3.3/src/x64/codegen-x64.h +0 -1090
- data/ext/v8/upstream/2.3.3/src/x64/cpu-x64.cc +0 -83
- data/ext/v8/upstream/2.3.3/src/x64/debug-x64.cc +0 -267
- data/ext/v8/upstream/2.3.3/src/x64/disasm-x64.cc +0 -1696
- data/ext/v8/upstream/2.3.3/src/x64/fast-codegen-x64.cc +0 -250
- data/ext/v8/upstream/2.3.3/src/x64/frames-x64.cc +0 -113
- data/ext/v8/upstream/2.3.3/src/x64/frames-x64.h +0 -125
- data/ext/v8/upstream/2.3.3/src/x64/full-codegen-x64.cc +0 -3270
- data/ext/v8/upstream/2.3.3/src/x64/ic-x64.cc +0 -1907
- data/ext/v8/upstream/2.3.3/src/x64/jump-target-x64.cc +0 -437
- data/ext/v8/upstream/2.3.3/src/x64/macro-assembler-x64.cc +0 -2793
- data/ext/v8/upstream/2.3.3/src/x64/macro-assembler-x64.h +0 -916
- data/ext/v8/upstream/2.3.3/src/x64/regexp-macro-assembler-x64.cc +0 -1374
- data/ext/v8/upstream/2.3.3/src/x64/regexp-macro-assembler-x64.h +0 -277
- data/ext/v8/upstream/2.3.3/src/x64/simulator-x64.h +0 -63
- data/ext/v8/upstream/2.3.3/src/x64/stub-cache-x64.cc +0 -2560
- data/ext/v8/upstream/2.3.3/src/x64/virtual-frame-x64.cc +0 -1264
- data/ext/v8/upstream/2.3.3/src/x64/virtual-frame-x64.h +0 -590
- data/ext/v8/upstream/2.3.3/src/zone-inl.h +0 -82
- data/ext/v8/upstream/2.3.3/src/zone.cc +0 -194
- data/ext/v8/upstream/2.3.3/src/zone.h +0 -221
- data/ext/v8/upstream/2.3.3/tools/codemap.js +0 -270
- data/ext/v8/upstream/2.3.3/tools/csvparser.js +0 -83
- data/ext/v8/upstream/2.3.3/tools/gc-nvp-trace-processor.py +0 -317
- data/ext/v8/upstream/2.3.3/tools/gyp/v8.gyp +0 -749
- data/ext/v8/upstream/2.3.3/tools/linux-tick-processor.py +0 -78
- data/ext/v8/upstream/2.3.3/tools/logreader.js +0 -338
- data/ext/v8/upstream/2.3.3/tools/oprofile/annotate +0 -7
- data/ext/v8/upstream/2.3.3/tools/oprofile/common +0 -19
- data/ext/v8/upstream/2.3.3/tools/oprofile/dump +0 -7
- data/ext/v8/upstream/2.3.3/tools/oprofile/report +0 -7
- data/ext/v8/upstream/2.3.3/tools/oprofile/reset +0 -7
- data/ext/v8/upstream/2.3.3/tools/oprofile/run +0 -14
- data/ext/v8/upstream/2.3.3/tools/oprofile/shutdown +0 -7
- data/ext/v8/upstream/2.3.3/tools/oprofile/start +0 -7
- data/ext/v8/upstream/2.3.3/tools/presubmit.py +0 -299
- data/ext/v8/upstream/2.3.3/tools/profile.js +0 -691
- data/ext/v8/upstream/2.3.3/tools/profile_view.js +0 -224
- data/ext/v8/upstream/2.3.3/tools/splaytree.js +0 -322
- data/ext/v8/upstream/2.3.3/tools/splaytree.py +0 -226
- data/ext/v8/upstream/2.3.3/tools/tickprocessor.js +0 -862
- data/ext/v8/upstream/2.3.3/tools/tickprocessor.py +0 -571
- data/ext/v8/upstream/2.3.3/tools/utils.py +0 -88
- data/ext/v8/upstream/2.3.3/tools/visual_studio/README.txt +0 -71
- data/ext/v8/upstream/2.3.3/tools/visual_studio/common.vsprops +0 -34
- data/ext/v8/upstream/2.3.3/tools/visual_studio/debug.vsprops +0 -17
- data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_base.vcproj +0 -1143
- data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_base_arm.vcproj +0 -1115
- data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_base_x64.vcproj +0 -1096
- data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_shell_sample.vcproj +0 -145
- data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_shell_sample_arm.vcproj +0 -145
- data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_shell_sample_x64.vcproj +0 -161
- data/ext/v8/upstream/2.3.3/tools/windows-tick-processor.bat +0 -29
- data/ext/v8/upstream/2.3.3/tools/windows-tick-processor.py +0 -137
@@ -1,342 +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
|
-
#ifndef V8_CONTEXTS_H_
|
29
|
-
#define V8_CONTEXTS_H_
|
30
|
-
|
31
|
-
namespace v8 {
|
32
|
-
namespace internal {
|
33
|
-
|
34
|
-
|
35
|
-
enum ContextLookupFlags {
|
36
|
-
FOLLOW_CONTEXT_CHAIN = 1,
|
37
|
-
FOLLOW_PROTOTYPE_CHAIN = 2,
|
38
|
-
|
39
|
-
DONT_FOLLOW_CHAINS = 0,
|
40
|
-
FOLLOW_CHAINS = FOLLOW_CONTEXT_CHAIN | FOLLOW_PROTOTYPE_CHAIN
|
41
|
-
};
|
42
|
-
|
43
|
-
|
44
|
-
// Heap-allocated activation contexts.
|
45
|
-
//
|
46
|
-
// Contexts are implemented as FixedArray objects; the Context
|
47
|
-
// class is a convenience interface casted on a FixedArray object.
|
48
|
-
//
|
49
|
-
// Note: Context must have no virtual functions and Context objects
|
50
|
-
// must always be allocated via Heap::AllocateContext() or
|
51
|
-
// Factory::NewContext.
|
52
|
-
|
53
|
-
#define GLOBAL_CONTEXT_FIELDS(V) \
|
54
|
-
V(GLOBAL_PROXY_INDEX, JSObject, global_proxy_object) \
|
55
|
-
V(SECURITY_TOKEN_INDEX, Object, security_token) \
|
56
|
-
V(BOOLEAN_FUNCTION_INDEX, JSFunction, boolean_function) \
|
57
|
-
V(NUMBER_FUNCTION_INDEX, JSFunction, number_function) \
|
58
|
-
V(STRING_FUNCTION_INDEX, JSFunction, string_function) \
|
59
|
-
V(OBJECT_FUNCTION_INDEX, JSFunction, object_function) \
|
60
|
-
V(ARRAY_FUNCTION_INDEX, JSFunction, array_function) \
|
61
|
-
V(DATE_FUNCTION_INDEX, JSFunction, date_function) \
|
62
|
-
V(JSON_OBJECT_INDEX, JSObject, json_object) \
|
63
|
-
V(REGEXP_FUNCTION_INDEX, JSFunction, regexp_function) \
|
64
|
-
V(INITIAL_OBJECT_PROTOTYPE_INDEX, JSObject, initial_object_prototype) \
|
65
|
-
V(CREATE_DATE_FUN_INDEX, JSFunction, create_date_fun) \
|
66
|
-
V(TO_NUMBER_FUN_INDEX, JSFunction, to_number_fun) \
|
67
|
-
V(TO_STRING_FUN_INDEX, JSFunction, to_string_fun) \
|
68
|
-
V(TO_DETAIL_STRING_FUN_INDEX, JSFunction, to_detail_string_fun) \
|
69
|
-
V(TO_OBJECT_FUN_INDEX, JSFunction, to_object_fun) \
|
70
|
-
V(TO_INTEGER_FUN_INDEX, JSFunction, to_integer_fun) \
|
71
|
-
V(TO_UINT32_FUN_INDEX, JSFunction, to_uint32_fun) \
|
72
|
-
V(TO_INT32_FUN_INDEX, JSFunction, to_int32_fun) \
|
73
|
-
V(GLOBAL_EVAL_FUN_INDEX, JSFunction, global_eval_fun) \
|
74
|
-
V(INSTANTIATE_FUN_INDEX, JSFunction, instantiate_fun) \
|
75
|
-
V(CONFIGURE_INSTANCE_FUN_INDEX, JSFunction, configure_instance_fun) \
|
76
|
-
V(FUNCTION_MAP_INDEX, Map, function_map) \
|
77
|
-
V(FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX, Map, function_without_prototype_map) \
|
78
|
-
V(FUNCTION_INSTANCE_MAP_INDEX, Map, function_instance_map) \
|
79
|
-
V(JS_ARRAY_MAP_INDEX, Map, js_array_map)\
|
80
|
-
V(REGEXP_RESULT_MAP_INDEX, Map, regexp_result_map)\
|
81
|
-
V(ARGUMENTS_BOILERPLATE_INDEX, JSObject, arguments_boilerplate) \
|
82
|
-
V(MESSAGE_LISTENERS_INDEX, JSObject, message_listeners) \
|
83
|
-
V(MAKE_MESSAGE_FUN_INDEX, JSFunction, make_message_fun) \
|
84
|
-
V(GET_STACK_TRACE_LINE_INDEX, JSFunction, get_stack_trace_line_fun) \
|
85
|
-
V(CONFIGURE_GLOBAL_INDEX, JSFunction, configure_global_fun) \
|
86
|
-
V(FUNCTION_CACHE_INDEX, JSObject, function_cache) \
|
87
|
-
V(JSFUNCTION_RESULT_CACHES_INDEX, FixedArray, jsfunction_result_caches) \
|
88
|
-
V(RUNTIME_CONTEXT_INDEX, Context, runtime_context) \
|
89
|
-
V(CALL_AS_FUNCTION_DELEGATE_INDEX, JSFunction, call_as_function_delegate) \
|
90
|
-
V(CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, JSFunction, \
|
91
|
-
call_as_constructor_delegate) \
|
92
|
-
V(SCRIPT_FUNCTION_INDEX, JSFunction, script_function) \
|
93
|
-
V(OPAQUE_REFERENCE_FUNCTION_INDEX, JSFunction, opaque_reference_function) \
|
94
|
-
V(CONTEXT_EXTENSION_FUNCTION_INDEX, JSFunction, context_extension_function) \
|
95
|
-
V(OUT_OF_MEMORY_INDEX, Object, out_of_memory) \
|
96
|
-
V(MAP_CACHE_INDEX, Object, map_cache) \
|
97
|
-
V(CONTEXT_DATA_INDEX, Object, data)
|
98
|
-
|
99
|
-
// JSFunctions are pairs (context, function code), sometimes also called
|
100
|
-
// closures. A Context object is used to represent function contexts and
|
101
|
-
// dynamically pushed 'with' contexts (or 'scopes' in ECMA-262 speak).
|
102
|
-
//
|
103
|
-
// At runtime, the contexts build a stack in parallel to the execution
|
104
|
-
// stack, with the top-most context being the current context. All contexts
|
105
|
-
// have the following slots:
|
106
|
-
//
|
107
|
-
// [ closure ] This is the current function. It is the same for all
|
108
|
-
// contexts inside a function. It provides access to the
|
109
|
-
// incoming context (i.e., the outer context, which may
|
110
|
-
// or may not become the current function's context), and
|
111
|
-
// it provides access to the functions code and thus it's
|
112
|
-
// scope information, which in turn contains the names of
|
113
|
-
// statically allocated context slots. The names are needed
|
114
|
-
// for dynamic lookups in the presence of 'with' or 'eval'.
|
115
|
-
//
|
116
|
-
// [ fcontext ] A pointer to the innermost enclosing function context.
|
117
|
-
// It is the same for all contexts *allocated* inside a
|
118
|
-
// function, and the function context's fcontext points
|
119
|
-
// to itself. It is only needed for fast access of the
|
120
|
-
// function context (used for declarations, and static
|
121
|
-
// context slot access).
|
122
|
-
//
|
123
|
-
// [ previous ] A pointer to the previous context. It is NULL for
|
124
|
-
// function contexts, and non-NULL for 'with' contexts.
|
125
|
-
// Used to implement the 'with' statement.
|
126
|
-
//
|
127
|
-
// [ extension ] A pointer to an extension JSObject, or NULL. Used to
|
128
|
-
// implement 'with' statements and dynamic declarations
|
129
|
-
// (through 'eval'). The object in a 'with' statement is
|
130
|
-
// stored in the extension slot of a 'with' context.
|
131
|
-
// Dynamically declared variables/functions are also added
|
132
|
-
// to lazily allocated extension object. Context::Lookup
|
133
|
-
// searches the extension object for properties.
|
134
|
-
//
|
135
|
-
// [ global ] A pointer to the global object. Provided for quick
|
136
|
-
// access to the global object from inside the code (since
|
137
|
-
// we always have a context pointer).
|
138
|
-
//
|
139
|
-
// In addition, function contexts may have statically allocated context slots
|
140
|
-
// to store local variables/functions that are accessed from inner functions
|
141
|
-
// (via static context addresses) or through 'eval' (dynamic context lookups).
|
142
|
-
// Finally, the global context contains additional slots for fast access to
|
143
|
-
// global properties.
|
144
|
-
//
|
145
|
-
// We may be able to simplify the implementation:
|
146
|
-
//
|
147
|
-
// - We may be able to get rid of 'fcontext': We can always use the fact that
|
148
|
-
// previous == NULL for function contexts and so we can search for them. They
|
149
|
-
// are only needed when doing dynamic declarations, and the context chains
|
150
|
-
// tend to be very very short (depth of nesting of 'with' statements). At
|
151
|
-
// the moment we also use it in generated code for context slot accesses -
|
152
|
-
// and there we don't want a loop because of code bloat - but we may not
|
153
|
-
// need it there after all (see comment in codegen_*.cc).
|
154
|
-
//
|
155
|
-
// - If we cannot get rid of fcontext, consider making 'previous' never NULL
|
156
|
-
// except for the global context. This could simplify Context::Lookup.
|
157
|
-
|
158
|
-
class Context: public FixedArray {
|
159
|
-
public:
|
160
|
-
// Conversions.
|
161
|
-
static Context* cast(Object* context) {
|
162
|
-
ASSERT(context->IsContext());
|
163
|
-
return reinterpret_cast<Context*>(context);
|
164
|
-
}
|
165
|
-
|
166
|
-
// The default context slot layout; indices are FixedArray slot indices.
|
167
|
-
enum {
|
168
|
-
// These slots are in all contexts.
|
169
|
-
CLOSURE_INDEX,
|
170
|
-
FCONTEXT_INDEX,
|
171
|
-
PREVIOUS_INDEX,
|
172
|
-
EXTENSION_INDEX,
|
173
|
-
GLOBAL_INDEX,
|
174
|
-
MIN_CONTEXT_SLOTS,
|
175
|
-
|
176
|
-
// These slots are only in global contexts.
|
177
|
-
GLOBAL_PROXY_INDEX = MIN_CONTEXT_SLOTS,
|
178
|
-
SECURITY_TOKEN_INDEX,
|
179
|
-
ARGUMENTS_BOILERPLATE_INDEX,
|
180
|
-
JS_ARRAY_MAP_INDEX,
|
181
|
-
REGEXP_RESULT_MAP_INDEX,
|
182
|
-
FUNCTION_MAP_INDEX,
|
183
|
-
FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX,
|
184
|
-
FUNCTION_INSTANCE_MAP_INDEX,
|
185
|
-
INITIAL_OBJECT_PROTOTYPE_INDEX,
|
186
|
-
BOOLEAN_FUNCTION_INDEX,
|
187
|
-
NUMBER_FUNCTION_INDEX,
|
188
|
-
STRING_FUNCTION_INDEX,
|
189
|
-
OBJECT_FUNCTION_INDEX,
|
190
|
-
ARRAY_FUNCTION_INDEX,
|
191
|
-
DATE_FUNCTION_INDEX,
|
192
|
-
JSON_OBJECT_INDEX,
|
193
|
-
REGEXP_FUNCTION_INDEX,
|
194
|
-
CREATE_DATE_FUN_INDEX,
|
195
|
-
TO_NUMBER_FUN_INDEX,
|
196
|
-
TO_STRING_FUN_INDEX,
|
197
|
-
TO_DETAIL_STRING_FUN_INDEX,
|
198
|
-
TO_OBJECT_FUN_INDEX,
|
199
|
-
TO_INTEGER_FUN_INDEX,
|
200
|
-
TO_UINT32_FUN_INDEX,
|
201
|
-
TO_INT32_FUN_INDEX,
|
202
|
-
TO_BOOLEAN_FUN_INDEX,
|
203
|
-
GLOBAL_EVAL_FUN_INDEX,
|
204
|
-
INSTANTIATE_FUN_INDEX,
|
205
|
-
CONFIGURE_INSTANCE_FUN_INDEX,
|
206
|
-
MESSAGE_LISTENERS_INDEX,
|
207
|
-
MAKE_MESSAGE_FUN_INDEX,
|
208
|
-
GET_STACK_TRACE_LINE_INDEX,
|
209
|
-
CONFIGURE_GLOBAL_INDEX,
|
210
|
-
FUNCTION_CACHE_INDEX,
|
211
|
-
JSFUNCTION_RESULT_CACHES_INDEX,
|
212
|
-
RUNTIME_CONTEXT_INDEX,
|
213
|
-
CALL_AS_FUNCTION_DELEGATE_INDEX,
|
214
|
-
CALL_AS_CONSTRUCTOR_DELEGATE_INDEX,
|
215
|
-
SCRIPT_FUNCTION_INDEX,
|
216
|
-
OPAQUE_REFERENCE_FUNCTION_INDEX,
|
217
|
-
CONTEXT_EXTENSION_FUNCTION_INDEX,
|
218
|
-
OUT_OF_MEMORY_INDEX,
|
219
|
-
MAP_CACHE_INDEX,
|
220
|
-
CONTEXT_DATA_INDEX,
|
221
|
-
GLOBAL_CONTEXT_SLOTS
|
222
|
-
};
|
223
|
-
|
224
|
-
// Direct slot access.
|
225
|
-
JSFunction* closure() { return JSFunction::cast(get(CLOSURE_INDEX)); }
|
226
|
-
void set_closure(JSFunction* closure) { set(CLOSURE_INDEX, closure); }
|
227
|
-
|
228
|
-
Context* fcontext() { return Context::cast(get(FCONTEXT_INDEX)); }
|
229
|
-
void set_fcontext(Context* context) { set(FCONTEXT_INDEX, context); }
|
230
|
-
|
231
|
-
Context* previous() {
|
232
|
-
Object* result = unchecked_previous();
|
233
|
-
ASSERT(IsBootstrappingOrContext(result));
|
234
|
-
return reinterpret_cast<Context*>(result);
|
235
|
-
}
|
236
|
-
void set_previous(Context* context) { set(PREVIOUS_INDEX, context); }
|
237
|
-
|
238
|
-
bool has_extension() { return unchecked_extension() != NULL; }
|
239
|
-
JSObject* extension() { return JSObject::cast(unchecked_extension()); }
|
240
|
-
void set_extension(JSObject* object) { set(EXTENSION_INDEX, object); }
|
241
|
-
|
242
|
-
GlobalObject* global() {
|
243
|
-
Object* result = get(GLOBAL_INDEX);
|
244
|
-
ASSERT(IsBootstrappingOrGlobalObject(result));
|
245
|
-
return reinterpret_cast<GlobalObject*>(result);
|
246
|
-
}
|
247
|
-
void set_global(GlobalObject* global) { set(GLOBAL_INDEX, global); }
|
248
|
-
|
249
|
-
// Returns a JSGlobalProxy object or null.
|
250
|
-
JSObject* global_proxy();
|
251
|
-
void set_global_proxy(JSObject* global);
|
252
|
-
|
253
|
-
// The builtins object.
|
254
|
-
JSBuiltinsObject* builtins();
|
255
|
-
|
256
|
-
// Compute the global context by traversing the context chain.
|
257
|
-
Context* global_context();
|
258
|
-
|
259
|
-
// Tells if this is a function context (as opposed to a 'with' context).
|
260
|
-
bool is_function_context() { return unchecked_previous() == NULL; }
|
261
|
-
|
262
|
-
// Tells whether the global context is marked with out of memory.
|
263
|
-
bool has_out_of_memory() {
|
264
|
-
return global_context()->out_of_memory() == Heap::true_value();
|
265
|
-
}
|
266
|
-
|
267
|
-
// Mark the global context with out of memory.
|
268
|
-
void mark_out_of_memory() {
|
269
|
-
global_context()->set_out_of_memory(Heap::true_value());
|
270
|
-
}
|
271
|
-
|
272
|
-
// The exception holder is the object used as a with object in
|
273
|
-
// the implementation of a catch block.
|
274
|
-
bool is_exception_holder(Object* object) {
|
275
|
-
return IsCatchContext() && extension() == object;
|
276
|
-
}
|
277
|
-
|
278
|
-
#define GLOBAL_CONTEXT_FIELD_ACCESSORS(index, type, name) \
|
279
|
-
void set_##name(type* value) { \
|
280
|
-
ASSERT(IsGlobalContext()); \
|
281
|
-
set(index, value); \
|
282
|
-
} \
|
283
|
-
type* name() { \
|
284
|
-
ASSERT(IsGlobalContext()); \
|
285
|
-
return type::cast(get(index)); \
|
286
|
-
}
|
287
|
-
GLOBAL_CONTEXT_FIELDS(GLOBAL_CONTEXT_FIELD_ACCESSORS)
|
288
|
-
#undef GLOBAL_CONTEXT_FIELD_ACCESSORS
|
289
|
-
|
290
|
-
// Lookup the the slot called name, starting with the current context.
|
291
|
-
// There are 4 possible outcomes:
|
292
|
-
//
|
293
|
-
// 1) index_ >= 0 && result->IsContext():
|
294
|
-
// most common case, the result is a Context, and index is the
|
295
|
-
// context slot index, and the slot exists.
|
296
|
-
// attributes == READ_ONLY for the function name variable, NONE otherwise.
|
297
|
-
//
|
298
|
-
// 2) index_ >= 0 && result->IsJSObject():
|
299
|
-
// the result is the JSObject arguments object, the index is the parameter
|
300
|
-
// index, i.e., key into the arguments object, and the property exists.
|
301
|
-
// attributes != ABSENT.
|
302
|
-
//
|
303
|
-
// 3) index_ < 0 && result->IsJSObject():
|
304
|
-
// the result is the JSObject extension context or the global object,
|
305
|
-
// and the name is the property name, and the property exists.
|
306
|
-
// attributes != ABSENT.
|
307
|
-
//
|
308
|
-
// 4) index_ < 0 && result.is_null():
|
309
|
-
// there was no context found with the corresponding property.
|
310
|
-
// attributes == ABSENT.
|
311
|
-
Handle<Object> Lookup(Handle<String> name, ContextLookupFlags flags,
|
312
|
-
int* index_, PropertyAttributes* attributes);
|
313
|
-
|
314
|
-
// Determine if a local variable with the given name exists in a
|
315
|
-
// context. Do not consider context extension objects. This is
|
316
|
-
// used for compiling code using eval. If the context surrounding
|
317
|
-
// the eval call does not have a local variable with this name and
|
318
|
-
// does not contain a with statement the property is global unless
|
319
|
-
// it is shadowed by a property in an extension object introduced by
|
320
|
-
// eval.
|
321
|
-
bool GlobalIfNotShadowedByEval(Handle<String> name);
|
322
|
-
|
323
|
-
// Code generation support.
|
324
|
-
static int SlotOffset(int index) {
|
325
|
-
return kHeaderSize + index * kPointerSize - kHeapObjectTag;
|
326
|
-
}
|
327
|
-
|
328
|
-
private:
|
329
|
-
// Unchecked access to the slots.
|
330
|
-
Object* unchecked_previous() { return get(PREVIOUS_INDEX); }
|
331
|
-
Object* unchecked_extension() { return get(EXTENSION_INDEX); }
|
332
|
-
|
333
|
-
#ifdef DEBUG
|
334
|
-
// Bootstrapping-aware type checks.
|
335
|
-
static bool IsBootstrappingOrContext(Object* object);
|
336
|
-
static bool IsBootstrappingOrGlobalObject(Object* object);
|
337
|
-
#endif
|
338
|
-
};
|
339
|
-
|
340
|
-
} } // namespace v8::internal
|
341
|
-
|
342
|
-
#endif // V8_CONTEXTS_H_
|
@@ -1,1119 +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 <stdarg.h>
|
29
|
-
#include <limits.h>
|
30
|
-
|
31
|
-
#include "v8.h"
|
32
|
-
|
33
|
-
#include "conversions-inl.h"
|
34
|
-
#include "dtoa.h"
|
35
|
-
#include "factory.h"
|
36
|
-
#include "scanner.h"
|
37
|
-
|
38
|
-
namespace v8 {
|
39
|
-
namespace internal {
|
40
|
-
|
41
|
-
int HexValue(uc32 c) {
|
42
|
-
if ('0' <= c && c <= '9')
|
43
|
-
return c - '0';
|
44
|
-
if ('a' <= c && c <= 'f')
|
45
|
-
return c - 'a' + 10;
|
46
|
-
if ('A' <= c && c <= 'F')
|
47
|
-
return c - 'A' + 10;
|
48
|
-
return -1;
|
49
|
-
}
|
50
|
-
|
51
|
-
namespace {
|
52
|
-
|
53
|
-
// C++-style iterator adaptor for StringInputBuffer
|
54
|
-
// (unlike C++ iterators the end-marker has different type).
|
55
|
-
class StringInputBufferIterator {
|
56
|
-
public:
|
57
|
-
class EndMarker {};
|
58
|
-
|
59
|
-
explicit StringInputBufferIterator(StringInputBuffer* buffer);
|
60
|
-
|
61
|
-
int operator*() const;
|
62
|
-
void operator++();
|
63
|
-
bool operator==(EndMarker const&) const { return end_; }
|
64
|
-
bool operator!=(EndMarker const& m) const { return !end_; }
|
65
|
-
|
66
|
-
private:
|
67
|
-
StringInputBuffer* const buffer_;
|
68
|
-
int current_;
|
69
|
-
bool end_;
|
70
|
-
};
|
71
|
-
|
72
|
-
|
73
|
-
StringInputBufferIterator::StringInputBufferIterator(
|
74
|
-
StringInputBuffer* buffer) : buffer_(buffer) {
|
75
|
-
++(*this);
|
76
|
-
}
|
77
|
-
|
78
|
-
int StringInputBufferIterator::operator*() const {
|
79
|
-
return current_;
|
80
|
-
}
|
81
|
-
|
82
|
-
|
83
|
-
void StringInputBufferIterator::operator++() {
|
84
|
-
end_ = !buffer_->has_more();
|
85
|
-
if (!end_) {
|
86
|
-
current_ = buffer_->GetNext();
|
87
|
-
}
|
88
|
-
}
|
89
|
-
}
|
90
|
-
|
91
|
-
|
92
|
-
template <class Iterator, class EndMark>
|
93
|
-
static bool SubStringEquals(Iterator* current,
|
94
|
-
EndMark end,
|
95
|
-
const char* substring) {
|
96
|
-
ASSERT(**current == *substring);
|
97
|
-
for (substring++; *substring != '\0'; substring++) {
|
98
|
-
++*current;
|
99
|
-
if (*current == end || **current != *substring) return false;
|
100
|
-
}
|
101
|
-
++*current;
|
102
|
-
return true;
|
103
|
-
}
|
104
|
-
|
105
|
-
|
106
|
-
extern "C" double gay_strtod(const char* s00, const char** se);
|
107
|
-
|
108
|
-
// Maximum number of significant digits in decimal representation.
|
109
|
-
// The longest possible double in decimal representation is
|
110
|
-
// (2^53 - 1) * 2 ^ -1074 that is (2 ^ 53 - 1) * 5 ^ 1074 / 10 ^ 1074
|
111
|
-
// (768 digits). If we parse a number whose first digits are equal to a
|
112
|
-
// mean of 2 adjacent doubles (that could have up to 769 digits) the result
|
113
|
-
// must be rounded to the bigger one unless the tail consists of zeros, so
|
114
|
-
// we don't need to preserve all the digits.
|
115
|
-
const int kMaxSignificantDigits = 772;
|
116
|
-
|
117
|
-
|
118
|
-
static const double JUNK_STRING_VALUE = OS::nan_value();
|
119
|
-
|
120
|
-
|
121
|
-
// Returns true if a nonspace found and false if the end has reached.
|
122
|
-
template <class Iterator, class EndMark>
|
123
|
-
static inline bool AdvanceToNonspace(Iterator* current, EndMark end) {
|
124
|
-
while (*current != end) {
|
125
|
-
if (!Scanner::kIsWhiteSpace.get(**current)) return true;
|
126
|
-
++*current;
|
127
|
-
}
|
128
|
-
return false;
|
129
|
-
}
|
130
|
-
|
131
|
-
|
132
|
-
static bool isDigit(int x, int radix) {
|
133
|
-
return (x >= '0' && x <= '9' && x < '0' + radix)
|
134
|
-
|| (radix > 10 && x >= 'a' && x < 'a' + radix - 10)
|
135
|
-
|| (radix > 10 && x >= 'A' && x < 'A' + radix - 10);
|
136
|
-
}
|
137
|
-
|
138
|
-
|
139
|
-
static double SignedZero(bool sign) {
|
140
|
-
return sign ? -0.0 : 0.0;
|
141
|
-
}
|
142
|
-
|
143
|
-
|
144
|
-
// Parsing integers with radix 2, 4, 8, 16, 32. Assumes current != end.
|
145
|
-
template <int radix_log_2, class Iterator, class EndMark>
|
146
|
-
static double InternalStringToIntDouble(Iterator current,
|
147
|
-
EndMark end,
|
148
|
-
bool sign,
|
149
|
-
bool allow_trailing_junk) {
|
150
|
-
ASSERT(current != end);
|
151
|
-
|
152
|
-
// Skip leading 0s.
|
153
|
-
while (*current == '0') {
|
154
|
-
++current;
|
155
|
-
if (current == end) return SignedZero(sign);
|
156
|
-
}
|
157
|
-
|
158
|
-
int64_t number = 0;
|
159
|
-
int exponent = 0;
|
160
|
-
const int radix = (1 << radix_log_2);
|
161
|
-
|
162
|
-
do {
|
163
|
-
int digit;
|
164
|
-
if (*current >= '0' && *current <= '9' && *current < '0' + radix) {
|
165
|
-
digit = static_cast<char>(*current) - '0';
|
166
|
-
} else if (radix > 10 && *current >= 'a' && *current < 'a' + radix - 10) {
|
167
|
-
digit = static_cast<char>(*current) - 'a' + 10;
|
168
|
-
} else if (radix > 10 && *current >= 'A' && *current < 'A' + radix - 10) {
|
169
|
-
digit = static_cast<char>(*current) - 'A' + 10;
|
170
|
-
} else {
|
171
|
-
if (allow_trailing_junk || !AdvanceToNonspace(¤t, end)) {
|
172
|
-
break;
|
173
|
-
} else {
|
174
|
-
return JUNK_STRING_VALUE;
|
175
|
-
}
|
176
|
-
}
|
177
|
-
|
178
|
-
number = number * radix + digit;
|
179
|
-
int overflow = static_cast<int>(number >> 53);
|
180
|
-
if (overflow != 0) {
|
181
|
-
// Overflow occurred. Need to determine which direction to round the
|
182
|
-
// result.
|
183
|
-
int overflow_bits_count = 1;
|
184
|
-
while (overflow > 1) {
|
185
|
-
overflow_bits_count++;
|
186
|
-
overflow >>= 1;
|
187
|
-
}
|
188
|
-
|
189
|
-
int dropped_bits_mask = ((1 << overflow_bits_count) - 1);
|
190
|
-
int dropped_bits = static_cast<int>(number) & dropped_bits_mask;
|
191
|
-
number >>= overflow_bits_count;
|
192
|
-
exponent = overflow_bits_count;
|
193
|
-
|
194
|
-
bool zero_tail = true;
|
195
|
-
while (true) {
|
196
|
-
++current;
|
197
|
-
if (current == end || !isDigit(*current, radix)) break;
|
198
|
-
zero_tail = zero_tail && *current == '0';
|
199
|
-
exponent += radix_log_2;
|
200
|
-
}
|
201
|
-
|
202
|
-
if (!allow_trailing_junk && AdvanceToNonspace(¤t, end)) {
|
203
|
-
return JUNK_STRING_VALUE;
|
204
|
-
}
|
205
|
-
|
206
|
-
int middle_value = (1 << (overflow_bits_count - 1));
|
207
|
-
if (dropped_bits > middle_value) {
|
208
|
-
number++; // Rounding up.
|
209
|
-
} else if (dropped_bits == middle_value) {
|
210
|
-
// Rounding to even to consistency with decimals: half-way case rounds
|
211
|
-
// up if significant part is odd and down otherwise.
|
212
|
-
if ((number & 1) != 0 || !zero_tail) {
|
213
|
-
number++; // Rounding up.
|
214
|
-
}
|
215
|
-
}
|
216
|
-
|
217
|
-
// Rounding up may cause overflow.
|
218
|
-
if ((number & ((int64_t)1 << 53)) != 0) {
|
219
|
-
exponent++;
|
220
|
-
number >>= 1;
|
221
|
-
}
|
222
|
-
break;
|
223
|
-
}
|
224
|
-
++current;
|
225
|
-
} while (current != end);
|
226
|
-
|
227
|
-
ASSERT(number < ((int64_t)1 << 53));
|
228
|
-
ASSERT(static_cast<int64_t>(static_cast<double>(number)) == number);
|
229
|
-
|
230
|
-
if (exponent == 0) {
|
231
|
-
if (sign) {
|
232
|
-
if (number == 0) return -0.0;
|
233
|
-
number = -number;
|
234
|
-
}
|
235
|
-
return static_cast<double>(number);
|
236
|
-
}
|
237
|
-
|
238
|
-
ASSERT(number != 0);
|
239
|
-
// The double could be constructed faster from number (mantissa), exponent
|
240
|
-
// and sign. Assuming it's a rare case more simple code is used.
|
241
|
-
return static_cast<double>(sign ? -number : number) * pow(2.0, exponent);
|
242
|
-
}
|
243
|
-
|
244
|
-
|
245
|
-
template <class Iterator, class EndMark>
|
246
|
-
static double InternalStringToInt(Iterator current, EndMark end, int radix) {
|
247
|
-
const bool allow_trailing_junk = true;
|
248
|
-
const double empty_string_val = JUNK_STRING_VALUE;
|
249
|
-
|
250
|
-
if (!AdvanceToNonspace(¤t, end)) return empty_string_val;
|
251
|
-
|
252
|
-
bool sign = false;
|
253
|
-
bool leading_zero = false;
|
254
|
-
|
255
|
-
if (*current == '+') {
|
256
|
-
// Ignore leading sign; skip following spaces.
|
257
|
-
++current;
|
258
|
-
if (!AdvanceToNonspace(¤t, end)) return JUNK_STRING_VALUE;
|
259
|
-
} else if (*current == '-') {
|
260
|
-
++current;
|
261
|
-
if (!AdvanceToNonspace(¤t, end)) return JUNK_STRING_VALUE;
|
262
|
-
sign = true;
|
263
|
-
}
|
264
|
-
|
265
|
-
if (radix == 0) {
|
266
|
-
// Radix detection.
|
267
|
-
if (*current == '0') {
|
268
|
-
++current;
|
269
|
-
if (current == end) return SignedZero(sign);
|
270
|
-
if (*current == 'x' || *current == 'X') {
|
271
|
-
radix = 16;
|
272
|
-
++current;
|
273
|
-
if (current == end) return JUNK_STRING_VALUE;
|
274
|
-
} else {
|
275
|
-
radix = 8;
|
276
|
-
leading_zero = true;
|
277
|
-
}
|
278
|
-
} else {
|
279
|
-
radix = 10;
|
280
|
-
}
|
281
|
-
} else if (radix == 16) {
|
282
|
-
if (*current == '0') {
|
283
|
-
// Allow "0x" prefix.
|
284
|
-
++current;
|
285
|
-
if (current == end) return SignedZero(sign);
|
286
|
-
if (*current == 'x' || *current == 'X') {
|
287
|
-
++current;
|
288
|
-
if (current == end) return JUNK_STRING_VALUE;
|
289
|
-
} else {
|
290
|
-
leading_zero = true;
|
291
|
-
}
|
292
|
-
}
|
293
|
-
}
|
294
|
-
|
295
|
-
if (radix < 2 || radix > 36) return JUNK_STRING_VALUE;
|
296
|
-
|
297
|
-
// Skip leading zeros.
|
298
|
-
while (*current == '0') {
|
299
|
-
leading_zero = true;
|
300
|
-
++current;
|
301
|
-
if (current == end) return SignedZero(sign);
|
302
|
-
}
|
303
|
-
|
304
|
-
if (!leading_zero && !isDigit(*current, radix)) {
|
305
|
-
return JUNK_STRING_VALUE;
|
306
|
-
}
|
307
|
-
|
308
|
-
if (IsPowerOf2(radix)) {
|
309
|
-
switch (radix) {
|
310
|
-
case 2:
|
311
|
-
return InternalStringToIntDouble<1>(
|
312
|
-
current, end, sign, allow_trailing_junk);
|
313
|
-
case 4:
|
314
|
-
return InternalStringToIntDouble<2>(
|
315
|
-
current, end, sign, allow_trailing_junk);
|
316
|
-
case 8:
|
317
|
-
return InternalStringToIntDouble<3>(
|
318
|
-
current, end, sign, allow_trailing_junk);
|
319
|
-
|
320
|
-
case 16:
|
321
|
-
return InternalStringToIntDouble<4>(
|
322
|
-
current, end, sign, allow_trailing_junk);
|
323
|
-
|
324
|
-
case 32:
|
325
|
-
return InternalStringToIntDouble<5>(
|
326
|
-
current, end, sign, allow_trailing_junk);
|
327
|
-
default:
|
328
|
-
UNREACHABLE();
|
329
|
-
}
|
330
|
-
}
|
331
|
-
|
332
|
-
if (radix == 10) {
|
333
|
-
// Parsing with strtod.
|
334
|
-
const int kMaxSignificantDigits = 309; // Doubles are less than 1.8e308.
|
335
|
-
// The buffer may contain up to kMaxSignificantDigits + 1 digits and a zero
|
336
|
-
// end.
|
337
|
-
const int kBufferSize = kMaxSignificantDigits + 2;
|
338
|
-
char buffer[kBufferSize];
|
339
|
-
int buffer_pos = 0;
|
340
|
-
while (*current >= '0' && *current <= '9') {
|
341
|
-
if (buffer_pos <= kMaxSignificantDigits) {
|
342
|
-
// If the number has more than kMaxSignificantDigits it will be parsed
|
343
|
-
// as infinity.
|
344
|
-
ASSERT(buffer_pos < kBufferSize);
|
345
|
-
buffer[buffer_pos++] = static_cast<char>(*current);
|
346
|
-
}
|
347
|
-
++current;
|
348
|
-
if (current == end) break;
|
349
|
-
}
|
350
|
-
|
351
|
-
if (!allow_trailing_junk && AdvanceToNonspace(¤t, end)) {
|
352
|
-
return JUNK_STRING_VALUE;
|
353
|
-
}
|
354
|
-
|
355
|
-
ASSERT(buffer_pos < kBufferSize);
|
356
|
-
buffer[buffer_pos++] = '\0';
|
357
|
-
return sign ? -gay_strtod(buffer, NULL) : gay_strtod(buffer, NULL);
|
358
|
-
}
|
359
|
-
|
360
|
-
// The following code causes accumulating rounding error for numbers greater
|
361
|
-
// than ~2^56. It's explicitly allowed in the spec: "if R is not 2, 4, 8, 10,
|
362
|
-
// 16, or 32, then mathInt may be an implementation-dependent approximation to
|
363
|
-
// the mathematical integer value" (15.1.2.2).
|
364
|
-
|
365
|
-
int lim_0 = '0' + (radix < 10 ? radix : 10);
|
366
|
-
int lim_a = 'a' + (radix - 10);
|
367
|
-
int lim_A = 'A' + (radix - 10);
|
368
|
-
|
369
|
-
// NOTE: The code for computing the value may seem a bit complex at
|
370
|
-
// first glance. It is structured to use 32-bit multiply-and-add
|
371
|
-
// loops as long as possible to avoid loosing precision.
|
372
|
-
|
373
|
-
double v = 0.0;
|
374
|
-
bool done = false;
|
375
|
-
do {
|
376
|
-
// Parse the longest part of the string starting at index j
|
377
|
-
// possible while keeping the multiplier, and thus the part
|
378
|
-
// itself, within 32 bits.
|
379
|
-
unsigned int part = 0, multiplier = 1;
|
380
|
-
while (true) {
|
381
|
-
int d;
|
382
|
-
if (*current >= '0' && *current < lim_0) {
|
383
|
-
d = *current - '0';
|
384
|
-
} else if (*current >= 'a' && *current < lim_a) {
|
385
|
-
d = *current - 'a' + 10;
|
386
|
-
} else if (*current >= 'A' && *current < lim_A) {
|
387
|
-
d = *current - 'A' + 10;
|
388
|
-
} else {
|
389
|
-
done = true;
|
390
|
-
break;
|
391
|
-
}
|
392
|
-
|
393
|
-
// Update the value of the part as long as the multiplier fits
|
394
|
-
// in 32 bits. When we can't guarantee that the next iteration
|
395
|
-
// will not overflow the multiplier, we stop parsing the part
|
396
|
-
// by leaving the loop.
|
397
|
-
const unsigned int kMaximumMultiplier = 0xffffffffU / 36;
|
398
|
-
uint32_t m = multiplier * radix;
|
399
|
-
if (m > kMaximumMultiplier) break;
|
400
|
-
part = part * radix + d;
|
401
|
-
multiplier = m;
|
402
|
-
ASSERT(multiplier > part);
|
403
|
-
|
404
|
-
++current;
|
405
|
-
if (current == end) {
|
406
|
-
done = true;
|
407
|
-
break;
|
408
|
-
}
|
409
|
-
}
|
410
|
-
|
411
|
-
// Update the value and skip the part in the string.
|
412
|
-
v = v * multiplier + part;
|
413
|
-
} while (!done);
|
414
|
-
|
415
|
-
if (!allow_trailing_junk && AdvanceToNonspace(¤t, end)) {
|
416
|
-
return JUNK_STRING_VALUE;
|
417
|
-
}
|
418
|
-
|
419
|
-
return sign ? -v : v;
|
420
|
-
}
|
421
|
-
|
422
|
-
|
423
|
-
// Converts a string to a double value. Assumes the Iterator supports
|
424
|
-
// the following operations:
|
425
|
-
// 1. current == end (other ops are not allowed), current != end.
|
426
|
-
// 2. *current - gets the current character in the sequence.
|
427
|
-
// 3. ++current (advances the position).
|
428
|
-
template <class Iterator, class EndMark>
|
429
|
-
static double InternalStringToDouble(Iterator current,
|
430
|
-
EndMark end,
|
431
|
-
int flags,
|
432
|
-
double empty_string_val) {
|
433
|
-
// To make sure that iterator dereferencing is valid the following
|
434
|
-
// convention is used:
|
435
|
-
// 1. Each '++current' statement is followed by check for equality to 'end'.
|
436
|
-
// 2. If AdvanceToNonspace returned false then current == end.
|
437
|
-
// 3. If 'current' becomes be equal to 'end' the function returns or goes to
|
438
|
-
// 'parsing_done'.
|
439
|
-
// 4. 'current' is not dereferenced after the 'parsing_done' label.
|
440
|
-
// 5. Code before 'parsing_done' may rely on 'current != end'.
|
441
|
-
if (!AdvanceToNonspace(¤t, end)) return empty_string_val;
|
442
|
-
|
443
|
-
const bool allow_trailing_junk = (flags & ALLOW_TRAILING_JUNK) != 0;
|
444
|
-
|
445
|
-
// The longest form of simplified number is: "-<significant digits>'.1eXXX\0".
|
446
|
-
const int kBufferSize = kMaxSignificantDigits + 10;
|
447
|
-
char buffer[kBufferSize]; // NOLINT: size is known at compile time.
|
448
|
-
int buffer_pos = 0;
|
449
|
-
|
450
|
-
// Exponent will be adjusted if insignificant digits of the integer part
|
451
|
-
// or insignificant leading zeros of the fractional part are dropped.
|
452
|
-
int exponent = 0;
|
453
|
-
int significant_digits = 0;
|
454
|
-
int insignificant_digits = 0;
|
455
|
-
bool nonzero_digit_dropped = false;
|
456
|
-
bool fractional_part = false;
|
457
|
-
|
458
|
-
bool sign = false;
|
459
|
-
|
460
|
-
if (*current == '+') {
|
461
|
-
// Ignore leading sign; skip following spaces.
|
462
|
-
++current;
|
463
|
-
if (!AdvanceToNonspace(¤t, end)) return JUNK_STRING_VALUE;
|
464
|
-
} else if (*current == '-') {
|
465
|
-
buffer[buffer_pos++] = '-';
|
466
|
-
++current;
|
467
|
-
if (!AdvanceToNonspace(¤t, end)) return JUNK_STRING_VALUE;
|
468
|
-
sign = true;
|
469
|
-
}
|
470
|
-
|
471
|
-
static const char kInfinitySymbol[] = "Infinity";
|
472
|
-
if (*current == kInfinitySymbol[0]) {
|
473
|
-
if (!SubStringEquals(¤t, end, kInfinitySymbol)) {
|
474
|
-
return JUNK_STRING_VALUE;
|
475
|
-
}
|
476
|
-
|
477
|
-
if (!allow_trailing_junk && AdvanceToNonspace(¤t, end)) {
|
478
|
-
return JUNK_STRING_VALUE;
|
479
|
-
}
|
480
|
-
|
481
|
-
ASSERT(buffer_pos == 0 || buffer[0] == '-');
|
482
|
-
return buffer_pos > 0 ? -V8_INFINITY : V8_INFINITY;
|
483
|
-
}
|
484
|
-
|
485
|
-
bool leading_zero = false;
|
486
|
-
if (*current == '0') {
|
487
|
-
++current;
|
488
|
-
if (current == end) return SignedZero(sign);
|
489
|
-
|
490
|
-
leading_zero = true;
|
491
|
-
|
492
|
-
// It could be hexadecimal value.
|
493
|
-
if ((flags & ALLOW_HEX) && (*current == 'x' || *current == 'X')) {
|
494
|
-
++current;
|
495
|
-
if (current == end || !isDigit(*current, 16)) {
|
496
|
-
return JUNK_STRING_VALUE; // "0x".
|
497
|
-
}
|
498
|
-
|
499
|
-
bool sign = (buffer_pos > 0 && buffer[0] == '-');
|
500
|
-
return InternalStringToIntDouble<4>(current,
|
501
|
-
end,
|
502
|
-
sign,
|
503
|
-
allow_trailing_junk);
|
504
|
-
}
|
505
|
-
|
506
|
-
// Ignore leading zeros in the integer part.
|
507
|
-
while (*current == '0') {
|
508
|
-
++current;
|
509
|
-
if (current == end) return SignedZero(sign);
|
510
|
-
}
|
511
|
-
}
|
512
|
-
|
513
|
-
bool octal = leading_zero && (flags & ALLOW_OCTALS) != 0;
|
514
|
-
|
515
|
-
// Copy significant digits of the integer part (if any) to the buffer.
|
516
|
-
while (*current >= '0' && *current <= '9') {
|
517
|
-
if (significant_digits < kMaxSignificantDigits) {
|
518
|
-
ASSERT(buffer_pos < kBufferSize);
|
519
|
-
buffer[buffer_pos++] = static_cast<char>(*current);
|
520
|
-
significant_digits++;
|
521
|
-
// Will later check if it's an octal in the buffer.
|
522
|
-
} else {
|
523
|
-
insignificant_digits++; // Move the digit into the exponential part.
|
524
|
-
nonzero_digit_dropped = nonzero_digit_dropped || *current != '0';
|
525
|
-
}
|
526
|
-
octal = octal && *current < '8';
|
527
|
-
++current;
|
528
|
-
if (current == end) goto parsing_done;
|
529
|
-
}
|
530
|
-
|
531
|
-
if (significant_digits == 0) {
|
532
|
-
octal = false;
|
533
|
-
}
|
534
|
-
|
535
|
-
if (*current == '.') {
|
536
|
-
++current;
|
537
|
-
if (current == end) {
|
538
|
-
if (significant_digits == 0 && !leading_zero) {
|
539
|
-
return JUNK_STRING_VALUE;
|
540
|
-
} else {
|
541
|
-
goto parsing_done;
|
542
|
-
}
|
543
|
-
}
|
544
|
-
|
545
|
-
if (significant_digits == 0) {
|
546
|
-
// octal = false;
|
547
|
-
// Integer part consists of 0 or is absent. Significant digits start after
|
548
|
-
// leading zeros (if any).
|
549
|
-
while (*current == '0') {
|
550
|
-
++current;
|
551
|
-
if (current == end) return SignedZero(sign);
|
552
|
-
exponent--; // Move this 0 into the exponent.
|
553
|
-
}
|
554
|
-
}
|
555
|
-
|
556
|
-
ASSERT(buffer_pos < kBufferSize);
|
557
|
-
buffer[buffer_pos++] = '.';
|
558
|
-
fractional_part = true;
|
559
|
-
|
560
|
-
// There is the fractional part.
|
561
|
-
while (*current >= '0' && *current <= '9') {
|
562
|
-
if (significant_digits < kMaxSignificantDigits) {
|
563
|
-
ASSERT(buffer_pos < kBufferSize);
|
564
|
-
buffer[buffer_pos++] = static_cast<char>(*current);
|
565
|
-
significant_digits++;
|
566
|
-
} else {
|
567
|
-
// Ignore insignificant digits in the fractional part.
|
568
|
-
nonzero_digit_dropped = nonzero_digit_dropped || *current != '0';
|
569
|
-
}
|
570
|
-
++current;
|
571
|
-
if (current == end) goto parsing_done;
|
572
|
-
}
|
573
|
-
}
|
574
|
-
|
575
|
-
if (!leading_zero && exponent == 0 && significant_digits == 0) {
|
576
|
-
// If leading_zeros is true then the string contains zeros.
|
577
|
-
// If exponent < 0 then string was [+-]\.0*...
|
578
|
-
// If significant_digits != 0 the string is not equal to 0.
|
579
|
-
// Otherwise there are no digits in the string.
|
580
|
-
return JUNK_STRING_VALUE;
|
581
|
-
}
|
582
|
-
|
583
|
-
// Parse exponential part.
|
584
|
-
if (*current == 'e' || *current == 'E') {
|
585
|
-
if (octal) return JUNK_STRING_VALUE;
|
586
|
-
++current;
|
587
|
-
if (current == end) {
|
588
|
-
if (allow_trailing_junk) {
|
589
|
-
goto parsing_done;
|
590
|
-
} else {
|
591
|
-
return JUNK_STRING_VALUE;
|
592
|
-
}
|
593
|
-
}
|
594
|
-
char sign = '+';
|
595
|
-
if (*current == '+' || *current == '-') {
|
596
|
-
sign = static_cast<char>(*current);
|
597
|
-
++current;
|
598
|
-
if (current == end) {
|
599
|
-
if (allow_trailing_junk) {
|
600
|
-
goto parsing_done;
|
601
|
-
} else {
|
602
|
-
return JUNK_STRING_VALUE;
|
603
|
-
}
|
604
|
-
}
|
605
|
-
}
|
606
|
-
|
607
|
-
if (current == end || *current < '0' || *current > '9') {
|
608
|
-
if (allow_trailing_junk) {
|
609
|
-
goto parsing_done;
|
610
|
-
} else {
|
611
|
-
return JUNK_STRING_VALUE;
|
612
|
-
}
|
613
|
-
}
|
614
|
-
|
615
|
-
const int max_exponent = INT_MAX / 2;
|
616
|
-
ASSERT(-max_exponent / 2 <= exponent && exponent <= max_exponent / 2);
|
617
|
-
int num = 0;
|
618
|
-
do {
|
619
|
-
// Check overflow.
|
620
|
-
int digit = *current - '0';
|
621
|
-
if (num >= max_exponent / 10
|
622
|
-
&& !(num == max_exponent / 10 && digit <= max_exponent % 10)) {
|
623
|
-
num = max_exponent;
|
624
|
-
} else {
|
625
|
-
num = num * 10 + digit;
|
626
|
-
}
|
627
|
-
++current;
|
628
|
-
} while (current != end && *current >= '0' && *current <= '9');
|
629
|
-
|
630
|
-
exponent += (sign == '-' ? -num : num);
|
631
|
-
}
|
632
|
-
|
633
|
-
if (!allow_trailing_junk && AdvanceToNonspace(¤t, end)) {
|
634
|
-
return JUNK_STRING_VALUE;
|
635
|
-
}
|
636
|
-
|
637
|
-
parsing_done:
|
638
|
-
exponent += insignificant_digits;
|
639
|
-
|
640
|
-
if (octal) {
|
641
|
-
bool sign = buffer[0] == '-';
|
642
|
-
int start_pos = (sign ? 1 : 0);
|
643
|
-
|
644
|
-
return InternalStringToIntDouble<3>(buffer + start_pos,
|
645
|
-
buffer + buffer_pos,
|
646
|
-
sign,
|
647
|
-
allow_trailing_junk);
|
648
|
-
}
|
649
|
-
|
650
|
-
if (nonzero_digit_dropped) {
|
651
|
-
if (insignificant_digits) buffer[buffer_pos++] = '.';
|
652
|
-
buffer[buffer_pos++] = '1';
|
653
|
-
}
|
654
|
-
|
655
|
-
// If the number has no more than kMaxDigitsInInt digits and doesn't have
|
656
|
-
// fractional part it could be parsed faster (without checks for
|
657
|
-
// spaces, overflow, etc.).
|
658
|
-
const int kMaxDigitsInInt = 9 * sizeof(int) / 4; // NOLINT
|
659
|
-
|
660
|
-
if (exponent != 0) {
|
661
|
-
ASSERT(buffer_pos < kBufferSize);
|
662
|
-
buffer[buffer_pos++] = 'e';
|
663
|
-
if (exponent < 0) {
|
664
|
-
ASSERT(buffer_pos < kBufferSize);
|
665
|
-
buffer[buffer_pos++] = '-';
|
666
|
-
exponent = -exponent;
|
667
|
-
}
|
668
|
-
if (exponent > 999) exponent = 999; // Result will be Infinity or 0 or -0.
|
669
|
-
|
670
|
-
const int exp_digits = 3;
|
671
|
-
for (int i = 0; i < exp_digits; i++) {
|
672
|
-
buffer[buffer_pos + exp_digits - 1 - i] = '0' + exponent % 10;
|
673
|
-
exponent /= 10;
|
674
|
-
}
|
675
|
-
ASSERT(exponent == 0);
|
676
|
-
buffer_pos += exp_digits;
|
677
|
-
} else if (!fractional_part && significant_digits <= kMaxDigitsInInt) {
|
678
|
-
if (significant_digits == 0) return SignedZero(sign);
|
679
|
-
ASSERT(buffer_pos > 0);
|
680
|
-
int num = 0;
|
681
|
-
int start_pos = (buffer[0] == '-' ? 1 : 0);
|
682
|
-
for (int i = start_pos; i < buffer_pos; i++) {
|
683
|
-
ASSERT(buffer[i] >= '0' && buffer[i] <= '9');
|
684
|
-
num = 10 * num + (buffer[i] - '0');
|
685
|
-
}
|
686
|
-
return static_cast<double>(start_pos == 0 ? num : -num);
|
687
|
-
}
|
688
|
-
|
689
|
-
ASSERT(buffer_pos < kBufferSize);
|
690
|
-
buffer[buffer_pos] = '\0';
|
691
|
-
|
692
|
-
return gay_strtod(buffer, NULL);
|
693
|
-
}
|
694
|
-
|
695
|
-
double StringToDouble(String* str, int flags, double empty_string_val) {
|
696
|
-
StringShape shape(str);
|
697
|
-
if (shape.IsSequentialAscii()) {
|
698
|
-
const char* begin = SeqAsciiString::cast(str)->GetChars();
|
699
|
-
const char* end = begin + str->length();
|
700
|
-
return InternalStringToDouble(begin, end, flags, empty_string_val);
|
701
|
-
} else if (shape.IsSequentialTwoByte()) {
|
702
|
-
const uc16* begin = SeqTwoByteString::cast(str)->GetChars();
|
703
|
-
const uc16* end = begin + str->length();
|
704
|
-
return InternalStringToDouble(begin, end, flags, empty_string_val);
|
705
|
-
} else {
|
706
|
-
StringInputBuffer buffer(str);
|
707
|
-
return InternalStringToDouble(StringInputBufferIterator(&buffer),
|
708
|
-
StringInputBufferIterator::EndMarker(),
|
709
|
-
flags,
|
710
|
-
empty_string_val);
|
711
|
-
}
|
712
|
-
}
|
713
|
-
|
714
|
-
|
715
|
-
double StringToInt(String* str, int radix) {
|
716
|
-
StringShape shape(str);
|
717
|
-
if (shape.IsSequentialAscii()) {
|
718
|
-
const char* begin = SeqAsciiString::cast(str)->GetChars();
|
719
|
-
const char* end = begin + str->length();
|
720
|
-
return InternalStringToInt(begin, end, radix);
|
721
|
-
} else if (shape.IsSequentialTwoByte()) {
|
722
|
-
const uc16* begin = SeqTwoByteString::cast(str)->GetChars();
|
723
|
-
const uc16* end = begin + str->length();
|
724
|
-
return InternalStringToInt(begin, end, radix);
|
725
|
-
} else {
|
726
|
-
StringInputBuffer buffer(str);
|
727
|
-
return InternalStringToInt(StringInputBufferIterator(&buffer),
|
728
|
-
StringInputBufferIterator::EndMarker(),
|
729
|
-
radix);
|
730
|
-
}
|
731
|
-
}
|
732
|
-
|
733
|
-
|
734
|
-
double StringToDouble(const char* str, int flags, double empty_string_val) {
|
735
|
-
const char* end = str + StrLength(str);
|
736
|
-
|
737
|
-
return InternalStringToDouble(str, end, flags, empty_string_val);
|
738
|
-
}
|
739
|
-
|
740
|
-
|
741
|
-
extern "C" char* dtoa(double d, int mode, int ndigits,
|
742
|
-
int* decpt, int* sign, char** rve);
|
743
|
-
|
744
|
-
extern "C" void freedtoa(char* s);
|
745
|
-
|
746
|
-
const char* DoubleToCString(double v, Vector<char> buffer) {
|
747
|
-
StringBuilder builder(buffer.start(), buffer.length());
|
748
|
-
|
749
|
-
switch (fpclassify(v)) {
|
750
|
-
case FP_NAN:
|
751
|
-
builder.AddString("NaN");
|
752
|
-
break;
|
753
|
-
|
754
|
-
case FP_INFINITE:
|
755
|
-
if (v < 0.0) {
|
756
|
-
builder.AddString("-Infinity");
|
757
|
-
} else {
|
758
|
-
builder.AddString("Infinity");
|
759
|
-
}
|
760
|
-
break;
|
761
|
-
|
762
|
-
case FP_ZERO:
|
763
|
-
builder.AddCharacter('0');
|
764
|
-
break;
|
765
|
-
|
766
|
-
default: {
|
767
|
-
int decimal_point;
|
768
|
-
int sign;
|
769
|
-
char* decimal_rep;
|
770
|
-
bool used_gay_dtoa = false;
|
771
|
-
const int kV8DtoaBufferCapacity = kBase10MaximalLength + 1;
|
772
|
-
char v8_dtoa_buffer[kV8DtoaBufferCapacity];
|
773
|
-
int length;
|
774
|
-
|
775
|
-
if (DoubleToAscii(v, DTOA_SHORTEST, 0,
|
776
|
-
Vector<char>(v8_dtoa_buffer, kV8DtoaBufferCapacity),
|
777
|
-
&sign, &length, &decimal_point)) {
|
778
|
-
decimal_rep = v8_dtoa_buffer;
|
779
|
-
} else {
|
780
|
-
decimal_rep = dtoa(v, 0, 0, &decimal_point, &sign, NULL);
|
781
|
-
used_gay_dtoa = true;
|
782
|
-
length = StrLength(decimal_rep);
|
783
|
-
}
|
784
|
-
|
785
|
-
if (sign) builder.AddCharacter('-');
|
786
|
-
|
787
|
-
if (length <= decimal_point && decimal_point <= 21) {
|
788
|
-
// ECMA-262 section 9.8.1 step 6.
|
789
|
-
builder.AddString(decimal_rep);
|
790
|
-
builder.AddPadding('0', decimal_point - length);
|
791
|
-
|
792
|
-
} else if (0 < decimal_point && decimal_point <= 21) {
|
793
|
-
// ECMA-262 section 9.8.1 step 7.
|
794
|
-
builder.AddSubstring(decimal_rep, decimal_point);
|
795
|
-
builder.AddCharacter('.');
|
796
|
-
builder.AddString(decimal_rep + decimal_point);
|
797
|
-
|
798
|
-
} else if (decimal_point <= 0 && decimal_point > -6) {
|
799
|
-
// ECMA-262 section 9.8.1 step 8.
|
800
|
-
builder.AddString("0.");
|
801
|
-
builder.AddPadding('0', -decimal_point);
|
802
|
-
builder.AddString(decimal_rep);
|
803
|
-
|
804
|
-
} else {
|
805
|
-
// ECMA-262 section 9.8.1 step 9 and 10 combined.
|
806
|
-
builder.AddCharacter(decimal_rep[0]);
|
807
|
-
if (length != 1) {
|
808
|
-
builder.AddCharacter('.');
|
809
|
-
builder.AddString(decimal_rep + 1);
|
810
|
-
}
|
811
|
-
builder.AddCharacter('e');
|
812
|
-
builder.AddCharacter((decimal_point >= 0) ? '+' : '-');
|
813
|
-
int exponent = decimal_point - 1;
|
814
|
-
if (exponent < 0) exponent = -exponent;
|
815
|
-
builder.AddFormatted("%d", exponent);
|
816
|
-
}
|
817
|
-
|
818
|
-
if (used_gay_dtoa) freedtoa(decimal_rep);
|
819
|
-
}
|
820
|
-
}
|
821
|
-
return builder.Finalize();
|
822
|
-
}
|
823
|
-
|
824
|
-
|
825
|
-
const char* IntToCString(int n, Vector<char> buffer) {
|
826
|
-
bool negative = false;
|
827
|
-
if (n < 0) {
|
828
|
-
// We must not negate the most negative int.
|
829
|
-
if (n == kMinInt) return DoubleToCString(n, buffer);
|
830
|
-
negative = true;
|
831
|
-
n = -n;
|
832
|
-
}
|
833
|
-
// Build the string backwards from the least significant digit.
|
834
|
-
int i = buffer.length();
|
835
|
-
buffer[--i] = '\0';
|
836
|
-
do {
|
837
|
-
buffer[--i] = '0' + (n % 10);
|
838
|
-
n /= 10;
|
839
|
-
} while (n);
|
840
|
-
if (negative) buffer[--i] = '-';
|
841
|
-
return buffer.start() + i;
|
842
|
-
}
|
843
|
-
|
844
|
-
|
845
|
-
char* DoubleToFixedCString(double value, int f) {
|
846
|
-
const int kMaxDigitsBeforePoint = 20;
|
847
|
-
const double kFirstNonFixed = 1e21;
|
848
|
-
const int kMaxDigitsAfterPoint = 20;
|
849
|
-
ASSERT(f >= 0);
|
850
|
-
ASSERT(f <= kMaxDigitsAfterPoint);
|
851
|
-
|
852
|
-
bool negative = false;
|
853
|
-
double abs_value = value;
|
854
|
-
if (value < 0) {
|
855
|
-
abs_value = -value;
|
856
|
-
negative = true;
|
857
|
-
}
|
858
|
-
|
859
|
-
// If abs_value has more than kMaxDigitsBeforePoint digits before the point
|
860
|
-
// use the non-fixed conversion routine.
|
861
|
-
if (abs_value >= kFirstNonFixed) {
|
862
|
-
char arr[100];
|
863
|
-
Vector<char> buffer(arr, ARRAY_SIZE(arr));
|
864
|
-
return StrDup(DoubleToCString(value, buffer));
|
865
|
-
}
|
866
|
-
|
867
|
-
// Find a sufficiently precise decimal representation of n.
|
868
|
-
int decimal_point;
|
869
|
-
int sign;
|
870
|
-
// Add space for the '.' and the '\0' byte.
|
871
|
-
const int kDecimalRepCapacity =
|
872
|
-
kMaxDigitsBeforePoint + kMaxDigitsAfterPoint + 2;
|
873
|
-
char decimal_rep[kDecimalRepCapacity];
|
874
|
-
int decimal_rep_length;
|
875
|
-
bool status = DoubleToAscii(value, DTOA_FIXED, f,
|
876
|
-
Vector<char>(decimal_rep, kDecimalRepCapacity),
|
877
|
-
&sign, &decimal_rep_length, &decimal_point);
|
878
|
-
USE(status);
|
879
|
-
ASSERT(status);
|
880
|
-
|
881
|
-
// Create a representation that is padded with zeros if needed.
|
882
|
-
int zero_prefix_length = 0;
|
883
|
-
int zero_postfix_length = 0;
|
884
|
-
|
885
|
-
if (decimal_point <= 0) {
|
886
|
-
zero_prefix_length = -decimal_point + 1;
|
887
|
-
decimal_point = 1;
|
888
|
-
}
|
889
|
-
|
890
|
-
if (zero_prefix_length + decimal_rep_length < decimal_point + f) {
|
891
|
-
zero_postfix_length = decimal_point + f - decimal_rep_length -
|
892
|
-
zero_prefix_length;
|
893
|
-
}
|
894
|
-
|
895
|
-
unsigned rep_length =
|
896
|
-
zero_prefix_length + decimal_rep_length + zero_postfix_length;
|
897
|
-
StringBuilder rep_builder(rep_length + 1);
|
898
|
-
rep_builder.AddPadding('0', zero_prefix_length);
|
899
|
-
rep_builder.AddString(decimal_rep);
|
900
|
-
rep_builder.AddPadding('0', zero_postfix_length);
|
901
|
-
char* rep = rep_builder.Finalize();
|
902
|
-
|
903
|
-
// Create the result string by appending a minus and putting in a
|
904
|
-
// decimal point if needed.
|
905
|
-
unsigned result_size = decimal_point + f + 2;
|
906
|
-
StringBuilder builder(result_size + 1);
|
907
|
-
if (negative) builder.AddCharacter('-');
|
908
|
-
builder.AddSubstring(rep, decimal_point);
|
909
|
-
if (f > 0) {
|
910
|
-
builder.AddCharacter('.');
|
911
|
-
builder.AddSubstring(rep + decimal_point, f);
|
912
|
-
}
|
913
|
-
DeleteArray(rep);
|
914
|
-
return builder.Finalize();
|
915
|
-
}
|
916
|
-
|
917
|
-
|
918
|
-
static char* CreateExponentialRepresentation(char* decimal_rep,
|
919
|
-
int exponent,
|
920
|
-
bool negative,
|
921
|
-
int significant_digits) {
|
922
|
-
bool negative_exponent = false;
|
923
|
-
if (exponent < 0) {
|
924
|
-
negative_exponent = true;
|
925
|
-
exponent = -exponent;
|
926
|
-
}
|
927
|
-
|
928
|
-
// Leave room in the result for appending a minus, for a period, the
|
929
|
-
// letter 'e', a minus or a plus depending on the exponent, and a
|
930
|
-
// three digit exponent.
|
931
|
-
unsigned result_size = significant_digits + 7;
|
932
|
-
StringBuilder builder(result_size + 1);
|
933
|
-
|
934
|
-
if (negative) builder.AddCharacter('-');
|
935
|
-
builder.AddCharacter(decimal_rep[0]);
|
936
|
-
if (significant_digits != 1) {
|
937
|
-
builder.AddCharacter('.');
|
938
|
-
builder.AddString(decimal_rep + 1);
|
939
|
-
int rep_length = StrLength(decimal_rep);
|
940
|
-
builder.AddPadding('0', significant_digits - rep_length);
|
941
|
-
}
|
942
|
-
|
943
|
-
builder.AddCharacter('e');
|
944
|
-
builder.AddCharacter(negative_exponent ? '-' : '+');
|
945
|
-
builder.AddFormatted("%d", exponent);
|
946
|
-
return builder.Finalize();
|
947
|
-
}
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
char* DoubleToExponentialCString(double value, int f) {
|
952
|
-
// f might be -1 to signal that f was undefined in JavaScript.
|
953
|
-
ASSERT(f >= -1 && f <= 20);
|
954
|
-
|
955
|
-
bool negative = false;
|
956
|
-
if (value < 0) {
|
957
|
-
value = -value;
|
958
|
-
negative = true;
|
959
|
-
}
|
960
|
-
|
961
|
-
// Find a sufficiently precise decimal representation of n.
|
962
|
-
int decimal_point;
|
963
|
-
int sign;
|
964
|
-
char* decimal_rep = NULL;
|
965
|
-
if (f == -1) {
|
966
|
-
decimal_rep = dtoa(value, 0, 0, &decimal_point, &sign, NULL);
|
967
|
-
f = StrLength(decimal_rep) - 1;
|
968
|
-
} else {
|
969
|
-
decimal_rep = dtoa(value, 2, f + 1, &decimal_point, &sign, NULL);
|
970
|
-
}
|
971
|
-
int decimal_rep_length = StrLength(decimal_rep);
|
972
|
-
ASSERT(decimal_rep_length > 0);
|
973
|
-
ASSERT(decimal_rep_length <= f + 1);
|
974
|
-
USE(decimal_rep_length);
|
975
|
-
|
976
|
-
int exponent = decimal_point - 1;
|
977
|
-
char* result =
|
978
|
-
CreateExponentialRepresentation(decimal_rep, exponent, negative, f+1);
|
979
|
-
|
980
|
-
freedtoa(decimal_rep);
|
981
|
-
|
982
|
-
return result;
|
983
|
-
}
|
984
|
-
|
985
|
-
|
986
|
-
char* DoubleToPrecisionCString(double value, int p) {
|
987
|
-
ASSERT(p >= 1 && p <= 21);
|
988
|
-
|
989
|
-
bool negative = false;
|
990
|
-
if (value < 0) {
|
991
|
-
value = -value;
|
992
|
-
negative = true;
|
993
|
-
}
|
994
|
-
|
995
|
-
// Find a sufficiently precise decimal representation of n.
|
996
|
-
int decimal_point;
|
997
|
-
int sign;
|
998
|
-
char* decimal_rep = dtoa(value, 2, p, &decimal_point, &sign, NULL);
|
999
|
-
int decimal_rep_length = StrLength(decimal_rep);
|
1000
|
-
ASSERT(decimal_rep_length <= p);
|
1001
|
-
|
1002
|
-
int exponent = decimal_point - 1;
|
1003
|
-
|
1004
|
-
char* result = NULL;
|
1005
|
-
|
1006
|
-
if (exponent < -6 || exponent >= p) {
|
1007
|
-
result =
|
1008
|
-
CreateExponentialRepresentation(decimal_rep, exponent, negative, p);
|
1009
|
-
} else {
|
1010
|
-
// Use fixed notation.
|
1011
|
-
//
|
1012
|
-
// Leave room in the result for appending a minus, a period and in
|
1013
|
-
// the case where decimal_point is not positive for a zero in
|
1014
|
-
// front of the period.
|
1015
|
-
unsigned result_size = (decimal_point <= 0)
|
1016
|
-
? -decimal_point + p + 3
|
1017
|
-
: p + 2;
|
1018
|
-
StringBuilder builder(result_size + 1);
|
1019
|
-
if (negative) builder.AddCharacter('-');
|
1020
|
-
if (decimal_point <= 0) {
|
1021
|
-
builder.AddString("0.");
|
1022
|
-
builder.AddPadding('0', -decimal_point);
|
1023
|
-
builder.AddString(decimal_rep);
|
1024
|
-
builder.AddPadding('0', p - decimal_rep_length);
|
1025
|
-
} else {
|
1026
|
-
const int m = Min(decimal_rep_length, decimal_point);
|
1027
|
-
builder.AddSubstring(decimal_rep, m);
|
1028
|
-
builder.AddPadding('0', decimal_point - decimal_rep_length);
|
1029
|
-
if (decimal_point < p) {
|
1030
|
-
builder.AddCharacter('.');
|
1031
|
-
const int extra = negative ? 2 : 1;
|
1032
|
-
if (decimal_rep_length > decimal_point) {
|
1033
|
-
const int len = StrLength(decimal_rep + decimal_point);
|
1034
|
-
const int n = Min(len, p - (builder.position() - extra));
|
1035
|
-
builder.AddSubstring(decimal_rep + decimal_point, n);
|
1036
|
-
}
|
1037
|
-
builder.AddPadding('0', extra + (p - builder.position()));
|
1038
|
-
}
|
1039
|
-
}
|
1040
|
-
result = builder.Finalize();
|
1041
|
-
}
|
1042
|
-
|
1043
|
-
freedtoa(decimal_rep);
|
1044
|
-
return result;
|
1045
|
-
}
|
1046
|
-
|
1047
|
-
|
1048
|
-
char* DoubleToRadixCString(double value, int radix) {
|
1049
|
-
ASSERT(radix >= 2 && radix <= 36);
|
1050
|
-
|
1051
|
-
// Character array used for conversion.
|
1052
|
-
static const char chars[] = "0123456789abcdefghijklmnopqrstuvwxyz";
|
1053
|
-
|
1054
|
-
// Buffer for the integer part of the result. 1024 chars is enough
|
1055
|
-
// for max integer value in radix 2. We need room for a sign too.
|
1056
|
-
static const int kBufferSize = 1100;
|
1057
|
-
char integer_buffer[kBufferSize];
|
1058
|
-
integer_buffer[kBufferSize - 1] = '\0';
|
1059
|
-
|
1060
|
-
// Buffer for the decimal part of the result. We only generate up
|
1061
|
-
// to kBufferSize - 1 chars for the decimal part.
|
1062
|
-
char decimal_buffer[kBufferSize];
|
1063
|
-
decimal_buffer[kBufferSize - 1] = '\0';
|
1064
|
-
|
1065
|
-
// Make sure the value is positive.
|
1066
|
-
bool is_negative = value < 0.0;
|
1067
|
-
if (is_negative) value = -value;
|
1068
|
-
|
1069
|
-
// Get the integer part and the decimal part.
|
1070
|
-
double integer_part = floor(value);
|
1071
|
-
double decimal_part = value - integer_part;
|
1072
|
-
|
1073
|
-
// Convert the integer part starting from the back. Always generate
|
1074
|
-
// at least one digit.
|
1075
|
-
int integer_pos = kBufferSize - 2;
|
1076
|
-
do {
|
1077
|
-
integer_buffer[integer_pos--] =
|
1078
|
-
chars[static_cast<int>(modulo(integer_part, radix))];
|
1079
|
-
integer_part /= radix;
|
1080
|
-
} while (integer_part >= 1.0);
|
1081
|
-
// Sanity check.
|
1082
|
-
ASSERT(integer_pos > 0);
|
1083
|
-
// Add sign if needed.
|
1084
|
-
if (is_negative) integer_buffer[integer_pos--] = '-';
|
1085
|
-
|
1086
|
-
// Convert the decimal part. Repeatedly multiply by the radix to
|
1087
|
-
// generate the next char. Never generate more than kBufferSize - 1
|
1088
|
-
// chars.
|
1089
|
-
//
|
1090
|
-
// TODO(1093998): We will often generate a full decimal_buffer of
|
1091
|
-
// chars because hitting zero will often not happen. The right
|
1092
|
-
// solution would be to continue until the string representation can
|
1093
|
-
// be read back and yield the original value. To implement this
|
1094
|
-
// efficiently, we probably have to modify dtoa.
|
1095
|
-
int decimal_pos = 0;
|
1096
|
-
while ((decimal_part > 0.0) && (decimal_pos < kBufferSize - 1)) {
|
1097
|
-
decimal_part *= radix;
|
1098
|
-
decimal_buffer[decimal_pos++] =
|
1099
|
-
chars[static_cast<int>(floor(decimal_part))];
|
1100
|
-
decimal_part -= floor(decimal_part);
|
1101
|
-
}
|
1102
|
-
decimal_buffer[decimal_pos] = '\0';
|
1103
|
-
|
1104
|
-
// Compute the result size.
|
1105
|
-
int integer_part_size = kBufferSize - 2 - integer_pos;
|
1106
|
-
// Make room for zero termination.
|
1107
|
-
unsigned result_size = integer_part_size + decimal_pos;
|
1108
|
-
// If the number has a decimal part, leave room for the period.
|
1109
|
-
if (decimal_pos > 0) result_size++;
|
1110
|
-
// Allocate result and fill in the parts.
|
1111
|
-
StringBuilder builder(result_size + 1);
|
1112
|
-
builder.AddSubstring(integer_buffer + integer_pos + 1, integer_part_size);
|
1113
|
-
if (decimal_pos > 0) builder.AddCharacter('.');
|
1114
|
-
builder.AddSubstring(decimal_buffer, decimal_pos);
|
1115
|
-
return builder.Finalize();
|
1116
|
-
}
|
1117
|
-
|
1118
|
-
|
1119
|
-
} } // namespace v8::internal
|