therubyracer 0.6.3 → 0.7.0.pre
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/Rakefile +10 -9
- data/ext/v8/callbacks.cpp +15 -8
- data/ext/v8/converters.cpp +7 -8
- data/ext/v8/converters.h +0 -2
- data/ext/v8/extconf.rb +2 -0
- data/ext/v8/rr.cpp +169 -0
- data/ext/v8/rr.h +34 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/AUTHORS +8 -1
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/ChangeLog +198 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/LICENSE +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/SConstruct +152 -38
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/include/v8-debug.h +52 -4
- data/ext/v8/upstream/2.1.10/include/v8-profiler.h +176 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/include/v8.h +227 -48
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/SConscript +60 -10
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/accessors.cc +5 -39
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/accessors.h +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/allocation.cc +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/allocation.h +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/api.cc +477 -57
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/api.h +8 -4
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/apinatives.js +1 -1
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/apiutils.h +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arguments.h +5 -6
- data/ext/v8/upstream/{2.0.6/src/arm/assembler-thumb2-inl.h → 2.1.10/src/arm/assembler-arm-inl.h} +42 -27
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/assembler-arm.cc +430 -216
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/assembler-arm.h +199 -110
- data/ext/v8/upstream/{2.0.6/src/arm/assembler-arm-inl.h → 2.1.10/src/arm/assembler-thumb2-inl.h} +4 -18
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/assembler-thumb2.cc +142 -85
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/assembler-thumb2.h +18 -9
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/builtins-arm.cc +127 -87
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/codegen-arm-inl.h +3 -5
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/codegen-arm.cc +4634 -1427
- data/ext/v8/upstream/2.1.10/src/arm/codegen-arm.h +946 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/constants-arm.cc +21 -3
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/constants-arm.h +39 -13
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/cpu-arm.cc +9 -3
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/debug-arm.cc +34 -8
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/disasm-arm.cc +262 -117
- data/ext/v8/upstream/2.1.10/src/arm/fast-codegen-arm.cc +238 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/frames-arm.cc +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/frames-arm.h +0 -0
- data/ext/v8/upstream/{2.0.6/src/arm/fast-codegen-arm.cc → 2.1.10/src/arm/full-codegen-arm.cc} +453 -283
- data/ext/v8/upstream/2.1.10/src/arm/ic-arm.cc +1833 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/jump-target-arm.cc +3 -29
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/macro-assembler-arm.cc +564 -104
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/macro-assembler-arm.h +255 -46
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/regexp-macro-assembler-arm.cc +78 -104
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/regexp-macro-assembler-arm.h +6 -22
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/register-allocator-arm-inl.h +0 -3
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/register-allocator-arm.cc +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/register-allocator-arm.h +2 -1
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/simulator-arm.cc +557 -180
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/simulator-arm.h +52 -4
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/arm/stub-cache-arm.cc +904 -240
- data/ext/v8/upstream/2.1.10/src/arm/virtual-frame-arm.cc +668 -0
- data/ext/v8/upstream/2.1.10/src/arm/virtual-frame-arm.h +503 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/array.js +82 -109
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/assembler.cc +49 -13
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/assembler.h +27 -5
- data/ext/v8/upstream/2.1.10/src/ast.cc +1138 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ast.h +354 -53
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/bootstrapper.cc +609 -501
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/bootstrapper.h +27 -8
- data/ext/v8/upstream/2.1.10/src/builtins.cc +1512 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/builtins.h +41 -25
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/bytecodes-irregexp.h +0 -0
- data/ext/v8/upstream/2.1.10/src/cached-powers.h +119 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/char-predicates-inl.h +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/char-predicates.h +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/checks.cc +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/checks.h +25 -1
- data/ext/v8/upstream/2.1.10/src/circular-queue-inl.h +101 -0
- data/ext/v8/upstream/2.1.10/src/circular-queue.cc +121 -0
- data/ext/v8/upstream/2.1.10/src/circular-queue.h +129 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/code-stubs.cc +23 -8
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/code-stubs.h +16 -4
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/code.h +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/codegen-inl.h +6 -34
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/codegen.cc +73 -92
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/codegen.h +164 -68
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/compilation-cache.cc +117 -73
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/compilation-cache.h +18 -17
- data/ext/v8/upstream/2.1.10/src/compiler.cc +623 -0
- data/ext/v8/upstream/2.1.10/src/compiler.h +299 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/contexts.cc +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/contexts.h +8 -11
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/conversions-inl.h +28 -13
- data/ext/v8/upstream/2.1.10/src/conversions.cc +1105 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/conversions.h +9 -4
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/counters.cc +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/counters.h +1 -1
- data/ext/v8/upstream/2.1.10/src/cpu-profiler-inl.h +99 -0
- data/ext/v8/upstream/2.1.10/src/cpu-profiler.cc +494 -0
- data/ext/v8/upstream/2.1.10/src/cpu-profiler.h +277 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/cpu.h +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/d8-debug.cc +15 -4
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/d8-debug.h +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/d8-posix.cc +18 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/d8-readline.cc +2 -2
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/d8-windows.cc +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/d8.cc +10 -6
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/d8.h +2 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/d8.js +43 -38
- data/ext/v8/upstream/2.1.10/src/data-flow.cc +755 -0
- data/ext/v8/upstream/2.1.10/src/data-flow.h +278 -0
- data/ext/v8/upstream/{2.0.6/src/date-delay.js → 2.1.10/src/date.js} +100 -110
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/dateparser-inl.h +11 -2
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/dateparser.cc +24 -26
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/dateparser.h +8 -4
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/debug-agent.cc +3 -1
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/debug-agent.h +0 -0
- data/ext/v8/upstream/{2.0.6/src/debug-delay.js → 2.1.10/src/debug-debugger.js} +111 -15
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/debug.cc +156 -96
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/debug.h +53 -5
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/disasm.h +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/disassembler.cc +2 -8
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/disassembler.h +0 -0
- data/ext/v8/upstream/2.1.10/src/diy-fp.cc +58 -0
- data/ext/v8/upstream/2.1.10/src/diy-fp.h +117 -0
- data/ext/v8/upstream/2.1.10/src/double.h +169 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/dtoa-config.c +4 -3
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/execution.cc +22 -22
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/execution.h +17 -4
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/factory.cc +70 -46
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/factory.h +27 -17
- data/ext/v8/upstream/2.1.10/src/fast-codegen.cc +746 -0
- data/ext/v8/upstream/2.1.10/src/fast-codegen.h +161 -0
- data/ext/v8/upstream/2.1.10/src/fast-dtoa.cc +512 -0
- data/ext/v8/upstream/2.1.10/src/fast-dtoa.h +59 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/flag-definitions.h +32 -11
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/flags.cc +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/flags.h +0 -0
- data/ext/v8/upstream/2.1.10/src/flow-graph.cc +763 -0
- data/ext/v8/upstream/2.1.10/src/flow-graph.h +180 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/frame-element.cc +1 -4
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/frame-element.h +49 -11
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/frames-inl.h +2 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/frames.cc +91 -17
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/frames.h +24 -2
- data/ext/v8/upstream/{2.0.6/src/fast-codegen.cc → 2.1.10/src/full-codegen.cc} +549 -198
- data/ext/v8/upstream/{2.0.6/src/fast-codegen.h → 2.1.10/src/full-codegen.h} +109 -29
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/func-name-inferrer.cc +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/func-name-inferrer.h +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/global-handles.cc +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/global-handles.h +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/globals.h +67 -43
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/handles-inl.h +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/handles.cc +124 -129
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/handles.h +33 -15
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/hashmap.cc +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/hashmap.h +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/heap-inl.h +56 -12
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/heap-profiler.cc +2 -2
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/heap-profiler.h +2 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/heap.cc +413 -221
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/heap.h +192 -67
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/assembler-ia32-inl.h +6 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/assembler-ia32.cc +187 -32
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/assembler-ia32.h +31 -4
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/builtins-ia32.cc +160 -133
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/codegen-ia32-inl.h +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/codegen-ia32.cc +5533 -2177
- data/ext/v8/upstream/{2.0.6/src/x64/codegen-x64.h → 2.1.10/src/ia32/codegen-ia32.h} +453 -134
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/cpu-ia32.cc +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/debug-ia32.cc +63 -8
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/disasm-ia32.cc +99 -16
- data/ext/v8/upstream/2.1.10/src/ia32/fast-codegen-ia32.cc +950 -0
- data/ext/v8/upstream/2.1.10/src/ia32/fast-codegen-ia32.h +155 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/frames-ia32.cc +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/frames-ia32.h +0 -0
- data/ext/v8/upstream/{2.0.6/src/ia32/fast-codegen-ia32.cc → 2.1.10/src/ia32/full-codegen-ia32.cc} +454 -253
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/ic-ia32.cc +545 -390
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/jump-target-ia32.cc +1 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/macro-assembler-ia32.cc +330 -139
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/macro-assembler-ia32.h +96 -30
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/regexp-macro-assembler-ia32.cc +73 -89
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/regexp-macro-assembler-ia32.h +6 -21
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/register-allocator-ia32-inl.h +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/register-allocator-ia32.cc +59 -5
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/register-allocator-ia32.h +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/simulator-ia32.cc +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/simulator-ia32.h +2 -2
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/stub-cache-ia32.cc +745 -303
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/virtual-frame-ia32.cc +278 -71
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ia32/virtual-frame-ia32.h +78 -22
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ic-inl.h +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ic.cc +172 -89
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/ic.h +51 -20
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/interpreter-irregexp.cc +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/interpreter-irregexp.h +0 -0
- data/ext/v8/upstream/{2.0.6/src/json-delay.js → 2.1.10/src/json.js} +26 -12
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/jsregexp.cc +151 -118
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/jsregexp.h +31 -7
- data/ext/v8/upstream/2.1.10/src/jump-target-heavy-inl.h +51 -0
- data/ext/v8/upstream/{2.0.6/src/jump-target.cc → 2.1.10/src/jump-target-heavy.cc} +164 -184
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/jump-target-inl.h +8 -9
- data/ext/v8/upstream/{2.0.6/src/usage-analyzer.h → 2.1.10/src/jump-target-light-inl.h} +9 -7
- data/ext/v8/upstream/2.1.10/src/jump-target-light.cc +86 -0
- data/ext/v8/upstream/2.1.10/src/jump-target.cc +155 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/jump-target.h +6 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/list-inl.h +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/list.h +2 -1
- data/ext/v8/upstream/2.1.10/src/liveedit-debugger.js +944 -0
- data/ext/v8/upstream/2.1.10/src/liveedit.cc +1468 -0
- data/ext/v8/upstream/2.1.10/src/liveedit.h +170 -0
- data/ext/v8/upstream/2.1.10/src/log-inl.h +59 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/log-utils.cc +3 -9
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/log-utils.h +1 -4
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/log.cc +198 -95
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/log.h +50 -49
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/macro-assembler.h +9 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/macros.py +30 -11
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/mark-compact.cc +464 -152
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/mark-compact.h +41 -20
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/math.js +9 -8
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/memory.h +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/messages.cc +1 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/messages.h +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/messages.js +46 -9
- data/ext/v8/upstream/2.1.10/src/mips/assembler-mips-inl.h +215 -0
- data/ext/v8/upstream/2.1.10/src/mips/assembler-mips.cc +1208 -0
- data/ext/v8/upstream/2.1.10/src/mips/assembler-mips.h +665 -0
- data/ext/v8/upstream/2.1.10/src/mips/builtins-mips.cc +202 -0
- data/ext/v8/upstream/2.1.10/src/mips/codegen-mips-inl.h +70 -0
- data/ext/v8/upstream/2.1.10/src/mips/codegen-mips.cc +1428 -0
- data/ext/v8/upstream/{2.0.6/src/arm/codegen-arm.h → 2.1.10/src/mips/codegen-mips.h} +103 -205
- data/ext/v8/upstream/2.1.10/src/mips/constants-mips.cc +323 -0
- data/ext/v8/upstream/2.1.10/src/mips/constants-mips.h +525 -0
- data/ext/v8/upstream/2.1.10/src/mips/cpu-mips.cc +69 -0
- data/ext/v8/upstream/2.1.10/src/mips/debug-mips.cc +128 -0
- data/ext/v8/upstream/2.1.10/src/mips/disasm-mips.cc +784 -0
- data/ext/v8/upstream/2.1.10/src/mips/fast-codegen-mips.cc +74 -0
- data/ext/v8/upstream/2.1.10/src/mips/frames-mips.cc +99 -0
- data/ext/v8/upstream/2.1.10/src/mips/frames-mips.h +164 -0
- data/ext/v8/upstream/2.1.10/src/mips/full-codegen-mips.cc +273 -0
- data/ext/v8/upstream/2.1.10/src/mips/ic-mips.cc +217 -0
- data/ext/v8/upstream/2.1.10/src/mips/jump-target-mips.cc +172 -0
- data/ext/v8/upstream/2.1.10/src/mips/macro-assembler-mips.cc +1323 -0
- data/ext/v8/upstream/2.1.10/src/mips/macro-assembler-mips.h +461 -0
- data/ext/v8/upstream/2.1.10/src/mips/register-allocator-mips-inl.h +137 -0
- data/ext/v8/upstream/2.1.10/src/mips/register-allocator-mips.cc +60 -0
- data/ext/v8/upstream/2.1.10/src/mips/register-allocator-mips.h +46 -0
- data/ext/v8/upstream/2.1.10/src/mips/simulator-mips.cc +1648 -0
- data/ext/v8/upstream/2.1.10/src/mips/simulator-mips.h +311 -0
- data/ext/v8/upstream/2.1.10/src/mips/stub-cache-mips.cc +400 -0
- data/ext/v8/upstream/2.1.10/src/mips/virtual-frame-mips.cc +316 -0
- data/ext/v8/upstream/{2.0.6/src/arm/virtual-frame-arm.h → 2.1.10/src/mips/virtual-frame-mips.h} +87 -71
- data/ext/v8/upstream/{2.0.6/src/mirror-delay.js → 2.1.10/src/mirror-debugger.js} +51 -45
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/mksnapshot.cc +97 -10
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/natives.h +6 -6
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/objects-debug.cc +47 -5
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/objects-inl.h +154 -38
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/objects.cc +528 -280
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/objects.h +302 -95
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/oprofile-agent.cc +25 -33
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/oprofile-agent.h +9 -1
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/parser.cc +444 -72
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/parser.h +4 -2
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/platform-freebsd.cc +32 -13
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/platform-linux.cc +59 -25
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/platform-macos.cc +30 -13
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/platform-nullos.cc +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/platform-openbsd.cc +21 -2
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/platform-posix.cc +0 -18
- data/ext/v8/upstream/2.1.10/src/platform-solaris.cc +607 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/platform-win32.cc +16 -17
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/platform.h +25 -8
- data/ext/v8/upstream/2.1.10/src/powers-ten.h +2461 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/prettyprinter.cc +49 -29
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/prettyprinter.h +3 -1
- data/ext/v8/upstream/2.1.10/src/profile-generator-inl.h +124 -0
- data/ext/v8/upstream/2.1.10/src/profile-generator.cc +583 -0
- data/ext/v8/upstream/2.1.10/src/profile-generator.h +364 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/property.cc +1 -1
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/property.h +12 -24
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/regexp-macro-assembler-irregexp-inl.h +2 -2
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/regexp-macro-assembler-irregexp.cc +2 -2
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/regexp-macro-assembler-irregexp.h +2 -2
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/regexp-macro-assembler-tracer.cc +2 -2
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/regexp-macro-assembler-tracer.h +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/regexp-macro-assembler.cc +33 -10
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/regexp-macro-assembler.h +12 -4
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/regexp-stack.cc +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/regexp-stack.h +0 -0
- data/ext/v8/upstream/{2.0.6/src/regexp-delay.js → 2.1.10/src/regexp.js} +180 -58
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/register-allocator-inl.h +68 -1
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/register-allocator.cc +5 -2
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/register-allocator.h +42 -17
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/rewriter.cc +110 -4
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/rewriter.h +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/runtime.cc +2733 -623
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/runtime.h +43 -20
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/runtime.js +46 -35
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/scanner.cc +278 -36
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/scanner.h +97 -26
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/scopeinfo.cc +3 -3
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/scopeinfo.h +1 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/scopes.cc +11 -12
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/scopes.h +0 -1
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/serialize.cc +298 -175
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/serialize.h +184 -40
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/shell.h +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/simulator.h +2 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/smart-pointer.h +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/snapshot-common.cc +16 -31
- data/ext/v8/upstream/2.1.10/src/snapshot-empty.cc +50 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/snapshot.h +13 -1
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/spaces-inl.h +35 -27
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/spaces.cc +256 -42
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/spaces.h +136 -42
- data/ext/v8/upstream/{2.0.6/src/zone-inl.h → 2.1.10/src/splay-tree-inl.h} +102 -89
- data/ext/v8/upstream/2.1.10/src/splay-tree.h +203 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/string-stream.cc +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/string-stream.h +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/string.js +260 -149
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/stub-cache.cc +195 -69
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/stub-cache.h +127 -12
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/third_party/dtoa/COPYING +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/third_party/dtoa/dtoa.c +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/third_party/valgrind/valgrind.h +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/token.cc +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/token.h +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/top.cc +26 -31
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/top.h +3 -4
- data/ext/v8/upstream/2.1.10/src/type-info.cc +53 -0
- data/ext/v8/upstream/2.1.10/src/type-info.h +244 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/unicode-inl.h +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/unicode.cc +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/unicode.h +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/uri.js +6 -6
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/utils.cc +0 -37
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/utils.h +121 -50
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/v8-counters.cc +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/v8-counters.h +130 -98
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/v8.cc +42 -11
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/v8.h +4 -2
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/v8natives.js +202 -37
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/v8threads.cc +11 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/v8threads.h +15 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/variables.cc +7 -51
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/variables.h +5 -35
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/version.cc +3 -3
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/version.h +0 -0
- data/ext/v8/upstream/2.1.10/src/virtual-frame-heavy-inl.h +152 -0
- data/ext/v8/upstream/{2.0.6/src/virtual-frame.cc → 2.1.10/src/virtual-frame-heavy.cc} +107 -176
- data/ext/v8/upstream/2.1.10/src/virtual-frame-inl.h +39 -0
- data/ext/v8/upstream/2.1.10/src/virtual-frame-light-inl.h +69 -0
- data/ext/v8/upstream/2.1.10/src/virtual-frame-light.cc +49 -0
- data/ext/v8/upstream/2.1.10/src/virtual-frame.cc +49 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/virtual-frame.h +2 -0
- data/ext/v8/upstream/{2.0.6/src/log-inl.h → 2.1.10/src/vm-state-inl.h} +28 -20
- data/ext/v8/upstream/{2.0.6/src/snapshot-empty.cc → 2.1.10/src/vm-state.cc} +5 -6
- data/ext/v8/upstream/2.1.10/src/vm-state.h +75 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/assembler-x64-inl.h +11 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/assembler-x64.cc +285 -93
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/assembler-x64.h +81 -78
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/builtins-x64.cc +130 -87
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/codegen-x64-inl.h +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/codegen-x64.cc +4520 -1317
- data/ext/v8/upstream/{2.0.6/src/ia32/codegen-ia32.h → 2.1.10/src/x64/codegen-x64.h} +362 -141
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/cpu-x64.cc +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/debug-x64.cc +20 -4
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/disasm-x64.cc +121 -44
- data/ext/v8/upstream/2.1.10/src/x64/fast-codegen-x64.cc +246 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/frames-x64.cc +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/frames-x64.h +0 -0
- data/ext/v8/upstream/{2.0.6/src/x64/fast-codegen-x64.cc → 2.1.10/src/x64/full-codegen-x64.cc} +404 -231
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/ic-x64.cc +346 -117
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/jump-target-x64.cc +1 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/macro-assembler-x64.cc +537 -181
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/macro-assembler-x64.h +140 -34
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/regexp-macro-assembler-x64.cc +74 -96
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/regexp-macro-assembler-x64.h +8 -25
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/register-allocator-x64-inl.h +1 -1
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/register-allocator-x64.cc +3 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/register-allocator-x64.h +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/simulator-x64.cc +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/simulator-x64.h +2 -2
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/stub-cache-x64.cc +785 -288
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/virtual-frame-x64.cc +128 -52
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/x64/virtual-frame-x64.h +40 -19
- data/ext/v8/upstream/2.1.10/src/zone-inl.h +82 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/zone.cc +1 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/src/zone.h +6 -90
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/codemap.js +12 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/consarray.js +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/csvparser.js +22 -37
- data/ext/v8/upstream/2.1.10/tools/generate-ten-powers.scm +286 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/gyp/v8.gyp +86 -24
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/js2c.py +22 -22
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/jsmin.py +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/linux-tick-processor +10 -1
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/linux-tick-processor.py +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/logreader.js +34 -16
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/mac-nm +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/mac-tick-processor +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/oprofile/annotate +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/oprofile/common +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/oprofile/dump +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/oprofile/report +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/oprofile/reset +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/oprofile/run +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/oprofile/shutdown +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/oprofile/start +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/presubmit.py +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/process-heap-prof.py +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/profile.js +70 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/profile_view.js +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/run-valgrind.py +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/splaytree.js +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/splaytree.py +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/stats-viewer.py +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/test.py +7 -7
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/tickprocessor-driver.js +7 -1
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/tickprocessor.js +140 -9
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/tickprocessor.py +40 -4
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/utils.py +6 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/README.txt +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/arm.vsprops +1 -1
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/common.vsprops +1 -2
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/d8.vcproj +0 -6
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/d8_arm.vcproj +193 -199
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/d8_x64.vcproj +16 -8
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/d8js2c.cmd +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/debug.vsprops +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/ia32.vsprops +5 -1
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/js2c.cmd +1 -1
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/release.vsprops +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8.sln +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8.vcproj +11 -7
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_arm.sln +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_arm.vcproj +227 -223
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_base.vcproj +137 -5
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_base_arm.vcproj +116 -4
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_base_x64.vcproj +125 -4
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_cctest.vcproj +12 -6
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_cctest_arm.vcproj +12 -6
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_cctest_x64.vcproj +11 -11
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_mksnapshot.vcproj +0 -6
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_mksnapshot_x64.vcproj +0 -6
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_process_sample.vcproj +0 -6
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_process_sample_arm.vcproj +145 -151
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_process_sample_x64.vcproj +16 -6
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_shell_sample.vcproj +0 -6
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_shell_sample_arm.vcproj +145 -151
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_shell_sample_x64.vcproj +16 -8
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_snapshot.vcproj +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_snapshot_cc.vcproj +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_snapshot_cc_x64.vcproj +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_snapshot_x64.vcproj +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_x64.sln +0 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/v8_x64.vcproj +11 -7
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/visual_studio/x64.vsprops +5 -1
- data/ext/v8/upstream/2.1.10/tools/windows-tick-processor.bat +29 -0
- data/ext/v8/upstream/{2.0.6 → 2.1.10}/tools/windows-tick-processor.py +0 -0
- data/ext/v8/upstream/Makefile +8 -2
- data/ext/v8/v8.cpp +21 -73
- data/ext/v8/v8_array.cpp +56 -0
- data/ext/v8/v8_array.h +8 -0
- data/ext/v8/v8_callbacks.cpp +121 -0
- data/ext/v8/v8_callbacks.h +8 -0
- data/ext/v8/v8_cxt.cpp +74 -77
- data/ext/v8/v8_cxt.h +2 -9
- data/ext/v8/v8_date.cpp +26 -0
- data/ext/v8/v8_date.h +6 -0
- data/ext/v8/v8_exception.cpp +55 -0
- data/ext/v8/v8_exception.h +6 -0
- data/ext/v8/v8_external.cpp +50 -0
- data/ext/v8/v8_external.h +8 -0
- data/ext/v8/v8_func.cpp +76 -18
- data/ext/v8/v8_func.h +5 -4
- data/ext/v8/v8_msg.cpp +55 -46
- data/ext/v8/v8_msg.h +3 -11
- data/ext/v8/v8_obj.cpp +67 -36
- data/ext/v8/v8_obj.h +6 -8
- data/ext/v8/v8_ref.cpp +25 -9
- data/ext/v8/v8_ref.h +3 -5
- data/ext/v8/v8_script.cpp +17 -10
- data/ext/v8/v8_script.h +3 -3
- data/ext/v8/v8_str.cpp +34 -6
- data/ext/v8/v8_str.h +4 -2
- data/ext/v8/v8_template.cpp +195 -33
- data/ext/v8/v8_template.h +4 -5
- data/ext/v8/v8_try_catch.cpp +99 -0
- data/ext/v8/v8_try_catch.h +5 -0
- data/ext/v8/v8_value.cpp +164 -0
- data/ext/v8/v8_value.h +10 -0
- data/lib/v8.rb +3 -1
- data/lib/v8/access.rb +60 -0
- data/lib/v8/array.rb +15 -0
- data/lib/v8/callbacks.rb +88 -0
- data/lib/v8/cli.rb +1 -1
- data/lib/v8/context.rb +55 -66
- data/lib/v8/function.rb +20 -2
- data/lib/v8/object.rb +14 -12
- data/lib/v8/ruby_error.rb +3 -0
- data/lib/v8/to.rb +59 -7
- data/spec/ext/cxt_spec.rb +2 -15
- data/spec/ext/func_spec.rb +17 -10
- data/spec/ext/try_catch_spec.rb +32 -0
- data/spec/foo.rb +17 -0
- data/spec/redjs/jsapi_spec.rb +173 -96
- data/spec/spec_helper.rb +7 -0
- data/spec/v8/to_spec.rb +0 -1
- data/therubyracer.gemspec +6 -6
- metadata +493 -386
- data/ext/v8/upstream/2.0.6/src/arm/ic-arm.cc +0 -849
- data/ext/v8/upstream/2.0.6/src/arm/virtual-frame-arm.cc +0 -412
- data/ext/v8/upstream/2.0.6/src/ast.cc +0 -512
- data/ext/v8/upstream/2.0.6/src/builtins.cc +0 -851
- data/ext/v8/upstream/2.0.6/src/compiler.cc +0 -1132
- data/ext/v8/upstream/2.0.6/src/compiler.h +0 -107
- data/ext/v8/upstream/2.0.6/src/conversions.cc +0 -709
- data/ext/v8/upstream/2.0.6/src/usage-analyzer.cc +0 -426
- data/ext/v8/upstream/2.0.6/tools/windows-tick-processor.bat +0 -5
- data/ext/v8/upstream/no-strict-aliasing.patch +0 -13
- data/ext/v8/v8_standalone.cpp +0 -69
- data/ext/v8/v8_standalone.h +0 -31
- data/spec/ext/obj_spec.rb +0 -13
@@ -0,0 +1,161 @@
|
|
1
|
+
// Copyright 2010 the V8 project authors. All rights reserved.
|
2
|
+
// Redistribution and use in source and binary forms, with or without
|
3
|
+
// modification, are permitted provided that the following conditions are
|
4
|
+
// met:
|
5
|
+
//
|
6
|
+
// * Redistributions of source code must retain the above copyright
|
7
|
+
// notice, this list of conditions and the following disclaimer.
|
8
|
+
// * Redistributions in binary form must reproduce the above
|
9
|
+
// copyright notice, this list of conditions and the following
|
10
|
+
// disclaimer in the documentation and/or other materials provided
|
11
|
+
// with the distribution.
|
12
|
+
// * Neither the name of Google Inc. nor the names of its
|
13
|
+
// contributors may be used to endorse or promote products derived
|
14
|
+
// from this software without specific prior written permission.
|
15
|
+
//
|
16
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
17
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
18
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
19
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
20
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
21
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
22
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
23
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
24
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
25
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
26
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27
|
+
|
28
|
+
#ifndef V8_FAST_CODEGEN_H_
|
29
|
+
#define V8_FAST_CODEGEN_H_
|
30
|
+
|
31
|
+
#if V8_TARGET_ARCH_IA32
|
32
|
+
#include "ia32/fast-codegen-ia32.h"
|
33
|
+
#else
|
34
|
+
|
35
|
+
#include "v8.h"
|
36
|
+
|
37
|
+
#include "ast.h"
|
38
|
+
#include "compiler.h"
|
39
|
+
#include "list.h"
|
40
|
+
|
41
|
+
namespace v8 {
|
42
|
+
namespace internal {
|
43
|
+
|
44
|
+
class FastCodeGenSyntaxChecker: public AstVisitor {
|
45
|
+
public:
|
46
|
+
explicit FastCodeGenSyntaxChecker()
|
47
|
+
: info_(NULL), has_supported_syntax_(true) {
|
48
|
+
}
|
49
|
+
|
50
|
+
void Check(CompilationInfo* info);
|
51
|
+
|
52
|
+
CompilationInfo* info() { return info_; }
|
53
|
+
bool has_supported_syntax() { return has_supported_syntax_; }
|
54
|
+
|
55
|
+
private:
|
56
|
+
void VisitDeclarations(ZoneList<Declaration*>* decls);
|
57
|
+
void VisitStatements(ZoneList<Statement*>* stmts);
|
58
|
+
|
59
|
+
// AST node visit functions.
|
60
|
+
#define DECLARE_VISIT(type) virtual void Visit##type(type* node);
|
61
|
+
AST_NODE_LIST(DECLARE_VISIT)
|
62
|
+
#undef DECLARE_VISIT
|
63
|
+
|
64
|
+
CompilationInfo* info_;
|
65
|
+
bool has_supported_syntax_;
|
66
|
+
|
67
|
+
DISALLOW_COPY_AND_ASSIGN(FastCodeGenSyntaxChecker);
|
68
|
+
};
|
69
|
+
|
70
|
+
|
71
|
+
class FastCodeGenerator: public AstVisitor {
|
72
|
+
public:
|
73
|
+
explicit FastCodeGenerator(MacroAssembler* masm)
|
74
|
+
: masm_(masm), info_(NULL), destination_(no_reg), smi_bits_(0) {
|
75
|
+
}
|
76
|
+
|
77
|
+
static Handle<Code> MakeCode(CompilationInfo* info);
|
78
|
+
|
79
|
+
void Generate(CompilationInfo* compilation_info);
|
80
|
+
|
81
|
+
private:
|
82
|
+
MacroAssembler* masm() { return masm_; }
|
83
|
+
CompilationInfo* info() { return info_; }
|
84
|
+
|
85
|
+
Register destination() { return destination_; }
|
86
|
+
void set_destination(Register reg) { destination_ = reg; }
|
87
|
+
|
88
|
+
FunctionLiteral* function() { return info_->function(); }
|
89
|
+
Scope* scope() { return info_->scope(); }
|
90
|
+
|
91
|
+
// Platform-specific fixed registers, all guaranteed distinct.
|
92
|
+
Register accumulator0();
|
93
|
+
Register accumulator1();
|
94
|
+
Register scratch0();
|
95
|
+
Register scratch1();
|
96
|
+
Register scratch2();
|
97
|
+
Register receiver_reg();
|
98
|
+
Register context_reg();
|
99
|
+
|
100
|
+
Register other_accumulator(Register reg) {
|
101
|
+
ASSERT(reg.is(accumulator0()) || reg.is(accumulator1()));
|
102
|
+
return (reg.is(accumulator0())) ? accumulator1() : accumulator0();
|
103
|
+
}
|
104
|
+
|
105
|
+
// Flags are true if the respective register is statically known to hold a
|
106
|
+
// smi. We do not track every register, only the accumulator registers.
|
107
|
+
bool is_smi(Register reg) {
|
108
|
+
ASSERT(!reg.is(no_reg));
|
109
|
+
return (smi_bits_ & reg.bit()) != 0;
|
110
|
+
}
|
111
|
+
void set_as_smi(Register reg) {
|
112
|
+
ASSERT(!reg.is(no_reg));
|
113
|
+
smi_bits_ = smi_bits_ | reg.bit();
|
114
|
+
}
|
115
|
+
void clear_as_smi(Register reg) {
|
116
|
+
ASSERT(!reg.is(no_reg));
|
117
|
+
smi_bits_ = smi_bits_ & ~reg.bit();
|
118
|
+
}
|
119
|
+
|
120
|
+
// AST node visit functions.
|
121
|
+
#define DECLARE_VISIT(type) virtual void Visit##type(type* node);
|
122
|
+
AST_NODE_LIST(DECLARE_VISIT)
|
123
|
+
#undef DECLARE_VISIT
|
124
|
+
|
125
|
+
// Emit code to load the receiver from the stack into receiver_reg.
|
126
|
+
void EmitLoadReceiver();
|
127
|
+
|
128
|
+
// Emit code to load a global variable directly from a global property
|
129
|
+
// cell into the destination register.
|
130
|
+
void EmitGlobalVariableLoad(Handle<Object> cell);
|
131
|
+
|
132
|
+
// Emit a store to an own property of this. The stored value is expected
|
133
|
+
// in accumulator0 and the receiver in receiver_reg. The receiver
|
134
|
+
// register is preserved and the result (the stored value) is left in the
|
135
|
+
// destination register.
|
136
|
+
void EmitThisPropertyStore(Handle<String> name);
|
137
|
+
|
138
|
+
// Emit a load from an own property of this. The receiver is expected in
|
139
|
+
// receiver_reg. The receiver register is preserved and the result is
|
140
|
+
// left in the destination register.
|
141
|
+
void EmitThisPropertyLoad(Handle<String> name);
|
142
|
+
|
143
|
+
// Emit a bitwise or operation. The left operand is in accumulator1 and
|
144
|
+
// the right is in accumulator0. The result should be left in the
|
145
|
+
// destination register.
|
146
|
+
void EmitBitOr();
|
147
|
+
|
148
|
+
MacroAssembler* masm_;
|
149
|
+
CompilationInfo* info_;
|
150
|
+
Register destination_;
|
151
|
+
uint32_t smi_bits_;
|
152
|
+
|
153
|
+
DISALLOW_COPY_AND_ASSIGN(FastCodeGenerator);
|
154
|
+
};
|
155
|
+
|
156
|
+
|
157
|
+
} } // namespace v8::internal
|
158
|
+
|
159
|
+
#endif // V8_TARGET_ARCH_IA32
|
160
|
+
|
161
|
+
#endif // V8_FAST_CODEGEN_H_
|
@@ -0,0 +1,512 @@
|
|
1
|
+
// Copyright 2010 the V8 project authors. All rights reserved.
|
2
|
+
// Redistribution and use in source and binary forms, with or without
|
3
|
+
// modification, are permitted provided that the following conditions are
|
4
|
+
// met:
|
5
|
+
//
|
6
|
+
// * Redistributions of source code must retain the above copyright
|
7
|
+
// notice, this list of conditions and the following disclaimer.
|
8
|
+
// * Redistributions in binary form must reproduce the above
|
9
|
+
// copyright notice, this list of conditions and the following
|
10
|
+
// disclaimer in the documentation and/or other materials provided
|
11
|
+
// with the distribution.
|
12
|
+
// * Neither the name of Google Inc. nor the names of its
|
13
|
+
// contributors may be used to endorse or promote products derived
|
14
|
+
// from this software without specific prior written permission.
|
15
|
+
//
|
16
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
17
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
18
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
19
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
20
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
21
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
22
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
23
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
24
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
25
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
26
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27
|
+
|
28
|
+
#include "v8.h"
|
29
|
+
|
30
|
+
#include "fast-dtoa.h"
|
31
|
+
|
32
|
+
#include "cached-powers.h"
|
33
|
+
#include "diy-fp.h"
|
34
|
+
#include "double.h"
|
35
|
+
|
36
|
+
namespace v8 {
|
37
|
+
namespace internal {
|
38
|
+
|
39
|
+
// The minimal and maximal target exponent define the range of w's binary
|
40
|
+
// exponent, where 'w' is the result of multiplying the input by a cached power
|
41
|
+
// of ten.
|
42
|
+
//
|
43
|
+
// A different range might be chosen on a different platform, to optimize digit
|
44
|
+
// generation, but a smaller range requires more powers of ten to be cached.
|
45
|
+
static const int minimal_target_exponent = -60;
|
46
|
+
static const int maximal_target_exponent = -32;
|
47
|
+
|
48
|
+
|
49
|
+
// Adjusts the last digit of the generated number, and screens out generated
|
50
|
+
// solutions that may be inaccurate. A solution may be inaccurate if it is
|
51
|
+
// outside the safe interval, or if we ctannot prove that it is closer to the
|
52
|
+
// input than a neighboring representation of the same length.
|
53
|
+
//
|
54
|
+
// Input: * buffer containing the digits of too_high / 10^kappa
|
55
|
+
// * the buffer's length
|
56
|
+
// * distance_too_high_w == (too_high - w).f() * unit
|
57
|
+
// * unsafe_interval == (too_high - too_low).f() * unit
|
58
|
+
// * rest = (too_high - buffer * 10^kappa).f() * unit
|
59
|
+
// * ten_kappa = 10^kappa * unit
|
60
|
+
// * unit = the common multiplier
|
61
|
+
// Output: returns true if the buffer is guaranteed to contain the closest
|
62
|
+
// representable number to the input.
|
63
|
+
// Modifies the generated digits in the buffer to approach (round towards) w.
|
64
|
+
bool RoundWeed(Vector<char> buffer,
|
65
|
+
int length,
|
66
|
+
uint64_t distance_too_high_w,
|
67
|
+
uint64_t unsafe_interval,
|
68
|
+
uint64_t rest,
|
69
|
+
uint64_t ten_kappa,
|
70
|
+
uint64_t unit) {
|
71
|
+
uint64_t small_distance = distance_too_high_w - unit;
|
72
|
+
uint64_t big_distance = distance_too_high_w + unit;
|
73
|
+
// Let w_low = too_high - big_distance, and
|
74
|
+
// w_high = too_high - small_distance.
|
75
|
+
// Note: w_low < w < w_high
|
76
|
+
//
|
77
|
+
// The real w (* unit) must lie somewhere inside the interval
|
78
|
+
// ]w_low; w_low[ (often written as "(w_low; w_low)")
|
79
|
+
|
80
|
+
// Basically the buffer currently contains a number in the unsafe interval
|
81
|
+
// ]too_low; too_high[ with too_low < w < too_high
|
82
|
+
//
|
83
|
+
// too_high - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
84
|
+
// ^v 1 unit ^ ^ ^ ^
|
85
|
+
// boundary_high --------------------- . . . .
|
86
|
+
// ^v 1 unit . . . .
|
87
|
+
// - - - - - - - - - - - - - - - - - - - + - - + - - - - - - . .
|
88
|
+
// . . ^ . .
|
89
|
+
// . big_distance . . .
|
90
|
+
// . . . . rest
|
91
|
+
// small_distance . . . .
|
92
|
+
// v . . . .
|
93
|
+
// w_high - - - - - - - - - - - - - - - - - - . . . .
|
94
|
+
// ^v 1 unit . . . .
|
95
|
+
// w ---------------------------------------- . . . .
|
96
|
+
// ^v 1 unit v . . .
|
97
|
+
// w_low - - - - - - - - - - - - - - - - - - - - - . . .
|
98
|
+
// . . v
|
99
|
+
// buffer --------------------------------------------------+-------+--------
|
100
|
+
// . .
|
101
|
+
// safe_interval .
|
102
|
+
// v .
|
103
|
+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .
|
104
|
+
// ^v 1 unit .
|
105
|
+
// boundary_low ------------------------- unsafe_interval
|
106
|
+
// ^v 1 unit v
|
107
|
+
// too_low - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
108
|
+
//
|
109
|
+
//
|
110
|
+
// Note that the value of buffer could lie anywhere inside the range too_low
|
111
|
+
// to too_high.
|
112
|
+
//
|
113
|
+
// boundary_low, boundary_high and w are approximations of the real boundaries
|
114
|
+
// and v (the input number). They are guaranteed to be precise up to one unit.
|
115
|
+
// In fact the error is guaranteed to be strictly less than one unit.
|
116
|
+
//
|
117
|
+
// Anything that lies outside the unsafe interval is guaranteed not to round
|
118
|
+
// to v when read again.
|
119
|
+
// Anything that lies inside the safe interval is guaranteed to round to v
|
120
|
+
// when read again.
|
121
|
+
// If the number inside the buffer lies inside the unsafe interval but not
|
122
|
+
// inside the safe interval then we simply do not know and bail out (returning
|
123
|
+
// false).
|
124
|
+
//
|
125
|
+
// Similarly we have to take into account the imprecision of 'w' when rounding
|
126
|
+
// the buffer. If we have two potential representations we need to make sure
|
127
|
+
// that the chosen one is closer to w_low and w_high since v can be anywhere
|
128
|
+
// between them.
|
129
|
+
//
|
130
|
+
// By generating the digits of too_high we got the largest (closest to
|
131
|
+
// too_high) buffer that is still in the unsafe interval. In the case where
|
132
|
+
// w_high < buffer < too_high we try to decrement the buffer.
|
133
|
+
// This way the buffer approaches (rounds towards) w.
|
134
|
+
// There are 3 conditions that stop the decrementation process:
|
135
|
+
// 1) the buffer is already below w_high
|
136
|
+
// 2) decrementing the buffer would make it leave the unsafe interval
|
137
|
+
// 3) decrementing the buffer would yield a number below w_high and farther
|
138
|
+
// away than the current number. In other words:
|
139
|
+
// (buffer{-1} < w_high) && w_high - buffer{-1} > buffer - w_high
|
140
|
+
// Instead of using the buffer directly we use its distance to too_high.
|
141
|
+
// Conceptually rest ~= too_high - buffer
|
142
|
+
while (rest < small_distance && // Negated condition 1
|
143
|
+
unsafe_interval - rest >= ten_kappa && // Negated condition 2
|
144
|
+
(rest + ten_kappa < small_distance || // buffer{-1} > w_high
|
145
|
+
small_distance - rest >= rest + ten_kappa - small_distance)) {
|
146
|
+
buffer[length - 1]--;
|
147
|
+
rest += ten_kappa;
|
148
|
+
}
|
149
|
+
|
150
|
+
// We have approached w+ as much as possible. We now test if approaching w-
|
151
|
+
// would require changing the buffer. If yes, then we have two possible
|
152
|
+
// representations close to w, but we cannot decide which one is closer.
|
153
|
+
if (rest < big_distance &&
|
154
|
+
unsafe_interval - rest >= ten_kappa &&
|
155
|
+
(rest + ten_kappa < big_distance ||
|
156
|
+
big_distance - rest > rest + ten_kappa - big_distance)) {
|
157
|
+
return false;
|
158
|
+
}
|
159
|
+
|
160
|
+
// Weeding test.
|
161
|
+
// The safe interval is [too_low + 2 ulp; too_high - 2 ulp]
|
162
|
+
// Since too_low = too_high - unsafe_interval this is equivalent to
|
163
|
+
// [too_high - unsafe_interval + 4 ulp; too_high - 2 ulp]
|
164
|
+
// Conceptually we have: rest ~= too_high - buffer
|
165
|
+
return (2 * unit <= rest) && (rest <= unsafe_interval - 4 * unit);
|
166
|
+
}
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
static const uint32_t kTen4 = 10000;
|
171
|
+
static const uint32_t kTen5 = 100000;
|
172
|
+
static const uint32_t kTen6 = 1000000;
|
173
|
+
static const uint32_t kTen7 = 10000000;
|
174
|
+
static const uint32_t kTen8 = 100000000;
|
175
|
+
static const uint32_t kTen9 = 1000000000;
|
176
|
+
|
177
|
+
// Returns the biggest power of ten that is less than or equal than the given
|
178
|
+
// number. We furthermore receive the maximum number of bits 'number' has.
|
179
|
+
// If number_bits == 0 then 0^-1 is returned
|
180
|
+
// The number of bits must be <= 32.
|
181
|
+
// Precondition: (1 << number_bits) <= number < (1 << (number_bits + 1)).
|
182
|
+
static void BiggestPowerTen(uint32_t number,
|
183
|
+
int number_bits,
|
184
|
+
uint32_t* power,
|
185
|
+
int* exponent) {
|
186
|
+
switch (number_bits) {
|
187
|
+
case 32:
|
188
|
+
case 31:
|
189
|
+
case 30:
|
190
|
+
if (kTen9 <= number) {
|
191
|
+
*power = kTen9;
|
192
|
+
*exponent = 9;
|
193
|
+
break;
|
194
|
+
} // else fallthrough
|
195
|
+
case 29:
|
196
|
+
case 28:
|
197
|
+
case 27:
|
198
|
+
if (kTen8 <= number) {
|
199
|
+
*power = kTen8;
|
200
|
+
*exponent = 8;
|
201
|
+
break;
|
202
|
+
} // else fallthrough
|
203
|
+
case 26:
|
204
|
+
case 25:
|
205
|
+
case 24:
|
206
|
+
if (kTen7 <= number) {
|
207
|
+
*power = kTen7;
|
208
|
+
*exponent = 7;
|
209
|
+
break;
|
210
|
+
} // else fallthrough
|
211
|
+
case 23:
|
212
|
+
case 22:
|
213
|
+
case 21:
|
214
|
+
case 20:
|
215
|
+
if (kTen6 <= number) {
|
216
|
+
*power = kTen6;
|
217
|
+
*exponent = 6;
|
218
|
+
break;
|
219
|
+
} // else fallthrough
|
220
|
+
case 19:
|
221
|
+
case 18:
|
222
|
+
case 17:
|
223
|
+
if (kTen5 <= number) {
|
224
|
+
*power = kTen5;
|
225
|
+
*exponent = 5;
|
226
|
+
break;
|
227
|
+
} // else fallthrough
|
228
|
+
case 16:
|
229
|
+
case 15:
|
230
|
+
case 14:
|
231
|
+
if (kTen4 <= number) {
|
232
|
+
*power = kTen4;
|
233
|
+
*exponent = 4;
|
234
|
+
break;
|
235
|
+
} // else fallthrough
|
236
|
+
case 13:
|
237
|
+
case 12:
|
238
|
+
case 11:
|
239
|
+
case 10:
|
240
|
+
if (1000 <= number) {
|
241
|
+
*power = 1000;
|
242
|
+
*exponent = 3;
|
243
|
+
break;
|
244
|
+
} // else fallthrough
|
245
|
+
case 9:
|
246
|
+
case 8:
|
247
|
+
case 7:
|
248
|
+
if (100 <= number) {
|
249
|
+
*power = 100;
|
250
|
+
*exponent = 2;
|
251
|
+
break;
|
252
|
+
} // else fallthrough
|
253
|
+
case 6:
|
254
|
+
case 5:
|
255
|
+
case 4:
|
256
|
+
if (10 <= number) {
|
257
|
+
*power = 10;
|
258
|
+
*exponent = 1;
|
259
|
+
break;
|
260
|
+
} // else fallthrough
|
261
|
+
case 3:
|
262
|
+
case 2:
|
263
|
+
case 1:
|
264
|
+
if (1 <= number) {
|
265
|
+
*power = 1;
|
266
|
+
*exponent = 0;
|
267
|
+
break;
|
268
|
+
} // else fallthrough
|
269
|
+
case 0:
|
270
|
+
*power = 0;
|
271
|
+
*exponent = -1;
|
272
|
+
break;
|
273
|
+
default:
|
274
|
+
// Following assignments are here to silence compiler warnings.
|
275
|
+
*power = 0;
|
276
|
+
*exponent = 0;
|
277
|
+
UNREACHABLE();
|
278
|
+
}
|
279
|
+
}
|
280
|
+
|
281
|
+
|
282
|
+
// Generates the digits of input number w.
|
283
|
+
// w is a floating-point number (DiyFp), consisting of a significand and an
|
284
|
+
// exponent. Its exponent is bounded by minimal_target_exponent and
|
285
|
+
// maximal_target_exponent.
|
286
|
+
// Hence -60 <= w.e() <= -32.
|
287
|
+
//
|
288
|
+
// Returns false if it fails, in which case the generated digits in the buffer
|
289
|
+
// should not be used.
|
290
|
+
// Preconditions:
|
291
|
+
// * low, w and high are correct up to 1 ulp (unit in the last place). That
|
292
|
+
// is, their error must be less that a unit of their last digits.
|
293
|
+
// * low.e() == w.e() == high.e()
|
294
|
+
// * low < w < high, and taking into account their error: low~ <= high~
|
295
|
+
// * minimal_target_exponent <= w.e() <= maximal_target_exponent
|
296
|
+
// Postconditions: returns false if procedure fails.
|
297
|
+
// otherwise:
|
298
|
+
// * buffer is not null-terminated, but len contains the number of digits.
|
299
|
+
// * buffer contains the shortest possible decimal digit-sequence
|
300
|
+
// such that LOW < buffer * 10^kappa < HIGH, where LOW and HIGH are the
|
301
|
+
// correct values of low and high (without their error).
|
302
|
+
// * if more than one decimal representation gives the minimal number of
|
303
|
+
// decimal digits then the one closest to W (where W is the correct value
|
304
|
+
// of w) is chosen.
|
305
|
+
// Remark: this procedure takes into account the imprecision of its input
|
306
|
+
// numbers. If the precision is not enough to guarantee all the postconditions
|
307
|
+
// then false is returned. This usually happens rarely (~0.5%).
|
308
|
+
//
|
309
|
+
// Say, for the sake of example, that
|
310
|
+
// w.e() == -48, and w.f() == 0x1234567890abcdef
|
311
|
+
// w's value can be computed by w.f() * 2^w.e()
|
312
|
+
// We can obtain w's integral digits by simply shifting w.f() by -w.e().
|
313
|
+
// -> w's integral part is 0x1234
|
314
|
+
// w's fractional part is therefore 0x567890abcdef.
|
315
|
+
// Printing w's integral part is easy (simply print 0x1234 in decimal).
|
316
|
+
// In order to print its fraction we repeatedly multiply the fraction by 10 and
|
317
|
+
// get each digit. Example the first digit after the comma would be computed by
|
318
|
+
// (0x567890abcdef * 10) >> 48. -> 3
|
319
|
+
// The whole thing becomes slightly more complicated because we want to stop
|
320
|
+
// once we have enough digits. That is, once the digits inside the buffer
|
321
|
+
// represent 'w' we can stop. Everything inside the interval low - high
|
322
|
+
// represents w. However we have to pay attention to low, high and w's
|
323
|
+
// imprecision.
|
324
|
+
bool DigitGen(DiyFp low,
|
325
|
+
DiyFp w,
|
326
|
+
DiyFp high,
|
327
|
+
Vector<char> buffer,
|
328
|
+
int* length,
|
329
|
+
int* kappa) {
|
330
|
+
ASSERT(low.e() == w.e() && w.e() == high.e());
|
331
|
+
ASSERT(low.f() + 1 <= high.f() - 1);
|
332
|
+
ASSERT(minimal_target_exponent <= w.e() && w.e() <= maximal_target_exponent);
|
333
|
+
// low, w and high are imprecise, but by less than one ulp (unit in the last
|
334
|
+
// place).
|
335
|
+
// If we remove (resp. add) 1 ulp from low (resp. high) we are certain that
|
336
|
+
// the new numbers are outside of the interval we want the final
|
337
|
+
// representation to lie in.
|
338
|
+
// Inversely adding (resp. removing) 1 ulp from low (resp. high) would yield
|
339
|
+
// numbers that are certain to lie in the interval. We will use this fact
|
340
|
+
// later on.
|
341
|
+
// We will now start by generating the digits within the uncertain
|
342
|
+
// interval. Later we will weed out representations that lie outside the safe
|
343
|
+
// interval and thus _might_ lie outside the correct interval.
|
344
|
+
uint64_t unit = 1;
|
345
|
+
DiyFp too_low = DiyFp(low.f() - unit, low.e());
|
346
|
+
DiyFp too_high = DiyFp(high.f() + unit, high.e());
|
347
|
+
// too_low and too_high are guaranteed to lie outside the interval we want the
|
348
|
+
// generated number in.
|
349
|
+
DiyFp unsafe_interval = DiyFp::Minus(too_high, too_low);
|
350
|
+
// We now cut the input number into two parts: the integral digits and the
|
351
|
+
// fractionals. We will not write any decimal separator though, but adapt
|
352
|
+
// kappa instead.
|
353
|
+
// Reminder: we are currently computing the digits (stored inside the buffer)
|
354
|
+
// such that: too_low < buffer * 10^kappa < too_high
|
355
|
+
// We use too_high for the digit_generation and stop as soon as possible.
|
356
|
+
// If we stop early we effectively round down.
|
357
|
+
DiyFp one = DiyFp(static_cast<uint64_t>(1) << -w.e(), w.e());
|
358
|
+
// Division by one is a shift.
|
359
|
+
uint32_t integrals = static_cast<uint32_t>(too_high.f() >> -one.e());
|
360
|
+
// Modulo by one is an and.
|
361
|
+
uint64_t fractionals = too_high.f() & (one.f() - 1);
|
362
|
+
uint32_t divider;
|
363
|
+
int divider_exponent;
|
364
|
+
BiggestPowerTen(integrals, DiyFp::kSignificandSize - (-one.e()),
|
365
|
+
÷r, ÷r_exponent);
|
366
|
+
*kappa = divider_exponent + 1;
|
367
|
+
*length = 0;
|
368
|
+
// Loop invariant: buffer = too_high / 10^kappa (integer division)
|
369
|
+
// The invariant holds for the first iteration: kappa has been initialized
|
370
|
+
// with the divider exponent + 1. And the divider is the biggest power of ten
|
371
|
+
// that is smaller than integrals.
|
372
|
+
while (*kappa > 0) {
|
373
|
+
int digit = integrals / divider;
|
374
|
+
buffer[*length] = '0' + digit;
|
375
|
+
(*length)++;
|
376
|
+
integrals %= divider;
|
377
|
+
(*kappa)--;
|
378
|
+
// Note that kappa now equals the exponent of the divider and that the
|
379
|
+
// invariant thus holds again.
|
380
|
+
uint64_t rest =
|
381
|
+
(static_cast<uint64_t>(integrals) << -one.e()) + fractionals;
|
382
|
+
// Invariant: too_high = buffer * 10^kappa + DiyFp(rest, one.e())
|
383
|
+
// Reminder: unsafe_interval.e() == one.e()
|
384
|
+
if (rest < unsafe_interval.f()) {
|
385
|
+
// Rounding down (by not emitting the remaining digits) yields a number
|
386
|
+
// that lies within the unsafe interval.
|
387
|
+
return RoundWeed(buffer, *length, DiyFp::Minus(too_high, w).f(),
|
388
|
+
unsafe_interval.f(), rest,
|
389
|
+
static_cast<uint64_t>(divider) << -one.e(), unit);
|
390
|
+
}
|
391
|
+
divider /= 10;
|
392
|
+
}
|
393
|
+
|
394
|
+
// The integrals have been generated. We are at the point of the decimal
|
395
|
+
// separator. In the following loop we simply multiply the remaining digits by
|
396
|
+
// 10 and divide by one. We just need to pay attention to multiply associated
|
397
|
+
// data (like the interval or 'unit'), too.
|
398
|
+
// Instead of multiplying by 10 we multiply by 5 (cheaper operation) and
|
399
|
+
// increase its (imaginary) exponent. At the same time we decrease the
|
400
|
+
// divider's (one's) exponent and shift its significand.
|
401
|
+
// Basically, if fractionals was a DiyFp (with fractionals.e == one.e):
|
402
|
+
// fractionals.f *= 10;
|
403
|
+
// fractionals.f >>= 1; fractionals.e++; // value remains unchanged.
|
404
|
+
// one.f >>= 1; one.e++; // value remains unchanged.
|
405
|
+
// and we have again fractionals.e == one.e which allows us to divide
|
406
|
+
// fractionals.f() by one.f()
|
407
|
+
// We simply combine the *= 10 and the >>= 1.
|
408
|
+
while (true) {
|
409
|
+
fractionals *= 5;
|
410
|
+
unit *= 5;
|
411
|
+
unsafe_interval.set_f(unsafe_interval.f() * 5);
|
412
|
+
unsafe_interval.set_e(unsafe_interval.e() + 1); // Will be optimized out.
|
413
|
+
one.set_f(one.f() >> 1);
|
414
|
+
one.set_e(one.e() + 1);
|
415
|
+
// Integer division by one.
|
416
|
+
int digit = static_cast<int>(fractionals >> -one.e());
|
417
|
+
buffer[*length] = '0' + digit;
|
418
|
+
(*length)++;
|
419
|
+
fractionals &= one.f() - 1; // Modulo by one.
|
420
|
+
(*kappa)--;
|
421
|
+
if (fractionals < unsafe_interval.f()) {
|
422
|
+
return RoundWeed(buffer, *length, DiyFp::Minus(too_high, w).f() * unit,
|
423
|
+
unsafe_interval.f(), fractionals, one.f(), unit);
|
424
|
+
}
|
425
|
+
}
|
426
|
+
}
|
427
|
+
|
428
|
+
|
429
|
+
// Provides a decimal representation of v.
|
430
|
+
// Returns true if it succeeds, otherwise the result cannot be trusted.
|
431
|
+
// There will be *length digits inside the buffer (not null-terminated).
|
432
|
+
// If the function returns true then
|
433
|
+
// v == (double) (buffer * 10^decimal_exponent).
|
434
|
+
// The digits in the buffer are the shortest representation possible: no
|
435
|
+
// 0.09999999999999999 instead of 0.1. The shorter representation will even be
|
436
|
+
// chosen even if the longer one would be closer to v.
|
437
|
+
// The last digit will be closest to the actual v. That is, even if several
|
438
|
+
// digits might correctly yield 'v' when read again, the closest will be
|
439
|
+
// computed.
|
440
|
+
bool grisu3(double v, Vector<char> buffer, int* length, int* decimal_exponent) {
|
441
|
+
DiyFp w = Double(v).AsNormalizedDiyFp();
|
442
|
+
// boundary_minus and boundary_plus are the boundaries between v and its
|
443
|
+
// closest floating-point neighbors. Any number strictly between
|
444
|
+
// boundary_minus and boundary_plus will round to v when convert to a double.
|
445
|
+
// Grisu3 will never output representations that lie exactly on a boundary.
|
446
|
+
DiyFp boundary_minus, boundary_plus;
|
447
|
+
Double(v).NormalizedBoundaries(&boundary_minus, &boundary_plus);
|
448
|
+
ASSERT(boundary_plus.e() == w.e());
|
449
|
+
DiyFp ten_mk; // Cached power of ten: 10^-k
|
450
|
+
int mk; // -k
|
451
|
+
GetCachedPower(w.e() + DiyFp::kSignificandSize, minimal_target_exponent,
|
452
|
+
maximal_target_exponent, &mk, &ten_mk);
|
453
|
+
ASSERT(minimal_target_exponent <= w.e() + ten_mk.e() +
|
454
|
+
DiyFp::kSignificandSize &&
|
455
|
+
maximal_target_exponent >= w.e() + ten_mk.e() +
|
456
|
+
DiyFp::kSignificandSize);
|
457
|
+
// Note that ten_mk is only an approximation of 10^-k. A DiyFp only contains a
|
458
|
+
// 64 bit significand and ten_mk is thus only precise up to 64 bits.
|
459
|
+
|
460
|
+
// The DiyFp::Times procedure rounds its result, and ten_mk is approximated
|
461
|
+
// too. The variable scaled_w (as well as scaled_boundary_minus/plus) are now
|
462
|
+
// off by a small amount.
|
463
|
+
// In fact: scaled_w - w*10^k < 1ulp (unit in the last place) of scaled_w.
|
464
|
+
// In other words: let f = scaled_w.f() and e = scaled_w.e(), then
|
465
|
+
// (f-1) * 2^e < w*10^k < (f+1) * 2^e
|
466
|
+
DiyFp scaled_w = DiyFp::Times(w, ten_mk);
|
467
|
+
ASSERT(scaled_w.e() ==
|
468
|
+
boundary_plus.e() + ten_mk.e() + DiyFp::kSignificandSize);
|
469
|
+
// In theory it would be possible to avoid some recomputations by computing
|
470
|
+
// the difference between w and boundary_minus/plus (a power of 2) and to
|
471
|
+
// compute scaled_boundary_minus/plus by subtracting/adding from
|
472
|
+
// scaled_w. However the code becomes much less readable and the speed
|
473
|
+
// enhancements are not terriffic.
|
474
|
+
DiyFp scaled_boundary_minus = DiyFp::Times(boundary_minus, ten_mk);
|
475
|
+
DiyFp scaled_boundary_plus = DiyFp::Times(boundary_plus, ten_mk);
|
476
|
+
|
477
|
+
// DigitGen will generate the digits of scaled_w. Therefore we have
|
478
|
+
// v == (double) (scaled_w * 10^-mk).
|
479
|
+
// Set decimal_exponent == -mk and pass it to DigitGen. If scaled_w is not an
|
480
|
+
// integer than it will be updated. For instance if scaled_w == 1.23 then
|
481
|
+
// the buffer will be filled with "123" und the decimal_exponent will be
|
482
|
+
// decreased by 2.
|
483
|
+
int kappa;
|
484
|
+
bool result = DigitGen(scaled_boundary_minus, scaled_w, scaled_boundary_plus,
|
485
|
+
buffer, length, &kappa);
|
486
|
+
*decimal_exponent = -mk + kappa;
|
487
|
+
return result;
|
488
|
+
}
|
489
|
+
|
490
|
+
|
491
|
+
bool FastDtoa(double v,
|
492
|
+
Vector<char> buffer,
|
493
|
+
int* sign,
|
494
|
+
int* length,
|
495
|
+
int* point) {
|
496
|
+
ASSERT(v != 0);
|
497
|
+
ASSERT(!Double(v).IsSpecial());
|
498
|
+
|
499
|
+
if (v < 0) {
|
500
|
+
v = -v;
|
501
|
+
*sign = 1;
|
502
|
+
} else {
|
503
|
+
*sign = 0;
|
504
|
+
}
|
505
|
+
int decimal_exponent;
|
506
|
+
bool result = grisu3(v, buffer, length, &decimal_exponent);
|
507
|
+
*point = *length + decimal_exponent;
|
508
|
+
buffer[*length] = '\0';
|
509
|
+
return result;
|
510
|
+
}
|
511
|
+
|
512
|
+
} } // namespace v8::internal
|