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
@@ -32,10 +32,6 @@
|
|
32
32
|
namespace v8 {
|
33
33
|
namespace internal {
|
34
34
|
|
35
|
-
#ifdef ENABLE_OPROFILE_AGENT
|
36
|
-
op_agent_t OProfileAgent::handle_ = NULL;
|
37
|
-
#endif
|
38
|
-
|
39
35
|
|
40
36
|
bool OProfileAgent::Initialize() {
|
41
37
|
#ifdef ENABLE_OPROFILE_AGENT
|
@@ -70,47 +66,43 @@ void OProfileAgent::TearDown() {
|
|
70
66
|
}
|
71
67
|
|
72
68
|
|
69
|
+
#ifdef ENABLE_OPROFILE_AGENT
|
70
|
+
op_agent_t OProfileAgent::handle_ = NULL;
|
71
|
+
|
72
|
+
|
73
73
|
void OProfileAgent::CreateNativeCodeRegion(const char* name,
|
74
74
|
const void* ptr, unsigned int size) {
|
75
|
-
#ifdef ENABLE_OPROFILE_AGENT
|
76
|
-
if (handle_ == NULL) return;
|
77
75
|
op_write_native_code(handle_, name, (uint64_t)ptr, ptr, size);
|
78
|
-
#endif
|
79
76
|
}
|
80
77
|
|
81
78
|
|
82
79
|
void OProfileAgent::CreateNativeCodeRegion(String* name,
|
83
80
|
const void* ptr, unsigned int size) {
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
func_name = name->length() > 0 ? *str : "<anonymous>";
|
90
|
-
CreateNativeCodeRegion(func_name, ptr, size);
|
91
|
-
}
|
92
|
-
#endif
|
81
|
+
const char* func_name;
|
82
|
+
SmartPointer<char> str =
|
83
|
+
name->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL);
|
84
|
+
func_name = name->length() > 0 ? *str : "<anonymous>";
|
85
|
+
CreateNativeCodeRegion(func_name, ptr, size);
|
93
86
|
}
|
94
87
|
|
95
88
|
|
96
89
|
void OProfileAgent::CreateNativeCodeRegion(String* name, String* source,
|
97
90
|
int line_num, const void* ptr, unsigned int size) {
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
} else {
|
111
|
-
CreateNativeCodeRegion("<script/func name too long>", ptr, size);
|
112
|
-
}
|
91
|
+
Vector<char> buf = Vector<char>::New(OProfileAgent::kFormattingBufSize);
|
92
|
+
const char* func_name;
|
93
|
+
SmartPointer<char> str =
|
94
|
+
name->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL);
|
95
|
+
func_name = name->length() > 0 ? *str : "<anonymous>";
|
96
|
+
SmartPointer<char> source_str =
|
97
|
+
source->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL);
|
98
|
+
if (v8::internal::OS::SNPrintF(buf, "%s %s:%d",
|
99
|
+
func_name, *source_str, line_num) != -1) {
|
100
|
+
CreateNativeCodeRegion(buf.start(), ptr, size);
|
101
|
+
} else {
|
102
|
+
CreateNativeCodeRegion("<script/func name too long>", ptr, size);
|
113
103
|
}
|
114
|
-
#endif
|
115
104
|
}
|
116
|
-
|
105
|
+
|
106
|
+
#endif // ENABLE_OPROFILE_AGENT
|
107
|
+
|
108
|
+
} } // namespace v8::internal
|
@@ -37,6 +37,14 @@
|
|
37
37
|
// system headers (they have __uint64_t), but is defined
|
38
38
|
// in V8's headers.
|
39
39
|
#include <opagent.h> // NOLINT
|
40
|
+
|
41
|
+
#define OPROFILE(Call) \
|
42
|
+
do { \
|
43
|
+
if (v8::internal::OProfileAgent::is_enabled()) \
|
44
|
+
v8::internal::OProfileAgent::Call; \
|
45
|
+
} while (false)
|
46
|
+
#else
|
47
|
+
#define OPROFILE(Call) ((void) 0)
|
40
48
|
#endif
|
41
49
|
|
42
50
|
namespace v8 {
|
@@ -46,13 +54,13 @@ class OProfileAgent {
|
|
46
54
|
public:
|
47
55
|
static bool Initialize();
|
48
56
|
static void TearDown();
|
57
|
+
#ifdef ENABLE_OPROFILE_AGENT
|
49
58
|
static void CreateNativeCodeRegion(const char* name,
|
50
59
|
const void* ptr, unsigned int size);
|
51
60
|
static void CreateNativeCodeRegion(String* name,
|
52
61
|
const void* ptr, unsigned int size);
|
53
62
|
static void CreateNativeCodeRegion(String* name, String* source, int line_num,
|
54
63
|
const void* ptr, unsigned int size);
|
55
|
-
#ifdef ENABLE_OPROFILE_AGENT
|
56
64
|
static bool is_enabled() { return handle_ != NULL; }
|
57
65
|
|
58
66
|
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:
|
@@ -30,7 +30,9 @@
|
|
30
30
|
#include "api.h"
|
31
31
|
#include "ast.h"
|
32
32
|
#include "bootstrapper.h"
|
33
|
+
#include "codegen.h"
|
33
34
|
#include "compiler.h"
|
35
|
+
#include "messages.h"
|
34
36
|
#include "platform.h"
|
35
37
|
#include "runtime.h"
|
36
38
|
#include "parser.h"
|
@@ -91,7 +93,7 @@ class PositionStack {
|
|
91
93
|
class Parser {
|
92
94
|
public:
|
93
95
|
Parser(Handle<Script> script, bool allow_natives_syntax,
|
94
|
-
v8::Extension* extension,
|
96
|
+
v8::Extension* extension, ParserMode is_pre_parsing,
|
95
97
|
ParserFactory* factory, ParserLog* log, ScriptDataImpl* pre_data);
|
96
98
|
virtual ~Parser() { }
|
97
99
|
|
@@ -107,11 +109,13 @@ class Parser {
|
|
107
109
|
|
108
110
|
// Returns NULL if parsing failed.
|
109
111
|
FunctionLiteral* ParseProgram(Handle<String> source,
|
110
|
-
unibrow::CharacterStream* stream,
|
111
112
|
bool in_global_context);
|
112
113
|
FunctionLiteral* ParseLazy(Handle<String> source,
|
113
114
|
Handle<String> name,
|
114
|
-
int start_position,
|
115
|
+
int start_position,
|
116
|
+
int end_position,
|
117
|
+
bool is_expression);
|
118
|
+
FunctionLiteral* ParseJson(Handle<String> source);
|
115
119
|
|
116
120
|
// The minimum number of contiguous assignment that will
|
117
121
|
// be treated as an initialization block. Benchmarks show that
|
@@ -144,6 +148,7 @@ class Parser {
|
|
144
148
|
ParserLog* log_;
|
145
149
|
bool is_pre_parsing_;
|
146
150
|
ScriptDataImpl* pre_data_;
|
151
|
+
bool seen_loop_stmt_; // Used for inner loop detection.
|
147
152
|
|
148
153
|
bool inside_with() const { return with_nesting_level_ > 0; }
|
149
154
|
ParserFactory* factory() const { return factory_; }
|
@@ -202,7 +207,22 @@ class Parser {
|
|
202
207
|
Expression* ParseObjectLiteral(bool* ok);
|
203
208
|
Expression* ParseRegExpLiteral(bool seen_equal, bool* ok);
|
204
209
|
|
205
|
-
//
|
210
|
+
// Populate the constant properties fixed array for a materialized object
|
211
|
+
// literal.
|
212
|
+
void BuildObjectLiteralConstantProperties(
|
213
|
+
ZoneList<ObjectLiteral::Property*>* properties,
|
214
|
+
Handle<FixedArray> constants,
|
215
|
+
bool* is_simple,
|
216
|
+
bool* fast_elements,
|
217
|
+
int* depth);
|
218
|
+
|
219
|
+
// Populate the literals fixed array for a materialized array literal.
|
220
|
+
void BuildArrayLiteralBoilerplateLiterals(ZoneList<Expression*>* properties,
|
221
|
+
Handle<FixedArray> constants,
|
222
|
+
bool* is_simple,
|
223
|
+
int* depth);
|
224
|
+
|
225
|
+
// Decide if a property should be in the object boilerplate.
|
206
226
|
bool IsBoilerplateProperty(ObjectLiteral::Property* property);
|
207
227
|
// If the expression is a literal, return the literal value;
|
208
228
|
// if the expression is a materialized literal and is simple return a
|
@@ -231,6 +251,7 @@ class Parser {
|
|
231
251
|
INLINE(Token::Value Next()) { return scanner_.Next(); }
|
232
252
|
INLINE(void Consume(Token::Value token));
|
233
253
|
void Expect(Token::Value token, bool* ok);
|
254
|
+
bool Check(Token::Value token);
|
234
255
|
void ExpectSemicolon(bool* ok);
|
235
256
|
|
236
257
|
// Get odd-ball literals.
|
@@ -277,6 +298,29 @@ class Parser {
|
|
277
298
|
Handle<String> type,
|
278
299
|
Vector< Handle<Object> > arguments);
|
279
300
|
|
301
|
+
// JSON is a subset of JavaScript, as specified in, e.g., the ECMAScript 5
|
302
|
+
// specification section 15.12.1 (and appendix A.8).
|
303
|
+
// The grammar is given section 15.12.1.2 (and appendix A.8.2).
|
304
|
+
|
305
|
+
// Parse JSON input as a single JSON value.
|
306
|
+
Expression* ParseJson(bool* ok);
|
307
|
+
|
308
|
+
// Parse a single JSON value from input (grammar production JSONValue).
|
309
|
+
// A JSON value is either a (double-quoted) string literal, a number literal,
|
310
|
+
// one of "true", "false", or "null", or an object or array literal.
|
311
|
+
Expression* ParseJsonValue(bool* ok);
|
312
|
+
// Parse a JSON object literal (grammar production JSONObject).
|
313
|
+
// An object literal is a squiggly-braced and comma separated sequence
|
314
|
+
// (possibly empty) of key/value pairs, where the key is a JSON string
|
315
|
+
// literal, the value is a JSON value, and the two are spearated by a colon.
|
316
|
+
// A JavaScript object also allows numbers and identifiers as keys.
|
317
|
+
Expression* ParseJsonObject(bool* ok);
|
318
|
+
// Parses a JSON array literal (grammar production JSONArray). An array
|
319
|
+
// literal is a square-bracketed and comma separated sequence (possibly empty)
|
320
|
+
// of JSON values.
|
321
|
+
// A JavaScript array allows leaving out values from the sequence.
|
322
|
+
Expression* ParseJsonArray(bool* ok);
|
323
|
+
|
280
324
|
friend class Target;
|
281
325
|
friend class TargetScope;
|
282
326
|
friend class LexicalScope;
|
@@ -983,7 +1027,7 @@ class AstBuildingParser : public Parser {
|
|
983
1027
|
public:
|
984
1028
|
AstBuildingParser(Handle<Script> script, bool allow_natives_syntax,
|
985
1029
|
v8::Extension* extension, ScriptDataImpl* pre_data)
|
986
|
-
: Parser(script, allow_natives_syntax, extension,
|
1030
|
+
: Parser(script, allow_natives_syntax, extension, PARSE,
|
987
1031
|
factory(), log(), pre_data) { }
|
988
1032
|
virtual void ReportMessageAt(Scanner::Location loc, const char* message,
|
989
1033
|
Vector<const char*> args);
|
@@ -1002,9 +1046,9 @@ class PreParser : public Parser {
|
|
1002
1046
|
public:
|
1003
1047
|
PreParser(Handle<Script> script, bool allow_natives_syntax,
|
1004
1048
|
v8::Extension* extension)
|
1005
|
-
: Parser(script, allow_natives_syntax, extension,
|
1006
|
-
factory(), recorder(), NULL)
|
1007
|
-
|
1049
|
+
: Parser(script, allow_natives_syntax, extension, PREPARSE,
|
1050
|
+
factory(), recorder(), NULL),
|
1051
|
+
factory_(true) { }
|
1008
1052
|
virtual void ReportMessageAt(Scanner::Location loc, const char* message,
|
1009
1053
|
Vector<const char*> args);
|
1010
1054
|
virtual VariableProxy* Declare(Handle<String> name, Variable::Mode mode,
|
@@ -1147,7 +1191,7 @@ class LexicalScope BASE_EMBEDDED {
|
|
1147
1191
|
Parser::Parser(Handle<Script> script,
|
1148
1192
|
bool allow_natives_syntax,
|
1149
1193
|
v8::Extension* extension,
|
1150
|
-
|
1194
|
+
ParserMode is_pre_parsing,
|
1151
1195
|
ParserFactory* factory,
|
1152
1196
|
ParserLog* log,
|
1153
1197
|
ScriptDataImpl* pre_data)
|
@@ -1161,8 +1205,9 @@ Parser::Parser(Handle<Script> script,
|
|
1161
1205
|
extension_(extension),
|
1162
1206
|
factory_(factory),
|
1163
1207
|
log_(log),
|
1164
|
-
is_pre_parsing_(is_pre_parsing),
|
1165
|
-
pre_data_(pre_data)
|
1208
|
+
is_pre_parsing_(is_pre_parsing == PREPARSE),
|
1209
|
+
pre_data_(pre_data),
|
1210
|
+
seen_loop_stmt_(false) {
|
1166
1211
|
}
|
1167
1212
|
|
1168
1213
|
|
@@ -1172,7 +1217,7 @@ bool Parser::PreParseProgram(Handle<String> source,
|
|
1172
1217
|
AssertNoZoneAllocation assert_no_zone_allocation;
|
1173
1218
|
AssertNoAllocation assert_no_allocation;
|
1174
1219
|
NoHandleAllocation no_handle_allocation;
|
1175
|
-
scanner_.
|
1220
|
+
scanner_.Initialize(source, stream, JAVASCRIPT);
|
1176
1221
|
ASSERT(target_stack_ == NULL);
|
1177
1222
|
mode_ = PARSE_EAGERLY;
|
1178
1223
|
DummyScope top_scope;
|
@@ -1186,7 +1231,6 @@ bool Parser::PreParseProgram(Handle<String> source,
|
|
1186
1231
|
|
1187
1232
|
|
1188
1233
|
FunctionLiteral* Parser::ParseProgram(Handle<String> source,
|
1189
|
-
unibrow::CharacterStream* stream,
|
1190
1234
|
bool in_global_context) {
|
1191
1235
|
CompilationZoneScope zone_scope(DONT_DELETE_ON_EXIT);
|
1192
1236
|
|
@@ -1194,8 +1238,8 @@ FunctionLiteral* Parser::ParseProgram(Handle<String> source,
|
|
1194
1238
|
Counters::total_parse_size.Increment(source->length());
|
1195
1239
|
|
1196
1240
|
// Initialize parser state.
|
1197
|
-
source->
|
1198
|
-
scanner_.
|
1241
|
+
source->TryFlatten();
|
1242
|
+
scanner_.Initialize(source, JAVASCRIPT);
|
1199
1243
|
ASSERT(target_stack_ == NULL);
|
1200
1244
|
|
1201
1245
|
// Compute the parsing mode.
|
@@ -1246,15 +1290,15 @@ FunctionLiteral* Parser::ParseProgram(Handle<String> source,
|
|
1246
1290
|
FunctionLiteral* Parser::ParseLazy(Handle<String> source,
|
1247
1291
|
Handle<String> name,
|
1248
1292
|
int start_position,
|
1293
|
+
int end_position,
|
1249
1294
|
bool is_expression) {
|
1250
1295
|
CompilationZoneScope zone_scope(DONT_DELETE_ON_EXIT);
|
1251
1296
|
HistogramTimerScope timer(&Counters::parse_lazy);
|
1252
|
-
source->TryFlattenIfNotFlat();
|
1253
1297
|
Counters::total_parse_size.Increment(source->length());
|
1254
|
-
SafeStringInputBuffer buffer(source.location());
|
1255
1298
|
|
1256
1299
|
// Initialize parser state.
|
1257
|
-
|
1300
|
+
source->TryFlatten();
|
1301
|
+
scanner_.Initialize(source, start_position, end_position, JAVASCRIPT);
|
1258
1302
|
ASSERT(target_stack_ == NULL);
|
1259
1303
|
mode_ = PARSE_EAGERLY;
|
1260
1304
|
|
@@ -1290,6 +1334,54 @@ FunctionLiteral* Parser::ParseLazy(Handle<String> source,
|
|
1290
1334
|
return result;
|
1291
1335
|
}
|
1292
1336
|
|
1337
|
+
FunctionLiteral* Parser::ParseJson(Handle<String> source) {
|
1338
|
+
CompilationZoneScope zone_scope(DONT_DELETE_ON_EXIT);
|
1339
|
+
|
1340
|
+
HistogramTimerScope timer(&Counters::parse);
|
1341
|
+
Counters::total_parse_size.Increment(source->length());
|
1342
|
+
|
1343
|
+
// Initialize parser state.
|
1344
|
+
source->TryFlatten(TENURED);
|
1345
|
+
scanner_.Initialize(source, JSON);
|
1346
|
+
ASSERT(target_stack_ == NULL);
|
1347
|
+
|
1348
|
+
FunctionLiteral* result = NULL;
|
1349
|
+
Handle<String> no_name = factory()->EmptySymbol();
|
1350
|
+
|
1351
|
+
{
|
1352
|
+
Scope* scope = factory()->NewScope(top_scope_, Scope::GLOBAL_SCOPE, false);
|
1353
|
+
LexicalScope lexical_scope(this, scope);
|
1354
|
+
TemporaryScope temp_scope(this);
|
1355
|
+
bool ok = true;
|
1356
|
+
Expression* expression = ParseJson(&ok);
|
1357
|
+
if (ok) {
|
1358
|
+
ZoneListWrapper<Statement> statement = factory()->NewList<Statement>(1);
|
1359
|
+
statement.Add(new ExpressionStatement(expression));
|
1360
|
+
result = NEW(FunctionLiteral(
|
1361
|
+
no_name,
|
1362
|
+
top_scope_,
|
1363
|
+
statement.elements(),
|
1364
|
+
temp_scope.materialized_literal_count(),
|
1365
|
+
temp_scope.expected_property_count(),
|
1366
|
+
temp_scope.only_simple_this_property_assignments(),
|
1367
|
+
temp_scope.this_property_assignments(),
|
1368
|
+
0,
|
1369
|
+
0,
|
1370
|
+
source->length(),
|
1371
|
+
false));
|
1372
|
+
} else if (scanner().stack_overflow()) {
|
1373
|
+
Top::StackOverflow();
|
1374
|
+
}
|
1375
|
+
}
|
1376
|
+
|
1377
|
+
// Make sure the target stack is empty.
|
1378
|
+
ASSERT(target_stack_ == NULL);
|
1379
|
+
|
1380
|
+
// If there was a syntax error we have to get rid of the AST
|
1381
|
+
// and it is not safe to do so before the scope has been deleted.
|
1382
|
+
if (result == NULL) zone_scope.DeleteOnExit();
|
1383
|
+
return result;
|
1384
|
+
}
|
1293
1385
|
|
1294
1386
|
void Parser::ReportMessage(const char* type, Vector<const char*> args) {
|
1295
1387
|
Scanner::Location source_location = scanner_.location();
|
@@ -1495,13 +1587,15 @@ class ThisNamedPropertyAssigmentFinder : public ParserFinder {
|
|
1495
1587
|
}
|
1496
1588
|
|
1497
1589
|
void HandleThisPropertyAssignment(Scope* scope, Assignment* assignment) {
|
1498
|
-
// Check that the property assigned to is a named property
|
1590
|
+
// Check that the property assigned to is a named property, which is not
|
1591
|
+
// __proto__.
|
1499
1592
|
Property* property = assignment->target()->AsProperty();
|
1500
1593
|
ASSERT(property != NULL);
|
1501
1594
|
Literal* literal = property->key()->AsLiteral();
|
1502
1595
|
uint32_t dummy;
|
1503
1596
|
if (literal != NULL &&
|
1504
1597
|
literal->handle()->IsString() &&
|
1598
|
+
!String::cast(*(literal->handle()))->Equals(Heap::Proto_symbol()) &&
|
1505
1599
|
!String::cast(*(literal->handle()))->AsArrayIndex(&dummy)) {
|
1506
1600
|
Handle<String> key = Handle<String>::cast(literal->handle());
|
1507
1601
|
|
@@ -1601,7 +1695,8 @@ void* Parser::ParseSourceElements(ZoneListWrapper<Statement>* processor,
|
|
1601
1695
|
// Propagate the collected information on this property assignments.
|
1602
1696
|
if (top_scope_->is_function_scope()) {
|
1603
1697
|
bool only_simple_this_property_assignments =
|
1604
|
-
this_property_assignment_finder.only_simple_this_property_assignments()
|
1698
|
+
this_property_assignment_finder.only_simple_this_property_assignments()
|
1699
|
+
&& top_scope_->declarations()->length() == 0;
|
1605
1700
|
if (only_simple_this_property_assignments) {
|
1606
1701
|
temp_scope_->SetThisPropertyAssignmentInfo(
|
1607
1702
|
only_simple_this_property_assignments,
|
@@ -1864,25 +1959,24 @@ Statement* Parser::ParseNativeDeclaration(bool* ok) {
|
|
1864
1959
|
extension_->GetNativeFunction(v8::Utils::ToLocal(name));
|
1865
1960
|
ASSERT(!fun_template.IsEmpty());
|
1866
1961
|
|
1867
|
-
// Instantiate the function and create a
|
1962
|
+
// Instantiate the function and create a shared function info from it.
|
1868
1963
|
Handle<JSFunction> fun = Utils::OpenHandle(*fun_template->GetFunction());
|
1869
1964
|
const int literals = fun->NumberOfLiterals();
|
1870
1965
|
Handle<Code> code = Handle<Code>(fun->shared()->code());
|
1871
|
-
Handle<
|
1872
|
-
|
1966
|
+
Handle<Code> construct_stub = Handle<Code>(fun->shared()->construct_stub());
|
1967
|
+
Handle<SharedFunctionInfo> shared =
|
1968
|
+
Factory::NewSharedFunctionInfo(name, literals, code);
|
1969
|
+
shared->set_construct_stub(*construct_stub);
|
1873
1970
|
|
1874
|
-
// Copy the function data to the
|
1875
|
-
|
1876
|
-
// find the right native code to call.
|
1877
|
-
boilerplate->shared()->set_function_data(fun->shared()->function_data());
|
1971
|
+
// Copy the function data to the shared function info.
|
1972
|
+
shared->set_function_data(fun->shared()->function_data());
|
1878
1973
|
int parameters = fun->shared()->formal_parameter_count();
|
1879
|
-
|
1974
|
+
shared->set_formal_parameter_count(parameters);
|
1880
1975
|
|
1881
1976
|
// TODO(1240846): It's weird that native function declarations are
|
1882
1977
|
// introduced dynamically when we meet their declarations, whereas
|
1883
1978
|
// other functions are setup when entering the surrounding scope.
|
1884
|
-
|
1885
|
-
NEW(FunctionBoilerplateLiteral(boilerplate));
|
1979
|
+
SharedFunctionInfoLiteral* lit = NEW(SharedFunctionInfoLiteral(shared));
|
1886
1980
|
VariableProxy* var = Declare(name, Variable::VAR, NULL, true, CHECK_OK);
|
1887
1981
|
return NEW(ExpressionStatement(
|
1888
1982
|
new Assignment(Token::INIT_VAR, var, lit, RelocInfo::kNoPosition)));
|
@@ -2551,6 +2645,7 @@ DoWhileStatement* Parser::ParseDoWhileStatement(ZoneStringList* labels,
|
|
2551
2645
|
}
|
2552
2646
|
|
2553
2647
|
Expression* cond = ParseExpression(true, CHECK_OK);
|
2648
|
+
if (cond != NULL) cond->set_is_loop_condition(true);
|
2554
2649
|
Expect(Token::RPAREN, CHECK_OK);
|
2555
2650
|
|
2556
2651
|
// Allow do-statements to be terminated with and without
|
@@ -2560,6 +2655,9 @@ DoWhileStatement* Parser::ParseDoWhileStatement(ZoneStringList* labels,
|
|
2560
2655
|
if (peek() == Token::SEMICOLON) Consume(Token::SEMICOLON);
|
2561
2656
|
|
2562
2657
|
if (loop != NULL) loop->Initialize(cond, body);
|
2658
|
+
|
2659
|
+
seen_loop_stmt_ = true;
|
2660
|
+
|
2563
2661
|
return loop;
|
2564
2662
|
}
|
2565
2663
|
|
@@ -2574,10 +2672,14 @@ WhileStatement* Parser::ParseWhileStatement(ZoneStringList* labels, bool* ok) {
|
|
2574
2672
|
Expect(Token::WHILE, CHECK_OK);
|
2575
2673
|
Expect(Token::LPAREN, CHECK_OK);
|
2576
2674
|
Expression* cond = ParseExpression(true, CHECK_OK);
|
2675
|
+
if (cond != NULL) cond->set_is_loop_condition(true);
|
2577
2676
|
Expect(Token::RPAREN, CHECK_OK);
|
2578
2677
|
Statement* body = ParseStatement(NULL, CHECK_OK);
|
2579
2678
|
|
2580
2679
|
if (loop != NULL) loop->Initialize(cond, body);
|
2680
|
+
|
2681
|
+
seen_loop_stmt_ = true;
|
2682
|
+
|
2581
2683
|
return loop;
|
2582
2684
|
}
|
2583
2685
|
|
@@ -2611,6 +2713,9 @@ Statement* Parser::ParseForStatement(ZoneStringList* labels, bool* ok) {
|
|
2611
2713
|
Block* result = NEW(Block(NULL, 2, false));
|
2612
2714
|
result->AddStatement(variable_statement);
|
2613
2715
|
result->AddStatement(loop);
|
2716
|
+
|
2717
|
+
seen_loop_stmt_ = true;
|
2718
|
+
|
2614
2719
|
// Parsed for-in loop w/ variable/const declaration.
|
2615
2720
|
return result;
|
2616
2721
|
}
|
@@ -2640,6 +2745,8 @@ Statement* Parser::ParseForStatement(ZoneStringList* labels, bool* ok) {
|
|
2640
2745
|
Statement* body = ParseStatement(NULL, CHECK_OK);
|
2641
2746
|
if (loop) loop->Initialize(expression, enumerable, body);
|
2642
2747
|
|
2748
|
+
seen_loop_stmt_ = true;
|
2749
|
+
|
2643
2750
|
// Parsed for-in loop.
|
2644
2751
|
return loop;
|
2645
2752
|
|
@@ -2659,9 +2766,7 @@ Statement* Parser::ParseForStatement(ZoneStringList* labels, bool* ok) {
|
|
2659
2766
|
Expression* cond = NULL;
|
2660
2767
|
if (peek() != Token::SEMICOLON) {
|
2661
2768
|
cond = ParseExpression(true, CHECK_OK);
|
2662
|
-
if (cond
|
2663
|
-
cond->AsCompareOperation()->set_is_for_loop_condition();
|
2664
|
-
}
|
2769
|
+
if (cond != NULL) cond->set_is_loop_condition(true);
|
2665
2770
|
}
|
2666
2771
|
Expect(Token::SEMICOLON, CHECK_OK);
|
2667
2772
|
|
@@ -2672,9 +2777,17 @@ Statement* Parser::ParseForStatement(ZoneStringList* labels, bool* ok) {
|
|
2672
2777
|
}
|
2673
2778
|
Expect(Token::RPAREN, CHECK_OK);
|
2674
2779
|
|
2780
|
+
seen_loop_stmt_ = false;
|
2781
|
+
|
2675
2782
|
Statement* body = ParseStatement(NULL, CHECK_OK);
|
2676
2783
|
|
2784
|
+
// Mark this loop if it is an inner loop.
|
2785
|
+
if (loop && !seen_loop_stmt_) loop->set_peel_this_loop(true);
|
2786
|
+
|
2677
2787
|
if (loop) loop->Initialize(init, cond, next, body);
|
2788
|
+
|
2789
|
+
seen_loop_stmt_ = true;
|
2790
|
+
|
2678
2791
|
return loop;
|
2679
2792
|
}
|
2680
2793
|
|
@@ -3120,7 +3233,7 @@ DebuggerStatement* Parser::ParseDebuggerStatement(bool* ok) {
|
|
3120
3233
|
void Parser::ReportUnexpectedToken(Token::Value token) {
|
3121
3234
|
// We don't report stack overflows here, to avoid increasing the
|
3122
3235
|
// stack depth even further. Instead we report it after parsing is
|
3123
|
-
// over, in ParseProgram.
|
3236
|
+
// over, in ParseProgram/ParseJson.
|
3124
3237
|
if (token == Token::ILLEGAL && scanner().stack_overflow())
|
3125
3238
|
return;
|
3126
3239
|
// Four of the tokens are treated specially
|
@@ -3166,7 +3279,6 @@ Expression* Parser::ParsePrimaryExpression(bool* ok) {
|
|
3166
3279
|
result = VariableProxySentinel::this_proxy();
|
3167
3280
|
} else {
|
3168
3281
|
VariableProxy* recv = top_scope_->receiver();
|
3169
|
-
recv->var_uses()->RecordRead(1);
|
3170
3282
|
result = recv;
|
3171
3283
|
}
|
3172
3284
|
break;
|
@@ -3260,6 +3372,33 @@ Expression* Parser::ParsePrimaryExpression(bool* ok) {
|
|
3260
3372
|
}
|
3261
3373
|
|
3262
3374
|
|
3375
|
+
void Parser::BuildArrayLiteralBoilerplateLiterals(ZoneList<Expression*>* values,
|
3376
|
+
Handle<FixedArray> literals,
|
3377
|
+
bool* is_simple,
|
3378
|
+
int* depth) {
|
3379
|
+
// Fill in the literals.
|
3380
|
+
// Accumulate output values in local variables.
|
3381
|
+
bool is_simple_acc = true;
|
3382
|
+
int depth_acc = 1;
|
3383
|
+
for (int i = 0; i < values->length(); i++) {
|
3384
|
+
MaterializedLiteral* m_literal = values->at(i)->AsMaterializedLiteral();
|
3385
|
+
if (m_literal != NULL && m_literal->depth() >= depth_acc) {
|
3386
|
+
depth_acc = m_literal->depth() + 1;
|
3387
|
+
}
|
3388
|
+
Handle<Object> boilerplate_value = GetBoilerplateValue(values->at(i));
|
3389
|
+
if (boilerplate_value->IsUndefined()) {
|
3390
|
+
literals->set_the_hole(i);
|
3391
|
+
is_simple_acc = false;
|
3392
|
+
} else {
|
3393
|
+
literals->set(i, *boilerplate_value);
|
3394
|
+
}
|
3395
|
+
}
|
3396
|
+
|
3397
|
+
*is_simple = is_simple_acc;
|
3398
|
+
*depth = depth_acc;
|
3399
|
+
}
|
3400
|
+
|
3401
|
+
|
3263
3402
|
Expression* Parser::ParseArrayLiteral(bool* ok) {
|
3264
3403
|
// ArrayLiteral ::
|
3265
3404
|
// '[' Expression? (',' Expression?)* ']'
|
@@ -3328,7 +3467,11 @@ Handle<FixedArray> CompileTimeValue::GetValue(Expression* expression) {
|
|
3328
3467
|
ObjectLiteral* object_literal = expression->AsObjectLiteral();
|
3329
3468
|
if (object_literal != NULL) {
|
3330
3469
|
ASSERT(object_literal->is_simple());
|
3331
|
-
|
3470
|
+
if (object_literal->fast_elements()) {
|
3471
|
+
result->set(kTypeSlot, Smi::FromInt(OBJECT_LITERAL_FAST_ELEMENTS));
|
3472
|
+
} else {
|
3473
|
+
result->set(kTypeSlot, Smi::FromInt(OBJECT_LITERAL_SLOW_ELEMENTS));
|
3474
|
+
}
|
3332
3475
|
result->set(kElementsSlot, *object_literal->constant_properties());
|
3333
3476
|
} else {
|
3334
3477
|
ArrayLiteral* array_literal = expression->AsArrayLiteral();
|
@@ -3362,6 +3505,66 @@ Handle<Object> Parser::GetBoilerplateValue(Expression* expression) {
|
|
3362
3505
|
}
|
3363
3506
|
|
3364
3507
|
|
3508
|
+
void Parser::BuildObjectLiteralConstantProperties(
|
3509
|
+
ZoneList<ObjectLiteral::Property*>* properties,
|
3510
|
+
Handle<FixedArray> constant_properties,
|
3511
|
+
bool* is_simple,
|
3512
|
+
bool* fast_elements,
|
3513
|
+
int* depth) {
|
3514
|
+
int position = 0;
|
3515
|
+
// Accumulate the value in local variables and store it at the end.
|
3516
|
+
bool is_simple_acc = true;
|
3517
|
+
int depth_acc = 1;
|
3518
|
+
uint32_t max_element_index = 0;
|
3519
|
+
uint32_t elements = 0;
|
3520
|
+
for (int i = 0; i < properties->length(); i++) {
|
3521
|
+
ObjectLiteral::Property* property = properties->at(i);
|
3522
|
+
if (!IsBoilerplateProperty(property)) {
|
3523
|
+
is_simple_acc = false;
|
3524
|
+
continue;
|
3525
|
+
}
|
3526
|
+
MaterializedLiteral* m_literal = property->value()->AsMaterializedLiteral();
|
3527
|
+
if (m_literal != NULL && m_literal->depth() >= depth_acc) {
|
3528
|
+
depth_acc = m_literal->depth() + 1;
|
3529
|
+
}
|
3530
|
+
|
3531
|
+
// Add CONSTANT and COMPUTED properties to boilerplate. Use undefined
|
3532
|
+
// value for COMPUTED properties, the real value is filled in at
|
3533
|
+
// runtime. The enumeration order is maintained.
|
3534
|
+
Handle<Object> key = property->key()->handle();
|
3535
|
+
Handle<Object> value = GetBoilerplateValue(property->value());
|
3536
|
+
is_simple_acc = is_simple_acc && !value->IsUndefined();
|
3537
|
+
|
3538
|
+
// Keep track of the number of elements in the object literal and
|
3539
|
+
// the largest element index. If the largest element index is
|
3540
|
+
// much larger than the number of elements, creating an object
|
3541
|
+
// literal with fast elements will be a waste of space.
|
3542
|
+
uint32_t element_index = 0;
|
3543
|
+
if (key->IsString()
|
3544
|
+
&& Handle<String>::cast(key)->AsArrayIndex(&element_index)
|
3545
|
+
&& element_index > max_element_index) {
|
3546
|
+
max_element_index = element_index;
|
3547
|
+
elements++;
|
3548
|
+
} else if (key->IsSmi()) {
|
3549
|
+
int key_value = Smi::cast(*key)->value();
|
3550
|
+
if (key_value > 0
|
3551
|
+
&& static_cast<uint32_t>(key_value) > max_element_index) {
|
3552
|
+
max_element_index = key_value;
|
3553
|
+
}
|
3554
|
+
elements++;
|
3555
|
+
}
|
3556
|
+
|
3557
|
+
// Add name, value pair to the fixed array.
|
3558
|
+
constant_properties->set(position++, *key);
|
3559
|
+
constant_properties->set(position++, *value);
|
3560
|
+
}
|
3561
|
+
*fast_elements =
|
3562
|
+
(max_element_index <= 32) || ((2 * elements) >= max_element_index);
|
3563
|
+
*is_simple = is_simple_acc;
|
3564
|
+
*depth = depth_acc;
|
3565
|
+
}
|
3566
|
+
|
3567
|
+
|
3365
3568
|
Expression* Parser::ParseObjectLiteral(bool* ok) {
|
3366
3569
|
// ObjectLiteral ::
|
3367
3570
|
// '{' (
|
@@ -3452,36 +3655,20 @@ Expression* Parser::ParseObjectLiteral(bool* ok) {
|
|
3452
3655
|
|
3453
3656
|
Handle<FixedArray> constant_properties =
|
3454
3657
|
Factory::NewFixedArray(number_of_boilerplate_properties * 2, TENURED);
|
3455
|
-
|
3658
|
+
|
3456
3659
|
bool is_simple = true;
|
3660
|
+
bool fast_elements = true;
|
3457
3661
|
int depth = 1;
|
3458
|
-
|
3459
|
-
|
3460
|
-
|
3461
|
-
|
3462
|
-
|
3463
|
-
}
|
3464
|
-
MaterializedLiteral* m_literal = property->value()->AsMaterializedLiteral();
|
3465
|
-
if (m_literal != NULL && m_literal->depth() + 1 > depth) {
|
3466
|
-
depth = m_literal->depth() + 1;
|
3467
|
-
}
|
3468
|
-
|
3469
|
-
// Add CONSTANT and COMPUTED properties to boilerplate. Use undefined
|
3470
|
-
// value for COMPUTED properties, the real value is filled in at
|
3471
|
-
// runtime. The enumeration order is maintained.
|
3472
|
-
Handle<Object> key = property->key()->handle();
|
3473
|
-
Handle<Object> value = GetBoilerplateValue(property->value());
|
3474
|
-
is_simple = is_simple && !value->IsUndefined();
|
3475
|
-
|
3476
|
-
// Add name, value pair to the fixed array.
|
3477
|
-
constant_properties->set(position++, *key);
|
3478
|
-
constant_properties->set(position++, *value);
|
3479
|
-
}
|
3480
|
-
|
3662
|
+
BuildObjectLiteralConstantProperties(properties.elements(),
|
3663
|
+
constant_properties,
|
3664
|
+
&is_simple,
|
3665
|
+
&fast_elements,
|
3666
|
+
&depth);
|
3481
3667
|
return new ObjectLiteral(constant_properties,
|
3482
3668
|
properties.elements(),
|
3483
3669
|
literal_index,
|
3484
3670
|
is_simple,
|
3671
|
+
fast_elements,
|
3485
3672
|
depth);
|
3486
3673
|
}
|
3487
3674
|
|
@@ -3545,6 +3732,9 @@ FunctionLiteral* Parser::ParseFunctionLiteral(Handle<String> var_name,
|
|
3545
3732
|
// Function ::
|
3546
3733
|
// '(' FormalParameterList? ')' '{' FunctionBody '}'
|
3547
3734
|
|
3735
|
+
// Reset flag used for inner loop detection.
|
3736
|
+
seen_loop_stmt_ = false;
|
3737
|
+
|
3548
3738
|
bool is_named = !var_name.is_null();
|
3549
3739
|
|
3550
3740
|
// The name associated with this function. If it's a function expression,
|
@@ -3655,6 +3845,12 @@ FunctionLiteral* Parser::ParseFunctionLiteral(Handle<String> var_name,
|
|
3655
3845
|
if (!is_pre_parsing_) {
|
3656
3846
|
function_literal->set_function_token_position(function_token_position);
|
3657
3847
|
}
|
3848
|
+
|
3849
|
+
// Set flag for inner loop detection. We treat loops that contain a function
|
3850
|
+
// literal not as inner loops because we avoid duplicating function literals
|
3851
|
+
// when peeling or unrolling such a loop.
|
3852
|
+
seen_loop_stmt_ = true;
|
3853
|
+
|
3658
3854
|
return function_literal;
|
3659
3855
|
}
|
3660
3856
|
}
|
@@ -3697,7 +3893,27 @@ Expression* Parser::ParseV8Intrinsic(bool* ok) {
|
|
3697
3893
|
}
|
3698
3894
|
}
|
3699
3895
|
|
3700
|
-
//
|
3896
|
+
// Check that the expected number arguments are passed to runtime functions.
|
3897
|
+
if (!is_pre_parsing_) {
|
3898
|
+
if (function != NULL
|
3899
|
+
&& function->nargs != -1
|
3900
|
+
&& function->nargs != args->length()) {
|
3901
|
+
ReportMessage("illegal_access", Vector<const char*>::empty());
|
3902
|
+
*ok = false;
|
3903
|
+
return NULL;
|
3904
|
+
} else if (function == NULL && !name.is_null()) {
|
3905
|
+
// If this is not a runtime function implemented in C++ it might be an
|
3906
|
+
// inlined runtime function.
|
3907
|
+
int argc = CodeGenerator::InlineRuntimeCallArgumentsCount(name);
|
3908
|
+
if (argc != -1 && argc != args->length()) {
|
3909
|
+
ReportMessage("illegal_access", Vector<const char*>::empty());
|
3910
|
+
*ok = false;
|
3911
|
+
return NULL;
|
3912
|
+
}
|
3913
|
+
}
|
3914
|
+
}
|
3915
|
+
|
3916
|
+
// Otherwise we have a valid runtime call.
|
3701
3917
|
return NEW(CallRuntime(name, function, args));
|
3702
3918
|
}
|
3703
3919
|
|
@@ -3718,6 +3934,16 @@ void Parser::Expect(Token::Value token, bool* ok) {
|
|
3718
3934
|
}
|
3719
3935
|
|
3720
3936
|
|
3937
|
+
bool Parser::Check(Token::Value token) {
|
3938
|
+
Token::Value next = peek();
|
3939
|
+
if (next == token) {
|
3940
|
+
Consume(next);
|
3941
|
+
return true;
|
3942
|
+
}
|
3943
|
+
return false;
|
3944
|
+
}
|
3945
|
+
|
3946
|
+
|
3721
3947
|
void Parser::ExpectSemicolon(bool* ok) {
|
3722
3948
|
// Check for automatic semicolon insertion according to
|
3723
3949
|
// the rules given in ECMA-262, section 7.9, page 21.
|
@@ -3884,6 +4110,148 @@ Expression* Parser::NewThrowError(Handle<String> constructor,
|
|
3884
4110
|
scanner().location().beg_pos);
|
3885
4111
|
}
|
3886
4112
|
|
4113
|
+
// ----------------------------------------------------------------------------
|
4114
|
+
// JSON
|
4115
|
+
|
4116
|
+
Expression* Parser::ParseJson(bool* ok) {
|
4117
|
+
Expression* result = ParseJsonValue(CHECK_OK);
|
4118
|
+
Expect(Token::EOS, CHECK_OK);
|
4119
|
+
return result;
|
4120
|
+
}
|
4121
|
+
|
4122
|
+
|
4123
|
+
// Parse any JSON value.
|
4124
|
+
Expression* Parser::ParseJsonValue(bool* ok) {
|
4125
|
+
Token::Value token = peek();
|
4126
|
+
switch (token) {
|
4127
|
+
case Token::STRING: {
|
4128
|
+
Consume(Token::STRING);
|
4129
|
+
int literal_length = scanner_.literal_length();
|
4130
|
+
const char* literal_string = scanner_.literal_string();
|
4131
|
+
if (literal_length == 0) {
|
4132
|
+
return NEW(Literal(Factory::empty_string()));
|
4133
|
+
}
|
4134
|
+
Vector<const char> literal(literal_string, literal_length);
|
4135
|
+
return NEW(Literal(Factory::NewStringFromUtf8(literal, TENURED)));
|
4136
|
+
}
|
4137
|
+
case Token::NUMBER: {
|
4138
|
+
Consume(Token::NUMBER);
|
4139
|
+
ASSERT(scanner_.literal_length() > 0);
|
4140
|
+
double value = StringToDouble(scanner_.literal_string(),
|
4141
|
+
NO_FLAGS, // Hex, octal or trailing junk.
|
4142
|
+
OS::nan_value());
|
4143
|
+
return NewNumberLiteral(value);
|
4144
|
+
}
|
4145
|
+
case Token::FALSE_LITERAL:
|
4146
|
+
Consume(Token::FALSE_LITERAL);
|
4147
|
+
return NEW(Literal(Factory::false_value()));
|
4148
|
+
case Token::TRUE_LITERAL:
|
4149
|
+
Consume(Token::TRUE_LITERAL);
|
4150
|
+
return NEW(Literal(Factory::true_value()));
|
4151
|
+
case Token::NULL_LITERAL:
|
4152
|
+
Consume(Token::NULL_LITERAL);
|
4153
|
+
return NEW(Literal(Factory::null_value()));
|
4154
|
+
case Token::LBRACE: {
|
4155
|
+
Expression* result = ParseJsonObject(CHECK_OK);
|
4156
|
+
return result;
|
4157
|
+
}
|
4158
|
+
case Token::LBRACK: {
|
4159
|
+
Expression* result = ParseJsonArray(CHECK_OK);
|
4160
|
+
return result;
|
4161
|
+
}
|
4162
|
+
default:
|
4163
|
+
*ok = false;
|
4164
|
+
ReportUnexpectedToken(token);
|
4165
|
+
return NULL;
|
4166
|
+
}
|
4167
|
+
}
|
4168
|
+
|
4169
|
+
|
4170
|
+
// Parse a JSON object. Scanner must be right after '{' token.
|
4171
|
+
Expression* Parser::ParseJsonObject(bool* ok) {
|
4172
|
+
Consume(Token::LBRACE);
|
4173
|
+
ZoneListWrapper<ObjectLiteral::Property> properties =
|
4174
|
+
factory()->NewList<ObjectLiteral::Property>(4);
|
4175
|
+
int boilerplate_properties = 0;
|
4176
|
+
if (peek() != Token::RBRACE) {
|
4177
|
+
do {
|
4178
|
+
Expect(Token::STRING, CHECK_OK);
|
4179
|
+
Handle<String> key = factory()->LookupSymbol(scanner_.literal_string(),
|
4180
|
+
scanner_.literal_length());
|
4181
|
+
Expect(Token::COLON, CHECK_OK);
|
4182
|
+
Expression* value = ParseJsonValue(CHECK_OK);
|
4183
|
+
Literal* key_literal;
|
4184
|
+
uint32_t index;
|
4185
|
+
if (key->AsArrayIndex(&index)) {
|
4186
|
+
key_literal = NewNumberLiteral(index);
|
4187
|
+
} else {
|
4188
|
+
key_literal = NEW(Literal(key));
|
4189
|
+
}
|
4190
|
+
ObjectLiteral::Property* property =
|
4191
|
+
NEW(ObjectLiteral::Property(key_literal, value));
|
4192
|
+
properties.Add(property);
|
4193
|
+
|
4194
|
+
if (IsBoilerplateProperty(property)) {
|
4195
|
+
boilerplate_properties++;
|
4196
|
+
}
|
4197
|
+
} while (Check(Token::COMMA));
|
4198
|
+
}
|
4199
|
+
Expect(Token::RBRACE, CHECK_OK);
|
4200
|
+
|
4201
|
+
int literal_index = temp_scope_->NextMaterializedLiteralIndex();
|
4202
|
+
if (is_pre_parsing_) return NULL;
|
4203
|
+
|
4204
|
+
Handle<FixedArray> constant_properties =
|
4205
|
+
Factory::NewFixedArray(boilerplate_properties * 2, TENURED);
|
4206
|
+
bool is_simple = true;
|
4207
|
+
bool fast_elements = true;
|
4208
|
+
int depth = 1;
|
4209
|
+
BuildObjectLiteralConstantProperties(properties.elements(),
|
4210
|
+
constant_properties,
|
4211
|
+
&is_simple,
|
4212
|
+
&fast_elements,
|
4213
|
+
&depth);
|
4214
|
+
return new ObjectLiteral(constant_properties,
|
4215
|
+
properties.elements(),
|
4216
|
+
literal_index,
|
4217
|
+
is_simple,
|
4218
|
+
fast_elements,
|
4219
|
+
depth);
|
4220
|
+
}
|
4221
|
+
|
4222
|
+
|
4223
|
+
// Parse a JSON array. Scanner must be right after '[' token.
|
4224
|
+
Expression* Parser::ParseJsonArray(bool* ok) {
|
4225
|
+
Consume(Token::LBRACK);
|
4226
|
+
|
4227
|
+
ZoneListWrapper<Expression> values = factory()->NewList<Expression>(4);
|
4228
|
+
if (peek() != Token::RBRACK) {
|
4229
|
+
do {
|
4230
|
+
Expression* exp = ParseJsonValue(CHECK_OK);
|
4231
|
+
values.Add(exp);
|
4232
|
+
} while (Check(Token::COMMA));
|
4233
|
+
}
|
4234
|
+
Expect(Token::RBRACK, CHECK_OK);
|
4235
|
+
|
4236
|
+
// Update the scope information before the pre-parsing bailout.
|
4237
|
+
int literal_index = temp_scope_->NextMaterializedLiteralIndex();
|
4238
|
+
|
4239
|
+
if (is_pre_parsing_) return NULL;
|
4240
|
+
|
4241
|
+
// Allocate a fixed array with all the literals.
|
4242
|
+
Handle<FixedArray> literals =
|
4243
|
+
Factory::NewFixedArray(values.length(), TENURED);
|
4244
|
+
|
4245
|
+
bool is_simple;
|
4246
|
+
int depth;
|
4247
|
+
BuildArrayLiteralBoilerplateLiterals(values.elements(),
|
4248
|
+
literals,
|
4249
|
+
&is_simple,
|
4250
|
+
&depth);
|
4251
|
+
return NEW(ArrayLiteral(literals, values.elements(),
|
4252
|
+
literal_index, is_simple, depth));
|
4253
|
+
}
|
4254
|
+
|
3887
4255
|
|
3888
4256
|
// ----------------------------------------------------------------------------
|
3889
4257
|
// Regular expressions
|
@@ -4759,7 +5127,8 @@ bool ParseRegExp(FlatStringReader* input,
|
|
4759
5127
|
FunctionLiteral* MakeAST(bool compile_in_global_context,
|
4760
5128
|
Handle<Script> script,
|
4761
5129
|
v8::Extension* extension,
|
4762
|
-
ScriptDataImpl* pre_data
|
5130
|
+
ScriptDataImpl* pre_data,
|
5131
|
+
bool is_json) {
|
4763
5132
|
bool allow_natives_syntax =
|
4764
5133
|
always_allow_natives_syntax ||
|
4765
5134
|
FLAG_allow_natives_syntax ||
|
@@ -4771,15 +5140,20 @@ FunctionLiteral* MakeAST(bool compile_in_global_context,
|
|
4771
5140
|
Vector<const char*> args = pre_data->BuildArgs();
|
4772
5141
|
parser.ReportMessageAt(loc, message, args);
|
4773
5142
|
DeleteArray(message);
|
4774
|
-
for (int i = 0; i < args.length(); i++)
|
5143
|
+
for (int i = 0; i < args.length(); i++) {
|
4775
5144
|
DeleteArray(args[i]);
|
5145
|
+
}
|
4776
5146
|
DeleteArray(args.start());
|
4777
5147
|
return NULL;
|
4778
5148
|
}
|
4779
5149
|
Handle<String> source = Handle<String>(String::cast(script->source()));
|
4780
|
-
|
4781
|
-
|
4782
|
-
|
5150
|
+
FunctionLiteral* result;
|
5151
|
+
if (is_json) {
|
5152
|
+
ASSERT(compile_in_global_context);
|
5153
|
+
result = parser.ParseJson(source);
|
5154
|
+
} else {
|
5155
|
+
result = parser.ParseProgram(source, compile_in_global_context);
|
5156
|
+
}
|
4783
5157
|
return result;
|
4784
5158
|
}
|
4785
5159
|
|
@@ -4793,13 +5167,11 @@ FunctionLiteral* MakeLazyAST(Handle<Script> script,
|
|
4793
5167
|
always_allow_natives_syntax = true;
|
4794
5168
|
AstBuildingParser parser(script, true, NULL, NULL); // always allow
|
4795
5169
|
always_allow_natives_syntax = allow_natives_syntax_before;
|
4796
|
-
// Parse the function by
|
5170
|
+
// Parse the function by pointing to the function source in the script source.
|
4797
5171
|
Handle<String> script_source(String::cast(script->source()));
|
4798
5172
|
FunctionLiteral* result =
|
4799
|
-
parser.ParseLazy(
|
4800
|
-
|
4801
|
-
start_position,
|
4802
|
-
is_expression);
|
5173
|
+
parser.ParseLazy(script_source, name,
|
5174
|
+
start_position, end_position, is_expression);
|
4803
5175
|
return result;
|
4804
5176
|
}
|
4805
5177
|
|