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
|
// Default scratch register used by MacroAssembler (and other code that needs
|
51
39
|
// a spare register). The register isn't callee save, and not used by the
|
52
40
|
// function calling convention.
|
@@ -317,6 +305,7 @@ class MacroAssembler: public Assembler {
|
|
317
305
|
void PopSafepointRegisters() { Popad(); }
|
318
306
|
// Store the value in register src in the safepoint register stack
|
319
307
|
// slot for register dst.
|
308
|
+
void StoreToSafepointRegisterSlot(Register dst, const Immediate& imm);
|
320
309
|
void StoreToSafepointRegisterSlot(Register dst, Register src);
|
321
310
|
void LoadFromSafepointRegisterSlot(Register dst, Register src);
|
322
311
|
|
@@ -384,7 +373,7 @@ class MacroAssembler: public Assembler {
|
|
384
373
|
void InitializeSmiConstantRegister() {
|
385
374
|
movq(kSmiConstantRegister,
|
386
375
|
reinterpret_cast<uint64_t>(Smi::FromInt(kSmiConstantRegisterValue)),
|
387
|
-
RelocInfo::
|
376
|
+
RelocInfo::NONE64);
|
388
377
|
}
|
389
378
|
|
390
379
|
// Conversions between tagged smi values and non-tagged integer values.
|
@@ -774,6 +763,11 @@ class MacroAssembler: public Assembler {
|
|
774
763
|
// Move if the registers are not identical.
|
775
764
|
void Move(Register target, Register source);
|
776
765
|
|
766
|
+
// Support for constant splitting.
|
767
|
+
bool IsUnsafeInt(const int x);
|
768
|
+
void SafeMove(Register dst, Smi* src);
|
769
|
+
void SafePush(Smi* src);
|
770
|
+
|
777
771
|
// Bit-field support.
|
778
772
|
void TestBit(const Operand& dst, int bit_index);
|
779
773
|
|
@@ -817,7 +811,7 @@ class MacroAssembler: public Assembler {
|
|
817
811
|
void Call(ExternalReference ext);
|
818
812
|
void Call(Handle<Code> code_object,
|
819
813
|
RelocInfo::Mode rmode,
|
820
|
-
|
814
|
+
TypeFeedbackId ast_id = TypeFeedbackId::None());
|
821
815
|
|
822
816
|
// The size of the code generated for different call instructions.
|
823
817
|
int CallSize(Address destination, RelocInfo::Mode rmode) {
|
@@ -889,7 +883,8 @@ class MacroAssembler: public Assembler {
|
|
889
883
|
Register elements,
|
890
884
|
Register index,
|
891
885
|
XMMRegister xmm_scratch,
|
892
|
-
Label* fail
|
886
|
+
Label* fail,
|
887
|
+
int elements_offset = 0);
|
893
888
|
|
894
889
|
// Compare an object's map with the specified map and its transitioned
|
895
890
|
// elements maps if mode is ALLOW_ELEMENT_TRANSITION_MAPS. FLAGS are set with
|
@@ -936,32 +931,45 @@ class MacroAssembler: public Assembler {
|
|
936
931
|
|
937
932
|
void ClampDoubleToUint8(XMMRegister input_reg,
|
938
933
|
XMMRegister temp_xmm_reg,
|
939
|
-
Register result_reg
|
940
|
-
|
934
|
+
Register result_reg);
|
935
|
+
|
936
|
+
void LoadUint32(XMMRegister dst, Register src, XMMRegister scratch);
|
941
937
|
|
942
938
|
void LoadInstanceDescriptors(Register map, Register descriptors);
|
939
|
+
void EnumLength(Register dst, Register map);
|
940
|
+
void NumberOfOwnDescriptors(Register dst, Register map);
|
941
|
+
|
942
|
+
template<typename Field>
|
943
|
+
void DecodeField(Register reg) {
|
944
|
+
static const int shift = Field::kShift + kSmiShift;
|
945
|
+
static const int mask = Field::kMask >> Field::kShift;
|
946
|
+
shr(reg, Immediate(shift));
|
947
|
+
and_(reg, Immediate(mask));
|
948
|
+
shl(reg, Immediate(kSmiShift));
|
949
|
+
}
|
943
950
|
|
944
|
-
// Abort execution if argument is not a number
|
945
|
-
void
|
951
|
+
// Abort execution if argument is not a number, enabled via --debug-code.
|
952
|
+
void AssertNumber(Register object);
|
946
953
|
|
947
|
-
// Abort execution if argument is a smi
|
948
|
-
void
|
954
|
+
// Abort execution if argument is a smi, enabled via --debug-code.
|
955
|
+
void AssertNotSmi(Register object);
|
949
956
|
|
950
|
-
// Abort execution if argument is not a smi
|
951
|
-
void
|
952
|
-
void
|
957
|
+
// Abort execution if argument is not a smi, enabled via --debug-code.
|
958
|
+
void AssertSmi(Register object);
|
959
|
+
void AssertSmi(const Operand& object);
|
953
960
|
|
954
961
|
// Abort execution if a 64 bit register containing a 32 bit payload does not
|
955
|
-
// have zeros in the top 32 bits.
|
956
|
-
void
|
962
|
+
// have zeros in the top 32 bits, enabled via --debug-code.
|
963
|
+
void AssertZeroExtended(Register reg);
|
957
964
|
|
958
|
-
// Abort execution if argument is a string
|
959
|
-
void
|
965
|
+
// Abort execution if argument is not a string, enabled via --debug-code.
|
966
|
+
void AssertString(Register object);
|
960
967
|
|
961
|
-
// Abort execution if argument is not the root value with the given index
|
962
|
-
|
963
|
-
|
964
|
-
|
968
|
+
// Abort execution if argument is not the root value with the given index,
|
969
|
+
// enabled via --debug-code.
|
970
|
+
void AssertRootValue(Register src,
|
971
|
+
Heap::RootListIndex root_value_index,
|
972
|
+
const char* message);
|
965
973
|
|
966
974
|
// ---------------------------------------------------------------------------
|
967
975
|
// Exception handling
|
@@ -1128,8 +1136,8 @@ class MacroAssembler: public Assembler {
|
|
1128
1136
|
void LoadContext(Register dst, int context_chain_length);
|
1129
1137
|
|
1130
1138
|
// Conditionally load the cached Array transitioned map of type
|
1131
|
-
// transitioned_kind from the
|
1132
|
-
// map_in_out is the cached Array map in the
|
1139
|
+
// transitioned_kind from the native context if the map in register
|
1140
|
+
// map_in_out is the cached Array map in the native context of
|
1133
1141
|
// expected_kind.
|
1134
1142
|
void LoadTransitionedArrayMapConditional(
|
1135
1143
|
ElementsKind expected_kind,
|
@@ -1155,7 +1163,7 @@ class MacroAssembler: public Assembler {
|
|
1155
1163
|
// Runtime calls
|
1156
1164
|
|
1157
1165
|
// Call a code stub.
|
1158
|
-
void CallStub(CodeStub* stub,
|
1166
|
+
void CallStub(CodeStub* stub, TypeFeedbackId ast_id = TypeFeedbackId::None());
|
1159
1167
|
|
1160
1168
|
// Tail call a code stub (jump).
|
1161
1169
|
void TailCallStub(CodeStub* stub);
|
@@ -1307,6 +1315,15 @@ class MacroAssembler: public Assembler {
|
|
1307
1315
|
void CheckEnumCache(Register null_value,
|
1308
1316
|
Label* call_runtime);
|
1309
1317
|
|
1318
|
+
// AllocationSiteInfo support. Arrays may have an associated
|
1319
|
+
// AllocationSiteInfo object that can be checked for in order to pretransition
|
1320
|
+
// to another type.
|
1321
|
+
// On entry, receiver_reg should point to the array object.
|
1322
|
+
// scratch_reg gets clobbered.
|
1323
|
+
// If allocation info is present, condition flags are set to equal
|
1324
|
+
void TestJSArrayForAllocationSiteInfo(Register receiver_reg,
|
1325
|
+
Register scratch_reg);
|
1326
|
+
|
1310
1327
|
private:
|
1311
1328
|
// Order general registers are pushed by Pushad.
|
1312
1329
|
// rax, rcx, rdx, rbx, rsi, rdi, r8, r9, r11, r14, r15.
|
@@ -1323,6 +1340,8 @@ class MacroAssembler: public Assembler {
|
|
1323
1340
|
// modified. It may be the "smi 1 constant" register.
|
1324
1341
|
Register GetSmiConstant(Smi* value);
|
1325
1342
|
|
1343
|
+
intptr_t RootRegisterDelta(ExternalReference other);
|
1344
|
+
|
1326
1345
|
// Moves the smi value to the destination register.
|
1327
1346
|
void LoadSmiConstant(Register dst, Smi* value);
|
1328
1347
|
|
@@ -1392,9 +1411,9 @@ class MacroAssembler: public Assembler {
|
|
1392
1411
|
return kNumSafepointRegisters - kSafepointPushRegisterIndices[reg_code] - 1;
|
1393
1412
|
}
|
1394
1413
|
|
1395
|
-
// Needs access to SafepointRegisterStackIndex for
|
1414
|
+
// Needs access to SafepointRegisterStackIndex for compiled frame
|
1396
1415
|
// traversal.
|
1397
|
-
friend class
|
1416
|
+
friend class StandardFrame;
|
1398
1417
|
};
|
1399
1418
|
|
1400
1419
|
|
@@ -1442,7 +1461,7 @@ inline Operand ContextOperand(Register context, int index) {
|
|
1442
1461
|
|
1443
1462
|
|
1444
1463
|
inline Operand GlobalObjectOperand() {
|
1445
|
-
return ContextOperand(rsi, Context::
|
1464
|
+
return ContextOperand(rsi, Context::GLOBAL_OBJECT_INDEX);
|
1446
1465
|
}
|
1447
1466
|
|
1448
1467
|
|
@@ -1463,17 +1482,16 @@ extern void LogGeneratedCodeCoverage(const char* file_line);
|
|
1463
1482
|
#define CODE_COVERAGE_STRINGIFY(x) #x
|
1464
1483
|
#define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x)
|
1465
1484
|
#define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__)
|
1466
|
-
#define ACCESS_MASM(masm) {
|
1467
|
-
|
1468
|
-
|
1469
|
-
masm->
|
1470
|
-
masm->
|
1471
|
-
masm->
|
1472
|
-
masm->
|
1473
|
-
masm->
|
1474
|
-
masm->
|
1475
|
-
|
1476
|
-
} \
|
1485
|
+
#define ACCESS_MASM(masm) { \
|
1486
|
+
Address x64_coverage_function = FUNCTION_ADDR(LogGeneratedCodeCoverage); \
|
1487
|
+
masm->pushfq(); \
|
1488
|
+
masm->Pushad(); \
|
1489
|
+
masm->push(Immediate(reinterpret_cast<int>(&__FILE_LINE__))); \
|
1490
|
+
masm->Call(x64_coverage_function, RelocInfo::EXTERNAL_REFERENCE); \
|
1491
|
+
masm->pop(rax); \
|
1492
|
+
masm->Popad(); \
|
1493
|
+
masm->popfq(); \
|
1494
|
+
} \
|
1477
1495
|
masm->
|
1478
1496
|
#else
|
1479
1497
|
#define ACCESS_MASM(masm) masm->
|
@@ -117,10 +117,12 @@ namespace internal {
|
|
117
117
|
|
118
118
|
RegExpMacroAssemblerX64::RegExpMacroAssemblerX64(
|
119
119
|
Mode mode,
|
120
|
-
int registers_to_save
|
121
|
-
|
120
|
+
int registers_to_save,
|
121
|
+
Zone* zone)
|
122
|
+
: NativeRegExpMacroAssembler(zone),
|
123
|
+
masm_(Isolate::Current(), NULL, kRegExpCodeSize),
|
122
124
|
no_root_array_scope_(&masm_),
|
123
|
-
code_relative_fixup_positions_(4),
|
125
|
+
code_relative_fixup_positions_(4, zone),
|
124
126
|
mode_(mode),
|
125
127
|
num_registers_(registers_to_save),
|
126
128
|
num_saved_registers_(registers_to_save),
|
@@ -232,7 +234,7 @@ void RegExpMacroAssemblerX64::CheckCharacters(Vector<const uc16> str,
|
|
232
234
|
// If input is ASCII, don't even bother calling here if the string to
|
233
235
|
// match contains a non-ASCII character.
|
234
236
|
if (mode_ == ASCII) {
|
235
|
-
ASSERT(String::
|
237
|
+
ASSERT(String::IsOneByte(str.start(), str.length()));
|
236
238
|
}
|
237
239
|
#endif
|
238
240
|
int byte_length = str.length() * char_size();
|
@@ -278,7 +280,7 @@ void RegExpMacroAssemblerX64::CheckCharacters(Vector<const uc16> str,
|
|
278
280
|
(static_cast<uint64_t>(str[i + 5]) << 40) ||
|
279
281
|
(static_cast<uint64_t>(str[i + 6]) << 48) ||
|
280
282
|
(static_cast<uint64_t>(str[i + 7]) << 56);
|
281
|
-
__ movq(rax, combined_chars, RelocInfo::
|
283
|
+
__ movq(rax, combined_chars, RelocInfo::NONE64);
|
282
284
|
__ cmpq(rax, Operand(rbx, byte_offset + i));
|
283
285
|
i += 8;
|
284
286
|
} else if (i + 4 <= n) {
|
@@ -298,7 +300,7 @@ void RegExpMacroAssemblerX64::CheckCharacters(Vector<const uc16> str,
|
|
298
300
|
ASSERT(mode_ == UC16);
|
299
301
|
if (i + 4 <= n) {
|
300
302
|
uint64_t combined_chars = *reinterpret_cast<const uint64_t*>(&str[i]);
|
301
|
-
__ movq(rax, combined_chars, RelocInfo::
|
303
|
+
__ movq(rax, combined_chars, RelocInfo::NONE64);
|
302
304
|
__ cmpq(rax,
|
303
305
|
Operand(rsi, rdi, times_1, byte_offset + i * sizeof(uc16)));
|
304
306
|
i += 4;
|
@@ -351,6 +353,14 @@ void RegExpMacroAssemblerX64::CheckNotBackReferenceIgnoreCase(
|
|
351
353
|
// In either case succeed immediately.
|
352
354
|
__ j(equal, &fallthrough);
|
353
355
|
|
356
|
+
// -----------------------
|
357
|
+
// rdx - Start of capture
|
358
|
+
// rbx - length of capture
|
359
|
+
// Check that there are sufficient characters left in the input.
|
360
|
+
__ movl(rax, rdi);
|
361
|
+
__ addl(rax, rbx);
|
362
|
+
BranchOrBacktrack(greater, on_no_match);
|
363
|
+
|
354
364
|
if (mode_ == ASCII) {
|
355
365
|
Label loop_increment;
|
356
366
|
if (on_no_match == NULL) {
|
@@ -383,8 +393,17 @@ void RegExpMacroAssemblerX64::CheckNotBackReferenceIgnoreCase(
|
|
383
393
|
__ j(not_equal, on_no_match); // Definitely not equal.
|
384
394
|
__ subb(rax, Immediate('a'));
|
385
395
|
__ cmpb(rax, Immediate('z' - 'a'));
|
396
|
+
#ifndef ENABLE_LATIN_1
|
386
397
|
__ j(above, on_no_match); // Weren't letters anyway.
|
387
|
-
|
398
|
+
#else
|
399
|
+
__ j(below_equal, &loop_increment); // In range 'a'-'z'.
|
400
|
+
// Latin-1: Check for values in range [224,254] but not 247.
|
401
|
+
__ subb(rax, Immediate(224 - 'a'));
|
402
|
+
__ cmpb(rax, Immediate(254 - 224));
|
403
|
+
__ j(above, on_no_match); // Weren't Latin-1 letters.
|
404
|
+
__ cmpb(rax, Immediate(247 - 224)); // Check for 247.
|
405
|
+
__ j(equal, on_no_match);
|
406
|
+
#endif
|
388
407
|
__ bind(&loop_increment);
|
389
408
|
// Increment pointers into match and capture strings.
|
390
409
|
__ addq(r11, Immediate(1));
|
@@ -527,15 +546,6 @@ void RegExpMacroAssemblerX64::CheckNotBackReference(
|
|
527
546
|
}
|
528
547
|
|
529
548
|
|
530
|
-
void RegExpMacroAssemblerX64::CheckNotRegistersEqual(int reg1,
|
531
|
-
int reg2,
|
532
|
-
Label* on_not_equal) {
|
533
|
-
__ movq(rax, register_location(reg1));
|
534
|
-
__ cmpq(rax, register_location(reg2));
|
535
|
-
BranchOrBacktrack(not_equal, on_not_equal);
|
536
|
-
}
|
537
|
-
|
538
|
-
|
539
549
|
void RegExpMacroAssemblerX64::CheckNotCharacter(uint32_t c,
|
540
550
|
Label* on_not_equal) {
|
541
551
|
__ cmpl(current_character(), Immediate(c));
|
@@ -609,7 +619,7 @@ void RegExpMacroAssemblerX64::CheckBitInTable(
|
|
609
619
|
Label* on_bit_set) {
|
610
620
|
__ Move(rax, table);
|
611
621
|
Register index = current_character();
|
612
|
-
if (mode_ != ASCII || kTableMask != String::
|
622
|
+
if (mode_ != ASCII || kTableMask != String::kMaxOneByteCharCode) {
|
613
623
|
__ movq(rbx, current_character());
|
614
624
|
__ and_(rbx, Immediate(kTableMask));
|
615
625
|
index = rbx;
|
@@ -926,7 +936,7 @@ Handle<HeapObject> RegExpMacroAssemblerX64::GetCode(Handle<String> source) {
|
|
926
936
|
}
|
927
937
|
for (int i = 0; i < num_saved_registers_; i++) {
|
928
938
|
__ movq(rax, register_location(i));
|
929
|
-
if (i == 0 &&
|
939
|
+
if (i == 0 && global_with_zero_length_check()) {
|
930
940
|
// Keep capture start in rdx for the zero-length check later.
|
931
941
|
__ movq(rdx, rax);
|
932
942
|
}
|
@@ -958,20 +968,23 @@ Handle<HeapObject> RegExpMacroAssemblerX64::GetCode(Handle<String> source) {
|
|
958
968
|
// Prepare rax to initialize registers with its value in the next run.
|
959
969
|
__ movq(rax, Operand(rbp, kInputStartMinusOne));
|
960
970
|
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
968
|
-
|
969
|
-
|
970
|
-
|
971
|
-
|
972
|
-
|
973
|
-
|
971
|
+
if (global_with_zero_length_check()) {
|
972
|
+
// Special case for zero-length matches.
|
973
|
+
// rdx: capture start index
|
974
|
+
__ cmpq(rdi, rdx);
|
975
|
+
// Not a zero-length match, restart.
|
976
|
+
__ j(not_equal, &load_char_start_regexp);
|
977
|
+
// rdi (offset from the end) is zero if we already reached the end.
|
978
|
+
__ testq(rdi, rdi);
|
979
|
+
__ j(zero, &exit_label_, Label::kNear);
|
980
|
+
// Advance current position after a zero-length match.
|
981
|
+
if (mode_ == UC16) {
|
982
|
+
__ addq(rdi, Immediate(2));
|
983
|
+
} else {
|
984
|
+
__ incq(rdi);
|
985
|
+
}
|
974
986
|
}
|
987
|
+
|
975
988
|
__ jmp(&load_char_start_regexp);
|
976
989
|
} else {
|
977
990
|
__ movq(rax, Immediate(SUCCESS));
|
@@ -1301,7 +1314,7 @@ int RegExpMacroAssemblerX64::CheckStackGuardState(Address* return_address,
|
|
1301
1314
|
Handle<String> subject(frame_entry<String*>(re_frame, kInputString));
|
1302
1315
|
|
1303
1316
|
// Current string.
|
1304
|
-
bool is_ascii = subject->
|
1317
|
+
bool is_ascii = subject->IsOneByteRepresentationUnderneath();
|
1305
1318
|
|
1306
1319
|
ASSERT(re_code->instruction_start() <= *return_address);
|
1307
1320
|
ASSERT(*return_address <=
|
@@ -1332,7 +1345,7 @@ int RegExpMacroAssemblerX64::CheckStackGuardState(Address* return_address,
|
|
1332
1345
|
}
|
1333
1346
|
|
1334
1347
|
// String might have changed.
|
1335
|
-
if (subject_tmp->
|
1348
|
+
if (subject_tmp->IsOneByteRepresentation() != is_ascii) {
|
1336
1349
|
// If we changed between an ASCII and an UC16 string, the specialized
|
1337
1350
|
// code cannot be used, and we need to restart regexp matching from
|
1338
1351
|
// scratch (including, potentially, compiling a new version of the code).
|
@@ -41,7 +41,7 @@ namespace internal {
|
|
41
41
|
|
42
42
|
class RegExpMacroAssemblerX64: public NativeRegExpMacroAssembler {
|
43
43
|
public:
|
44
|
-
RegExpMacroAssemblerX64(Mode mode, int registers_to_save);
|
44
|
+
RegExpMacroAssemblerX64(Mode mode, int registers_to_save, Zone* zone);
|
45
45
|
virtual ~RegExpMacroAssemblerX64();
|
46
46
|
virtual int stack_limit_slack();
|
47
47
|
virtual void AdvanceCurrentPosition(int by);
|
@@ -66,7 +66,6 @@ class RegExpMacroAssemblerX64: public NativeRegExpMacroAssembler {
|
|
66
66
|
virtual void CheckNotBackReference(int start_reg, Label* on_no_match);
|
67
67
|
virtual void CheckNotBackReferenceIgnoreCase(int start_reg,
|
68
68
|
Label* on_no_match);
|
69
|
-
virtual void CheckNotRegistersEqual(int reg1, int reg2, Label* on_not_equal);
|
70
69
|
virtual void CheckNotCharacter(uint32_t c, Label* on_not_equal);
|
71
70
|
virtual void CheckNotCharacterAfterAnd(uint32_t c,
|
72
71
|
uint32_t mask,
|
@@ -241,7 +240,7 @@ class RegExpMacroAssemblerX64: public NativeRegExpMacroAssembler {
|
|
241
240
|
void BranchOrBacktrack(Condition condition, Label* to);
|
242
241
|
|
243
242
|
void MarkPositionForCodeRelativeFixup() {
|
244
|
-
code_relative_fixup_positions_.Add(masm_.pc_offset());
|
243
|
+
code_relative_fixup_positions_.Add(masm_.pc_offset(), zone());
|
245
244
|
}
|
246
245
|
|
247
246
|
void FixupCodeRelativePositions();
|
@@ -228,15 +228,15 @@ void StubCompiler::GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm,
|
|
228
228
|
Register prototype) {
|
229
229
|
// Load the global or builtins object from the current context.
|
230
230
|
__ movq(prototype,
|
231
|
-
|
232
|
-
// Load the
|
231
|
+
Operand(rsi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
|
232
|
+
// Load the native context from the global or builtins object.
|
233
233
|
__ movq(prototype,
|
234
|
-
|
235
|
-
// Load the function from the
|
234
|
+
FieldOperand(prototype, GlobalObject::kNativeContextOffset));
|
235
|
+
// Load the function from the native context.
|
236
236
|
__ movq(prototype, Operand(prototype, Context::SlotOffset(index)));
|
237
237
|
// Load the initial map. The global functions all have initial maps.
|
238
238
|
__ movq(prototype,
|
239
|
-
|
239
|
+
FieldOperand(prototype, JSFunction::kPrototypeOrInitialMapOffset));
|
240
240
|
// Load the prototype from the initial map.
|
241
241
|
__ movq(prototype, FieldOperand(prototype, Map::kPrototypeOffset));
|
242
242
|
}
|
@@ -249,13 +249,13 @@ void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype(
|
|
249
249
|
Label* miss) {
|
250
250
|
Isolate* isolate = masm->isolate();
|
251
251
|
// Check we're still in the same context.
|
252
|
-
__ Move(prototype, isolate->
|
253
|
-
__ cmpq(Operand(rsi, Context::SlotOffset(Context::
|
252
|
+
__ Move(prototype, isolate->global_object());
|
253
|
+
__ cmpq(Operand(rsi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)),
|
254
254
|
prototype);
|
255
255
|
__ j(not_equal, miss);
|
256
256
|
// Get the global function with the given index.
|
257
257
|
Handle<JSFunction> function(
|
258
|
-
JSFunction::cast(isolate->
|
258
|
+
JSFunction::cast(isolate->native_context()->get(index)));
|
259
259
|
// Load its initial map. The global functions all have initial maps.
|
260
260
|
__ Move(prototype, Handle<Map>(function->initial_map()));
|
261
261
|
// Load the prototype from the initial map.
|
@@ -350,18 +350,23 @@ void StubCompiler::GenerateFastPropertyLoad(MacroAssembler* masm,
|
|
350
350
|
Register dst,
|
351
351
|
Register src,
|
352
352
|
Handle<JSObject> holder,
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
if (index < 0) {
|
357
|
-
// Get the property straight out of the holder.
|
358
|
-
int offset = holder->map()->instance_size() + (index * kPointerSize);
|
353
|
+
PropertyIndex index) {
|
354
|
+
if (index.is_header_index()) {
|
355
|
+
int offset = index.header_index() * kPointerSize;
|
359
356
|
__ movq(dst, FieldOperand(src, offset));
|
360
357
|
} else {
|
361
|
-
//
|
362
|
-
int
|
363
|
-
|
364
|
-
|
358
|
+
// Adjust for the number of properties stored in the holder.
|
359
|
+
int slot = index.field_index() - holder->map()->inobject_properties();
|
360
|
+
if (slot < 0) {
|
361
|
+
// Get the property straight out of the holder.
|
362
|
+
int offset = holder->map()->instance_size() + (slot * kPointerSize);
|
363
|
+
__ movq(dst, FieldOperand(src, offset));
|
364
|
+
} else {
|
365
|
+
// Calculate the offset into the properties array.
|
366
|
+
int offset = slot * kPointerSize + FixedArray::kHeaderSize;
|
367
|
+
__ movq(dst, FieldOperand(src, JSObject::kPropertiesOffset));
|
368
|
+
__ movq(dst, FieldOperand(dst, offset));
|
369
|
+
}
|
365
370
|
}
|
366
371
|
}
|
367
372
|
|
@@ -718,6 +723,15 @@ void StubCompiler::GenerateLoadMiss(MacroAssembler* masm, Code::Kind kind) {
|
|
718
723
|
}
|
719
724
|
|
720
725
|
|
726
|
+
void StubCompiler::GenerateStoreMiss(MacroAssembler* masm, Code::Kind kind) {
|
727
|
+
ASSERT(kind == Code::STORE_IC || kind == Code::KEYED_STORE_IC);
|
728
|
+
Handle<Code> code = (kind == Code::STORE_IC)
|
729
|
+
? masm->isolate()->builtins()->StoreIC_Miss()
|
730
|
+
: masm->isolate()->builtins()->KeyedStoreIC_Miss();
|
731
|
+
__ Jump(code, RelocInfo::CODE_TARGET);
|
732
|
+
}
|
733
|
+
|
734
|
+
|
721
735
|
void StubCompiler::GenerateKeyedLoadMissForceGeneric(MacroAssembler* masm) {
|
722
736
|
Handle<Code> code =
|
723
737
|
masm->isolate()->builtins()->KeyedLoadIC_MissForceGeneric();
|
@@ -731,10 +745,22 @@ void StubCompiler::GenerateStoreField(MacroAssembler* masm,
|
|
731
745
|
Handle<JSObject> object,
|
732
746
|
int index,
|
733
747
|
Handle<Map> transition,
|
748
|
+
Handle<String> name,
|
734
749
|
Register receiver_reg,
|
735
750
|
Register name_reg,
|
736
|
-
Register
|
751
|
+
Register scratch1,
|
752
|
+
Register scratch2,
|
737
753
|
Label* miss_label) {
|
754
|
+
LookupResult lookup(masm->isolate());
|
755
|
+
object->Lookup(*name, &lookup);
|
756
|
+
if (lookup.IsFound() && (lookup.IsReadOnly() || !lookup.IsCacheable())) {
|
757
|
+
// In sloppy mode, we could just return the value and be done. However, we
|
758
|
+
// might be in strict mode, where we have to throw. Since we cannot tell,
|
759
|
+
// go into slow case unconditionally.
|
760
|
+
__ jmp(miss_label);
|
761
|
+
return;
|
762
|
+
}
|
763
|
+
|
738
764
|
// Check that the map of the object hasn't changed.
|
739
765
|
CompareMapMode mode = transition.is_null() ? ALLOW_ELEMENT_TRANSITION_MAPS
|
740
766
|
: REQUIRE_EXACT_MAP;
|
@@ -743,7 +769,32 @@ void StubCompiler::GenerateStoreField(MacroAssembler* masm,
|
|
743
769
|
|
744
770
|
// Perform global security token check if needed.
|
745
771
|
if (object->IsJSGlobalProxy()) {
|
746
|
-
__ CheckAccessGlobalProxy(receiver_reg,
|
772
|
+
__ CheckAccessGlobalProxy(receiver_reg, scratch1, miss_label);
|
773
|
+
}
|
774
|
+
|
775
|
+
// Check that we are allowed to write this.
|
776
|
+
if (!transition.is_null() && object->GetPrototype()->IsJSObject()) {
|
777
|
+
JSObject* holder;
|
778
|
+
if (lookup.IsFound()) {
|
779
|
+
holder = lookup.holder();
|
780
|
+
} else {
|
781
|
+
// Find the top object.
|
782
|
+
holder = *object;
|
783
|
+
do {
|
784
|
+
holder = JSObject::cast(holder->GetPrototype());
|
785
|
+
} while (holder->GetPrototype()->IsJSObject());
|
786
|
+
}
|
787
|
+
// We need an extra register, push
|
788
|
+
__ push(name_reg);
|
789
|
+
Label miss_pop, done_check;
|
790
|
+
CheckPrototypes(object, receiver_reg, Handle<JSObject>(holder), name_reg,
|
791
|
+
scratch1, scratch2, name, &miss_pop);
|
792
|
+
__ jmp(&done_check);
|
793
|
+
__ bind(&miss_pop);
|
794
|
+
__ pop(name_reg);
|
795
|
+
__ jmp(miss_label);
|
796
|
+
__ bind(&done_check);
|
797
|
+
__ pop(name_reg);
|
747
798
|
}
|
748
799
|
|
749
800
|
// Stub never generated for non-global objects that require access
|
@@ -754,11 +805,11 @@ void StubCompiler::GenerateStoreField(MacroAssembler* masm,
|
|
754
805
|
if (!transition.is_null() && (object->map()->unused_property_fields() == 0)) {
|
755
806
|
// The properties must be extended before we can store the value.
|
756
807
|
// We jump to a runtime call that extends the properties array.
|
757
|
-
__ pop(
|
808
|
+
__ pop(scratch1); // Return address.
|
758
809
|
__ push(receiver_reg);
|
759
810
|
__ Push(transition);
|
760
811
|
__ push(rax);
|
761
|
-
__ push(
|
812
|
+
__ push(scratch1);
|
762
813
|
__ TailCallExternalReference(
|
763
814
|
ExternalReference(IC_Utility(IC::kSharedStoreIC_ExtendStorage),
|
764
815
|
masm->isolate()),
|
@@ -769,14 +820,14 @@ void StubCompiler::GenerateStoreField(MacroAssembler* masm,
|
|
769
820
|
|
770
821
|
if (!transition.is_null()) {
|
771
822
|
// Update the map of the object.
|
772
|
-
__ Move(
|
773
|
-
__ movq(FieldOperand(receiver_reg, HeapObject::kMapOffset),
|
823
|
+
__ Move(scratch1, transition);
|
824
|
+
__ movq(FieldOperand(receiver_reg, HeapObject::kMapOffset), scratch1);
|
774
825
|
|
775
826
|
// Update the write barrier for the map field and pass the now unused
|
776
827
|
// name_reg as scratch register.
|
777
828
|
__ RecordWriteField(receiver_reg,
|
778
829
|
HeapObject::kMapOffset,
|
779
|
-
|
830
|
+
scratch1,
|
780
831
|
name_reg,
|
781
832
|
kDontSaveFPRegs,
|
782
833
|
OMIT_REMEMBERED_SET,
|
@@ -797,19 +848,19 @@ void StubCompiler::GenerateStoreField(MacroAssembler* masm,
|
|
797
848
|
// Pass the value being stored in the now unused name_reg.
|
798
849
|
__ movq(name_reg, rax);
|
799
850
|
__ RecordWriteField(
|
800
|
-
receiver_reg, offset, name_reg,
|
851
|
+
receiver_reg, offset, name_reg, scratch1, kDontSaveFPRegs);
|
801
852
|
} else {
|
802
853
|
// Write to the properties array.
|
803
854
|
int offset = index * kPointerSize + FixedArray::kHeaderSize;
|
804
855
|
// Get the properties array (optimistically).
|
805
|
-
__ movq(
|
806
|
-
__ movq(FieldOperand(
|
856
|
+
__ movq(scratch1, FieldOperand(receiver_reg, JSObject::kPropertiesOffset));
|
857
|
+
__ movq(FieldOperand(scratch1, offset), rax);
|
807
858
|
|
808
859
|
// Update the write barrier for the array address.
|
809
860
|
// Pass the value being stored in the now unused name_reg.
|
810
861
|
__ movq(name_reg, rax);
|
811
862
|
__ RecordWriteField(
|
812
|
-
|
863
|
+
scratch1, offset, name_reg, receiver_reg, kDontSaveFPRegs);
|
813
864
|
}
|
814
865
|
|
815
866
|
// Return the value (register rax).
|
@@ -976,7 +1027,7 @@ void StubCompiler::GenerateLoadField(Handle<JSObject> object,
|
|
976
1027
|
Register scratch1,
|
977
1028
|
Register scratch2,
|
978
1029
|
Register scratch3,
|
979
|
-
|
1030
|
+
PropertyIndex index,
|
980
1031
|
Handle<String> name,
|
981
1032
|
Label* miss) {
|
982
1033
|
// Check that the receiver isn't a smi.
|
@@ -992,6 +1043,49 @@ void StubCompiler::GenerateLoadField(Handle<JSObject> object,
|
|
992
1043
|
}
|
993
1044
|
|
994
1045
|
|
1046
|
+
void StubCompiler::GenerateDictionaryLoadCallback(Register receiver,
|
1047
|
+
Register name_reg,
|
1048
|
+
Register scratch1,
|
1049
|
+
Register scratch2,
|
1050
|
+
Register scratch3,
|
1051
|
+
Handle<AccessorInfo> callback,
|
1052
|
+
Handle<String> name,
|
1053
|
+
Label* miss) {
|
1054
|
+
ASSERT(!receiver.is(scratch1));
|
1055
|
+
ASSERT(!receiver.is(scratch2));
|
1056
|
+
ASSERT(!receiver.is(scratch3));
|
1057
|
+
|
1058
|
+
// Load the properties dictionary.
|
1059
|
+
Register dictionary = scratch1;
|
1060
|
+
__ movq(dictionary, FieldOperand(receiver, JSObject::kPropertiesOffset));
|
1061
|
+
|
1062
|
+
// Probe the dictionary.
|
1063
|
+
Label probe_done;
|
1064
|
+
StringDictionaryLookupStub::GeneratePositiveLookup(masm(),
|
1065
|
+
miss,
|
1066
|
+
&probe_done,
|
1067
|
+
dictionary,
|
1068
|
+
name_reg,
|
1069
|
+
scratch2,
|
1070
|
+
scratch3);
|
1071
|
+
__ bind(&probe_done);
|
1072
|
+
|
1073
|
+
// If probing finds an entry in the dictionary, scratch3 contains the
|
1074
|
+
// index into the dictionary. Check that the value is the callback.
|
1075
|
+
Register index = scratch3;
|
1076
|
+
const int kElementsStartOffset =
|
1077
|
+
StringDictionary::kHeaderSize +
|
1078
|
+
StringDictionary::kElementsStartIndex * kPointerSize;
|
1079
|
+
const int kValueOffset = kElementsStartOffset + kPointerSize;
|
1080
|
+
__ movq(scratch2,
|
1081
|
+
Operand(dictionary, index, times_pointer_size,
|
1082
|
+
kValueOffset - kHeapObjectTag));
|
1083
|
+
__ movq(scratch3, callback, RelocInfo::EMBEDDED_OBJECT);
|
1084
|
+
__ cmpq(scratch2, scratch3);
|
1085
|
+
__ j(not_equal, miss);
|
1086
|
+
}
|
1087
|
+
|
1088
|
+
|
995
1089
|
void StubCompiler::GenerateLoadCallback(Handle<JSObject> object,
|
996
1090
|
Handle<JSObject> holder,
|
997
1091
|
Register receiver,
|
@@ -999,6 +1093,7 @@ void StubCompiler::GenerateLoadCallback(Handle<JSObject> object,
|
|
999
1093
|
Register scratch1,
|
1000
1094
|
Register scratch2,
|
1001
1095
|
Register scratch3,
|
1096
|
+
Register scratch4,
|
1002
1097
|
Handle<AccessorInfo> callback,
|
1003
1098
|
Handle<String> name,
|
1004
1099
|
Label* miss) {
|
@@ -1009,6 +1104,11 @@ void StubCompiler::GenerateLoadCallback(Handle<JSObject> object,
|
|
1009
1104
|
Register reg = CheckPrototypes(object, receiver, holder, scratch1,
|
1010
1105
|
scratch2, scratch3, name, miss);
|
1011
1106
|
|
1107
|
+
if (!holder->HasFastProperties() && !holder->IsJSGlobalObject()) {
|
1108
|
+
GenerateDictionaryLoadCallback(
|
1109
|
+
reg, name_reg, scratch2, scratch3, scratch4, callback, name, miss);
|
1110
|
+
}
|
1111
|
+
|
1012
1112
|
// Insert additional parameters into the stack frame above return address.
|
1013
1113
|
ASSERT(!scratch2.is(reg));
|
1014
1114
|
__ pop(scratch2); // Get return address to place it below.
|
@@ -1106,12 +1206,13 @@ void StubCompiler::GenerateLoadInterceptor(Handle<JSObject> object,
|
|
1106
1206
|
// later.
|
1107
1207
|
bool compile_followup_inline = false;
|
1108
1208
|
if (lookup->IsFound() && lookup->IsCacheable()) {
|
1109
|
-
if (lookup->
|
1209
|
+
if (lookup->IsField()) {
|
1110
1210
|
compile_followup_inline = true;
|
1111
1211
|
} else if (lookup->type() == CALLBACKS &&
|
1112
1212
|
lookup->GetCallbackObject()->IsAccessorInfo()) {
|
1113
|
-
|
1114
|
-
|
1213
|
+
AccessorInfo* callback = AccessorInfo::cast(lookup->GetCallbackObject());
|
1214
|
+
compile_followup_inline = callback->getter() != NULL &&
|
1215
|
+
callback->IsCompatibleReceiver(*object);
|
1115
1216
|
}
|
1116
1217
|
}
|
1117
1218
|
|
@@ -1183,7 +1284,7 @@ void StubCompiler::GenerateLoadInterceptor(Handle<JSObject> object,
|
|
1183
1284
|
miss);
|
1184
1285
|
}
|
1185
1286
|
|
1186
|
-
if (lookup->
|
1287
|
+
if (lookup->IsField()) {
|
1187
1288
|
// We found FIELD property in prototype chain of interceptor's holder.
|
1188
1289
|
// Retrieve a field from field's holder.
|
1189
1290
|
GenerateFastPropertyLoad(masm(), rax, holder_reg,
|
@@ -1301,7 +1402,7 @@ void CallStubCompiler::GenerateMissBranch() {
|
|
1301
1402
|
|
1302
1403
|
Handle<Code> CallStubCompiler::CompileCallField(Handle<JSObject> object,
|
1303
1404
|
Handle<JSObject> holder,
|
1304
|
-
|
1405
|
+
PropertyIndex index,
|
1305
1406
|
Handle<String> name) {
|
1306
1407
|
// ----------- S t a t e -------------
|
1307
1408
|
// rcx : function name
|
@@ -1353,7 +1454,7 @@ Handle<Code> CallStubCompiler::CompileCallField(Handle<JSObject> object,
|
|
1353
1454
|
GenerateMissBranch();
|
1354
1455
|
|
1355
1456
|
// Return the generated code.
|
1356
|
-
return GetCode(FIELD, name);
|
1457
|
+
return GetCode(Code::FIELD, name);
|
1357
1458
|
}
|
1358
1459
|
|
1359
1460
|
|
@@ -1395,7 +1496,7 @@ Handle<Code> CallStubCompiler::CompileArrayPushCall(
|
|
1395
1496
|
Label call_builtin;
|
1396
1497
|
|
1397
1498
|
if (argc == 1) { // Otherwise fall through to call builtin.
|
1398
|
-
Label attempt_to_grow_elements, with_write_barrier;
|
1499
|
+
Label attempt_to_grow_elements, with_write_barrier, check_double;
|
1399
1500
|
|
1400
1501
|
// Get the elements array of the object.
|
1401
1502
|
__ movq(rdi, FieldOperand(rdx, JSArray::kElementsOffset));
|
@@ -1403,7 +1504,7 @@ Handle<Code> CallStubCompiler::CompileArrayPushCall(
|
|
1403
1504
|
// Check that the elements are in fast mode and writable.
|
1404
1505
|
__ Cmp(FieldOperand(rdi, HeapObject::kMapOffset),
|
1405
1506
|
factory()->fixed_array_map());
|
1406
|
-
__ j(not_equal, &
|
1507
|
+
__ j(not_equal, &check_double);
|
1407
1508
|
|
1408
1509
|
// Get the array's length into rax and calculate new length.
|
1409
1510
|
__ SmiToInteger32(rax, FieldOperand(rdx, JSArray::kLengthOffset));
|
@@ -1434,6 +1535,34 @@ Handle<Code> CallStubCompiler::CompileArrayPushCall(
|
|
1434
1535
|
__ Integer32ToSmi(rax, rax); // Return new length as smi.
|
1435
1536
|
__ ret((argc + 1) * kPointerSize);
|
1436
1537
|
|
1538
|
+
__ bind(&check_double);
|
1539
|
+
|
1540
|
+
// Check that the elements are in double mode.
|
1541
|
+
__ Cmp(FieldOperand(rdi, HeapObject::kMapOffset),
|
1542
|
+
factory()->fixed_double_array_map());
|
1543
|
+
__ j(not_equal, &call_builtin);
|
1544
|
+
|
1545
|
+
// Get the array's length into rax and calculate new length.
|
1546
|
+
__ SmiToInteger32(rax, FieldOperand(rdx, JSArray::kLengthOffset));
|
1547
|
+
STATIC_ASSERT(FixedArray::kMaxLength < Smi::kMaxValue);
|
1548
|
+
__ addl(rax, Immediate(argc));
|
1549
|
+
|
1550
|
+
// Get the elements' length into rcx.
|
1551
|
+
__ SmiToInteger32(rcx, FieldOperand(rdi, FixedArray::kLengthOffset));
|
1552
|
+
|
1553
|
+
// Check if we could survive without allocation.
|
1554
|
+
__ cmpl(rax, rcx);
|
1555
|
+
__ j(greater, &call_builtin);
|
1556
|
+
|
1557
|
+
__ movq(rcx, Operand(rsp, argc * kPointerSize));
|
1558
|
+
__ StoreNumberToDoubleElements(
|
1559
|
+
rcx, rdi, rax, xmm0, &call_builtin, argc * kDoubleSize);
|
1560
|
+
|
1561
|
+
// Save new length.
|
1562
|
+
__ Integer32ToSmiField(FieldOperand(rdx, JSArray::kLengthOffset), rax);
|
1563
|
+
__ Integer32ToSmi(rax, rax); // Return new length as smi.
|
1564
|
+
__ ret((argc + 1) * kPointerSize);
|
1565
|
+
|
1437
1566
|
__ bind(&with_write_barrier);
|
1438
1567
|
|
1439
1568
|
__ movq(rbx, FieldOperand(rdx, HeapObject::kMapOffset));
|
@@ -1445,6 +1574,9 @@ Handle<Code> CallStubCompiler::CompileArrayPushCall(
|
|
1445
1574
|
// In case of fast smi-only, convert to fast object, otherwise bail out.
|
1446
1575
|
__ bind(¬_fast_object);
|
1447
1576
|
__ CheckFastSmiElements(rbx, &call_builtin);
|
1577
|
+
__ Cmp(FieldOperand(rcx, HeapObject::kMapOffset),
|
1578
|
+
factory()->heap_number_map());
|
1579
|
+
__ j(equal, &call_builtin);
|
1448
1580
|
// rdx: receiver
|
1449
1581
|
// rbx: map
|
1450
1582
|
|
@@ -1456,7 +1588,9 @@ Handle<Code> CallStubCompiler::CompileArrayPushCall(
|
|
1456
1588
|
&try_holey_map);
|
1457
1589
|
|
1458
1590
|
ElementsTransitionGenerator::
|
1459
|
-
GenerateMapChangeElementsTransition(masm()
|
1591
|
+
GenerateMapChangeElementsTransition(masm(),
|
1592
|
+
DONT_TRACK_ALLOCATION_SITE,
|
1593
|
+
NULL);
|
1460
1594
|
// Restore edi.
|
1461
1595
|
__ movq(rdi, FieldOperand(rdx, JSArray::kElementsOffset));
|
1462
1596
|
__ jmp(&fast_object);
|
@@ -1468,7 +1602,9 @@ Handle<Code> CallStubCompiler::CompileArrayPushCall(
|
|
1468
1602
|
rdi,
|
1469
1603
|
&call_builtin);
|
1470
1604
|
ElementsTransitionGenerator::
|
1471
|
-
GenerateMapChangeElementsTransition(masm()
|
1605
|
+
GenerateMapChangeElementsTransition(masm(),
|
1606
|
+
DONT_TRACK_ALLOCATION_SITE,
|
1607
|
+
NULL);
|
1472
1608
|
__ movq(rdi, FieldOperand(rdx, JSArray::kElementsOffset));
|
1473
1609
|
__ bind(&fast_object);
|
1474
1610
|
} else {
|
@@ -1877,7 +2013,7 @@ Handle<Code> CallStubCompiler::CompileStringFromCharCodeCall(
|
|
1877
2013
|
GenerateMissBranch();
|
1878
2014
|
|
1879
2015
|
// Return the generated code.
|
1880
|
-
return cell.is_null() ? GetCode(function) : GetCode(NORMAL, name);
|
2016
|
+
return cell.is_null() ? GetCode(function) : GetCode(Code::NORMAL, name);
|
1881
2017
|
}
|
1882
2018
|
|
1883
2019
|
|
@@ -1965,7 +2101,7 @@ Handle<Code> CallStubCompiler::CompileMathAbsCall(
|
|
1965
2101
|
const int sign_mask_shift =
|
1966
2102
|
(HeapNumber::kExponentOffset - HeapNumber::kValueOffset) * kBitsPerByte;
|
1967
2103
|
__ movq(rdi, static_cast<int64_t>(HeapNumber::kSignMask) << sign_mask_shift,
|
1968
|
-
RelocInfo::
|
2104
|
+
RelocInfo::NONE64);
|
1969
2105
|
__ testq(rbx, rdi);
|
1970
2106
|
__ j(not_zero, &negative_sign);
|
1971
2107
|
__ ret(2 * kPointerSize);
|
@@ -1992,7 +2128,7 @@ Handle<Code> CallStubCompiler::CompileMathAbsCall(
|
|
1992
2128
|
GenerateMissBranch();
|
1993
2129
|
|
1994
2130
|
// Return the generated code.
|
1995
|
-
return cell.is_null() ? GetCode(function) : GetCode(NORMAL, name);
|
2131
|
+
return cell.is_null() ? GetCode(function) : GetCode(Code::NORMAL, name);
|
1996
2132
|
}
|
1997
2133
|
|
1998
2134
|
|
@@ -2052,11 +2188,11 @@ Handle<Code> CallStubCompiler::CompileFastApiCall(
|
|
2052
2188
|
}
|
2053
2189
|
|
2054
2190
|
|
2055
|
-
|
2056
|
-
|
2057
|
-
|
2058
|
-
|
2059
|
-
|
2191
|
+
void CallStubCompiler::CompileHandlerFrontend(Handle<Object> object,
|
2192
|
+
Handle<JSObject> holder,
|
2193
|
+
Handle<String> name,
|
2194
|
+
CheckType check,
|
2195
|
+
Label* success) {
|
2060
2196
|
// ----------- S t a t e -------------
|
2061
2197
|
// rcx : function name
|
2062
2198
|
// rsp[0] : return address
|
@@ -2066,15 +2202,6 @@ Handle<Code> CallStubCompiler::CompileCallConstant(Handle<Object> object,
|
|
2066
2202
|
// rsp[argc * 8] : argument 1
|
2067
2203
|
// rsp[(argc + 1) * 8] : argument 0 = receiver
|
2068
2204
|
// -----------------------------------
|
2069
|
-
|
2070
|
-
if (HasCustomCallGenerator(function)) {
|
2071
|
-
Handle<Code> code = CompileCustomCall(object, holder,
|
2072
|
-
Handle<JSGlobalPropertyCell>::null(),
|
2073
|
-
function, name);
|
2074
|
-
// A null handle means bail out to the regular compiler code below.
|
2075
|
-
if (!code.is_null()) return code;
|
2076
|
-
}
|
2077
|
-
|
2078
2205
|
Label miss;
|
2079
2206
|
GenerateNameCheck(name, &miss);
|
2080
2207
|
|
@@ -2109,76 +2236,86 @@ Handle<Code> CallStubCompiler::CompileCallConstant(Handle<Object> object,
|
|
2109
2236
|
break;
|
2110
2237
|
|
2111
2238
|
case STRING_CHECK:
|
2112
|
-
|
2113
|
-
|
2114
|
-
|
2115
|
-
|
2116
|
-
|
2117
|
-
|
2118
|
-
|
2119
|
-
|
2120
|
-
|
2121
|
-
rax, holder, rbx, rdx, rdi, name, &miss);
|
2122
|
-
} else {
|
2123
|
-
// Calling non-strict non-builtins with a value as the receiver
|
2124
|
-
// requires boxing.
|
2125
|
-
__ jmp(&miss);
|
2126
|
-
}
|
2239
|
+
// Check that the object is a two-byte string or a symbol.
|
2240
|
+
__ CmpObjectType(rdx, FIRST_NONSTRING_TYPE, rax);
|
2241
|
+
__ j(above_equal, &miss);
|
2242
|
+
// Check that the maps starting from the prototype haven't changed.
|
2243
|
+
GenerateDirectLoadGlobalFunctionPrototype(
|
2244
|
+
masm(), Context::STRING_FUNCTION_INDEX, rax, &miss);
|
2245
|
+
CheckPrototypes(
|
2246
|
+
Handle<JSObject>(JSObject::cast(object->GetPrototype())),
|
2247
|
+
rax, holder, rbx, rdx, rdi, name, &miss);
|
2127
2248
|
break;
|
2128
2249
|
|
2129
|
-
case NUMBER_CHECK:
|
2130
|
-
|
2131
|
-
|
2132
|
-
|
2133
|
-
|
2134
|
-
|
2135
|
-
|
2136
|
-
|
2137
|
-
|
2138
|
-
|
2139
|
-
|
2140
|
-
|
2141
|
-
|
2142
|
-
rax, holder, rbx, rdx, rdi, name, &miss);
|
2143
|
-
} else {
|
2144
|
-
// Calling non-strict non-builtins with a value as the receiver
|
2145
|
-
// requires boxing.
|
2146
|
-
__ jmp(&miss);
|
2147
|
-
}
|
2250
|
+
case NUMBER_CHECK: {
|
2251
|
+
Label fast;
|
2252
|
+
// Check that the object is a smi or a heap number.
|
2253
|
+
__ JumpIfSmi(rdx, &fast);
|
2254
|
+
__ CmpObjectType(rdx, HEAP_NUMBER_TYPE, rax);
|
2255
|
+
__ j(not_equal, &miss);
|
2256
|
+
__ bind(&fast);
|
2257
|
+
// Check that the maps starting from the prototype haven't changed.
|
2258
|
+
GenerateDirectLoadGlobalFunctionPrototype(
|
2259
|
+
masm(), Context::NUMBER_FUNCTION_INDEX, rax, &miss);
|
2260
|
+
CheckPrototypes(
|
2261
|
+
Handle<JSObject>(JSObject::cast(object->GetPrototype())),
|
2262
|
+
rax, holder, rbx, rdx, rdi, name, &miss);
|
2148
2263
|
break;
|
2149
|
-
|
2150
|
-
case BOOLEAN_CHECK:
|
2151
|
-
|
2152
|
-
|
2153
|
-
|
2154
|
-
|
2155
|
-
|
2156
|
-
|
2157
|
-
|
2158
|
-
|
2159
|
-
|
2160
|
-
|
2161
|
-
|
2162
|
-
|
2163
|
-
|
2164
|
-
rax, holder, rbx, rdx, rdi, name, &miss);
|
2165
|
-
} else {
|
2166
|
-
// Calling non-strict non-builtins with a value as the receiver
|
2167
|
-
// requires boxing.
|
2168
|
-
__ jmp(&miss);
|
2169
|
-
}
|
2264
|
+
}
|
2265
|
+
case BOOLEAN_CHECK: {
|
2266
|
+
Label fast;
|
2267
|
+
// Check that the object is a boolean.
|
2268
|
+
__ CompareRoot(rdx, Heap::kTrueValueRootIndex);
|
2269
|
+
__ j(equal, &fast);
|
2270
|
+
__ CompareRoot(rdx, Heap::kFalseValueRootIndex);
|
2271
|
+
__ j(not_equal, &miss);
|
2272
|
+
__ bind(&fast);
|
2273
|
+
// Check that the maps starting from the prototype haven't changed.
|
2274
|
+
GenerateDirectLoadGlobalFunctionPrototype(
|
2275
|
+
masm(), Context::BOOLEAN_FUNCTION_INDEX, rax, &miss);
|
2276
|
+
CheckPrototypes(
|
2277
|
+
Handle<JSObject>(JSObject::cast(object->GetPrototype())),
|
2278
|
+
rax, holder, rbx, rdx, rdi, name, &miss);
|
2170
2279
|
break;
|
2280
|
+
}
|
2171
2281
|
}
|
2172
2282
|
|
2283
|
+
__ jmp(success);
|
2284
|
+
|
2285
|
+
// Handle call cache miss.
|
2286
|
+
__ bind(&miss);
|
2287
|
+
GenerateMissBranch();
|
2288
|
+
}
|
2289
|
+
|
2290
|
+
|
2291
|
+
void CallStubCompiler::CompileHandlerBackend(Handle<JSFunction> function) {
|
2173
2292
|
CallKind call_kind = CallICBase::Contextual::decode(extra_state_)
|
2174
2293
|
? CALL_AS_FUNCTION
|
2175
2294
|
: CALL_AS_METHOD;
|
2176
2295
|
__ InvokeFunction(function, arguments(), JUMP_FUNCTION,
|
2177
2296
|
NullCallWrapper(), call_kind);
|
2297
|
+
}
|
2178
2298
|
|
2179
|
-
|
2180
|
-
|
2181
|
-
|
2299
|
+
|
2300
|
+
Handle<Code> CallStubCompiler::CompileCallConstant(
|
2301
|
+
Handle<Object> object,
|
2302
|
+
Handle<JSObject> holder,
|
2303
|
+
Handle<String> name,
|
2304
|
+
CheckType check,
|
2305
|
+
Handle<JSFunction> function) {
|
2306
|
+
if (HasCustomCallGenerator(function)) {
|
2307
|
+
Handle<Code> code = CompileCustomCall(object, holder,
|
2308
|
+
Handle<JSGlobalPropertyCell>::null(),
|
2309
|
+
function, name);
|
2310
|
+
// A null handle means bail out to the regular compiler code below.
|
2311
|
+
if (!code.is_null()) return code;
|
2312
|
+
}
|
2313
|
+
|
2314
|
+
Label success;
|
2315
|
+
|
2316
|
+
CompileHandlerFrontend(object, holder, name, check, &success);
|
2317
|
+
__ bind(&success);
|
2318
|
+
CompileHandlerBackend(function);
|
2182
2319
|
|
2183
2320
|
// Return the generated code.
|
2184
2321
|
return GetCode(function);
|
@@ -2241,7 +2378,7 @@ Handle<Code> CallStubCompiler::CompileCallInterceptor(Handle<JSObject> object,
|
|
2241
2378
|
GenerateMissBranch();
|
2242
2379
|
|
2243
2380
|
// Return the generated code.
|
2244
|
-
return GetCode(INTERCEPTOR, name);
|
2381
|
+
return GetCode(Code::INTERCEPTOR, name);
|
2245
2382
|
}
|
2246
2383
|
|
2247
2384
|
|
@@ -2304,7 +2441,7 @@ Handle<Code> CallStubCompiler::CompileCallGlobal(
|
|
2304
2441
|
GenerateMissBranch();
|
2305
2442
|
|
2306
2443
|
// Return the generated code.
|
2307
|
-
return GetCode(NORMAL, name);
|
2444
|
+
return GetCode(Code::NORMAL, name);
|
2308
2445
|
}
|
2309
2446
|
|
2310
2447
|
|
@@ -2321,7 +2458,13 @@ Handle<Code> StoreStubCompiler::CompileStoreField(Handle<JSObject> object,
|
|
2321
2458
|
Label miss;
|
2322
2459
|
|
2323
2460
|
// Generate store field code. Preserves receiver and name on jump to miss.
|
2324
|
-
GenerateStoreField(masm(),
|
2461
|
+
GenerateStoreField(masm(),
|
2462
|
+
object,
|
2463
|
+
index,
|
2464
|
+
transition,
|
2465
|
+
name,
|
2466
|
+
rdx, rcx, rbx, rdi,
|
2467
|
+
&miss);
|
2325
2468
|
|
2326
2469
|
// Handle store cache miss.
|
2327
2470
|
__ bind(&miss);
|
@@ -2329,14 +2472,17 @@ Handle<Code> StoreStubCompiler::CompileStoreField(Handle<JSObject> object,
|
|
2329
2472
|
__ Jump(ic, RelocInfo::CODE_TARGET);
|
2330
2473
|
|
2331
2474
|
// Return the generated code.
|
2332
|
-
return GetCode(transition.is_null()
|
2475
|
+
return GetCode(transition.is_null()
|
2476
|
+
? Code::FIELD
|
2477
|
+
: Code::MAP_TRANSITION, name);
|
2333
2478
|
}
|
2334
2479
|
|
2335
2480
|
|
2336
2481
|
Handle<Code> StoreStubCompiler::CompileStoreCallback(
|
2337
|
-
Handle<
|
2338
|
-
Handle<
|
2339
|
-
Handle<
|
2482
|
+
Handle<String> name,
|
2483
|
+
Handle<JSObject> receiver,
|
2484
|
+
Handle<JSObject> holder,
|
2485
|
+
Handle<AccessorInfo> callback) {
|
2340
2486
|
// ----------- S t a t e -------------
|
2341
2487
|
// -- rax : value
|
2342
2488
|
// -- rcx : name
|
@@ -2344,19 +2490,12 @@ Handle<Code> StoreStubCompiler::CompileStoreCallback(
|
|
2344
2490
|
// -- rsp[0] : return address
|
2345
2491
|
// -----------------------------------
|
2346
2492
|
Label miss;
|
2493
|
+
// Check that the maps haven't changed.
|
2494
|
+
__ JumpIfSmi(rdx, &miss);
|
2495
|
+
CheckPrototypes(receiver, rdx, holder, rbx, r8, rdi, name, &miss);
|
2347
2496
|
|
2348
|
-
//
|
2349
|
-
|
2350
|
-
DO_SMI_CHECK, ALLOW_ELEMENT_TRANSITION_MAPS);
|
2351
|
-
|
2352
|
-
// Perform global security token check if needed.
|
2353
|
-
if (object->IsJSGlobalProxy()) {
|
2354
|
-
__ CheckAccessGlobalProxy(rdx, rbx, &miss);
|
2355
|
-
}
|
2356
|
-
|
2357
|
-
// Stub never generated for non-global objects that require access
|
2358
|
-
// checks.
|
2359
|
-
ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded());
|
2497
|
+
// Stub never generated for non-global objects that require access checks.
|
2498
|
+
ASSERT(holder->IsJSGlobalProxy() || !holder->IsAccessCheckNeeded());
|
2360
2499
|
|
2361
2500
|
__ pop(rbx); // remove the return address
|
2362
2501
|
__ push(rdx); // receiver
|
@@ -2376,7 +2515,81 @@ Handle<Code> StoreStubCompiler::CompileStoreCallback(
|
|
2376
2515
|
__ Jump(ic, RelocInfo::CODE_TARGET);
|
2377
2516
|
|
2378
2517
|
// Return the generated code.
|
2379
|
-
return GetCode(CALLBACKS, name);
|
2518
|
+
return GetCode(Code::CALLBACKS, name);
|
2519
|
+
}
|
2520
|
+
|
2521
|
+
|
2522
|
+
#undef __
|
2523
|
+
#define __ ACCESS_MASM(masm)
|
2524
|
+
|
2525
|
+
|
2526
|
+
void StoreStubCompiler::GenerateStoreViaSetter(
|
2527
|
+
MacroAssembler* masm,
|
2528
|
+
Handle<JSFunction> setter) {
|
2529
|
+
// ----------- S t a t e -------------
|
2530
|
+
// -- rax : value
|
2531
|
+
// -- rcx : name
|
2532
|
+
// -- rdx : receiver
|
2533
|
+
// -- rsp[0] : return address
|
2534
|
+
// -----------------------------------
|
2535
|
+
{
|
2536
|
+
FrameScope scope(masm, StackFrame::INTERNAL);
|
2537
|
+
|
2538
|
+
// Save value register, so we can restore it later.
|
2539
|
+
__ push(rax);
|
2540
|
+
|
2541
|
+
if (!setter.is_null()) {
|
2542
|
+
// Call the JavaScript setter with receiver and value on the stack.
|
2543
|
+
__ push(rdx);
|
2544
|
+
__ push(rax);
|
2545
|
+
ParameterCount actual(1);
|
2546
|
+
__ InvokeFunction(setter, actual, CALL_FUNCTION, NullCallWrapper(),
|
2547
|
+
CALL_AS_METHOD);
|
2548
|
+
} else {
|
2549
|
+
// If we generate a global code snippet for deoptimization only, remember
|
2550
|
+
// the place to continue after deoptimization.
|
2551
|
+
masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset());
|
2552
|
+
}
|
2553
|
+
|
2554
|
+
// We have to return the passed value, not the return value of the setter.
|
2555
|
+
__ pop(rax);
|
2556
|
+
|
2557
|
+
// Restore context register.
|
2558
|
+
__ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
|
2559
|
+
}
|
2560
|
+
__ ret(0);
|
2561
|
+
}
|
2562
|
+
|
2563
|
+
|
2564
|
+
#undef __
|
2565
|
+
#define __ ACCESS_MASM(masm())
|
2566
|
+
|
2567
|
+
|
2568
|
+
Handle<Code> StoreStubCompiler::CompileStoreViaSetter(
|
2569
|
+
Handle<String> name,
|
2570
|
+
Handle<JSObject> receiver,
|
2571
|
+
Handle<JSObject> holder,
|
2572
|
+
Handle<JSFunction> setter) {
|
2573
|
+
// ----------- S t a t e -------------
|
2574
|
+
// -- rax : value
|
2575
|
+
// -- rcx : name
|
2576
|
+
// -- rdx : receiver
|
2577
|
+
// -- rsp[0] : return address
|
2578
|
+
// -----------------------------------
|
2579
|
+
Label miss;
|
2580
|
+
|
2581
|
+
// Check that the maps haven't changed.
|
2582
|
+
__ JumpIfSmi(rdx, &miss);
|
2583
|
+
CheckPrototypes(receiver, rdx, holder, rbx, r8, rdi, name, &miss);
|
2584
|
+
|
2585
|
+
GenerateStoreViaSetter(masm(), setter);
|
2586
|
+
|
2587
|
+
__ bind(&miss);
|
2588
|
+
Handle<Code> ic = isolate()->builtins()->StoreIC_Miss();
|
2589
|
+
__ Jump(ic, RelocInfo::CODE_TARGET);
|
2590
|
+
|
2591
|
+
// Return the generated code.
|
2592
|
+
return GetCode(Code::CALLBACKS, name);
|
2380
2593
|
}
|
2381
2594
|
|
2382
2595
|
|
@@ -2422,7 +2635,7 @@ Handle<Code> StoreStubCompiler::CompileStoreInterceptor(
|
|
2422
2635
|
__ Jump(ic, RelocInfo::CODE_TARGET);
|
2423
2636
|
|
2424
2637
|
// Return the generated code.
|
2425
|
-
return GetCode(INTERCEPTOR, name);
|
2638
|
+
return GetCode(Code::INTERCEPTOR, name);
|
2426
2639
|
}
|
2427
2640
|
|
2428
2641
|
|
@@ -2470,7 +2683,7 @@ Handle<Code> StoreStubCompiler::CompileStoreGlobal(
|
|
2470
2683
|
__ Jump(ic, RelocInfo::CODE_TARGET);
|
2471
2684
|
|
2472
2685
|
// Return the generated code.
|
2473
|
-
return GetCode(NORMAL, name);
|
2686
|
+
return GetCode(Code::NORMAL, name);
|
2474
2687
|
}
|
2475
2688
|
|
2476
2689
|
|
@@ -2494,7 +2707,13 @@ Handle<Code> KeyedStoreStubCompiler::CompileStoreField(Handle<JSObject> object,
|
|
2494
2707
|
__ j(not_equal, &miss);
|
2495
2708
|
|
2496
2709
|
// Generate store field code. Preserves receiver and name on jump to miss.
|
2497
|
-
GenerateStoreField(masm(),
|
2710
|
+
GenerateStoreField(masm(),
|
2711
|
+
object,
|
2712
|
+
index,
|
2713
|
+
transition,
|
2714
|
+
name,
|
2715
|
+
rdx, rcx, rbx, rdi,
|
2716
|
+
&miss);
|
2498
2717
|
|
2499
2718
|
// Handle store cache miss.
|
2500
2719
|
__ bind(&miss);
|
@@ -2503,7 +2722,9 @@ Handle<Code> KeyedStoreStubCompiler::CompileStoreField(Handle<JSObject> object,
|
|
2503
2722
|
__ Jump(ic, RelocInfo::CODE_TARGET);
|
2504
2723
|
|
2505
2724
|
// Return the generated code.
|
2506
|
-
return GetCode(transition.is_null()
|
2725
|
+
return GetCode(transition.is_null()
|
2726
|
+
? Code::FIELD
|
2727
|
+
: Code::MAP_TRANSITION, name);
|
2507
2728
|
}
|
2508
2729
|
|
2509
2730
|
|
@@ -2527,7 +2748,7 @@ Handle<Code> KeyedStoreStubCompiler::CompileStoreElement(
|
|
2527
2748
|
__ jmp(ic, RelocInfo::CODE_TARGET);
|
2528
2749
|
|
2529
2750
|
// Return the generated code.
|
2530
|
-
return GetCode(NORMAL, factory()->empty_string());
|
2751
|
+
return GetCode(Code::NORMAL, factory()->empty_string());
|
2531
2752
|
}
|
2532
2753
|
|
2533
2754
|
|
@@ -2565,13 +2786,15 @@ Handle<Code> KeyedStoreStubCompiler::CompileStorePolymorphic(
|
|
2565
2786
|
__ jmp(ic, RelocInfo::CODE_TARGET);
|
2566
2787
|
|
2567
2788
|
// Return the generated code.
|
2568
|
-
return GetCode(NORMAL, factory()->empty_string(),
|
2789
|
+
return GetCode(Code::NORMAL, factory()->empty_string(), POLYMORPHIC);
|
2569
2790
|
}
|
2570
2791
|
|
2571
2792
|
|
2572
|
-
Handle<Code> LoadStubCompiler::CompileLoadNonexistent(
|
2573
|
-
|
2574
|
-
|
2793
|
+
Handle<Code> LoadStubCompiler::CompileLoadNonexistent(
|
2794
|
+
Handle<JSObject> object,
|
2795
|
+
Handle<JSObject> last,
|
2796
|
+
Handle<String> name,
|
2797
|
+
Handle<GlobalObject> global) {
|
2575
2798
|
// ----------- S t a t e -------------
|
2576
2799
|
// -- rax : receiver
|
2577
2800
|
// -- rcx : name
|
@@ -2585,13 +2808,21 @@ Handle<Code> LoadStubCompiler::CompileLoadNonexistent(Handle<String> name,
|
|
2585
2808
|
// Check the maps of the full prototype chain. Also check that
|
2586
2809
|
// global property cells up to (but not including) the last object
|
2587
2810
|
// in the prototype chain are empty.
|
2588
|
-
|
2811
|
+
Register scratch = rdx;
|
2812
|
+
Register result =
|
2813
|
+
CheckPrototypes(object, rax, last, rbx, scratch, rdi, name, &miss);
|
2589
2814
|
|
2590
2815
|
// If the last object in the prototype chain is a global object,
|
2591
2816
|
// check that the global property cell is empty.
|
2592
|
-
if (
|
2593
|
-
GenerateCheckPropertyCell(
|
2594
|
-
|
2817
|
+
if (!global.is_null()) {
|
2818
|
+
GenerateCheckPropertyCell(masm(), global, name, scratch, &miss);
|
2819
|
+
}
|
2820
|
+
|
2821
|
+
if (!last->HasFastProperties()) {
|
2822
|
+
__ movq(scratch, FieldOperand(result, HeapObject::kMapOffset));
|
2823
|
+
__ movq(scratch, FieldOperand(scratch, Map::kPrototypeOffset));
|
2824
|
+
__ Cmp(scratch, isolate()->factory()->null_value());
|
2825
|
+
__ j(not_equal, &miss);
|
2595
2826
|
}
|
2596
2827
|
|
2597
2828
|
// Return undefined if maps of the full prototype chain are still the
|
@@ -2603,92 +2834,92 @@ Handle<Code> LoadStubCompiler::CompileLoadNonexistent(Handle<String> name,
|
|
2603
2834
|
GenerateLoadMiss(masm(), Code::LOAD_IC);
|
2604
2835
|
|
2605
2836
|
// Return the generated code.
|
2606
|
-
return GetCode(NONEXISTENT, factory()->empty_string());
|
2837
|
+
return GetCode(Code::NONEXISTENT, factory()->empty_string());
|
2607
2838
|
}
|
2608
2839
|
|
2609
2840
|
|
2610
|
-
|
2611
|
-
|
2612
|
-
|
2613
|
-
|
2614
|
-
|
2615
|
-
// -- rax : receiver
|
2616
|
-
// -- rcx : name
|
2617
|
-
// -- rsp[0] : return address
|
2618
|
-
// -----------------------------------
|
2619
|
-
Label miss;
|
2841
|
+
Register* LoadStubCompiler::registers() {
|
2842
|
+
// receiver, name, scratch1, scratch2, scratch3, scratch4.
|
2843
|
+
static Register registers[] = { rax, rcx, rdx, rbx, rdi, r8 };
|
2844
|
+
return registers;
|
2845
|
+
}
|
2620
2846
|
|
2621
|
-
GenerateLoadField(object, holder, rax, rbx, rdx, rdi, index, name, &miss);
|
2622
|
-
__ bind(&miss);
|
2623
|
-
GenerateLoadMiss(masm(), Code::LOAD_IC);
|
2624
2847
|
|
2625
|
-
|
2626
|
-
|
2848
|
+
Register* KeyedLoadStubCompiler::registers() {
|
2849
|
+
// receiver, name, scratch1, scratch2, scratch3, scratch4.
|
2850
|
+
static Register registers[] = { rdx, rax, rbx, rcx, rdi, r8 };
|
2851
|
+
return registers;
|
2627
2852
|
}
|
2628
2853
|
|
2629
2854
|
|
2630
|
-
Handle<
|
2631
|
-
|
2632
|
-
|
2633
|
-
|
2634
|
-
|
2635
|
-
// ----------- S t a t e -------------
|
2636
|
-
// -- rax : receiver
|
2637
|
-
// -- rcx : name
|
2638
|
-
// -- rsp[0] : return address
|
2639
|
-
// -----------------------------------
|
2640
|
-
Label miss;
|
2641
|
-
GenerateLoadCallback(object, holder, rax, rcx, rdx, rbx, rdi, callback,
|
2642
|
-
name, &miss);
|
2643
|
-
__ bind(&miss);
|
2644
|
-
GenerateLoadMiss(masm(), Code::LOAD_IC);
|
2645
|
-
|
2646
|
-
// Return the generated code.
|
2647
|
-
return GetCode(CALLBACKS, name);
|
2855
|
+
void KeyedLoadStubCompiler::GenerateNameCheck(Handle<String> name,
|
2856
|
+
Register name_reg,
|
2857
|
+
Label* miss) {
|
2858
|
+
__ Cmp(name_reg, name);
|
2859
|
+
__ j(not_equal, miss);
|
2648
2860
|
}
|
2649
2861
|
|
2650
2862
|
|
2651
|
-
|
2652
|
-
|
2653
|
-
|
2654
|
-
|
2863
|
+
#undef __
|
2864
|
+
#define __ ACCESS_MASM(masm)
|
2865
|
+
|
2866
|
+
|
2867
|
+
void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm,
|
2868
|
+
Handle<JSFunction> getter) {
|
2655
2869
|
// ----------- S t a t e -------------
|
2656
2870
|
// -- rax : receiver
|
2657
2871
|
// -- rcx : name
|
2658
2872
|
// -- rsp[0] : return address
|
2659
2873
|
// -----------------------------------
|
2660
|
-
|
2874
|
+
{
|
2875
|
+
FrameScope scope(masm, StackFrame::INTERNAL);
|
2661
2876
|
|
2662
|
-
|
2663
|
-
|
2664
|
-
|
2877
|
+
if (!getter.is_null()) {
|
2878
|
+
// Call the JavaScript getter with the receiver on the stack.
|
2879
|
+
__ push(rax);
|
2880
|
+
ParameterCount actual(0);
|
2881
|
+
__ InvokeFunction(getter, actual, CALL_FUNCTION, NullCallWrapper(),
|
2882
|
+
CALL_AS_METHOD);
|
2883
|
+
} else {
|
2884
|
+
// If we generate a global code snippet for deoptimization only, remember
|
2885
|
+
// the place to continue after deoptimization.
|
2886
|
+
masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset());
|
2887
|
+
}
|
2665
2888
|
|
2666
|
-
|
2667
|
-
|
2889
|
+
// Restore context register.
|
2890
|
+
__ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
|
2891
|
+
}
|
2892
|
+
__ ret(0);
|
2668
2893
|
}
|
2669
2894
|
|
2670
2895
|
|
2671
|
-
|
2672
|
-
|
2673
|
-
|
2896
|
+
#undef __
|
2897
|
+
#define __ ACCESS_MASM(masm())
|
2898
|
+
|
2899
|
+
|
2900
|
+
Handle<Code> LoadStubCompiler::CompileLoadViaGetter(
|
2901
|
+
Handle<JSObject> receiver,
|
2902
|
+
Handle<JSObject> holder,
|
2903
|
+
Handle<String> name,
|
2904
|
+
Handle<JSFunction> getter) {
|
2674
2905
|
// ----------- S t a t e -------------
|
2675
2906
|
// -- rax : receiver
|
2676
2907
|
// -- rcx : name
|
2677
2908
|
// -- rsp[0] : return address
|
2678
2909
|
// -----------------------------------
|
2679
2910
|
Label miss;
|
2680
|
-
LookupResult lookup(isolate());
|
2681
|
-
LookupPostInterceptor(holder, name, &lookup);
|
2682
2911
|
|
2683
|
-
//
|
2684
|
-
|
2685
|
-
|
2686
|
-
|
2912
|
+
// Check that the maps haven't changed.
|
2913
|
+
__ JumpIfSmi(rax, &miss);
|
2914
|
+
CheckPrototypes(receiver, rax, holder, rbx, rdx, rdi, name, &miss);
|
2915
|
+
|
2916
|
+
GenerateLoadViaGetter(masm(), getter),
|
2917
|
+
|
2687
2918
|
__ bind(&miss);
|
2688
2919
|
GenerateLoadMiss(masm(), Code::LOAD_IC);
|
2689
2920
|
|
2690
2921
|
// Return the generated code.
|
2691
|
-
return GetCode(
|
2922
|
+
return GetCode(Code::CALLBACKS, name);
|
2692
2923
|
}
|
2693
2924
|
|
2694
2925
|
|
@@ -2732,236 +2963,47 @@ Handle<Code> LoadStubCompiler::CompileLoadGlobal(
|
|
2732
2963
|
GenerateLoadMiss(masm(), Code::LOAD_IC);
|
2733
2964
|
|
2734
2965
|
// Return the generated code.
|
2735
|
-
return GetCode(NORMAL, name);
|
2966
|
+
return GetCode(Code::NORMAL, name);
|
2736
2967
|
}
|
2737
2968
|
|
2738
2969
|
|
2739
|
-
Handle<Code> KeyedLoadStubCompiler::
|
2740
|
-
|
2741
|
-
Handle<JSObject> holder,
|
2742
|
-
int index) {
|
2970
|
+
Handle<Code> KeyedLoadStubCompiler::CompileLoadElement(
|
2971
|
+
Handle<Map> receiver_map) {
|
2743
2972
|
// ----------- S t a t e -------------
|
2744
|
-
// -- rax
|
2745
|
-
// -- rdx
|
2746
|
-
// -- rsp[0]
|
2973
|
+
// -- rax : key
|
2974
|
+
// -- rdx : receiver
|
2975
|
+
// -- rsp[0] : return address
|
2747
2976
|
// -----------------------------------
|
2748
|
-
|
2749
|
-
|
2750
|
-
|
2751
|
-
|
2752
|
-
|
2753
|
-
|
2754
|
-
|
2755
|
-
|
2756
|
-
|
2757
|
-
|
2977
|
+
ElementsKind elements_kind = receiver_map->elements_kind();
|
2978
|
+
if (receiver_map->has_fast_elements() ||
|
2979
|
+
receiver_map->has_external_array_elements()) {
|
2980
|
+
Handle<Code> stub = KeyedLoadFastElementStub(
|
2981
|
+
receiver_map->instance_type() == JS_ARRAY_TYPE,
|
2982
|
+
elements_kind).GetCode();
|
2983
|
+
__ DispatchMap(rdx, receiver_map, stub, DO_SMI_CHECK);
|
2984
|
+
} else {
|
2985
|
+
Handle<Code> stub =
|
2986
|
+
KeyedLoadDictionaryElementStub().GetCode();
|
2987
|
+
__ DispatchMap(rdx, receiver_map, stub, DO_SMI_CHECK);
|
2988
|
+
}
|
2758
2989
|
|
2759
|
-
__ bind(&miss);
|
2760
|
-
__ DecrementCounter(counters->keyed_load_field(), 1);
|
2761
2990
|
GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
|
2762
2991
|
|
2763
2992
|
// Return the generated code.
|
2764
|
-
return GetCode(
|
2993
|
+
return GetCode(Code::NORMAL, factory()->empty_string());
|
2765
2994
|
}
|
2766
2995
|
|
2767
2996
|
|
2768
|
-
Handle<Code> KeyedLoadStubCompiler::
|
2769
|
-
|
2770
|
-
|
2771
|
-
Handle<JSObject> holder,
|
2772
|
-
Handle<AccessorInfo> callback) {
|
2997
|
+
Handle<Code> KeyedLoadStubCompiler::CompileLoadPolymorphic(
|
2998
|
+
MapHandleList* receiver_maps,
|
2999
|
+
CodeHandleList* handler_ics) {
|
2773
3000
|
// ----------- S t a t e -------------
|
2774
|
-
// -- rax
|
2775
|
-
// -- rdx
|
2776
|
-
// -- rsp[0]
|
3001
|
+
// -- rax : key
|
3002
|
+
// -- rdx : receiver
|
3003
|
+
// -- rsp[0] : return address
|
2777
3004
|
// -----------------------------------
|
2778
3005
|
Label miss;
|
2779
|
-
|
2780
|
-
__ IncrementCounter(counters->keyed_load_callback(), 1);
|
2781
|
-
|
2782
|
-
// Check that the name has not changed.
|
2783
|
-
__ Cmp(rax, name);
|
2784
|
-
__ j(not_equal, &miss);
|
2785
|
-
|
2786
|
-
GenerateLoadCallback(receiver, holder, rdx, rax, rbx, rcx, rdi, callback,
|
2787
|
-
name, &miss);
|
2788
|
-
__ bind(&miss);
|
2789
|
-
__ DecrementCounter(counters->keyed_load_callback(), 1);
|
2790
|
-
GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
|
2791
|
-
|
2792
|
-
// Return the generated code.
|
2793
|
-
return GetCode(CALLBACKS, name);
|
2794
|
-
}
|
2795
|
-
|
2796
|
-
|
2797
|
-
Handle<Code> KeyedLoadStubCompiler::CompileLoadConstant(
|
2798
|
-
Handle<String> name,
|
2799
|
-
Handle<JSObject> receiver,
|
2800
|
-
Handle<JSObject> holder,
|
2801
|
-
Handle<JSFunction> value) {
|
2802
|
-
// ----------- S t a t e -------------
|
2803
|
-
// -- rax : key
|
2804
|
-
// -- rdx : receiver
|
2805
|
-
// -- rsp[0] : return address
|
2806
|
-
// -----------------------------------
|
2807
|
-
Label miss;
|
2808
|
-
|
2809
|
-
Counters* counters = isolate()->counters();
|
2810
|
-
__ IncrementCounter(counters->keyed_load_constant_function(), 1);
|
2811
|
-
|
2812
|
-
// Check that the name has not changed.
|
2813
|
-
__ Cmp(rax, name);
|
2814
|
-
__ j(not_equal, &miss);
|
2815
|
-
|
2816
|
-
GenerateLoadConstant(receiver, holder, rdx, rbx, rcx, rdi,
|
2817
|
-
value, name, &miss);
|
2818
|
-
__ bind(&miss);
|
2819
|
-
__ DecrementCounter(counters->keyed_load_constant_function(), 1);
|
2820
|
-
GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
|
2821
|
-
|
2822
|
-
// Return the generated code.
|
2823
|
-
return GetCode(CONSTANT_FUNCTION, name);
|
2824
|
-
}
|
2825
|
-
|
2826
|
-
|
2827
|
-
Handle<Code> KeyedLoadStubCompiler::CompileLoadInterceptor(
|
2828
|
-
Handle<JSObject> receiver,
|
2829
|
-
Handle<JSObject> holder,
|
2830
|
-
Handle<String> name) {
|
2831
|
-
// ----------- S t a t e -------------
|
2832
|
-
// -- rax : key
|
2833
|
-
// -- rdx : receiver
|
2834
|
-
// -- rsp[0] : return address
|
2835
|
-
// -----------------------------------
|
2836
|
-
Label miss;
|
2837
|
-
Counters* counters = isolate()->counters();
|
2838
|
-
__ IncrementCounter(counters->keyed_load_interceptor(), 1);
|
2839
|
-
|
2840
|
-
// Check that the name has not changed.
|
2841
|
-
__ Cmp(rax, name);
|
2842
|
-
__ j(not_equal, &miss);
|
2843
|
-
|
2844
|
-
LookupResult lookup(isolate());
|
2845
|
-
LookupPostInterceptor(holder, name, &lookup);
|
2846
|
-
GenerateLoadInterceptor(receiver, holder, &lookup, rdx, rax, rcx, rbx, rdi,
|
2847
|
-
name, &miss);
|
2848
|
-
__ bind(&miss);
|
2849
|
-
__ DecrementCounter(counters->keyed_load_interceptor(), 1);
|
2850
|
-
GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
|
2851
|
-
|
2852
|
-
// Return the generated code.
|
2853
|
-
return GetCode(INTERCEPTOR, name);
|
2854
|
-
}
|
2855
|
-
|
2856
|
-
|
2857
|
-
Handle<Code> KeyedLoadStubCompiler::CompileLoadArrayLength(
|
2858
|
-
Handle<String> name) {
|
2859
|
-
// ----------- S t a t e -------------
|
2860
|
-
// -- rax : key
|
2861
|
-
// -- rdx : receiver
|
2862
|
-
// -- rsp[0] : return address
|
2863
|
-
// -----------------------------------
|
2864
|
-
Label miss;
|
2865
|
-
|
2866
|
-
Counters* counters = isolate()->counters();
|
2867
|
-
__ IncrementCounter(counters->keyed_load_array_length(), 1);
|
2868
|
-
|
2869
|
-
// Check that the name has not changed.
|
2870
|
-
__ Cmp(rax, name);
|
2871
|
-
__ j(not_equal, &miss);
|
2872
|
-
|
2873
|
-
GenerateLoadArrayLength(masm(), rdx, rcx, &miss);
|
2874
|
-
__ bind(&miss);
|
2875
|
-
__ DecrementCounter(counters->keyed_load_array_length(), 1);
|
2876
|
-
GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
|
2877
|
-
|
2878
|
-
// Return the generated code.
|
2879
|
-
return GetCode(CALLBACKS, name);
|
2880
|
-
}
|
2881
|
-
|
2882
|
-
|
2883
|
-
Handle<Code> KeyedLoadStubCompiler::CompileLoadStringLength(
|
2884
|
-
Handle<String> name) {
|
2885
|
-
// ----------- S t a t e -------------
|
2886
|
-
// -- rax : key
|
2887
|
-
// -- rdx : receiver
|
2888
|
-
// -- rsp[0] : return address
|
2889
|
-
// -----------------------------------
|
2890
|
-
Label miss;
|
2891
|
-
|
2892
|
-
Counters* counters = isolate()->counters();
|
2893
|
-
__ IncrementCounter(counters->keyed_load_string_length(), 1);
|
2894
|
-
|
2895
|
-
// Check that the name has not changed.
|
2896
|
-
__ Cmp(rax, name);
|
2897
|
-
__ j(not_equal, &miss);
|
2898
|
-
|
2899
|
-
GenerateLoadStringLength(masm(), rdx, rcx, rbx, &miss, true);
|
2900
|
-
__ bind(&miss);
|
2901
|
-
__ DecrementCounter(counters->keyed_load_string_length(), 1);
|
2902
|
-
GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
|
2903
|
-
|
2904
|
-
// Return the generated code.
|
2905
|
-
return GetCode(CALLBACKS, name);
|
2906
|
-
}
|
2907
|
-
|
2908
|
-
|
2909
|
-
Handle<Code> KeyedLoadStubCompiler::CompileLoadFunctionPrototype(
|
2910
|
-
Handle<String> name) {
|
2911
|
-
// ----------- S t a t e -------------
|
2912
|
-
// -- rax : key
|
2913
|
-
// -- rdx : receiver
|
2914
|
-
// -- rsp[0] : return address
|
2915
|
-
// -----------------------------------
|
2916
|
-
Label miss;
|
2917
|
-
|
2918
|
-
Counters* counters = isolate()->counters();
|
2919
|
-
__ IncrementCounter(counters->keyed_load_function_prototype(), 1);
|
2920
|
-
|
2921
|
-
// Check that the name has not changed.
|
2922
|
-
__ Cmp(rax, name);
|
2923
|
-
__ j(not_equal, &miss);
|
2924
|
-
|
2925
|
-
GenerateLoadFunctionPrototype(masm(), rdx, rcx, rbx, &miss);
|
2926
|
-
__ bind(&miss);
|
2927
|
-
__ DecrementCounter(counters->keyed_load_function_prototype(), 1);
|
2928
|
-
GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
|
2929
|
-
|
2930
|
-
// Return the generated code.
|
2931
|
-
return GetCode(CALLBACKS, name);
|
2932
|
-
}
|
2933
|
-
|
2934
|
-
|
2935
|
-
Handle<Code> KeyedLoadStubCompiler::CompileLoadElement(
|
2936
|
-
Handle<Map> receiver_map) {
|
2937
|
-
// ----------- S t a t e -------------
|
2938
|
-
// -- rax : key
|
2939
|
-
// -- rdx : receiver
|
2940
|
-
// -- rsp[0] : return address
|
2941
|
-
// -----------------------------------
|
2942
|
-
ElementsKind elements_kind = receiver_map->elements_kind();
|
2943
|
-
Handle<Code> stub = KeyedLoadElementStub(elements_kind).GetCode();
|
2944
|
-
|
2945
|
-
__ DispatchMap(rdx, receiver_map, stub, DO_SMI_CHECK);
|
2946
|
-
|
2947
|
-
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Miss();
|
2948
|
-
__ jmp(ic, RelocInfo::CODE_TARGET);
|
2949
|
-
|
2950
|
-
// Return the generated code.
|
2951
|
-
return GetCode(NORMAL, factory()->empty_string());
|
2952
|
-
}
|
2953
|
-
|
2954
|
-
|
2955
|
-
Handle<Code> KeyedLoadStubCompiler::CompileLoadPolymorphic(
|
2956
|
-
MapHandleList* receiver_maps,
|
2957
|
-
CodeHandleList* handler_ics) {
|
2958
|
-
// ----------- S t a t e -------------
|
2959
|
-
// -- rax : key
|
2960
|
-
// -- rdx : receiver
|
2961
|
-
// -- rsp[0] : return address
|
2962
|
-
// -----------------------------------
|
2963
|
-
Label miss;
|
2964
|
-
__ JumpIfSmi(rdx, &miss);
|
3006
|
+
__ JumpIfSmi(rdx, &miss);
|
2965
3007
|
|
2966
3008
|
Register map_reg = rbx;
|
2967
3009
|
__ movq(map_reg, FieldOperand(rdx, HeapObject::kMapOffset));
|
@@ -2976,7 +3018,7 @@ Handle<Code> KeyedLoadStubCompiler::CompileLoadPolymorphic(
|
|
2976
3018
|
GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
|
2977
3019
|
|
2978
3020
|
// Return the generated code.
|
2979
|
-
return GetCode(NORMAL, factory()->empty_string(),
|
3021
|
+
return GetCode(Code::NORMAL, factory()->empty_string(), POLYMORPHIC);
|
2980
3022
|
}
|
2981
3023
|
|
2982
3024
|
|
@@ -3006,6 +3048,7 @@ Handle<Code> ConstructStubCompiler::CompileConstructStub(
|
|
3006
3048
|
#endif
|
3007
3049
|
|
3008
3050
|
// Load the initial map and verify that it is in fact a map.
|
3051
|
+
// rdi: constructor
|
3009
3052
|
__ movq(rbx, FieldOperand(rdi, JSFunction::kPrototypeOrInitialMapOffset));
|
3010
3053
|
// Will both indicate a NULL and a Smi.
|
3011
3054
|
STATIC_ASSERT(kSmiTag == 0);
|
@@ -3015,18 +3058,22 @@ Handle<Code> ConstructStubCompiler::CompileConstructStub(
|
|
3015
3058
|
|
3016
3059
|
#ifdef DEBUG
|
3017
3060
|
// Cannot construct functions this way.
|
3018
|
-
// rdi: constructor
|
3019
3061
|
// rbx: initial map
|
3020
3062
|
__ CmpInstanceType(rbx, JS_FUNCTION_TYPE);
|
3021
|
-
__
|
3063
|
+
__ Check(not_equal, "Function constructed by construct stub.");
|
3022
3064
|
#endif
|
3023
3065
|
|
3024
3066
|
// Now allocate the JSObject in new space.
|
3025
|
-
// rdi: constructor
|
3026
3067
|
// rbx: initial map
|
3068
|
+
ASSERT(function->has_initial_map());
|
3069
|
+
int instance_size = function->initial_map()->instance_size();
|
3070
|
+
#ifdef DEBUG
|
3027
3071
|
__ movzxbq(rcx, FieldOperand(rbx, Map::kInstanceSizeOffset));
|
3028
3072
|
__ shl(rcx, Immediate(kPointerSizeLog2));
|
3029
|
-
__
|
3073
|
+
__ cmpq(rcx, Immediate(instance_size));
|
3074
|
+
__ Check(equal, "Instance size of initial map changed.");
|
3075
|
+
#endif
|
3076
|
+
__ AllocateInNewSpace(instance_size, rdx, rcx, no_reg,
|
3030
3077
|
&generic_stub_call, NO_ALLOCATION_FLAGS);
|
3031
3078
|
|
3032
3079
|
// Allocated the JSObject, now initialize the fields and add the heap tag.
|
@@ -3072,7 +3119,6 @@ Handle<Code> ConstructStubCompiler::CompileConstructStub(
|
|
3072
3119
|
}
|
3073
3120
|
|
3074
3121
|
// Fill the unused in-object property fields with undefined.
|
3075
|
-
ASSERT(function->has_initial_map());
|
3076
3122
|
for (int i = shared->this_property_assignments_count();
|
3077
3123
|
i < function->initial_map()->inobject_properties();
|
3078
3124
|
i++) {
|
@@ -3183,140 +3229,6 @@ static void GenerateSmiKeyCheck(MacroAssembler* masm,
|
|
3183
3229
|
}
|
3184
3230
|
|
3185
3231
|
|
3186
|
-
void KeyedLoadStubCompiler::GenerateLoadExternalArray(
|
3187
|
-
MacroAssembler* masm,
|
3188
|
-
ElementsKind elements_kind) {
|
3189
|
-
// ----------- S t a t e -------------
|
3190
|
-
// -- rax : key
|
3191
|
-
// -- rdx : receiver
|
3192
|
-
// -- rsp[0] : return address
|
3193
|
-
// -----------------------------------
|
3194
|
-
Label slow, miss_force_generic;
|
3195
|
-
|
3196
|
-
// This stub is meant to be tail-jumped to, the receiver must already
|
3197
|
-
// have been verified by the caller to not be a smi.
|
3198
|
-
|
3199
|
-
// Check that the key is a smi or a heap number convertible to a smi.
|
3200
|
-
GenerateSmiKeyCheck(masm, rax, rcx, xmm0, xmm1, &miss_force_generic);
|
3201
|
-
|
3202
|
-
// Check that the index is in range.
|
3203
|
-
__ movq(rbx, FieldOperand(rdx, JSObject::kElementsOffset));
|
3204
|
-
__ SmiToInteger32(rcx, rax);
|
3205
|
-
__ cmpq(rax, FieldOperand(rbx, ExternalArray::kLengthOffset));
|
3206
|
-
// Unsigned comparison catches both negative and too-large values.
|
3207
|
-
__ j(above_equal, &miss_force_generic);
|
3208
|
-
|
3209
|
-
// rax: index (as a smi)
|
3210
|
-
// rdx: receiver (JSObject)
|
3211
|
-
// rcx: untagged index
|
3212
|
-
// rbx: elements array
|
3213
|
-
__ movq(rbx, FieldOperand(rbx, ExternalArray::kExternalPointerOffset));
|
3214
|
-
// rbx: base pointer of external storage
|
3215
|
-
switch (elements_kind) {
|
3216
|
-
case EXTERNAL_BYTE_ELEMENTS:
|
3217
|
-
__ movsxbq(rcx, Operand(rbx, rcx, times_1, 0));
|
3218
|
-
break;
|
3219
|
-
case EXTERNAL_PIXEL_ELEMENTS:
|
3220
|
-
case EXTERNAL_UNSIGNED_BYTE_ELEMENTS:
|
3221
|
-
__ movzxbq(rcx, Operand(rbx, rcx, times_1, 0));
|
3222
|
-
break;
|
3223
|
-
case EXTERNAL_SHORT_ELEMENTS:
|
3224
|
-
__ movsxwq(rcx, Operand(rbx, rcx, times_2, 0));
|
3225
|
-
break;
|
3226
|
-
case EXTERNAL_UNSIGNED_SHORT_ELEMENTS:
|
3227
|
-
__ movzxwq(rcx, Operand(rbx, rcx, times_2, 0));
|
3228
|
-
break;
|
3229
|
-
case EXTERNAL_INT_ELEMENTS:
|
3230
|
-
__ movsxlq(rcx, Operand(rbx, rcx, times_4, 0));
|
3231
|
-
break;
|
3232
|
-
case EXTERNAL_UNSIGNED_INT_ELEMENTS:
|
3233
|
-
__ movl(rcx, Operand(rbx, rcx, times_4, 0));
|
3234
|
-
break;
|
3235
|
-
case EXTERNAL_FLOAT_ELEMENTS:
|
3236
|
-
__ cvtss2sd(xmm0, Operand(rbx, rcx, times_4, 0));
|
3237
|
-
break;
|
3238
|
-
case EXTERNAL_DOUBLE_ELEMENTS:
|
3239
|
-
__ movsd(xmm0, Operand(rbx, rcx, times_8, 0));
|
3240
|
-
break;
|
3241
|
-
default:
|
3242
|
-
UNREACHABLE();
|
3243
|
-
break;
|
3244
|
-
}
|
3245
|
-
|
3246
|
-
// rax: index
|
3247
|
-
// rdx: receiver
|
3248
|
-
// For integer array types:
|
3249
|
-
// rcx: value
|
3250
|
-
// For floating-point array type:
|
3251
|
-
// xmm0: value as double.
|
3252
|
-
|
3253
|
-
ASSERT(kSmiValueSize == 32);
|
3254
|
-
if (elements_kind == EXTERNAL_UNSIGNED_INT_ELEMENTS) {
|
3255
|
-
// For the UnsignedInt array type, we need to see whether
|
3256
|
-
// the value can be represented in a Smi. If not, we need to convert
|
3257
|
-
// it to a HeapNumber.
|
3258
|
-
Label box_int;
|
3259
|
-
|
3260
|
-
__ JumpIfUIntNotValidSmiValue(rcx, &box_int, Label::kNear);
|
3261
|
-
|
3262
|
-
__ Integer32ToSmi(rax, rcx);
|
3263
|
-
__ ret(0);
|
3264
|
-
|
3265
|
-
__ bind(&box_int);
|
3266
|
-
|
3267
|
-
// Allocate a HeapNumber for the int and perform int-to-double
|
3268
|
-
// conversion.
|
3269
|
-
// The value is zero-extended since we loaded the value from memory
|
3270
|
-
// with movl.
|
3271
|
-
__ cvtqsi2sd(xmm0, rcx);
|
3272
|
-
|
3273
|
-
__ AllocateHeapNumber(rcx, rbx, &slow);
|
3274
|
-
// Set the value.
|
3275
|
-
__ movsd(FieldOperand(rcx, HeapNumber::kValueOffset), xmm0);
|
3276
|
-
__ movq(rax, rcx);
|
3277
|
-
__ ret(0);
|
3278
|
-
} else if (elements_kind == EXTERNAL_FLOAT_ELEMENTS ||
|
3279
|
-
elements_kind == EXTERNAL_DOUBLE_ELEMENTS) {
|
3280
|
-
// For the floating-point array type, we need to always allocate a
|
3281
|
-
// HeapNumber.
|
3282
|
-
__ AllocateHeapNumber(rcx, rbx, &slow);
|
3283
|
-
// Set the value.
|
3284
|
-
__ movsd(FieldOperand(rcx, HeapNumber::kValueOffset), xmm0);
|
3285
|
-
__ movq(rax, rcx);
|
3286
|
-
__ ret(0);
|
3287
|
-
} else {
|
3288
|
-
__ Integer32ToSmi(rax, rcx);
|
3289
|
-
__ ret(0);
|
3290
|
-
}
|
3291
|
-
|
3292
|
-
// Slow case: Jump to runtime.
|
3293
|
-
__ bind(&slow);
|
3294
|
-
Counters* counters = masm->isolate()->counters();
|
3295
|
-
__ IncrementCounter(counters->keyed_load_external_array_slow(), 1);
|
3296
|
-
|
3297
|
-
// ----------- S t a t e -------------
|
3298
|
-
// -- rax : key
|
3299
|
-
// -- rdx : receiver
|
3300
|
-
// -- rsp[0] : return address
|
3301
|
-
// -----------------------------------
|
3302
|
-
|
3303
|
-
Handle<Code> ic = masm->isolate()->builtins()->KeyedLoadIC_Slow();
|
3304
|
-
__ jmp(ic, RelocInfo::CODE_TARGET);
|
3305
|
-
|
3306
|
-
// Miss case: Jump to runtime.
|
3307
|
-
__ bind(&miss_force_generic);
|
3308
|
-
|
3309
|
-
// ----------- S t a t e -------------
|
3310
|
-
// -- rax : key
|
3311
|
-
// -- rdx : receiver
|
3312
|
-
// -- rsp[0] : return address
|
3313
|
-
// -----------------------------------
|
3314
|
-
Handle<Code> miss_ic =
|
3315
|
-
masm->isolate()->builtins()->KeyedLoadIC_MissForceGeneric();
|
3316
|
-
__ jmp(miss_ic, RelocInfo::CODE_TARGET);
|
3317
|
-
}
|
3318
|
-
|
3319
|
-
|
3320
3232
|
void KeyedStoreStubCompiler::GenerateStoreExternalArray(
|
3321
3233
|
MacroAssembler* masm,
|
3322
3234
|
ElementsKind elements_kind) {
|
@@ -3506,98 +3418,6 @@ void KeyedStoreStubCompiler::GenerateStoreExternalArray(
|
|
3506
3418
|
}
|
3507
3419
|
|
3508
3420
|
|
3509
|
-
void KeyedLoadStubCompiler::GenerateLoadFastElement(MacroAssembler* masm) {
|
3510
|
-
// ----------- S t a t e -------------
|
3511
|
-
// -- rax : key
|
3512
|
-
// -- rdx : receiver
|
3513
|
-
// -- rsp[0] : return address
|
3514
|
-
// -----------------------------------
|
3515
|
-
Label miss_force_generic;
|
3516
|
-
|
3517
|
-
// This stub is meant to be tail-jumped to, the receiver must already
|
3518
|
-
// have been verified by the caller to not be a smi.
|
3519
|
-
|
3520
|
-
// Check that the key is a smi or a heap number convertible to a smi.
|
3521
|
-
GenerateSmiKeyCheck(masm, rax, rcx, xmm0, xmm1, &miss_force_generic);
|
3522
|
-
|
3523
|
-
// Get the elements array.
|
3524
|
-
__ movq(rcx, FieldOperand(rdx, JSObject::kElementsOffset));
|
3525
|
-
__ AssertFastElements(rcx);
|
3526
|
-
|
3527
|
-
// Check that the key is within bounds.
|
3528
|
-
__ SmiCompare(rax, FieldOperand(rcx, FixedArray::kLengthOffset));
|
3529
|
-
__ j(above_equal, &miss_force_generic);
|
3530
|
-
|
3531
|
-
// Load the result and make sure it's not the hole.
|
3532
|
-
SmiIndex index = masm->SmiToIndex(rbx, rax, kPointerSizeLog2);
|
3533
|
-
__ movq(rbx, FieldOperand(rcx,
|
3534
|
-
index.reg,
|
3535
|
-
index.scale,
|
3536
|
-
FixedArray::kHeaderSize));
|
3537
|
-
__ CompareRoot(rbx, Heap::kTheHoleValueRootIndex);
|
3538
|
-
__ j(equal, &miss_force_generic);
|
3539
|
-
__ movq(rax, rbx);
|
3540
|
-
__ ret(0);
|
3541
|
-
|
3542
|
-
__ bind(&miss_force_generic);
|
3543
|
-
Code* code = masm->isolate()->builtins()->builtin(
|
3544
|
-
Builtins::kKeyedLoadIC_MissForceGeneric);
|
3545
|
-
Handle<Code> ic(code);
|
3546
|
-
__ jmp(ic, RelocInfo::CODE_TARGET);
|
3547
|
-
}
|
3548
|
-
|
3549
|
-
|
3550
|
-
void KeyedLoadStubCompiler::GenerateLoadFastDoubleElement(
|
3551
|
-
MacroAssembler* masm) {
|
3552
|
-
// ----------- S t a t e -------------
|
3553
|
-
// -- rax : key
|
3554
|
-
// -- rdx : receiver
|
3555
|
-
// -- rsp[0] : return address
|
3556
|
-
// -----------------------------------
|
3557
|
-
Label miss_force_generic, slow_allocate_heapnumber;
|
3558
|
-
|
3559
|
-
// This stub is meant to be tail-jumped to, the receiver must already
|
3560
|
-
// have been verified by the caller to not be a smi.
|
3561
|
-
|
3562
|
-
// Check that the key is a smi or a heap number convertible to a smi.
|
3563
|
-
GenerateSmiKeyCheck(masm, rax, rcx, xmm0, xmm1, &miss_force_generic);
|
3564
|
-
|
3565
|
-
// Get the elements array.
|
3566
|
-
__ movq(rcx, FieldOperand(rdx, JSObject::kElementsOffset));
|
3567
|
-
__ AssertFastElements(rcx);
|
3568
|
-
|
3569
|
-
// Check that the key is within bounds.
|
3570
|
-
__ SmiCompare(rax, FieldOperand(rcx, FixedArray::kLengthOffset));
|
3571
|
-
__ j(above_equal, &miss_force_generic);
|
3572
|
-
|
3573
|
-
// Check for the hole
|
3574
|
-
__ SmiToInteger32(kScratchRegister, rax);
|
3575
|
-
uint32_t offset = FixedDoubleArray::kHeaderSize + sizeof(kHoleNanLower32);
|
3576
|
-
__ cmpl(FieldOperand(rcx, kScratchRegister, times_8, offset),
|
3577
|
-
Immediate(kHoleNanUpper32));
|
3578
|
-
__ j(equal, &miss_force_generic);
|
3579
|
-
|
3580
|
-
// Always allocate a heap number for the result.
|
3581
|
-
__ movsd(xmm0, FieldOperand(rcx, kScratchRegister, times_8,
|
3582
|
-
FixedDoubleArray::kHeaderSize));
|
3583
|
-
__ AllocateHeapNumber(rcx, rbx, &slow_allocate_heapnumber);
|
3584
|
-
// Set the value.
|
3585
|
-
__ movq(rax, rcx);
|
3586
|
-
__ movsd(FieldOperand(rcx, HeapNumber::kValueOffset), xmm0);
|
3587
|
-
__ ret(0);
|
3588
|
-
|
3589
|
-
__ bind(&slow_allocate_heapnumber);
|
3590
|
-
Handle<Code> slow_ic =
|
3591
|
-
masm->isolate()->builtins()->KeyedLoadIC_Slow();
|
3592
|
-
__ jmp(slow_ic, RelocInfo::CODE_TARGET);
|
3593
|
-
|
3594
|
-
__ bind(&miss_force_generic);
|
3595
|
-
Handle<Code> miss_ic =
|
3596
|
-
masm->isolate()->builtins()->KeyedLoadIC_MissForceGeneric();
|
3597
|
-
__ jmp(miss_ic, RelocInfo::CODE_TARGET);
|
3598
|
-
}
|
3599
|
-
|
3600
|
-
|
3601
3421
|
void KeyedStoreStubCompiler::GenerateStoreFastElement(
|
3602
3422
|
MacroAssembler* masm,
|
3603
3423
|
bool is_js_array,
|
@@ -3752,7 +3572,7 @@ void KeyedStoreStubCompiler::GenerateStoreFastDoubleElement(
|
|
3752
3572
|
// -- rsp[0] : return address
|
3753
3573
|
// -----------------------------------
|
3754
3574
|
Label miss_force_generic, transition_elements_kind, finish_store;
|
3755
|
-
Label grow, slow, check_capacity;
|
3575
|
+
Label grow, slow, check_capacity, restore_key_transition_elements_kind;
|
3756
3576
|
|
3757
3577
|
// This stub is meant to be tail-jumped to, the receiver must already
|
3758
3578
|
// have been verified by the caller to not be a smi.
|
@@ -3781,7 +3601,7 @@ void KeyedStoreStubCompiler::GenerateStoreFastDoubleElement(
|
|
3781
3601
|
__ bind(&finish_store);
|
3782
3602
|
__ SmiToInteger32(rcx, rcx);
|
3783
3603
|
__ StoreNumberToDoubleElements(rax, rdi, rcx, xmm0,
|
3784
|
-
&
|
3604
|
+
&restore_key_transition_elements_kind);
|
3785
3605
|
__ ret(0);
|
3786
3606
|
|
3787
3607
|
// Handle store cache miss, replacing the ic with the generic stub.
|
@@ -3790,9 +3610,10 @@ void KeyedStoreStubCompiler::GenerateStoreFastDoubleElement(
|
|
3790
3610
|
masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric();
|
3791
3611
|
__ jmp(ic_force_generic, RelocInfo::CODE_TARGET);
|
3792
3612
|
|
3793
|
-
__ bind(&
|
3613
|
+
__ bind(&restore_key_transition_elements_kind);
|
3794
3614
|
// Restore smi-tagging of rcx.
|
3795
3615
|
__ Integer32ToSmi(rcx, rcx);
|
3616
|
+
__ bind(&transition_elements_kind);
|
3796
3617
|
Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss();
|
3797
3618
|
__ jmp(ic_miss, RelocInfo::CODE_TARGET);
|
3798
3619
|
|
@@ -3833,6 +3654,16 @@ void KeyedStoreStubCompiler::GenerateStoreFastDoubleElement(
|
|
3833
3654
|
__ Move(FieldOperand(rdi, FixedDoubleArray::kLengthOffset),
|
3834
3655
|
Smi::FromInt(JSArray::kPreallocatedArrayElements));
|
3835
3656
|
|
3657
|
+
// Increment the length of the array.
|
3658
|
+
__ SmiToInteger32(rcx, rcx);
|
3659
|
+
__ StoreNumberToDoubleElements(rax, rdi, rcx, xmm0,
|
3660
|
+
&restore_key_transition_elements_kind);
|
3661
|
+
|
3662
|
+
__ movq(r8, BitCast<int64_t, uint64_t>(kHoleNanInt64), RelocInfo::NONE64);
|
3663
|
+
for (int i = 1; i < JSArray::kPreallocatedArrayElements; i++) {
|
3664
|
+
__ movq(FieldOperand(rdi, FixedDoubleArray::OffsetOfElementAt(i)), r8);
|
3665
|
+
}
|
3666
|
+
|
3836
3667
|
// Install the new backing store in the JSArray.
|
3837
3668
|
__ movq(FieldOperand(rdx, JSObject::kElementsOffset), rdi);
|
3838
3669
|
__ RecordWriteField(rdx, JSObject::kElementsOffset, rdi, rbx,
|
@@ -3841,7 +3672,7 @@ void KeyedStoreStubCompiler::GenerateStoreFastDoubleElement(
|
|
3841
3672
|
// Increment the length of the array.
|
3842
3673
|
__ Move(FieldOperand(rdx, JSArray::kLengthOffset), Smi::FromInt(1));
|
3843
3674
|
__ movq(rdi, FieldOperand(rdx, JSObject::kElementsOffset));
|
3844
|
-
__
|
3675
|
+
__ ret(0);
|
3845
3676
|
|
3846
3677
|
__ bind(&check_capacity);
|
3847
3678
|
// rax: value
|