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,203 @@
|
|
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_SPLAY_TREE_H_
|
29
|
+
#define V8_SPLAY_TREE_H_
|
30
|
+
|
31
|
+
namespace v8 {
|
32
|
+
namespace internal {
|
33
|
+
|
34
|
+
|
35
|
+
// A splay tree. The config type parameter encapsulates the different
|
36
|
+
// configurations of a concrete splay tree:
|
37
|
+
//
|
38
|
+
// typedef Key: the key type
|
39
|
+
// typedef Value: the value type
|
40
|
+
// static const kNoKey: the dummy key used when no key is set
|
41
|
+
// static const kNoValue: the dummy value used to initialize nodes
|
42
|
+
// int (Compare)(Key& a, Key& b) -> {-1, 0, 1}: comparison function
|
43
|
+
//
|
44
|
+
// The tree is also parameterized by an allocation policy
|
45
|
+
// (Allocator). The policy is used for allocating lists in the C free
|
46
|
+
// store or the zone; see zone.h.
|
47
|
+
|
48
|
+
// Forward defined as
|
49
|
+
// template <typename Config, class Allocator = FreeStoreAllocationPolicy>
|
50
|
+
// class SplayTree;
|
51
|
+
template <typename Config, class Allocator>
|
52
|
+
class SplayTree {
|
53
|
+
public:
|
54
|
+
typedef typename Config::Key Key;
|
55
|
+
typedef typename Config::Value Value;
|
56
|
+
|
57
|
+
class Locator;
|
58
|
+
|
59
|
+
SplayTree() : root_(NULL) { }
|
60
|
+
~SplayTree();
|
61
|
+
|
62
|
+
INLINE(void* operator new(size_t size)) {
|
63
|
+
return Allocator::New(static_cast<int>(size));
|
64
|
+
}
|
65
|
+
INLINE(void operator delete(void* p, size_t)) { return Allocator::Delete(p); }
|
66
|
+
|
67
|
+
// Inserts the given key in this tree with the given value. Returns
|
68
|
+
// true if a node was inserted, otherwise false. If found the locator
|
69
|
+
// is enabled and provides access to the mapping for the key.
|
70
|
+
bool Insert(const Key& key, Locator* locator);
|
71
|
+
|
72
|
+
// Looks up the key in this tree and returns true if it was found,
|
73
|
+
// otherwise false. If the node is found the locator is enabled and
|
74
|
+
// provides access to the mapping for the key.
|
75
|
+
bool Find(const Key& key, Locator* locator);
|
76
|
+
|
77
|
+
// Finds the mapping with the greatest key less than or equal to the
|
78
|
+
// given key.
|
79
|
+
bool FindGreatestLessThan(const Key& key, Locator* locator);
|
80
|
+
|
81
|
+
// Find the mapping with the greatest key in this tree.
|
82
|
+
bool FindGreatest(Locator* locator);
|
83
|
+
|
84
|
+
// Finds the mapping with the least key greater than or equal to the
|
85
|
+
// given key.
|
86
|
+
bool FindLeastGreaterThan(const Key& key, Locator* locator);
|
87
|
+
|
88
|
+
// Find the mapping with the least key in this tree.
|
89
|
+
bool FindLeast(Locator* locator);
|
90
|
+
|
91
|
+
// Move the node from one key to another.
|
92
|
+
bool Move(const Key& old_key, const Key& new_key);
|
93
|
+
|
94
|
+
// Remove the node with the given key from the tree.
|
95
|
+
bool Remove(const Key& key);
|
96
|
+
|
97
|
+
bool is_empty() { return root_ == NULL; }
|
98
|
+
|
99
|
+
// Perform the splay operation for the given key. Moves the node with
|
100
|
+
// the given key to the top of the tree. If no node has the given
|
101
|
+
// key, the last node on the search path is moved to the top of the
|
102
|
+
// tree.
|
103
|
+
void Splay(const Key& key);
|
104
|
+
|
105
|
+
class Node {
|
106
|
+
public:
|
107
|
+
Node(const Key& key, const Value& value)
|
108
|
+
: key_(key),
|
109
|
+
value_(value),
|
110
|
+
left_(NULL),
|
111
|
+
right_(NULL) { }
|
112
|
+
|
113
|
+
INLINE(void* operator new(size_t size)) {
|
114
|
+
return Allocator::New(static_cast<int>(size));
|
115
|
+
}
|
116
|
+
INLINE(void operator delete(void* p, size_t)) {
|
117
|
+
return Allocator::Delete(p);
|
118
|
+
}
|
119
|
+
|
120
|
+
Key key() { return key_; }
|
121
|
+
Value value() { return value_; }
|
122
|
+
Node* left() { return left_; }
|
123
|
+
Node* right() { return right_; }
|
124
|
+
private:
|
125
|
+
|
126
|
+
friend class SplayTree;
|
127
|
+
friend class Locator;
|
128
|
+
Key key_;
|
129
|
+
Value value_;
|
130
|
+
Node* left_;
|
131
|
+
Node* right_;
|
132
|
+
};
|
133
|
+
|
134
|
+
// A locator provides access to a node in the tree without actually
|
135
|
+
// exposing the node.
|
136
|
+
class Locator BASE_EMBEDDED {
|
137
|
+
public:
|
138
|
+
explicit Locator(Node* node) : node_(node) { }
|
139
|
+
Locator() : node_(NULL) { }
|
140
|
+
const Key& key() { return node_->key_; }
|
141
|
+
Value& value() { return node_->value_; }
|
142
|
+
void set_value(const Value& value) { node_->value_ = value; }
|
143
|
+
inline void bind(Node* node) { node_ = node; }
|
144
|
+
private:
|
145
|
+
Node* node_;
|
146
|
+
};
|
147
|
+
|
148
|
+
template <class Callback>
|
149
|
+
void ForEach(Callback* callback);
|
150
|
+
|
151
|
+
protected:
|
152
|
+
|
153
|
+
// Resets tree root. Existing nodes become unreachable.
|
154
|
+
void ResetRoot() { root_ = NULL; }
|
155
|
+
|
156
|
+
private:
|
157
|
+
// Search for a node with a given key. If found, root_ points
|
158
|
+
// to the node.
|
159
|
+
bool FindInternal(const Key& key);
|
160
|
+
|
161
|
+
// Inserts a node assuming that root_ is already set up.
|
162
|
+
void InsertInternal(int cmp, Node* node);
|
163
|
+
|
164
|
+
// Removes root_ node.
|
165
|
+
void RemoveRootNode(const Key& key);
|
166
|
+
|
167
|
+
template<class Callback>
|
168
|
+
class NodeToPairAdaptor BASE_EMBEDDED {
|
169
|
+
public:
|
170
|
+
explicit NodeToPairAdaptor(Callback* callback)
|
171
|
+
: callback_(callback) { }
|
172
|
+
void Call(Node* node) {
|
173
|
+
callback_->Call(node->key(), node->value());
|
174
|
+
}
|
175
|
+
|
176
|
+
private:
|
177
|
+
Callback* callback_;
|
178
|
+
|
179
|
+
DISALLOW_COPY_AND_ASSIGN(NodeToPairAdaptor);
|
180
|
+
};
|
181
|
+
|
182
|
+
class NodeDeleter BASE_EMBEDDED {
|
183
|
+
public:
|
184
|
+
NodeDeleter() { }
|
185
|
+
void Call(Node* node) { delete node; }
|
186
|
+
|
187
|
+
private:
|
188
|
+
|
189
|
+
DISALLOW_COPY_AND_ASSIGN(NodeDeleter);
|
190
|
+
};
|
191
|
+
|
192
|
+
template <class Callback>
|
193
|
+
void ForEachNode(Callback* callback);
|
194
|
+
|
195
|
+
Node* root_;
|
196
|
+
|
197
|
+
DISALLOW_COPY_AND_ASSIGN(SplayTree);
|
198
|
+
};
|
199
|
+
|
200
|
+
|
201
|
+
} } // namespace v8::internal
|
202
|
+
|
203
|
+
#endif // V8_SPLAY_TREE_H_
|
File without changes
|
File without changes
|
@@ -34,7 +34,7 @@
|
|
34
34
|
|
35
35
|
// Set the String function and constructor.
|
36
36
|
%SetCode($String, function(x) {
|
37
|
-
var value = %_ArgumentsLength() == 0 ? '' :
|
37
|
+
var value = %_ArgumentsLength() == 0 ? '' : TO_STRING_INLINE(x);
|
38
38
|
if (%_IsConstructCall()) {
|
39
39
|
%_SetValueOf(this, value);
|
40
40
|
} else {
|
@@ -64,12 +64,12 @@ function StringValueOf() {
|
|
64
64
|
function StringCharAt(pos) {
|
65
65
|
var char_code = %_FastCharCodeAt(this, pos);
|
66
66
|
if (!%_IsSmi(char_code)) {
|
67
|
-
var subject =
|
67
|
+
var subject = TO_STRING_INLINE(this);
|
68
68
|
var index = TO_INTEGER(pos);
|
69
69
|
if (index >= subject.length || index < 0) return "";
|
70
70
|
char_code = %StringCharCodeAt(subject, index);
|
71
71
|
}
|
72
|
-
return %
|
72
|
+
return %_CharFromCode(char_code);
|
73
73
|
}
|
74
74
|
|
75
75
|
|
@@ -79,7 +79,7 @@ function StringCharCodeAt(pos) {
|
|
79
79
|
if (%_IsSmi(fast_answer)) {
|
80
80
|
return fast_answer;
|
81
81
|
}
|
82
|
-
var subject =
|
82
|
+
var subject = TO_STRING_INLINE(this);
|
83
83
|
var index = TO_INTEGER(pos);
|
84
84
|
return %StringCharCodeAt(subject, index);
|
85
85
|
}
|
@@ -87,14 +87,18 @@ function StringCharCodeAt(pos) {
|
|
87
87
|
|
88
88
|
// ECMA-262, section 15.5.4.6
|
89
89
|
function StringConcat() {
|
90
|
-
var len = %_ArgumentsLength()
|
91
|
-
var
|
92
|
-
|
93
|
-
|
94
|
-
var part = %_Arguments(i - 1);
|
95
|
-
parts[i] = IS_STRING(part) ? part : ToString(part);
|
90
|
+
var len = %_ArgumentsLength();
|
91
|
+
var this_as_string = TO_STRING_INLINE(this);
|
92
|
+
if (len === 1) {
|
93
|
+
return this_as_string + %_Arguments(0);
|
96
94
|
}
|
97
|
-
|
95
|
+
var parts = new $Array(len + 1);
|
96
|
+
parts[0] = this_as_string;
|
97
|
+
for (var i = 0; i < len; i++) {
|
98
|
+
var part = %_Arguments(i);
|
99
|
+
parts[i + 1] = TO_STRING_INLINE(part);
|
100
|
+
}
|
101
|
+
return %StringBuilderConcat(parts, len + 1, "");
|
98
102
|
}
|
99
103
|
|
100
104
|
// Match ES3 and Safari
|
@@ -103,8 +107,8 @@ function StringConcat() {
|
|
103
107
|
|
104
108
|
// ECMA-262 section 15.5.4.7
|
105
109
|
function StringIndexOf(searchString /* position */) { // length == 1
|
106
|
-
var subject_str =
|
107
|
-
var pattern_str =
|
110
|
+
var subject_str = TO_STRING_INLINE(this);
|
111
|
+
var pattern_str = TO_STRING_INLINE(searchString);
|
108
112
|
var subject_str_len = subject_str.length;
|
109
113
|
var pattern_str_len = pattern_str.length;
|
110
114
|
var index = 0;
|
@@ -121,9 +125,9 @@ function StringIndexOf(searchString /* position */) { // length == 1
|
|
121
125
|
|
122
126
|
// ECMA-262 section 15.5.4.8
|
123
127
|
function StringLastIndexOf(searchString /* position */) { // length == 1
|
124
|
-
var sub =
|
128
|
+
var sub = TO_STRING_INLINE(this);
|
125
129
|
var subLength = sub.length;
|
126
|
-
var pat =
|
130
|
+
var pat = TO_STRING_INLINE(searchString);
|
127
131
|
var patLength = pat.length;
|
128
132
|
var index = subLength - patLength;
|
129
133
|
if (%_ArgumentsLength() > 1) {
|
@@ -145,6 +149,16 @@ function StringLastIndexOf(searchString /* position */) { // length == 1
|
|
145
149
|
}
|
146
150
|
|
147
151
|
|
152
|
+
function CloneDenseArray(array) {
|
153
|
+
if (array === null) return null;
|
154
|
+
var clone = new $Array(array.length);
|
155
|
+
for (var i = 0; i < array.length; i++) {
|
156
|
+
clone[i] = array[i];
|
157
|
+
}
|
158
|
+
return clone;
|
159
|
+
}
|
160
|
+
|
161
|
+
|
148
162
|
// ECMA-262 section 15.5.4.9
|
149
163
|
//
|
150
164
|
// This function is implementation specific. For now, we do not
|
@@ -152,21 +166,45 @@ function StringLastIndexOf(searchString /* position */) { // length == 1
|
|
152
166
|
function StringLocaleCompare(other) {
|
153
167
|
if (%_ArgumentsLength() === 0) return 0;
|
154
168
|
|
155
|
-
var this_str =
|
156
|
-
var other_str =
|
169
|
+
var this_str = TO_STRING_INLINE(this);
|
170
|
+
var other_str = TO_STRING_INLINE(other);
|
157
171
|
return %StringLocaleCompare(this_str, other_str);
|
158
172
|
}
|
159
173
|
|
160
174
|
|
161
175
|
// ECMA-262 section 15.5.4.10
|
162
176
|
function StringMatch(regexp) {
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
177
|
+
var subject = TO_STRING_INLINE(this);
|
178
|
+
if (IS_REGEXP(regexp)) {
|
179
|
+
if (!regexp.global) return regexp.exec(subject);
|
180
|
+
|
181
|
+
var cache = regExpCache;
|
182
|
+
var saveAnswer = false;
|
183
|
+
|
184
|
+
if (%_ObjectEquals(cache.type, 'match') &&
|
185
|
+
%_ObjectEquals(cache.regExp, regexp) &&
|
186
|
+
%_ObjectEquals(cache.subject, subject)) {
|
187
|
+
if (cache.answerSaved) {
|
188
|
+
return CloneDenseArray(cache.answer);
|
189
|
+
} else {
|
190
|
+
saveAnswer = true;
|
191
|
+
}
|
192
|
+
}
|
193
|
+
%_Log('regexp', 'regexp-match,%0S,%1r', [subject, regexp]);
|
194
|
+
// lastMatchInfo is defined in regexp.js.
|
195
|
+
var result = %StringMatch(subject, regexp, lastMatchInfo);
|
196
|
+
cache.type = 'match';
|
197
|
+
cache.regExp = regexp;
|
198
|
+
cache.subject = subject;
|
199
|
+
if (saveAnswer) cache.answer = CloneDenseArray(result);
|
200
|
+
cache.answerSaved = saveAnswer;
|
201
|
+
return result;
|
202
|
+
}
|
203
|
+
// Non-regexp argument.
|
204
|
+
regexp = new $RegExp(regexp);
|
205
|
+
// Don't check regexp exec cache, since the regexp is new.
|
206
|
+
// TODO(lrn): Change this if we start caching regexps here.
|
207
|
+
return RegExpExecNoTests(regexp, subject, 0);
|
170
208
|
}
|
171
209
|
|
172
210
|
|
@@ -180,7 +218,7 @@ function SubString(string, start, end) {
|
|
180
218
|
if (!%_IsSmi(char_code)) {
|
181
219
|
char_code = %StringCharCodeAt(string, start);
|
182
220
|
}
|
183
|
-
return %
|
221
|
+
return %_CharFromCode(char_code);
|
184
222
|
}
|
185
223
|
return %_SubString(string, start, end);
|
186
224
|
}
|
@@ -196,12 +234,13 @@ var reusableMatchInfo = [2, "", "", -1, -1];
|
|
196
234
|
|
197
235
|
// ECMA-262, section 15.5.4.11
|
198
236
|
function StringReplace(search, replace) {
|
199
|
-
var subject =
|
237
|
+
var subject = TO_STRING_INLINE(this);
|
200
238
|
|
201
239
|
// Delegate to one of the regular expression variants if necessary.
|
202
240
|
if (IS_REGEXP(search)) {
|
203
241
|
%_Log('regexp', 'regexp-replace,%0r,%1S', [search, subject]);
|
204
242
|
if (IS_FUNCTION(replace)) {
|
243
|
+
regExpCache.type = 'none';
|
205
244
|
return StringReplaceRegExpWithFunction(subject, search, replace);
|
206
245
|
} else {
|
207
246
|
return StringReplaceRegExp(subject, search, replace);
|
@@ -209,7 +248,7 @@ function StringReplace(search, replace) {
|
|
209
248
|
}
|
210
249
|
|
211
250
|
// Convert the search argument to a string and search for it.
|
212
|
-
search =
|
251
|
+
search = TO_STRING_INLINE(search);
|
213
252
|
var start = %StringIndexOf(subject, search, 0);
|
214
253
|
if (start < 0) return subject;
|
215
254
|
var end = start + search.length;
|
@@ -224,7 +263,7 @@ function StringReplace(search, replace) {
|
|
224
263
|
} else {
|
225
264
|
reusableMatchInfo[CAPTURE0] = start;
|
226
265
|
reusableMatchInfo[CAPTURE1] = end;
|
227
|
-
|
266
|
+
replace = TO_STRING_INLINE(replace);
|
228
267
|
ExpandReplacement(replace, subject, reusableMatchInfo, builder);
|
229
268
|
}
|
230
269
|
|
@@ -237,12 +276,25 @@ function StringReplace(search, replace) {
|
|
237
276
|
|
238
277
|
// Helper function for regular expressions in String.prototype.replace.
|
239
278
|
function StringReplaceRegExp(subject, regexp, replace) {
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
279
|
+
var cache = regExpCache;
|
280
|
+
if (%_ObjectEquals(cache.regExp, regexp) &&
|
281
|
+
%_ObjectEquals(cache.type, 'replace') &&
|
282
|
+
%_ObjectEquals(cache.replaceString, replace) &&
|
283
|
+
%_ObjectEquals(cache.subject, subject)) {
|
284
|
+
return cache.answer;
|
285
|
+
}
|
286
|
+
replace = TO_STRING_INLINE(replace);
|
287
|
+
var answer = %StringReplaceRegExpWithString(subject,
|
288
|
+
regexp,
|
289
|
+
replace,
|
290
|
+
lastMatchInfo);
|
291
|
+
cache.subject = subject;
|
292
|
+
cache.regExp = regexp;
|
293
|
+
cache.replaceString = replace;
|
294
|
+
cache.answer = answer;
|
295
|
+
cache.type = 'replace';
|
296
|
+
return answer;
|
297
|
+
}
|
246
298
|
|
247
299
|
|
248
300
|
// Expand the $-expressions in the string and return a new string with
|
@@ -364,72 +416,95 @@ function addCaptureString(builder, matchInfo, index) {
|
|
364
416
|
builder.addSpecialSlice(start, end);
|
365
417
|
};
|
366
418
|
|
419
|
+
// TODO(lrn): This array will survive indefinitely if replace is never
|
420
|
+
// called again. However, it will be empty, since the contents are cleared
|
421
|
+
// in the finally block.
|
422
|
+
var reusableReplaceArray = $Array(16);
|
367
423
|
|
368
424
|
// Helper function for replacing regular expressions with the result of a
|
369
|
-
// function application in String.prototype.replace.
|
370
|
-
// must be interleaved with the regexp matching (contrary to ECMA-262
|
371
|
-
// 15.5.4.11) to mimic SpiderMonkey and KJS behavior when the function uses
|
372
|
-
// the static properties of the RegExp constructor. Example:
|
373
|
-
// 'abcd'.replace(/(.)/g, function() { return RegExp.$1; }
|
374
|
-
// should be 'abcd' and not 'dddd' (or anything else).
|
425
|
+
// function application in String.prototype.replace.
|
375
426
|
function StringReplaceRegExpWithFunction(subject, regexp, replace) {
|
376
|
-
var matchInfo = DoRegExpExec(regexp, subject, 0);
|
377
|
-
if (IS_NULL(matchInfo)) return subject;
|
378
|
-
|
379
|
-
var result = new ReplaceResultBuilder(subject);
|
380
|
-
// There's at least one match. If the regexp is global, we have to loop
|
381
|
-
// over all matches. The loop is not in C++ code here like the one in
|
382
|
-
// RegExp.prototype.exec, because of the interleaved function application.
|
383
|
-
// Unfortunately, that means this code is nearly duplicated, here and in
|
384
|
-
// jsregexp.cc.
|
385
427
|
if (regexp.global) {
|
386
|
-
var
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
428
|
+
var resultArray = reusableReplaceArray;
|
429
|
+
if (resultArray) {
|
430
|
+
reusableReplaceArray = null;
|
431
|
+
} else {
|
432
|
+
// Inside a nested replace (replace called from the replacement function
|
433
|
+
// of another replace) or we have failed to set the reusable array
|
434
|
+
// back due to an exception in a replacement function. Create a new
|
435
|
+
// array to use in the future, or until the original is written back.
|
436
|
+
resultArray = $Array(16);
|
437
|
+
}
|
438
|
+
|
439
|
+
var res = %RegExpExecMultiple(regexp,
|
440
|
+
subject,
|
441
|
+
lastMatchInfo,
|
442
|
+
resultArray);
|
443
|
+
regexp.lastIndex = 0;
|
444
|
+
if (IS_NULL(res)) {
|
445
|
+
// No matches at all.
|
446
|
+
return subject;
|
447
|
+
}
|
448
|
+
var len = res.length;
|
449
|
+
var i = 0;
|
450
|
+
if (NUMBER_OF_CAPTURES(lastMatchInfo) == 2) {
|
451
|
+
var match_start = 0;
|
452
|
+
var override = [null, 0, subject];
|
453
|
+
while (i < len) {
|
454
|
+
var elem = res[i];
|
455
|
+
if (%_IsSmi(elem)) {
|
456
|
+
if (elem > 0) {
|
457
|
+
match_start = (elem >> 11) + (elem & 0x7ff);
|
458
|
+
} else {
|
459
|
+
match_start = res[++i] - elem;
|
460
|
+
}
|
461
|
+
} else {
|
462
|
+
override[0] = elem;
|
463
|
+
override[1] = match_start;
|
464
|
+
lastMatchInfoOverride = override;
|
465
|
+
var func_result = replace.call(null, elem, match_start, subject);
|
466
|
+
if (!IS_STRING(func_result)) {
|
467
|
+
func_result = NonStringToString(func_result);
|
468
|
+
}
|
469
|
+
res[i] = func_result;
|
470
|
+
match_start += elem.length;
|
471
|
+
}
|
472
|
+
i++;
|
398
473
|
}
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
474
|
+
} else {
|
475
|
+
while (i < len) {
|
476
|
+
var elem = res[i];
|
477
|
+
if (!%_IsSmi(elem)) {
|
478
|
+
// elem must be an Array.
|
479
|
+
// Use the apply argument as backing for global RegExp properties.
|
480
|
+
lastMatchInfoOverride = elem;
|
481
|
+
var func_result = replace.apply(null, elem);
|
482
|
+
if (!IS_STRING(func_result)) {
|
483
|
+
func_result = NonStringToString(func_result);
|
484
|
+
}
|
485
|
+
res[i] = func_result;
|
408
486
|
}
|
409
|
-
|
487
|
+
i++;
|
410
488
|
}
|
411
|
-
|
412
|
-
// Per ECMA-262 15.10.6.2, if the previous index is greater than the
|
413
|
-
// string length, there is no match
|
414
|
-
matchInfo = (previous > subject.length)
|
415
|
-
? null
|
416
|
-
: DoRegExpExec(regexp, subject, previous);
|
417
|
-
} while (!IS_NULL(matchInfo));
|
418
|
-
|
419
|
-
// Tack on the final right substring after the last match, if necessary.
|
420
|
-
if (previous < subject.length) {
|
421
|
-
result.addSpecialSlice(previous, subject.length);
|
422
489
|
}
|
490
|
+
var resultBuilder = new ReplaceResultBuilder(subject, res);
|
491
|
+
var result = resultBuilder.generate();
|
492
|
+
resultArray.length = 0;
|
493
|
+
reusableReplaceArray = resultArray;
|
494
|
+
return result;
|
423
495
|
} else { // Not a global regexp, no need to loop.
|
496
|
+
var matchInfo = DoRegExpExec(regexp, subject, 0);
|
497
|
+
if (IS_NULL(matchInfo)) return subject;
|
498
|
+
|
499
|
+
var result = new ReplaceResultBuilder(subject);
|
424
500
|
result.addSpecialSlice(0, matchInfo[CAPTURE0]);
|
425
501
|
var endOfMatch = matchInfo[CAPTURE1];
|
426
502
|
result.add(ApplyReplacementFunction(replace, matchInfo, subject));
|
427
503
|
// Can't use matchInfo any more from here, since the function could
|
428
504
|
// overwrite it.
|
429
505
|
result.addSpecialSlice(endOfMatch, subject.length);
|
506
|
+
return result.generate();
|
430
507
|
}
|
431
|
-
|
432
|
-
return result.generate();
|
433
508
|
}
|
434
509
|
|
435
510
|
|
@@ -454,25 +529,28 @@ function ApplyReplacementFunction(replace, matchInfo, subject) {
|
|
454
529
|
return replace.apply(null, parameters);
|
455
530
|
}
|
456
531
|
|
457
|
-
|
458
532
|
// ECMA-262 section 15.5.4.12
|
459
533
|
function StringSearch(re) {
|
460
|
-
var regexp
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
534
|
+
var regexp;
|
535
|
+
if (IS_STRING(re)) {
|
536
|
+
regexp = %_GetFromCache(STRING_TO_REGEXP_CACHE_ID, re);
|
537
|
+
} else if (IS_REGEXP(re)) {
|
538
|
+
regexp = re;
|
539
|
+
} else {
|
540
|
+
regexp = new $RegExp(re);
|
541
|
+
}
|
542
|
+
var s = TO_STRING_INLINE(this);
|
543
|
+
var match = DoRegExpExec(regexp, s, 0);
|
544
|
+
if (match) {
|
545
|
+
return match[CAPTURE0];
|
546
|
+
}
|
547
|
+
return -1;
|
470
548
|
}
|
471
549
|
|
472
550
|
|
473
551
|
// ECMA-262 section 15.5.4.13
|
474
552
|
function StringSlice(start, end) {
|
475
|
-
var s =
|
553
|
+
var s = TO_STRING_INLINE(this);
|
476
554
|
var s_len = s.length;
|
477
555
|
var start_i = TO_INTEGER(start);
|
478
556
|
var end_i = s_len;
|
@@ -507,13 +585,13 @@ function StringSlice(start, end) {
|
|
507
585
|
|
508
586
|
// ECMA-262 section 15.5.4.14
|
509
587
|
function StringSplit(separator, limit) {
|
510
|
-
var subject =
|
588
|
+
var subject = TO_STRING_INLINE(this);
|
511
589
|
limit = (IS_UNDEFINED(limit)) ? 0xffffffff : TO_UINT32(limit);
|
512
590
|
if (limit === 0) return [];
|
513
591
|
|
514
592
|
// ECMA-262 says that if separator is undefined, the result should
|
515
593
|
// be an array of size 1 containing the entire string. SpiderMonkey
|
516
|
-
// and KJS have this
|
594
|
+
// and KJS have this behavior only when no separator is given. If
|
517
595
|
// undefined is explicitly given, they convert it to a string and
|
518
596
|
// use that. We do as SpiderMonkey and KJS.
|
519
597
|
if (%_ArgumentsLength() === 0) {
|
@@ -521,20 +599,44 @@ function StringSplit(separator, limit) {
|
|
521
599
|
}
|
522
600
|
|
523
601
|
var length = subject.length;
|
524
|
-
if (IS_REGEXP(separator)) {
|
525
|
-
|
526
|
-
|
527
|
-
|
602
|
+
if (!IS_REGEXP(separator)) {
|
603
|
+
separator = TO_STRING_INLINE(separator);
|
604
|
+
var separator_length = separator.length;
|
605
|
+
|
528
606
|
// If the separator string is empty then return the elements in the subject.
|
529
|
-
if (
|
530
|
-
|
531
|
-
|
532
|
-
|
607
|
+
if (separator_length === 0) return %StringToArray(subject);
|
608
|
+
|
609
|
+
var result = %StringSplit(subject, separator, limit);
|
610
|
+
|
611
|
+
return result;
|
612
|
+
}
|
613
|
+
|
614
|
+
var cache = regExpCache;
|
615
|
+
var saveAnswer = false;
|
616
|
+
|
617
|
+
if (%_ObjectEquals(cache.type, 'split') &&
|
618
|
+
%_ObjectEquals(cache.regExp, separator) &&
|
619
|
+
%_ObjectEquals(cache.subject, subject)) {
|
620
|
+
if (cache.answerSaved) {
|
621
|
+
return CloneDenseArray(cache.answer);
|
622
|
+
} else {
|
623
|
+
saveAnswer = true;
|
533
624
|
}
|
534
625
|
}
|
535
626
|
|
627
|
+
cache.type = 'split';
|
628
|
+
cache.regExp = separator;
|
629
|
+
cache.subject = subject;
|
630
|
+
|
631
|
+
%_Log('regexp', 'regexp-split,%0S,%1r', [subject, separator]);
|
632
|
+
|
536
633
|
if (length === 0) {
|
537
|
-
|
634
|
+
cache.answerSaved = true;
|
635
|
+
if (splitMatch(separator, subject, 0, 0) != null) {
|
636
|
+
cache.answer = [];
|
637
|
+
return [];
|
638
|
+
}
|
639
|
+
cache.answer = [subject];
|
538
640
|
return [subject];
|
539
641
|
}
|
540
642
|
|
@@ -542,18 +644,19 @@ function StringSplit(separator, limit) {
|
|
542
644
|
var startIndex = 0;
|
543
645
|
var result = [];
|
544
646
|
|
647
|
+
outer_loop:
|
545
648
|
while (true) {
|
546
649
|
|
547
650
|
if (startIndex === length) {
|
548
651
|
result[result.length] = subject.slice(currentIndex, length);
|
549
|
-
|
652
|
+
break;
|
550
653
|
}
|
551
654
|
|
552
655
|
var matchInfo = splitMatch(separator, subject, currentIndex, startIndex);
|
553
656
|
|
554
657
|
if (IS_NULL(matchInfo)) {
|
555
658
|
result[result.length] = subject.slice(currentIndex, length);
|
556
|
-
|
659
|
+
break;
|
557
660
|
}
|
558
661
|
|
559
662
|
var endIndex = matchInfo[CAPTURE1];
|
@@ -565,9 +668,10 @@ function StringSplit(separator, limit) {
|
|
565
668
|
}
|
566
669
|
|
567
670
|
result[result.length] = SubString(subject, currentIndex, matchInfo[CAPTURE0]);
|
568
|
-
if (result.length === limit)
|
671
|
+
if (result.length === limit) break;
|
569
672
|
|
570
|
-
|
673
|
+
var num_captures = NUMBER_OF_CAPTURES(matchInfo);
|
674
|
+
for (var i = 2; i < num_captures; i += 2) {
|
571
675
|
var start = matchInfo[CAPTURE(i)];
|
572
676
|
var end = matchInfo[CAPTURE(i + 1)];
|
573
677
|
if (start != -1 && end != -1) {
|
@@ -575,11 +679,14 @@ function StringSplit(separator, limit) {
|
|
575
679
|
} else {
|
576
680
|
result[result.length] = void 0;
|
577
681
|
}
|
578
|
-
if (result.length === limit)
|
682
|
+
if (result.length === limit) break outer_loop;
|
579
683
|
}
|
580
684
|
|
581
685
|
startIndex = currentIndex = endIndex;
|
582
686
|
}
|
687
|
+
if (saveAnswer) cache.answer = CloneDenseArray(result);
|
688
|
+
cache.answerSaved = saveAnswer;
|
689
|
+
return result;
|
583
690
|
}
|
584
691
|
|
585
692
|
|
@@ -587,28 +694,18 @@ function StringSplit(separator, limit) {
|
|
587
694
|
// Helper function used by split. This version returns the matchInfo
|
588
695
|
// instead of allocating a new array with basically the same information.
|
589
696
|
function splitMatch(separator, subject, current_index, start_index) {
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
}
|
598
|
-
|
599
|
-
var separatorIndex = subject.indexOf(separator, start_index);
|
600
|
-
if (separatorIndex === -1) return null;
|
601
|
-
|
602
|
-
reusableMatchInfo[CAPTURE0] = separatorIndex;
|
603
|
-
reusableMatchInfo[CAPTURE1] = separatorIndex + separator.length;
|
604
|
-
return reusableMatchInfo;
|
605
|
-
};
|
697
|
+
var matchInfo = DoRegExpExec(separator, subject, start_index);
|
698
|
+
if (matchInfo == null) return null;
|
699
|
+
// Section 15.5.4.14 paragraph two says that we do not allow zero length
|
700
|
+
// matches at the end of the string.
|
701
|
+
if (matchInfo[CAPTURE0] === subject.length) return null;
|
702
|
+
return matchInfo;
|
703
|
+
}
|
606
704
|
|
607
705
|
|
608
706
|
// ECMA-262 section 15.5.4.15
|
609
707
|
function StringSubstring(start, end) {
|
610
|
-
var s = this;
|
611
|
-
if (!IS_STRING(s)) s = ToString(s);
|
708
|
+
var s = TO_STRING_INLINE(this);
|
612
709
|
var s_len = s.length;
|
613
710
|
|
614
711
|
var start_i = TO_INTEGER(start);
|
@@ -639,7 +736,7 @@ function StringSubstring(start, end) {
|
|
639
736
|
|
640
737
|
// This is not a part of ECMA-262.
|
641
738
|
function StringSubstr(start, n) {
|
642
|
-
var s =
|
739
|
+
var s = TO_STRING_INLINE(this);
|
643
740
|
var len;
|
644
741
|
|
645
742
|
// Correct n: If not given, set to string length; if explicitly
|
@@ -677,60 +774,70 @@ function StringSubstr(start, n) {
|
|
677
774
|
|
678
775
|
// ECMA-262, 15.5.4.16
|
679
776
|
function StringToLowerCase() {
|
680
|
-
return %StringToLowerCase(
|
777
|
+
return %StringToLowerCase(TO_STRING_INLINE(this));
|
681
778
|
}
|
682
779
|
|
683
780
|
|
684
781
|
// ECMA-262, 15.5.4.17
|
685
782
|
function StringToLocaleLowerCase() {
|
686
|
-
return %StringToLowerCase(
|
783
|
+
return %StringToLowerCase(TO_STRING_INLINE(this));
|
687
784
|
}
|
688
785
|
|
689
786
|
|
690
787
|
// ECMA-262, 15.5.4.18
|
691
788
|
function StringToUpperCase() {
|
692
|
-
return %StringToUpperCase(
|
789
|
+
return %StringToUpperCase(TO_STRING_INLINE(this));
|
693
790
|
}
|
694
791
|
|
695
792
|
|
696
793
|
// ECMA-262, 15.5.4.19
|
697
794
|
function StringToLocaleUpperCase() {
|
698
|
-
return %StringToUpperCase(
|
795
|
+
return %StringToUpperCase(TO_STRING_INLINE(this));
|
699
796
|
}
|
700
797
|
|
701
798
|
// ES5, 15.5.4.20
|
702
799
|
function StringTrim() {
|
703
|
-
return %StringTrim(
|
800
|
+
return %StringTrim(TO_STRING_INLINE(this), true, true);
|
704
801
|
}
|
705
802
|
|
706
803
|
function StringTrimLeft() {
|
707
|
-
return %StringTrim(
|
804
|
+
return %StringTrim(TO_STRING_INLINE(this), true, false);
|
708
805
|
}
|
709
806
|
|
710
807
|
function StringTrimRight() {
|
711
|
-
return %StringTrim(
|
808
|
+
return %StringTrim(TO_STRING_INLINE(this), false, true);
|
712
809
|
}
|
713
810
|
|
811
|
+
var static_charcode_array = new $Array(4);
|
812
|
+
|
714
813
|
// ECMA-262, section 15.5.3.2
|
715
814
|
function StringFromCharCode(code) {
|
716
815
|
var n = %_ArgumentsLength();
|
717
|
-
if (n == 1)
|
816
|
+
if (n == 1) {
|
817
|
+
if (!%_IsSmi(code)) code = ToNumber(code);
|
818
|
+
return %_CharFromCode(code & 0xffff);
|
819
|
+
}
|
718
820
|
|
719
821
|
// NOTE: This is not super-efficient, but it is necessary because we
|
720
822
|
// want to avoid converting to numbers from within the virtual
|
721
823
|
// machine. Maybe we can find another way of doing this?
|
722
|
-
var codes =
|
723
|
-
for (var i = 0; i < n; i++)
|
824
|
+
var codes = static_charcode_array;
|
825
|
+
for (var i = 0; i < n; i++) {
|
826
|
+
var code = %_Arguments(i);
|
827
|
+
if (!%_IsSmi(code)) code = ToNumber(code);
|
828
|
+
codes[i] = code;
|
829
|
+
}
|
830
|
+
codes.length = n;
|
724
831
|
return %StringFromCharCodeArray(codes);
|
725
832
|
}
|
726
833
|
|
727
834
|
|
728
835
|
// Helper function for very basic XSS protection.
|
729
836
|
function HtmlEscape(str) {
|
730
|
-
return
|
731
|
-
|
732
|
-
|
733
|
-
|
837
|
+
return TO_STRING_INLINE(str).replace(/</g, "<")
|
838
|
+
.replace(/>/g, ">")
|
839
|
+
.replace(/"/g, """)
|
840
|
+
.replace(/'/g, "'");
|
734
841
|
};
|
735
842
|
|
736
843
|
|
@@ -803,13 +910,17 @@ function StringSup() {
|
|
803
910
|
|
804
911
|
// ReplaceResultBuilder support.
|
805
912
|
function ReplaceResultBuilder(str) {
|
806
|
-
|
913
|
+
if (%_ArgumentsLength() > 1) {
|
914
|
+
this.elements = %_Arguments(1);
|
915
|
+
} else {
|
916
|
+
this.elements = new $Array();
|
917
|
+
}
|
807
918
|
this.special_string = str;
|
808
919
|
}
|
809
920
|
|
810
921
|
|
811
922
|
ReplaceResultBuilder.prototype.add = function(str) {
|
812
|
-
|
923
|
+
str = TO_STRING_INLINE(str);
|
813
924
|
if (str.length > 0) {
|
814
925
|
var elements = this.elements;
|
815
926
|
elements[elements.length] = str;
|
@@ -819,10 +930,10 @@ ReplaceResultBuilder.prototype.add = function(str) {
|
|
819
930
|
|
820
931
|
ReplaceResultBuilder.prototype.addSpecialSlice = function(start, end) {
|
821
932
|
var len = end - start;
|
822
|
-
if (len
|
933
|
+
if (start < 0 || len <= 0) return;
|
823
934
|
var elements = this.elements;
|
824
935
|
if (start < 0x80000 && len < 0x800) {
|
825
|
-
elements[elements.length] = (start << 11)
|
936
|
+
elements[elements.length] = (start << 11) | len;
|
826
937
|
} else {
|
827
938
|
// 0 < len <= String::kMaxLength and Smi::kMaxValue >= String::kMaxLength,
|
828
939
|
// so -len is a smi.
|