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
@@ -219,7 +219,7 @@ Object* JSObject::GetPropertyWithFailedAccessCheck(
|
|
219
219
|
LookupResult* result,
|
220
220
|
String* name,
|
221
221
|
PropertyAttributes* attributes) {
|
222
|
-
if (result->
|
222
|
+
if (result->IsProperty()) {
|
223
223
|
switch (result->type()) {
|
224
224
|
case CALLBACKS: {
|
225
225
|
// Only allow API accessors.
|
@@ -242,7 +242,7 @@ Object* JSObject::GetPropertyWithFailedAccessCheck(
|
|
242
242
|
// Search ALL_CAN_READ accessors in prototype chain.
|
243
243
|
LookupResult r;
|
244
244
|
result->holder()->LookupRealNamedPropertyInPrototypes(name, &r);
|
245
|
-
if (r.
|
245
|
+
if (r.IsProperty()) {
|
246
246
|
return GetPropertyWithFailedAccessCheck(receiver,
|
247
247
|
&r,
|
248
248
|
name,
|
@@ -255,16 +255,16 @@ Object* JSObject::GetPropertyWithFailedAccessCheck(
|
|
255
255
|
// No access check in GetPropertyAttributeWithInterceptor.
|
256
256
|
LookupResult r;
|
257
257
|
result->holder()->LookupRealNamedProperty(name, &r);
|
258
|
-
if (r.
|
258
|
+
if (r.IsProperty()) {
|
259
259
|
return GetPropertyWithFailedAccessCheck(receiver,
|
260
260
|
&r,
|
261
261
|
name,
|
262
262
|
attributes);
|
263
263
|
}
|
264
|
-
}
|
265
|
-
default: {
|
266
264
|
break;
|
267
265
|
}
|
266
|
+
default:
|
267
|
+
UNREACHABLE();
|
268
268
|
}
|
269
269
|
}
|
270
270
|
|
@@ -280,7 +280,7 @@ PropertyAttributes JSObject::GetPropertyAttributeWithFailedAccessCheck(
|
|
280
280
|
LookupResult* result,
|
281
281
|
String* name,
|
282
282
|
bool continue_search) {
|
283
|
-
if (result->
|
283
|
+
if (result->IsProperty()) {
|
284
284
|
switch (result->type()) {
|
285
285
|
case CALLBACKS: {
|
286
286
|
// Only allow API accessors.
|
@@ -301,7 +301,7 @@ PropertyAttributes JSObject::GetPropertyAttributeWithFailedAccessCheck(
|
|
301
301
|
// Search ALL_CAN_READ accessors in prototype chain.
|
302
302
|
LookupResult r;
|
303
303
|
result->holder()->LookupRealNamedPropertyInPrototypes(name, &r);
|
304
|
-
if (r.
|
304
|
+
if (r.IsProperty()) {
|
305
305
|
return GetPropertyAttributeWithFailedAccessCheck(receiver,
|
306
306
|
&r,
|
307
307
|
name,
|
@@ -319,7 +319,7 @@ PropertyAttributes JSObject::GetPropertyAttributeWithFailedAccessCheck(
|
|
319
319
|
} else {
|
320
320
|
result->holder()->LocalLookupRealNamedProperty(name, &r);
|
321
321
|
}
|
322
|
-
if (r.
|
322
|
+
if (r.IsProperty()) {
|
323
323
|
return GetPropertyAttributeWithFailedAccessCheck(receiver,
|
324
324
|
&r,
|
325
325
|
name,
|
@@ -328,9 +328,8 @@ PropertyAttributes JSObject::GetPropertyAttributeWithFailedAccessCheck(
|
|
328
328
|
break;
|
329
329
|
}
|
330
330
|
|
331
|
-
default:
|
332
|
-
|
333
|
-
}
|
331
|
+
default:
|
332
|
+
UNREACHABLE();
|
334
333
|
}
|
335
334
|
}
|
336
335
|
|
@@ -339,55 +338,6 @@ PropertyAttributes JSObject::GetPropertyAttributeWithFailedAccessCheck(
|
|
339
338
|
}
|
340
339
|
|
341
340
|
|
342
|
-
Object* JSObject::GetLazyProperty(Object* receiver,
|
343
|
-
LookupResult* result,
|
344
|
-
String* name,
|
345
|
-
PropertyAttributes* attributes) {
|
346
|
-
HandleScope scope;
|
347
|
-
Handle<Object> this_handle(this);
|
348
|
-
Handle<Object> receiver_handle(receiver);
|
349
|
-
Handle<String> name_handle(name);
|
350
|
-
bool pending_exception;
|
351
|
-
LoadLazy(Handle<JSObject>(JSObject::cast(result->GetLazyValue())),
|
352
|
-
&pending_exception);
|
353
|
-
if (pending_exception) return Failure::Exception();
|
354
|
-
return this_handle->GetPropertyWithReceiver(*receiver_handle,
|
355
|
-
*name_handle,
|
356
|
-
attributes);
|
357
|
-
}
|
358
|
-
|
359
|
-
|
360
|
-
Object* JSObject::SetLazyProperty(LookupResult* result,
|
361
|
-
String* name,
|
362
|
-
Object* value,
|
363
|
-
PropertyAttributes attributes) {
|
364
|
-
ASSERT(!IsJSGlobalProxy());
|
365
|
-
HandleScope scope;
|
366
|
-
Handle<JSObject> this_handle(this);
|
367
|
-
Handle<String> name_handle(name);
|
368
|
-
Handle<Object> value_handle(value);
|
369
|
-
bool pending_exception;
|
370
|
-
LoadLazy(Handle<JSObject>(JSObject::cast(result->GetLazyValue())),
|
371
|
-
&pending_exception);
|
372
|
-
if (pending_exception) return Failure::Exception();
|
373
|
-
return this_handle->SetProperty(*name_handle, *value_handle, attributes);
|
374
|
-
}
|
375
|
-
|
376
|
-
|
377
|
-
Object* JSObject::DeleteLazyProperty(LookupResult* result,
|
378
|
-
String* name,
|
379
|
-
DeleteMode mode) {
|
380
|
-
HandleScope scope;
|
381
|
-
Handle<JSObject> this_handle(this);
|
382
|
-
Handle<String> name_handle(name);
|
383
|
-
bool pending_exception;
|
384
|
-
LoadLazy(Handle<JSObject>(JSObject::cast(result->GetLazyValue())),
|
385
|
-
&pending_exception);
|
386
|
-
if (pending_exception) return Failure::Exception();
|
387
|
-
return this_handle->DeleteProperty(*name_handle, mode);
|
388
|
-
}
|
389
|
-
|
390
|
-
|
391
341
|
Object* JSObject::GetNormalizedProperty(LookupResult* result) {
|
392
342
|
ASSERT(!HasFastProperties());
|
393
343
|
Object* value = property_dictionary()->ValueAt(result->GetDictionaryEntry());
|
@@ -481,7 +431,7 @@ bool JSObject::IsDirty() {
|
|
481
431
|
if (!cons_obj->IsJSFunction())
|
482
432
|
return true;
|
483
433
|
JSFunction* fun = JSFunction::cast(cons_obj);
|
484
|
-
if (!fun->shared()->
|
434
|
+
if (!fun->shared()->IsApiFunction())
|
485
435
|
return true;
|
486
436
|
// If the object is fully fast case and has the same map it was
|
487
437
|
// created with then no changes can have been made to it.
|
@@ -505,7 +455,7 @@ Object* Object::GetProperty(Object* receiver,
|
|
505
455
|
// holder will always be the interceptor holder and the search may
|
506
456
|
// only continue with a current object just after the interceptor
|
507
457
|
// holder in the prototype chain.
|
508
|
-
Object* last = result->
|
458
|
+
Object* last = result->IsProperty() ? result->holder() : Heap::null_value();
|
509
459
|
for (Object* current = this; true; current = current->GetPrototype()) {
|
510
460
|
if (current->IsAccessCheckNeeded()) {
|
511
461
|
// Check if we're allowed to read from the current object. Note
|
@@ -531,12 +481,6 @@ Object* Object::GetProperty(Object* receiver,
|
|
531
481
|
return Heap::undefined_value();
|
532
482
|
}
|
533
483
|
*attributes = result->GetAttributes();
|
534
|
-
if (!result->IsLoaded()) {
|
535
|
-
return JSObject::cast(this)->GetLazyProperty(receiver,
|
536
|
-
result,
|
537
|
-
name,
|
538
|
-
attributes);
|
539
|
-
}
|
540
484
|
Object* value;
|
541
485
|
JSObject* holder = result->holder();
|
542
486
|
switch (result->type()) {
|
@@ -674,7 +618,7 @@ static bool AnWord(String* str) {
|
|
674
618
|
}
|
675
619
|
|
676
620
|
|
677
|
-
Object* String::
|
621
|
+
Object* String::SlowTryFlatten(PretenureFlag pretenure) {
|
678
622
|
#ifdef DEBUG
|
679
623
|
// Do not attempt to flatten in debug mode when allocation is not
|
680
624
|
// allowed. This is to avoid an assertion failure when allocating.
|
@@ -692,7 +636,7 @@ Object* String::TryFlatten() {
|
|
692
636
|
// There's little point in putting the flat string in new space if the
|
693
637
|
// cons string is in old space. It can never get GCed until there is
|
694
638
|
// an old space GC.
|
695
|
-
PretenureFlag tenure = Heap::InNewSpace(this) ?
|
639
|
+
PretenureFlag tenure = Heap::InNewSpace(this) ? pretenure : TENURED;
|
696
640
|
int len = length();
|
697
641
|
Object* object;
|
698
642
|
String* result;
|
@@ -1245,8 +1189,7 @@ String* JSObject::class_name() {
|
|
1245
1189
|
|
1246
1190
|
String* JSObject::constructor_name() {
|
1247
1191
|
if (IsJSFunction()) {
|
1248
|
-
return
|
1249
|
-
Heap::function_class_symbol() : Heap::closure_symbol();
|
1192
|
+
return Heap::closure_symbol();
|
1250
1193
|
}
|
1251
1194
|
if (map()->constructor()->IsJSFunction()) {
|
1252
1195
|
JSFunction* constructor = JSFunction::cast(map()->constructor());
|
@@ -1463,8 +1406,12 @@ Object* JSObject::SetPropertyPostInterceptor(String* name,
|
|
1463
1406
|
// Check local property, ignore interceptor.
|
1464
1407
|
LookupResult result;
|
1465
1408
|
LocalLookupRealNamedProperty(name, &result);
|
1466
|
-
if (result.
|
1467
|
-
|
1409
|
+
if (result.IsFound()) {
|
1410
|
+
// An existing property, a map transition or a null descriptor was
|
1411
|
+
// found. Use set property to handle all these cases.
|
1412
|
+
return SetProperty(&result, name, value, attributes);
|
1413
|
+
}
|
1414
|
+
// Add a new real property.
|
1468
1415
|
return AddProperty(name, value, attributes);
|
1469
1416
|
}
|
1470
1417
|
|
@@ -1696,8 +1643,8 @@ void JSObject::LookupCallbackSetterInPrototypes(String* name,
|
|
1696
1643
|
pt != Heap::null_value();
|
1697
1644
|
pt = pt->GetPrototype()) {
|
1698
1645
|
JSObject::cast(pt)->LocalLookupRealNamedProperty(name, result);
|
1699
|
-
if (result->
|
1700
|
-
if (
|
1646
|
+
if (result->IsProperty()) {
|
1647
|
+
if (result->IsReadOnly()) {
|
1701
1648
|
result->NotFound();
|
1702
1649
|
return;
|
1703
1650
|
}
|
@@ -1758,7 +1705,11 @@ void JSObject::LocalLookupRealNamedProperty(String* name,
|
|
1758
1705
|
|
1759
1706
|
if (HasFastProperties()) {
|
1760
1707
|
LookupInDescriptor(name, result);
|
1761
|
-
if (result->
|
1708
|
+
if (result->IsFound()) {
|
1709
|
+
// A property, a map transition or a null descriptor was found.
|
1710
|
+
// We return all of these result types because
|
1711
|
+
// LocalLookupRealNamedProperty is used when setting properties
|
1712
|
+
// where map transitions and null descriptors are handled.
|
1762
1713
|
ASSERT(result->holder() == this && result->type() != NORMAL);
|
1763
1714
|
// Disallow caching for uninitialized constants. These can only
|
1764
1715
|
// occur as fields.
|
@@ -1779,7 +1730,6 @@ void JSObject::LocalLookupRealNamedProperty(String* name,
|
|
1779
1730
|
return;
|
1780
1731
|
}
|
1781
1732
|
value = JSGlobalPropertyCell::cast(value)->value();
|
1782
|
-
ASSERT(result->IsLoaded());
|
1783
1733
|
}
|
1784
1734
|
// Make sure to disallow caching for uninitialized constants
|
1785
1735
|
// found in the dictionary-mode objects.
|
@@ -1808,16 +1758,7 @@ void JSObject::LookupRealNamedPropertyInPrototypes(String* name,
|
|
1808
1758
|
pt != Heap::null_value();
|
1809
1759
|
pt = JSObject::cast(pt)->GetPrototype()) {
|
1810
1760
|
JSObject::cast(pt)->LocalLookupRealNamedProperty(name, result);
|
1811
|
-
if (result->
|
1812
|
-
switch (result->type()) {
|
1813
|
-
case NORMAL:
|
1814
|
-
case FIELD:
|
1815
|
-
case CONSTANT_FUNCTION:
|
1816
|
-
case CALLBACKS:
|
1817
|
-
return;
|
1818
|
-
default: break;
|
1819
|
-
}
|
1820
|
-
}
|
1761
|
+
if (result->IsProperty() && (result->type() != INTERCEPTOR)) return;
|
1821
1762
|
}
|
1822
1763
|
result->NotFound();
|
1823
1764
|
}
|
@@ -1903,19 +1844,17 @@ Object* JSObject::SetProperty(LookupResult* result,
|
|
1903
1844
|
// accessor that wants to handle the property.
|
1904
1845
|
LookupResult accessor_result;
|
1905
1846
|
LookupCallbackSetterInPrototypes(name, &accessor_result);
|
1906
|
-
if (accessor_result.
|
1847
|
+
if (accessor_result.IsProperty()) {
|
1907
1848
|
return SetPropertyWithCallback(accessor_result.GetCallbackObject(),
|
1908
1849
|
name,
|
1909
1850
|
value,
|
1910
1851
|
accessor_result.holder());
|
1911
1852
|
}
|
1912
1853
|
}
|
1913
|
-
if (result->
|
1854
|
+
if (!result->IsFound()) {
|
1855
|
+
// Neither properties nor transitions found.
|
1914
1856
|
return AddProperty(name, value, attributes);
|
1915
1857
|
}
|
1916
|
-
if (!result->IsLoaded()) {
|
1917
|
-
return SetLazyProperty(result, name, value, attributes);
|
1918
|
-
}
|
1919
1858
|
if (result->IsReadOnly() && result->IsProperty()) return value;
|
1920
1859
|
// This is a real property that is not read-only, or it is a
|
1921
1860
|
// transition or null descriptor and there are no setters in the prototypes.
|
@@ -1972,15 +1911,12 @@ Object* JSObject::IgnoreAttributesAndSetLocalProperty(
|
|
1972
1911
|
// Make sure that the top context does not change when doing callbacks or
|
1973
1912
|
// interceptor calls.
|
1974
1913
|
AssertNoContextChange ncc;
|
1975
|
-
|
1976
|
-
|
1977
|
-
LocalLookup(name, &result_struct);
|
1978
|
-
LookupResult* result = &result_struct;
|
1979
|
-
// END ADDED TO CLONE
|
1914
|
+
LookupResult result;
|
1915
|
+
LocalLookup(name, &result);
|
1980
1916
|
// Check access rights if needed.
|
1981
1917
|
if (IsAccessCheckNeeded()
|
1982
|
-
|
1983
|
-
return SetPropertyWithFailedAccessCheck(result, name, value);
|
1918
|
+
&& !Top::MayNamedAccess(this, name, v8::ACCESS_SET)) {
|
1919
|
+
return SetPropertyWithFailedAccessCheck(&result, name, value);
|
1984
1920
|
}
|
1985
1921
|
|
1986
1922
|
if (IsJSGlobalProxy()) {
|
@@ -1994,31 +1930,32 @@ Object* JSObject::IgnoreAttributesAndSetLocalProperty(
|
|
1994
1930
|
}
|
1995
1931
|
|
1996
1932
|
// Check for accessor in prototype chain removed here in clone.
|
1997
|
-
if (result
|
1933
|
+
if (!result.IsFound()) {
|
1934
|
+
// Neither properties nor transitions found.
|
1998
1935
|
return AddProperty(name, value, attributes);
|
1999
1936
|
}
|
2000
|
-
|
2001
|
-
|
2002
|
-
|
1937
|
+
|
1938
|
+
PropertyDetails details = PropertyDetails(attributes, NORMAL);
|
1939
|
+
|
2003
1940
|
// Check of IsReadOnly removed from here in clone.
|
2004
|
-
switch (result
|
1941
|
+
switch (result.type()) {
|
2005
1942
|
case NORMAL:
|
2006
|
-
return SetNormalizedProperty(
|
1943
|
+
return SetNormalizedProperty(name, value, details);
|
2007
1944
|
case FIELD:
|
2008
|
-
return FastPropertyAtPut(result
|
1945
|
+
return FastPropertyAtPut(result.GetFieldIndex(), value);
|
2009
1946
|
case MAP_TRANSITION:
|
2010
|
-
if (attributes == result
|
1947
|
+
if (attributes == result.GetAttributes()) {
|
2011
1948
|
// Only use map transition if the attributes match.
|
2012
|
-
return AddFastPropertyUsingMap(result
|
1949
|
+
return AddFastPropertyUsingMap(result.GetTransitionMap(),
|
2013
1950
|
name,
|
2014
1951
|
value);
|
2015
1952
|
}
|
2016
1953
|
return ConvertDescriptorToField(name, value, attributes);
|
2017
1954
|
case CONSTANT_FUNCTION:
|
2018
1955
|
// Only replace the function if necessary.
|
2019
|
-
if (value == result
|
1956
|
+
if (value == result.GetConstantFunction()) return value;
|
2020
1957
|
// Preserve the attributes of this existing property.
|
2021
|
-
attributes = result
|
1958
|
+
attributes = result.GetAttributes();
|
2022
1959
|
return ConvertDescriptorToField(name, value, attributes);
|
2023
1960
|
case CALLBACKS:
|
2024
1961
|
case INTERCEPTOR:
|
@@ -2134,7 +2071,7 @@ PropertyAttributes JSObject::GetPropertyAttribute(JSObject* receiver,
|
|
2134
2071
|
name,
|
2135
2072
|
continue_search);
|
2136
2073
|
}
|
2137
|
-
if (result->
|
2074
|
+
if (result->IsProperty()) {
|
2138
2075
|
switch (result->type()) {
|
2139
2076
|
case NORMAL: // fall through
|
2140
2077
|
case FIELD:
|
@@ -2144,13 +2081,8 @@ PropertyAttributes JSObject::GetPropertyAttribute(JSObject* receiver,
|
|
2144
2081
|
case INTERCEPTOR:
|
2145
2082
|
return result->holder()->
|
2146
2083
|
GetPropertyAttributeWithInterceptor(receiver, name, continue_search);
|
2147
|
-
case MAP_TRANSITION:
|
2148
|
-
case CONSTANT_TRANSITION:
|
2149
|
-
case NULL_DESCRIPTOR:
|
2150
|
-
return ABSENT;
|
2151
2084
|
default:
|
2152
2085
|
UNREACHABLE();
|
2153
|
-
break;
|
2154
2086
|
}
|
2155
2087
|
}
|
2156
2088
|
return ABSENT;
|
@@ -2186,7 +2118,7 @@ Object* JSObject::NormalizeProperties(PropertyNormalizationMode mode,
|
|
2186
2118
|
property_count += 2; // Make space for two more properties.
|
2187
2119
|
}
|
2188
2120
|
Object* obj =
|
2189
|
-
StringDictionary::Allocate(property_count
|
2121
|
+
StringDictionary::Allocate(property_count);
|
2190
2122
|
if (obj->IsFailure()) return obj;
|
2191
2123
|
StringDictionary* dictionary = StringDictionary::cast(obj);
|
2192
2124
|
|
@@ -2323,7 +2255,7 @@ Object* JSObject::DeletePropertyPostInterceptor(String* name, DeleteMode mode) {
|
|
2323
2255
|
// Check local property, ignore interceptor.
|
2324
2256
|
LookupResult result;
|
2325
2257
|
LocalLookupRealNamedProperty(name, &result);
|
2326
|
-
if (!result.
|
2258
|
+
if (!result.IsProperty()) return Heap::true_value();
|
2327
2259
|
|
2328
2260
|
// Normalize object if needed.
|
2329
2261
|
Object* obj = NormalizeProperties(CLEAR_INOBJECT_PROPERTIES, 0);
|
@@ -2507,7 +2439,7 @@ Object* JSObject::DeleteProperty(String* name, DeleteMode mode) {
|
|
2507
2439
|
} else {
|
2508
2440
|
LookupResult result;
|
2509
2441
|
LocalLookup(name, &result);
|
2510
|
-
if (!result.
|
2442
|
+
if (!result.IsProperty()) return Heap::true_value();
|
2511
2443
|
// Ignore attributes if forcing a deletion.
|
2512
2444
|
if (result.IsDontDelete() && mode != FORCE_DELETION) {
|
2513
2445
|
return Heap::false_value();
|
@@ -2520,11 +2452,6 @@ Object* JSObject::DeleteProperty(String* name, DeleteMode mode) {
|
|
2520
2452
|
}
|
2521
2453
|
return DeletePropertyWithInterceptor(name);
|
2522
2454
|
}
|
2523
|
-
if (!result.IsLoaded()) {
|
2524
|
-
return JSObject::cast(this)->DeleteLazyProperty(&result,
|
2525
|
-
name,
|
2526
|
-
mode);
|
2527
|
-
}
|
2528
2455
|
// Normalize object if needed.
|
2529
2456
|
Object* obj = NormalizeProperties(CLEAR_INOBJECT_PROPERTIES, 0);
|
2530
2457
|
if (obj->IsFailure()) return obj;
|
@@ -2591,9 +2518,8 @@ bool JSObject::ReferencesObject(Object* obj) {
|
|
2591
2518
|
break;
|
2592
2519
|
}
|
2593
2520
|
|
2594
|
-
// For functions check the context.
|
2595
|
-
|
2596
|
-
if (IsJSFunction() && !JSFunction::cast(this)->IsBoilerplate()) {
|
2521
|
+
// For functions check the context.
|
2522
|
+
if (IsJSFunction()) {
|
2597
2523
|
// Get the constructor function for arguments array.
|
2598
2524
|
JSObject* arguments_boilerplate =
|
2599
2525
|
Top::context()->global_context()->arguments_boilerplate();
|
@@ -2742,7 +2668,7 @@ void JSObject::Lookup(String* name, LookupResult* result) {
|
|
2742
2668
|
current != Heap::null_value();
|
2743
2669
|
current = JSObject::cast(current)->GetPrototype()) {
|
2744
2670
|
JSObject::cast(current)->LocalLookup(name, result);
|
2745
|
-
if (result->
|
2671
|
+
if (result->IsProperty()) return;
|
2746
2672
|
}
|
2747
2673
|
result->NotFound();
|
2748
2674
|
}
|
@@ -2754,7 +2680,7 @@ void JSObject::LookupCallback(String* name, LookupResult* result) {
|
|
2754
2680
|
current != Heap::null_value();
|
2755
2681
|
current = JSObject::cast(current)->GetPrototype()) {
|
2756
2682
|
JSObject::cast(current)->LocalLookupRealNamedProperty(name, result);
|
2757
|
-
if (result->
|
2683
|
+
if (result->IsProperty() && result->type() == CALLBACKS) return;
|
2758
2684
|
}
|
2759
2685
|
result->NotFound();
|
2760
2686
|
}
|
@@ -2774,7 +2700,7 @@ Object* JSObject::DefineGetterSetter(String* name,
|
|
2774
2700
|
}
|
2775
2701
|
|
2776
2702
|
// Try to flatten before operating on the string.
|
2777
|
-
name->
|
2703
|
+
name->TryFlatten();
|
2778
2704
|
|
2779
2705
|
// Check if there is an API defined callback object which prohibits
|
2780
2706
|
// callback overwriting in this object or it's prototype chain.
|
@@ -2784,7 +2710,7 @@ Object* JSObject::DefineGetterSetter(String* name,
|
|
2784
2710
|
// cause security problems.
|
2785
2711
|
LookupResult callback_result;
|
2786
2712
|
LookupCallback(name, &callback_result);
|
2787
|
-
if (callback_result.
|
2713
|
+
if (callback_result.IsFound()) {
|
2788
2714
|
Object* obj = callback_result.GetCallbackObject();
|
2789
2715
|
if (obj->IsAccessorInfo() &&
|
2790
2716
|
AccessorInfo::cast(obj)->prohibits_overwriting()) {
|
@@ -2835,11 +2761,20 @@ Object* JSObject::DefineGetterSetter(String* name,
|
|
2835
2761
|
// Lookup the name.
|
2836
2762
|
LookupResult result;
|
2837
2763
|
LocalLookup(name, &result);
|
2838
|
-
if (result.
|
2764
|
+
if (result.IsProperty()) {
|
2839
2765
|
if (result.IsReadOnly()) return Heap::undefined_value();
|
2840
2766
|
if (result.type() == CALLBACKS) {
|
2841
2767
|
Object* obj = result.GetCallbackObject();
|
2842
|
-
if (obj->IsFixedArray())
|
2768
|
+
if (obj->IsFixedArray()) {
|
2769
|
+
// The object might be in fast mode even though it has
|
2770
|
+
// a getter/setter.
|
2771
|
+
Object* ok = NormalizeProperties(CLEAR_INOBJECT_PROPERTIES, 0);
|
2772
|
+
if (ok->IsFailure()) return ok;
|
2773
|
+
|
2774
|
+
PropertyDetails details = PropertyDetails(attributes, CALLBACKS);
|
2775
|
+
SetNormalizedProperty(name, obj, details);
|
2776
|
+
return obj;
|
2777
|
+
}
|
2843
2778
|
}
|
2844
2779
|
}
|
2845
2780
|
}
|
@@ -2948,7 +2883,7 @@ Object* JSObject::LookupAccessor(String* name, bool is_getter) {
|
|
2948
2883
|
obj = JSObject::cast(obj)->GetPrototype()) {
|
2949
2884
|
LookupResult result;
|
2950
2885
|
JSObject::cast(obj)->LocalLookup(name, &result);
|
2951
|
-
if (result.
|
2886
|
+
if (result.IsProperty()) {
|
2952
2887
|
if (result.IsReadOnly()) return Heap::undefined_value();
|
2953
2888
|
if (result.type() == CALLBACKS) {
|
2954
2889
|
Object* obj = result.GetCallbackObject();
|
@@ -3030,19 +2965,79 @@ Object* Map::CopyDropTransitions() {
|
|
3030
2965
|
|
3031
2966
|
|
3032
2967
|
Object* Map::UpdateCodeCache(String* name, Code* code) {
|
2968
|
+
// Allocate the code cache if not present.
|
2969
|
+
if (code_cache()->IsFixedArray()) {
|
2970
|
+
Object* result = Heap::AllocateCodeCache();
|
2971
|
+
if (result->IsFailure()) return result;
|
2972
|
+
set_code_cache(result);
|
2973
|
+
}
|
2974
|
+
|
2975
|
+
// Update the code cache.
|
2976
|
+
return CodeCache::cast(code_cache())->Update(name, code);
|
2977
|
+
}
|
2978
|
+
|
2979
|
+
|
2980
|
+
Object* Map::FindInCodeCache(String* name, Code::Flags flags) {
|
2981
|
+
// Do a lookup if a code cache exists.
|
2982
|
+
if (!code_cache()->IsFixedArray()) {
|
2983
|
+
return CodeCache::cast(code_cache())->Lookup(name, flags);
|
2984
|
+
} else {
|
2985
|
+
return Heap::undefined_value();
|
2986
|
+
}
|
2987
|
+
}
|
2988
|
+
|
2989
|
+
|
2990
|
+
int Map::IndexInCodeCache(Object* name, Code* code) {
|
2991
|
+
// Get the internal index if a code cache exists.
|
2992
|
+
if (!code_cache()->IsFixedArray()) {
|
2993
|
+
return CodeCache::cast(code_cache())->GetIndex(name, code);
|
2994
|
+
}
|
2995
|
+
return -1;
|
2996
|
+
}
|
2997
|
+
|
2998
|
+
|
2999
|
+
void Map::RemoveFromCodeCache(String* name, Code* code, int index) {
|
3000
|
+
// No GC is supposed to happen between a call to IndexInCodeCache and
|
3001
|
+
// RemoveFromCodeCache so the code cache must be there.
|
3002
|
+
ASSERT(!code_cache()->IsFixedArray());
|
3003
|
+
CodeCache::cast(code_cache())->RemoveByIndex(name, code, index);
|
3004
|
+
}
|
3005
|
+
|
3006
|
+
|
3007
|
+
Object* CodeCache::Update(String* name, Code* code) {
|
3033
3008
|
ASSERT(code->ic_state() == MONOMORPHIC);
|
3034
|
-
FixedArray* cache = code_cache();
|
3035
3009
|
|
3036
|
-
//
|
3010
|
+
// The number of monomorphic stubs for normal load/store/call IC's can grow to
|
3011
|
+
// a large number and therefore they need to go into a hash table. They are
|
3012
|
+
// used to load global properties from cells.
|
3013
|
+
if (code->type() == NORMAL) {
|
3014
|
+
// Make sure that a hash table is allocated for the normal load code cache.
|
3015
|
+
if (normal_type_cache()->IsUndefined()) {
|
3016
|
+
Object* result =
|
3017
|
+
CodeCacheHashTable::Allocate(CodeCacheHashTable::kInitialSize);
|
3018
|
+
if (result->IsFailure()) return result;
|
3019
|
+
set_normal_type_cache(result);
|
3020
|
+
}
|
3021
|
+
return UpdateNormalTypeCache(name, code);
|
3022
|
+
} else {
|
3023
|
+
ASSERT(default_cache()->IsFixedArray());
|
3024
|
+
return UpdateDefaultCache(name, code);
|
3025
|
+
}
|
3026
|
+
}
|
3027
|
+
|
3028
|
+
|
3029
|
+
Object* CodeCache::UpdateDefaultCache(String* name, Code* code) {
|
3030
|
+
// When updating the default code cache we disregard the type encoded in the
|
3037
3031
|
// flags. This allows call constant stubs to overwrite call field
|
3038
3032
|
// stubs, etc.
|
3039
3033
|
Code::Flags flags = Code::RemoveTypeFromFlags(code->flags());
|
3040
3034
|
|
3041
3035
|
// First check whether we can update existing code cache without
|
3042
3036
|
// extending it.
|
3037
|
+
FixedArray* cache = default_cache();
|
3043
3038
|
int length = cache->length();
|
3044
3039
|
int deleted_index = -1;
|
3045
|
-
for (int i = 0; i < length; i +=
|
3040
|
+
for (int i = 0; i < length; i += kCodeCacheEntrySize) {
|
3046
3041
|
Object* key = cache->get(i);
|
3047
3042
|
if (key->IsNull()) {
|
3048
3043
|
if (deleted_index < 0) deleted_index = i;
|
@@ -3050,14 +3045,15 @@ Object* Map::UpdateCodeCache(String* name, Code* code) {
|
|
3050
3045
|
}
|
3051
3046
|
if (key->IsUndefined()) {
|
3052
3047
|
if (deleted_index >= 0) i = deleted_index;
|
3053
|
-
cache->set(i +
|
3054
|
-
cache->set(i +
|
3048
|
+
cache->set(i + kCodeCacheEntryNameOffset, name);
|
3049
|
+
cache->set(i + kCodeCacheEntryCodeOffset, code);
|
3055
3050
|
return this;
|
3056
3051
|
}
|
3057
3052
|
if (name->Equals(String::cast(key))) {
|
3058
|
-
Code::Flags found =
|
3053
|
+
Code::Flags found =
|
3054
|
+
Code::cast(cache->get(i + kCodeCacheEntryCodeOffset))->flags();
|
3059
3055
|
if (Code::RemoveTypeFromFlags(found) == flags) {
|
3060
|
-
cache->set(i +
|
3056
|
+
cache->set(i + kCodeCacheEntryCodeOffset, code);
|
3061
3057
|
return this;
|
3062
3058
|
}
|
3063
3059
|
}
|
@@ -3066,61 +3062,206 @@ Object* Map::UpdateCodeCache(String* name, Code* code) {
|
|
3066
3062
|
// Reached the end of the code cache. If there were deleted
|
3067
3063
|
// elements, reuse the space for the first of them.
|
3068
3064
|
if (deleted_index >= 0) {
|
3069
|
-
cache->set(deleted_index +
|
3070
|
-
cache->set(deleted_index +
|
3065
|
+
cache->set(deleted_index + kCodeCacheEntryNameOffset, name);
|
3066
|
+
cache->set(deleted_index + kCodeCacheEntryCodeOffset, code);
|
3071
3067
|
return this;
|
3072
3068
|
}
|
3073
3069
|
|
3074
|
-
// Extend the code cache with some new entries (at least one).
|
3075
|
-
|
3076
|
-
|
3070
|
+
// Extend the code cache with some new entries (at least one). Must be a
|
3071
|
+
// multiple of the entry size.
|
3072
|
+
int new_length = length + ((length >> 1)) + kCodeCacheEntrySize;
|
3073
|
+
new_length = new_length - new_length % kCodeCacheEntrySize;
|
3074
|
+
ASSERT((new_length % kCodeCacheEntrySize) == 0);
|
3077
3075
|
Object* result = cache->CopySize(new_length);
|
3078
3076
|
if (result->IsFailure()) return result;
|
3079
3077
|
|
3080
3078
|
// Add the (name, code) pair to the new cache.
|
3081
3079
|
cache = FixedArray::cast(result);
|
3082
|
-
cache->set(length +
|
3083
|
-
cache->set(length +
|
3084
|
-
|
3080
|
+
cache->set(length + kCodeCacheEntryNameOffset, name);
|
3081
|
+
cache->set(length + kCodeCacheEntryCodeOffset, code);
|
3082
|
+
set_default_cache(cache);
|
3085
3083
|
return this;
|
3086
3084
|
}
|
3087
3085
|
|
3088
3086
|
|
3089
|
-
Object*
|
3090
|
-
|
3087
|
+
Object* CodeCache::UpdateNormalTypeCache(String* name, Code* code) {
|
3088
|
+
// Adding a new entry can cause a new cache to be allocated.
|
3089
|
+
CodeCacheHashTable* cache = CodeCacheHashTable::cast(normal_type_cache());
|
3090
|
+
Object* new_cache = cache->Put(name, code);
|
3091
|
+
if (new_cache->IsFailure()) return new_cache;
|
3092
|
+
set_normal_type_cache(new_cache);
|
3093
|
+
return this;
|
3094
|
+
}
|
3095
|
+
|
3096
|
+
|
3097
|
+
Object* CodeCache::Lookup(String* name, Code::Flags flags) {
|
3098
|
+
if (Code::ExtractTypeFromFlags(flags) == NORMAL) {
|
3099
|
+
return LookupNormalTypeCache(name, flags);
|
3100
|
+
} else {
|
3101
|
+
return LookupDefaultCache(name, flags);
|
3102
|
+
}
|
3103
|
+
}
|
3104
|
+
|
3105
|
+
|
3106
|
+
Object* CodeCache::LookupDefaultCache(String* name, Code::Flags flags) {
|
3107
|
+
FixedArray* cache = default_cache();
|
3091
3108
|
int length = cache->length();
|
3092
|
-
for (int i = 0; i < length; i +=
|
3093
|
-
Object* key = cache->get(i);
|
3109
|
+
for (int i = 0; i < length; i += kCodeCacheEntrySize) {
|
3110
|
+
Object* key = cache->get(i + kCodeCacheEntryNameOffset);
|
3094
3111
|
// Skip deleted elements.
|
3095
3112
|
if (key->IsNull()) continue;
|
3096
3113
|
if (key->IsUndefined()) return key;
|
3097
3114
|
if (name->Equals(String::cast(key))) {
|
3098
|
-
Code* code = Code::cast(cache->get(i +
|
3099
|
-
if (code->flags() == flags)
|
3115
|
+
Code* code = Code::cast(cache->get(i + kCodeCacheEntryCodeOffset));
|
3116
|
+
if (code->flags() == flags) {
|
3117
|
+
return code;
|
3118
|
+
}
|
3100
3119
|
}
|
3101
3120
|
}
|
3102
3121
|
return Heap::undefined_value();
|
3103
3122
|
}
|
3104
3123
|
|
3105
3124
|
|
3106
|
-
|
3107
|
-
|
3125
|
+
Object* CodeCache::LookupNormalTypeCache(String* name, Code::Flags flags) {
|
3126
|
+
if (!normal_type_cache()->IsUndefined()) {
|
3127
|
+
CodeCacheHashTable* cache = CodeCacheHashTable::cast(normal_type_cache());
|
3128
|
+
return cache->Lookup(name, flags);
|
3129
|
+
} else {
|
3130
|
+
return Heap::undefined_value();
|
3131
|
+
}
|
3132
|
+
}
|
3133
|
+
|
3134
|
+
|
3135
|
+
int CodeCache::GetIndex(Object* name, Code* code) {
|
3136
|
+
if (code->type() == NORMAL) {
|
3137
|
+
if (normal_type_cache()->IsUndefined()) return -1;
|
3138
|
+
CodeCacheHashTable* cache = CodeCacheHashTable::cast(normal_type_cache());
|
3139
|
+
return cache->GetIndex(String::cast(name), code->flags());
|
3140
|
+
}
|
3141
|
+
|
3142
|
+
FixedArray* array = default_cache();
|
3108
3143
|
int len = array->length();
|
3109
|
-
for (int i = 0; i < len; i +=
|
3110
|
-
if (array->get(i +
|
3144
|
+
for (int i = 0; i < len; i += kCodeCacheEntrySize) {
|
3145
|
+
if (array->get(i + kCodeCacheEntryCodeOffset) == code) return i + 1;
|
3111
3146
|
}
|
3112
3147
|
return -1;
|
3113
3148
|
}
|
3114
3149
|
|
3115
3150
|
|
3116
|
-
void
|
3117
|
-
|
3118
|
-
|
3119
|
-
|
3120
|
-
|
3121
|
-
|
3122
|
-
|
3123
|
-
|
3151
|
+
void CodeCache::RemoveByIndex(Object* name, Code* code, int index) {
|
3152
|
+
if (code->type() == NORMAL) {
|
3153
|
+
ASSERT(!normal_type_cache()->IsUndefined());
|
3154
|
+
CodeCacheHashTable* cache = CodeCacheHashTable::cast(normal_type_cache());
|
3155
|
+
ASSERT(cache->GetIndex(String::cast(name), code->flags()) == index);
|
3156
|
+
cache->RemoveByIndex(index);
|
3157
|
+
} else {
|
3158
|
+
FixedArray* array = default_cache();
|
3159
|
+
ASSERT(array->length() >= index && array->get(index)->IsCode());
|
3160
|
+
// Use null instead of undefined for deleted elements to distinguish
|
3161
|
+
// deleted elements from unused elements. This distinction is used
|
3162
|
+
// when looking up in the cache and when updating the cache.
|
3163
|
+
ASSERT_EQ(1, kCodeCacheEntryCodeOffset - kCodeCacheEntryNameOffset);
|
3164
|
+
array->set_null(index - 1); // Name.
|
3165
|
+
array->set_null(index); // Code.
|
3166
|
+
}
|
3167
|
+
}
|
3168
|
+
|
3169
|
+
|
3170
|
+
// The key in the code cache hash table consists of the property name and the
|
3171
|
+
// code object. The actual match is on the name and the code flags. If a key
|
3172
|
+
// is created using the flags and not a code object it can only be used for
|
3173
|
+
// lookup not to create a new entry.
|
3174
|
+
class CodeCacheHashTableKey : public HashTableKey {
|
3175
|
+
public:
|
3176
|
+
CodeCacheHashTableKey(String* name, Code::Flags flags)
|
3177
|
+
: name_(name), flags_(flags), code_(NULL) { }
|
3178
|
+
|
3179
|
+
CodeCacheHashTableKey(String* name, Code* code)
|
3180
|
+
: name_(name),
|
3181
|
+
flags_(code->flags()),
|
3182
|
+
code_(code) { }
|
3183
|
+
|
3184
|
+
|
3185
|
+
bool IsMatch(Object* other) {
|
3186
|
+
if (!other->IsFixedArray()) return false;
|
3187
|
+
FixedArray* pair = FixedArray::cast(other);
|
3188
|
+
String* name = String::cast(pair->get(0));
|
3189
|
+
Code::Flags flags = Code::cast(pair->get(1))->flags();
|
3190
|
+
if (flags != flags_) {
|
3191
|
+
return false;
|
3192
|
+
}
|
3193
|
+
return name_->Equals(name);
|
3194
|
+
}
|
3195
|
+
|
3196
|
+
static uint32_t NameFlagsHashHelper(String* name, Code::Flags flags) {
|
3197
|
+
return name->Hash() ^ flags;
|
3198
|
+
}
|
3199
|
+
|
3200
|
+
uint32_t Hash() { return NameFlagsHashHelper(name_, flags_); }
|
3201
|
+
|
3202
|
+
uint32_t HashForObject(Object* obj) {
|
3203
|
+
FixedArray* pair = FixedArray::cast(obj);
|
3204
|
+
String* name = String::cast(pair->get(0));
|
3205
|
+
Code* code = Code::cast(pair->get(1));
|
3206
|
+
return NameFlagsHashHelper(name, code->flags());
|
3207
|
+
}
|
3208
|
+
|
3209
|
+
Object* AsObject() {
|
3210
|
+
ASSERT(code_ != NULL);
|
3211
|
+
Object* obj = Heap::AllocateFixedArray(2);
|
3212
|
+
if (obj->IsFailure()) return obj;
|
3213
|
+
FixedArray* pair = FixedArray::cast(obj);
|
3214
|
+
pair->set(0, name_);
|
3215
|
+
pair->set(1, code_);
|
3216
|
+
return pair;
|
3217
|
+
}
|
3218
|
+
|
3219
|
+
private:
|
3220
|
+
String* name_;
|
3221
|
+
Code::Flags flags_;
|
3222
|
+
Code* code_;
|
3223
|
+
};
|
3224
|
+
|
3225
|
+
|
3226
|
+
Object* CodeCacheHashTable::Lookup(String* name, Code::Flags flags) {
|
3227
|
+
CodeCacheHashTableKey key(name, flags);
|
3228
|
+
int entry = FindEntry(&key);
|
3229
|
+
if (entry == kNotFound) return Heap::undefined_value();
|
3230
|
+
return get(EntryToIndex(entry) + 1);
|
3231
|
+
}
|
3232
|
+
|
3233
|
+
|
3234
|
+
Object* CodeCacheHashTable::Put(String* name, Code* code) {
|
3235
|
+
CodeCacheHashTableKey key(name, code);
|
3236
|
+
Object* obj = EnsureCapacity(1, &key);
|
3237
|
+
if (obj->IsFailure()) return obj;
|
3238
|
+
|
3239
|
+
// Don't use this, as the table might have grown.
|
3240
|
+
CodeCacheHashTable* cache = reinterpret_cast<CodeCacheHashTable*>(obj);
|
3241
|
+
|
3242
|
+
int entry = cache->FindInsertionEntry(key.Hash());
|
3243
|
+
Object* k = key.AsObject();
|
3244
|
+
if (k->IsFailure()) return k;
|
3245
|
+
|
3246
|
+
cache->set(EntryToIndex(entry), k);
|
3247
|
+
cache->set(EntryToIndex(entry) + 1, code);
|
3248
|
+
cache->ElementAdded();
|
3249
|
+
return cache;
|
3250
|
+
}
|
3251
|
+
|
3252
|
+
|
3253
|
+
int CodeCacheHashTable::GetIndex(String* name, Code::Flags flags) {
|
3254
|
+
CodeCacheHashTableKey key(name, flags);
|
3255
|
+
int entry = FindEntry(&key);
|
3256
|
+
return (entry == kNotFound) ? -1 : entry;
|
3257
|
+
}
|
3258
|
+
|
3259
|
+
|
3260
|
+
void CodeCacheHashTable::RemoveByIndex(int index) {
|
3261
|
+
ASSERT(index >= 0);
|
3262
|
+
set(EntryToIndex(index), Heap::null_value());
|
3263
|
+
set(EntryToIndex(index) + 1, Heap::null_value());
|
3264
|
+
ElementRemoved();
|
3124
3265
|
}
|
3125
3266
|
|
3126
3267
|
|
@@ -3196,8 +3337,9 @@ Object* FixedArray::UnionOfKeys(FixedArray* other) {
|
|
3196
3337
|
Object* obj = Heap::AllocateFixedArray(len0 + extra);
|
3197
3338
|
if (obj->IsFailure()) return obj;
|
3198
3339
|
// Fill in the content
|
3340
|
+
AssertNoAllocation no_gc;
|
3199
3341
|
FixedArray* result = FixedArray::cast(obj);
|
3200
|
-
WriteBarrierMode mode = result->GetWriteBarrierMode();
|
3342
|
+
WriteBarrierMode mode = result->GetWriteBarrierMode(no_gc);
|
3201
3343
|
for (int i = 0; i < len0; i++) {
|
3202
3344
|
result->set(i, get(i), mode);
|
3203
3345
|
}
|
@@ -3221,10 +3363,11 @@ Object* FixedArray::CopySize(int new_length) {
|
|
3221
3363
|
if (obj->IsFailure()) return obj;
|
3222
3364
|
FixedArray* result = FixedArray::cast(obj);
|
3223
3365
|
// Copy the content
|
3366
|
+
AssertNoAllocation no_gc;
|
3224
3367
|
int len = length();
|
3225
3368
|
if (new_length < len) len = new_length;
|
3226
3369
|
result->set_map(map());
|
3227
|
-
WriteBarrierMode mode = result->GetWriteBarrierMode();
|
3370
|
+
WriteBarrierMode mode = result->GetWriteBarrierMode(no_gc);
|
3228
3371
|
for (int i = 0; i < len; i++) {
|
3229
3372
|
result->set(i, get(i), mode);
|
3230
3373
|
}
|
@@ -3233,7 +3376,8 @@ Object* FixedArray::CopySize(int new_length) {
|
|
3233
3376
|
|
3234
3377
|
|
3235
3378
|
void FixedArray::CopyTo(int pos, FixedArray* dest, int dest_pos, int len) {
|
3236
|
-
|
3379
|
+
AssertNoAllocation no_gc;
|
3380
|
+
WriteBarrierMode mode = dest->GetWriteBarrierMode(no_gc);
|
3237
3381
|
for (int index = 0; index < len; index++) {
|
3238
3382
|
dest->set(dest_pos+index, get(pos+index), mode);
|
3239
3383
|
}
|
@@ -3267,8 +3411,7 @@ Object* DescriptorArray::Allocate(int number_of_descriptors) {
|
|
3267
3411
|
if (array->IsFailure()) return array;
|
3268
3412
|
result->set(kContentArrayIndex, array);
|
3269
3413
|
result->set(kEnumerationIndexIndex,
|
3270
|
-
Smi::FromInt(PropertyDetails::kInitialIndex)
|
3271
|
-
SKIP_WRITE_BARRIER);
|
3414
|
+
Smi::FromInt(PropertyDetails::kInitialIndex));
|
3272
3415
|
return result;
|
3273
3416
|
}
|
3274
3417
|
|
@@ -3425,18 +3568,25 @@ void DescriptorArray::Sort() {
|
|
3425
3568
|
int len = number_of_descriptors();
|
3426
3569
|
|
3427
3570
|
// Bottom-up max-heap construction.
|
3428
|
-
|
3429
|
-
|
3430
|
-
|
3431
|
-
|
3432
|
-
|
3571
|
+
// Index of the last node with children
|
3572
|
+
const int max_parent_index = (len / 2) - 1;
|
3573
|
+
for (int i = max_parent_index; i >= 0; --i) {
|
3574
|
+
int parent_index = i;
|
3575
|
+
const uint32_t parent_hash = GetKey(i)->Hash();
|
3576
|
+
while (parent_index <= max_parent_index) {
|
3577
|
+
int child_index = 2 * parent_index + 1;
|
3433
3578
|
uint32_t child_hash = GetKey(child_index)->Hash();
|
3434
|
-
if (
|
3435
|
-
|
3436
|
-
|
3437
|
-
|
3579
|
+
if (child_index + 1 < len) {
|
3580
|
+
uint32_t right_child_hash = GetKey(child_index + 1)->Hash();
|
3581
|
+
if (right_child_hash > child_hash) {
|
3582
|
+
child_index++;
|
3583
|
+
child_hash = right_child_hash;
|
3584
|
+
}
|
3438
3585
|
}
|
3439
|
-
|
3586
|
+
if (child_hash <= parent_hash) break;
|
3587
|
+
Swap(parent_index, child_index);
|
3588
|
+
// Now element at child_index could be < its children.
|
3589
|
+
parent_index = child_index; // parent_hash remains correct.
|
3440
3590
|
}
|
3441
3591
|
}
|
3442
3592
|
|
@@ -3446,21 +3596,21 @@ void DescriptorArray::Sort() {
|
|
3446
3596
|
Swap(0, i);
|
3447
3597
|
// Sift down the new top element.
|
3448
3598
|
int parent_index = 0;
|
3449
|
-
|
3450
|
-
|
3451
|
-
|
3452
|
-
|
3453
|
-
uint32_t
|
3454
|
-
|
3455
|
-
|
3456
|
-
if (
|
3457
|
-
|
3458
|
-
|
3459
|
-
|
3460
|
-
if (parent_hash > child2_hash) break;
|
3461
|
-
Swap(parent_index, child_index + 1);
|
3462
|
-
parent_index = child_index + 1;
|
3599
|
+
const uint32_t parent_hash = GetKey(parent_index)->Hash();
|
3600
|
+
const int max_parent_index = (i / 2) - 1;
|
3601
|
+
while (parent_index <= max_parent_index) {
|
3602
|
+
int child_index = parent_index * 2 + 1;
|
3603
|
+
uint32_t child_hash = GetKey(child_index)->Hash();
|
3604
|
+
if (child_index + 1 < i) {
|
3605
|
+
uint32_t right_child_hash = GetKey(child_index + 1)->Hash();
|
3606
|
+
if (right_child_hash > child_hash) {
|
3607
|
+
child_index++;
|
3608
|
+
child_hash = right_child_hash;
|
3609
|
+
}
|
3463
3610
|
}
|
3611
|
+
if (child_hash <= parent_hash) break;
|
3612
|
+
Swap(parent_index, child_index);
|
3613
|
+
parent_index = child_index;
|
3464
3614
|
}
|
3465
3615
|
}
|
3466
3616
|
|
@@ -3541,7 +3691,7 @@ int String::Utf8Length() {
|
|
3541
3691
|
// doesn't make Utf8Length faster, but it is very likely that
|
3542
3692
|
// the string will be accessed later (for example by WriteUtf8)
|
3543
3693
|
// so it's still a good idea.
|
3544
|
-
|
3694
|
+
TryFlatten();
|
3545
3695
|
Access<StringInputBuffer> buffer(&string_input_buffer);
|
3546
3696
|
buffer->Reset(0, this);
|
3547
3697
|
int result = 0;
|
@@ -4508,13 +4658,38 @@ bool String::IsEqualTo(Vector<const char> str) {
|
|
4508
4658
|
}
|
4509
4659
|
|
4510
4660
|
|
4661
|
+
template <typename schar>
|
4662
|
+
static inline uint32_t HashSequentialString(const schar* chars, int length) {
|
4663
|
+
StringHasher hasher(length);
|
4664
|
+
if (!hasher.has_trivial_hash()) {
|
4665
|
+
int i;
|
4666
|
+
for (i = 0; hasher.is_array_index() && (i < length); i++) {
|
4667
|
+
hasher.AddCharacter(chars[i]);
|
4668
|
+
}
|
4669
|
+
for (; i < length; i++) {
|
4670
|
+
hasher.AddCharacterNoIndex(chars[i]);
|
4671
|
+
}
|
4672
|
+
}
|
4673
|
+
return hasher.GetHashField();
|
4674
|
+
}
|
4675
|
+
|
4676
|
+
|
4511
4677
|
uint32_t String::ComputeAndSetHash() {
|
4512
4678
|
// Should only be called if hash code has not yet been computed.
|
4513
4679
|
ASSERT(!(hash_field() & kHashComputedMask));
|
4514
4680
|
|
4681
|
+
const int len = length();
|
4682
|
+
|
4515
4683
|
// Compute the hash code.
|
4516
|
-
|
4517
|
-
|
4684
|
+
uint32_t field = 0;
|
4685
|
+
if (StringShape(this).IsSequentialAscii()) {
|
4686
|
+
field = HashSequentialString(SeqAsciiString::cast(this)->GetChars(), len);
|
4687
|
+
} else if (StringShape(this).IsSequentialTwoByte()) {
|
4688
|
+
field = HashSequentialString(SeqTwoByteString::cast(this)->GetChars(), len);
|
4689
|
+
} else {
|
4690
|
+
StringInputBuffer buffer(this);
|
4691
|
+
field = ComputeHashField(&buffer, len);
|
4692
|
+
}
|
4518
4693
|
|
4519
4694
|
// Store the hash code in the object.
|
4520
4695
|
set_hash_field(field);
|
@@ -4632,9 +4807,9 @@ uint32_t String::ComputeHashField(unibrow::CharacterStream* buffer,
|
|
4632
4807
|
}
|
4633
4808
|
|
4634
4809
|
|
4635
|
-
Object* String::SubString(int start, int end) {
|
4810
|
+
Object* String::SubString(int start, int end, PretenureFlag pretenure) {
|
4636
4811
|
if (start == 0 && end == length()) return this;
|
4637
|
-
Object* result = Heap::AllocateSubString(this, start, end);
|
4812
|
+
Object* result = Heap::AllocateSubString(this, start, end, pretenure);
|
4638
4813
|
return result;
|
4639
4814
|
}
|
4640
4815
|
|
@@ -4696,8 +4871,8 @@ void Map::ClearNonLiveTransitions(Object* real_prototype) {
|
|
4696
4871
|
ASSERT(target->IsHeapObject());
|
4697
4872
|
if (!target->IsMarked()) {
|
4698
4873
|
ASSERT(target->IsMap());
|
4699
|
-
contents->set(i + 1, NullDescriptorDetails
|
4700
|
-
contents->
|
4874
|
+
contents->set(i + 1, NullDescriptorDetails);
|
4875
|
+
contents->set_null(i);
|
4701
4876
|
ASSERT(target->prototype() == this ||
|
4702
4877
|
target->prototype() == real_prototype);
|
4703
4878
|
// Getter prototype() is read-only, set_prototype() has side effects.
|
@@ -4731,6 +4906,7 @@ Object* JSFunction::SetInstancePrototype(Object* value) {
|
|
4731
4906
|
|
4732
4907
|
|
4733
4908
|
Object* JSFunction::SetPrototype(Object* value) {
|
4909
|
+
ASSERT(should_have_prototype());
|
4734
4910
|
Object* construct_prototype = value;
|
4735
4911
|
|
4736
4912
|
// If the value is not a JSObject, store the value in the map's
|
@@ -4756,6 +4932,14 @@ Object* JSFunction::SetPrototype(Object* value) {
|
|
4756
4932
|
}
|
4757
4933
|
|
4758
4934
|
|
4935
|
+
Object* JSFunction::RemovePrototype() {
|
4936
|
+
ASSERT(map() == context()->global_context()->function_map());
|
4937
|
+
set_map(context()->global_context()->function_without_prototype_map());
|
4938
|
+
set_prototype_or_initial_map(Heap::the_hole_value());
|
4939
|
+
return this;
|
4940
|
+
}
|
4941
|
+
|
4942
|
+
|
4759
4943
|
Object* JSFunction::SetInstanceClassName(String* name) {
|
4760
4944
|
shared()->set_instance_class_name(name);
|
4761
4945
|
return this;
|
@@ -4814,6 +4998,40 @@ int SharedFunctionInfo::CalculateInObjectProperties() {
|
|
4814
4998
|
}
|
4815
4999
|
|
4816
5000
|
|
5001
|
+
bool SharedFunctionInfo::CanGenerateInlineConstructor(Object* prototype) {
|
5002
|
+
// Check the basic conditions for generating inline constructor code.
|
5003
|
+
if (!FLAG_inline_new
|
5004
|
+
|| !has_only_simple_this_property_assignments()
|
5005
|
+
|| this_property_assignments_count() == 0) {
|
5006
|
+
return false;
|
5007
|
+
}
|
5008
|
+
|
5009
|
+
// If the prototype is null inline constructors cause no problems.
|
5010
|
+
if (!prototype->IsJSObject()) {
|
5011
|
+
ASSERT(prototype->IsNull());
|
5012
|
+
return true;
|
5013
|
+
}
|
5014
|
+
|
5015
|
+
// Traverse the proposed prototype chain looking for setters for properties of
|
5016
|
+
// the same names as are set by the inline constructor.
|
5017
|
+
for (Object* obj = prototype;
|
5018
|
+
obj != Heap::null_value();
|
5019
|
+
obj = obj->GetPrototype()) {
|
5020
|
+
JSObject* js_object = JSObject::cast(obj);
|
5021
|
+
for (int i = 0; i < this_property_assignments_count(); i++) {
|
5022
|
+
LookupResult result;
|
5023
|
+
String* name = GetThisPropertyAssignmentName(i);
|
5024
|
+
js_object->LocalLookupRealNamedProperty(name, &result);
|
5025
|
+
if (result.IsProperty() && result.type() == CALLBACKS) {
|
5026
|
+
return false;
|
5027
|
+
}
|
5028
|
+
}
|
5029
|
+
}
|
5030
|
+
|
5031
|
+
return true;
|
5032
|
+
}
|
5033
|
+
|
5034
|
+
|
4817
5035
|
void SharedFunctionInfo::SetThisPropertyAssignmentsInfo(
|
4818
5036
|
bool only_simple_this_property_assignments,
|
4819
5037
|
FixedArray* assignments) {
|
@@ -4869,7 +5087,6 @@ Object* SharedFunctionInfo::GetThisPropertyAssignmentConstant(int index) {
|
|
4869
5087
|
}
|
4870
5088
|
|
4871
5089
|
|
4872
|
-
|
4873
5090
|
// Support function for printing the source code to a StringStream
|
4874
5091
|
// without any allocation in the heap.
|
4875
5092
|
void SharedFunctionInfo::SourceCodePrint(StringStream* accumulator,
|
@@ -4913,11 +5130,9 @@ void SharedFunctionInfo::SourceCodePrint(StringStream* accumulator,
|
|
4913
5130
|
|
4914
5131
|
|
4915
5132
|
void SharedFunctionInfo::SharedFunctionInfoIterateBody(ObjectVisitor* v) {
|
4916
|
-
IteratePointers(v,
|
4917
|
-
|
4918
|
-
|
4919
|
-
IteratePointers(v, kThisPropertyAssignmentsOffset,
|
4920
|
-
kThisPropertyAssignmentsOffset + kPointerSize);
|
5133
|
+
IteratePointers(v,
|
5134
|
+
kNameOffset,
|
5135
|
+
kThisPropertyAssignmentsOffset + kPointerSize);
|
4921
5136
|
}
|
4922
5137
|
|
4923
5138
|
|
@@ -5088,6 +5303,7 @@ const char* Code::Kind2String(Kind kind) {
|
|
5088
5303
|
case STORE_IC: return "STORE_IC";
|
5089
5304
|
case KEYED_STORE_IC: return "KEYED_STORE_IC";
|
5090
5305
|
case CALL_IC: return "CALL_IC";
|
5306
|
+
case BINARY_OP_IC: return "BINARY_OP_IC";
|
5091
5307
|
}
|
5092
5308
|
UNREACHABLE();
|
5093
5309
|
return NULL;
|
@@ -5157,7 +5373,8 @@ void JSObject::SetFastElements(FixedArray* elems) {
|
|
5157
5373
|
uint32_t len = static_cast<uint32_t>(elems->length());
|
5158
5374
|
for (uint32_t i = 0; i < len; i++) ASSERT(elems->get(i)->IsTheHole());
|
5159
5375
|
#endif
|
5160
|
-
|
5376
|
+
AssertNoAllocation no_gc;
|
5377
|
+
WriteBarrierMode mode = elems->GetWriteBarrierMode(no_gc);
|
5161
5378
|
switch (GetElementsKind()) {
|
5162
5379
|
case FAST_ELEMENTS: {
|
5163
5380
|
FixedArray* old_elements = FixedArray::cast(elements());
|
@@ -5208,7 +5425,7 @@ Object* JSObject::SetSlowElements(Object* len) {
|
|
5208
5425
|
case DICTIONARY_ELEMENTS: {
|
5209
5426
|
if (IsJSArray()) {
|
5210
5427
|
uint32_t old_length =
|
5211
|
-
|
5428
|
+
static_cast<uint32_t>(JSArray::cast(this)->length()->Number());
|
5212
5429
|
element_dictionary()->RemoveNumberEntries(new_length, old_length),
|
5213
5430
|
JSArray::cast(this)->set_length(len);
|
5214
5431
|
}
|
@@ -5224,7 +5441,7 @@ Object* JSObject::SetSlowElements(Object* len) {
|
|
5224
5441
|
|
5225
5442
|
Object* JSArray::Initialize(int capacity) {
|
5226
5443
|
ASSERT(capacity >= 0);
|
5227
|
-
set_length(Smi::FromInt(0)
|
5444
|
+
set_length(Smi::FromInt(0));
|
5228
5445
|
FixedArray* new_elements;
|
5229
5446
|
if (capacity == 0) {
|
5230
5447
|
new_elements = Heap::empty_fixed_array();
|
@@ -5266,7 +5483,7 @@ static Object* ArrayLengthRangeError() {
|
|
5266
5483
|
|
5267
5484
|
Object* JSObject::SetElementsLength(Object* len) {
|
5268
5485
|
// We should never end in here with a pixel or external array.
|
5269
|
-
ASSERT(
|
5486
|
+
ASSERT(AllowsSetElementsLength());
|
5270
5487
|
|
5271
5488
|
Object* smi_length = len->ToSmi();
|
5272
5489
|
if (smi_length->IsSmi()) {
|
@@ -5284,7 +5501,7 @@ Object* JSObject::SetElementsLength(Object* len) {
|
|
5284
5501
|
for (int i = value; i < old_length; i++) {
|
5285
5502
|
FixedArray::cast(elements())->set_the_hole(i);
|
5286
5503
|
}
|
5287
|
-
JSArray::cast(this)->set_length(smi_length
|
5504
|
+
JSArray::cast(this)->set_length(Smi::cast(smi_length));
|
5288
5505
|
}
|
5289
5506
|
return this;
|
5290
5507
|
}
|
@@ -5294,8 +5511,9 @@ Object* JSObject::SetElementsLength(Object* len) {
|
|
5294
5511
|
!ShouldConvertToSlowElements(new_capacity)) {
|
5295
5512
|
Object* obj = Heap::AllocateFixedArrayWithHoles(new_capacity);
|
5296
5513
|
if (obj->IsFailure()) return obj;
|
5297
|
-
if (IsJSArray())
|
5298
|
-
|
5514
|
+
if (IsJSArray()) {
|
5515
|
+
JSArray::cast(this)->set_length(Smi::cast(smi_length));
|
5516
|
+
}
|
5299
5517
|
SetFastElements(FixedArray::cast(obj));
|
5300
5518
|
return this;
|
5301
5519
|
}
|
@@ -5314,7 +5532,7 @@ Object* JSObject::SetElementsLength(Object* len) {
|
|
5314
5532
|
static_cast<uint32_t>(JSArray::cast(this)->length()->Number());
|
5315
5533
|
element_dictionary()->RemoveNumberEntries(value, old_length);
|
5316
5534
|
}
|
5317
|
-
JSArray::cast(this)->set_length(smi_length
|
5535
|
+
JSArray::cast(this)->set_length(Smi::cast(smi_length));
|
5318
5536
|
}
|
5319
5537
|
return this;
|
5320
5538
|
}
|
@@ -5339,13 +5557,54 @@ Object* JSObject::SetElementsLength(Object* len) {
|
|
5339
5557
|
Object* obj = Heap::AllocateFixedArray(1);
|
5340
5558
|
if (obj->IsFailure()) return obj;
|
5341
5559
|
FixedArray::cast(obj)->set(0, len);
|
5342
|
-
if (IsJSArray()) JSArray::cast(this)->set_length(Smi::FromInt(1)
|
5343
|
-
SKIP_WRITE_BARRIER);
|
5560
|
+
if (IsJSArray()) JSArray::cast(this)->set_length(Smi::FromInt(1));
|
5344
5561
|
set_elements(FixedArray::cast(obj));
|
5345
5562
|
return this;
|
5346
5563
|
}
|
5347
5564
|
|
5348
5565
|
|
5566
|
+
Object* JSObject::SetPrototype(Object* value,
|
5567
|
+
bool skip_hidden_prototypes) {
|
5568
|
+
// Silently ignore the change if value is not a JSObject or null.
|
5569
|
+
// SpiderMonkey behaves this way.
|
5570
|
+
if (!value->IsJSObject() && !value->IsNull()) return value;
|
5571
|
+
|
5572
|
+
// Before we can set the prototype we need to be sure
|
5573
|
+
// prototype cycles are prevented.
|
5574
|
+
// It is sufficient to validate that the receiver is not in the new prototype
|
5575
|
+
// chain.
|
5576
|
+
for (Object* pt = value; pt != Heap::null_value(); pt = pt->GetPrototype()) {
|
5577
|
+
if (JSObject::cast(pt) == this) {
|
5578
|
+
// Cycle detected.
|
5579
|
+
HandleScope scope;
|
5580
|
+
return Top::Throw(*Factory::NewError("cyclic_proto",
|
5581
|
+
HandleVector<Object>(NULL, 0)));
|
5582
|
+
}
|
5583
|
+
}
|
5584
|
+
|
5585
|
+
JSObject* real_receiver = this;
|
5586
|
+
|
5587
|
+
if (skip_hidden_prototypes) {
|
5588
|
+
// Find the first object in the chain whose prototype object is not
|
5589
|
+
// hidden and set the new prototype on that object.
|
5590
|
+
Object* current_proto = real_receiver->GetPrototype();
|
5591
|
+
while (current_proto->IsJSObject() &&
|
5592
|
+
JSObject::cast(current_proto)->map()->is_hidden_prototype()) {
|
5593
|
+
real_receiver = JSObject::cast(current_proto);
|
5594
|
+
current_proto = current_proto->GetPrototype();
|
5595
|
+
}
|
5596
|
+
}
|
5597
|
+
|
5598
|
+
// Set the new prototype of the object.
|
5599
|
+
Object* new_map = real_receiver->map()->CopyDropTransitions();
|
5600
|
+
if (new_map->IsFailure()) return new_map;
|
5601
|
+
Map::cast(new_map)->set_prototype(value);
|
5602
|
+
real_receiver->set_map(Map::cast(new_map));
|
5603
|
+
|
5604
|
+
return value;
|
5605
|
+
}
|
5606
|
+
|
5607
|
+
|
5349
5608
|
bool JSObject::HasElementPostInterceptor(JSObject* receiver, uint32_t index) {
|
5350
5609
|
switch (GetElementsKind()) {
|
5351
5610
|
case FAST_ELEMENTS: {
|
@@ -5610,8 +5869,7 @@ Object* JSObject::SetFastElement(uint32_t index, Object* value) {
|
|
5610
5869
|
CHECK(Array::IndexFromObject(JSArray::cast(this)->length(),
|
5611
5870
|
&array_length));
|
5612
5871
|
if (index >= array_length) {
|
5613
|
-
JSArray::cast(this)->set_length(Smi::FromInt(index + 1)
|
5614
|
-
SKIP_WRITE_BARRIER);
|
5872
|
+
JSArray::cast(this)->set_length(Smi::FromInt(index + 1));
|
5615
5873
|
}
|
5616
5874
|
}
|
5617
5875
|
return value;
|
@@ -5627,8 +5885,9 @@ Object* JSObject::SetFastElement(uint32_t index, Object* value) {
|
|
5627
5885
|
Object* obj = Heap::AllocateFixedArrayWithHoles(new_capacity);
|
5628
5886
|
if (obj->IsFailure()) return obj;
|
5629
5887
|
SetFastElements(FixedArray::cast(obj));
|
5630
|
-
if (IsJSArray())
|
5631
|
-
|
5888
|
+
if (IsJSArray()) {
|
5889
|
+
JSArray::cast(this)->set_length(Smi::FromInt(index + 1));
|
5890
|
+
}
|
5632
5891
|
FixedArray::cast(elements())->set(index, value);
|
5633
5892
|
return value;
|
5634
5893
|
}
|
@@ -6125,7 +6384,8 @@ template<typename Shape, typename Key>
|
|
6125
6384
|
void Dictionary<Shape, Key>::CopyValuesTo(FixedArray* elements) {
|
6126
6385
|
int pos = 0;
|
6127
6386
|
int capacity = HashTable<Shape, Key>::Capacity();
|
6128
|
-
|
6387
|
+
AssertNoAllocation no_gc;
|
6388
|
+
WriteBarrierMode mode = elements->GetWriteBarrierMode(no_gc);
|
6129
6389
|
for (int i = 0; i < capacity; i++) {
|
6130
6390
|
Object* k = Dictionary<Shape, Key>::KeyAt(i);
|
6131
6391
|
if (Dictionary<Shape, Key>::IsKey(k)) {
|
@@ -6139,9 +6399,9 @@ void Dictionary<Shape, Key>::CopyValuesTo(FixedArray* elements) {
|
|
6139
6399
|
InterceptorInfo* JSObject::GetNamedInterceptor() {
|
6140
6400
|
ASSERT(map()->has_named_interceptor());
|
6141
6401
|
JSFunction* constructor = JSFunction::cast(map()->constructor());
|
6142
|
-
|
6402
|
+
ASSERT(constructor->shared()->IsApiFunction());
|
6143
6403
|
Object* result =
|
6144
|
-
|
6404
|
+
constructor->shared()->get_api_func_data()->named_property_handler();
|
6145
6405
|
return InterceptorInfo::cast(result);
|
6146
6406
|
}
|
6147
6407
|
|
@@ -6149,9 +6409,9 @@ InterceptorInfo* JSObject::GetNamedInterceptor() {
|
|
6149
6409
|
InterceptorInfo* JSObject::GetIndexedInterceptor() {
|
6150
6410
|
ASSERT(map()->has_indexed_interceptor());
|
6151
6411
|
JSFunction* constructor = JSFunction::cast(map()->constructor());
|
6152
|
-
|
6412
|
+
ASSERT(constructor->shared()->IsApiFunction());
|
6153
6413
|
Object* result =
|
6154
|
-
|
6414
|
+
constructor->shared()->get_api_func_data()->indexed_property_handler();
|
6155
6415
|
return InterceptorInfo::cast(result);
|
6156
6416
|
}
|
6157
6417
|
|
@@ -6162,7 +6422,9 @@ Object* JSObject::GetPropertyPostInterceptor(JSObject* receiver,
|
|
6162
6422
|
// Check local property in holder, ignore interceptor.
|
6163
6423
|
LookupResult result;
|
6164
6424
|
LocalLookupRealNamedProperty(name, &result);
|
6165
|
-
if (result.
|
6425
|
+
if (result.IsProperty()) {
|
6426
|
+
return GetProperty(receiver, &result, name, attributes);
|
6427
|
+
}
|
6166
6428
|
// Continue searching via the prototype chain.
|
6167
6429
|
Object* pt = GetPrototype();
|
6168
6430
|
*attributes = ABSENT;
|
@@ -6178,8 +6440,10 @@ Object* JSObject::GetLocalPropertyPostInterceptor(
|
|
6178
6440
|
// Check local property in holder, ignore interceptor.
|
6179
6441
|
LookupResult result;
|
6180
6442
|
LocalLookupRealNamedProperty(name, &result);
|
6181
|
-
if (
|
6182
|
-
|
6443
|
+
if (result.IsProperty()) {
|
6444
|
+
return GetProperty(receiver, &result, name, attributes);
|
6445
|
+
}
|
6446
|
+
return Heap::undefined_value();
|
6183
6447
|
}
|
6184
6448
|
|
6185
6449
|
|
@@ -6231,24 +6495,7 @@ bool JSObject::HasRealNamedProperty(String* key) {
|
|
6231
6495
|
|
6232
6496
|
LookupResult result;
|
6233
6497
|
LocalLookupRealNamedProperty(key, &result);
|
6234
|
-
|
6235
|
-
switch (result.type()) {
|
6236
|
-
case NORMAL: // fall through.
|
6237
|
-
case FIELD: // fall through.
|
6238
|
-
case CALLBACKS: // fall through.
|
6239
|
-
case CONSTANT_FUNCTION:
|
6240
|
-
return true;
|
6241
|
-
case INTERCEPTOR:
|
6242
|
-
case MAP_TRANSITION:
|
6243
|
-
case CONSTANT_TRANSITION:
|
6244
|
-
case NULL_DESCRIPTOR:
|
6245
|
-
return false;
|
6246
|
-
default:
|
6247
|
-
UNREACHABLE();
|
6248
|
-
}
|
6249
|
-
}
|
6250
|
-
|
6251
|
-
return false;
|
6498
|
+
return result.IsProperty() && (result.type() != INTERCEPTOR);
|
6252
6499
|
}
|
6253
6500
|
|
6254
6501
|
|
@@ -6310,7 +6557,7 @@ bool JSObject::HasRealNamedCallbackProperty(String* key) {
|
|
6310
6557
|
|
6311
6558
|
LookupResult result;
|
6312
6559
|
LocalLookupRealNamedProperty(key, &result);
|
6313
|
-
return result.
|
6560
|
+
return result.IsProperty() && (result.type() == CALLBACKS);
|
6314
6561
|
}
|
6315
6562
|
|
6316
6563
|
|
@@ -6496,7 +6743,7 @@ int JSObject::GetLocalElementKeys(FixedArray* storage,
|
|
6496
6743
|
for (int i = 0; i < length; i++) {
|
6497
6744
|
if (!FixedArray::cast(elements())->get(i)->IsTheHole()) {
|
6498
6745
|
if (storage != NULL) {
|
6499
|
-
storage->set(counter, Smi::FromInt(i)
|
6746
|
+
storage->set(counter, Smi::FromInt(i));
|
6500
6747
|
}
|
6501
6748
|
counter++;
|
6502
6749
|
}
|
@@ -6508,7 +6755,7 @@ int JSObject::GetLocalElementKeys(FixedArray* storage,
|
|
6508
6755
|
int length = PixelArray::cast(elements())->length();
|
6509
6756
|
while (counter < length) {
|
6510
6757
|
if (storage != NULL) {
|
6511
|
-
storage->set(counter, Smi::FromInt(counter)
|
6758
|
+
storage->set(counter, Smi::FromInt(counter));
|
6512
6759
|
}
|
6513
6760
|
counter++;
|
6514
6761
|
}
|
@@ -6525,7 +6772,7 @@ int JSObject::GetLocalElementKeys(FixedArray* storage,
|
|
6525
6772
|
int length = ExternalArray::cast(elements())->length();
|
6526
6773
|
while (counter < length) {
|
6527
6774
|
if (storage != NULL) {
|
6528
|
-
storage->set(counter, Smi::FromInt(counter)
|
6775
|
+
storage->set(counter, Smi::FromInt(counter));
|
6529
6776
|
}
|
6530
6777
|
counter++;
|
6531
6778
|
}
|
@@ -6550,7 +6797,7 @@ int JSObject::GetLocalElementKeys(FixedArray* storage,
|
|
6550
6797
|
String* str = String::cast(val);
|
6551
6798
|
if (storage) {
|
6552
6799
|
for (int i = 0; i < str->length(); i++) {
|
6553
|
-
storage->set(counter + i, Smi::FromInt(i)
|
6800
|
+
storage->set(counter + i, Smi::FromInt(i));
|
6554
6801
|
}
|
6555
6802
|
}
|
6556
6803
|
counter += str->length();
|
@@ -6834,15 +7081,17 @@ void HashTable<Shape, Key>::IterateElements(ObjectVisitor* v) {
|
|
6834
7081
|
|
6835
7082
|
|
6836
7083
|
template<typename Shape, typename Key>
|
6837
|
-
Object* HashTable<Shape, Key>::Allocate(int at_least_space_for
|
6838
|
-
|
6839
|
-
|
6840
|
-
|
7084
|
+
Object* HashTable<Shape, Key>::Allocate(int at_least_space_for,
|
7085
|
+
PretenureFlag pretenure) {
|
7086
|
+
const int kMinCapacity = 32;
|
7087
|
+
int capacity = RoundUpToPowerOf2(at_least_space_for * 2);
|
7088
|
+
if (capacity < kMinCapacity) {
|
7089
|
+
capacity = kMinCapacity; // Guarantee min capacity.
|
6841
7090
|
} else if (capacity > HashTable::kMaxCapacity) {
|
6842
7091
|
return Failure::OutOfMemoryException();
|
6843
7092
|
}
|
6844
7093
|
|
6845
|
-
Object* obj = Heap::AllocateHashTable(EntryToIndex(capacity));
|
7094
|
+
Object* obj = Heap::AllocateHashTable(EntryToIndex(capacity), pretenure);
|
6846
7095
|
if (!obj->IsFailure()) {
|
6847
7096
|
HashTable::cast(obj)->SetNumberOfElements(0);
|
6848
7097
|
HashTable::cast(obj)->SetNumberOfDeletedElements(0);
|
@@ -6877,13 +7126,20 @@ Object* HashTable<Shape, Key>::EnsureCapacity(int n, Key key) {
|
|
6877
7126
|
// Return if:
|
6878
7127
|
// 50% is still free after adding n elements and
|
6879
7128
|
// at most 50% of the free elements are deleted elements.
|
6880
|
-
if ((
|
6881
|
-
|
7129
|
+
if (nod <= (capacity - nof) >> 1) {
|
7130
|
+
int needed_free = nof >> 1;
|
7131
|
+
if (nof + needed_free <= capacity) return this;
|
7132
|
+
}
|
6882
7133
|
|
6883
|
-
|
7134
|
+
const int kMinCapacityForPretenure = 256;
|
7135
|
+
bool pretenure =
|
7136
|
+
(capacity > kMinCapacityForPretenure) && !Heap::InNewSpace(this);
|
7137
|
+
Object* obj = Allocate(nof * 2, pretenure ? TENURED : NOT_TENURED);
|
6884
7138
|
if (obj->IsFailure()) return obj;
|
7139
|
+
|
7140
|
+
AssertNoAllocation no_gc;
|
6885
7141
|
HashTable* table = HashTable::cast(obj);
|
6886
|
-
WriteBarrierMode mode = table->GetWriteBarrierMode();
|
7142
|
+
WriteBarrierMode mode = table->GetWriteBarrierMode(no_gc);
|
6887
7143
|
|
6888
7144
|
// Copy prefix to new array.
|
6889
7145
|
for (int i = kPrefixStartIndex;
|
@@ -6910,7 +7166,6 @@ Object* HashTable<Shape, Key>::EnsureCapacity(int n, Key key) {
|
|
6910
7166
|
}
|
6911
7167
|
|
6912
7168
|
|
6913
|
-
|
6914
7169
|
template<typename Shape, typename Key>
|
6915
7170
|
uint32_t HashTable<Shape, Key>::FindInsertionEntry(uint32_t hash) {
|
6916
7171
|
uint32_t capacity = Capacity();
|
@@ -7020,8 +7275,7 @@ Object* JSObject::PrepareSlowElementsForSort(uint32_t limit) {
|
|
7020
7275
|
result_double = HeapNumber::cast(new_double);
|
7021
7276
|
}
|
7022
7277
|
|
7023
|
-
|
7024
|
-
Object* obj = NumberDictionary::Allocate(dict->Capacity());
|
7278
|
+
Object* obj = NumberDictionary::Allocate(dict->NumberOfElements());
|
7025
7279
|
if (obj->IsFailure()) return obj;
|
7026
7280
|
NumberDictionary* new_dict = NumberDictionary::cast(obj);
|
7027
7281
|
|
@@ -7029,6 +7283,7 @@ Object* JSObject::PrepareSlowElementsForSort(uint32_t limit) {
|
|
7029
7283
|
|
7030
7284
|
uint32_t pos = 0;
|
7031
7285
|
uint32_t undefs = 0;
|
7286
|
+
int capacity = dict->Capacity();
|
7032
7287
|
for (int i = 0; i < capacity; i++) {
|
7033
7288
|
Object* k = dict->KeyAt(i);
|
7034
7289
|
if (dict->IsKey(k)) {
|
@@ -7130,7 +7385,7 @@ Object* JSObject::PrepareElementsForSort(uint32_t limit) {
|
|
7130
7385
|
|
7131
7386
|
// Split elements into defined, undefined and the_hole, in that order.
|
7132
7387
|
// Only count locations for undefined and the hole, and fill them afterwards.
|
7133
|
-
WriteBarrierMode write_barrier = elements->GetWriteBarrierMode();
|
7388
|
+
WriteBarrierMode write_barrier = elements->GetWriteBarrierMode(no_alloc);
|
7134
7389
|
unsigned int undefs = limit;
|
7135
7390
|
unsigned int holes = limit;
|
7136
7391
|
// Assume most arrays contain no holes and undefined values, so minimize the
|
@@ -7625,7 +7880,7 @@ Object* Dictionary<Shape, Key>::GenerateNewEnumerationIndices() {
|
|
7625
7880
|
if (obj->IsFailure()) return obj;
|
7626
7881
|
FixedArray* iteration_order = FixedArray::cast(obj);
|
7627
7882
|
for (int i = 0; i < length; i++) {
|
7628
|
-
iteration_order->set(i, Smi::FromInt(i)
|
7883
|
+
iteration_order->set(i, Smi::FromInt(i));
|
7629
7884
|
}
|
7630
7885
|
|
7631
7886
|
// Allocate array with enumeration order.
|
@@ -7638,9 +7893,7 @@ Object* Dictionary<Shape, Key>::GenerateNewEnumerationIndices() {
|
|
7638
7893
|
int pos = 0;
|
7639
7894
|
for (int i = 0; i < capacity; i++) {
|
7640
7895
|
if (Dictionary<Shape, Key>::IsKey(Dictionary<Shape, Key>::KeyAt(i))) {
|
7641
|
-
enumeration_order->set(pos++,
|
7642
|
-
Smi::FromInt(DetailsAt(i).index()),
|
7643
|
-
SKIP_WRITE_BARRIER);
|
7896
|
+
enumeration_order->set(pos++, Smi::FromInt(DetailsAt(i).index()));
|
7644
7897
|
}
|
7645
7898
|
}
|
7646
7899
|
|
@@ -7651,9 +7904,7 @@ Object* Dictionary<Shape, Key>::GenerateNewEnumerationIndices() {
|
|
7651
7904
|
for (int i = 0; i < length; i++) {
|
7652
7905
|
int index = Smi::cast(iteration_order->get(i))->value();
|
7653
7906
|
int enum_index = PropertyDetails::kInitialIndex + i;
|
7654
|
-
enumeration_order->set(index,
|
7655
|
-
Smi::FromInt(enum_index),
|
7656
|
-
SKIP_WRITE_BARRIER);
|
7907
|
+
enumeration_order->set(index, Smi::FromInt(enum_index));
|
7657
7908
|
}
|
7658
7909
|
|
7659
7910
|
// Update the dictionary with new indices.
|
@@ -7801,8 +8052,7 @@ void NumberDictionary::UpdateMaxNumberKey(uint32_t key) {
|
|
7801
8052
|
Object* max_index_object = get(kMaxNumberKeyIndex);
|
7802
8053
|
if (!max_index_object->IsSmi() || max_number_key() < key) {
|
7803
8054
|
FixedArray::set(kMaxNumberKeyIndex,
|
7804
|
-
Smi::FromInt(key << kRequiresSlowElementsTagSize)
|
7805
|
-
SKIP_WRITE_BARRIER);
|
8055
|
+
Smi::FromInt(key << kRequiresSlowElementsTagSize));
|
7806
8056
|
}
|
7807
8057
|
}
|
7808
8058
|
|
@@ -7893,9 +8143,7 @@ void StringDictionary::CopyEnumKeysTo(FixedArray* storage,
|
|
7893
8143
|
PropertyDetails details = DetailsAt(i);
|
7894
8144
|
if (details.IsDeleted() || details.IsDontEnum()) continue;
|
7895
8145
|
storage->set(index, k);
|
7896
|
-
sort_array->set(index,
|
7897
|
-
Smi::FromInt(details.index()),
|
7898
|
-
SKIP_WRITE_BARRIER);
|
8146
|
+
sort_array->set(index, Smi::FromInt(details.index()));
|
7899
8147
|
index++;
|
7900
8148
|
}
|
7901
8149
|
}
|