libv8 3.11.8.17 → 3.16.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -2
- data/Gemfile +1 -1
- data/Rakefile +6 -7
- data/lib/libv8/version.rb +1 -1
- data/vendor/v8/.gitignore +24 -3
- data/vendor/v8/AUTHORS +7 -0
- data/vendor/v8/ChangeLog +839 -0
- data/vendor/v8/DEPS +1 -1
- data/vendor/v8/Makefile.android +92 -0
- data/vendor/v8/OWNERS +11 -0
- data/vendor/v8/PRESUBMIT.py +71 -0
- data/vendor/v8/SConstruct +34 -39
- data/vendor/v8/build/android.gypi +56 -37
- data/vendor/v8/build/common.gypi +112 -30
- data/vendor/v8/build/gyp_v8 +1 -1
- data/vendor/v8/build/standalone.gypi +15 -11
- data/vendor/v8/include/v8-debug.h +9 -1
- data/vendor/v8/include/v8-preparser.h +4 -3
- data/vendor/v8/include/v8-profiler.h +25 -25
- data/vendor/v8/include/v8-testing.h +4 -3
- data/vendor/v8/include/v8.h +994 -540
- data/vendor/v8/preparser/preparser-process.cc +3 -3
- data/vendor/v8/samples/lineprocessor.cc +20 -27
- data/vendor/v8/samples/process.cc +18 -14
- data/vendor/v8/samples/shell.cc +16 -15
- data/vendor/v8/src/SConscript +15 -14
- data/vendor/v8/src/accessors.cc +169 -77
- data/vendor/v8/src/accessors.h +4 -0
- data/vendor/v8/src/allocation-inl.h +2 -2
- data/vendor/v8/src/allocation.h +7 -7
- data/vendor/v8/src/api.cc +810 -497
- data/vendor/v8/src/api.h +85 -60
- data/vendor/v8/src/arm/assembler-arm-inl.h +179 -22
- data/vendor/v8/src/arm/assembler-arm.cc +633 -264
- data/vendor/v8/src/arm/assembler-arm.h +264 -197
- data/vendor/v8/src/arm/builtins-arm.cc +117 -27
- data/vendor/v8/src/arm/code-stubs-arm.cc +1241 -700
- data/vendor/v8/src/arm/code-stubs-arm.h +35 -138
- data/vendor/v8/src/arm/codegen-arm.cc +285 -16
- data/vendor/v8/src/arm/codegen-arm.h +22 -0
- data/vendor/v8/src/arm/constants-arm.cc +5 -3
- data/vendor/v8/src/arm/constants-arm.h +24 -11
- data/vendor/v8/src/arm/debug-arm.cc +3 -3
- data/vendor/v8/src/arm/deoptimizer-arm.cc +382 -92
- data/vendor/v8/src/arm/disasm-arm.cc +61 -12
- data/vendor/v8/src/arm/frames-arm.h +0 -14
- data/vendor/v8/src/arm/full-codegen-arm.cc +332 -304
- data/vendor/v8/src/arm/ic-arm.cc +180 -259
- data/vendor/v8/src/arm/lithium-arm.cc +364 -316
- data/vendor/v8/src/arm/lithium-arm.h +512 -275
- data/vendor/v8/src/arm/lithium-codegen-arm.cc +1768 -809
- data/vendor/v8/src/arm/lithium-codegen-arm.h +97 -35
- data/vendor/v8/src/arm/lithium-gap-resolver-arm.cc +12 -5
- data/vendor/v8/src/arm/macro-assembler-arm.cc +439 -228
- data/vendor/v8/src/arm/macro-assembler-arm.h +116 -70
- data/vendor/v8/src/arm/regexp-macro-assembler-arm.cc +54 -44
- data/vendor/v8/src/arm/regexp-macro-assembler-arm.h +3 -10
- data/vendor/v8/src/arm/simulator-arm.cc +272 -238
- data/vendor/v8/src/arm/simulator-arm.h +38 -8
- data/vendor/v8/src/arm/stub-cache-arm.cc +522 -895
- data/vendor/v8/src/array.js +101 -70
- data/vendor/v8/src/assembler.cc +270 -19
- data/vendor/v8/src/assembler.h +110 -15
- data/vendor/v8/src/ast.cc +79 -69
- data/vendor/v8/src/ast.h +255 -301
- data/vendor/v8/src/atomicops.h +7 -1
- data/vendor/v8/src/atomicops_internals_tsan.h +335 -0
- data/vendor/v8/src/bootstrapper.cc +481 -418
- data/vendor/v8/src/bootstrapper.h +4 -4
- data/vendor/v8/src/builtins.cc +498 -311
- data/vendor/v8/src/builtins.h +75 -47
- data/vendor/v8/src/checks.cc +2 -1
- data/vendor/v8/src/checks.h +8 -0
- data/vendor/v8/src/code-stubs-hydrogen.cc +253 -0
- data/vendor/v8/src/code-stubs.cc +249 -84
- data/vendor/v8/src/code-stubs.h +501 -169
- data/vendor/v8/src/codegen.cc +36 -18
- data/vendor/v8/src/codegen.h +25 -3
- data/vendor/v8/src/collection.js +54 -17
- data/vendor/v8/src/compilation-cache.cc +24 -16
- data/vendor/v8/src/compilation-cache.h +15 -6
- data/vendor/v8/src/compiler.cc +497 -195
- data/vendor/v8/src/compiler.h +246 -38
- data/vendor/v8/src/contexts.cc +64 -24
- data/vendor/v8/src/contexts.h +60 -29
- data/vendor/v8/src/conversions-inl.h +24 -14
- data/vendor/v8/src/conversions.h +7 -4
- data/vendor/v8/src/counters.cc +21 -12
- data/vendor/v8/src/counters.h +44 -16
- data/vendor/v8/src/cpu-profiler.h +1 -1
- data/vendor/v8/src/d8-debug.cc +2 -2
- data/vendor/v8/src/d8-readline.cc +13 -2
- data/vendor/v8/src/d8.cc +681 -273
- data/vendor/v8/src/d8.gyp +4 -4
- data/vendor/v8/src/d8.h +38 -18
- data/vendor/v8/src/d8.js +0 -617
- data/vendor/v8/src/data-flow.h +55 -0
- data/vendor/v8/src/date.js +1 -42
- data/vendor/v8/src/dateparser-inl.h +5 -1
- data/vendor/v8/src/debug-agent.cc +10 -15
- data/vendor/v8/src/debug-debugger.js +147 -149
- data/vendor/v8/src/debug.cc +323 -164
- data/vendor/v8/src/debug.h +26 -14
- data/vendor/v8/src/deoptimizer.cc +765 -290
- data/vendor/v8/src/deoptimizer.h +130 -28
- data/vendor/v8/src/disassembler.cc +10 -4
- data/vendor/v8/src/elements-kind.cc +7 -2
- data/vendor/v8/src/elements-kind.h +19 -0
- data/vendor/v8/src/elements.cc +607 -285
- data/vendor/v8/src/elements.h +36 -13
- data/vendor/v8/src/execution.cc +52 -31
- data/vendor/v8/src/execution.h +4 -4
- data/vendor/v8/src/extensions/externalize-string-extension.cc +5 -4
- data/vendor/v8/src/extensions/gc-extension.cc +5 -1
- data/vendor/v8/src/extensions/statistics-extension.cc +153 -0
- data/vendor/v8/src/{inspector.h → extensions/statistics-extension.h} +12 -23
- data/vendor/v8/src/factory.cc +101 -134
- data/vendor/v8/src/factory.h +36 -31
- data/vendor/v8/src/flag-definitions.h +102 -25
- data/vendor/v8/src/flags.cc +9 -5
- data/vendor/v8/src/frames-inl.h +10 -0
- data/vendor/v8/src/frames.cc +116 -26
- data/vendor/v8/src/frames.h +96 -12
- data/vendor/v8/src/full-codegen.cc +219 -74
- data/vendor/v8/src/full-codegen.h +63 -21
- data/vendor/v8/src/func-name-inferrer.cc +8 -7
- data/vendor/v8/src/func-name-inferrer.h +5 -3
- data/vendor/v8/src/gdb-jit.cc +71 -57
- data/vendor/v8/src/global-handles.cc +230 -101
- data/vendor/v8/src/global-handles.h +26 -27
- data/vendor/v8/src/globals.h +17 -19
- data/vendor/v8/src/handles-inl.h +59 -12
- data/vendor/v8/src/handles.cc +180 -200
- data/vendor/v8/src/handles.h +80 -11
- data/vendor/v8/src/hashmap.h +60 -40
- data/vendor/v8/src/heap-inl.h +107 -45
- data/vendor/v8/src/heap-profiler.cc +38 -19
- data/vendor/v8/src/heap-profiler.h +24 -14
- data/vendor/v8/src/heap.cc +1123 -738
- data/vendor/v8/src/heap.h +385 -146
- data/vendor/v8/src/hydrogen-instructions.cc +700 -217
- data/vendor/v8/src/hydrogen-instructions.h +1158 -472
- data/vendor/v8/src/hydrogen.cc +3319 -1662
- data/vendor/v8/src/hydrogen.h +411 -170
- data/vendor/v8/src/ia32/assembler-ia32-inl.h +46 -16
- data/vendor/v8/src/ia32/assembler-ia32.cc +131 -61
- data/vendor/v8/src/ia32/assembler-ia32.h +115 -57
- data/vendor/v8/src/ia32/builtins-ia32.cc +99 -5
- data/vendor/v8/src/ia32/code-stubs-ia32.cc +787 -495
- data/vendor/v8/src/ia32/code-stubs-ia32.h +10 -100
- data/vendor/v8/src/ia32/codegen-ia32.cc +227 -23
- data/vendor/v8/src/ia32/codegen-ia32.h +14 -0
- data/vendor/v8/src/ia32/deoptimizer-ia32.cc +428 -87
- data/vendor/v8/src/ia32/disasm-ia32.cc +28 -1
- data/vendor/v8/src/ia32/frames-ia32.h +6 -16
- data/vendor/v8/src/ia32/full-codegen-ia32.cc +280 -272
- data/vendor/v8/src/ia32/ic-ia32.cc +150 -250
- data/vendor/v8/src/ia32/lithium-codegen-ia32.cc +1600 -517
- data/vendor/v8/src/ia32/lithium-codegen-ia32.h +90 -24
- data/vendor/v8/src/ia32/lithium-gap-resolver-ia32.cc +10 -6
- data/vendor/v8/src/ia32/lithium-gap-resolver-ia32.h +2 -2
- data/vendor/v8/src/ia32/lithium-ia32.cc +405 -302
- data/vendor/v8/src/ia32/lithium-ia32.h +526 -271
- data/vendor/v8/src/ia32/macro-assembler-ia32.cc +378 -119
- data/vendor/v8/src/ia32/macro-assembler-ia32.h +62 -28
- data/vendor/v8/src/ia32/regexp-macro-assembler-ia32.cc +43 -30
- data/vendor/v8/src/ia32/regexp-macro-assembler-ia32.h +2 -10
- data/vendor/v8/src/ia32/stub-cache-ia32.cc +492 -678
- data/vendor/v8/src/ic-inl.h +9 -4
- data/vendor/v8/src/ic.cc +836 -923
- data/vendor/v8/src/ic.h +228 -247
- data/vendor/v8/src/incremental-marking-inl.h +26 -30
- data/vendor/v8/src/incremental-marking.cc +276 -248
- data/vendor/v8/src/incremental-marking.h +29 -37
- data/vendor/v8/src/interface.cc +34 -25
- data/vendor/v8/src/interface.h +69 -25
- data/vendor/v8/src/interpreter-irregexp.cc +2 -2
- data/vendor/v8/src/isolate.cc +382 -76
- data/vendor/v8/src/isolate.h +109 -56
- data/vendor/v8/src/json-parser.h +217 -104
- data/vendor/v8/src/json-stringifier.h +745 -0
- data/vendor/v8/src/json.js +10 -132
- data/vendor/v8/src/jsregexp-inl.h +106 -0
- data/vendor/v8/src/jsregexp.cc +517 -285
- data/vendor/v8/src/jsregexp.h +145 -117
- data/vendor/v8/src/list-inl.h +35 -22
- data/vendor/v8/src/list.h +46 -19
- data/vendor/v8/src/lithium-allocator-inl.h +22 -2
- data/vendor/v8/src/lithium-allocator.cc +85 -70
- data/vendor/v8/src/lithium-allocator.h +21 -39
- data/vendor/v8/src/lithium.cc +259 -5
- data/vendor/v8/src/lithium.h +131 -32
- data/vendor/v8/src/liveedit-debugger.js +52 -3
- data/vendor/v8/src/liveedit.cc +393 -113
- data/vendor/v8/src/liveedit.h +7 -3
- data/vendor/v8/src/log-utils.cc +4 -2
- data/vendor/v8/src/log.cc +170 -140
- data/vendor/v8/src/log.h +62 -11
- data/vendor/v8/src/macro-assembler.h +17 -0
- data/vendor/v8/src/macros.py +2 -0
- data/vendor/v8/src/mark-compact-inl.h +3 -23
- data/vendor/v8/src/mark-compact.cc +801 -830
- data/vendor/v8/src/mark-compact.h +154 -47
- data/vendor/v8/src/marking-thread.cc +85 -0
- data/vendor/v8/src/{inspector.cc → marking-thread.h} +32 -24
- data/vendor/v8/src/math.js +12 -18
- data/vendor/v8/src/messages.cc +18 -8
- data/vendor/v8/src/messages.js +314 -261
- data/vendor/v8/src/mips/assembler-mips-inl.h +58 -6
- data/vendor/v8/src/mips/assembler-mips.cc +92 -75
- data/vendor/v8/src/mips/assembler-mips.h +54 -60
- data/vendor/v8/src/mips/builtins-mips.cc +116 -17
- data/vendor/v8/src/mips/code-stubs-mips.cc +919 -556
- data/vendor/v8/src/mips/code-stubs-mips.h +22 -131
- data/vendor/v8/src/mips/codegen-mips.cc +281 -6
- data/vendor/v8/src/mips/codegen-mips.h +22 -0
- data/vendor/v8/src/mips/constants-mips.cc +2 -0
- data/vendor/v8/src/mips/constants-mips.h +12 -2
- data/vendor/v8/src/mips/deoptimizer-mips.cc +286 -50
- data/vendor/v8/src/mips/disasm-mips.cc +13 -0
- data/vendor/v8/src/mips/full-codegen-mips.cc +297 -284
- data/vendor/v8/src/mips/ic-mips.cc +182 -263
- data/vendor/v8/src/mips/lithium-codegen-mips.cc +1208 -556
- data/vendor/v8/src/mips/lithium-codegen-mips.h +72 -19
- data/vendor/v8/src/mips/lithium-gap-resolver-mips.cc +9 -2
- data/vendor/v8/src/mips/lithium-mips.cc +290 -302
- data/vendor/v8/src/mips/lithium-mips.h +463 -266
- data/vendor/v8/src/mips/macro-assembler-mips.cc +208 -115
- data/vendor/v8/src/mips/macro-assembler-mips.h +67 -24
- data/vendor/v8/src/mips/regexp-macro-assembler-mips.cc +40 -25
- data/vendor/v8/src/mips/regexp-macro-assembler-mips.h +3 -9
- data/vendor/v8/src/mips/simulator-mips.cc +112 -40
- data/vendor/v8/src/mips/simulator-mips.h +5 -0
- data/vendor/v8/src/mips/stub-cache-mips.cc +502 -884
- data/vendor/v8/src/mirror-debugger.js +157 -30
- data/vendor/v8/src/mksnapshot.cc +88 -14
- data/vendor/v8/src/object-observe.js +235 -0
- data/vendor/v8/src/objects-debug.cc +178 -176
- data/vendor/v8/src/objects-inl.h +1333 -486
- data/vendor/v8/src/objects-printer.cc +125 -43
- data/vendor/v8/src/objects-visiting-inl.h +578 -6
- data/vendor/v8/src/objects-visiting.cc +2 -2
- data/vendor/v8/src/objects-visiting.h +172 -79
- data/vendor/v8/src/objects.cc +3533 -2885
- data/vendor/v8/src/objects.h +1352 -1131
- data/vendor/v8/src/optimizing-compiler-thread.cc +152 -0
- data/vendor/v8/src/optimizing-compiler-thread.h +111 -0
- data/vendor/v8/src/parser.cc +390 -500
- data/vendor/v8/src/parser.h +45 -33
- data/vendor/v8/src/platform-cygwin.cc +10 -21
- data/vendor/v8/src/platform-freebsd.cc +36 -41
- data/vendor/v8/src/platform-linux.cc +160 -124
- data/vendor/v8/src/platform-macos.cc +30 -27
- data/vendor/v8/src/platform-nullos.cc +17 -1
- data/vendor/v8/src/platform-openbsd.cc +19 -50
- data/vendor/v8/src/platform-posix.cc +14 -0
- data/vendor/v8/src/platform-solaris.cc +20 -53
- data/vendor/v8/src/platform-win32.cc +49 -26
- data/vendor/v8/src/platform.h +40 -1
- data/vendor/v8/src/preparser.cc +8 -5
- data/vendor/v8/src/preparser.h +2 -2
- data/vendor/v8/src/prettyprinter.cc +16 -0
- data/vendor/v8/src/prettyprinter.h +2 -0
- data/vendor/v8/src/profile-generator-inl.h +1 -0
- data/vendor/v8/src/profile-generator.cc +209 -147
- data/vendor/v8/src/profile-generator.h +15 -12
- data/vendor/v8/src/property-details.h +46 -31
- data/vendor/v8/src/property.cc +27 -46
- data/vendor/v8/src/property.h +163 -83
- data/vendor/v8/src/proxy.js +7 -2
- data/vendor/v8/src/regexp-macro-assembler-irregexp.cc +4 -13
- data/vendor/v8/src/regexp-macro-assembler-irregexp.h +1 -2
- data/vendor/v8/src/regexp-macro-assembler-tracer.cc +1 -11
- data/vendor/v8/src/regexp-macro-assembler-tracer.h +0 -1
- data/vendor/v8/src/regexp-macro-assembler.cc +31 -14
- data/vendor/v8/src/regexp-macro-assembler.h +14 -11
- data/vendor/v8/src/regexp-stack.cc +1 -0
- data/vendor/v8/src/regexp.js +9 -8
- data/vendor/v8/src/rewriter.cc +18 -7
- data/vendor/v8/src/runtime-profiler.cc +52 -43
- data/vendor/v8/src/runtime-profiler.h +0 -25
- data/vendor/v8/src/runtime.cc +2006 -2023
- data/vendor/v8/src/runtime.h +56 -49
- data/vendor/v8/src/safepoint-table.cc +12 -18
- data/vendor/v8/src/safepoint-table.h +11 -8
- data/vendor/v8/src/scanner.cc +1 -0
- data/vendor/v8/src/scanner.h +4 -10
- data/vendor/v8/src/scopeinfo.cc +35 -9
- data/vendor/v8/src/scopeinfo.h +64 -3
- data/vendor/v8/src/scopes.cc +251 -156
- data/vendor/v8/src/scopes.h +61 -27
- data/vendor/v8/src/serialize.cc +348 -396
- data/vendor/v8/src/serialize.h +125 -114
- data/vendor/v8/src/small-pointer-list.h +11 -11
- data/vendor/v8/src/{smart-array-pointer.h → smart-pointers.h} +64 -15
- data/vendor/v8/src/snapshot-common.cc +64 -15
- data/vendor/v8/src/snapshot-empty.cc +7 -1
- data/vendor/v8/src/snapshot.h +9 -2
- data/vendor/v8/src/spaces-inl.h +17 -0
- data/vendor/v8/src/spaces.cc +477 -183
- data/vendor/v8/src/spaces.h +238 -58
- data/vendor/v8/src/splay-tree-inl.h +8 -7
- data/vendor/v8/src/splay-tree.h +24 -10
- data/vendor/v8/src/store-buffer.cc +12 -5
- data/vendor/v8/src/store-buffer.h +2 -4
- data/vendor/v8/src/string-search.h +22 -6
- data/vendor/v8/src/string-stream.cc +11 -8
- data/vendor/v8/src/string.js +47 -15
- data/vendor/v8/src/stub-cache.cc +461 -224
- data/vendor/v8/src/stub-cache.h +164 -102
- data/vendor/v8/src/sweeper-thread.cc +105 -0
- data/vendor/v8/src/sweeper-thread.h +81 -0
- data/vendor/v8/src/token.h +1 -0
- data/vendor/v8/src/transitions-inl.h +220 -0
- data/vendor/v8/src/transitions.cc +160 -0
- data/vendor/v8/src/transitions.h +207 -0
- data/vendor/v8/src/type-info.cc +182 -181
- data/vendor/v8/src/type-info.h +31 -19
- data/vendor/v8/src/unicode-inl.h +62 -106
- data/vendor/v8/src/unicode.cc +57 -67
- data/vendor/v8/src/unicode.h +45 -91
- data/vendor/v8/src/uri.js +57 -29
- data/vendor/v8/src/utils.h +105 -5
- data/vendor/v8/src/v8-counters.cc +54 -11
- data/vendor/v8/src/v8-counters.h +134 -19
- data/vendor/v8/src/v8.cc +29 -29
- data/vendor/v8/src/v8.h +1 -0
- data/vendor/v8/src/v8conversions.cc +26 -22
- data/vendor/v8/src/v8globals.h +56 -43
- data/vendor/v8/src/v8natives.js +83 -30
- data/vendor/v8/src/v8threads.cc +42 -21
- data/vendor/v8/src/v8threads.h +4 -1
- data/vendor/v8/src/v8utils.cc +9 -93
- data/vendor/v8/src/v8utils.h +37 -33
- data/vendor/v8/src/variables.cc +6 -3
- data/vendor/v8/src/variables.h +6 -13
- data/vendor/v8/src/version.cc +2 -2
- data/vendor/v8/src/vm-state-inl.h +11 -0
- data/vendor/v8/src/x64/assembler-x64-inl.h +39 -8
- data/vendor/v8/src/x64/assembler-x64.cc +78 -64
- data/vendor/v8/src/x64/assembler-x64.h +38 -33
- data/vendor/v8/src/x64/builtins-x64.cc +105 -7
- data/vendor/v8/src/x64/code-stubs-x64.cc +790 -413
- data/vendor/v8/src/x64/code-stubs-x64.h +10 -106
- data/vendor/v8/src/x64/codegen-x64.cc +210 -8
- data/vendor/v8/src/x64/codegen-x64.h +20 -1
- data/vendor/v8/src/x64/deoptimizer-x64.cc +336 -75
- data/vendor/v8/src/x64/disasm-x64.cc +15 -0
- data/vendor/v8/src/x64/frames-x64.h +0 -14
- data/vendor/v8/src/x64/full-codegen-x64.cc +293 -270
- data/vendor/v8/src/x64/ic-x64.cc +153 -251
- data/vendor/v8/src/x64/lithium-codegen-x64.cc +1379 -531
- data/vendor/v8/src/x64/lithium-codegen-x64.h +67 -23
- data/vendor/v8/src/x64/lithium-gap-resolver-x64.cc +2 -2
- data/vendor/v8/src/x64/lithium-x64.cc +349 -289
- data/vendor/v8/src/x64/lithium-x64.h +460 -250
- data/vendor/v8/src/x64/macro-assembler-x64.cc +350 -177
- data/vendor/v8/src/x64/macro-assembler-x64.h +67 -49
- data/vendor/v8/src/x64/regexp-macro-assembler-x64.cc +46 -33
- data/vendor/v8/src/x64/regexp-macro-assembler-x64.h +2 -3
- data/vendor/v8/src/x64/stub-cache-x64.cc +484 -653
- data/vendor/v8/src/zone-inl.h +9 -27
- data/vendor/v8/src/zone.cc +5 -5
- data/vendor/v8/src/zone.h +53 -27
- data/vendor/v8/test/benchmarks/testcfg.py +5 -0
- data/vendor/v8/test/cctest/cctest.cc +4 -0
- data/vendor/v8/test/cctest/cctest.gyp +3 -1
- data/vendor/v8/test/cctest/cctest.h +57 -9
- data/vendor/v8/test/cctest/cctest.status +15 -15
- data/vendor/v8/test/cctest/test-accessors.cc +26 -0
- data/vendor/v8/test/cctest/test-alloc.cc +22 -30
- data/vendor/v8/test/cctest/test-api.cc +1943 -314
- data/vendor/v8/test/cctest/test-assembler-arm.cc +133 -13
- data/vendor/v8/test/cctest/test-assembler-ia32.cc +1 -1
- data/vendor/v8/test/cctest/test-assembler-mips.cc +12 -0
- data/vendor/v8/test/cctest/test-ast.cc +4 -2
- data/vendor/v8/test/cctest/test-compiler.cc +61 -29
- data/vendor/v8/test/cctest/test-dataflow.cc +2 -2
- data/vendor/v8/test/cctest/test-debug.cc +212 -33
- data/vendor/v8/test/cctest/test-decls.cc +257 -11
- data/vendor/v8/test/cctest/test-dictionary.cc +24 -10
- data/vendor/v8/test/cctest/test-disasm-arm.cc +118 -1
- data/vendor/v8/test/cctest/test-disasm-ia32.cc +3 -2
- data/vendor/v8/test/cctest/test-flags.cc +14 -1
- data/vendor/v8/test/cctest/test-func-name-inference.cc +7 -4
- data/vendor/v8/test/cctest/test-global-object.cc +51 -0
- data/vendor/v8/test/cctest/test-hashing.cc +32 -23
- data/vendor/v8/test/cctest/test-heap-profiler.cc +131 -77
- data/vendor/v8/test/cctest/test-heap.cc +1084 -143
- data/vendor/v8/test/cctest/test-list.cc +1 -1
- data/vendor/v8/test/cctest/test-liveedit.cc +3 -2
- data/vendor/v8/test/cctest/test-lockers.cc +12 -13
- data/vendor/v8/test/cctest/test-log.cc +10 -8
- data/vendor/v8/test/cctest/test-macro-assembler-x64.cc +2 -2
- data/vendor/v8/test/cctest/test-mark-compact.cc +44 -22
- data/vendor/v8/test/cctest/test-object-observe.cc +434 -0
- data/vendor/v8/test/cctest/test-parsing.cc +86 -39
- data/vendor/v8/test/cctest/test-platform-linux.cc +6 -0
- data/vendor/v8/test/cctest/test-platform-win32.cc +7 -0
- data/vendor/v8/test/cctest/test-random.cc +5 -4
- data/vendor/v8/test/cctest/test-regexp.cc +137 -101
- data/vendor/v8/test/cctest/test-serialize.cc +150 -230
- data/vendor/v8/test/cctest/test-sockets.cc +1 -1
- data/vendor/v8/test/cctest/test-spaces.cc +139 -0
- data/vendor/v8/test/cctest/test-strings.cc +736 -74
- data/vendor/v8/test/cctest/test-thread-termination.cc +10 -11
- data/vendor/v8/test/cctest/test-threads.cc +4 -4
- data/vendor/v8/test/cctest/test-utils.cc +16 -0
- data/vendor/v8/test/cctest/test-weakmaps.cc +7 -3
- data/vendor/v8/test/cctest/testcfg.py +64 -5
- data/vendor/v8/test/es5conform/testcfg.py +5 -0
- data/vendor/v8/test/message/message.status +1 -1
- data/vendor/v8/test/message/overwritten-builtins.out +3 -0
- data/vendor/v8/test/message/testcfg.py +89 -8
- data/vendor/v8/test/message/try-catch-finally-no-message.out +26 -26
- data/vendor/v8/test/mjsunit/accessor-map-sharing.js +18 -2
- data/vendor/v8/test/mjsunit/allocation-site-info.js +126 -0
- data/vendor/v8/test/mjsunit/array-bounds-check-removal.js +62 -1
- data/vendor/v8/test/mjsunit/array-iteration.js +1 -1
- data/vendor/v8/test/mjsunit/array-literal-transitions.js +2 -0
- data/vendor/v8/test/mjsunit/array-natives-elements.js +317 -0
- data/vendor/v8/test/mjsunit/array-reduce.js +8 -8
- data/vendor/v8/test/mjsunit/array-slice.js +12 -0
- data/vendor/v8/test/mjsunit/array-store-and-grow.js +4 -1
- data/vendor/v8/test/mjsunit/assert-opt-and-deopt.js +1 -1
- data/vendor/v8/test/mjsunit/bugs/bug-2337.js +53 -0
- data/vendor/v8/test/mjsunit/compare-known-objects-slow.js +69 -0
- data/vendor/v8/test/mjsunit/compiler/alloc-object-huge.js +3 -1
- data/vendor/v8/test/mjsunit/compiler/inline-accessors.js +368 -0
- data/vendor/v8/test/mjsunit/compiler/inline-arguments.js +87 -1
- data/vendor/v8/test/mjsunit/compiler/inline-closures.js +49 -0
- data/vendor/v8/test/mjsunit/compiler/inline-construct.js +55 -43
- data/vendor/v8/test/mjsunit/compiler/inline-literals.js +39 -0
- data/vendor/v8/test/mjsunit/compiler/multiply-add.js +69 -0
- data/vendor/v8/test/mjsunit/compiler/optimized-closures.js +57 -0
- data/vendor/v8/test/mjsunit/compiler/parallel-proto-change.js +44 -0
- data/vendor/v8/test/mjsunit/compiler/property-static.js +69 -0
- data/vendor/v8/test/mjsunit/compiler/proto-chain-constant.js +55 -0
- data/vendor/v8/test/mjsunit/compiler/proto-chain-load.js +44 -0
- data/vendor/v8/test/mjsunit/compiler/regress-gvn.js +3 -2
- data/vendor/v8/test/mjsunit/compiler/regress-or.js +6 -2
- data/vendor/v8/test/mjsunit/compiler/rotate.js +224 -0
- data/vendor/v8/test/mjsunit/compiler/uint32.js +173 -0
- data/vendor/v8/test/mjsunit/count-based-osr.js +2 -1
- data/vendor/v8/test/mjsunit/d8-os.js +3 -3
- data/vendor/v8/test/mjsunit/date-parse.js +3 -0
- data/vendor/v8/test/mjsunit/date.js +22 -0
- data/vendor/v8/test/mjsunit/debug-break-inline.js +1 -0
- data/vendor/v8/test/mjsunit/debug-evaluate-locals-optimized-double.js +22 -12
- data/vendor/v8/test/mjsunit/debug-evaluate-locals-optimized.js +21 -10
- data/vendor/v8/test/mjsunit/debug-liveedit-compile-error.js +60 -0
- data/vendor/v8/test/mjsunit/debug-liveedit-double-call.js +142 -0
- data/vendor/v8/test/mjsunit/debug-liveedit-literals.js +94 -0
- data/vendor/v8/test/mjsunit/debug-liveedit-restart-frame.js +153 -0
- data/vendor/v8/test/mjsunit/debug-multiple-breakpoints.js +1 -1
- data/vendor/v8/test/mjsunit/debug-script-breakpoints-closure.js +67 -0
- data/vendor/v8/test/mjsunit/debug-script-breakpoints-nested.js +82 -0
- data/vendor/v8/test/mjsunit/debug-script.js +4 -2
- data/vendor/v8/test/mjsunit/debug-set-variable-value.js +308 -0
- data/vendor/v8/test/mjsunit/debug-stepout-scope-part1.js +190 -0
- data/vendor/v8/test/mjsunit/debug-stepout-scope-part2.js +83 -0
- data/vendor/v8/test/mjsunit/debug-stepout-scope-part3.js +80 -0
- data/vendor/v8/test/mjsunit/debug-stepout-scope-part4.js +80 -0
- data/vendor/v8/test/mjsunit/debug-stepout-scope-part5.js +77 -0
- data/vendor/v8/test/mjsunit/debug-stepout-scope-part6.js +79 -0
- data/vendor/v8/test/mjsunit/debug-stepout-scope-part7.js +79 -0
- data/vendor/v8/test/mjsunit/{debug-stepout-scope.js → debug-stepout-scope-part8.js} +0 -189
- data/vendor/v8/test/mjsunit/delete-non-configurable.js +74 -0
- data/vendor/v8/test/mjsunit/deopt-minus-zero.js +56 -0
- data/vendor/v8/test/mjsunit/elements-kind.js +6 -4
- data/vendor/v8/test/mjsunit/elements-length-no-holey.js +33 -0
- data/vendor/v8/test/mjsunit/elements-transition-hoisting.js +46 -19
- data/vendor/v8/test/mjsunit/error-accessors.js +54 -0
- data/vendor/v8/test/mjsunit/error-constructors.js +1 -14
- data/vendor/v8/test/mjsunit/error-tostring.js +8 -0
- data/vendor/v8/test/mjsunit/eval-stack-trace.js +204 -0
- data/vendor/v8/test/mjsunit/external-array.js +364 -1
- data/vendor/v8/test/mjsunit/fast-array-length.js +37 -0
- data/vendor/v8/test/mjsunit/fast-non-keyed.js +113 -0
- data/vendor/v8/test/mjsunit/fast-prototype.js +117 -0
- data/vendor/v8/test/mjsunit/function-call.js +14 -18
- data/vendor/v8/test/mjsunit/fuzz-natives-part1.js +230 -0
- data/vendor/v8/test/mjsunit/fuzz-natives-part2.js +229 -0
- data/vendor/v8/test/mjsunit/fuzz-natives-part3.js +229 -0
- data/vendor/v8/test/mjsunit/{fuzz-natives.js → fuzz-natives-part4.js} +12 -2
- data/vendor/v8/test/mjsunit/generated-transition-stub.js +218 -0
- data/vendor/v8/test/mjsunit/greedy.js +1 -1
- data/vendor/v8/test/mjsunit/harmony/block-conflicts.js +2 -1
- data/vendor/v8/test/mjsunit/harmony/block-let-crankshaft.js +1 -1
- data/vendor/v8/test/mjsunit/harmony/collections.js +69 -11
- data/vendor/v8/test/mjsunit/harmony/debug-blockscopes.js +2 -2
- data/vendor/v8/test/mjsunit/harmony/module-linking.js +180 -3
- data/vendor/v8/test/mjsunit/harmony/module-parsing.js +31 -0
- data/vendor/v8/test/mjsunit/harmony/module-recompile.js +87 -0
- data/vendor/v8/test/mjsunit/harmony/module-resolution.js +15 -2
- data/vendor/v8/test/mjsunit/harmony/object-observe.js +1056 -0
- data/vendor/v8/test/mjsunit/harmony/proxies-json.js +178 -0
- data/vendor/v8/test/mjsunit/harmony/proxies.js +25 -10
- data/vendor/v8/test/mjsunit/json-parser-recursive.js +33 -0
- data/vendor/v8/test/mjsunit/json-stringify-recursive.js +52 -0
- data/vendor/v8/test/mjsunit/json.js +38 -2
- data/vendor/v8/test/mjsunit/json2.js +153 -0
- data/vendor/v8/test/mjsunit/limit-locals.js +5 -4
- data/vendor/v8/test/mjsunit/manual-parallel-recompile.js +79 -0
- data/vendor/v8/test/mjsunit/math-exp-precision.js +64 -0
- data/vendor/v8/test/mjsunit/math-floor-negative.js +59 -0
- data/vendor/v8/test/mjsunit/math-floor-of-div-minus-zero.js +41 -0
- data/vendor/v8/test/mjsunit/math-floor-of-div-nosudiv.js +288 -0
- data/vendor/v8/test/mjsunit/math-floor-of-div.js +81 -9
- data/vendor/v8/test/mjsunit/{math-floor.js → math-floor-part1.js} +1 -72
- data/vendor/v8/test/mjsunit/math-floor-part2.js +76 -0
- data/vendor/v8/test/mjsunit/math-floor-part3.js +78 -0
- data/vendor/v8/test/mjsunit/math-floor-part4.js +76 -0
- data/vendor/v8/test/mjsunit/mirror-object.js +43 -9
- data/vendor/v8/test/mjsunit/mjsunit.js +1 -1
- data/vendor/v8/test/mjsunit/mjsunit.status +52 -27
- data/vendor/v8/test/mjsunit/mul-exhaustive-part1.js +491 -0
- data/vendor/v8/test/mjsunit/mul-exhaustive-part10.js +470 -0
- data/vendor/v8/test/mjsunit/mul-exhaustive-part2.js +525 -0
- data/vendor/v8/test/mjsunit/mul-exhaustive-part3.js +532 -0
- data/vendor/v8/test/mjsunit/mul-exhaustive-part4.js +509 -0
- data/vendor/v8/test/mjsunit/mul-exhaustive-part5.js +505 -0
- data/vendor/v8/test/mjsunit/mul-exhaustive-part6.js +554 -0
- data/vendor/v8/test/mjsunit/mul-exhaustive-part7.js +497 -0
- data/vendor/v8/test/mjsunit/mul-exhaustive-part8.js +526 -0
- data/vendor/v8/test/mjsunit/mul-exhaustive-part9.js +533 -0
- data/vendor/v8/test/mjsunit/new-function.js +34 -0
- data/vendor/v8/test/mjsunit/numops-fuzz-part1.js +1172 -0
- data/vendor/v8/test/mjsunit/numops-fuzz-part2.js +1178 -0
- data/vendor/v8/test/mjsunit/numops-fuzz-part3.js +1178 -0
- data/vendor/v8/test/mjsunit/numops-fuzz-part4.js +1177 -0
- data/vendor/v8/test/mjsunit/object-define-property.js +107 -2
- data/vendor/v8/test/mjsunit/override-read-only-property.js +6 -4
- data/vendor/v8/test/mjsunit/packed-elements.js +2 -2
- data/vendor/v8/test/mjsunit/parse-int-float.js +4 -4
- data/vendor/v8/test/mjsunit/pixel-array-rounding.js +1 -1
- data/vendor/v8/test/mjsunit/readonly.js +228 -0
- data/vendor/v8/test/mjsunit/regexp-capture-3.js +16 -18
- data/vendor/v8/test/mjsunit/regexp-capture.js +2 -0
- data/vendor/v8/test/mjsunit/regexp-global.js +122 -0
- data/vendor/v8/test/mjsunit/regexp-results-cache.js +78 -0
- data/vendor/v8/test/mjsunit/regress/regress-1117.js +12 -3
- data/vendor/v8/test/mjsunit/regress/regress-1118.js +1 -1
- data/vendor/v8/test/mjsunit/regress/regress-115100.js +36 -0
- data/vendor/v8/test/mjsunit/regress/regress-1199637.js +1 -3
- data/vendor/v8/test/mjsunit/regress/regress-121407.js +1 -1
- data/vendor/v8/test/mjsunit/regress/regress-131923.js +30 -0
- data/vendor/v8/test/mjsunit/regress/regress-131994.js +70 -0
- data/vendor/v8/test/mjsunit/regress/regress-133211.js +35 -0
- data/vendor/v8/test/mjsunit/regress/regress-133211b.js +39 -0
- data/vendor/v8/test/mjsunit/regress/regress-136048.js +34 -0
- data/vendor/v8/test/mjsunit/regress/regress-137768.js +73 -0
- data/vendor/v8/test/mjsunit/regress/regress-143967.js +34 -0
- data/vendor/v8/test/mjsunit/regress/regress-145201.js +107 -0
- data/vendor/v8/test/mjsunit/regress/regress-147497.js +45 -0
- data/vendor/v8/test/mjsunit/regress/regress-148378.js +38 -0
- data/vendor/v8/test/mjsunit/regress/regress-1563.js +1 -1
- data/vendor/v8/test/mjsunit/regress/regress-1591.js +48 -0
- data/vendor/v8/test/mjsunit/regress/regress-164442.js +45 -0
- data/vendor/v8/test/mjsunit/regress/regress-165637.js +61 -0
- data/vendor/v8/test/mjsunit/regress/regress-166379.js +39 -0
- data/vendor/v8/test/mjsunit/regress/regress-166553.js +33 -0
- data/vendor/v8/test/mjsunit/regress/regress-1692.js +1 -1
- data/vendor/v8/test/mjsunit/regress/regress-171641.js +40 -0
- data/vendor/v8/test/mjsunit/regress/regress-1980.js +1 -1
- data/vendor/v8/test/mjsunit/regress/regress-2073.js +99 -0
- data/vendor/v8/test/mjsunit/regress/regress-2119.js +36 -0
- data/vendor/v8/test/mjsunit/regress/regress-2156.js +39 -0
- data/vendor/v8/test/mjsunit/regress/regress-2163.js +70 -0
- data/vendor/v8/test/mjsunit/regress/regress-2170.js +58 -0
- data/vendor/v8/test/mjsunit/regress/regress-2172.js +35 -0
- data/vendor/v8/test/mjsunit/regress/regress-2185-2.js +145 -0
- data/vendor/v8/test/mjsunit/regress/regress-2185.js +38 -0
- data/vendor/v8/test/mjsunit/regress/regress-2186.js +49 -0
- data/vendor/v8/test/mjsunit/regress/regress-2193.js +58 -0
- data/vendor/v8/test/mjsunit/regress/regress-2219.js +32 -0
- data/vendor/v8/test/mjsunit/regress/regress-2225.js +65 -0
- data/vendor/v8/test/mjsunit/regress/regress-2226.js +36 -0
- data/vendor/v8/test/mjsunit/regress/regress-2234.js +41 -0
- data/vendor/v8/test/mjsunit/regress/regress-2243.js +31 -0
- data/vendor/v8/test/mjsunit/regress/regress-2249.js +33 -0
- data/vendor/v8/test/mjsunit/regress/regress-2250.js +68 -0
- data/vendor/v8/test/mjsunit/regress/regress-2261.js +113 -0
- data/vendor/v8/test/mjsunit/regress/regress-2263.js +30 -0
- data/vendor/v8/test/mjsunit/regress/regress-2284.js +32 -0
- data/vendor/v8/test/mjsunit/regress/regress-2285.js +32 -0
- data/vendor/v8/test/mjsunit/regress/regress-2286.js +32 -0
- data/vendor/v8/test/mjsunit/regress/regress-2289.js +34 -0
- data/vendor/v8/test/mjsunit/regress/regress-2291.js +36 -0
- data/vendor/v8/test/mjsunit/regress/regress-2294.js +70 -0
- data/vendor/v8/test/mjsunit/regress/regress-2296.js +40 -0
- data/vendor/v8/test/mjsunit/regress/regress-2315.js +40 -0
- data/vendor/v8/test/mjsunit/regress/regress-2318.js +66 -0
- data/vendor/v8/test/mjsunit/regress/regress-2322.js +36 -0
- data/vendor/v8/test/mjsunit/regress/regress-2326.js +54 -0
- data/vendor/v8/test/mjsunit/regress/regress-2336.js +53 -0
- data/vendor/v8/test/mjsunit/regress/regress-2339.js +59 -0
- data/vendor/v8/test/mjsunit/regress/regress-2346.js +123 -0
- data/vendor/v8/test/mjsunit/regress/regress-2373.js +29 -0
- data/vendor/v8/test/mjsunit/regress/regress-2374.js +33 -0
- data/vendor/v8/test/mjsunit/regress/regress-2398.js +41 -0
- data/vendor/v8/test/mjsunit/regress/regress-2410.js +36 -0
- data/vendor/v8/test/mjsunit/regress/regress-2416.js +75 -0
- data/vendor/v8/test/mjsunit/regress/regress-2419.js +37 -0
- data/vendor/v8/test/mjsunit/regress/regress-2433.js +36 -0
- data/vendor/v8/test/mjsunit/regress/regress-2437.js +156 -0
- data/vendor/v8/test/mjsunit/regress/regress-2438.js +52 -0
- data/vendor/v8/test/mjsunit/regress/regress-2443.js +129 -0
- data/vendor/v8/test/mjsunit/regress/regress-2444.js +120 -0
- data/vendor/v8/test/mjsunit/regress/regress-2489.js +50 -0
- data/vendor/v8/test/mjsunit/regress/regress-2499.js +40 -0
- data/vendor/v8/test/mjsunit/regress/regress-334.js +1 -1
- data/vendor/v8/test/mjsunit/regress/regress-492.js +39 -1
- data/vendor/v8/test/mjsunit/regress/regress-builtin-array-op.js +38 -0
- data/vendor/v8/test/mjsunit/regress/regress-cnlt-elements.js +43 -0
- data/vendor/v8/test/mjsunit/regress/regress-cnlt-enum-indices.js +45 -0
- data/vendor/v8/test/mjsunit/regress/regress-cntl-descriptors-enum.js +46 -0
- data/vendor/v8/test/mjsunit/regress/regress-convert-enum.js +60 -0
- data/vendor/v8/test/mjsunit/regress/regress-convert-enum2.js +46 -0
- data/vendor/v8/test/mjsunit/regress/regress-convert-transition.js +40 -0
- data/vendor/v8/test/mjsunit/regress/regress-crbug-119926.js +3 -1
- data/vendor/v8/test/mjsunit/regress/regress-crbug-125148.js +90 -0
- data/vendor/v8/test/mjsunit/regress/regress-crbug-134055.js +63 -0
- data/vendor/v8/test/mjsunit/regress/regress-crbug-134609.js +59 -0
- data/vendor/v8/test/mjsunit/regress/regress-crbug-135008.js +45 -0
- data/vendor/v8/test/mjsunit/regress/regress-crbug-135066.js +55 -0
- data/vendor/v8/test/mjsunit/regress/regress-crbug-137689.js +47 -0
- data/vendor/v8/test/mjsunit/regress/regress-crbug-138887.js +48 -0
- data/vendor/v8/test/mjsunit/regress/regress-crbug-140083.js +44 -0
- data/vendor/v8/test/mjsunit/regress/regress-crbug-142087.js +38 -0
- data/vendor/v8/test/mjsunit/regress/regress-crbug-142218.js +44 -0
- data/vendor/v8/test/mjsunit/regress/regress-crbug-145961.js +39 -0
- data/vendor/v8/test/mjsunit/regress/regress-crbug-146910.js +33 -0
- data/vendor/v8/test/mjsunit/regress/regress-crbug-147475.js +48 -0
- data/vendor/v8/test/mjsunit/regress/regress-crbug-148376.js +35 -0
- data/vendor/v8/test/mjsunit/regress/regress-crbug-150545.js +53 -0
- data/vendor/v8/test/mjsunit/regress/regress-crbug-150729.js +39 -0
- data/vendor/v8/test/mjsunit/regress/regress-crbug-157019.js +54 -0
- data/vendor/v8/test/mjsunit/regress/regress-crbug-157520.js +38 -0
- data/vendor/v8/test/mjsunit/regress/regress-crbug-158185.js +39 -0
- data/vendor/v8/test/mjsunit/regress/regress-crbug-160010.js +35 -0
- data/vendor/v8/test/mjsunit/regress/regress-crbug-162085.js +71 -0
- data/vendor/v8/test/mjsunit/regress/regress-crbug-168545.js +34 -0
- data/vendor/v8/test/mjsunit/regress/regress-crbug-170856.js +33 -0
- data/vendor/v8/test/mjsunit/regress/regress-crbug-172345.js +34 -0
- data/vendor/v8/test/mjsunit/regress/regress-crbug-173974.js +36 -0
- data/vendor/v8/test/mjsunit/regress/regress-crbug-18639.js +9 -5
- data/vendor/v8/test/mjsunit/regress/regress-debug-code-recompilation.js +2 -1
- data/vendor/v8/test/mjsunit/regress/regress-deep-proto.js +45 -0
- data/vendor/v8/test/mjsunit/regress/regress-delete-empty-double.js +40 -0
- data/vendor/v8/test/mjsunit/regress/regress-iteration-order.js +42 -0
- data/vendor/v8/test/mjsunit/regress/regress-json-stringify-gc.js +41 -0
- data/vendor/v8/test/mjsunit/regress/regress-latin-1.js +78 -0
- data/vendor/v8/test/mjsunit/regress/regress-load-elements.js +49 -0
- data/vendor/v8/test/mjsunit/regress/regress-observe-empty-double-array.js +38 -0
- data/vendor/v8/test/mjsunit/regress/regress-undefined-store-keyed-fast-element.js +37 -0
- data/vendor/v8/test/mjsunit/shift-for-integer-div.js +59 -0
- data/vendor/v8/test/mjsunit/stack-traces-gc.js +119 -0
- data/vendor/v8/test/mjsunit/stack-traces-overflow.js +122 -0
- data/vendor/v8/test/mjsunit/stack-traces.js +39 -1
- data/vendor/v8/test/mjsunit/str-to-num.js +7 -2
- data/vendor/v8/test/mjsunit/strict-mode.js +36 -11
- data/vendor/v8/test/mjsunit/string-charcodeat.js +3 -0
- data/vendor/v8/test/mjsunit/string-natives.js +72 -0
- data/vendor/v8/test/mjsunit/string-split.js +17 -0
- data/vendor/v8/test/mjsunit/testcfg.py +76 -6
- data/vendor/v8/test/mjsunit/tools/tickprocessor.js +4 -1
- data/vendor/v8/test/mjsunit/try-finally-continue.js +72 -0
- data/vendor/v8/test/mjsunit/typed-array-slice.js +61 -0
- data/vendor/v8/test/mjsunit/unbox-double-arrays.js +2 -0
- data/vendor/v8/test/mjsunit/uri.js +12 -0
- data/vendor/v8/test/mjsunit/with-readonly.js +4 -2
- data/vendor/v8/test/mozilla/mozilla.status +19 -113
- data/vendor/v8/test/mozilla/testcfg.py +122 -3
- data/vendor/v8/test/preparser/preparser.status +5 -0
- data/vendor/v8/test/preparser/strict-identifiers.pyt +1 -1
- data/vendor/v8/test/preparser/testcfg.py +101 -5
- data/vendor/v8/test/sputnik/sputnik.status +1 -1
- data/vendor/v8/test/sputnik/testcfg.py +5 -0
- data/vendor/v8/test/test262/README +2 -2
- data/vendor/v8/test/test262/test262.status +13 -36
- data/vendor/v8/test/test262/testcfg.py +102 -8
- data/vendor/v8/tools/android-build.sh +0 -0
- data/vendor/v8/tools/android-ll-prof.sh +69 -0
- data/vendor/v8/tools/android-run.py +109 -0
- data/vendor/v8/tools/android-sync.sh +105 -0
- data/vendor/v8/tools/bash-completion.sh +0 -0
- data/vendor/v8/tools/check-static-initializers.sh +0 -0
- data/vendor/v8/tools/common-includes.sh +15 -22
- data/vendor/v8/tools/disasm.py +4 -4
- data/vendor/v8/tools/fuzz-harness.sh +0 -0
- data/vendor/v8/tools/gen-postmortem-metadata.py +6 -8
- data/vendor/v8/tools/grokdump.py +404 -129
- data/vendor/v8/tools/gyp/v8.gyp +105 -43
- data/vendor/v8/tools/linux-tick-processor +5 -5
- data/vendor/v8/tools/ll_prof.py +75 -15
- data/vendor/v8/tools/merge-to-branch.sh +2 -2
- data/vendor/v8/tools/plot-timer-events +70 -0
- data/vendor/v8/tools/plot-timer-events.js +510 -0
- data/vendor/v8/tools/presubmit.py +1 -0
- data/vendor/v8/tools/push-to-trunk.sh +14 -4
- data/vendor/v8/tools/run-llprof.sh +69 -0
- data/vendor/v8/tools/run-tests.py +372 -0
- data/vendor/v8/tools/run-valgrind.py +1 -1
- data/vendor/v8/tools/status-file-converter.py +39 -0
- data/vendor/v8/tools/test-server.py +224 -0
- data/vendor/v8/tools/test-wrapper-gypbuild.py +13 -16
- data/vendor/v8/tools/test.py +10 -19
- data/vendor/v8/tools/testrunner/README +174 -0
- data/vendor/v8/tools/testrunner/__init__.py +26 -0
- data/vendor/v8/tools/testrunner/local/__init__.py +26 -0
- data/vendor/v8/tools/testrunner/local/commands.py +153 -0
- data/vendor/v8/tools/testrunner/local/execution.py +182 -0
- data/vendor/v8/tools/testrunner/local/old_statusfile.py +460 -0
- data/vendor/v8/tools/testrunner/local/progress.py +238 -0
- data/vendor/v8/tools/testrunner/local/statusfile.py +145 -0
- data/vendor/v8/tools/testrunner/local/testsuite.py +187 -0
- data/vendor/v8/tools/testrunner/local/utils.py +108 -0
- data/vendor/v8/tools/testrunner/local/verbose.py +99 -0
- data/vendor/v8/tools/testrunner/network/__init__.py +26 -0
- data/vendor/v8/tools/testrunner/network/distro.py +90 -0
- data/vendor/v8/tools/testrunner/network/endpoint.py +124 -0
- data/vendor/v8/tools/testrunner/network/network_execution.py +253 -0
- data/vendor/v8/tools/testrunner/network/perfdata.py +120 -0
- data/vendor/v8/tools/testrunner/objects/__init__.py +26 -0
- data/vendor/v8/tools/testrunner/objects/context.py +50 -0
- data/vendor/v8/tools/testrunner/objects/output.py +60 -0
- data/vendor/v8/tools/testrunner/objects/peer.py +80 -0
- data/vendor/v8/tools/testrunner/objects/testcase.py +83 -0
- data/vendor/v8/tools/testrunner/objects/workpacket.py +90 -0
- data/vendor/v8/tools/testrunner/server/__init__.py +26 -0
- data/vendor/v8/tools/testrunner/server/compression.py +111 -0
- data/vendor/v8/tools/testrunner/server/constants.py +51 -0
- data/vendor/v8/tools/testrunner/server/daemon.py +147 -0
- data/vendor/v8/tools/testrunner/server/local_handler.py +119 -0
- data/vendor/v8/tools/testrunner/server/main.py +245 -0
- data/vendor/v8/tools/testrunner/server/presence_handler.py +120 -0
- data/vendor/v8/tools/testrunner/server/signatures.py +63 -0
- data/vendor/v8/tools/testrunner/server/status_handler.py +112 -0
- data/vendor/v8/tools/testrunner/server/work_handler.py +150 -0
- data/vendor/v8/tools/tick-processor.html +168 -0
- data/vendor/v8/tools/tickprocessor-driver.js +5 -3
- data/vendor/v8/tools/tickprocessor.js +58 -15
- metadata +534 -30
- data/patches/add-freebsd9-and-freebsd10-to-gyp-GetFlavor.patch +0 -11
- data/patches/do-not-imply-vfp3-and-armv7.patch +0 -44
- data/patches/fPIC-on-x64.patch +0 -14
- data/vendor/v8/src/liveobjectlist-inl.h +0 -126
- data/vendor/v8/src/liveobjectlist.cc +0 -2631
- data/vendor/v8/src/liveobjectlist.h +0 -319
- data/vendor/v8/test/mjsunit/mul-exhaustive.js +0 -4629
- data/vendor/v8/test/mjsunit/numops-fuzz.js +0 -4609
- data/vendor/v8/test/mjsunit/regress/regress-1969.js +0 -5045
@@ -35,18 +35,6 @@
|
|
35
35
|
namespace v8 {
|
36
36
|
namespace internal {
|
37
37
|
|
38
|
-
// Flags used for the AllocateInNewSpace functions.
|
39
|
-
enum AllocationFlags {
|
40
|
-
// No special flags.
|
41
|
-
NO_ALLOCATION_FLAGS = 0,
|
42
|
-
// Return the pointer to the allocated already tagged as a heap object.
|
43
|
-
TAG_OBJECT = 1 << 0,
|
44
|
-
// The content of the result register already contains the allocation top in
|
45
|
-
// new space.
|
46
|
-
RESULT_CONTAINS_TOP = 1 << 1
|
47
|
-
};
|
48
|
-
|
49
|
-
|
50
38
|
// Convenience for platform-independent signatures. We do not normally
|
51
39
|
// distinguish memory operands from other operands on ia32.
|
52
40
|
typedef Operand MemOperand;
|
@@ -55,6 +43,12 @@ enum RememberedSetAction { EMIT_REMEMBERED_SET, OMIT_REMEMBERED_SET };
|
|
55
43
|
enum SmiCheck { INLINE_SMI_CHECK, OMIT_SMI_CHECK };
|
56
44
|
|
57
45
|
|
46
|
+
enum RegisterValueType {
|
47
|
+
REGISTER_VALUE_IS_SMI,
|
48
|
+
REGISTER_VALUE_IS_INT32
|
49
|
+
};
|
50
|
+
|
51
|
+
|
58
52
|
bool AreAliased(Register r1, Register r2, Register r3, Register r4);
|
59
53
|
|
60
54
|
|
@@ -90,6 +84,13 @@ class MacroAssembler: public Assembler {
|
|
90
84
|
Label* condition_met,
|
91
85
|
Label::Distance condition_met_distance = Label::kFar);
|
92
86
|
|
87
|
+
void CheckPageFlagForMap(
|
88
|
+
Handle<Map> map,
|
89
|
+
int mask,
|
90
|
+
Condition cc,
|
91
|
+
Label* condition_met,
|
92
|
+
Label::Distance condition_met_distance = Label::kFar);
|
93
|
+
|
93
94
|
// Check if object is in new space. Jumps if the object is not in new space.
|
94
95
|
// The register scratch can be object itself, but scratch will be clobbered.
|
95
96
|
void JumpIfNotInNewSpace(Register object,
|
@@ -194,6 +195,16 @@ class MacroAssembler: public Assembler {
|
|
194
195
|
RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET,
|
195
196
|
SmiCheck smi_check = INLINE_SMI_CHECK);
|
196
197
|
|
198
|
+
// For page containing |object| mark the region covering the object's map
|
199
|
+
// dirty. |object| is the object being stored into, |map| is the Map object
|
200
|
+
// that was stored.
|
201
|
+
void RecordWriteForMap(
|
202
|
+
Register object,
|
203
|
+
Handle<Map> map,
|
204
|
+
Register scratch1,
|
205
|
+
Register scratch2,
|
206
|
+
SaveFPRegsMode save_fp);
|
207
|
+
|
197
208
|
#ifdef ENABLE_DEBUGGER_SUPPORT
|
198
209
|
// ---------------------------------------------------------------------------
|
199
210
|
// Debugger Support
|
@@ -222,8 +233,8 @@ class MacroAssembler: public Assembler {
|
|
222
233
|
void LoadContext(Register dst, int context_chain_length);
|
223
234
|
|
224
235
|
// Conditionally load the cached Array transitioned map of type
|
225
|
-
// transitioned_kind from the
|
226
|
-
// map_in_out is the cached Array map in the
|
236
|
+
// transitioned_kind from the native context if the map in register
|
237
|
+
// map_in_out is the cached Array map in the native context of
|
227
238
|
// expected_kind.
|
228
239
|
void LoadTransitionedArrayMapConditional(
|
229
240
|
ElementsKind expected_kind,
|
@@ -371,7 +382,8 @@ class MacroAssembler: public Assembler {
|
|
371
382
|
Register scratch1,
|
372
383
|
XMMRegister scratch2,
|
373
384
|
Label* fail,
|
374
|
-
bool specialize_for_processor
|
385
|
+
bool specialize_for_processor,
|
386
|
+
int offset = 0);
|
375
387
|
|
376
388
|
// Compare an object's map with the specified map and its transitioned
|
377
389
|
// elements maps if mode is ALLOW_ELEMENT_TRANSITION_MAPS. FLAGS are set with
|
@@ -450,6 +462,8 @@ class MacroAssembler: public Assembler {
|
|
450
462
|
j(not_carry, is_smi);
|
451
463
|
}
|
452
464
|
|
465
|
+
void LoadUint32(XMMRegister dst, Register src, XMMRegister scratch);
|
466
|
+
|
453
467
|
// Jump the register contains a smi.
|
454
468
|
inline void JumpIfSmi(Register value,
|
455
469
|
Label* smi_label,
|
@@ -473,20 +487,29 @@ class MacroAssembler: public Assembler {
|
|
473
487
|
}
|
474
488
|
|
475
489
|
void LoadInstanceDescriptors(Register map, Register descriptors);
|
476
|
-
|
490
|
+
void EnumLength(Register dst, Register map);
|
491
|
+
void NumberOfOwnDescriptors(Register dst, Register map);
|
492
|
+
|
493
|
+
template<typename Field>
|
494
|
+
void DecodeField(Register reg) {
|
495
|
+
static const int shift = Field::kShift;
|
496
|
+
static const int mask = (Field::kMask >> Field::kShift) << kSmiTagSize;
|
497
|
+
sar(reg, shift);
|
498
|
+
and_(reg, Immediate(mask));
|
499
|
+
}
|
477
500
|
void LoadPowerOf2(XMMRegister dst, Register scratch, int power);
|
478
501
|
|
479
|
-
// Abort execution if argument is not a number
|
480
|
-
void
|
502
|
+
// Abort execution if argument is not a number, enabled via --debug-code.
|
503
|
+
void AssertNumber(Register object);
|
481
504
|
|
482
|
-
// Abort execution if argument is not a smi
|
483
|
-
void
|
505
|
+
// Abort execution if argument is not a smi, enabled via --debug-code.
|
506
|
+
void AssertSmi(Register object);
|
484
507
|
|
485
|
-
// Abort execution if argument is a smi
|
486
|
-
void
|
508
|
+
// Abort execution if argument is a smi, enabled via --debug-code.
|
509
|
+
void AssertNotSmi(Register object);
|
487
510
|
|
488
|
-
// Abort execution if argument is a string
|
489
|
-
void
|
511
|
+
// Abort execution if argument is not a string, enabled via --debug-code.
|
512
|
+
void AssertString(Register object);
|
490
513
|
|
491
514
|
// ---------------------------------------------------------------------------
|
492
515
|
// Exception handling
|
@@ -547,6 +570,7 @@ class MacroAssembler: public Assembler {
|
|
547
570
|
void AllocateInNewSpace(int header_size,
|
548
571
|
ScaleFactor element_size,
|
549
572
|
Register element_count,
|
573
|
+
RegisterValueType element_count_type,
|
550
574
|
Register result,
|
551
575
|
Register result_end,
|
552
576
|
Register scratch,
|
@@ -671,7 +695,7 @@ class MacroAssembler: public Assembler {
|
|
671
695
|
// Runtime calls
|
672
696
|
|
673
697
|
// Call a code stub. Generate the code if necessary.
|
674
|
-
void CallStub(CodeStub* stub,
|
698
|
+
void CallStub(CodeStub* stub, TypeFeedbackId ast_id = TypeFeedbackId::None());
|
675
699
|
|
676
700
|
// Tail call a code stub (jump). Generate the code if necessary.
|
677
701
|
void TailCallStub(CodeStub* stub);
|
@@ -760,6 +784,7 @@ class MacroAssembler: public Assembler {
|
|
760
784
|
|
761
785
|
// Push a handle value.
|
762
786
|
void Push(Handle<Object> handle) { push(Immediate(handle)); }
|
787
|
+
void Push(Smi* smi) { Push(Handle<Smi>(smi)); }
|
763
788
|
|
764
789
|
Handle<Object> CodeObject() {
|
765
790
|
ASSERT(!code_object_.is_null());
|
@@ -834,6 +859,15 @@ class MacroAssembler: public Assembler {
|
|
834
859
|
// in eax. Assumes that any other register can be used as a scratch.
|
835
860
|
void CheckEnumCache(Label* call_runtime);
|
836
861
|
|
862
|
+
// AllocationSiteInfo support. Arrays may have an associated
|
863
|
+
// AllocationSiteInfo object that can be checked for in order to pretransition
|
864
|
+
// to another type.
|
865
|
+
// On entry, receiver_reg should point to the array object.
|
866
|
+
// scratch_reg gets clobbered.
|
867
|
+
// If allocation info is present, conditional code is set to equal
|
868
|
+
void TestJSArrayForAllocationSiteInfo(Register receiver_reg,
|
869
|
+
Register scratch_reg);
|
870
|
+
|
837
871
|
private:
|
838
872
|
bool generating_stub_;
|
839
873
|
bool allow_stub_calls_;
|
@@ -894,9 +928,9 @@ class MacroAssembler: public Assembler {
|
|
894
928
|
Operand SafepointRegisterSlot(Register reg);
|
895
929
|
static int SafepointRegisterStackIndex(int reg_code);
|
896
930
|
|
897
|
-
// Needs access to SafepointRegisterStackIndex for
|
931
|
+
// Needs access to SafepointRegisterStackIndex for compiled frame
|
898
932
|
// traversal.
|
899
|
-
friend class
|
933
|
+
friend class StandardFrame;
|
900
934
|
};
|
901
935
|
|
902
936
|
|
@@ -944,7 +978,7 @@ inline Operand ContextOperand(Register context, int index) {
|
|
944
978
|
|
945
979
|
|
946
980
|
inline Operand GlobalObjectOperand() {
|
947
|
-
return ContextOperand(esi, Context::
|
981
|
+
return ContextOperand(esi, Context::GLOBAL_OBJECT_INDEX);
|
948
982
|
}
|
949
983
|
|
950
984
|
|
@@ -101,8 +101,10 @@ namespace internal {
|
|
101
101
|
|
102
102
|
RegExpMacroAssemblerIA32::RegExpMacroAssemblerIA32(
|
103
103
|
Mode mode,
|
104
|
-
int registers_to_save
|
105
|
-
|
104
|
+
int registers_to_save,
|
105
|
+
Zone* zone)
|
106
|
+
: NativeRegExpMacroAssembler(zone),
|
107
|
+
masm_(new MacroAssembler(Isolate::Current(), NULL, kRegExpCodeSize)),
|
106
108
|
mode_(mode),
|
107
109
|
num_registers_(registers_to_save),
|
108
110
|
num_saved_registers_(registers_to_save),
|
@@ -215,7 +217,7 @@ void RegExpMacroAssemblerIA32::CheckCharacters(Vector<const uc16> str,
|
|
215
217
|
// If input is ASCII, don't even bother calling here if the string to
|
216
218
|
// match contains a non-ASCII character.
|
217
219
|
if (mode_ == ASCII) {
|
218
|
-
ASSERT(String::
|
220
|
+
ASSERT(String::IsOneByte(str.start(), str.length()));
|
219
221
|
}
|
220
222
|
#endif
|
221
223
|
int byte_length = str.length() * char_size();
|
@@ -314,6 +316,11 @@ void RegExpMacroAssemblerIA32::CheckNotBackReferenceIgnoreCase(
|
|
314
316
|
// uncaptured. In either case succeed immediately.
|
315
317
|
__ j(equal, &fallthrough);
|
316
318
|
|
319
|
+
// Check that there are sufficient characters left in the input.
|
320
|
+
__ mov(eax, edi);
|
321
|
+
__ add(eax, ebx);
|
322
|
+
BranchOrBacktrack(greater, on_no_match);
|
323
|
+
|
317
324
|
if (mode_ == ASCII) {
|
318
325
|
Label success;
|
319
326
|
Label fail;
|
@@ -337,7 +344,19 @@ void RegExpMacroAssemblerIA32::CheckNotBackReferenceIgnoreCase(
|
|
337
344
|
__ or_(eax, 0x20); // Convert match character to lower-case.
|
338
345
|
__ lea(ecx, Operand(eax, -'a'));
|
339
346
|
__ cmp(ecx, static_cast<int32_t>('z' - 'a')); // Is eax a lowercase letter?
|
340
|
-
|
347
|
+
#ifndef ENABLE_LATIN_1
|
348
|
+
__ j(above, &fail); // Weren't letters anyway.
|
349
|
+
#else
|
350
|
+
Label convert_capture;
|
351
|
+
__ j(below_equal, &convert_capture); // In range 'a'-'z'.
|
352
|
+
// Latin-1: Check for values in range [224,254] but not 247.
|
353
|
+
__ sub(ecx, Immediate(224 - 'a'));
|
354
|
+
__ cmp(ecx, Immediate(254 - 224));
|
355
|
+
__ j(above, &fail); // Weren't Latin-1 letters.
|
356
|
+
__ cmp(ecx, Immediate(247 - 224)); // Check for 247.
|
357
|
+
__ j(equal, &fail);
|
358
|
+
__ bind(&convert_capture);
|
359
|
+
#endif
|
341
360
|
// Also convert capture character.
|
342
361
|
__ movzx_b(ecx, Operand(edx, 0));
|
343
362
|
__ or_(ecx, 0x20);
|
@@ -485,15 +504,6 @@ void RegExpMacroAssemblerIA32::CheckNotBackReference(
|
|
485
504
|
}
|
486
505
|
|
487
506
|
|
488
|
-
void RegExpMacroAssemblerIA32::CheckNotRegistersEqual(int reg1,
|
489
|
-
int reg2,
|
490
|
-
Label* on_not_equal) {
|
491
|
-
__ mov(eax, register_location(reg1));
|
492
|
-
__ cmp(eax, register_location(reg2));
|
493
|
-
BranchOrBacktrack(not_equal, on_not_equal);
|
494
|
-
}
|
495
|
-
|
496
|
-
|
497
507
|
void RegExpMacroAssemblerIA32::CheckNotCharacter(uint32_t c,
|
498
508
|
Label* on_not_equal) {
|
499
509
|
__ cmp(current_character(), c);
|
@@ -571,7 +581,7 @@ void RegExpMacroAssemblerIA32::CheckBitInTable(
|
|
571
581
|
Label* on_bit_set) {
|
572
582
|
__ mov(eax, Immediate(table));
|
573
583
|
Register index = current_character();
|
574
|
-
if (mode_ != ASCII || kTableMask != String::
|
584
|
+
if (mode_ != ASCII || kTableMask != String::kMaxOneByteCharCode) {
|
575
585
|
__ mov(ebx, kTableSize - 1);
|
576
586
|
__ and_(ebx, current_character());
|
577
587
|
index = ebx;
|
@@ -857,7 +867,7 @@ Handle<HeapObject> RegExpMacroAssemblerIA32::GetCode(Handle<String> source) {
|
|
857
867
|
}
|
858
868
|
for (int i = 0; i < num_saved_registers_; i++) {
|
859
869
|
__ mov(eax, register_location(i));
|
860
|
-
if (i == 0 &&
|
870
|
+
if (i == 0 && global_with_zero_length_check()) {
|
861
871
|
// Keep capture start in edx for the zero-length check later.
|
862
872
|
__ mov(edx, eax);
|
863
873
|
}
|
@@ -890,20 +900,23 @@ Handle<HeapObject> RegExpMacroAssemblerIA32::GetCode(Handle<String> source) {
|
|
890
900
|
// Prepare eax to initialize registers with its value in the next run.
|
891
901
|
__ mov(eax, Operand(ebp, kInputStartMinusOne));
|
892
902
|
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
903
|
+
if (global_with_zero_length_check()) {
|
904
|
+
// Special case for zero-length matches.
|
905
|
+
// edx: capture start index
|
906
|
+
__ cmp(edi, edx);
|
907
|
+
// Not a zero-length match, restart.
|
908
|
+
__ j(not_equal, &load_char_start_regexp);
|
909
|
+
// edi (offset from the end) is zero if we already reached the end.
|
910
|
+
__ test(edi, edi);
|
911
|
+
__ j(zero, &exit_label_, Label::kNear);
|
912
|
+
// Advance current position after a zero-length match.
|
913
|
+
if (mode_ == UC16) {
|
914
|
+
__ add(edi, Immediate(2));
|
915
|
+
} else {
|
916
|
+
__ inc(edi);
|
917
|
+
}
|
906
918
|
}
|
919
|
+
|
907
920
|
__ jmp(&load_char_start_regexp);
|
908
921
|
} else {
|
909
922
|
__ mov(eax, Immediate(SUCCESS));
|
@@ -1196,7 +1209,7 @@ int RegExpMacroAssemblerIA32::CheckStackGuardState(Address* return_address,
|
|
1196
1209
|
Handle<String> subject(frame_entry<String*>(re_frame, kInputString));
|
1197
1210
|
|
1198
1211
|
// Current string.
|
1199
|
-
bool is_ascii = subject->
|
1212
|
+
bool is_ascii = subject->IsOneByteRepresentationUnderneath();
|
1200
1213
|
|
1201
1214
|
ASSERT(re_code->instruction_start() <= *return_address);
|
1202
1215
|
ASSERT(*return_address <=
|
@@ -1227,7 +1240,7 @@ int RegExpMacroAssemblerIA32::CheckStackGuardState(Address* return_address,
|
|
1227
1240
|
}
|
1228
1241
|
|
1229
1242
|
// String might have changed.
|
1230
|
-
if (subject_tmp->
|
1243
|
+
if (subject_tmp->IsOneByteRepresentation() != is_ascii) {
|
1231
1244
|
// If we changed between an ASCII and an UC16 string, the specialized
|
1232
1245
|
// code cannot be used, and we need to restart regexp matching from
|
1233
1246
|
// scratch (including, potentially, compiling a new version of the code).
|
@@ -34,17 +34,10 @@
|
|
34
34
|
namespace v8 {
|
35
35
|
namespace internal {
|
36
36
|
|
37
|
-
#
|
38
|
-
class RegExpMacroAssemblerIA32: public RegExpMacroAssembler {
|
39
|
-
public:
|
40
|
-
RegExpMacroAssemblerIA32() { }
|
41
|
-
virtual ~RegExpMacroAssemblerIA32() { }
|
42
|
-
};
|
43
|
-
|
44
|
-
#else // V8_INTERPRETED_REGEXP
|
37
|
+
#ifndef V8_INTERPRETED_REGEXP
|
45
38
|
class RegExpMacroAssemblerIA32: public NativeRegExpMacroAssembler {
|
46
39
|
public:
|
47
|
-
RegExpMacroAssemblerIA32(Mode mode, int registers_to_save);
|
40
|
+
RegExpMacroAssemblerIA32(Mode mode, int registers_to_save, Zone* zone);
|
48
41
|
virtual ~RegExpMacroAssemblerIA32();
|
49
42
|
virtual int stack_limit_slack();
|
50
43
|
virtual void AdvanceCurrentPosition(int by);
|
@@ -69,7 +62,6 @@ class RegExpMacroAssemblerIA32: public NativeRegExpMacroAssembler {
|
|
69
62
|
virtual void CheckNotBackReference(int start_reg, Label* on_no_match);
|
70
63
|
virtual void CheckNotBackReferenceIgnoreCase(int start_reg,
|
71
64
|
Label* on_no_match);
|
72
|
-
virtual void CheckNotRegistersEqual(int reg1, int reg2, Label* on_not_equal);
|
73
65
|
virtual void CheckNotCharacter(uint32_t c, Label* on_not_equal);
|
74
66
|
virtual void CheckNotCharacterAfterAnd(uint32_t c,
|
75
67
|
uint32_t mask,
|
@@ -276,12 +276,12 @@ void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype(
|
|
276
276
|
Register prototype,
|
277
277
|
Label* miss) {
|
278
278
|
// Check we're still in the same context.
|
279
|
-
__ cmp(Operand(esi, Context::SlotOffset(Context::
|
280
|
-
masm->isolate()->
|
279
|
+
__ cmp(Operand(esi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)),
|
280
|
+
masm->isolate()->global_object());
|
281
281
|
__ j(not_equal, miss);
|
282
282
|
// Get the global function with the given index.
|
283
283
|
Handle<JSFunction> function(
|
284
|
-
JSFunction::cast(masm->isolate()->
|
284
|
+
JSFunction::cast(masm->isolate()->native_context()->get(index)));
|
285
285
|
// Load its initial map. The global functions all have initial maps.
|
286
286
|
__ Set(prototype, Immediate(Handle<Map>(function->initial_map())));
|
287
287
|
// Load the prototype from the initial map.
|
@@ -376,18 +376,23 @@ void StubCompiler::GenerateFastPropertyLoad(MacroAssembler* masm,
|
|
376
376
|
Register dst,
|
377
377
|
Register src,
|
378
378
|
Handle<JSObject> holder,
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
if (index < 0) {
|
383
|
-
// Get the property straight out of the holder.
|
384
|
-
int offset = holder->map()->instance_size() + (index * kPointerSize);
|
379
|
+
PropertyIndex index) {
|
380
|
+
if (index.is_header_index()) {
|
381
|
+
int offset = index.header_index() * kPointerSize;
|
385
382
|
__ mov(dst, FieldOperand(src, offset));
|
386
383
|
} else {
|
387
|
-
//
|
388
|
-
int
|
389
|
-
|
390
|
-
|
384
|
+
// Adjust for the number of properties stored in the holder.
|
385
|
+
int slot = index.field_index() - holder->map()->inobject_properties();
|
386
|
+
if (slot < 0) {
|
387
|
+
// Get the property straight out of the holder.
|
388
|
+
int offset = holder->map()->instance_size() + (slot * kPointerSize);
|
389
|
+
__ mov(dst, FieldOperand(src, offset));
|
390
|
+
} else {
|
391
|
+
// Calculate the offset into the properties array.
|
392
|
+
int offset = slot * kPointerSize + FixedArray::kHeaderSize;
|
393
|
+
__ mov(dst, FieldOperand(src, JSObject::kPropertiesOffset));
|
394
|
+
__ mov(dst, FieldOperand(dst, offset));
|
395
|
+
}
|
391
396
|
}
|
392
397
|
}
|
393
398
|
|
@@ -732,6 +737,15 @@ void StubCompiler::GenerateLoadMiss(MacroAssembler* masm, Code::Kind kind) {
|
|
732
737
|
}
|
733
738
|
|
734
739
|
|
740
|
+
void StubCompiler::GenerateStoreMiss(MacroAssembler* masm, Code::Kind kind) {
|
741
|
+
ASSERT(kind == Code::STORE_IC || kind == Code::KEYED_STORE_IC);
|
742
|
+
Handle<Code> code = (kind == Code::STORE_IC)
|
743
|
+
? masm->isolate()->builtins()->StoreIC_Miss()
|
744
|
+
: masm->isolate()->builtins()->KeyedStoreIC_Miss();
|
745
|
+
__ jmp(code, RelocInfo::CODE_TARGET);
|
746
|
+
}
|
747
|
+
|
748
|
+
|
735
749
|
void StubCompiler::GenerateKeyedLoadMissForceGeneric(MacroAssembler* masm) {
|
736
750
|
Handle<Code> code =
|
737
751
|
masm->isolate()->builtins()->KeyedLoadIC_MissForceGeneric();
|
@@ -745,10 +759,22 @@ void StubCompiler::GenerateStoreField(MacroAssembler* masm,
|
|
745
759
|
Handle<JSObject> object,
|
746
760
|
int index,
|
747
761
|
Handle<Map> transition,
|
762
|
+
Handle<String> name,
|
748
763
|
Register receiver_reg,
|
749
764
|
Register name_reg,
|
750
|
-
Register
|
765
|
+
Register scratch1,
|
766
|
+
Register scratch2,
|
751
767
|
Label* miss_label) {
|
768
|
+
LookupResult lookup(masm->isolate());
|
769
|
+
object->Lookup(*name, &lookup);
|
770
|
+
if (lookup.IsFound() && (lookup.IsReadOnly() || !lookup.IsCacheable())) {
|
771
|
+
// In sloppy mode, we could just return the value and be done. However, we
|
772
|
+
// might be in strict mode, where we have to throw. Since we cannot tell,
|
773
|
+
// go into slow case unconditionally.
|
774
|
+
__ jmp(miss_label);
|
775
|
+
return;
|
776
|
+
}
|
777
|
+
|
752
778
|
// Check that the map of the object hasn't changed.
|
753
779
|
CompareMapMode mode = transition.is_null() ? ALLOW_ELEMENT_TRANSITION_MAPS
|
754
780
|
: REQUIRE_EXACT_MAP;
|
@@ -757,7 +783,32 @@ void StubCompiler::GenerateStoreField(MacroAssembler* masm,
|
|
757
783
|
|
758
784
|
// Perform global security token check if needed.
|
759
785
|
if (object->IsJSGlobalProxy()) {
|
760
|
-
__ CheckAccessGlobalProxy(receiver_reg,
|
786
|
+
__ CheckAccessGlobalProxy(receiver_reg, scratch1, miss_label);
|
787
|
+
}
|
788
|
+
|
789
|
+
// Check that we are allowed to write this.
|
790
|
+
if (!transition.is_null() && object->GetPrototype()->IsJSObject()) {
|
791
|
+
JSObject* holder;
|
792
|
+
if (lookup.IsFound()) {
|
793
|
+
holder = lookup.holder();
|
794
|
+
} else {
|
795
|
+
// Find the top object.
|
796
|
+
holder = *object;
|
797
|
+
do {
|
798
|
+
holder = JSObject::cast(holder->GetPrototype());
|
799
|
+
} while (holder->GetPrototype()->IsJSObject());
|
800
|
+
}
|
801
|
+
// We need an extra register, push
|
802
|
+
__ push(name_reg);
|
803
|
+
Label miss_pop, done_check;
|
804
|
+
CheckPrototypes(object, receiver_reg, Handle<JSObject>(holder), name_reg,
|
805
|
+
scratch1, scratch2, name, &miss_pop);
|
806
|
+
__ jmp(&done_check);
|
807
|
+
__ bind(&miss_pop);
|
808
|
+
__ pop(name_reg);
|
809
|
+
__ jmp(miss_label);
|
810
|
+
__ bind(&done_check);
|
811
|
+
__ pop(name_reg);
|
761
812
|
}
|
762
813
|
|
763
814
|
// Stub never generated for non-global objects that require access
|
@@ -768,11 +819,11 @@ void StubCompiler::GenerateStoreField(MacroAssembler* masm,
|
|
768
819
|
if (!transition.is_null() && (object->map()->unused_property_fields() == 0)) {
|
769
820
|
// The properties must be extended before we can store the value.
|
770
821
|
// We jump to a runtime call that extends the properties array.
|
771
|
-
__ pop(
|
822
|
+
__ pop(scratch1); // Return address.
|
772
823
|
__ push(receiver_reg);
|
773
824
|
__ push(Immediate(transition));
|
774
825
|
__ push(eax);
|
775
|
-
__ push(
|
826
|
+
__ push(scratch1);
|
776
827
|
__ TailCallExternalReference(
|
777
828
|
ExternalReference(IC_Utility(IC::kSharedStoreIC_ExtendStorage),
|
778
829
|
masm->isolate()),
|
@@ -783,14 +834,14 @@ void StubCompiler::GenerateStoreField(MacroAssembler* masm,
|
|
783
834
|
|
784
835
|
if (!transition.is_null()) {
|
785
836
|
// Update the map of the object.
|
786
|
-
__ mov(
|
787
|
-
__ mov(FieldOperand(receiver_reg, HeapObject::kMapOffset),
|
837
|
+
__ mov(scratch1, Immediate(transition));
|
838
|
+
__ mov(FieldOperand(receiver_reg, HeapObject::kMapOffset), scratch1);
|
788
839
|
|
789
840
|
// Update the write barrier for the map field and pass the now unused
|
790
841
|
// name_reg as scratch register.
|
791
842
|
__ RecordWriteField(receiver_reg,
|
792
843
|
HeapObject::kMapOffset,
|
793
|
-
|
844
|
+
scratch1,
|
794
845
|
name_reg,
|
795
846
|
kDontSaveFPRegs,
|
796
847
|
OMIT_REMEMBERED_SET,
|
@@ -813,19 +864,19 @@ void StubCompiler::GenerateStoreField(MacroAssembler* masm,
|
|
813
864
|
__ RecordWriteField(receiver_reg,
|
814
865
|
offset,
|
815
866
|
name_reg,
|
816
|
-
|
867
|
+
scratch1,
|
817
868
|
kDontSaveFPRegs);
|
818
869
|
} else {
|
819
870
|
// Write to the properties array.
|
820
871
|
int offset = index * kPointerSize + FixedArray::kHeaderSize;
|
821
872
|
// Get the properties array (optimistically).
|
822
|
-
__ mov(
|
823
|
-
__ mov(FieldOperand(
|
873
|
+
__ mov(scratch1, FieldOperand(receiver_reg, JSObject::kPropertiesOffset));
|
874
|
+
__ mov(FieldOperand(scratch1, offset), eax);
|
824
875
|
|
825
876
|
// Update the write barrier for the array address.
|
826
877
|
// Pass the value being stored in the now unused name_reg.
|
827
878
|
__ mov(name_reg, eax);
|
828
|
-
__ RecordWriteField(
|
879
|
+
__ RecordWriteField(scratch1,
|
829
880
|
offset,
|
830
881
|
name_reg,
|
831
882
|
receiver_reg,
|
@@ -999,7 +1050,7 @@ void StubCompiler::GenerateLoadField(Handle<JSObject> object,
|
|
999
1050
|
Register scratch1,
|
1000
1051
|
Register scratch2,
|
1001
1052
|
Register scratch3,
|
1002
|
-
|
1053
|
+
PropertyIndex index,
|
1003
1054
|
Handle<String> name,
|
1004
1055
|
Label* miss) {
|
1005
1056
|
// Check that the receiver isn't a smi.
|
@@ -1015,6 +1066,58 @@ void StubCompiler::GenerateLoadField(Handle<JSObject> object,
|
|
1015
1066
|
}
|
1016
1067
|
|
1017
1068
|
|
1069
|
+
void StubCompiler::GenerateDictionaryLoadCallback(Register receiver,
|
1070
|
+
Register name_reg,
|
1071
|
+
Register scratch1,
|
1072
|
+
Register scratch2,
|
1073
|
+
Register scratch3,
|
1074
|
+
Handle<AccessorInfo> callback,
|
1075
|
+
Handle<String> name,
|
1076
|
+
Label* miss) {
|
1077
|
+
ASSERT(!receiver.is(scratch2));
|
1078
|
+
ASSERT(!receiver.is(scratch3));
|
1079
|
+
Register dictionary = scratch1;
|
1080
|
+
bool must_preserve_dictionary_reg = receiver.is(dictionary);
|
1081
|
+
|
1082
|
+
// Load the properties dictionary.
|
1083
|
+
if (must_preserve_dictionary_reg) {
|
1084
|
+
__ push(dictionary);
|
1085
|
+
}
|
1086
|
+
__ mov(dictionary, FieldOperand(receiver, JSObject::kPropertiesOffset));
|
1087
|
+
|
1088
|
+
// Probe the dictionary.
|
1089
|
+
Label probe_done, pop_and_miss;
|
1090
|
+
StringDictionaryLookupStub::GeneratePositiveLookup(masm(),
|
1091
|
+
&pop_and_miss,
|
1092
|
+
&probe_done,
|
1093
|
+
dictionary,
|
1094
|
+
name_reg,
|
1095
|
+
scratch2,
|
1096
|
+
scratch3);
|
1097
|
+
__ bind(&pop_and_miss);
|
1098
|
+
if (must_preserve_dictionary_reg) {
|
1099
|
+
__ pop(dictionary);
|
1100
|
+
}
|
1101
|
+
__ jmp(miss);
|
1102
|
+
__ bind(&probe_done);
|
1103
|
+
|
1104
|
+
// If probing finds an entry in the dictionary, scratch2 contains the
|
1105
|
+
// index into the dictionary. Check that the value is the callback.
|
1106
|
+
Register index = scratch2;
|
1107
|
+
const int kElementsStartOffset =
|
1108
|
+
StringDictionary::kHeaderSize +
|
1109
|
+
StringDictionary::kElementsStartIndex * kPointerSize;
|
1110
|
+
const int kValueOffset = kElementsStartOffset + kPointerSize;
|
1111
|
+
__ mov(scratch3,
|
1112
|
+
Operand(dictionary, index, times_4, kValueOffset - kHeapObjectTag));
|
1113
|
+
if (must_preserve_dictionary_reg) {
|
1114
|
+
__ pop(dictionary);
|
1115
|
+
}
|
1116
|
+
__ cmp(scratch3, callback);
|
1117
|
+
__ j(not_equal, miss);
|
1118
|
+
}
|
1119
|
+
|
1120
|
+
|
1018
1121
|
void StubCompiler::GenerateLoadCallback(Handle<JSObject> object,
|
1019
1122
|
Handle<JSObject> holder,
|
1020
1123
|
Register receiver,
|
@@ -1022,6 +1125,7 @@ void StubCompiler::GenerateLoadCallback(Handle<JSObject> object,
|
|
1022
1125
|
Register scratch1,
|
1023
1126
|
Register scratch2,
|
1024
1127
|
Register scratch3,
|
1128
|
+
Register scratch4,
|
1025
1129
|
Handle<AccessorInfo> callback,
|
1026
1130
|
Handle<String> name,
|
1027
1131
|
Label* miss) {
|
@@ -1032,6 +1136,11 @@ void StubCompiler::GenerateLoadCallback(Handle<JSObject> object,
|
|
1032
1136
|
Register reg = CheckPrototypes(object, receiver, holder, scratch1,
|
1033
1137
|
scratch2, scratch3, name, miss);
|
1034
1138
|
|
1139
|
+
if (!holder->HasFastProperties() && !holder->IsJSGlobalObject()) {
|
1140
|
+
GenerateDictionaryLoadCallback(
|
1141
|
+
reg, name_reg, scratch1, scratch2, scratch3, callback, name, miss);
|
1142
|
+
}
|
1143
|
+
|
1035
1144
|
// Insert additional parameters into the stack frame above return address.
|
1036
1145
|
ASSERT(!scratch3.is(reg));
|
1037
1146
|
__ pop(scratch3); // Get return address to place it below.
|
@@ -1120,12 +1229,13 @@ void StubCompiler::GenerateLoadInterceptor(Handle<JSObject> object,
|
|
1120
1229
|
// later.
|
1121
1230
|
bool compile_followup_inline = false;
|
1122
1231
|
if (lookup->IsFound() && lookup->IsCacheable()) {
|
1123
|
-
if (lookup->
|
1232
|
+
if (lookup->IsField()) {
|
1124
1233
|
compile_followup_inline = true;
|
1125
1234
|
} else if (lookup->type() == CALLBACKS &&
|
1126
1235
|
lookup->GetCallbackObject()->IsAccessorInfo()) {
|
1127
|
-
|
1128
|
-
|
1236
|
+
AccessorInfo* callback = AccessorInfo::cast(lookup->GetCallbackObject());
|
1237
|
+
compile_followup_inline = callback->getter() != NULL &&
|
1238
|
+
callback->IsCompatibleReceiver(*object);
|
1129
1239
|
}
|
1130
1240
|
}
|
1131
1241
|
|
@@ -1204,7 +1314,7 @@ void StubCompiler::GenerateLoadInterceptor(Handle<JSObject> object,
|
|
1204
1314
|
miss);
|
1205
1315
|
}
|
1206
1316
|
|
1207
|
-
if (lookup->
|
1317
|
+
if (lookup->IsField()) {
|
1208
1318
|
// We found FIELD property in prototype chain of interceptor's holder.
|
1209
1319
|
// Retrieve a field from field's holder.
|
1210
1320
|
GenerateFastPropertyLoad(masm(), eax, holder_reg,
|
@@ -1327,7 +1437,7 @@ void CallStubCompiler::GenerateMissBranch() {
|
|
1327
1437
|
|
1328
1438
|
Handle<Code> CallStubCompiler::CompileCallField(Handle<JSObject> object,
|
1329
1439
|
Handle<JSObject> holder,
|
1330
|
-
|
1440
|
+
PropertyIndex index,
|
1331
1441
|
Handle<String> name) {
|
1332
1442
|
// ----------- S t a t e -------------
|
1333
1443
|
// -- ecx : name
|
@@ -1377,7 +1487,7 @@ Handle<Code> CallStubCompiler::CompileCallField(Handle<JSObject> object,
|
|
1377
1487
|
GenerateMissBranch();
|
1378
1488
|
|
1379
1489
|
// Return the generated code.
|
1380
|
-
return GetCode(FIELD, name);
|
1490
|
+
return GetCode(Code::FIELD, name);
|
1381
1491
|
}
|
1382
1492
|
|
1383
1493
|
|
@@ -1422,7 +1532,7 @@ Handle<Code> CallStubCompiler::CompileArrayPushCall(
|
|
1422
1532
|
Label call_builtin;
|
1423
1533
|
|
1424
1534
|
if (argc == 1) { // Otherwise fall through to call builtin.
|
1425
|
-
Label attempt_to_grow_elements, with_write_barrier;
|
1535
|
+
Label attempt_to_grow_elements, with_write_barrier, check_double;
|
1426
1536
|
|
1427
1537
|
// Get the elements array of the object.
|
1428
1538
|
__ mov(edi, FieldOperand(edx, JSArray::kElementsOffset));
|
@@ -1430,7 +1540,7 @@ Handle<Code> CallStubCompiler::CompileArrayPushCall(
|
|
1430
1540
|
// Check that the elements are in fast mode and writable.
|
1431
1541
|
__ cmp(FieldOperand(edi, HeapObject::kMapOffset),
|
1432
1542
|
Immediate(factory()->fixed_array_map()));
|
1433
|
-
__ j(not_equal, &
|
1543
|
+
__ j(not_equal, &check_double);
|
1434
1544
|
|
1435
1545
|
// Get the array's length into eax and calculate new length.
|
1436
1546
|
__ mov(eax, FieldOperand(edx, JSArray::kLengthOffset));
|
@@ -1461,17 +1571,49 @@ Handle<Code> CallStubCompiler::CompileArrayPushCall(
|
|
1461
1571
|
|
1462
1572
|
__ ret((argc + 1) * kPointerSize);
|
1463
1573
|
|
1574
|
+
__ bind(&check_double);
|
1575
|
+
|
1576
|
+
|
1577
|
+
// Check that the elements are in double mode.
|
1578
|
+
__ cmp(FieldOperand(edi, HeapObject::kMapOffset),
|
1579
|
+
Immediate(factory()->fixed_double_array_map()));
|
1580
|
+
__ j(not_equal, &call_builtin);
|
1581
|
+
|
1582
|
+
// Get the array's length into eax and calculate new length.
|
1583
|
+
__ mov(eax, FieldOperand(edx, JSArray::kLengthOffset));
|
1584
|
+
STATIC_ASSERT(kSmiTagSize == 1);
|
1585
|
+
STATIC_ASSERT(kSmiTag == 0);
|
1586
|
+
__ add(eax, Immediate(Smi::FromInt(argc)));
|
1587
|
+
|
1588
|
+
// Get the elements' length into ecx.
|
1589
|
+
__ mov(ecx, FieldOperand(edi, FixedArray::kLengthOffset));
|
1590
|
+
|
1591
|
+
// Check if we could survive without allocation.
|
1592
|
+
__ cmp(eax, ecx);
|
1593
|
+
__ j(greater, &call_builtin);
|
1594
|
+
|
1595
|
+
__ mov(ecx, Operand(esp, argc * kPointerSize));
|
1596
|
+
__ StoreNumberToDoubleElements(
|
1597
|
+
ecx, edi, eax, ecx, xmm0, &call_builtin, true, argc * kDoubleSize);
|
1598
|
+
|
1599
|
+
// Save new length.
|
1600
|
+
__ mov(FieldOperand(edx, JSArray::kLengthOffset), eax);
|
1601
|
+
__ ret((argc + 1) * kPointerSize);
|
1602
|
+
|
1464
1603
|
__ bind(&with_write_barrier);
|
1465
1604
|
|
1466
1605
|
__ mov(ebx, FieldOperand(edx, HeapObject::kMapOffset));
|
1467
1606
|
|
1468
|
-
if (FLAG_smi_only_arrays
|
1607
|
+
if (FLAG_smi_only_arrays && !FLAG_trace_elements_transitions) {
|
1469
1608
|
Label fast_object, not_fast_object;
|
1470
1609
|
__ CheckFastObjectElements(ebx, ¬_fast_object, Label::kNear);
|
1471
1610
|
__ jmp(&fast_object);
|
1472
1611
|
// In case of fast smi-only, convert to fast object, otherwise bail out.
|
1473
1612
|
__ bind(¬_fast_object);
|
1474
1613
|
__ CheckFastSmiElements(ebx, &call_builtin);
|
1614
|
+
__ cmp(FieldOperand(ecx, HeapObject::kMapOffset),
|
1615
|
+
Immediate(factory()->heap_number_map()));
|
1616
|
+
__ j(equal, &call_builtin);
|
1475
1617
|
// edi: elements array
|
1476
1618
|
// edx: receiver
|
1477
1619
|
// ebx: map
|
@@ -1483,7 +1625,9 @@ Handle<Code> CallStubCompiler::CompileArrayPushCall(
|
|
1483
1625
|
&try_holey_map);
|
1484
1626
|
|
1485
1627
|
ElementsTransitionGenerator::
|
1486
|
-
GenerateMapChangeElementsTransition(masm()
|
1628
|
+
GenerateMapChangeElementsTransition(masm(),
|
1629
|
+
DONT_TRACK_ALLOCATION_SITE,
|
1630
|
+
NULL);
|
1487
1631
|
// Restore edi.
|
1488
1632
|
__ mov(edi, FieldOperand(edx, JSArray::kElementsOffset));
|
1489
1633
|
__ jmp(&fast_object);
|
@@ -1495,7 +1639,9 @@ Handle<Code> CallStubCompiler::CompileArrayPushCall(
|
|
1495
1639
|
edi,
|
1496
1640
|
&call_builtin);
|
1497
1641
|
ElementsTransitionGenerator::
|
1498
|
-
GenerateMapChangeElementsTransition(masm()
|
1642
|
+
GenerateMapChangeElementsTransition(masm(),
|
1643
|
+
DONT_TRACK_ALLOCATION_SITE,
|
1644
|
+
NULL);
|
1499
1645
|
// Restore edi.
|
1500
1646
|
__ mov(edi, FieldOperand(edx, JSArray::kElementsOffset));
|
1501
1647
|
__ bind(&fast_object);
|
@@ -1924,7 +2070,7 @@ Handle<Code> CallStubCompiler::CompileStringFromCharCodeCall(
|
|
1924
2070
|
GenerateMissBranch();
|
1925
2071
|
|
1926
2072
|
// Return the generated code.
|
1927
|
-
return cell.is_null() ? GetCode(function) : GetCode(NORMAL, name);
|
2073
|
+
return cell.is_null() ? GetCode(function) : GetCode(Code::NORMAL, name);
|
1928
2074
|
}
|
1929
2075
|
|
1930
2076
|
|
@@ -2054,7 +2200,7 @@ Handle<Code> CallStubCompiler::CompileMathFloorCall(
|
|
2054
2200
|
GenerateMissBranch();
|
2055
2201
|
|
2056
2202
|
// Return the generated code.
|
2057
|
-
return cell.is_null() ? GetCode(function) : GetCode(NORMAL, name);
|
2203
|
+
return cell.is_null() ? GetCode(function) : GetCode(Code::NORMAL, name);
|
2058
2204
|
}
|
2059
2205
|
|
2060
2206
|
|
@@ -2159,7 +2305,7 @@ Handle<Code> CallStubCompiler::CompileMathAbsCall(
|
|
2159
2305
|
GenerateMissBranch();
|
2160
2306
|
|
2161
2307
|
// Return the generated code.
|
2162
|
-
return cell.is_null() ? GetCode(function) : GetCode(NORMAL, name);
|
2308
|
+
return cell.is_null() ? GetCode(function) : GetCode(Code::NORMAL, name);
|
2163
2309
|
}
|
2164
2310
|
|
2165
2311
|
|
@@ -2222,11 +2368,11 @@ Handle<Code> CallStubCompiler::CompileFastApiCall(
|
|
2222
2368
|
}
|
2223
2369
|
|
2224
2370
|
|
2225
|
-
|
2226
|
-
|
2227
|
-
|
2228
|
-
|
2229
|
-
|
2371
|
+
void CallStubCompiler::CompileHandlerFrontend(Handle<Object> object,
|
2372
|
+
Handle<JSObject> holder,
|
2373
|
+
Handle<String> name,
|
2374
|
+
CheckType check,
|
2375
|
+
Label* success) {
|
2230
2376
|
// ----------- S t a t e -------------
|
2231
2377
|
// -- ecx : name
|
2232
2378
|
// -- esp[0] : return address
|
@@ -2234,15 +2380,6 @@ Handle<Code> CallStubCompiler::CompileCallConstant(Handle<Object> object,
|
|
2234
2380
|
// -- ...
|
2235
2381
|
// -- esp[(argc + 1) * 4] : receiver
|
2236
2382
|
// -----------------------------------
|
2237
|
-
|
2238
|
-
if (HasCustomCallGenerator(function)) {
|
2239
|
-
Handle<Code> code = CompileCustomCall(object, holder,
|
2240
|
-
Handle<JSGlobalPropertyCell>::null(),
|
2241
|
-
function, name);
|
2242
|
-
// A null handle means bail out to the regular compiler code below.
|
2243
|
-
if (!code.is_null()) return code;
|
2244
|
-
}
|
2245
|
-
|
2246
2383
|
Label miss;
|
2247
2384
|
GenerateNameCheck(name, &miss);
|
2248
2385
|
|
@@ -2275,76 +2412,87 @@ Handle<Code> CallStubCompiler::CompileCallConstant(Handle<Object> object,
|
|
2275
2412
|
break;
|
2276
2413
|
|
2277
2414
|
case STRING_CHECK:
|
2278
|
-
|
2279
|
-
|
2280
|
-
|
2281
|
-
|
2282
|
-
|
2283
|
-
|
2284
|
-
|
2285
|
-
|
2286
|
-
|
2287
|
-
eax, holder, ebx, edx, edi, name, &miss);
|
2288
|
-
} else {
|
2289
|
-
// Calling non-strict non-builtins with a value as the receiver
|
2290
|
-
// requires boxing.
|
2291
|
-
__ jmp(&miss);
|
2292
|
-
}
|
2415
|
+
// Check that the object is a string or a symbol.
|
2416
|
+
__ CmpObjectType(edx, FIRST_NONSTRING_TYPE, eax);
|
2417
|
+
__ j(above_equal, &miss);
|
2418
|
+
// Check that the maps starting from the prototype haven't changed.
|
2419
|
+
GenerateDirectLoadGlobalFunctionPrototype(
|
2420
|
+
masm(), Context::STRING_FUNCTION_INDEX, eax, &miss);
|
2421
|
+
CheckPrototypes(
|
2422
|
+
Handle<JSObject>(JSObject::cast(object->GetPrototype())),
|
2423
|
+
eax, holder, ebx, edx, edi, name, &miss);
|
2293
2424
|
break;
|
2294
2425
|
|
2295
|
-
case NUMBER_CHECK:
|
2296
|
-
|
2297
|
-
|
2298
|
-
|
2299
|
-
|
2300
|
-
|
2301
|
-
|
2302
|
-
|
2303
|
-
|
2304
|
-
|
2305
|
-
|
2306
|
-
|
2307
|
-
|
2308
|
-
eax, holder, ebx, edx, edi, name, &miss);
|
2309
|
-
} else {
|
2310
|
-
// Calling non-strict non-builtins with a value as the receiver
|
2311
|
-
// requires boxing.
|
2312
|
-
__ jmp(&miss);
|
2313
|
-
}
|
2426
|
+
case NUMBER_CHECK: {
|
2427
|
+
Label fast;
|
2428
|
+
// Check that the object is a smi or a heap number.
|
2429
|
+
__ JumpIfSmi(edx, &fast);
|
2430
|
+
__ CmpObjectType(edx, HEAP_NUMBER_TYPE, eax);
|
2431
|
+
__ j(not_equal, &miss);
|
2432
|
+
__ bind(&fast);
|
2433
|
+
// Check that the maps starting from the prototype haven't changed.
|
2434
|
+
GenerateDirectLoadGlobalFunctionPrototype(
|
2435
|
+
masm(), Context::NUMBER_FUNCTION_INDEX, eax, &miss);
|
2436
|
+
CheckPrototypes(
|
2437
|
+
Handle<JSObject>(JSObject::cast(object->GetPrototype())),
|
2438
|
+
eax, holder, ebx, edx, edi, name, &miss);
|
2314
2439
|
break;
|
2315
|
-
|
2316
|
-
case BOOLEAN_CHECK:
|
2317
|
-
|
2318
|
-
|
2319
|
-
|
2320
|
-
|
2321
|
-
|
2322
|
-
|
2323
|
-
|
2324
|
-
|
2325
|
-
|
2326
|
-
|
2327
|
-
|
2328
|
-
|
2329
|
-
|
2330
|
-
eax, holder, ebx, edx, edi, name, &miss);
|
2331
|
-
} else {
|
2332
|
-
// Calling non-strict non-builtins with a value as the receiver
|
2333
|
-
// requires boxing.
|
2334
|
-
__ jmp(&miss);
|
2335
|
-
}
|
2440
|
+
}
|
2441
|
+
case BOOLEAN_CHECK: {
|
2442
|
+
Label fast;
|
2443
|
+
// Check that the object is a boolean.
|
2444
|
+
__ cmp(edx, factory()->true_value());
|
2445
|
+
__ j(equal, &fast);
|
2446
|
+
__ cmp(edx, factory()->false_value());
|
2447
|
+
__ j(not_equal, &miss);
|
2448
|
+
__ bind(&fast);
|
2449
|
+
// Check that the maps starting from the prototype haven't changed.
|
2450
|
+
GenerateDirectLoadGlobalFunctionPrototype(
|
2451
|
+
masm(), Context::BOOLEAN_FUNCTION_INDEX, eax, &miss);
|
2452
|
+
CheckPrototypes(
|
2453
|
+
Handle<JSObject>(JSObject::cast(object->GetPrototype())),
|
2454
|
+
eax, holder, ebx, edx, edi, name, &miss);
|
2336
2455
|
break;
|
2456
|
+
}
|
2337
2457
|
}
|
2338
2458
|
|
2459
|
+
__ jmp(success);
|
2460
|
+
|
2461
|
+
// Handle call cache miss.
|
2462
|
+
__ bind(&miss);
|
2463
|
+
GenerateMissBranch();
|
2464
|
+
}
|
2465
|
+
|
2466
|
+
|
2467
|
+
void CallStubCompiler::CompileHandlerBackend(Handle<JSFunction> function) {
|
2339
2468
|
CallKind call_kind = CallICBase::Contextual::decode(extra_state_)
|
2340
2469
|
? CALL_AS_FUNCTION
|
2341
2470
|
: CALL_AS_METHOD;
|
2342
2471
|
__ InvokeFunction(function, arguments(), JUMP_FUNCTION,
|
2343
2472
|
NullCallWrapper(), call_kind);
|
2473
|
+
}
|
2344
2474
|
|
2345
|
-
|
2346
|
-
|
2347
|
-
|
2475
|
+
|
2476
|
+
Handle<Code> CallStubCompiler::CompileCallConstant(
|
2477
|
+
Handle<Object> object,
|
2478
|
+
Handle<JSObject> holder,
|
2479
|
+
Handle<String> name,
|
2480
|
+
CheckType check,
|
2481
|
+
Handle<JSFunction> function) {
|
2482
|
+
|
2483
|
+
if (HasCustomCallGenerator(function)) {
|
2484
|
+
Handle<Code> code = CompileCustomCall(object, holder,
|
2485
|
+
Handle<JSGlobalPropertyCell>::null(),
|
2486
|
+
function, name);
|
2487
|
+
// A null handle means bail out to the regular compiler code below.
|
2488
|
+
if (!code.is_null()) return code;
|
2489
|
+
}
|
2490
|
+
|
2491
|
+
Label success;
|
2492
|
+
|
2493
|
+
CompileHandlerFrontend(object, holder, name, check, &success);
|
2494
|
+
__ bind(&success);
|
2495
|
+
CompileHandlerBackend(function);
|
2348
2496
|
|
2349
2497
|
// Return the generated code.
|
2350
2498
|
return GetCode(function);
|
@@ -2406,7 +2554,7 @@ Handle<Code> CallStubCompiler::CompileCallInterceptor(Handle<JSObject> object,
|
|
2406
2554
|
GenerateMissBranch();
|
2407
2555
|
|
2408
2556
|
// Return the generated code.
|
2409
|
-
return GetCode(INTERCEPTOR, name);
|
2557
|
+
return GetCode(Code::INTERCEPTOR, name);
|
2410
2558
|
}
|
2411
2559
|
|
2412
2560
|
|
@@ -2467,7 +2615,7 @@ Handle<Code> CallStubCompiler::CompileCallGlobal(
|
|
2467
2615
|
GenerateMissBranch();
|
2468
2616
|
|
2469
2617
|
// Return the generated code.
|
2470
|
-
return GetCode(NORMAL, name);
|
2618
|
+
return GetCode(Code::NORMAL, name);
|
2471
2619
|
}
|
2472
2620
|
|
2473
2621
|
|
@@ -2484,8 +2632,13 @@ Handle<Code> StoreStubCompiler::CompileStoreField(Handle<JSObject> object,
|
|
2484
2632
|
Label miss;
|
2485
2633
|
|
2486
2634
|
// Generate store field code. Trashes the name register.
|
2487
|
-
GenerateStoreField(masm(),
|
2488
|
-
|
2635
|
+
GenerateStoreField(masm(),
|
2636
|
+
object,
|
2637
|
+
index,
|
2638
|
+
transition,
|
2639
|
+
name,
|
2640
|
+
edx, ecx, ebx, edi,
|
2641
|
+
&miss);
|
2489
2642
|
// Handle store cache miss.
|
2490
2643
|
__ bind(&miss);
|
2491
2644
|
__ mov(ecx, Immediate(name)); // restore name
|
@@ -2493,14 +2646,17 @@ Handle<Code> StoreStubCompiler::CompileStoreField(Handle<JSObject> object,
|
|
2493
2646
|
__ jmp(ic, RelocInfo::CODE_TARGET);
|
2494
2647
|
|
2495
2648
|
// Return the generated code.
|
2496
|
-
return GetCode(transition.is_null()
|
2649
|
+
return GetCode(transition.is_null()
|
2650
|
+
? Code::FIELD
|
2651
|
+
: Code::MAP_TRANSITION, name);
|
2497
2652
|
}
|
2498
2653
|
|
2499
2654
|
|
2500
2655
|
Handle<Code> StoreStubCompiler::CompileStoreCallback(
|
2501
|
-
Handle<
|
2502
|
-
Handle<
|
2503
|
-
Handle<
|
2656
|
+
Handle<String> name,
|
2657
|
+
Handle<JSObject> receiver,
|
2658
|
+
Handle<JSObject> holder,
|
2659
|
+
Handle<AccessorInfo> callback) {
|
2504
2660
|
// ----------- S t a t e -------------
|
2505
2661
|
// -- eax : value
|
2506
2662
|
// -- ecx : name
|
@@ -2508,19 +2664,14 @@ Handle<Code> StoreStubCompiler::CompileStoreCallback(
|
|
2508
2664
|
// -- esp[0] : return address
|
2509
2665
|
// -----------------------------------
|
2510
2666
|
Label miss;
|
2667
|
+
// Check that the maps haven't changed, preserving the value register.
|
2668
|
+
__ push(eax);
|
2669
|
+
__ JumpIfSmi(edx, &miss);
|
2670
|
+
CheckPrototypes(receiver, edx, holder, ebx, eax, edi, name, &miss);
|
2671
|
+
__ pop(eax); // restore value
|
2511
2672
|
|
2512
|
-
//
|
2513
|
-
|
2514
|
-
&miss, DO_SMI_CHECK, ALLOW_ELEMENT_TRANSITION_MAPS);
|
2515
|
-
|
2516
|
-
// Perform global security token check if needed.
|
2517
|
-
if (object->IsJSGlobalProxy()) {
|
2518
|
-
__ CheckAccessGlobalProxy(edx, ebx, &miss);
|
2519
|
-
}
|
2520
|
-
|
2521
|
-
// Stub never generated for non-global objects that require access
|
2522
|
-
// checks.
|
2523
|
-
ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded());
|
2673
|
+
// Stub never generated for non-global objects that require access checks.
|
2674
|
+
ASSERT(holder->IsJSGlobalProxy() || !holder->IsAccessCheckNeeded());
|
2524
2675
|
|
2525
2676
|
__ pop(ebx); // remove the return address
|
2526
2677
|
__ push(edx); // receiver
|
@@ -2536,11 +2687,89 @@ Handle<Code> StoreStubCompiler::CompileStoreCallback(
|
|
2536
2687
|
|
2537
2688
|
// Handle store cache miss.
|
2538
2689
|
__ bind(&miss);
|
2690
|
+
__ pop(eax);
|
2691
|
+
Handle<Code> ic = isolate()->builtins()->StoreIC_Miss();
|
2692
|
+
__ jmp(ic, RelocInfo::CODE_TARGET);
|
2693
|
+
|
2694
|
+
// Return the generated code.
|
2695
|
+
return GetCode(Code::CALLBACKS, name);
|
2696
|
+
}
|
2697
|
+
|
2698
|
+
|
2699
|
+
#undef __
|
2700
|
+
#define __ ACCESS_MASM(masm)
|
2701
|
+
|
2702
|
+
|
2703
|
+
void StoreStubCompiler::GenerateStoreViaSetter(
|
2704
|
+
MacroAssembler* masm,
|
2705
|
+
Handle<JSFunction> setter) {
|
2706
|
+
// ----------- S t a t e -------------
|
2707
|
+
// -- eax : value
|
2708
|
+
// -- ecx : name
|
2709
|
+
// -- edx : receiver
|
2710
|
+
// -- esp[0] : return address
|
2711
|
+
// -----------------------------------
|
2712
|
+
{
|
2713
|
+
FrameScope scope(masm, StackFrame::INTERNAL);
|
2714
|
+
|
2715
|
+
// Save value register, so we can restore it later.
|
2716
|
+
__ push(eax);
|
2717
|
+
|
2718
|
+
if (!setter.is_null()) {
|
2719
|
+
// Call the JavaScript setter with receiver and value on the stack.
|
2720
|
+
__ push(edx);
|
2721
|
+
__ push(eax);
|
2722
|
+
ParameterCount actual(1);
|
2723
|
+
__ InvokeFunction(setter, actual, CALL_FUNCTION, NullCallWrapper(),
|
2724
|
+
CALL_AS_METHOD);
|
2725
|
+
} else {
|
2726
|
+
// If we generate a global code snippet for deoptimization only, remember
|
2727
|
+
// the place to continue after deoptimization.
|
2728
|
+
masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset());
|
2729
|
+
}
|
2730
|
+
|
2731
|
+
// We have to return the passed value, not the return value of the setter.
|
2732
|
+
__ pop(eax);
|
2733
|
+
|
2734
|
+
// Restore context register.
|
2735
|
+
__ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
|
2736
|
+
}
|
2737
|
+
__ ret(0);
|
2738
|
+
}
|
2739
|
+
|
2740
|
+
|
2741
|
+
#undef __
|
2742
|
+
#define __ ACCESS_MASM(masm())
|
2743
|
+
|
2744
|
+
|
2745
|
+
Handle<Code> StoreStubCompiler::CompileStoreViaSetter(
|
2746
|
+
Handle<String> name,
|
2747
|
+
Handle<JSObject> receiver,
|
2748
|
+
Handle<JSObject> holder,
|
2749
|
+
Handle<JSFunction> setter) {
|
2750
|
+
// ----------- S t a t e -------------
|
2751
|
+
// -- eax : value
|
2752
|
+
// -- ecx : name
|
2753
|
+
// -- edx : receiver
|
2754
|
+
// -- esp[0] : return address
|
2755
|
+
// -----------------------------------
|
2756
|
+
Label miss;
|
2757
|
+
|
2758
|
+
// Check that the maps haven't changed, preserving the name register.
|
2759
|
+
__ push(ecx);
|
2760
|
+
__ JumpIfSmi(edx, &miss);
|
2761
|
+
CheckPrototypes(receiver, edx, holder, ebx, ecx, edi, name, &miss);
|
2762
|
+
__ pop(ecx);
|
2763
|
+
|
2764
|
+
GenerateStoreViaSetter(masm(), setter);
|
2765
|
+
|
2766
|
+
__ bind(&miss);
|
2767
|
+
__ pop(ecx);
|
2539
2768
|
Handle<Code> ic = isolate()->builtins()->StoreIC_Miss();
|
2540
2769
|
__ jmp(ic, RelocInfo::CODE_TARGET);
|
2541
2770
|
|
2542
2771
|
// Return the generated code.
|
2543
|
-
return GetCode(CALLBACKS, name);
|
2772
|
+
return GetCode(Code::CALLBACKS, name);
|
2544
2773
|
}
|
2545
2774
|
|
2546
2775
|
|
@@ -2586,7 +2815,7 @@ Handle<Code> StoreStubCompiler::CompileStoreInterceptor(
|
|
2586
2815
|
__ jmp(ic, RelocInfo::CODE_TARGET);
|
2587
2816
|
|
2588
2817
|
// Return the generated code.
|
2589
|
-
return GetCode(INTERCEPTOR, name);
|
2818
|
+
return GetCode(Code::INTERCEPTOR, name);
|
2590
2819
|
}
|
2591
2820
|
|
2592
2821
|
|
@@ -2634,7 +2863,7 @@ Handle<Code> StoreStubCompiler::CompileStoreGlobal(
|
|
2634
2863
|
__ jmp(ic, RelocInfo::CODE_TARGET);
|
2635
2864
|
|
2636
2865
|
// Return the generated code.
|
2637
|
-
return GetCode(NORMAL, name);
|
2866
|
+
return GetCode(Code::NORMAL, name);
|
2638
2867
|
}
|
2639
2868
|
|
2640
2869
|
|
@@ -2658,7 +2887,13 @@ Handle<Code> KeyedStoreStubCompiler::CompileStoreField(Handle<JSObject> object,
|
|
2658
2887
|
__ j(not_equal, &miss);
|
2659
2888
|
|
2660
2889
|
// Generate store field code. Trashes the name register.
|
2661
|
-
GenerateStoreField(masm(),
|
2890
|
+
GenerateStoreField(masm(),
|
2891
|
+
object,
|
2892
|
+
index,
|
2893
|
+
transition,
|
2894
|
+
name,
|
2895
|
+
edx, ecx, ebx, edi,
|
2896
|
+
&miss);
|
2662
2897
|
|
2663
2898
|
// Handle store cache miss.
|
2664
2899
|
__ bind(&miss);
|
@@ -2667,7 +2902,9 @@ Handle<Code> KeyedStoreStubCompiler::CompileStoreField(Handle<JSObject> object,
|
|
2667
2902
|
__ jmp(ic, RelocInfo::CODE_TARGET);
|
2668
2903
|
|
2669
2904
|
// Return the generated code.
|
2670
|
-
return GetCode(transition.is_null()
|
2905
|
+
return GetCode(transition.is_null()
|
2906
|
+
? Code::FIELD
|
2907
|
+
: Code::MAP_TRANSITION, name);
|
2671
2908
|
}
|
2672
2909
|
|
2673
2910
|
|
@@ -2690,7 +2927,7 @@ Handle<Code> KeyedStoreStubCompiler::CompileStoreElement(
|
|
2690
2927
|
__ jmp(ic, RelocInfo::CODE_TARGET);
|
2691
2928
|
|
2692
2929
|
// Return the generated code.
|
2693
|
-
return GetCode(NORMAL, factory()->empty_string());
|
2930
|
+
return GetCode(Code::NORMAL, factory()->empty_string());
|
2694
2931
|
}
|
2695
2932
|
|
2696
2933
|
|
@@ -2725,13 +2962,15 @@ Handle<Code> KeyedStoreStubCompiler::CompileStorePolymorphic(
|
|
2725
2962
|
__ jmp(miss_ic, RelocInfo::CODE_TARGET);
|
2726
2963
|
|
2727
2964
|
// Return the generated code.
|
2728
|
-
return GetCode(NORMAL, factory()->empty_string(),
|
2965
|
+
return GetCode(Code::NORMAL, factory()->empty_string(), POLYMORPHIC);
|
2729
2966
|
}
|
2730
2967
|
|
2731
2968
|
|
2732
|
-
Handle<Code> LoadStubCompiler::CompileLoadNonexistent(
|
2733
|
-
|
2734
|
-
|
2969
|
+
Handle<Code> LoadStubCompiler::CompileLoadNonexistent(
|
2970
|
+
Handle<JSObject> object,
|
2971
|
+
Handle<JSObject> last,
|
2972
|
+
Handle<String> name,
|
2973
|
+
Handle<GlobalObject> global) {
|
2735
2974
|
// ----------- S t a t e -------------
|
2736
2975
|
// -- ecx : name
|
2737
2976
|
// -- edx : receiver
|
@@ -2742,18 +2981,25 @@ Handle<Code> LoadStubCompiler::CompileLoadNonexistent(Handle<String> name,
|
|
2742
2981
|
// Check that the receiver isn't a smi.
|
2743
2982
|
__ JumpIfSmi(edx, &miss);
|
2744
2983
|
|
2745
|
-
|
2984
|
+
Register scratch = eax;
|
2746
2985
|
|
2747
2986
|
// Check the maps of the full prototype chain. Also check that
|
2748
2987
|
// global property cells up to (but not including) the last object
|
2749
2988
|
// in the prototype chain are empty.
|
2750
|
-
|
2989
|
+
Register result =
|
2990
|
+
CheckPrototypes(object, edx, last, ebx, scratch, edi, name, &miss);
|
2751
2991
|
|
2752
2992
|
// If the last object in the prototype chain is a global object,
|
2753
2993
|
// check that the global property cell is empty.
|
2754
|
-
if (
|
2755
|
-
GenerateCheckPropertyCell(
|
2756
|
-
|
2994
|
+
if (!global.is_null()) {
|
2995
|
+
GenerateCheckPropertyCell(masm(), global, name, scratch, &miss);
|
2996
|
+
}
|
2997
|
+
|
2998
|
+
if (!last->HasFastProperties()) {
|
2999
|
+
__ mov(scratch, FieldOperand(result, HeapObject::kMapOffset));
|
3000
|
+
__ mov(scratch, FieldOperand(scratch, Map::kPrototypeOffset));
|
3001
|
+
__ cmp(scratch, isolate()->factory()->null_value());
|
3002
|
+
__ j(not_equal, &miss);
|
2757
3003
|
}
|
2758
3004
|
|
2759
3005
|
// Return undefined if maps of the full prototype chain are still the
|
@@ -2765,75 +3011,74 @@ Handle<Code> LoadStubCompiler::CompileLoadNonexistent(Handle<String> name,
|
|
2765
3011
|
GenerateLoadMiss(masm(), Code::LOAD_IC);
|
2766
3012
|
|
2767
3013
|
// Return the generated code.
|
2768
|
-
return GetCode(NONEXISTENT, factory()->empty_string());
|
3014
|
+
return GetCode(Code::NONEXISTENT, factory()->empty_string());
|
2769
3015
|
}
|
2770
3016
|
|
2771
3017
|
|
2772
|
-
|
2773
|
-
|
2774
|
-
|
2775
|
-
|
2776
|
-
|
2777
|
-
// -- ecx : name
|
2778
|
-
// -- edx : receiver
|
2779
|
-
// -- esp[0] : return address
|
2780
|
-
// -----------------------------------
|
2781
|
-
Label miss;
|
3018
|
+
Register* LoadStubCompiler::registers() {
|
3019
|
+
// receiver, name, scratch1, scratch2, scratch3, scratch4.
|
3020
|
+
static Register registers[] = { edx, ecx, ebx, eax, edi, no_reg };
|
3021
|
+
return registers;
|
3022
|
+
}
|
2782
3023
|
|
2783
|
-
GenerateLoadField(object, holder, edx, ebx, eax, edi, index, name, &miss);
|
2784
|
-
__ bind(&miss);
|
2785
|
-
GenerateLoadMiss(masm(), Code::LOAD_IC);
|
2786
3024
|
|
2787
|
-
|
2788
|
-
|
3025
|
+
Register* KeyedLoadStubCompiler::registers() {
|
3026
|
+
// receiver, name, scratch1, scratch2, scratch3, scratch4.
|
3027
|
+
static Register registers[] = { edx, ecx, ebx, eax, edi, no_reg };
|
3028
|
+
return registers;
|
2789
3029
|
}
|
2790
3030
|
|
2791
3031
|
|
2792
|
-
Handle<
|
2793
|
-
|
2794
|
-
|
2795
|
-
|
2796
|
-
|
2797
|
-
|
2798
|
-
// -- ecx : name
|
2799
|
-
// -- edx : receiver
|
2800
|
-
// -- esp[0] : return address
|
2801
|
-
// -----------------------------------
|
2802
|
-
Label miss;
|
3032
|
+
void KeyedLoadStubCompiler::GenerateNameCheck(Handle<String> name,
|
3033
|
+
Register name_reg,
|
3034
|
+
Label* miss) {
|
3035
|
+
__ cmp(name_reg, Immediate(name));
|
3036
|
+
__ j(not_equal, miss);
|
3037
|
+
}
|
2803
3038
|
|
2804
|
-
GenerateLoadCallback(object, holder, edx, ecx, ebx, eax, edi, callback,
|
2805
|
-
name, &miss);
|
2806
|
-
__ bind(&miss);
|
2807
|
-
GenerateLoadMiss(masm(), Code::LOAD_IC);
|
2808
3039
|
|
2809
|
-
|
2810
|
-
|
2811
|
-
}
|
3040
|
+
#undef __
|
3041
|
+
#define __ ACCESS_MASM(masm)
|
2812
3042
|
|
2813
3043
|
|
2814
|
-
|
2815
|
-
|
2816
|
-
Handle<JSFunction> value,
|
2817
|
-
Handle<String> name) {
|
3044
|
+
void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm,
|
3045
|
+
Handle<JSFunction> getter) {
|
2818
3046
|
// ----------- S t a t e -------------
|
2819
3047
|
// -- ecx : name
|
2820
3048
|
// -- edx : receiver
|
2821
3049
|
// -- esp[0] : return address
|
2822
3050
|
// -----------------------------------
|
2823
|
-
|
3051
|
+
{
|
3052
|
+
FrameScope scope(masm, StackFrame::INTERNAL);
|
2824
3053
|
|
2825
|
-
|
2826
|
-
|
2827
|
-
|
3054
|
+
if (!getter.is_null()) {
|
3055
|
+
// Call the JavaScript getter with the receiver on the stack.
|
3056
|
+
__ push(edx);
|
3057
|
+
ParameterCount actual(0);
|
3058
|
+
__ InvokeFunction(getter, actual, CALL_FUNCTION, NullCallWrapper(),
|
3059
|
+
CALL_AS_METHOD);
|
3060
|
+
} else {
|
3061
|
+
// If we generate a global code snippet for deoptimization only, remember
|
3062
|
+
// the place to continue after deoptimization.
|
3063
|
+
masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset());
|
3064
|
+
}
|
2828
3065
|
|
2829
|
-
|
2830
|
-
|
3066
|
+
// Restore context register.
|
3067
|
+
__ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
|
3068
|
+
}
|
3069
|
+
__ ret(0);
|
2831
3070
|
}
|
2832
3071
|
|
2833
3072
|
|
2834
|
-
|
2835
|
-
|
2836
|
-
|
3073
|
+
#undef __
|
3074
|
+
#define __ ACCESS_MASM(masm())
|
3075
|
+
|
3076
|
+
|
3077
|
+
Handle<Code> LoadStubCompiler::CompileLoadViaGetter(
|
3078
|
+
Handle<JSObject> receiver,
|
3079
|
+
Handle<JSObject> holder,
|
3080
|
+
Handle<String> name,
|
3081
|
+
Handle<JSFunction> getter) {
|
2837
3082
|
// ----------- S t a t e -------------
|
2838
3083
|
// -- ecx : name
|
2839
3084
|
// -- edx : receiver
|
@@ -2841,19 +3086,17 @@ Handle<Code> LoadStubCompiler::CompileLoadInterceptor(Handle<JSObject> receiver,
|
|
2841
3086
|
// -----------------------------------
|
2842
3087
|
Label miss;
|
2843
3088
|
|
2844
|
-
|
2845
|
-
|
3089
|
+
// Check that the maps haven't changed.
|
3090
|
+
__ JumpIfSmi(edx, &miss);
|
3091
|
+
CheckPrototypes(receiver, edx, holder, ebx, eax, edi, name, &miss);
|
2846
3092
|
|
2847
|
-
|
2848
|
-
// prototypes and ultimate answer.
|
2849
|
-
GenerateLoadInterceptor(receiver, holder, &lookup, edx, ecx, eax, ebx, edi,
|
2850
|
-
name, &miss);
|
3093
|
+
GenerateLoadViaGetter(masm(), getter);
|
2851
3094
|
|
2852
3095
|
__ bind(&miss);
|
2853
3096
|
GenerateLoadMiss(masm(), Code::LOAD_IC);
|
2854
3097
|
|
2855
3098
|
// Return the generated code.
|
2856
|
-
return GetCode(
|
3099
|
+
return GetCode(Code::CALLBACKS, name);
|
2857
3100
|
}
|
2858
3101
|
|
2859
3102
|
|
@@ -2901,253 +3144,62 @@ Handle<Code> LoadStubCompiler::CompileLoadGlobal(
|
|
2901
3144
|
GenerateLoadMiss(masm(), Code::LOAD_IC);
|
2902
3145
|
|
2903
3146
|
// Return the generated code.
|
2904
|
-
return GetCode(NORMAL, name);
|
3147
|
+
return GetCode(Code::NORMAL, name);
|
2905
3148
|
}
|
2906
3149
|
|
2907
3150
|
|
2908
|
-
Handle<Code> KeyedLoadStubCompiler::
|
2909
|
-
|
2910
|
-
Handle<JSObject> holder,
|
2911
|
-
int index) {
|
3151
|
+
Handle<Code> KeyedLoadStubCompiler::CompileLoadElement(
|
3152
|
+
Handle<Map> receiver_map) {
|
2912
3153
|
// ----------- S t a t e -------------
|
2913
3154
|
// -- ecx : key
|
2914
3155
|
// -- edx : receiver
|
2915
3156
|
// -- esp[0] : return address
|
2916
3157
|
// -----------------------------------
|
2917
|
-
Label miss;
|
2918
|
-
|
2919
|
-
Counters* counters = isolate()->counters();
|
2920
|
-
__ IncrementCounter(counters->keyed_load_field(), 1);
|
2921
|
-
|
2922
|
-
// Check that the name has not changed.
|
2923
|
-
__ cmp(ecx, Immediate(name));
|
2924
|
-
__ j(not_equal, &miss);
|
2925
3158
|
|
2926
|
-
|
3159
|
+
ElementsKind elements_kind = receiver_map->elements_kind();
|
3160
|
+
if (receiver_map->has_fast_elements() ||
|
3161
|
+
receiver_map->has_external_array_elements()) {
|
3162
|
+
Handle<Code> stub = KeyedLoadFastElementStub(
|
3163
|
+
receiver_map->instance_type() == JS_ARRAY_TYPE,
|
3164
|
+
elements_kind).GetCode();
|
3165
|
+
__ DispatchMap(edx, receiver_map, stub, DO_SMI_CHECK);
|
3166
|
+
} else {
|
3167
|
+
Handle<Code> stub =
|
3168
|
+
KeyedLoadDictionaryElementStub().GetCode();
|
3169
|
+
__ DispatchMap(edx, receiver_map, stub, DO_SMI_CHECK);
|
3170
|
+
}
|
2927
3171
|
|
2928
|
-
__ bind(&miss);
|
2929
|
-
__ DecrementCounter(counters->keyed_load_field(), 1);
|
2930
3172
|
GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
|
2931
3173
|
|
2932
3174
|
// Return the generated code.
|
2933
|
-
return GetCode(
|
3175
|
+
return GetCode(Code::NORMAL, factory()->empty_string());
|
2934
3176
|
}
|
2935
3177
|
|
2936
3178
|
|
2937
|
-
Handle<Code> KeyedLoadStubCompiler::
|
2938
|
-
|
2939
|
-
|
2940
|
-
Handle<JSObject> holder,
|
2941
|
-
Handle<AccessorInfo> callback) {
|
3179
|
+
Handle<Code> KeyedLoadStubCompiler::CompileLoadPolymorphic(
|
3180
|
+
MapHandleList* receiver_maps,
|
3181
|
+
CodeHandleList* handler_ics) {
|
2942
3182
|
// ----------- S t a t e -------------
|
2943
3183
|
// -- ecx : key
|
2944
3184
|
// -- edx : receiver
|
2945
3185
|
// -- esp[0] : return address
|
2946
3186
|
// -----------------------------------
|
2947
3187
|
Label miss;
|
3188
|
+
__ JumpIfSmi(edx, &miss);
|
2948
3189
|
|
2949
|
-
|
2950
|
-
__
|
2951
|
-
|
2952
|
-
|
2953
|
-
|
2954
|
-
|
2955
|
-
|
2956
|
-
GenerateLoadCallback(receiver, holder, edx, ecx, ebx, eax, edi, callback,
|
2957
|
-
name, &miss);
|
2958
|
-
|
2959
|
-
__ bind(&miss);
|
2960
|
-
__ DecrementCounter(counters->keyed_load_callback(), 1);
|
2961
|
-
GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
|
2962
|
-
|
2963
|
-
// Return the generated code.
|
2964
|
-
return GetCode(CALLBACKS, name);
|
2965
|
-
}
|
2966
|
-
|
2967
|
-
|
2968
|
-
Handle<Code> KeyedLoadStubCompiler::CompileLoadConstant(
|
2969
|
-
Handle<String> name,
|
2970
|
-
Handle<JSObject> receiver,
|
2971
|
-
Handle<JSObject> holder,
|
2972
|
-
Handle<JSFunction> value) {
|
2973
|
-
// ----------- S t a t e -------------
|
2974
|
-
// -- ecx : key
|
2975
|
-
// -- edx : receiver
|
2976
|
-
// -- esp[0] : return address
|
2977
|
-
// -----------------------------------
|
2978
|
-
Label miss;
|
2979
|
-
|
2980
|
-
Counters* counters = isolate()->counters();
|
2981
|
-
__ IncrementCounter(counters->keyed_load_constant_function(), 1);
|
2982
|
-
|
2983
|
-
// Check that the name has not changed.
|
2984
|
-
__ cmp(ecx, Immediate(name));
|
2985
|
-
__ j(not_equal, &miss);
|
2986
|
-
|
2987
|
-
GenerateLoadConstant(
|
2988
|
-
receiver, holder, edx, ebx, eax, edi, value, name, &miss);
|
2989
|
-
__ bind(&miss);
|
2990
|
-
__ DecrementCounter(counters->keyed_load_constant_function(), 1);
|
2991
|
-
GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
|
2992
|
-
|
2993
|
-
// Return the generated code.
|
2994
|
-
return GetCode(CONSTANT_FUNCTION, name);
|
2995
|
-
}
|
2996
|
-
|
2997
|
-
|
2998
|
-
Handle<Code> KeyedLoadStubCompiler::CompileLoadInterceptor(
|
2999
|
-
Handle<JSObject> receiver,
|
3000
|
-
Handle<JSObject> holder,
|
3001
|
-
Handle<String> name) {
|
3002
|
-
// ----------- S t a t e -------------
|
3003
|
-
// -- ecx : key
|
3004
|
-
// -- edx : receiver
|
3005
|
-
// -- esp[0] : return address
|
3006
|
-
// -----------------------------------
|
3007
|
-
Label miss;
|
3008
|
-
|
3009
|
-
Counters* counters = isolate()->counters();
|
3010
|
-
__ IncrementCounter(counters->keyed_load_interceptor(), 1);
|
3011
|
-
|
3012
|
-
// Check that the name has not changed.
|
3013
|
-
__ cmp(ecx, Immediate(name));
|
3014
|
-
__ j(not_equal, &miss);
|
3015
|
-
|
3016
|
-
LookupResult lookup(isolate());
|
3017
|
-
LookupPostInterceptor(holder, name, &lookup);
|
3018
|
-
GenerateLoadInterceptor(receiver, holder, &lookup, edx, ecx, eax, ebx, edi,
|
3019
|
-
name, &miss);
|
3020
|
-
__ bind(&miss);
|
3021
|
-
__ DecrementCounter(counters->keyed_load_interceptor(), 1);
|
3022
|
-
GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
|
3023
|
-
|
3024
|
-
// Return the generated code.
|
3025
|
-
return GetCode(INTERCEPTOR, name);
|
3026
|
-
}
|
3027
|
-
|
3028
|
-
|
3029
|
-
Handle<Code> KeyedLoadStubCompiler::CompileLoadArrayLength(
|
3030
|
-
Handle<String> name) {
|
3031
|
-
// ----------- S t a t e -------------
|
3032
|
-
// -- ecx : key
|
3033
|
-
// -- edx : receiver
|
3034
|
-
// -- esp[0] : return address
|
3035
|
-
// -----------------------------------
|
3036
|
-
Label miss;
|
3037
|
-
|
3038
|
-
Counters* counters = isolate()->counters();
|
3039
|
-
__ IncrementCounter(counters->keyed_load_array_length(), 1);
|
3040
|
-
|
3041
|
-
// Check that the name has not changed.
|
3042
|
-
__ cmp(ecx, Immediate(name));
|
3043
|
-
__ j(not_equal, &miss);
|
3044
|
-
|
3045
|
-
GenerateLoadArrayLength(masm(), edx, eax, &miss);
|
3046
|
-
__ bind(&miss);
|
3047
|
-
__ DecrementCounter(counters->keyed_load_array_length(), 1);
|
3048
|
-
GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
|
3049
|
-
|
3050
|
-
// Return the generated code.
|
3051
|
-
return GetCode(CALLBACKS, name);
|
3052
|
-
}
|
3053
|
-
|
3054
|
-
|
3055
|
-
Handle<Code> KeyedLoadStubCompiler::CompileLoadStringLength(
|
3056
|
-
Handle<String> name) {
|
3057
|
-
// ----------- S t a t e -------------
|
3058
|
-
// -- ecx : key
|
3059
|
-
// -- edx : receiver
|
3060
|
-
// -- esp[0] : return address
|
3061
|
-
// -----------------------------------
|
3062
|
-
Label miss;
|
3063
|
-
|
3064
|
-
Counters* counters = isolate()->counters();
|
3065
|
-
__ IncrementCounter(counters->keyed_load_string_length(), 1);
|
3066
|
-
|
3067
|
-
// Check that the name has not changed.
|
3068
|
-
__ cmp(ecx, Immediate(name));
|
3069
|
-
__ j(not_equal, &miss);
|
3070
|
-
|
3071
|
-
GenerateLoadStringLength(masm(), edx, eax, ebx, &miss, true);
|
3072
|
-
__ bind(&miss);
|
3073
|
-
__ DecrementCounter(counters->keyed_load_string_length(), 1);
|
3074
|
-
GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
|
3075
|
-
|
3076
|
-
// Return the generated code.
|
3077
|
-
return GetCode(CALLBACKS, name);
|
3078
|
-
}
|
3079
|
-
|
3080
|
-
|
3081
|
-
Handle<Code> KeyedLoadStubCompiler::CompileLoadFunctionPrototype(
|
3082
|
-
Handle<String> name) {
|
3083
|
-
// ----------- S t a t e -------------
|
3084
|
-
// -- ecx : key
|
3085
|
-
// -- edx : receiver
|
3086
|
-
// -- esp[0] : return address
|
3087
|
-
// -----------------------------------
|
3088
|
-
Label miss;
|
3089
|
-
|
3090
|
-
Counters* counters = isolate()->counters();
|
3091
|
-
__ IncrementCounter(counters->keyed_load_function_prototype(), 1);
|
3092
|
-
|
3093
|
-
// Check that the name has not changed.
|
3094
|
-
__ cmp(ecx, Immediate(name));
|
3095
|
-
__ j(not_equal, &miss);
|
3096
|
-
|
3097
|
-
GenerateLoadFunctionPrototype(masm(), edx, eax, ebx, &miss);
|
3098
|
-
__ bind(&miss);
|
3099
|
-
__ DecrementCounter(counters->keyed_load_function_prototype(), 1);
|
3100
|
-
GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
|
3101
|
-
|
3102
|
-
// Return the generated code.
|
3103
|
-
return GetCode(CALLBACKS, name);
|
3104
|
-
}
|
3105
|
-
|
3106
|
-
|
3107
|
-
Handle<Code> KeyedLoadStubCompiler::CompileLoadElement(
|
3108
|
-
Handle<Map> receiver_map) {
|
3109
|
-
// ----------- S t a t e -------------
|
3110
|
-
// -- ecx : key
|
3111
|
-
// -- edx : receiver
|
3112
|
-
// -- esp[0] : return address
|
3113
|
-
// -----------------------------------
|
3114
|
-
|
3115
|
-
ElementsKind elements_kind = receiver_map->elements_kind();
|
3116
|
-
Handle<Code> stub = KeyedLoadElementStub(elements_kind).GetCode();
|
3117
|
-
|
3118
|
-
__ DispatchMap(edx, receiver_map, stub, DO_SMI_CHECK);
|
3119
|
-
|
3120
|
-
GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
|
3121
|
-
|
3122
|
-
// Return the generated code.
|
3123
|
-
return GetCode(NORMAL, factory()->empty_string());
|
3124
|
-
}
|
3125
|
-
|
3126
|
-
|
3127
|
-
Handle<Code> KeyedLoadStubCompiler::CompileLoadPolymorphic(
|
3128
|
-
MapHandleList* receiver_maps,
|
3129
|
-
CodeHandleList* handler_ics) {
|
3130
|
-
// ----------- S t a t e -------------
|
3131
|
-
// -- ecx : key
|
3132
|
-
// -- edx : receiver
|
3133
|
-
// -- esp[0] : return address
|
3134
|
-
// -----------------------------------
|
3135
|
-
Label miss;
|
3136
|
-
__ JumpIfSmi(edx, &miss);
|
3137
|
-
|
3138
|
-
Register map_reg = ebx;
|
3139
|
-
__ mov(map_reg, FieldOperand(edx, HeapObject::kMapOffset));
|
3140
|
-
int receiver_count = receiver_maps->length();
|
3141
|
-
for (int current = 0; current < receiver_count; ++current) {
|
3142
|
-
__ cmp(map_reg, receiver_maps->at(current));
|
3143
|
-
__ j(equal, handler_ics->at(current));
|
3144
|
-
}
|
3190
|
+
Register map_reg = ebx;
|
3191
|
+
__ mov(map_reg, FieldOperand(edx, HeapObject::kMapOffset));
|
3192
|
+
int receiver_count = receiver_maps->length();
|
3193
|
+
for (int current = 0; current < receiver_count; ++current) {
|
3194
|
+
__ cmp(map_reg, receiver_maps->at(current));
|
3195
|
+
__ j(equal, handler_ics->at(current));
|
3196
|
+
}
|
3145
3197
|
|
3146
3198
|
__ bind(&miss);
|
3147
3199
|
GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
|
3148
3200
|
|
3149
3201
|
// Return the generated code.
|
3150
|
-
return GetCode(NORMAL, factory()->empty_string(),
|
3202
|
+
return GetCode(Code::NORMAL, factory()->empty_string(), POLYMORPHIC);
|
3151
3203
|
}
|
3152
3204
|
|
3153
3205
|
|
@@ -3173,6 +3225,7 @@ Handle<Code> ConstructStubCompiler::CompileConstructStub(
|
|
3173
3225
|
#endif
|
3174
3226
|
|
3175
3227
|
// Load the initial map and verify that it is in fact a map.
|
3228
|
+
// edi: constructor
|
3176
3229
|
__ mov(ebx, FieldOperand(edi, JSFunction::kPrototypeOrInitialMapOffset));
|
3177
3230
|
// Will both indicate a NULL and a Smi.
|
3178
3231
|
__ JumpIfSmi(ebx, &generic_stub_call);
|
@@ -3181,19 +3234,23 @@ Handle<Code> ConstructStubCompiler::CompileConstructStub(
|
|
3181
3234
|
|
3182
3235
|
#ifdef DEBUG
|
3183
3236
|
// Cannot construct functions this way.
|
3184
|
-
// edi: constructor
|
3185
3237
|
// ebx: initial map
|
3186
3238
|
__ CmpInstanceType(ebx, JS_FUNCTION_TYPE);
|
3187
|
-
__
|
3239
|
+
__ Check(not_equal, "Function constructed by construct stub.");
|
3188
3240
|
#endif
|
3189
3241
|
|
3190
3242
|
// Now allocate the JSObject on the heap by moving the new space allocation
|
3191
3243
|
// top forward.
|
3192
|
-
// edi: constructor
|
3193
3244
|
// ebx: initial map
|
3245
|
+
ASSERT(function->has_initial_map());
|
3246
|
+
int instance_size = function->initial_map()->instance_size();
|
3247
|
+
#ifdef DEBUG
|
3194
3248
|
__ movzx_b(ecx, FieldOperand(ebx, Map::kInstanceSizeOffset));
|
3195
3249
|
__ shl(ecx, kPointerSizeLog2);
|
3196
|
-
__
|
3250
|
+
__ cmp(ecx, Immediate(instance_size));
|
3251
|
+
__ Check(equal, "Instance size of initial map changed.");
|
3252
|
+
#endif
|
3253
|
+
__ AllocateInNewSpace(instance_size, edx, ecx, no_reg,
|
3197
3254
|
&generic_stub_call, NO_ALLOCATION_FLAGS);
|
3198
3255
|
|
3199
3256
|
// Allocated the JSObject, now initialize the fields and add the heap tag.
|
@@ -3253,7 +3310,6 @@ Handle<Code> ConstructStubCompiler::CompileConstructStub(
|
|
3253
3310
|
}
|
3254
3311
|
|
3255
3312
|
// Fill the unused in-object property fields with undefined.
|
3256
|
-
ASSERT(function->has_initial_map());
|
3257
3313
|
for (int i = shared->this_property_assignments_count();
|
3258
3314
|
i < function->initial_map()->inobject_properties();
|
3259
3315
|
i++) {
|
@@ -3372,157 +3428,6 @@ static void GenerateSmiKeyCheck(MacroAssembler* masm,
|
|
3372
3428
|
}
|
3373
3429
|
|
3374
3430
|
|
3375
|
-
void KeyedLoadStubCompiler::GenerateLoadExternalArray(
|
3376
|
-
MacroAssembler* masm,
|
3377
|
-
ElementsKind elements_kind) {
|
3378
|
-
// ----------- S t a t e -------------
|
3379
|
-
// -- ecx : key
|
3380
|
-
// -- edx : receiver
|
3381
|
-
// -- esp[0] : return address
|
3382
|
-
// -----------------------------------
|
3383
|
-
Label miss_force_generic, failed_allocation, slow;
|
3384
|
-
|
3385
|
-
// This stub is meant to be tail-jumped to, the receiver must already
|
3386
|
-
// have been verified by the caller to not be a smi.
|
3387
|
-
|
3388
|
-
// Check that the key is a smi or a heap number convertible to a smi.
|
3389
|
-
GenerateSmiKeyCheck(masm, ecx, eax, xmm0, xmm1, &miss_force_generic);
|
3390
|
-
|
3391
|
-
// Check that the index is in range.
|
3392
|
-
__ mov(ebx, FieldOperand(edx, JSObject::kElementsOffset));
|
3393
|
-
__ cmp(ecx, FieldOperand(ebx, ExternalArray::kLengthOffset));
|
3394
|
-
// Unsigned comparison catches both negative and too-large values.
|
3395
|
-
__ j(above_equal, &miss_force_generic);
|
3396
|
-
__ mov(ebx, FieldOperand(ebx, ExternalArray::kExternalPointerOffset));
|
3397
|
-
// ebx: base pointer of external storage
|
3398
|
-
switch (elements_kind) {
|
3399
|
-
case EXTERNAL_BYTE_ELEMENTS:
|
3400
|
-
__ SmiUntag(ecx); // Untag the index.
|
3401
|
-
__ movsx_b(eax, Operand(ebx, ecx, times_1, 0));
|
3402
|
-
break;
|
3403
|
-
case EXTERNAL_UNSIGNED_BYTE_ELEMENTS:
|
3404
|
-
case EXTERNAL_PIXEL_ELEMENTS:
|
3405
|
-
__ SmiUntag(ecx); // Untag the index.
|
3406
|
-
__ movzx_b(eax, Operand(ebx, ecx, times_1, 0));
|
3407
|
-
break;
|
3408
|
-
case EXTERNAL_SHORT_ELEMENTS:
|
3409
|
-
__ movsx_w(eax, Operand(ebx, ecx, times_1, 0));
|
3410
|
-
break;
|
3411
|
-
case EXTERNAL_UNSIGNED_SHORT_ELEMENTS:
|
3412
|
-
__ movzx_w(eax, Operand(ebx, ecx, times_1, 0));
|
3413
|
-
break;
|
3414
|
-
case EXTERNAL_UNSIGNED_INT_ELEMENTS:
|
3415
|
-
case EXTERNAL_INT_ELEMENTS:
|
3416
|
-
__ mov(eax, Operand(ebx, ecx, times_2, 0));
|
3417
|
-
break;
|
3418
|
-
case EXTERNAL_FLOAT_ELEMENTS:
|
3419
|
-
__ fld_s(Operand(ebx, ecx, times_2, 0));
|
3420
|
-
break;
|
3421
|
-
case EXTERNAL_DOUBLE_ELEMENTS:
|
3422
|
-
__ fld_d(Operand(ebx, ecx, times_4, 0));
|
3423
|
-
break;
|
3424
|
-
default:
|
3425
|
-
UNREACHABLE();
|
3426
|
-
break;
|
3427
|
-
}
|
3428
|
-
|
3429
|
-
// For integer array types:
|
3430
|
-
// eax: value
|
3431
|
-
// For floating-point array type:
|
3432
|
-
// FP(0): value
|
3433
|
-
|
3434
|
-
if (elements_kind == EXTERNAL_INT_ELEMENTS ||
|
3435
|
-
elements_kind == EXTERNAL_UNSIGNED_INT_ELEMENTS) {
|
3436
|
-
// For the Int and UnsignedInt array types, we need to see whether
|
3437
|
-
// the value can be represented in a Smi. If not, we need to convert
|
3438
|
-
// it to a HeapNumber.
|
3439
|
-
Label box_int;
|
3440
|
-
if (elements_kind == EXTERNAL_INT_ELEMENTS) {
|
3441
|
-
__ cmp(eax, 0xc0000000);
|
3442
|
-
__ j(sign, &box_int);
|
3443
|
-
} else {
|
3444
|
-
ASSERT_EQ(EXTERNAL_UNSIGNED_INT_ELEMENTS, elements_kind);
|
3445
|
-
// The test is different for unsigned int values. Since we need
|
3446
|
-
// the value to be in the range of a positive smi, we can't
|
3447
|
-
// handle either of the top two bits being set in the value.
|
3448
|
-
__ test(eax, Immediate(0xc0000000));
|
3449
|
-
__ j(not_zero, &box_int);
|
3450
|
-
}
|
3451
|
-
|
3452
|
-
__ SmiTag(eax);
|
3453
|
-
__ ret(0);
|
3454
|
-
|
3455
|
-
__ bind(&box_int);
|
3456
|
-
|
3457
|
-
// Allocate a HeapNumber for the int and perform int-to-double
|
3458
|
-
// conversion.
|
3459
|
-
if (elements_kind == EXTERNAL_INT_ELEMENTS) {
|
3460
|
-
__ push(eax);
|
3461
|
-
__ fild_s(Operand(esp, 0));
|
3462
|
-
__ pop(eax);
|
3463
|
-
} else {
|
3464
|
-
ASSERT_EQ(EXTERNAL_UNSIGNED_INT_ELEMENTS, elements_kind);
|
3465
|
-
// Need to zero-extend the value.
|
3466
|
-
// There's no fild variant for unsigned values, so zero-extend
|
3467
|
-
// to a 64-bit int manually.
|
3468
|
-
__ push(Immediate(0));
|
3469
|
-
__ push(eax);
|
3470
|
-
__ fild_d(Operand(esp, 0));
|
3471
|
-
__ pop(eax);
|
3472
|
-
__ pop(eax);
|
3473
|
-
}
|
3474
|
-
// FP(0): value
|
3475
|
-
__ AllocateHeapNumber(eax, ebx, edi, &failed_allocation);
|
3476
|
-
// Set the value.
|
3477
|
-
__ fstp_d(FieldOperand(eax, HeapNumber::kValueOffset));
|
3478
|
-
__ ret(0);
|
3479
|
-
} else if (elements_kind == EXTERNAL_FLOAT_ELEMENTS ||
|
3480
|
-
elements_kind == EXTERNAL_DOUBLE_ELEMENTS) {
|
3481
|
-
// For the floating-point array type, we need to always allocate a
|
3482
|
-
// HeapNumber.
|
3483
|
-
__ AllocateHeapNumber(eax, ebx, edi, &failed_allocation);
|
3484
|
-
// Set the value.
|
3485
|
-
__ fstp_d(FieldOperand(eax, HeapNumber::kValueOffset));
|
3486
|
-
__ ret(0);
|
3487
|
-
} else {
|
3488
|
-
__ SmiTag(eax);
|
3489
|
-
__ ret(0);
|
3490
|
-
}
|
3491
|
-
|
3492
|
-
// If we fail allocation of the HeapNumber, we still have a value on
|
3493
|
-
// top of the FPU stack. Remove it.
|
3494
|
-
__ bind(&failed_allocation);
|
3495
|
-
__ fstp(0);
|
3496
|
-
// Fall through to slow case.
|
3497
|
-
|
3498
|
-
// Slow case: Jump to runtime.
|
3499
|
-
__ bind(&slow);
|
3500
|
-
Counters* counters = masm->isolate()->counters();
|
3501
|
-
__ IncrementCounter(counters->keyed_load_external_array_slow(), 1);
|
3502
|
-
|
3503
|
-
// ----------- S t a t e -------------
|
3504
|
-
// -- ecx : key
|
3505
|
-
// -- edx : receiver
|
3506
|
-
// -- esp[0] : return address
|
3507
|
-
// -----------------------------------
|
3508
|
-
|
3509
|
-
Handle<Code> ic = masm->isolate()->builtins()->KeyedLoadIC_Slow();
|
3510
|
-
__ jmp(ic, RelocInfo::CODE_TARGET);
|
3511
|
-
|
3512
|
-
// ----------- S t a t e -------------
|
3513
|
-
// -- ecx : key
|
3514
|
-
// -- edx : receiver
|
3515
|
-
// -- esp[0] : return address
|
3516
|
-
// -----------------------------------
|
3517
|
-
|
3518
|
-
// Miss case: Jump to runtime.
|
3519
|
-
__ bind(&miss_force_generic);
|
3520
|
-
Handle<Code> miss_ic =
|
3521
|
-
masm->isolate()->builtins()->KeyedLoadIC_MissForceGeneric();
|
3522
|
-
__ jmp(miss_ic, RelocInfo::CODE_TARGET);
|
3523
|
-
}
|
3524
|
-
|
3525
|
-
|
3526
3431
|
void KeyedStoreStubCompiler::GenerateStoreExternalArray(
|
3527
3432
|
MacroAssembler* masm,
|
3528
3433
|
ElementsKind elements_kind) {
|
@@ -3722,106 +3627,6 @@ void KeyedStoreStubCompiler::GenerateStoreExternalArray(
|
|
3722
3627
|
}
|
3723
3628
|
|
3724
3629
|
|
3725
|
-
void KeyedLoadStubCompiler::GenerateLoadFastElement(MacroAssembler* masm) {
|
3726
|
-
// ----------- S t a t e -------------
|
3727
|
-
// -- ecx : key
|
3728
|
-
// -- edx : receiver
|
3729
|
-
// -- esp[0] : return address
|
3730
|
-
// -----------------------------------
|
3731
|
-
Label miss_force_generic;
|
3732
|
-
|
3733
|
-
// This stub is meant to be tail-jumped to, the receiver must already
|
3734
|
-
// have been verified by the caller to not be a smi.
|
3735
|
-
|
3736
|
-
// Check that the key is a smi or a heap number convertible to a smi.
|
3737
|
-
GenerateSmiKeyCheck(masm, ecx, eax, xmm0, xmm1, &miss_force_generic);
|
3738
|
-
|
3739
|
-
// Get the elements array.
|
3740
|
-
__ mov(eax, FieldOperand(edx, JSObject::kElementsOffset));
|
3741
|
-
__ AssertFastElements(eax);
|
3742
|
-
|
3743
|
-
// Check that the key is within bounds.
|
3744
|
-
__ cmp(ecx, FieldOperand(eax, FixedArray::kLengthOffset));
|
3745
|
-
__ j(above_equal, &miss_force_generic);
|
3746
|
-
|
3747
|
-
// Load the result and make sure it's not the hole.
|
3748
|
-
__ mov(ebx, Operand(eax, ecx, times_2,
|
3749
|
-
FixedArray::kHeaderSize - kHeapObjectTag));
|
3750
|
-
__ cmp(ebx, masm->isolate()->factory()->the_hole_value());
|
3751
|
-
__ j(equal, &miss_force_generic);
|
3752
|
-
__ mov(eax, ebx);
|
3753
|
-
__ ret(0);
|
3754
|
-
|
3755
|
-
__ bind(&miss_force_generic);
|
3756
|
-
Handle<Code> miss_ic =
|
3757
|
-
masm->isolate()->builtins()->KeyedLoadIC_MissForceGeneric();
|
3758
|
-
__ jmp(miss_ic, RelocInfo::CODE_TARGET);
|
3759
|
-
}
|
3760
|
-
|
3761
|
-
|
3762
|
-
void KeyedLoadStubCompiler::GenerateLoadFastDoubleElement(
|
3763
|
-
MacroAssembler* masm) {
|
3764
|
-
// ----------- S t a t e -------------
|
3765
|
-
// -- ecx : key
|
3766
|
-
// -- edx : receiver
|
3767
|
-
// -- esp[0] : return address
|
3768
|
-
// -----------------------------------
|
3769
|
-
Label miss_force_generic, slow_allocate_heapnumber;
|
3770
|
-
|
3771
|
-
// This stub is meant to be tail-jumped to, the receiver must already
|
3772
|
-
// have been verified by the caller to not be a smi.
|
3773
|
-
|
3774
|
-
// Check that the key is a smi or a heap number convertible to a smi.
|
3775
|
-
GenerateSmiKeyCheck(masm, ecx, eax, xmm0, xmm1, &miss_force_generic);
|
3776
|
-
|
3777
|
-
// Get the elements array.
|
3778
|
-
__ mov(eax, FieldOperand(edx, JSObject::kElementsOffset));
|
3779
|
-
__ AssertFastElements(eax);
|
3780
|
-
|
3781
|
-
// Check that the key is within bounds.
|
3782
|
-
__ cmp(ecx, FieldOperand(eax, FixedDoubleArray::kLengthOffset));
|
3783
|
-
__ j(above_equal, &miss_force_generic);
|
3784
|
-
|
3785
|
-
// Check for the hole
|
3786
|
-
uint32_t offset = FixedDoubleArray::kHeaderSize + sizeof(kHoleNanLower32);
|
3787
|
-
__ cmp(FieldOperand(eax, ecx, times_4, offset), Immediate(kHoleNanUpper32));
|
3788
|
-
__ j(equal, &miss_force_generic);
|
3789
|
-
|
3790
|
-
// Always allocate a heap number for the result.
|
3791
|
-
if (CpuFeatures::IsSupported(SSE2)) {
|
3792
|
-
CpuFeatures::Scope use_sse2(SSE2);
|
3793
|
-
__ movdbl(xmm0, FieldOperand(eax, ecx, times_4,
|
3794
|
-
FixedDoubleArray::kHeaderSize));
|
3795
|
-
} else {
|
3796
|
-
__ fld_d(FieldOperand(eax, ecx, times_4, FixedDoubleArray::kHeaderSize));
|
3797
|
-
}
|
3798
|
-
__ AllocateHeapNumber(eax, ebx, edi, &slow_allocate_heapnumber);
|
3799
|
-
// Set the value.
|
3800
|
-
if (CpuFeatures::IsSupported(SSE2)) {
|
3801
|
-
CpuFeatures::Scope use_sse2(SSE2);
|
3802
|
-
__ movdbl(FieldOperand(eax, HeapNumber::kValueOffset), xmm0);
|
3803
|
-
} else {
|
3804
|
-
__ fstp_d(FieldOperand(eax, HeapNumber::kValueOffset));
|
3805
|
-
}
|
3806
|
-
__ ret(0);
|
3807
|
-
|
3808
|
-
__ bind(&slow_allocate_heapnumber);
|
3809
|
-
// A value was pushed on the floating point stack before the allocation, if
|
3810
|
-
// the allocation fails it needs to be removed.
|
3811
|
-
if (!CpuFeatures::IsSupported(SSE2)) {
|
3812
|
-
__ fstp(0);
|
3813
|
-
}
|
3814
|
-
Handle<Code> slow_ic =
|
3815
|
-
masm->isolate()->builtins()->KeyedLoadIC_Slow();
|
3816
|
-
__ jmp(slow_ic, RelocInfo::CODE_TARGET);
|
3817
|
-
|
3818
|
-
__ bind(&miss_force_generic);
|
3819
|
-
Handle<Code> miss_ic =
|
3820
|
-
masm->isolate()->builtins()->KeyedLoadIC_MissForceGeneric();
|
3821
|
-
__ jmp(miss_ic, RelocInfo::CODE_TARGET);
|
3822
|
-
}
|
3823
|
-
|
3824
|
-
|
3825
3630
|
void KeyedStoreStubCompiler::GenerateStoreFastElement(
|
3826
3631
|
MacroAssembler* masm,
|
3827
3632
|
bool is_js_array,
|
@@ -4064,13 +3869,22 @@ void KeyedStoreStubCompiler::GenerateStoreFastDoubleElement(
|
|
4064
3869
|
// ecx: key
|
4065
3870
|
// edx: receiver
|
4066
3871
|
// edi: elements
|
4067
|
-
// Initialize the new FixedDoubleArray.
|
4068
|
-
// efficiency, they are guaranteed to be initialized before use.
|
3872
|
+
// Initialize the new FixedDoubleArray.
|
4069
3873
|
__ mov(FieldOperand(edi, JSObject::kMapOffset),
|
4070
3874
|
Immediate(masm->isolate()->factory()->fixed_double_array_map()));
|
4071
3875
|
__ mov(FieldOperand(edi, FixedDoubleArray::kLengthOffset),
|
4072
3876
|
Immediate(Smi::FromInt(JSArray::kPreallocatedArrayElements)));
|
4073
3877
|
|
3878
|
+
__ StoreNumberToDoubleElements(eax, edi, ecx, ebx, xmm0,
|
3879
|
+
&transition_elements_kind, true);
|
3880
|
+
|
3881
|
+
for (int i = 1; i < JSArray::kPreallocatedArrayElements; i++) {
|
3882
|
+
int offset = FixedDoubleArray::OffsetOfElementAt(i);
|
3883
|
+
__ mov(FieldOperand(edi, offset), Immediate(kHoleNanLower32));
|
3884
|
+
__ mov(FieldOperand(edi, offset + kPointerSize),
|
3885
|
+
Immediate(kHoleNanUpper32));
|
3886
|
+
}
|
3887
|
+
|
4074
3888
|
// Install the new backing store in the JSArray.
|
4075
3889
|
__ mov(FieldOperand(edx, JSObject::kElementsOffset), edi);
|
4076
3890
|
__ RecordWriteField(edx, JSObject::kElementsOffset, edi, ebx,
|
@@ -4080,7 +3894,7 @@ void KeyedStoreStubCompiler::GenerateStoreFastDoubleElement(
|
|
4080
3894
|
__ add(FieldOperand(edx, JSArray::kLengthOffset),
|
4081
3895
|
Immediate(Smi::FromInt(1)));
|
4082
3896
|
__ mov(edi, FieldOperand(edx, JSObject::kElementsOffset));
|
4083
|
-
__
|
3897
|
+
__ ret(0);
|
4084
3898
|
|
4085
3899
|
__ bind(&check_capacity);
|
4086
3900
|
// eax: value
|