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
@@ -167,8 +167,17 @@ class Page {
|
|
167
167
|
return 0 == (OffsetFrom(a) & kPageAlignmentMask);
|
168
168
|
}
|
169
169
|
|
170
|
+
// True if this page was in use before current compaction started.
|
171
|
+
// Result is valid only for pages owned by paged spaces and
|
172
|
+
// only after PagedSpace::PrepareForMarkCompact was called.
|
173
|
+
inline bool WasInUseBeforeMC();
|
174
|
+
|
175
|
+
inline void SetWasInUseBeforeMC(bool was_in_use);
|
176
|
+
|
170
177
|
// True if this page is a large object page.
|
171
|
-
bool IsLargeObjectPage()
|
178
|
+
inline bool IsLargeObjectPage();
|
179
|
+
|
180
|
+
inline void SetIsLargeObjectPage(bool is_large_object_page);
|
172
181
|
|
173
182
|
// Returns the offset of a given address to this page.
|
174
183
|
INLINE(int Offset(Address a)) {
|
@@ -244,6 +253,14 @@ class Page {
|
|
244
253
|
// Maximum object size that fits in a page.
|
245
254
|
static const int kMaxHeapObjectSize = kObjectAreaSize;
|
246
255
|
|
256
|
+
enum PageFlag {
|
257
|
+
IS_NORMAL_PAGE = 1 << 0,
|
258
|
+
WAS_IN_USE_BEFORE_MC = 1 << 1
|
259
|
+
};
|
260
|
+
|
261
|
+
inline bool GetPageFlag(PageFlag flag);
|
262
|
+
inline void SetPageFlag(PageFlag flag, bool value);
|
263
|
+
|
247
264
|
//---------------------------------------------------------------------------
|
248
265
|
// Page header description.
|
249
266
|
//
|
@@ -262,7 +279,8 @@ class Page {
|
|
262
279
|
// second word *may* (if the page start and large object chunk start are
|
263
280
|
// the same) contain the large object chunk size. In either case, the
|
264
281
|
// low-order bit for large object pages will be cleared.
|
265
|
-
|
282
|
+
// For normal pages this word is used to store various page flags.
|
283
|
+
int flags;
|
266
284
|
|
267
285
|
// The following fields may overlap with remembered set, they can only
|
268
286
|
// be used in the mark-compact collector when remembered set is not
|
@@ -301,6 +319,12 @@ class Space : public Malloced {
|
|
301
319
|
|
302
320
|
virtual int Size() = 0;
|
303
321
|
|
322
|
+
#ifdef ENABLE_HEAP_PROTECTION
|
323
|
+
// Protect/unprotect the space by marking it read-only/writable.
|
324
|
+
virtual void Protect() = 0;
|
325
|
+
virtual void Unprotect() = 0;
|
326
|
+
#endif
|
327
|
+
|
304
328
|
#ifdef DEBUG
|
305
329
|
virtual void Print() = 0;
|
306
330
|
#endif
|
@@ -401,6 +425,13 @@ class CodeRange : public AllStatic {
|
|
401
425
|
//
|
402
426
|
// The memory allocator also allocates chunks for the large object space, but
|
403
427
|
// they are managed by the space itself. The new space does not expand.
|
428
|
+
//
|
429
|
+
// The fact that pages for paged spaces are allocated and deallocated in chunks
|
430
|
+
// induces a constraint on the order of pages in a linked lists. We say that
|
431
|
+
// pages are linked in the chunk-order if and only if every two consecutive
|
432
|
+
// pages from the same chunk are consecutive in the linked list.
|
433
|
+
//
|
434
|
+
|
404
435
|
|
405
436
|
class MemoryAllocator : public AllStatic {
|
406
437
|
public:
|
@@ -438,13 +469,16 @@ class MemoryAllocator : public AllStatic {
|
|
438
469
|
// and false otherwise.
|
439
470
|
static bool CommitBlock(Address start, size_t size, Executability executable);
|
440
471
|
|
441
|
-
|
442
472
|
// Uncommit a contiguous block of memory [start..(start+size)[.
|
443
473
|
// start is not NULL, the size is greater than zero, and the
|
444
474
|
// block is contained in the initial chunk. Returns true if it succeeded
|
445
475
|
// and false otherwise.
|
446
476
|
static bool UncommitBlock(Address start, size_t size);
|
447
477
|
|
478
|
+
// Zaps a contiguous block of memory [start..(start+size)[ thus
|
479
|
+
// filling it up with a recognizable non-NULL bit pattern.
|
480
|
+
static void ZapBlock(Address start, size_t size);
|
481
|
+
|
448
482
|
// Attempts to allocate the requested (non-zero) number of pages from the
|
449
483
|
// OS. Fewer pages might be allocated than requested. If it fails to
|
450
484
|
// allocate memory for the OS or cannot allocate a single page, this
|
@@ -457,13 +491,18 @@ class MemoryAllocator : public AllStatic {
|
|
457
491
|
static Page* AllocatePages(int requested_pages, int* allocated_pages,
|
458
492
|
PagedSpace* owner);
|
459
493
|
|
460
|
-
// Frees pages from a given page and after.
|
461
|
-
//
|
462
|
-
//
|
463
|
-
//
|
464
|
-
//
|
494
|
+
// Frees pages from a given page and after. Requires pages to be
|
495
|
+
// linked in chunk-order (see comment for class).
|
496
|
+
// If 'p' is the first page of a chunk, pages from 'p' are freed
|
497
|
+
// and this function returns an invalid page pointer.
|
498
|
+
// Otherwise, the function searches a page after 'p' that is
|
499
|
+
// the first page of a chunk. Pages after the found page
|
500
|
+
// are freed and the function returns 'p'.
|
465
501
|
static Page* FreePages(Page* p);
|
466
502
|
|
503
|
+
// Frees all pages owned by given space.
|
504
|
+
static void FreeAllPages(PagedSpace* space);
|
505
|
+
|
467
506
|
// Allocates and frees raw memory of certain size.
|
468
507
|
// These are just thin wrappers around OS::Allocate and OS::Free,
|
469
508
|
// but keep track of allocated bytes as part of heap.
|
@@ -502,6 +541,15 @@ class MemoryAllocator : public AllStatic {
|
|
502
541
|
static Page* FindFirstPageInSameChunk(Page* p);
|
503
542
|
static Page* FindLastPageInSameChunk(Page* p);
|
504
543
|
|
544
|
+
// Relinks list of pages owned by space to make it chunk-ordered.
|
545
|
+
// Returns new first and last pages of space.
|
546
|
+
// Also returns last page in relinked list which has WasInUsedBeforeMC
|
547
|
+
// flag set.
|
548
|
+
static void RelinkPageListInChunkOrder(PagedSpace* space,
|
549
|
+
Page** first_page,
|
550
|
+
Page** last_page,
|
551
|
+
Page** last_page_in_use);
|
552
|
+
|
505
553
|
#ifdef ENABLE_HEAP_PROTECTION
|
506
554
|
// Protect/unprotect a block of memory by marking it read-only/writable.
|
507
555
|
static inline void Protect(Address start, size_t size);
|
@@ -590,6 +638,12 @@ class MemoryAllocator : public AllStatic {
|
|
590
638
|
// used as a marking stack and its page headers are destroyed.
|
591
639
|
static Page* InitializePagesInChunk(int chunk_id, int pages_in_chunk,
|
592
640
|
PagedSpace* owner);
|
641
|
+
|
642
|
+
static Page* RelinkPagesInChunk(int chunk_id,
|
643
|
+
Address chunk_start,
|
644
|
+
size_t chunk_size,
|
645
|
+
Page* prev,
|
646
|
+
Page** last_page_in_use);
|
593
647
|
};
|
594
648
|
|
595
649
|
|
@@ -597,15 +651,14 @@ class MemoryAllocator : public AllStatic {
|
|
597
651
|
// Interface for heap object iterator to be implemented by all object space
|
598
652
|
// object iterators.
|
599
653
|
//
|
600
|
-
// NOTE: The space specific object iterators also implements the own
|
601
|
-
//
|
654
|
+
// NOTE: The space specific object iterators also implements the own next()
|
655
|
+
// method which is used to avoid using virtual functions
|
602
656
|
// iterating a specific space.
|
603
657
|
|
604
658
|
class ObjectIterator : public Malloced {
|
605
659
|
public:
|
606
660
|
virtual ~ObjectIterator() { }
|
607
661
|
|
608
|
-
virtual bool has_next_object() = 0;
|
609
662
|
virtual HeapObject* next_object() = 0;
|
610
663
|
};
|
611
664
|
|
@@ -645,11 +698,11 @@ class HeapObjectIterator: public ObjectIterator {
|
|
645
698
|
Address start,
|
646
699
|
HeapObjectCallback size_func);
|
647
700
|
|
648
|
-
inline
|
649
|
-
|
701
|
+
inline HeapObject* next() {
|
702
|
+
return (cur_addr_ < cur_limit_) ? FromCurrentPage() : FromNextPage();
|
703
|
+
}
|
650
704
|
|
651
705
|
// implementation of ObjectIterator.
|
652
|
-
virtual bool has_next_object() { return has_next(); }
|
653
706
|
virtual HeapObject* next_object() { return next(); }
|
654
707
|
|
655
708
|
private:
|
@@ -659,9 +712,21 @@ class HeapObjectIterator: public ObjectIterator {
|
|
659
712
|
HeapObjectCallback size_func_; // size function
|
660
713
|
Page* end_page_; // caches the page of the end address
|
661
714
|
|
662
|
-
|
663
|
-
|
664
|
-
|
715
|
+
HeapObject* FromCurrentPage() {
|
716
|
+
ASSERT(cur_addr_ < cur_limit_);
|
717
|
+
|
718
|
+
HeapObject* obj = HeapObject::FromAddress(cur_addr_);
|
719
|
+
int obj_size = (size_func_ == NULL) ? obj->Size() : size_func_(obj);
|
720
|
+
ASSERT_OBJECT_SIZE(obj_size);
|
721
|
+
|
722
|
+
cur_addr_ += obj_size;
|
723
|
+
ASSERT(cur_addr_ <= cur_limit_);
|
724
|
+
|
725
|
+
return obj;
|
726
|
+
}
|
727
|
+
|
728
|
+
// Slow path of next, goes into the next page.
|
729
|
+
HeapObject* FromNextPage();
|
665
730
|
|
666
731
|
// Initializes fields.
|
667
732
|
void Initialize(Address start, Address end, HeapObjectCallback size_func);
|
@@ -860,9 +925,16 @@ class PagedSpace : public Space {
|
|
860
925
|
void ClearRSet();
|
861
926
|
|
862
927
|
// Prepares for a mark-compact GC.
|
863
|
-
virtual void PrepareForMarkCompact(bool will_compact)
|
928
|
+
virtual void PrepareForMarkCompact(bool will_compact);
|
864
929
|
|
865
|
-
|
930
|
+
// The top of allocation in a page in this space. Undefined if page is unused.
|
931
|
+
Address PageAllocationTop(Page* page) {
|
932
|
+
return page == TopPageOf(allocation_info_) ? top()
|
933
|
+
: PageAllocationLimit(page);
|
934
|
+
}
|
935
|
+
|
936
|
+
// The limit of allocation for a page in this space.
|
937
|
+
virtual Address PageAllocationLimit(Page* page) = 0;
|
866
938
|
|
867
939
|
// Current capacity without growing (Size() + Available() + Waste()).
|
868
940
|
int Capacity() { return accounting_stats_.Capacity(); }
|
@@ -900,6 +972,16 @@ class PagedSpace : public Space {
|
|
900
972
|
// Used by ReserveSpace.
|
901
973
|
virtual void PutRestOfCurrentPageOnFreeList(Page* current_page) = 0;
|
902
974
|
|
975
|
+
// Free all pages in range from prev (exclusive) to last (inclusive).
|
976
|
+
// Freed pages are moved to the end of page list.
|
977
|
+
void FreePages(Page* prev, Page* last);
|
978
|
+
|
979
|
+
// Set space allocation info.
|
980
|
+
void SetTop(Address top) {
|
981
|
+
allocation_info_.top = top;
|
982
|
+
allocation_info_.limit = PageAllocationLimit(Page::FromAllocationTop(top));
|
983
|
+
}
|
984
|
+
|
903
985
|
// ---------------------------------------------------------------------------
|
904
986
|
// Mark-compact collection support functions
|
905
987
|
|
@@ -948,6 +1030,9 @@ class PagedSpace : public Space {
|
|
948
1030
|
static void ResetCodeStatistics();
|
949
1031
|
#endif
|
950
1032
|
|
1033
|
+
// Returns the page of the allocation pointer.
|
1034
|
+
Page* AllocationTopPage() { return TopPageOf(allocation_info_); }
|
1035
|
+
|
951
1036
|
protected:
|
952
1037
|
// Maximum capacity of this space.
|
953
1038
|
int max_capacity_;
|
@@ -962,6 +1047,10 @@ class PagedSpace : public Space {
|
|
962
1047
|
// Expand and Shrink.
|
963
1048
|
Page* last_page_;
|
964
1049
|
|
1050
|
+
// True if pages owned by this space are linked in chunk-order.
|
1051
|
+
// See comment for class MemoryAllocator for definition of chunk-order.
|
1052
|
+
bool page_list_is_chunk_ordered_;
|
1053
|
+
|
965
1054
|
// Normal allocation information.
|
966
1055
|
AllocationInfo allocation_info_;
|
967
1056
|
|
@@ -1023,8 +1112,6 @@ class PagedSpace : public Space {
|
|
1023
1112
|
void DoPrintRSet(const char* space_name);
|
1024
1113
|
#endif
|
1025
1114
|
private:
|
1026
|
-
// Returns the page of the allocation pointer.
|
1027
|
-
Page* AllocationTopPage() { return TopPageOf(allocation_info_); }
|
1028
1115
|
|
1029
1116
|
// Returns a pointer to the page of the relocation pointer.
|
1030
1117
|
Page* MCRelocationTopPage() { return TopPageOf(mc_forwarding_info_); }
|
@@ -1155,6 +1242,12 @@ class SemiSpace : public Space {
|
|
1155
1242
|
bool Commit();
|
1156
1243
|
bool Uncommit();
|
1157
1244
|
|
1245
|
+
#ifdef ENABLE_HEAP_PROTECTION
|
1246
|
+
// Protect/unprotect the space by marking it read-only/writable.
|
1247
|
+
virtual void Protect() {}
|
1248
|
+
virtual void Unprotect() {}
|
1249
|
+
#endif
|
1250
|
+
|
1158
1251
|
#ifdef DEBUG
|
1159
1252
|
virtual void Print();
|
1160
1253
|
virtual void Verify();
|
@@ -1206,10 +1299,8 @@ class SemiSpaceIterator : public ObjectIterator {
|
|
1206
1299
|
SemiSpaceIterator(NewSpace* space, HeapObjectCallback size_func);
|
1207
1300
|
SemiSpaceIterator(NewSpace* space, Address start);
|
1208
1301
|
|
1209
|
-
bool has_next() {return current_ < limit_; }
|
1210
|
-
|
1211
1302
|
HeapObject* next() {
|
1212
|
-
|
1303
|
+
if (current_ == limit_) return NULL;
|
1213
1304
|
|
1214
1305
|
HeapObject* object = HeapObject::FromAddress(current_);
|
1215
1306
|
int size = (size_func_ == NULL) ? object->Size() : size_func_(object);
|
@@ -1219,7 +1310,6 @@ class SemiSpaceIterator : public ObjectIterator {
|
|
1219
1310
|
}
|
1220
1311
|
|
1221
1312
|
// Implementation of the ObjectIterator functions.
|
1222
|
-
virtual bool has_next_object() { return has_next(); }
|
1223
1313
|
virtual HeapObject* next_object() { return next(); }
|
1224
1314
|
|
1225
1315
|
private:
|
@@ -1641,17 +1731,22 @@ class OldSpace : public PagedSpace {
|
|
1641
1731
|
// pointer).
|
1642
1732
|
int AvailableFree() { return free_list_.available(); }
|
1643
1733
|
|
1644
|
-
// The
|
1645
|
-
virtual Address
|
1646
|
-
return page
|
1734
|
+
// The limit of allocation for a page in this space.
|
1735
|
+
virtual Address PageAllocationLimit(Page* page) {
|
1736
|
+
return page->ObjectAreaEnd();
|
1647
1737
|
}
|
1648
1738
|
|
1649
1739
|
// Give a block of memory to the space's free list. It might be added to
|
1650
1740
|
// the free list or accounted as waste.
|
1651
|
-
|
1652
|
-
|
1741
|
+
// If add_to_freelist is false then just accounting stats are updated and
|
1742
|
+
// no attempt to add area to free list is made.
|
1743
|
+
void Free(Address start, int size_in_bytes, bool add_to_freelist) {
|
1653
1744
|
accounting_stats_.DeallocateBytes(size_in_bytes);
|
1654
|
-
|
1745
|
+
|
1746
|
+
if (add_to_freelist) {
|
1747
|
+
int wasted_bytes = free_list_.Free(start, size_in_bytes);
|
1748
|
+
accounting_stats_.WasteBytes(wasted_bytes);
|
1749
|
+
}
|
1655
1750
|
}
|
1656
1751
|
|
1657
1752
|
// Prepare for full garbage collection. Resets the relocation pointer and
|
@@ -1704,17 +1799,20 @@ class FixedSpace : public PagedSpace {
|
|
1704
1799
|
page_extra_ = Page::kObjectAreaSize % object_size_in_bytes;
|
1705
1800
|
}
|
1706
1801
|
|
1707
|
-
// The
|
1708
|
-
virtual Address
|
1709
|
-
return page
|
1710
|
-
: page->ObjectAreaEnd() - page_extra_;
|
1802
|
+
// The limit of allocation for a page in this space.
|
1803
|
+
virtual Address PageAllocationLimit(Page* page) {
|
1804
|
+
return page->ObjectAreaEnd() - page_extra_;
|
1711
1805
|
}
|
1712
1806
|
|
1713
1807
|
int object_size_in_bytes() { return object_size_in_bytes_; }
|
1714
1808
|
|
1715
1809
|
// Give a fixed sized block of memory to the space's free list.
|
1716
|
-
|
1717
|
-
|
1810
|
+
// If add_to_freelist is false then just accounting stats are updated and
|
1811
|
+
// no attempt to add area to free list is made.
|
1812
|
+
void Free(Address start, bool add_to_freelist) {
|
1813
|
+
if (add_to_freelist) {
|
1814
|
+
free_list_.Free(start);
|
1815
|
+
}
|
1718
1816
|
accounting_stats_.DeallocateBytes(object_size_in_bytes_);
|
1719
1817
|
}
|
1720
1818
|
|
@@ -1800,11 +1898,9 @@ class MapSpace : public FixedSpace {
|
|
1800
1898
|
int pages_left = live_maps / kMapsPerPage;
|
1801
1899
|
PageIterator it(this, PageIterator::ALL_PAGES);
|
1802
1900
|
while (pages_left-- > 0) {
|
1803
|
-
it.has_next(); // Must be called for side-effects, see bug 586.
|
1804
1901
|
ASSERT(it.has_next());
|
1805
1902
|
it.next()->ClearRSet();
|
1806
1903
|
}
|
1807
|
-
it.has_next(); // Must be called for side-effects, see bug 586.
|
1808
1904
|
ASSERT(it.has_next());
|
1809
1905
|
Page* top_page = it.next();
|
1810
1906
|
top_page->ClearRSet();
|
@@ -1831,7 +1927,7 @@ class MapSpace : public FixedSpace {
|
|
1831
1927
|
|
1832
1928
|
#ifdef DEBUG
|
1833
1929
|
if (FLAG_enable_slow_asserts) {
|
1834
|
-
|
1930
|
+
intptr_t actual_size = 0;
|
1835
1931
|
for (Page* p = first_page_; p != top_page; p = p->next_page())
|
1836
1932
|
actual_size += kMapsPerPage * Map::kSize;
|
1837
1933
|
actual_size += (new_top - top_page->ObjectAreaStart());
|
@@ -2054,11 +2150,9 @@ class LargeObjectIterator: public ObjectIterator {
|
|
2054
2150
|
explicit LargeObjectIterator(LargeObjectSpace* space);
|
2055
2151
|
LargeObjectIterator(LargeObjectSpace* space, HeapObjectCallback size_func);
|
2056
2152
|
|
2057
|
-
bool has_next() { return current_ != NULL; }
|
2058
2153
|
HeapObject* next();
|
2059
2154
|
|
2060
2155
|
// implementation of ObjectIterator.
|
2061
|
-
virtual bool has_next_object() { return has_next(); }
|
2062
2156
|
virtual HeapObject* next_object() { return next(); }
|
2063
2157
|
|
2064
2158
|
private:
|
@@ -1,4 +1,4 @@
|
|
1
|
-
// Copyright
|
1
|
+
// Copyright 2010 the V8 project authors. All rights reserved.
|
2
2
|
// Redistribution and use in source and binary forms, with or without
|
3
3
|
// modification, are permitted provided that the following conditions are
|
4
4
|
// met:
|
@@ -25,88 +25,73 @@
|
|
25
25
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
26
26
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27
27
|
|
28
|
-
#ifndef
|
29
|
-
#define
|
28
|
+
#ifndef V8_SPLAY_TREE_INL_H_
|
29
|
+
#define V8_SPLAY_TREE_INL_H_
|
30
30
|
|
31
|
-
#include "
|
32
|
-
#include "v8-counters.h"
|
31
|
+
#include "splay-tree.h"
|
33
32
|
|
34
33
|
namespace v8 {
|
35
34
|
namespace internal {
|
36
35
|
|
37
36
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
size = RoundUp(size, kAlignment);
|
43
|
-
|
44
|
-
// Check if the requested size is available without expanding.
|
45
|
-
Address result = position_;
|
46
|
-
if ((position_ += size) > limit_) result = NewExpand(size);
|
47
|
-
|
48
|
-
// Check that the result has the proper alignment and return it.
|
49
|
-
ASSERT(IsAddressAligned(result, kAlignment, 0));
|
50
|
-
return reinterpret_cast<void*>(result);
|
51
|
-
}
|
52
|
-
|
53
|
-
|
54
|
-
template <typename T>
|
55
|
-
T* Zone::NewArray(int length) {
|
56
|
-
return static_cast<T*>(Zone::New(length * sizeof(T)));
|
37
|
+
template<typename Config, class Allocator>
|
38
|
+
SplayTree<Config, Allocator>::~SplayTree() {
|
39
|
+
NodeDeleter deleter;
|
40
|
+
ForEachNode(&deleter);
|
57
41
|
}
|
58
42
|
|
59
43
|
|
60
|
-
|
61
|
-
|
62
|
-
}
|
63
|
-
|
64
|
-
|
65
|
-
void Zone::adjust_segment_bytes_allocated(int delta) {
|
66
|
-
segment_bytes_allocated_ += delta;
|
67
|
-
Counters::zone_segment_bytes.Set(segment_bytes_allocated_);
|
68
|
-
}
|
69
|
-
|
70
|
-
|
71
|
-
template <typename C>
|
72
|
-
bool ZoneSplayTree<C>::Insert(const Key& key, Locator* locator) {
|
44
|
+
template<typename Config, class Allocator>
|
45
|
+
bool SplayTree<Config, Allocator>::Insert(const Key& key, Locator* locator) {
|
73
46
|
if (is_empty()) {
|
74
47
|
// If the tree is empty, insert the new node.
|
75
|
-
root_ = new Node(key,
|
48
|
+
root_ = new Node(key, Config::kNoValue);
|
76
49
|
} else {
|
77
50
|
// Splay on the key to move the last node on the search path
|
78
51
|
// for the key to the root of the tree.
|
79
52
|
Splay(key);
|
80
53
|
// Ignore repeated insertions with the same key.
|
81
|
-
int cmp =
|
54
|
+
int cmp = Config::Compare(key, root_->key_);
|
82
55
|
if (cmp == 0) {
|
83
56
|
locator->bind(root_);
|
84
57
|
return false;
|
85
58
|
}
|
86
59
|
// Insert the new node.
|
87
|
-
Node* node = new Node(key,
|
88
|
-
|
89
|
-
node->left_ = root_;
|
90
|
-
node->right_ = root_->right_;
|
91
|
-
root_->right_ = NULL;
|
92
|
-
} else {
|
93
|
-
node->right_ = root_;
|
94
|
-
node->left_ = root_->left_;
|
95
|
-
root_->left_ = NULL;
|
96
|
-
}
|
97
|
-
root_ = node;
|
60
|
+
Node* node = new Node(key, Config::kNoValue);
|
61
|
+
InsertInternal(cmp, node);
|
98
62
|
}
|
99
63
|
locator->bind(root_);
|
100
64
|
return true;
|
101
65
|
}
|
102
66
|
|
103
67
|
|
104
|
-
template
|
105
|
-
|
68
|
+
template<typename Config, class Allocator>
|
69
|
+
void SplayTree<Config, Allocator>::InsertInternal(int cmp, Node* node) {
|
70
|
+
if (cmp > 0) {
|
71
|
+
node->left_ = root_;
|
72
|
+
node->right_ = root_->right_;
|
73
|
+
root_->right_ = NULL;
|
74
|
+
} else {
|
75
|
+
node->right_ = root_;
|
76
|
+
node->left_ = root_->left_;
|
77
|
+
root_->left_ = NULL;
|
78
|
+
}
|
79
|
+
root_ = node;
|
80
|
+
}
|
81
|
+
|
82
|
+
|
83
|
+
template<typename Config, class Allocator>
|
84
|
+
bool SplayTree<Config, Allocator>::FindInternal(const Key& key) {
|
106
85
|
if (is_empty())
|
107
86
|
return false;
|
108
87
|
Splay(key);
|
109
|
-
|
88
|
+
return Config::Compare(key, root_->key_) == 0;
|
89
|
+
}
|
90
|
+
|
91
|
+
|
92
|
+
template<typename Config, class Allocator>
|
93
|
+
bool SplayTree<Config, Allocator>::Find(const Key& key, Locator* locator) {
|
94
|
+
if (FindInternal(key)) {
|
110
95
|
locator->bind(root_);
|
111
96
|
return true;
|
112
97
|
} else {
|
@@ -115,9 +100,9 @@ bool ZoneSplayTree<C>::Find(const Key& key, Locator* locator) {
|
|
115
100
|
}
|
116
101
|
|
117
102
|
|
118
|
-
template
|
119
|
-
bool
|
120
|
-
|
103
|
+
template<typename Config, class Allocator>
|
104
|
+
bool SplayTree<Config, Allocator>::FindGreatestLessThan(const Key& key,
|
105
|
+
Locator* locator) {
|
121
106
|
if (is_empty())
|
122
107
|
return false;
|
123
108
|
// Splay on the key to move the node with the given key or the last
|
@@ -125,7 +110,7 @@ bool ZoneSplayTree<C>::FindGreatestLessThan(const Key& key,
|
|
125
110
|
Splay(key);
|
126
111
|
// Now the result is either the root node or the greatest node in
|
127
112
|
// the left subtree.
|
128
|
-
int cmp =
|
113
|
+
int cmp = Config::Compare(root_->key_, key);
|
129
114
|
if (cmp <= 0) {
|
130
115
|
locator->bind(root_);
|
131
116
|
return true;
|
@@ -139,9 +124,9 @@ bool ZoneSplayTree<C>::FindGreatestLessThan(const Key& key,
|
|
139
124
|
}
|
140
125
|
|
141
126
|
|
142
|
-
template
|
143
|
-
bool
|
144
|
-
|
127
|
+
template<typename Config, class Allocator>
|
128
|
+
bool SplayTree<Config, Allocator>::FindLeastGreaterThan(const Key& key,
|
129
|
+
Locator* locator) {
|
145
130
|
if (is_empty())
|
146
131
|
return false;
|
147
132
|
// Splay on the key to move the node with the given key or the last
|
@@ -149,7 +134,7 @@ bool ZoneSplayTree<C>::FindLeastGreaterThan(const Key& key,
|
|
149
134
|
Splay(key);
|
150
135
|
// Now the result is either the root node or the least node in
|
151
136
|
// the right subtree.
|
152
|
-
int cmp =
|
137
|
+
int cmp = Config::Compare(root_->key_, key);
|
153
138
|
if (cmp >= 0) {
|
154
139
|
locator->bind(root_);
|
155
140
|
return true;
|
@@ -163,8 +148,8 @@ bool ZoneSplayTree<C>::FindLeastGreaterThan(const Key& key,
|
|
163
148
|
}
|
164
149
|
|
165
150
|
|
166
|
-
template
|
167
|
-
bool
|
151
|
+
template<typename Config, class Allocator>
|
152
|
+
bool SplayTree<Config, Allocator>::FindGreatest(Locator* locator) {
|
168
153
|
if (is_empty())
|
169
154
|
return false;
|
170
155
|
Node* current = root_;
|
@@ -175,8 +160,8 @@ bool ZoneSplayTree<C>::FindGreatest(Locator* locator) {
|
|
175
160
|
}
|
176
161
|
|
177
162
|
|
178
|
-
template
|
179
|
-
bool
|
163
|
+
template<typename Config, class Allocator>
|
164
|
+
bool SplayTree<Config, Allocator>::FindLeast(Locator* locator) {
|
180
165
|
if (is_empty())
|
181
166
|
return false;
|
182
167
|
Node* current = root_;
|
@@ -187,16 +172,39 @@ bool ZoneSplayTree<C>::FindLeast(Locator* locator) {
|
|
187
172
|
}
|
188
173
|
|
189
174
|
|
190
|
-
template
|
191
|
-
bool
|
192
|
-
|
193
|
-
if (
|
175
|
+
template<typename Config, class Allocator>
|
176
|
+
bool SplayTree<Config, Allocator>::Move(const Key& old_key,
|
177
|
+
const Key& new_key) {
|
178
|
+
if (!FindInternal(old_key))
|
194
179
|
return false;
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
180
|
+
Node* node_to_move = root_;
|
181
|
+
RemoveRootNode(old_key);
|
182
|
+
Splay(new_key);
|
183
|
+
int cmp = Config::Compare(new_key, root_->key_);
|
184
|
+
if (cmp == 0) {
|
185
|
+
// A node with the target key already exists.
|
186
|
+
delete node_to_move;
|
187
|
+
return false;
|
188
|
+
}
|
189
|
+
node_to_move->key_ = new_key;
|
190
|
+
InsertInternal(cmp, node_to_move);
|
191
|
+
return true;
|
192
|
+
}
|
193
|
+
|
194
|
+
|
195
|
+
template<typename Config, class Allocator>
|
196
|
+
bool SplayTree<Config, Allocator>::Remove(const Key& key) {
|
197
|
+
if (!FindInternal(key))
|
199
198
|
return false;
|
199
|
+
Node* node_to_remove = root_;
|
200
|
+
RemoveRootNode(key);
|
201
|
+
delete node_to_remove;
|
202
|
+
return true;
|
203
|
+
}
|
204
|
+
|
205
|
+
|
206
|
+
template<typename Config, class Allocator>
|
207
|
+
void SplayTree<Config, Allocator>::RemoveRootNode(const Key& key) {
|
200
208
|
if (root_->left_ == NULL) {
|
201
209
|
// No left child, so the new tree is just the right child.
|
202
210
|
root_ = root_->right_;
|
@@ -211,15 +219,14 @@ bool ZoneSplayTree<C>::Remove(const Key& key) {
|
|
211
219
|
// root.
|
212
220
|
root_->right_ = right;
|
213
221
|
}
|
214
|
-
return true;
|
215
222
|
}
|
216
223
|
|
217
224
|
|
218
|
-
template
|
219
|
-
void
|
225
|
+
template<typename Config, class Allocator>
|
226
|
+
void SplayTree<Config, Allocator>::Splay(const Key& key) {
|
220
227
|
if (is_empty())
|
221
228
|
return;
|
222
|
-
Node dummy_node(
|
229
|
+
Node dummy_node(Config::kNoKey, Config::kNoValue);
|
223
230
|
// Create a dummy node. The use of the dummy node is a bit
|
224
231
|
// counter-intuitive: The right child of the dummy node will hold
|
225
232
|
// the L tree of the algorithm. The left child of the dummy node
|
@@ -230,11 +237,11 @@ void ZoneSplayTree<C>::Splay(const Key& key) {
|
|
230
237
|
Node* right = dummy;
|
231
238
|
Node* current = root_;
|
232
239
|
while (true) {
|
233
|
-
int cmp =
|
240
|
+
int cmp = Config::Compare(key, current->key_);
|
234
241
|
if (cmp < 0) {
|
235
242
|
if (current->left_ == NULL)
|
236
243
|
break;
|
237
|
-
if (
|
244
|
+
if (Config::Compare(key, current->left_->key_) < 0) {
|
238
245
|
// Rotate right.
|
239
246
|
Node* temp = current->left_;
|
240
247
|
current->left_ = temp->right_;
|
@@ -250,7 +257,7 @@ void ZoneSplayTree<C>::Splay(const Key& key) {
|
|
250
257
|
} else if (cmp > 0) {
|
251
258
|
if (current->right_ == NULL)
|
252
259
|
break;
|
253
|
-
if (
|
260
|
+
if (Config::Compare(key, current->right_->key_) > 0) {
|
254
261
|
// Rotate left.
|
255
262
|
Node* temp = current->right_;
|
256
263
|
current->right_ = temp->left_;
|
@@ -276,22 +283,28 @@ void ZoneSplayTree<C>::Splay(const Key& key) {
|
|
276
283
|
}
|
277
284
|
|
278
285
|
|
279
|
-
template <typename Config> template <class Callback>
|
280
|
-
void
|
286
|
+
template <typename Config, class Allocator> template <class Callback>
|
287
|
+
void SplayTree<Config, Allocator>::ForEach(Callback* callback) {
|
288
|
+
NodeToPairAdaptor<Callback> callback_adaptor(callback);
|
289
|
+
ForEachNode(&callback_adaptor);
|
290
|
+
}
|
291
|
+
|
292
|
+
|
293
|
+
template <typename Config, class Allocator> template <class Callback>
|
294
|
+
void SplayTree<Config, Allocator>::ForEachNode(Callback* callback) {
|
281
295
|
// Pre-allocate some space for tiny trees.
|
282
|
-
|
283
|
-
nodes_to_visit.Add(root_);
|
296
|
+
List<Node*, Allocator> nodes_to_visit(10);
|
297
|
+
if (root_ != NULL) nodes_to_visit.Add(root_);
|
284
298
|
int pos = 0;
|
285
299
|
while (pos < nodes_to_visit.length()) {
|
286
300
|
Node* node = nodes_to_visit[pos++];
|
287
|
-
if (node
|
288
|
-
|
289
|
-
|
290
|
-
nodes_to_visit.Add(node->right());
|
301
|
+
if (node->left() != NULL) nodes_to_visit.Add(node->left());
|
302
|
+
if (node->right() != NULL) nodes_to_visit.Add(node->right());
|
303
|
+
callback->Call(node);
|
291
304
|
}
|
292
305
|
}
|
293
306
|
|
294
307
|
|
295
308
|
} } // namespace v8::internal
|
296
309
|
|
297
|
-
#endif //
|
310
|
+
#endif // V8_SPLAY_TREE_INL_H_
|