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,202 @@
|
|
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
|
+
|
29
|
+
|
30
|
+
#include "v8.h"
|
31
|
+
|
32
|
+
#include "codegen-inl.h"
|
33
|
+
#include "debug.h"
|
34
|
+
#include "runtime.h"
|
35
|
+
|
36
|
+
namespace v8 {
|
37
|
+
namespace internal {
|
38
|
+
|
39
|
+
|
40
|
+
#define __ ACCESS_MASM(masm)
|
41
|
+
|
42
|
+
|
43
|
+
void Builtins::Generate_Adaptor(MacroAssembler* masm,
|
44
|
+
CFunctionId id,
|
45
|
+
BuiltinExtraArguments extra_args) {
|
46
|
+
UNIMPLEMENTED_MIPS();
|
47
|
+
}
|
48
|
+
|
49
|
+
|
50
|
+
void Builtins::Generate_ArrayCode(MacroAssembler* masm) {
|
51
|
+
UNIMPLEMENTED_MIPS();
|
52
|
+
}
|
53
|
+
|
54
|
+
|
55
|
+
void Builtins::Generate_ArrayConstructCode(MacroAssembler* masm) {
|
56
|
+
UNIMPLEMENTED_MIPS();
|
57
|
+
}
|
58
|
+
|
59
|
+
|
60
|
+
void Builtins::Generate_JSConstructCall(MacroAssembler* masm) {
|
61
|
+
UNIMPLEMENTED_MIPS();
|
62
|
+
}
|
63
|
+
|
64
|
+
|
65
|
+
void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) {
|
66
|
+
UNIMPLEMENTED_MIPS();
|
67
|
+
}
|
68
|
+
|
69
|
+
|
70
|
+
void Builtins::Generate_JSConstructStubApi(MacroAssembler* masm) {
|
71
|
+
UNIMPLEMENTED_MIPS();
|
72
|
+
}
|
73
|
+
|
74
|
+
|
75
|
+
static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
|
76
|
+
bool is_construct) {
|
77
|
+
// Called from JSEntryStub::GenerateBody
|
78
|
+
|
79
|
+
// Registers:
|
80
|
+
// a0: entry_address
|
81
|
+
// a1: function
|
82
|
+
// a2: reveiver_pointer
|
83
|
+
// a3: argc
|
84
|
+
// s0: argv
|
85
|
+
//
|
86
|
+
// Stack:
|
87
|
+
// arguments slots
|
88
|
+
// handler frame
|
89
|
+
// entry frame
|
90
|
+
// callee saved registers + ra
|
91
|
+
// 4 args slots
|
92
|
+
// args
|
93
|
+
|
94
|
+
// Clear the context before we push it when entering the JS frame.
|
95
|
+
__ li(cp, Operand(0));
|
96
|
+
|
97
|
+
// Enter an internal frame.
|
98
|
+
__ EnterInternalFrame();
|
99
|
+
|
100
|
+
// Set up the context from the function argument.
|
101
|
+
__ lw(cp, FieldMemOperand(a1, JSFunction::kContextOffset));
|
102
|
+
|
103
|
+
// Set up the roots register.
|
104
|
+
ExternalReference roots_address = ExternalReference::roots_address();
|
105
|
+
__ li(s6, Operand(roots_address));
|
106
|
+
|
107
|
+
// Push the function and the receiver onto the stack.
|
108
|
+
__ MultiPushReversed(a1.bit() | a2.bit());
|
109
|
+
|
110
|
+
// Copy arguments to the stack in a loop.
|
111
|
+
// a3: argc
|
112
|
+
// s0: argv, ie points to first arg
|
113
|
+
Label loop, entry;
|
114
|
+
__ sll(t0, a3, kPointerSizeLog2);
|
115
|
+
__ add(t2, s0, t0);
|
116
|
+
__ b(&entry);
|
117
|
+
__ nop(); // Branch delay slot nop.
|
118
|
+
// t2 points past last arg.
|
119
|
+
__ bind(&loop);
|
120
|
+
__ lw(t0, MemOperand(s0)); // Read next parameter.
|
121
|
+
__ addiu(s0, s0, kPointerSize);
|
122
|
+
__ lw(t0, MemOperand(t0)); // Dereference handle.
|
123
|
+
__ Push(t0); // Push parameter.
|
124
|
+
__ bind(&entry);
|
125
|
+
__ Branch(ne, &loop, s0, Operand(t2));
|
126
|
+
|
127
|
+
// Registers:
|
128
|
+
// a0: entry_address
|
129
|
+
// a1: function
|
130
|
+
// a2: reveiver_pointer
|
131
|
+
// a3: argc
|
132
|
+
// s0: argv
|
133
|
+
// s6: roots_address
|
134
|
+
//
|
135
|
+
// Stack:
|
136
|
+
// arguments
|
137
|
+
// receiver
|
138
|
+
// function
|
139
|
+
// arguments slots
|
140
|
+
// handler frame
|
141
|
+
// entry frame
|
142
|
+
// callee saved registers + ra
|
143
|
+
// 4 args slots
|
144
|
+
// args
|
145
|
+
|
146
|
+
// Initialize all JavaScript callee-saved registers, since they will be seen
|
147
|
+
// by the garbage collector as part of handlers.
|
148
|
+
__ LoadRoot(t4, Heap::kUndefinedValueRootIndex);
|
149
|
+
__ mov(s1, t4);
|
150
|
+
__ mov(s2, t4);
|
151
|
+
__ mov(s3, t4);
|
152
|
+
__ mov(s4, s4);
|
153
|
+
__ mov(s5, t4);
|
154
|
+
// s6 holds the root address. Do not clobber.
|
155
|
+
// s7 is cp. Do not init.
|
156
|
+
|
157
|
+
// Invoke the code and pass argc as a0.
|
158
|
+
__ mov(a0, a3);
|
159
|
+
if (is_construct) {
|
160
|
+
UNIMPLEMENTED_MIPS();
|
161
|
+
__ break_(0x164);
|
162
|
+
} else {
|
163
|
+
ParameterCount actual(a0);
|
164
|
+
__ InvokeFunction(a1, actual, CALL_FUNCTION);
|
165
|
+
}
|
166
|
+
|
167
|
+
__ LeaveInternalFrame();
|
168
|
+
|
169
|
+
__ Jump(ra);
|
170
|
+
}
|
171
|
+
|
172
|
+
|
173
|
+
void Builtins::Generate_JSEntryTrampoline(MacroAssembler* masm) {
|
174
|
+
Generate_JSEntryTrampolineHelper(masm, false);
|
175
|
+
}
|
176
|
+
|
177
|
+
|
178
|
+
void Builtins::Generate_JSConstructEntryTrampoline(MacroAssembler* masm) {
|
179
|
+
Generate_JSEntryTrampolineHelper(masm, true);
|
180
|
+
}
|
181
|
+
|
182
|
+
|
183
|
+
void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
|
184
|
+
UNIMPLEMENTED_MIPS();
|
185
|
+
}
|
186
|
+
|
187
|
+
|
188
|
+
void Builtins::Generate_FunctionApply(MacroAssembler* masm) {
|
189
|
+
UNIMPLEMENTED_MIPS();
|
190
|
+
}
|
191
|
+
|
192
|
+
|
193
|
+
void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
|
194
|
+
UNIMPLEMENTED_MIPS();
|
195
|
+
__ break_(0x201);
|
196
|
+
}
|
197
|
+
|
198
|
+
|
199
|
+
#undef __
|
200
|
+
|
201
|
+
} } // namespace v8::internal
|
202
|
+
|
@@ -0,0 +1,70 @@
|
|
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
|
+
|
29
|
+
#ifndef V8_MIPS_CODEGEN_MIPS_INL_H_
|
30
|
+
#define V8_MIPS_CODEGEN_MIPS_INL_H_
|
31
|
+
|
32
|
+
namespace v8 {
|
33
|
+
namespace internal {
|
34
|
+
|
35
|
+
#define __ ACCESS_MASM(masm_)
|
36
|
+
|
37
|
+
// Platform-specific inline functions.
|
38
|
+
|
39
|
+
void DeferredCode::Jump() {
|
40
|
+
__ b(&entry_label_);
|
41
|
+
__ nop();
|
42
|
+
}
|
43
|
+
|
44
|
+
|
45
|
+
void Reference::GetValueAndSpill() {
|
46
|
+
GetValue();
|
47
|
+
}
|
48
|
+
|
49
|
+
|
50
|
+
void CodeGenerator::VisitAndSpill(Statement* statement) {
|
51
|
+
Visit(statement);
|
52
|
+
}
|
53
|
+
|
54
|
+
|
55
|
+
void CodeGenerator::VisitStatementsAndSpill(ZoneList<Statement*>* statements) {
|
56
|
+
VisitStatements(statements);
|
57
|
+
}
|
58
|
+
|
59
|
+
|
60
|
+
void CodeGenerator::LoadAndSpill(Expression* expression) {
|
61
|
+
Load(expression);
|
62
|
+
}
|
63
|
+
|
64
|
+
|
65
|
+
#undef __
|
66
|
+
|
67
|
+
} } // namespace v8::internal
|
68
|
+
|
69
|
+
#endif // V8_MIPS_CODEGEN_MIPS_INL_H_
|
70
|
+
|
@@ -0,0 +1,1428 @@
|
|
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
|
+
|
29
|
+
#include "v8.h"
|
30
|
+
|
31
|
+
#include "bootstrapper.h"
|
32
|
+
#include "codegen-inl.h"
|
33
|
+
#include "compiler.h"
|
34
|
+
#include "debug.h"
|
35
|
+
#include "ic-inl.h"
|
36
|
+
#include "parser.h"
|
37
|
+
#include "register-allocator-inl.h"
|
38
|
+
#include "runtime.h"
|
39
|
+
#include "scopes.h"
|
40
|
+
#include "virtual-frame-inl.h"
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
namespace v8 {
|
45
|
+
namespace internal {
|
46
|
+
|
47
|
+
#define __ ACCESS_MASM(masm_)
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
// -----------------------------------------------------------------------------
|
52
|
+
// Platform-specific DeferredCode functions.
|
53
|
+
|
54
|
+
|
55
|
+
void DeferredCode::SaveRegisters() {
|
56
|
+
UNIMPLEMENTED_MIPS();
|
57
|
+
}
|
58
|
+
|
59
|
+
|
60
|
+
void DeferredCode::RestoreRegisters() {
|
61
|
+
UNIMPLEMENTED_MIPS();
|
62
|
+
}
|
63
|
+
|
64
|
+
|
65
|
+
// -----------------------------------------------------------------------------
|
66
|
+
// CodeGenState implementation.
|
67
|
+
|
68
|
+
CodeGenState::CodeGenState(CodeGenerator* owner)
|
69
|
+
: owner_(owner),
|
70
|
+
true_target_(NULL),
|
71
|
+
false_target_(NULL),
|
72
|
+
previous_(NULL) {
|
73
|
+
owner_->set_state(this);
|
74
|
+
}
|
75
|
+
|
76
|
+
|
77
|
+
CodeGenState::CodeGenState(CodeGenerator* owner,
|
78
|
+
JumpTarget* true_target,
|
79
|
+
JumpTarget* false_target)
|
80
|
+
: owner_(owner),
|
81
|
+
true_target_(true_target),
|
82
|
+
false_target_(false_target),
|
83
|
+
previous_(owner->state()) {
|
84
|
+
owner_->set_state(this);
|
85
|
+
}
|
86
|
+
|
87
|
+
|
88
|
+
CodeGenState::~CodeGenState() {
|
89
|
+
ASSERT(owner_->state() == this);
|
90
|
+
owner_->set_state(previous_);
|
91
|
+
}
|
92
|
+
|
93
|
+
|
94
|
+
// -----------------------------------------------------------------------------
|
95
|
+
// CodeGenerator implementation
|
96
|
+
|
97
|
+
CodeGenerator::CodeGenerator(MacroAssembler* masm)
|
98
|
+
: deferred_(8),
|
99
|
+
masm_(masm),
|
100
|
+
frame_(NULL),
|
101
|
+
allocator_(NULL),
|
102
|
+
cc_reg_(cc_always),
|
103
|
+
state_(NULL),
|
104
|
+
function_return_is_shadowed_(false) {
|
105
|
+
}
|
106
|
+
|
107
|
+
|
108
|
+
// Calling conventions:
|
109
|
+
// fp: caller's frame pointer
|
110
|
+
// sp: stack pointer
|
111
|
+
// a1: called JS function
|
112
|
+
// cp: callee's context
|
113
|
+
|
114
|
+
void CodeGenerator::Generate(CompilationInfo* info) {
|
115
|
+
// Record the position for debugging purposes.
|
116
|
+
CodeForFunctionPosition(info->function());
|
117
|
+
|
118
|
+
// Initialize state.
|
119
|
+
info_ = info;
|
120
|
+
ASSERT(allocator_ == NULL);
|
121
|
+
RegisterAllocator register_allocator(this);
|
122
|
+
allocator_ = ®ister_allocator;
|
123
|
+
ASSERT(frame_ == NULL);
|
124
|
+
frame_ = new VirtualFrame();
|
125
|
+
cc_reg_ = cc_always;
|
126
|
+
|
127
|
+
{
|
128
|
+
CodeGenState state(this);
|
129
|
+
|
130
|
+
// Registers:
|
131
|
+
// a1: called JS function
|
132
|
+
// ra: return address
|
133
|
+
// fp: caller's frame pointer
|
134
|
+
// sp: stack pointer
|
135
|
+
// cp: callee's context
|
136
|
+
//
|
137
|
+
// Stack:
|
138
|
+
// arguments
|
139
|
+
// receiver
|
140
|
+
|
141
|
+
frame_->Enter();
|
142
|
+
|
143
|
+
// Allocate space for locals and initialize them.
|
144
|
+
frame_->AllocateStackSlots();
|
145
|
+
|
146
|
+
// Initialize the function return target.
|
147
|
+
function_return_.set_direction(JumpTarget::BIDIRECTIONAL);
|
148
|
+
function_return_is_shadowed_ = false;
|
149
|
+
|
150
|
+
VirtualFrame::SpilledScope spilled_scope;
|
151
|
+
if (scope()->num_heap_slots() > 0) {
|
152
|
+
UNIMPLEMENTED_MIPS();
|
153
|
+
}
|
154
|
+
|
155
|
+
{
|
156
|
+
Comment cmnt2(masm_, "[ copy context parameters into .context");
|
157
|
+
|
158
|
+
// Note that iteration order is relevant here! If we have the same
|
159
|
+
// parameter twice (e.g., function (x, y, x)), and that parameter
|
160
|
+
// needs to be copied into the context, it must be the last argument
|
161
|
+
// passed to the parameter that needs to be copied. This is a rare
|
162
|
+
// case so we don't check for it, instead we rely on the copying
|
163
|
+
// order: such a parameter is copied repeatedly into the same
|
164
|
+
// context location and thus the last value is what is seen inside
|
165
|
+
// the function.
|
166
|
+
for (int i = 0; i < scope()->num_parameters(); i++) {
|
167
|
+
UNIMPLEMENTED_MIPS();
|
168
|
+
}
|
169
|
+
}
|
170
|
+
|
171
|
+
// Store the arguments object. This must happen after context
|
172
|
+
// initialization because the arguments object may be stored in the
|
173
|
+
// context.
|
174
|
+
if (scope()->arguments() != NULL) {
|
175
|
+
UNIMPLEMENTED_MIPS();
|
176
|
+
}
|
177
|
+
|
178
|
+
// Generate code to 'execute' declarations and initialize functions
|
179
|
+
// (source elements). In case of an illegal redeclaration we need to
|
180
|
+
// handle that instead of processing the declarations.
|
181
|
+
if (scope()->HasIllegalRedeclaration()) {
|
182
|
+
Comment cmnt(masm_, "[ illegal redeclarations");
|
183
|
+
scope()->VisitIllegalRedeclaration(this);
|
184
|
+
} else {
|
185
|
+
Comment cmnt(masm_, "[ declarations");
|
186
|
+
ProcessDeclarations(scope()->declarations());
|
187
|
+
// Bail out if a stack-overflow exception occurred when processing
|
188
|
+
// declarations.
|
189
|
+
if (HasStackOverflow()) return;
|
190
|
+
}
|
191
|
+
|
192
|
+
if (FLAG_trace) {
|
193
|
+
UNIMPLEMENTED_MIPS();
|
194
|
+
}
|
195
|
+
|
196
|
+
// Compile the body of the function in a vanilla state. Don't
|
197
|
+
// bother compiling all the code if the scope has an illegal
|
198
|
+
// redeclaration.
|
199
|
+
if (!scope()->HasIllegalRedeclaration()) {
|
200
|
+
Comment cmnt(masm_, "[ function body");
|
201
|
+
#ifdef DEBUG
|
202
|
+
bool is_builtin = Bootstrapper::IsActive();
|
203
|
+
bool should_trace =
|
204
|
+
is_builtin ? FLAG_trace_builtin_calls : FLAG_trace_calls;
|
205
|
+
if (should_trace) {
|
206
|
+
UNIMPLEMENTED_MIPS();
|
207
|
+
}
|
208
|
+
#endif
|
209
|
+
VisitStatementsAndSpill(info->function()->body());
|
210
|
+
}
|
211
|
+
}
|
212
|
+
|
213
|
+
if (has_valid_frame() || function_return_.is_linked()) {
|
214
|
+
if (!function_return_.is_linked()) {
|
215
|
+
CodeForReturnPosition(info->function());
|
216
|
+
}
|
217
|
+
// Registers:
|
218
|
+
// v0: result
|
219
|
+
// sp: stack pointer
|
220
|
+
// fp: frame pointer
|
221
|
+
// cp: callee's context
|
222
|
+
|
223
|
+
__ LoadRoot(v0, Heap::kUndefinedValueRootIndex);
|
224
|
+
|
225
|
+
function_return_.Bind();
|
226
|
+
if (FLAG_trace) {
|
227
|
+
UNIMPLEMENTED_MIPS();
|
228
|
+
}
|
229
|
+
|
230
|
+
// Add a label for checking the size of the code used for returning.
|
231
|
+
Label check_exit_codesize;
|
232
|
+
masm_->bind(&check_exit_codesize);
|
233
|
+
|
234
|
+
masm_->mov(sp, fp);
|
235
|
+
masm_->lw(fp, MemOperand(sp, 0));
|
236
|
+
masm_->lw(ra, MemOperand(sp, 4));
|
237
|
+
masm_->addiu(sp, sp, 8);
|
238
|
+
|
239
|
+
// Here we use masm_-> instead of the __ macro to avoid the code coverage
|
240
|
+
// tool from instrumenting as we rely on the code size here.
|
241
|
+
// TODO(MIPS): Should we be able to use more than 0x1ffe parameters?
|
242
|
+
masm_->addiu(sp, sp, (scope()->num_parameters() + 1) * kPointerSize);
|
243
|
+
masm_->Jump(ra);
|
244
|
+
// The Jump automatically generates a nop in the branch delay slot.
|
245
|
+
|
246
|
+
// Check that the size of the code used for returning matches what is
|
247
|
+
// expected by the debugger.
|
248
|
+
ASSERT_EQ(kJSReturnSequenceLength,
|
249
|
+
masm_->InstructionsGeneratedSince(&check_exit_codesize));
|
250
|
+
}
|
251
|
+
|
252
|
+
// Code generation state must be reset.
|
253
|
+
ASSERT(!has_cc());
|
254
|
+
ASSERT(state_ == NULL);
|
255
|
+
ASSERT(!function_return_is_shadowed_);
|
256
|
+
function_return_.Unuse();
|
257
|
+
DeleteFrame();
|
258
|
+
|
259
|
+
// Process any deferred code using the register allocator.
|
260
|
+
if (!HasStackOverflow()) {
|
261
|
+
ProcessDeferred();
|
262
|
+
}
|
263
|
+
|
264
|
+
allocator_ = NULL;
|
265
|
+
}
|
266
|
+
|
267
|
+
|
268
|
+
void CodeGenerator::LoadReference(Reference* ref) {
|
269
|
+
VirtualFrame::SpilledScope spilled_scope;
|
270
|
+
Comment cmnt(masm_, "[ LoadReference");
|
271
|
+
Expression* e = ref->expression();
|
272
|
+
Property* property = e->AsProperty();
|
273
|
+
Variable* var = e->AsVariableProxy()->AsVariable();
|
274
|
+
|
275
|
+
if (property != NULL) {
|
276
|
+
UNIMPLEMENTED_MIPS();
|
277
|
+
} else if (var != NULL) {
|
278
|
+
// The expression is a variable proxy that does not rewrite to a
|
279
|
+
// property. Global variables are treated as named property references.
|
280
|
+
if (var->is_global()) {
|
281
|
+
LoadGlobal();
|
282
|
+
ref->set_type(Reference::NAMED);
|
283
|
+
} else {
|
284
|
+
ASSERT(var->slot() != NULL);
|
285
|
+
ref->set_type(Reference::SLOT);
|
286
|
+
}
|
287
|
+
} else {
|
288
|
+
UNIMPLEMENTED_MIPS();
|
289
|
+
}
|
290
|
+
}
|
291
|
+
|
292
|
+
|
293
|
+
void CodeGenerator::UnloadReference(Reference* ref) {
|
294
|
+
VirtualFrame::SpilledScope spilled_scope;
|
295
|
+
// Pop a reference from the stack while preserving TOS.
|
296
|
+
Comment cmnt(masm_, "[ UnloadReference");
|
297
|
+
int size = ref->size();
|
298
|
+
if (size > 0) {
|
299
|
+
frame_->EmitPop(a0);
|
300
|
+
frame_->Drop(size);
|
301
|
+
frame_->EmitPush(a0);
|
302
|
+
}
|
303
|
+
ref->set_unloaded();
|
304
|
+
}
|
305
|
+
|
306
|
+
|
307
|
+
MemOperand CodeGenerator::SlotOperand(Slot* slot, Register tmp) {
|
308
|
+
// Currently, this assertion will fail if we try to assign to
|
309
|
+
// a constant variable that is constant because it is read-only
|
310
|
+
// (such as the variable referring to a named function expression).
|
311
|
+
// We need to implement assignments to read-only variables.
|
312
|
+
// Ideally, we should do this during AST generation (by converting
|
313
|
+
// such assignments into expression statements); however, in general
|
314
|
+
// we may not be able to make the decision until past AST generation,
|
315
|
+
// that is when the entire program is known.
|
316
|
+
ASSERT(slot != NULL);
|
317
|
+
int index = slot->index();
|
318
|
+
switch (slot->type()) {
|
319
|
+
case Slot::PARAMETER:
|
320
|
+
UNIMPLEMENTED_MIPS();
|
321
|
+
return MemOperand(no_reg, 0);
|
322
|
+
|
323
|
+
case Slot::LOCAL:
|
324
|
+
return frame_->LocalAt(index);
|
325
|
+
|
326
|
+
case Slot::CONTEXT: {
|
327
|
+
UNIMPLEMENTED_MIPS();
|
328
|
+
return MemOperand(no_reg, 0);
|
329
|
+
}
|
330
|
+
|
331
|
+
default:
|
332
|
+
UNREACHABLE();
|
333
|
+
return MemOperand(no_reg, 0);
|
334
|
+
}
|
335
|
+
}
|
336
|
+
|
337
|
+
|
338
|
+
// Loads a value on TOS. If it is a boolean value, the result may have been
|
339
|
+
// (partially) translated into branches, or it may have set the condition
|
340
|
+
// code register. If force_cc is set, the value is forced to set the
|
341
|
+
// condition code register and no value is pushed. If the condition code
|
342
|
+
// register was set, has_cc() is true and cc_reg_ contains the condition to
|
343
|
+
// test for 'true'.
|
344
|
+
void CodeGenerator::LoadCondition(Expression* x,
|
345
|
+
JumpTarget* true_target,
|
346
|
+
JumpTarget* false_target,
|
347
|
+
bool force_cc) {
|
348
|
+
ASSERT(!has_cc());
|
349
|
+
int original_height = frame_->height();
|
350
|
+
|
351
|
+
{ CodeGenState new_state(this, true_target, false_target);
|
352
|
+
Visit(x);
|
353
|
+
|
354
|
+
// If we hit a stack overflow, we may not have actually visited
|
355
|
+
// the expression. In that case, we ensure that we have a
|
356
|
+
// valid-looking frame state because we will continue to generate
|
357
|
+
// code as we unwind the C++ stack.
|
358
|
+
//
|
359
|
+
// It's possible to have both a stack overflow and a valid frame
|
360
|
+
// state (eg, a subexpression overflowed, visiting it returned
|
361
|
+
// with a dummied frame state, and visiting this expression
|
362
|
+
// returned with a normal-looking state).
|
363
|
+
if (HasStackOverflow() &&
|
364
|
+
has_valid_frame() &&
|
365
|
+
!has_cc() &&
|
366
|
+
frame_->height() == original_height) {
|
367
|
+
true_target->Jump();
|
368
|
+
}
|
369
|
+
}
|
370
|
+
if (force_cc && frame_ != NULL && !has_cc()) {
|
371
|
+
// Convert the TOS value to a boolean in the condition code register.
|
372
|
+
UNIMPLEMENTED_MIPS();
|
373
|
+
}
|
374
|
+
ASSERT(!force_cc || !has_valid_frame() || has_cc());
|
375
|
+
ASSERT(!has_valid_frame() ||
|
376
|
+
(has_cc() && frame_->height() == original_height) ||
|
377
|
+
(!has_cc() && frame_->height() == original_height + 1));
|
378
|
+
}
|
379
|
+
|
380
|
+
|
381
|
+
void CodeGenerator::Load(Expression* x) {
|
382
|
+
#ifdef DEBUG
|
383
|
+
int original_height = frame_->height();
|
384
|
+
#endif
|
385
|
+
JumpTarget true_target;
|
386
|
+
JumpTarget false_target;
|
387
|
+
LoadCondition(x, &true_target, &false_target, false);
|
388
|
+
|
389
|
+
if (has_cc()) {
|
390
|
+
UNIMPLEMENTED_MIPS();
|
391
|
+
}
|
392
|
+
|
393
|
+
if (true_target.is_linked() || false_target.is_linked()) {
|
394
|
+
UNIMPLEMENTED_MIPS();
|
395
|
+
}
|
396
|
+
ASSERT(has_valid_frame());
|
397
|
+
ASSERT(!has_cc());
|
398
|
+
ASSERT(frame_->height() == original_height + 1);
|
399
|
+
}
|
400
|
+
|
401
|
+
|
402
|
+
void CodeGenerator::LoadGlobal() {
|
403
|
+
VirtualFrame::SpilledScope spilled_scope;
|
404
|
+
__ lw(a0, GlobalObject());
|
405
|
+
frame_->EmitPush(a0);
|
406
|
+
}
|
407
|
+
|
408
|
+
|
409
|
+
void CodeGenerator::LoadFromSlot(Slot* slot, TypeofState typeof_state) {
|
410
|
+
VirtualFrame::SpilledScope spilled_scope;
|
411
|
+
if (slot->type() == Slot::LOOKUP) {
|
412
|
+
UNIMPLEMENTED_MIPS();
|
413
|
+
} else {
|
414
|
+
__ lw(a0, SlotOperand(slot, a2));
|
415
|
+
frame_->EmitPush(a0);
|
416
|
+
if (slot->var()->mode() == Variable::CONST) {
|
417
|
+
UNIMPLEMENTED_MIPS();
|
418
|
+
}
|
419
|
+
}
|
420
|
+
}
|
421
|
+
|
422
|
+
|
423
|
+
void CodeGenerator::StoreToSlot(Slot* slot, InitState init_state) {
|
424
|
+
ASSERT(slot != NULL);
|
425
|
+
if (slot->type() == Slot::LOOKUP) {
|
426
|
+
UNIMPLEMENTED_MIPS();
|
427
|
+
} else {
|
428
|
+
ASSERT(!slot->var()->is_dynamic());
|
429
|
+
|
430
|
+
JumpTarget exit;
|
431
|
+
if (init_state == CONST_INIT) {
|
432
|
+
UNIMPLEMENTED_MIPS();
|
433
|
+
}
|
434
|
+
|
435
|
+
// We must execute the store. Storing a variable must keep the
|
436
|
+
// (new) value on the stack. This is necessary for compiling
|
437
|
+
// assignment expressions.
|
438
|
+
//
|
439
|
+
// Note: We will reach here even with slot->var()->mode() ==
|
440
|
+
// Variable::CONST because of const declarations which will
|
441
|
+
// initialize consts to 'the hole' value and by doing so, end up
|
442
|
+
// calling this code. a2 may be loaded with context; used below in
|
443
|
+
// RecordWrite.
|
444
|
+
frame_->EmitPop(a0);
|
445
|
+
__ sw(a0, SlotOperand(slot, a2));
|
446
|
+
frame_->EmitPush(a0);
|
447
|
+
if (slot->type() == Slot::CONTEXT) {
|
448
|
+
UNIMPLEMENTED_MIPS();
|
449
|
+
}
|
450
|
+
// If we definitely did not jump over the assignment, we do not need
|
451
|
+
// to bind the exit label. Doing so can defeat peephole
|
452
|
+
// optimization.
|
453
|
+
if (init_state == CONST_INIT || slot->type() == Slot::CONTEXT) {
|
454
|
+
exit.Bind();
|
455
|
+
}
|
456
|
+
}
|
457
|
+
}
|
458
|
+
|
459
|
+
|
460
|
+
void CodeGenerator::VisitStatements(ZoneList<Statement*>* statements) {
|
461
|
+
VirtualFrame::SpilledScope spilled_scope;
|
462
|
+
for (int i = 0; frame_ != NULL && i < statements->length(); i++) {
|
463
|
+
VisitAndSpill(statements->at(i));
|
464
|
+
}
|
465
|
+
}
|
466
|
+
|
467
|
+
|
468
|
+
void CodeGenerator::VisitBlock(Block* node) {
|
469
|
+
UNIMPLEMENTED_MIPS();
|
470
|
+
}
|
471
|
+
|
472
|
+
|
473
|
+
void CodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) {
|
474
|
+
VirtualFrame::SpilledScope spilled_scope;
|
475
|
+
frame_->EmitPush(cp);
|
476
|
+
__ li(t0, Operand(pairs));
|
477
|
+
frame_->EmitPush(t0);
|
478
|
+
__ li(t0, Operand(Smi::FromInt(is_eval() ? 1 : 0)));
|
479
|
+
frame_->EmitPush(t0);
|
480
|
+
frame_->CallRuntime(Runtime::kDeclareGlobals, 3);
|
481
|
+
// The result is discarded.
|
482
|
+
}
|
483
|
+
|
484
|
+
|
485
|
+
void CodeGenerator::VisitDeclaration(Declaration* node) {
|
486
|
+
UNIMPLEMENTED_MIPS();
|
487
|
+
}
|
488
|
+
|
489
|
+
|
490
|
+
void CodeGenerator::VisitExpressionStatement(ExpressionStatement* node) {
|
491
|
+
#ifdef DEBUG
|
492
|
+
int original_height = frame_->height();
|
493
|
+
#endif
|
494
|
+
VirtualFrame::SpilledScope spilled_scope;
|
495
|
+
Comment cmnt(masm_, "[ ExpressionStatement");
|
496
|
+
CodeForStatementPosition(node);
|
497
|
+
Expression* expression = node->expression();
|
498
|
+
expression->MarkAsStatement();
|
499
|
+
LoadAndSpill(expression);
|
500
|
+
frame_->Drop();
|
501
|
+
ASSERT(frame_->height() == original_height);
|
502
|
+
}
|
503
|
+
|
504
|
+
|
505
|
+
void CodeGenerator::VisitEmptyStatement(EmptyStatement* node) {
|
506
|
+
UNIMPLEMENTED_MIPS();
|
507
|
+
}
|
508
|
+
|
509
|
+
|
510
|
+
void CodeGenerator::VisitIfStatement(IfStatement* node) {
|
511
|
+
UNIMPLEMENTED_MIPS();
|
512
|
+
}
|
513
|
+
|
514
|
+
|
515
|
+
void CodeGenerator::VisitContinueStatement(ContinueStatement* node) {
|
516
|
+
UNIMPLEMENTED_MIPS();
|
517
|
+
}
|
518
|
+
|
519
|
+
|
520
|
+
void CodeGenerator::VisitBreakStatement(BreakStatement* node) {
|
521
|
+
UNIMPLEMENTED_MIPS();
|
522
|
+
}
|
523
|
+
|
524
|
+
|
525
|
+
void CodeGenerator::VisitReturnStatement(ReturnStatement* node) {
|
526
|
+
VirtualFrame::SpilledScope spilled_scope;
|
527
|
+
Comment cmnt(masm_, "[ ReturnStatement");
|
528
|
+
|
529
|
+
CodeForStatementPosition(node);
|
530
|
+
LoadAndSpill(node->expression());
|
531
|
+
if (function_return_is_shadowed_) {
|
532
|
+
frame_->EmitPop(v0);
|
533
|
+
function_return_.Jump();
|
534
|
+
} else {
|
535
|
+
// Pop the result from the frame and prepare the frame for
|
536
|
+
// returning thus making it easier to merge.
|
537
|
+
frame_->EmitPop(v0);
|
538
|
+
frame_->PrepareForReturn();
|
539
|
+
|
540
|
+
function_return_.Jump();
|
541
|
+
}
|
542
|
+
}
|
543
|
+
|
544
|
+
|
545
|
+
void CodeGenerator::VisitWithEnterStatement(WithEnterStatement* node) {
|
546
|
+
UNIMPLEMENTED_MIPS();
|
547
|
+
}
|
548
|
+
|
549
|
+
|
550
|
+
void CodeGenerator::VisitWithExitStatement(WithExitStatement* node) {
|
551
|
+
UNIMPLEMENTED_MIPS();
|
552
|
+
}
|
553
|
+
|
554
|
+
|
555
|
+
void CodeGenerator::VisitSwitchStatement(SwitchStatement* node) {
|
556
|
+
UNIMPLEMENTED_MIPS();
|
557
|
+
}
|
558
|
+
|
559
|
+
|
560
|
+
void CodeGenerator::VisitDoWhileStatement(DoWhileStatement* node) {
|
561
|
+
UNIMPLEMENTED_MIPS();
|
562
|
+
}
|
563
|
+
|
564
|
+
|
565
|
+
void CodeGenerator::VisitWhileStatement(WhileStatement* node) {
|
566
|
+
UNIMPLEMENTED_MIPS();
|
567
|
+
}
|
568
|
+
|
569
|
+
|
570
|
+
void CodeGenerator::VisitForStatement(ForStatement* node) {
|
571
|
+
UNIMPLEMENTED_MIPS();
|
572
|
+
}
|
573
|
+
|
574
|
+
|
575
|
+
void CodeGenerator::VisitForInStatement(ForInStatement* node) {
|
576
|
+
UNIMPLEMENTED_MIPS();
|
577
|
+
}
|
578
|
+
|
579
|
+
|
580
|
+
void CodeGenerator::VisitTryCatchStatement(TryCatchStatement* node) {
|
581
|
+
UNIMPLEMENTED_MIPS();
|
582
|
+
}
|
583
|
+
|
584
|
+
|
585
|
+
void CodeGenerator::VisitTryFinallyStatement(TryFinallyStatement* node) {
|
586
|
+
UNIMPLEMENTED_MIPS();
|
587
|
+
}
|
588
|
+
|
589
|
+
|
590
|
+
void CodeGenerator::VisitDebuggerStatement(DebuggerStatement* node) {
|
591
|
+
UNIMPLEMENTED_MIPS();
|
592
|
+
}
|
593
|
+
|
594
|
+
|
595
|
+
void CodeGenerator::VisitFunctionLiteral(FunctionLiteral* node) {
|
596
|
+
UNIMPLEMENTED_MIPS();
|
597
|
+
}
|
598
|
+
|
599
|
+
|
600
|
+
void CodeGenerator::VisitSharedFunctionInfoLiteral(
|
601
|
+
SharedFunctionInfoLiteral* node) {
|
602
|
+
UNIMPLEMENTED_MIPS();
|
603
|
+
}
|
604
|
+
|
605
|
+
|
606
|
+
void CodeGenerator::VisitConditional(Conditional* node) {
|
607
|
+
UNIMPLEMENTED_MIPS();
|
608
|
+
}
|
609
|
+
|
610
|
+
|
611
|
+
void CodeGenerator::VisitSlot(Slot* node) {
|
612
|
+
#ifdef DEBUG
|
613
|
+
int original_height = frame_->height();
|
614
|
+
#endif
|
615
|
+
VirtualFrame::SpilledScope spilled_scope;
|
616
|
+
Comment cmnt(masm_, "[ Slot");
|
617
|
+
LoadFromSlot(node, typeof_state());
|
618
|
+
ASSERT(frame_->height() == original_height + 1);
|
619
|
+
}
|
620
|
+
|
621
|
+
|
622
|
+
void CodeGenerator::VisitVariableProxy(VariableProxy* node) {
|
623
|
+
#ifdef DEBUG
|
624
|
+
int original_height = frame_->height();
|
625
|
+
#endif
|
626
|
+
VirtualFrame::SpilledScope spilled_scope;
|
627
|
+
Comment cmnt(masm_, "[ VariableProxy");
|
628
|
+
|
629
|
+
Variable* var = node->var();
|
630
|
+
Expression* expr = var->rewrite();
|
631
|
+
if (expr != NULL) {
|
632
|
+
Visit(expr);
|
633
|
+
} else {
|
634
|
+
ASSERT(var->is_global());
|
635
|
+
Reference ref(this, node);
|
636
|
+
ref.GetValueAndSpill();
|
637
|
+
}
|
638
|
+
ASSERT(frame_->height() == original_height + 1);
|
639
|
+
}
|
640
|
+
|
641
|
+
|
642
|
+
void CodeGenerator::VisitLiteral(Literal* node) {
|
643
|
+
#ifdef DEBUG
|
644
|
+
int original_height = frame_->height();
|
645
|
+
#endif
|
646
|
+
VirtualFrame::SpilledScope spilled_scope;
|
647
|
+
Comment cmnt(masm_, "[ Literal");
|
648
|
+
__ li(t0, Operand(node->handle()));
|
649
|
+
frame_->EmitPush(t0);
|
650
|
+
ASSERT(frame_->height() == original_height + 1);
|
651
|
+
}
|
652
|
+
|
653
|
+
|
654
|
+
void CodeGenerator::VisitRegExpLiteral(RegExpLiteral* node) {
|
655
|
+
UNIMPLEMENTED_MIPS();
|
656
|
+
}
|
657
|
+
|
658
|
+
|
659
|
+
void CodeGenerator::VisitObjectLiteral(ObjectLiteral* node) {
|
660
|
+
UNIMPLEMENTED_MIPS();
|
661
|
+
}
|
662
|
+
|
663
|
+
|
664
|
+
void CodeGenerator::VisitArrayLiteral(ArrayLiteral* node) {
|
665
|
+
UNIMPLEMENTED_MIPS();
|
666
|
+
}
|
667
|
+
|
668
|
+
|
669
|
+
void CodeGenerator::VisitCatchExtensionObject(CatchExtensionObject* node) {
|
670
|
+
UNIMPLEMENTED_MIPS();
|
671
|
+
}
|
672
|
+
|
673
|
+
|
674
|
+
void CodeGenerator::VisitAssignment(Assignment* node) {
|
675
|
+
#ifdef DEBUG
|
676
|
+
int original_height = frame_->height();
|
677
|
+
#endif
|
678
|
+
VirtualFrame::SpilledScope spilled_scope;
|
679
|
+
Comment cmnt(masm_, "[ Assignment");
|
680
|
+
|
681
|
+
{ Reference target(this, node->target());
|
682
|
+
if (target.is_illegal()) {
|
683
|
+
// Fool the virtual frame into thinking that we left the assignment's
|
684
|
+
// value on the frame.
|
685
|
+
frame_->EmitPush(zero_reg);
|
686
|
+
ASSERT(frame_->height() == original_height + 1);
|
687
|
+
return;
|
688
|
+
}
|
689
|
+
|
690
|
+
if (node->op() == Token::ASSIGN ||
|
691
|
+
node->op() == Token::INIT_VAR ||
|
692
|
+
node->op() == Token::INIT_CONST) {
|
693
|
+
LoadAndSpill(node->value());
|
694
|
+
} else {
|
695
|
+
UNIMPLEMENTED_MIPS();
|
696
|
+
}
|
697
|
+
|
698
|
+
Variable* var = node->target()->AsVariableProxy()->AsVariable();
|
699
|
+
if (var != NULL &&
|
700
|
+
(var->mode() == Variable::CONST) &&
|
701
|
+
node->op() != Token::INIT_VAR && node->op() != Token::INIT_CONST) {
|
702
|
+
// Assignment ignored - leave the value on the stack.
|
703
|
+
} else {
|
704
|
+
CodeForSourcePosition(node->position());
|
705
|
+
if (node->op() == Token::INIT_CONST) {
|
706
|
+
// Dynamic constant initializations must use the function context
|
707
|
+
// and initialize the actual constant declared. Dynamic variable
|
708
|
+
// initializations are simply assignments and use SetValue.
|
709
|
+
target.SetValue(CONST_INIT);
|
710
|
+
} else {
|
711
|
+
target.SetValue(NOT_CONST_INIT);
|
712
|
+
}
|
713
|
+
}
|
714
|
+
}
|
715
|
+
ASSERT(frame_->height() == original_height + 1);
|
716
|
+
}
|
717
|
+
|
718
|
+
|
719
|
+
void CodeGenerator::VisitThrow(Throw* node) {
|
720
|
+
UNIMPLEMENTED_MIPS();
|
721
|
+
}
|
722
|
+
|
723
|
+
|
724
|
+
void CodeGenerator::VisitProperty(Property* node) {
|
725
|
+
UNIMPLEMENTED_MIPS();
|
726
|
+
}
|
727
|
+
|
728
|
+
|
729
|
+
void CodeGenerator::VisitCall(Call* node) {
|
730
|
+
#ifdef DEBUG
|
731
|
+
int original_height = frame_->height();
|
732
|
+
#endif
|
733
|
+
VirtualFrame::SpilledScope spilled_scope;
|
734
|
+
Comment cmnt(masm_, "[ Call");
|
735
|
+
|
736
|
+
Expression* function = node->expression();
|
737
|
+
ZoneList<Expression*>* args = node->arguments();
|
738
|
+
|
739
|
+
// Standard function call.
|
740
|
+
// Check if the function is a variable or a property.
|
741
|
+
Variable* var = function->AsVariableProxy()->AsVariable();
|
742
|
+
Property* property = function->AsProperty();
|
743
|
+
|
744
|
+
// ------------------------------------------------------------------------
|
745
|
+
// Fast-case: Use inline caching.
|
746
|
+
// ---
|
747
|
+
// According to ECMA-262, section 11.2.3, page 44, the function to call
|
748
|
+
// must be resolved after the arguments have been evaluated. The IC code
|
749
|
+
// automatically handles this by loading the arguments before the function
|
750
|
+
// is resolved in cache misses (this also holds for megamorphic calls).
|
751
|
+
// ------------------------------------------------------------------------
|
752
|
+
|
753
|
+
if (var != NULL && var->is_possibly_eval()) {
|
754
|
+
UNIMPLEMENTED_MIPS();
|
755
|
+
} else if (var != NULL && !var->is_this() && var->is_global()) {
|
756
|
+
// ----------------------------------
|
757
|
+
// JavaScript example: 'foo(1, 2, 3)' // foo is global
|
758
|
+
// ----------------------------------
|
759
|
+
|
760
|
+
int arg_count = args->length();
|
761
|
+
|
762
|
+
// We need sp to be 8 bytes aligned when calling the stub.
|
763
|
+
__ SetupAlignedCall(t0, arg_count);
|
764
|
+
|
765
|
+
// Pass the global object as the receiver and let the IC stub
|
766
|
+
// patch the stack to use the global proxy as 'this' in the
|
767
|
+
// invoked function.
|
768
|
+
LoadGlobal();
|
769
|
+
|
770
|
+
// Load the arguments.
|
771
|
+
for (int i = 0; i < arg_count; i++) {
|
772
|
+
LoadAndSpill(args->at(i));
|
773
|
+
}
|
774
|
+
|
775
|
+
// Setup the receiver register and call the IC initialization code.
|
776
|
+
__ li(a2, Operand(var->name()));
|
777
|
+
InLoopFlag in_loop = loop_nesting() > 0 ? IN_LOOP : NOT_IN_LOOP;
|
778
|
+
Handle<Code> stub = ComputeCallInitialize(arg_count, in_loop);
|
779
|
+
CodeForSourcePosition(node->position());
|
780
|
+
frame_->CallCodeObject(stub, RelocInfo::CODE_TARGET_CONTEXT,
|
781
|
+
arg_count + 1);
|
782
|
+
__ ReturnFromAlignedCall();
|
783
|
+
__ lw(cp, frame_->Context());
|
784
|
+
// Remove the function from the stack.
|
785
|
+
frame_->EmitPush(v0);
|
786
|
+
|
787
|
+
} else if (var != NULL && var->slot() != NULL &&
|
788
|
+
var->slot()->type() == Slot::LOOKUP) {
|
789
|
+
UNIMPLEMENTED_MIPS();
|
790
|
+
} else if (property != NULL) {
|
791
|
+
UNIMPLEMENTED_MIPS();
|
792
|
+
} else {
|
793
|
+
UNIMPLEMENTED_MIPS();
|
794
|
+
}
|
795
|
+
|
796
|
+
ASSERT(frame_->height() == original_height + 1);
|
797
|
+
}
|
798
|
+
|
799
|
+
|
800
|
+
void CodeGenerator::VisitCallNew(CallNew* node) {
|
801
|
+
UNIMPLEMENTED_MIPS();
|
802
|
+
}
|
803
|
+
|
804
|
+
|
805
|
+
void CodeGenerator::GenerateClassOf(ZoneList<Expression*>* args) {
|
806
|
+
UNIMPLEMENTED_MIPS();
|
807
|
+
}
|
808
|
+
|
809
|
+
|
810
|
+
void CodeGenerator::GenerateValueOf(ZoneList<Expression*>* args) {
|
811
|
+
UNIMPLEMENTED_MIPS();
|
812
|
+
}
|
813
|
+
|
814
|
+
|
815
|
+
void CodeGenerator::GenerateSetValueOf(ZoneList<Expression*>* args) {
|
816
|
+
UNIMPLEMENTED_MIPS();
|
817
|
+
}
|
818
|
+
|
819
|
+
|
820
|
+
void CodeGenerator::GenerateIsSmi(ZoneList<Expression*>* args) {
|
821
|
+
UNIMPLEMENTED_MIPS();
|
822
|
+
}
|
823
|
+
|
824
|
+
|
825
|
+
void CodeGenerator::GenerateLog(ZoneList<Expression*>* args) {
|
826
|
+
UNIMPLEMENTED_MIPS();
|
827
|
+
}
|
828
|
+
|
829
|
+
|
830
|
+
void CodeGenerator::GenerateIsNonNegativeSmi(ZoneList<Expression*>* args) {
|
831
|
+
UNIMPLEMENTED_MIPS();
|
832
|
+
}
|
833
|
+
|
834
|
+
|
835
|
+
void CodeGenerator::GenerateMathPow(ZoneList<Expression*>* args) {
|
836
|
+
UNIMPLEMENTED_MIPS();
|
837
|
+
}
|
838
|
+
|
839
|
+
|
840
|
+
void CodeGenerator::GenerateMathCos(ZoneList<Expression*>* args) {
|
841
|
+
UNIMPLEMENTED_MIPS();
|
842
|
+
}
|
843
|
+
|
844
|
+
|
845
|
+
void CodeGenerator::GenerateMathSin(ZoneList<Expression*>* args) {
|
846
|
+
UNIMPLEMENTED_MIPS();
|
847
|
+
}
|
848
|
+
|
849
|
+
|
850
|
+
void CodeGenerator::GenerateMathSqrt(ZoneList<Expression*>* args) {
|
851
|
+
UNIMPLEMENTED_MIPS();
|
852
|
+
}
|
853
|
+
|
854
|
+
|
855
|
+
// This should generate code that performs a charCodeAt() call or returns
|
856
|
+
// undefined in order to trigger the slow case, Runtime_StringCharCodeAt.
|
857
|
+
// It is not yet implemented on ARM, so it always goes to the slow case.
|
858
|
+
void CodeGenerator::GenerateFastCharCodeAt(ZoneList<Expression*>* args) {
|
859
|
+
UNIMPLEMENTED_MIPS();
|
860
|
+
}
|
861
|
+
|
862
|
+
|
863
|
+
void CodeGenerator::GenerateCharFromCode(ZoneList<Expression*>* args) {
|
864
|
+
UNIMPLEMENTED_MIPS();
|
865
|
+
}
|
866
|
+
|
867
|
+
|
868
|
+
void CodeGenerator::GenerateIsArray(ZoneList<Expression*>* args) {
|
869
|
+
UNIMPLEMENTED_MIPS();
|
870
|
+
}
|
871
|
+
|
872
|
+
|
873
|
+
void CodeGenerator::GenerateIsRegExp(ZoneList<Expression*>* args) {
|
874
|
+
UNIMPLEMENTED_MIPS();
|
875
|
+
}
|
876
|
+
|
877
|
+
|
878
|
+
void CodeGenerator::GenerateIsConstructCall(ZoneList<Expression*>* args) {
|
879
|
+
UNIMPLEMENTED_MIPS();
|
880
|
+
}
|
881
|
+
|
882
|
+
|
883
|
+
void CodeGenerator::GenerateArgumentsLength(ZoneList<Expression*>* args) {
|
884
|
+
UNIMPLEMENTED_MIPS();
|
885
|
+
}
|
886
|
+
|
887
|
+
|
888
|
+
void CodeGenerator::GenerateArguments(ZoneList<Expression*>* args) {
|
889
|
+
UNIMPLEMENTED_MIPS();
|
890
|
+
}
|
891
|
+
|
892
|
+
|
893
|
+
void CodeGenerator::GenerateRandomHeapNumber(ZoneList<Expression*>* args) {
|
894
|
+
UNIMPLEMENTED_MIPS();
|
895
|
+
}
|
896
|
+
|
897
|
+
|
898
|
+
void CodeGenerator::GenerateObjectEquals(ZoneList<Expression*>* args) {
|
899
|
+
UNIMPLEMENTED_MIPS();
|
900
|
+
}
|
901
|
+
|
902
|
+
|
903
|
+
void CodeGenerator::GenerateIsObject(ZoneList<Expression*>* args) {
|
904
|
+
UNIMPLEMENTED_MIPS();
|
905
|
+
}
|
906
|
+
|
907
|
+
|
908
|
+
void CodeGenerator::GenerateIsFunction(ZoneList<Expression*>* args) {
|
909
|
+
UNIMPLEMENTED_MIPS();
|
910
|
+
}
|
911
|
+
|
912
|
+
|
913
|
+
void CodeGenerator::GenerateIsUndetectableObject(ZoneList<Expression*>* args) {
|
914
|
+
UNIMPLEMENTED_MIPS();
|
915
|
+
}
|
916
|
+
|
917
|
+
|
918
|
+
void CodeGenerator::GenerateStringAdd(ZoneList<Expression*>* args) {
|
919
|
+
UNIMPLEMENTED_MIPS();
|
920
|
+
}
|
921
|
+
|
922
|
+
|
923
|
+
void CodeGenerator::GenerateSubString(ZoneList<Expression*>* args) {
|
924
|
+
UNIMPLEMENTED_MIPS();
|
925
|
+
}
|
926
|
+
|
927
|
+
|
928
|
+
void CodeGenerator::GenerateStringCompare(ZoneList<Expression*>* args) {
|
929
|
+
UNIMPLEMENTED_MIPS();
|
930
|
+
}
|
931
|
+
|
932
|
+
|
933
|
+
void CodeGenerator::GenerateRegExpExec(ZoneList<Expression*>* args) {
|
934
|
+
UNIMPLEMENTED_MIPS();
|
935
|
+
}
|
936
|
+
|
937
|
+
|
938
|
+
void CodeGenerator::GenerateNumberToString(ZoneList<Expression*>* args) {
|
939
|
+
UNIMPLEMENTED_MIPS();
|
940
|
+
}
|
941
|
+
|
942
|
+
|
943
|
+
void CodeGenerator::VisitCallRuntime(CallRuntime* node) {
|
944
|
+
UNIMPLEMENTED_MIPS();
|
945
|
+
}
|
946
|
+
|
947
|
+
|
948
|
+
void CodeGenerator::VisitUnaryOperation(UnaryOperation* node) {
|
949
|
+
UNIMPLEMENTED_MIPS();
|
950
|
+
}
|
951
|
+
|
952
|
+
|
953
|
+
void CodeGenerator::VisitCountOperation(CountOperation* node) {
|
954
|
+
UNIMPLEMENTED_MIPS();
|
955
|
+
}
|
956
|
+
|
957
|
+
|
958
|
+
void CodeGenerator::VisitBinaryOperation(BinaryOperation* node) {
|
959
|
+
UNIMPLEMENTED_MIPS();
|
960
|
+
}
|
961
|
+
|
962
|
+
|
963
|
+
void CodeGenerator::VisitThisFunction(ThisFunction* node) {
|
964
|
+
UNIMPLEMENTED_MIPS();
|
965
|
+
}
|
966
|
+
|
967
|
+
|
968
|
+
void CodeGenerator::VisitCompareOperation(CompareOperation* node) {
|
969
|
+
UNIMPLEMENTED_MIPS();
|
970
|
+
}
|
971
|
+
|
972
|
+
|
973
|
+
#ifdef DEBUG
|
974
|
+
bool CodeGenerator::HasValidEntryRegisters() { return true; }
|
975
|
+
#endif
|
976
|
+
|
977
|
+
|
978
|
+
#undef __
|
979
|
+
#define __ ACCESS_MASM(masm)
|
980
|
+
|
981
|
+
// -----------------------------------------------------------------------------
|
982
|
+
// Reference support
|
983
|
+
|
984
|
+
Reference::Reference(CodeGenerator* cgen,
|
985
|
+
Expression* expression,
|
986
|
+
bool persist_after_get)
|
987
|
+
: cgen_(cgen),
|
988
|
+
expression_(expression),
|
989
|
+
type_(ILLEGAL),
|
990
|
+
persist_after_get_(persist_after_get) {
|
991
|
+
cgen->LoadReference(this);
|
992
|
+
}
|
993
|
+
|
994
|
+
|
995
|
+
Reference::~Reference() {
|
996
|
+
ASSERT(is_unloaded() || is_illegal());
|
997
|
+
}
|
998
|
+
|
999
|
+
|
1000
|
+
Handle<String> Reference::GetName() {
|
1001
|
+
ASSERT(type_ == NAMED);
|
1002
|
+
Property* property = expression_->AsProperty();
|
1003
|
+
if (property == NULL) {
|
1004
|
+
// Global variable reference treated as a named property reference.
|
1005
|
+
VariableProxy* proxy = expression_->AsVariableProxy();
|
1006
|
+
ASSERT(proxy->AsVariable() != NULL);
|
1007
|
+
ASSERT(proxy->AsVariable()->is_global());
|
1008
|
+
return proxy->name();
|
1009
|
+
} else {
|
1010
|
+
Literal* raw_name = property->key()->AsLiteral();
|
1011
|
+
ASSERT(raw_name != NULL);
|
1012
|
+
return Handle<String>(String::cast(*raw_name->handle()));
|
1013
|
+
}
|
1014
|
+
}
|
1015
|
+
|
1016
|
+
|
1017
|
+
void Reference::GetValue() {
|
1018
|
+
ASSERT(cgen_->HasValidEntryRegisters());
|
1019
|
+
ASSERT(!is_illegal());
|
1020
|
+
ASSERT(!cgen_->has_cc());
|
1021
|
+
Property* property = expression_->AsProperty();
|
1022
|
+
if (property != NULL) {
|
1023
|
+
cgen_->CodeForSourcePosition(property->position());
|
1024
|
+
}
|
1025
|
+
|
1026
|
+
switch (type_) {
|
1027
|
+
case SLOT: {
|
1028
|
+
UNIMPLEMENTED_MIPS();
|
1029
|
+
break;
|
1030
|
+
}
|
1031
|
+
|
1032
|
+
case NAMED: {
|
1033
|
+
UNIMPLEMENTED_MIPS();
|
1034
|
+
break;
|
1035
|
+
}
|
1036
|
+
|
1037
|
+
case KEYED: {
|
1038
|
+
UNIMPLEMENTED_MIPS();
|
1039
|
+
break;
|
1040
|
+
}
|
1041
|
+
|
1042
|
+
default:
|
1043
|
+
UNREACHABLE();
|
1044
|
+
}
|
1045
|
+
}
|
1046
|
+
|
1047
|
+
|
1048
|
+
void Reference::SetValue(InitState init_state) {
|
1049
|
+
ASSERT(!is_illegal());
|
1050
|
+
ASSERT(!cgen_->has_cc());
|
1051
|
+
MacroAssembler* masm = cgen_->masm();
|
1052
|
+
Property* property = expression_->AsProperty();
|
1053
|
+
if (property != NULL) {
|
1054
|
+
cgen_->CodeForSourcePosition(property->position());
|
1055
|
+
}
|
1056
|
+
|
1057
|
+
switch (type_) {
|
1058
|
+
case SLOT: {
|
1059
|
+
Comment cmnt(masm, "[ Store to Slot");
|
1060
|
+
Slot* slot = expression_->AsVariableProxy()->AsVariable()->slot();
|
1061
|
+
cgen_->StoreToSlot(slot, init_state);
|
1062
|
+
cgen_->UnloadReference(this);
|
1063
|
+
break;
|
1064
|
+
}
|
1065
|
+
|
1066
|
+
case NAMED: {
|
1067
|
+
UNIMPLEMENTED_MIPS();
|
1068
|
+
break;
|
1069
|
+
}
|
1070
|
+
|
1071
|
+
case KEYED: {
|
1072
|
+
UNIMPLEMENTED_MIPS();
|
1073
|
+
break;
|
1074
|
+
}
|
1075
|
+
|
1076
|
+
default:
|
1077
|
+
UNREACHABLE();
|
1078
|
+
}
|
1079
|
+
}
|
1080
|
+
|
1081
|
+
|
1082
|
+
// On entry a0 and a1 are the things to be compared. On exit v0 is 0,
|
1083
|
+
// positive or negative to indicate the result of the comparison.
|
1084
|
+
void CompareStub::Generate(MacroAssembler* masm) {
|
1085
|
+
UNIMPLEMENTED_MIPS();
|
1086
|
+
__ break_(0x765);
|
1087
|
+
}
|
1088
|
+
|
1089
|
+
|
1090
|
+
Handle<Code> GetBinaryOpStub(int key, BinaryOpIC::TypeInfo type_info) {
|
1091
|
+
UNIMPLEMENTED_MIPS();
|
1092
|
+
return Handle<Code>::null();
|
1093
|
+
}
|
1094
|
+
|
1095
|
+
|
1096
|
+
void StackCheckStub::Generate(MacroAssembler* masm) {
|
1097
|
+
UNIMPLEMENTED_MIPS();
|
1098
|
+
__ break_(0x790);
|
1099
|
+
}
|
1100
|
+
|
1101
|
+
|
1102
|
+
void CEntryStub::GenerateThrowTOS(MacroAssembler* masm) {
|
1103
|
+
UNIMPLEMENTED_MIPS();
|
1104
|
+
__ break_(0x808);
|
1105
|
+
}
|
1106
|
+
|
1107
|
+
|
1108
|
+
void CEntryStub::GenerateThrowUncatchable(MacroAssembler* masm,
|
1109
|
+
UncatchableExceptionType type) {
|
1110
|
+
UNIMPLEMENTED_MIPS();
|
1111
|
+
__ break_(0x815);
|
1112
|
+
}
|
1113
|
+
|
1114
|
+
void CEntryStub::GenerateCore(MacroAssembler* masm,
|
1115
|
+
Label* throw_normal_exception,
|
1116
|
+
Label* throw_termination_exception,
|
1117
|
+
Label* throw_out_of_memory_exception,
|
1118
|
+
bool do_gc,
|
1119
|
+
bool always_allocate) {
|
1120
|
+
// s0: number of arguments including receiver (C callee-saved)
|
1121
|
+
// s1: pointer to the first argument (C callee-saved)
|
1122
|
+
// s2: pointer to builtin function (C callee-saved)
|
1123
|
+
|
1124
|
+
if (do_gc) {
|
1125
|
+
UNIMPLEMENTED_MIPS();
|
1126
|
+
}
|
1127
|
+
|
1128
|
+
ExternalReference scope_depth =
|
1129
|
+
ExternalReference::heap_always_allocate_scope_depth();
|
1130
|
+
if (always_allocate) {
|
1131
|
+
UNIMPLEMENTED_MIPS();
|
1132
|
+
}
|
1133
|
+
|
1134
|
+
// Call C built-in.
|
1135
|
+
// a0 = argc, a1 = argv
|
1136
|
+
__ mov(a0, s0);
|
1137
|
+
__ mov(a1, s1);
|
1138
|
+
|
1139
|
+
__ CallBuiltin(s2);
|
1140
|
+
|
1141
|
+
if (always_allocate) {
|
1142
|
+
UNIMPLEMENTED_MIPS();
|
1143
|
+
}
|
1144
|
+
|
1145
|
+
// Check for failure result.
|
1146
|
+
Label failure_returned;
|
1147
|
+
ASSERT(((kFailureTag + 1) & kFailureTagMask) == 0);
|
1148
|
+
__ addiu(a2, v0, 1);
|
1149
|
+
__ andi(t0, a2, kFailureTagMask);
|
1150
|
+
__ Branch(eq, &failure_returned, t0, Operand(zero_reg));
|
1151
|
+
|
1152
|
+
// Exit C frame and return.
|
1153
|
+
// v0:v1: result
|
1154
|
+
// sp: stack pointer
|
1155
|
+
// fp: frame pointer
|
1156
|
+
__ LeaveExitFrame(mode_);
|
1157
|
+
|
1158
|
+
// Check if we should retry or throw exception.
|
1159
|
+
Label retry;
|
1160
|
+
__ bind(&failure_returned);
|
1161
|
+
ASSERT(Failure::RETRY_AFTER_GC == 0);
|
1162
|
+
__ andi(t0, v0, ((1 << kFailureTypeTagSize) - 1) << kFailureTagSize);
|
1163
|
+
__ Branch(eq, &retry, t0, Operand(zero_reg));
|
1164
|
+
|
1165
|
+
// Special handling of out of memory exceptions.
|
1166
|
+
Failure* out_of_memory = Failure::OutOfMemoryException();
|
1167
|
+
__ Branch(eq, throw_out_of_memory_exception,
|
1168
|
+
v0, Operand(reinterpret_cast<int32_t>(out_of_memory)));
|
1169
|
+
|
1170
|
+
// Retrieve the pending exception and clear the variable.
|
1171
|
+
__ LoadExternalReference(t0, ExternalReference::the_hole_value_location());
|
1172
|
+
__ lw(a3, MemOperand(t0));
|
1173
|
+
__ LoadExternalReference(t0,
|
1174
|
+
ExternalReference(Top::k_pending_exception_address));
|
1175
|
+
__ lw(v0, MemOperand(t0));
|
1176
|
+
__ sw(a3, MemOperand(t0));
|
1177
|
+
|
1178
|
+
// Special handling of termination exceptions which are uncatchable
|
1179
|
+
// by javascript code.
|
1180
|
+
__ Branch(eq, throw_termination_exception,
|
1181
|
+
v0, Operand(Factory::termination_exception()));
|
1182
|
+
|
1183
|
+
// Handle normal exception.
|
1184
|
+
__ b(throw_normal_exception);
|
1185
|
+
__ nop(); // Branch delay slot nop.
|
1186
|
+
|
1187
|
+
__ bind(&retry); // pass last failure (r0) as parameter (r0) when retrying
|
1188
|
+
}
|
1189
|
+
|
1190
|
+
void CEntryStub::Generate(MacroAssembler* masm) {
|
1191
|
+
// Called from JavaScript; parameters are on stack as if calling JS function
|
1192
|
+
// a0: number of arguments including receiver
|
1193
|
+
// a1: pointer to builtin function
|
1194
|
+
// fp: frame pointer (restored after C call)
|
1195
|
+
// sp: stack pointer (restored as callee's sp after C call)
|
1196
|
+
// cp: current context (C callee-saved)
|
1197
|
+
|
1198
|
+
// NOTE: Invocations of builtins may return failure objects
|
1199
|
+
// instead of a proper result. The builtin entry handles
|
1200
|
+
// this by performing a garbage collection and retrying the
|
1201
|
+
// builtin once.
|
1202
|
+
|
1203
|
+
// Enter the exit frame that transitions from JavaScript to C++.
|
1204
|
+
__ EnterExitFrame(mode_, s0, s1, s2);
|
1205
|
+
|
1206
|
+
// s0: number of arguments (C callee-saved)
|
1207
|
+
// s1: pointer to first argument (C callee-saved)
|
1208
|
+
// s2: pointer to builtin function (C callee-saved)
|
1209
|
+
|
1210
|
+
Label throw_normal_exception;
|
1211
|
+
Label throw_termination_exception;
|
1212
|
+
Label throw_out_of_memory_exception;
|
1213
|
+
|
1214
|
+
// Call into the runtime system.
|
1215
|
+
GenerateCore(masm,
|
1216
|
+
&throw_normal_exception,
|
1217
|
+
&throw_termination_exception,
|
1218
|
+
&throw_out_of_memory_exception,
|
1219
|
+
false,
|
1220
|
+
false);
|
1221
|
+
|
1222
|
+
// Do space-specific GC and retry runtime call.
|
1223
|
+
GenerateCore(masm,
|
1224
|
+
&throw_normal_exception,
|
1225
|
+
&throw_termination_exception,
|
1226
|
+
&throw_out_of_memory_exception,
|
1227
|
+
true,
|
1228
|
+
false);
|
1229
|
+
|
1230
|
+
// Do full GC and retry runtime call one final time.
|
1231
|
+
Failure* failure = Failure::InternalError();
|
1232
|
+
__ li(v0, Operand(reinterpret_cast<int32_t>(failure)));
|
1233
|
+
GenerateCore(masm,
|
1234
|
+
&throw_normal_exception,
|
1235
|
+
&throw_termination_exception,
|
1236
|
+
&throw_out_of_memory_exception,
|
1237
|
+
true,
|
1238
|
+
true);
|
1239
|
+
|
1240
|
+
__ bind(&throw_out_of_memory_exception);
|
1241
|
+
GenerateThrowUncatchable(masm, OUT_OF_MEMORY);
|
1242
|
+
|
1243
|
+
__ bind(&throw_termination_exception);
|
1244
|
+
GenerateThrowUncatchable(masm, TERMINATION);
|
1245
|
+
|
1246
|
+
__ bind(&throw_normal_exception);
|
1247
|
+
GenerateThrowTOS(masm);
|
1248
|
+
}
|
1249
|
+
|
1250
|
+
void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
|
1251
|
+
Label invoke, exit;
|
1252
|
+
|
1253
|
+
// Registers:
|
1254
|
+
// a0: entry address
|
1255
|
+
// a1: function
|
1256
|
+
// a2: reveiver
|
1257
|
+
// a3: argc
|
1258
|
+
//
|
1259
|
+
// Stack:
|
1260
|
+
// 4 args slots
|
1261
|
+
// args
|
1262
|
+
|
1263
|
+
// Save callee saved registers on the stack.
|
1264
|
+
__ MultiPush((kCalleeSaved | ra.bit()) & ~sp.bit());
|
1265
|
+
|
1266
|
+
// We build an EntryFrame.
|
1267
|
+
__ li(t3, Operand(-1)); // Push a bad frame pointer to fail if it is used.
|
1268
|
+
int marker = is_construct ? StackFrame::ENTRY_CONSTRUCT : StackFrame::ENTRY;
|
1269
|
+
__ li(t2, Operand(Smi::FromInt(marker)));
|
1270
|
+
__ li(t1, Operand(Smi::FromInt(marker)));
|
1271
|
+
__ LoadExternalReference(t0, ExternalReference(Top::k_c_entry_fp_address));
|
1272
|
+
__ lw(t0, MemOperand(t0));
|
1273
|
+
__ MultiPush(t0.bit() | t1.bit() | t2.bit() | t3.bit());
|
1274
|
+
|
1275
|
+
// Setup frame pointer for the frame to be pushed.
|
1276
|
+
__ addiu(fp, sp, -EntryFrameConstants::kCallerFPOffset);
|
1277
|
+
|
1278
|
+
// Load argv in s0 register.
|
1279
|
+
__ lw(s0, MemOperand(sp, (kNumCalleeSaved + 1) * kPointerSize +
|
1280
|
+
StandardFrameConstants::kCArgsSlotsSize));
|
1281
|
+
|
1282
|
+
// Registers:
|
1283
|
+
// a0: entry_address
|
1284
|
+
// a1: function
|
1285
|
+
// a2: reveiver_pointer
|
1286
|
+
// a3: argc
|
1287
|
+
// s0: argv
|
1288
|
+
//
|
1289
|
+
// Stack:
|
1290
|
+
// caller fp |
|
1291
|
+
// function slot | entry frame
|
1292
|
+
// context slot |
|
1293
|
+
// bad fp (0xff...f) |
|
1294
|
+
// callee saved registers + ra
|
1295
|
+
// 4 args slots
|
1296
|
+
// args
|
1297
|
+
|
1298
|
+
// Call a faked try-block that does the invoke.
|
1299
|
+
__ bal(&invoke);
|
1300
|
+
__ nop(); // Branch delay slot nop.
|
1301
|
+
|
1302
|
+
// Caught exception: Store result (exception) in the pending
|
1303
|
+
// exception field in the JSEnv and return a failure sentinel.
|
1304
|
+
// Coming in here the fp will be invalid because the PushTryHandler below
|
1305
|
+
// sets it to 0 to signal the existence of the JSEntry frame.
|
1306
|
+
__ LoadExternalReference(t0,
|
1307
|
+
ExternalReference(Top::k_pending_exception_address));
|
1308
|
+
__ sw(v0, MemOperand(t0)); // We come back from 'invoke'. result is in v0.
|
1309
|
+
__ li(v0, Operand(reinterpret_cast<int32_t>(Failure::Exception())));
|
1310
|
+
__ b(&exit);
|
1311
|
+
__ nop(); // Branch delay slot nop.
|
1312
|
+
|
1313
|
+
// Invoke: Link this frame into the handler chain.
|
1314
|
+
__ bind(&invoke);
|
1315
|
+
__ PushTryHandler(IN_JS_ENTRY, JS_ENTRY_HANDLER);
|
1316
|
+
// If an exception not caught by another handler occurs, this handler
|
1317
|
+
// returns control to the code after the bal(&invoke) above, which
|
1318
|
+
// restores all kCalleeSaved registers (including cp and fp) to their
|
1319
|
+
// saved values before returning a failure to C.
|
1320
|
+
|
1321
|
+
// Clear any pending exceptions.
|
1322
|
+
__ LoadExternalReference(t0, ExternalReference::the_hole_value_location());
|
1323
|
+
__ lw(t1, MemOperand(t0));
|
1324
|
+
__ LoadExternalReference(t0,
|
1325
|
+
ExternalReference(Top::k_pending_exception_address));
|
1326
|
+
__ sw(t1, MemOperand(t0));
|
1327
|
+
|
1328
|
+
// Invoke the function by calling through JS entry trampoline builtin.
|
1329
|
+
// Notice that we cannot store a reference to the trampoline code directly in
|
1330
|
+
// this stub, because runtime stubs are not traversed when doing GC.
|
1331
|
+
|
1332
|
+
// Registers:
|
1333
|
+
// a0: entry_address
|
1334
|
+
// a1: function
|
1335
|
+
// a2: reveiver_pointer
|
1336
|
+
// a3: argc
|
1337
|
+
// s0: argv
|
1338
|
+
//
|
1339
|
+
// Stack:
|
1340
|
+
// handler frame
|
1341
|
+
// entry frame
|
1342
|
+
// callee saved registers + ra
|
1343
|
+
// 4 args slots
|
1344
|
+
// args
|
1345
|
+
|
1346
|
+
if (is_construct) {
|
1347
|
+
ExternalReference construct_entry(Builtins::JSConstructEntryTrampoline);
|
1348
|
+
__ LoadExternalReference(t0, construct_entry);
|
1349
|
+
} else {
|
1350
|
+
ExternalReference entry(Builtins::JSEntryTrampoline);
|
1351
|
+
__ LoadExternalReference(t0, entry);
|
1352
|
+
}
|
1353
|
+
__ lw(t9, MemOperand(t0)); // deref address
|
1354
|
+
|
1355
|
+
// Call JSEntryTrampoline.
|
1356
|
+
__ addiu(t9, t9, Code::kHeaderSize - kHeapObjectTag);
|
1357
|
+
__ CallBuiltin(t9);
|
1358
|
+
|
1359
|
+
// Unlink this frame from the handler chain. When reading the
|
1360
|
+
// address of the next handler, there is no need to use the address
|
1361
|
+
// displacement since the current stack pointer (sp) points directly
|
1362
|
+
// to the stack handler.
|
1363
|
+
__ lw(t1, MemOperand(sp, StackHandlerConstants::kNextOffset));
|
1364
|
+
__ LoadExternalReference(t0, ExternalReference(Top::k_handler_address));
|
1365
|
+
__ sw(t1, MemOperand(t0));
|
1366
|
+
|
1367
|
+
// This restores sp to its position before PushTryHandler.
|
1368
|
+
__ addiu(sp, sp, StackHandlerConstants::kSize);
|
1369
|
+
|
1370
|
+
__ bind(&exit); // v0 holds result
|
1371
|
+
// Restore the top frame descriptors from the stack.
|
1372
|
+
__ Pop(t1);
|
1373
|
+
__ LoadExternalReference(t0, ExternalReference(Top::k_c_entry_fp_address));
|
1374
|
+
__ sw(t1, MemOperand(t0));
|
1375
|
+
|
1376
|
+
// Reset the stack to the callee saved registers.
|
1377
|
+
__ addiu(sp, sp, -EntryFrameConstants::kCallerFPOffset);
|
1378
|
+
|
1379
|
+
// Restore callee saved registers from the stack.
|
1380
|
+
__ MultiPop((kCalleeSaved | ra.bit()) & ~sp.bit());
|
1381
|
+
// Return.
|
1382
|
+
__ Jump(ra);
|
1383
|
+
}
|
1384
|
+
|
1385
|
+
|
1386
|
+
// This stub performs an instanceof, calling the builtin function if
|
1387
|
+
// necessary. Uses a1 for the object, a0 for the function that it may
|
1388
|
+
// be an instance of (these are fetched from the stack).
|
1389
|
+
void InstanceofStub::Generate(MacroAssembler* masm) {
|
1390
|
+
UNIMPLEMENTED_MIPS();
|
1391
|
+
__ break_(0x845);
|
1392
|
+
}
|
1393
|
+
|
1394
|
+
|
1395
|
+
void ArgumentsAccessStub::GenerateReadLength(MacroAssembler* masm) {
|
1396
|
+
UNIMPLEMENTED_MIPS();
|
1397
|
+
__ break_(0x851);
|
1398
|
+
}
|
1399
|
+
|
1400
|
+
|
1401
|
+
void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) {
|
1402
|
+
UNIMPLEMENTED_MIPS();
|
1403
|
+
__ break_(0x857);
|
1404
|
+
}
|
1405
|
+
|
1406
|
+
|
1407
|
+
void ArgumentsAccessStub::GenerateNewObject(MacroAssembler* masm) {
|
1408
|
+
UNIMPLEMENTED_MIPS();
|
1409
|
+
__ break_(0x863);
|
1410
|
+
}
|
1411
|
+
|
1412
|
+
|
1413
|
+
const char* CompareStub::GetName() {
|
1414
|
+
UNIMPLEMENTED_MIPS();
|
1415
|
+
return NULL; // UNIMPLEMENTED RETURN
|
1416
|
+
}
|
1417
|
+
|
1418
|
+
|
1419
|
+
int CompareStub::MinorKey() {
|
1420
|
+
// Encode the two parameters in a unique 16 bit value.
|
1421
|
+
ASSERT(static_cast<unsigned>(cc_) >> 28 < (1 << 15));
|
1422
|
+
return (static_cast<unsigned>(cc_) >> 27) | (strict_ ? 1 : 0);
|
1423
|
+
}
|
1424
|
+
|
1425
|
+
|
1426
|
+
#undef __
|
1427
|
+
|
1428
|
+
} } // namespace v8::internal
|