mustang 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.rspec +1 -0
- data/Isolate +9 -0
- data/README.md +6 -12
- data/Rakefile +30 -4
- data/TODO.md +9 -0
- data/ext/v8/extconf.rb +56 -0
- data/ext/v8/v8.cpp +37 -0
- data/ext/v8/v8_array.cpp +161 -0
- data/ext/v8/v8_array.h +17 -0
- data/ext/v8/v8_base.cpp +147 -0
- data/ext/v8/v8_base.h +23 -0
- data/ext/v8/v8_cast.cpp +151 -0
- data/ext/v8/v8_cast.h +64 -0
- data/ext/v8/v8_context.cpp +174 -0
- data/ext/v8/v8_context.h +12 -0
- data/ext/v8/v8_date.cpp +61 -0
- data/ext/v8/v8_date.h +16 -0
- data/ext/v8/v8_errors.cpp +147 -0
- data/ext/v8/v8_errors.h +19 -0
- data/ext/v8/v8_external.cpp +66 -0
- data/ext/v8/v8_external.h +16 -0
- data/ext/v8/v8_function.cpp +182 -0
- data/ext/v8/v8_function.h +14 -0
- data/ext/v8/v8_integer.cpp +70 -0
- data/ext/v8/v8_integer.h +16 -0
- data/ext/v8/v8_macros.h +30 -0
- data/ext/v8/v8_main.cpp +53 -0
- data/ext/v8/v8_main.h +13 -0
- data/ext/v8/v8_number.cpp +62 -0
- data/ext/v8/v8_number.h +16 -0
- data/ext/v8/v8_object.cpp +172 -0
- data/ext/v8/v8_object.h +17 -0
- data/ext/v8/v8_ref.cpp +72 -0
- data/ext/v8/v8_ref.h +43 -0
- data/ext/v8/v8_regexp.cpp +148 -0
- data/ext/v8/v8_regexp.h +16 -0
- data/ext/v8/v8_string.cpp +78 -0
- data/ext/v8/v8_string.h +16 -0
- data/ext/v8/v8_value.cpp +370 -0
- data/ext/v8/v8_value.h +19 -0
- data/gemspec.yml +2 -1
- data/lib/core_ext/class.rb +14 -0
- data/lib/core_ext/object.rb +12 -0
- data/lib/core_ext/symbol.rb +23 -0
- data/lib/mustang.rb +44 -0
- data/lib/mustang/context.rb +69 -0
- data/lib/mustang/errors.rb +36 -0
- data/lib/support/delegated.rb +25 -0
- data/lib/v8/array.rb +21 -0
- data/lib/v8/context.rb +13 -0
- data/lib/v8/date.rb +20 -0
- data/lib/v8/error.rb +15 -0
- data/lib/v8/external.rb +16 -0
- data/lib/v8/function.rb +11 -0
- data/lib/v8/integer.rb +16 -0
- data/lib/v8/number.rb +16 -0
- data/lib/v8/object.rb +66 -0
- data/lib/v8/regexp.rb +23 -0
- data/lib/v8/string.rb +27 -0
- data/mustang.gemspec +3 -0
- data/spec/core_ext/class_spec.rb +19 -0
- data/spec/core_ext/object_spec.rb +19 -0
- data/spec/core_ext/symbol_spec.rb +27 -0
- data/spec/fixtures/test1.js +2 -0
- data/spec/fixtures/test2.js +2 -0
- data/spec/spec_helper.rb +20 -0
- data/spec/v8/array_spec.rb +88 -0
- data/spec/v8/cast_spec.rb +151 -0
- data/spec/v8/context_spec.rb +78 -0
- data/spec/v8/data_spec.rb +39 -0
- data/spec/v8/date_spec.rb +45 -0
- data/spec/v8/empty_spec.rb +27 -0
- data/spec/v8/errors_spec.rb +142 -0
- data/spec/v8/external_spec.rb +44 -0
- data/spec/v8/function_spec.rb +170 -0
- data/spec/v8/integer_spec.rb +41 -0
- data/spec/v8/main_spec.rb +18 -0
- data/spec/v8/null_spec.rb +27 -0
- data/spec/v8/number_spec.rb +40 -0
- data/spec/v8/object_spec.rb +79 -0
- data/spec/v8/primitive_spec.rb +9 -0
- data/spec/v8/regexp_spec.rb +65 -0
- data/spec/v8/string_spec.rb +48 -0
- data/spec/v8/undefined_spec.rb +27 -0
- data/spec/v8/value_spec.rb +215 -0
- data/vendor/v8/.gitignore +2 -0
- data/vendor/v8/AUTHORS +3 -1
- data/vendor/v8/ChangeLog +117 -0
- data/vendor/v8/SConstruct +334 -53
- data/vendor/v8/include/v8-debug.h +21 -11
- data/vendor/v8/include/v8-preparser.h +1 -1
- data/vendor/v8/include/v8-profiler.h +122 -43
- data/vendor/v8/include/v8-testing.h +5 -0
- data/vendor/v8/include/v8.h +171 -17
- data/vendor/v8/preparser/SConscript +38 -0
- data/vendor/v8/preparser/preparser-process.cc +77 -114
- data/vendor/v8/samples/shell.cc +232 -46
- data/vendor/v8/src/SConscript +29 -5
- data/vendor/v8/src/accessors.cc +70 -211
- data/vendor/v8/{test/cctest/test-mips.cc → src/allocation-inl.h} +15 -18
- data/vendor/v8/src/allocation.cc +0 -82
- data/vendor/v8/src/allocation.h +9 -42
- data/vendor/v8/src/api.cc +1645 -1156
- data/vendor/v8/src/api.h +76 -12
- data/vendor/v8/src/apiutils.h +0 -7
- data/vendor/v8/src/arguments.h +15 -4
- data/vendor/v8/src/arm/assembler-arm-inl.h +10 -9
- data/vendor/v8/src/arm/assembler-arm.cc +62 -23
- data/vendor/v8/src/arm/assembler-arm.h +76 -11
- data/vendor/v8/src/arm/builtins-arm.cc +39 -33
- data/vendor/v8/src/arm/code-stubs-arm.cc +1182 -402
- data/vendor/v8/src/arm/code-stubs-arm.h +20 -54
- data/vendor/v8/src/arm/codegen-arm.cc +159 -106
- data/vendor/v8/src/arm/codegen-arm.h +6 -6
- data/vendor/v8/src/arm/constants-arm.h +16 -1
- data/vendor/v8/src/arm/cpu-arm.cc +7 -5
- data/vendor/v8/src/arm/debug-arm.cc +6 -4
- data/vendor/v8/src/arm/deoptimizer-arm.cc +51 -14
- data/vendor/v8/src/arm/disasm-arm.cc +47 -15
- data/vendor/v8/src/arm/frames-arm.h +1 -1
- data/vendor/v8/src/arm/full-codegen-arm.cc +724 -408
- data/vendor/v8/src/arm/ic-arm.cc +90 -85
- data/vendor/v8/src/arm/lithium-arm.cc +140 -69
- data/vendor/v8/src/arm/lithium-arm.h +161 -46
- data/vendor/v8/src/arm/lithium-codegen-arm.cc +567 -297
- data/vendor/v8/src/arm/lithium-codegen-arm.h +21 -9
- data/vendor/v8/src/arm/lithium-gap-resolver-arm.cc +2 -0
- data/vendor/v8/src/arm/macro-assembler-arm.cc +457 -96
- data/vendor/v8/src/arm/macro-assembler-arm.h +115 -18
- data/vendor/v8/src/arm/regexp-macro-assembler-arm.cc +20 -13
- data/vendor/v8/src/arm/regexp-macro-assembler-arm.h +1 -0
- data/vendor/v8/src/arm/simulator-arm.cc +184 -101
- data/vendor/v8/src/arm/simulator-arm.h +26 -21
- data/vendor/v8/src/arm/stub-cache-arm.cc +450 -467
- data/vendor/v8/src/arm/virtual-frame-arm.cc +14 -12
- data/vendor/v8/src/arm/virtual-frame-arm.h +11 -8
- data/vendor/v8/src/array.js +35 -18
- data/vendor/v8/src/assembler.cc +186 -92
- data/vendor/v8/src/assembler.h +106 -69
- data/vendor/v8/src/ast-inl.h +5 -0
- data/vendor/v8/src/ast.cc +46 -35
- data/vendor/v8/src/ast.h +107 -50
- data/vendor/v8/src/atomicops.h +2 -0
- data/vendor/v8/src/atomicops_internals_mips_gcc.h +169 -0
- data/vendor/v8/src/bootstrapper.cc +649 -399
- data/vendor/v8/src/bootstrapper.h +94 -27
- data/vendor/v8/src/builtins.cc +359 -227
- data/vendor/v8/src/builtins.h +157 -123
- data/vendor/v8/src/checks.cc +2 -2
- data/vendor/v8/src/checks.h +4 -0
- data/vendor/v8/src/code-stubs.cc +27 -17
- data/vendor/v8/src/code-stubs.h +38 -17
- data/vendor/v8/src/codegen-inl.h +5 -1
- data/vendor/v8/src/codegen.cc +27 -17
- data/vendor/v8/src/codegen.h +9 -9
- data/vendor/v8/src/compilation-cache.cc +92 -206
- data/vendor/v8/src/compilation-cache.h +205 -30
- data/vendor/v8/src/compiler.cc +107 -120
- data/vendor/v8/src/compiler.h +17 -2
- data/vendor/v8/src/contexts.cc +22 -15
- data/vendor/v8/src/contexts.h +14 -8
- data/vendor/v8/src/conversions.cc +86 -30
- data/vendor/v8/src/counters.cc +19 -4
- data/vendor/v8/src/counters.h +28 -16
- data/vendor/v8/src/cpu-profiler-inl.h +4 -3
- data/vendor/v8/src/cpu-profiler.cc +123 -72
- data/vendor/v8/src/cpu-profiler.h +33 -19
- data/vendor/v8/src/cpu.h +2 -0
- data/vendor/v8/src/d8-debug.cc +3 -3
- data/vendor/v8/src/d8-debug.h +7 -6
- data/vendor/v8/src/d8-posix.cc +2 -0
- data/vendor/v8/src/d8.cc +22 -12
- data/vendor/v8/src/d8.gyp +3 -0
- data/vendor/v8/src/d8.js +618 -0
- data/vendor/v8/src/data-flow.h +3 -3
- data/vendor/v8/src/dateparser.h +4 -2
- data/vendor/v8/src/debug-agent.cc +10 -9
- data/vendor/v8/src/debug-agent.h +9 -11
- data/vendor/v8/src/debug-debugger.js +121 -0
- data/vendor/v8/src/debug.cc +331 -227
- data/vendor/v8/src/debug.h +248 -219
- data/vendor/v8/src/deoptimizer.cc +173 -62
- data/vendor/v8/src/deoptimizer.h +119 -19
- data/vendor/v8/src/disasm.h +3 -0
- data/vendor/v8/src/disassembler.cc +10 -9
- data/vendor/v8/src/execution.cc +185 -129
- data/vendor/v8/src/execution.h +47 -78
- data/vendor/v8/src/extensions/experimental/break-iterator.cc +250 -0
- data/vendor/v8/src/extensions/experimental/break-iterator.h +89 -0
- data/vendor/v8/src/extensions/experimental/experimental.gyp +2 -0
- data/vendor/v8/src/extensions/experimental/i18n-extension.cc +22 -2
- data/vendor/v8/src/extensions/externalize-string-extension.cc +2 -2
- data/vendor/v8/src/extensions/gc-extension.cc +1 -1
- data/vendor/v8/src/factory.cc +261 -154
- data/vendor/v8/src/factory.h +162 -158
- data/vendor/v8/src/flag-definitions.h +17 -11
- data/vendor/v8/src/frame-element.cc +0 -5
- data/vendor/v8/src/frame-element.h +9 -13
- data/vendor/v8/src/frames-inl.h +7 -0
- data/vendor/v8/src/frames.cc +56 -46
- data/vendor/v8/src/frames.h +36 -25
- data/vendor/v8/src/full-codegen.cc +15 -24
- data/vendor/v8/src/full-codegen.h +13 -41
- data/vendor/v8/src/func-name-inferrer.cc +7 -6
- data/vendor/v8/src/func-name-inferrer.h +1 -1
- data/vendor/v8/src/gdb-jit.cc +1 -0
- data/vendor/v8/src/global-handles.cc +118 -56
- data/vendor/v8/src/global-handles.h +98 -40
- data/vendor/v8/src/globals.h +2 -2
- data/vendor/v8/src/handles-inl.h +106 -9
- data/vendor/v8/src/handles.cc +220 -157
- data/vendor/v8/src/handles.h +38 -59
- data/vendor/v8/src/hashmap.h +3 -3
- data/vendor/v8/src/heap-inl.h +141 -25
- data/vendor/v8/src/heap-profiler.cc +117 -63
- data/vendor/v8/src/heap-profiler.h +38 -21
- data/vendor/v8/src/heap.cc +805 -564
- data/vendor/v8/src/heap.h +640 -594
- data/vendor/v8/src/hydrogen-instructions.cc +216 -73
- data/vendor/v8/src/hydrogen-instructions.h +259 -124
- data/vendor/v8/src/hydrogen.cc +996 -1171
- data/vendor/v8/src/hydrogen.h +163 -144
- data/vendor/v8/src/ia32/assembler-ia32-inl.h +12 -11
- data/vendor/v8/src/ia32/assembler-ia32.cc +85 -39
- data/vendor/v8/src/ia32/assembler-ia32.h +82 -16
- data/vendor/v8/src/ia32/builtins-ia32.cc +64 -58
- data/vendor/v8/src/ia32/code-stubs-ia32.cc +248 -324
- data/vendor/v8/src/ia32/code-stubs-ia32.h +3 -44
- data/vendor/v8/src/ia32/codegen-ia32.cc +217 -165
- data/vendor/v8/src/ia32/codegen-ia32.h +3 -0
- data/vendor/v8/src/ia32/cpu-ia32.cc +6 -5
- data/vendor/v8/src/ia32/debug-ia32.cc +8 -5
- data/vendor/v8/src/ia32/deoptimizer-ia32.cc +124 -14
- data/vendor/v8/src/ia32/disasm-ia32.cc +85 -62
- data/vendor/v8/src/ia32/frames-ia32.h +1 -1
- data/vendor/v8/src/ia32/full-codegen-ia32.cc +348 -435
- data/vendor/v8/src/ia32/ic-ia32.cc +91 -91
- data/vendor/v8/src/ia32/lithium-codegen-ia32.cc +500 -255
- data/vendor/v8/src/ia32/lithium-codegen-ia32.h +13 -4
- data/vendor/v8/src/ia32/lithium-gap-resolver-ia32.cc +6 -0
- data/vendor/v8/src/ia32/lithium-ia32.cc +122 -45
- data/vendor/v8/src/ia32/lithium-ia32.h +128 -41
- data/vendor/v8/src/ia32/macro-assembler-ia32.cc +109 -84
- data/vendor/v8/src/ia32/macro-assembler-ia32.h +18 -9
- data/vendor/v8/src/ia32/regexp-macro-assembler-ia32.cc +26 -15
- data/vendor/v8/src/ia32/regexp-macro-assembler-ia32.h +1 -0
- data/vendor/v8/src/ia32/register-allocator-ia32.cc +30 -30
- data/vendor/v8/src/ia32/simulator-ia32.h +4 -4
- data/vendor/v8/src/ia32/stub-cache-ia32.cc +383 -400
- data/vendor/v8/src/ia32/virtual-frame-ia32.cc +36 -13
- data/vendor/v8/src/ia32/virtual-frame-ia32.h +11 -5
- data/vendor/v8/src/ic-inl.h +12 -2
- data/vendor/v8/src/ic.cc +304 -221
- data/vendor/v8/src/ic.h +115 -58
- data/vendor/v8/src/interpreter-irregexp.cc +25 -21
- data/vendor/v8/src/interpreter-irregexp.h +2 -1
- data/vendor/v8/src/isolate.cc +883 -0
- data/vendor/v8/src/isolate.h +1304 -0
- data/vendor/v8/src/json.js +10 -10
- data/vendor/v8/src/jsregexp.cc +111 -80
- data/vendor/v8/src/jsregexp.h +6 -7
- data/vendor/v8/src/jump-target-heavy.cc +5 -8
- data/vendor/v8/src/jump-target-heavy.h +0 -6
- data/vendor/v8/src/jump-target-inl.h +1 -1
- data/vendor/v8/src/jump-target-light.cc +3 -3
- data/vendor/v8/src/lithium-allocator-inl.h +2 -0
- data/vendor/v8/src/lithium-allocator.cc +42 -30
- data/vendor/v8/src/lithium-allocator.h +8 -22
- data/vendor/v8/src/lithium.cc +1 -0
- data/vendor/v8/src/liveedit.cc +141 -99
- data/vendor/v8/src/liveedit.h +7 -2
- data/vendor/v8/src/liveobjectlist-inl.h +90 -0
- data/vendor/v8/src/liveobjectlist.cc +2537 -1
- data/vendor/v8/src/liveobjectlist.h +245 -35
- data/vendor/v8/src/log-utils.cc +122 -35
- data/vendor/v8/src/log-utils.h +33 -36
- data/vendor/v8/src/log.cc +299 -241
- data/vendor/v8/src/log.h +177 -110
- data/vendor/v8/src/mark-compact.cc +612 -470
- data/vendor/v8/src/mark-compact.h +153 -80
- data/vendor/v8/src/messages.cc +16 -14
- data/vendor/v8/src/messages.js +30 -7
- data/vendor/v8/src/mips/assembler-mips-inl.h +155 -35
- data/vendor/v8/src/mips/assembler-mips.cc +1093 -219
- data/vendor/v8/src/mips/assembler-mips.h +552 -153
- data/vendor/v8/src/mips/builtins-mips.cc +43 -100
- data/vendor/v8/src/mips/code-stubs-mips.cc +752 -0
- data/vendor/v8/src/mips/code-stubs-mips.h +511 -0
- data/vendor/v8/src/mips/codegen-mips-inl.h +8 -14
- data/vendor/v8/src/mips/codegen-mips.cc +672 -896
- data/vendor/v8/src/mips/codegen-mips.h +271 -69
- data/vendor/v8/src/mips/constants-mips.cc +44 -20
- data/vendor/v8/src/mips/constants-mips.h +238 -40
- data/vendor/v8/src/mips/cpu-mips.cc +20 -3
- data/vendor/v8/src/mips/debug-mips.cc +35 -7
- data/vendor/v8/src/mips/deoptimizer-mips.cc +91 -0
- data/vendor/v8/src/mips/disasm-mips.cc +329 -93
- data/vendor/v8/src/mips/frames-mips.cc +2 -50
- data/vendor/v8/src/mips/frames-mips.h +24 -9
- data/vendor/v8/src/mips/full-codegen-mips.cc +473 -23
- data/vendor/v8/src/mips/ic-mips.cc +81 -45
- data/vendor/v8/src/mips/jump-target-mips.cc +11 -106
- data/vendor/v8/src/mips/lithium-codegen-mips.h +65 -0
- data/vendor/v8/src/mips/lithium-mips.h +304 -0
- data/vendor/v8/src/mips/macro-assembler-mips.cc +2391 -390
- data/vendor/v8/src/mips/macro-assembler-mips.h +718 -121
- data/vendor/v8/src/mips/regexp-macro-assembler-mips.cc +478 -0
- data/vendor/v8/src/mips/regexp-macro-assembler-mips.h +250 -0
- data/vendor/v8/src/mips/register-allocator-mips-inl.h +0 -3
- data/vendor/v8/src/mips/register-allocator-mips.h +3 -2
- data/vendor/v8/src/mips/simulator-mips.cc +1009 -221
- data/vendor/v8/src/mips/simulator-mips.h +119 -36
- data/vendor/v8/src/mips/stub-cache-mips.cc +331 -148
- data/vendor/v8/src/mips/{fast-codegen-mips.cc → virtual-frame-mips-inl.h} +11 -30
- data/vendor/v8/src/mips/virtual-frame-mips.cc +137 -149
- data/vendor/v8/src/mips/virtual-frame-mips.h +294 -312
- data/vendor/v8/src/mirror-debugger.js +9 -8
- data/vendor/v8/src/mksnapshot.cc +2 -2
- data/vendor/v8/src/objects-debug.cc +16 -16
- data/vendor/v8/src/objects-inl.h +421 -195
- data/vendor/v8/src/objects-printer.cc +7 -7
- data/vendor/v8/src/objects-visiting.cc +1 -1
- data/vendor/v8/src/objects-visiting.h +33 -12
- data/vendor/v8/src/objects.cc +935 -658
- data/vendor/v8/src/objects.h +234 -139
- data/vendor/v8/src/parser.cc +484 -439
- data/vendor/v8/src/parser.h +35 -14
- data/vendor/v8/src/platform-cygwin.cc +173 -107
- data/vendor/v8/src/platform-freebsd.cc +224 -72
- data/vendor/v8/src/platform-linux.cc +234 -95
- data/vendor/v8/src/platform-macos.cc +215 -82
- data/vendor/v8/src/platform-nullos.cc +9 -3
- data/vendor/v8/src/platform-openbsd.cc +22 -7
- data/vendor/v8/src/platform-posix.cc +30 -5
- data/vendor/v8/src/platform-solaris.cc +120 -38
- data/vendor/v8/src/platform-tls-mac.h +62 -0
- data/vendor/v8/src/platform-tls-win32.h +62 -0
- data/vendor/v8/src/platform-tls.h +50 -0
- data/vendor/v8/src/platform-win32.cc +195 -97
- data/vendor/v8/src/platform.h +72 -15
- data/vendor/v8/src/preparse-data.cc +2 -0
- data/vendor/v8/src/preparser-api.cc +8 -2
- data/vendor/v8/src/preparser.cc +1 -1
- data/vendor/v8/src/prettyprinter.cc +43 -52
- data/vendor/v8/src/prettyprinter.h +1 -1
- data/vendor/v8/src/profile-generator-inl.h +0 -28
- data/vendor/v8/src/profile-generator.cc +942 -685
- data/vendor/v8/src/profile-generator.h +210 -176
- data/vendor/v8/src/property.cc +6 -0
- data/vendor/v8/src/property.h +14 -3
- data/vendor/v8/src/regexp-macro-assembler-irregexp.cc +1 -1
- data/vendor/v8/src/regexp-macro-assembler.cc +28 -19
- data/vendor/v8/src/regexp-macro-assembler.h +11 -6
- data/vendor/v8/src/regexp-stack.cc +18 -10
- data/vendor/v8/src/regexp-stack.h +45 -21
- data/vendor/v8/src/regexp.js +3 -3
- data/vendor/v8/src/register-allocator-inl.h +3 -3
- data/vendor/v8/src/register-allocator.cc +1 -7
- data/vendor/v8/src/register-allocator.h +5 -15
- data/vendor/v8/src/rewriter.cc +2 -1
- data/vendor/v8/src/runtime-profiler.cc +158 -128
- data/vendor/v8/src/runtime-profiler.h +131 -15
- data/vendor/v8/src/runtime.cc +2409 -1692
- data/vendor/v8/src/runtime.h +93 -17
- data/vendor/v8/src/safepoint-table.cc +3 -0
- data/vendor/v8/src/safepoint-table.h +9 -3
- data/vendor/v8/src/scanner-base.cc +21 -28
- data/vendor/v8/src/scanner-base.h +22 -11
- data/vendor/v8/src/scanner.cc +3 -5
- data/vendor/v8/src/scanner.h +4 -2
- data/vendor/v8/src/scopeinfo.cc +11 -16
- data/vendor/v8/src/scopeinfo.h +26 -15
- data/vendor/v8/src/scopes.cc +67 -37
- data/vendor/v8/src/scopes.h +26 -12
- data/vendor/v8/src/serialize.cc +193 -154
- data/vendor/v8/src/serialize.h +41 -36
- data/vendor/v8/src/small-pointer-list.h +163 -0
- data/vendor/v8/src/snapshot-common.cc +1 -1
- data/vendor/v8/src/snapshot.h +3 -1
- data/vendor/v8/src/spaces-inl.h +30 -25
- data/vendor/v8/src/spaces.cc +263 -370
- data/vendor/v8/src/spaces.h +178 -166
- data/vendor/v8/src/string-search.cc +4 -3
- data/vendor/v8/src/string-search.h +21 -20
- data/vendor/v8/src/string-stream.cc +32 -24
- data/vendor/v8/src/string.js +7 -7
- data/vendor/v8/src/stub-cache.cc +324 -248
- data/vendor/v8/src/stub-cache.h +181 -155
- data/vendor/v8/src/token.cc +3 -3
- data/vendor/v8/src/token.h +3 -3
- data/vendor/v8/src/top.cc +218 -390
- data/vendor/v8/src/type-info.cc +98 -32
- data/vendor/v8/src/type-info.h +10 -3
- data/vendor/v8/src/unicode.cc +1 -1
- data/vendor/v8/src/unicode.h +1 -1
- data/vendor/v8/src/utils.h +3 -0
- data/vendor/v8/src/v8-counters.cc +18 -11
- data/vendor/v8/src/v8-counters.h +34 -13
- data/vendor/v8/src/v8.cc +66 -121
- data/vendor/v8/src/v8.h +7 -4
- data/vendor/v8/src/v8globals.h +18 -12
- data/vendor/v8/src/{memory.h → v8memory.h} +0 -0
- data/vendor/v8/src/v8natives.js +59 -18
- data/vendor/v8/src/v8threads.cc +127 -114
- data/vendor/v8/src/v8threads.h +42 -35
- data/vendor/v8/src/v8utils.h +2 -39
- data/vendor/v8/src/variables.h +1 -1
- data/vendor/v8/src/version.cc +26 -5
- data/vendor/v8/src/version.h +4 -0
- data/vendor/v8/src/virtual-frame-heavy-inl.h +2 -4
- data/vendor/v8/src/virtual-frame-light-inl.h +5 -4
- data/vendor/v8/src/vm-state-inl.h +21 -17
- data/vendor/v8/src/vm-state.h +7 -5
- data/vendor/v8/src/win32-headers.h +1 -0
- data/vendor/v8/src/x64/assembler-x64-inl.h +12 -11
- data/vendor/v8/src/x64/assembler-x64.cc +80 -40
- data/vendor/v8/src/x64/assembler-x64.h +67 -17
- data/vendor/v8/src/x64/builtins-x64.cc +34 -33
- data/vendor/v8/src/x64/code-stubs-x64.cc +636 -377
- data/vendor/v8/src/x64/code-stubs-x64.h +14 -48
- data/vendor/v8/src/x64/codegen-x64-inl.h +1 -1
- data/vendor/v8/src/x64/codegen-x64.cc +158 -136
- data/vendor/v8/src/x64/codegen-x64.h +4 -1
- data/vendor/v8/src/x64/cpu-x64.cc +7 -5
- data/vendor/v8/src/x64/debug-x64.cc +8 -6
- data/vendor/v8/src/x64/deoptimizer-x64.cc +195 -20
- data/vendor/v8/src/x64/disasm-x64.cc +42 -23
- data/vendor/v8/src/x64/frames-x64.cc +1 -1
- data/vendor/v8/src/x64/frames-x64.h +2 -2
- data/vendor/v8/src/x64/full-codegen-x64.cc +780 -218
- data/vendor/v8/src/x64/ic-x64.cc +77 -79
- data/vendor/v8/src/x64/jump-target-x64.cc +1 -1
- data/vendor/v8/src/x64/lithium-codegen-x64.cc +698 -181
- data/vendor/v8/src/x64/lithium-codegen-x64.h +31 -6
- data/vendor/v8/src/x64/lithium-x64.cc +136 -54
- data/vendor/v8/src/x64/lithium-x64.h +142 -51
- data/vendor/v8/src/x64/macro-assembler-x64.cc +456 -187
- data/vendor/v8/src/x64/macro-assembler-x64.h +166 -34
- data/vendor/v8/src/x64/regexp-macro-assembler-x64.cc +44 -28
- data/vendor/v8/src/x64/regexp-macro-assembler-x64.h +8 -4
- data/vendor/v8/src/x64/register-allocator-x64-inl.h +3 -3
- data/vendor/v8/src/x64/register-allocator-x64.cc +12 -8
- data/vendor/v8/src/x64/simulator-x64.h +5 -5
- data/vendor/v8/src/x64/stub-cache-x64.cc +299 -344
- data/vendor/v8/src/x64/virtual-frame-x64.cc +37 -13
- data/vendor/v8/src/x64/virtual-frame-x64.h +13 -7
- data/vendor/v8/src/zone-inl.h +49 -3
- data/vendor/v8/src/zone.cc +42 -41
- data/vendor/v8/src/zone.h +37 -34
- data/vendor/v8/test/benchmarks/testcfg.py +100 -0
- data/vendor/v8/test/cctest/SConscript +5 -4
- data/vendor/v8/test/cctest/cctest.h +3 -2
- data/vendor/v8/test/cctest/cctest.status +6 -11
- data/vendor/v8/test/cctest/test-accessors.cc +3 -3
- data/vendor/v8/test/cctest/test-alloc.cc +39 -33
- data/vendor/v8/test/cctest/test-api.cc +1092 -205
- data/vendor/v8/test/cctest/test-assembler-arm.cc +39 -25
- data/vendor/v8/test/cctest/test-assembler-ia32.cc +36 -37
- data/vendor/v8/test/cctest/test-assembler-mips.cc +1098 -40
- data/vendor/v8/test/cctest/test-assembler-x64.cc +32 -25
- data/vendor/v8/test/cctest/test-ast.cc +1 -0
- data/vendor/v8/test/cctest/test-circular-queue.cc +8 -5
- data/vendor/v8/test/cctest/test-compiler.cc +24 -24
- data/vendor/v8/test/cctest/test-cpu-profiler.cc +140 -5
- data/vendor/v8/test/cctest/test-dataflow.cc +1 -0
- data/vendor/v8/test/cctest/test-debug.cc +136 -77
- data/vendor/v8/test/cctest/test-decls.cc +1 -1
- data/vendor/v8/test/cctest/test-deoptimization.cc +25 -24
- data/vendor/v8/test/cctest/test-disasm-arm.cc +9 -4
- data/vendor/v8/test/cctest/test-disasm-ia32.cc +10 -8
- data/vendor/v8/test/cctest/test-func-name-inference.cc +10 -4
- data/vendor/v8/test/cctest/test-heap-profiler.cc +226 -164
- data/vendor/v8/test/cctest/test-heap.cc +240 -217
- data/vendor/v8/test/cctest/test-liveedit.cc +1 -0
- data/vendor/v8/test/cctest/test-log-stack-tracer.cc +18 -20
- data/vendor/v8/test/cctest/test-log.cc +114 -108
- data/vendor/v8/test/cctest/test-macro-assembler-x64.cc +247 -177
- data/vendor/v8/test/cctest/test-mark-compact.cc +129 -90
- data/vendor/v8/test/cctest/test-parsing.cc +15 -14
- data/vendor/v8/test/cctest/test-platform-linux.cc +1 -0
- data/vendor/v8/test/cctest/test-platform-tls.cc +66 -0
- data/vendor/v8/test/cctest/test-platform-win32.cc +1 -0
- data/vendor/v8/test/cctest/test-profile-generator.cc +1 -1
- data/vendor/v8/test/cctest/test-regexp.cc +53 -41
- data/vendor/v8/test/cctest/test-reloc-info.cc +18 -11
- data/vendor/v8/test/cctest/test-serialize.cc +44 -43
- data/vendor/v8/test/cctest/test-sockets.cc +8 -3
- data/vendor/v8/test/cctest/test-spaces.cc +47 -29
- data/vendor/v8/test/cctest/test-strings.cc +20 -20
- data/vendor/v8/test/cctest/test-thread-termination.cc +8 -3
- data/vendor/v8/test/cctest/test-threads.cc +5 -3
- data/vendor/v8/test/cctest/test-utils.cc +5 -4
- data/vendor/v8/test/cctest/testcfg.py +7 -3
- data/vendor/v8/test/es5conform/es5conform.status +2 -77
- data/vendor/v8/test/es5conform/testcfg.py +1 -1
- data/vendor/v8/test/message/testcfg.py +1 -1
- data/vendor/v8/test/mjsunit/accessors-on-global-object.js +3 -3
- data/vendor/v8/test/mjsunit/array-concat.js +43 -1
- data/vendor/v8/test/mjsunit/array-join.js +25 -0
- data/vendor/v8/test/mjsunit/bitops-info.js +7 -1
- data/vendor/v8/test/mjsunit/compiler/array-length.js +2 -2
- data/vendor/v8/test/mjsunit/compiler/global-accessors.js +47 -0
- data/vendor/v8/test/mjsunit/compiler/pic.js +1 -1
- data/vendor/v8/test/mjsunit/compiler/regress-loadfield.js +65 -0
- data/vendor/v8/test/mjsunit/math-sqrt.js +5 -1
- data/vendor/v8/test/mjsunit/mjsunit.js +59 -8
- data/vendor/v8/test/mjsunit/mjsunit.status +0 -12
- data/vendor/v8/test/mjsunit/mul-exhaustive.js +129 -11
- data/vendor/v8/test/mjsunit/negate-zero.js +1 -1
- data/vendor/v8/test/mjsunit/object-freeze.js +5 -13
- data/vendor/v8/test/mjsunit/object-prevent-extensions.js +9 -50
- data/vendor/v8/test/mjsunit/object-seal.js +4 -13
- data/vendor/v8/test/mjsunit/override-eval-with-non-function.js +36 -0
- data/vendor/v8/test/mjsunit/regress/regress-1145.js +54 -0
- data/vendor/v8/test/mjsunit/regress/regress-1172-bis.js +37 -0
- data/vendor/v8/test/mjsunit/regress/regress-1181.js +54 -0
- data/vendor/v8/test/mjsunit/regress/regress-1207.js +35 -0
- data/vendor/v8/test/mjsunit/regress/regress-1209.js +34 -0
- data/vendor/v8/test/mjsunit/regress/regress-1210.js +48 -0
- data/vendor/v8/test/mjsunit/regress/regress-1213.js +43 -0
- data/vendor/v8/test/mjsunit/regress/regress-1218.js +29 -0
- data/vendor/v8/test/mjsunit/regress/regress-1229.js +79 -0
- data/vendor/v8/test/mjsunit/regress/regress-1233.js +47 -0
- data/vendor/v8/test/mjsunit/regress/regress-1236.js +34 -0
- data/vendor/v8/test/mjsunit/regress/regress-1237.js +36 -0
- data/vendor/v8/test/mjsunit/regress/regress-1240.js +39 -0
- data/vendor/v8/test/mjsunit/regress/regress-1257.js +58 -0
- data/vendor/v8/test/mjsunit/regress/regress-1278.js +69 -0
- data/vendor/v8/test/mjsunit/regress/regress-create-exception.js +1 -0
- data/vendor/v8/test/mjsunit/regress/regress-lazy-deopt-reloc.js +52 -0
- data/vendor/v8/test/mjsunit/sin-cos.js +15 -10
- data/vendor/v8/test/mjsunit/smi-negative-zero.js +2 -2
- data/vendor/v8/test/mjsunit/str-to-num.js +1 -1
- data/vendor/v8/test/mjsunit/strict-mode.js +435 -0
- data/vendor/v8/test/mjsunit/testcfg.py +23 -6
- data/vendor/v8/test/mozilla/mozilla.status +0 -2
- data/vendor/v8/test/mozilla/testcfg.py +1 -1
- data/vendor/v8/test/preparser/empty.js +28 -0
- data/vendor/v8/test/preparser/functions-only.js +38 -0
- data/vendor/v8/test/preparser/non-alphanum.js +34 -0
- data/vendor/v8/test/preparser/symbols-only.js +49 -0
- data/vendor/v8/test/preparser/testcfg.py +90 -0
- data/vendor/v8/test/sputnik/testcfg.py +1 -1
- data/vendor/v8/test/test262/README +16 -0
- data/vendor/v8/test/test262/harness-adapt.js +80 -0
- data/vendor/v8/test/test262/test262.status +1506 -0
- data/vendor/v8/test/test262/testcfg.py +123 -0
- data/vendor/v8/tools/freebsd-tick-processor +10 -0
- data/vendor/v8/tools/gyp/v8.gyp +8 -33
- data/vendor/v8/tools/linux-tick-processor +5 -3
- data/vendor/v8/tools/test.py +37 -14
- data/vendor/v8/tools/tickprocessor.js +22 -8
- data/vendor/v8/tools/visual_studio/v8_base.vcproj +13 -1
- data/vendor/v8/tools/visual_studio/v8_base_arm.vcproj +5 -1
- data/vendor/v8/tools/visual_studio/v8_base_x64.vcproj +5 -1
- data/vendor/v8/tools/visual_studio/x64.vsprops +1 -0
- metadata +1495 -1341
- data/ext/extconf.rb +0 -22
- data/ext/mustang.cpp +0 -58
- data/vendor/v8/src/top.h +0 -608
@@ -45,8 +45,8 @@ class TranscendentalCacheStub: public CodeStub {
|
|
45
45
|
UNTAGGED = 1 << TranscendentalCache::kTranscendentalTypeBits
|
46
46
|
};
|
47
47
|
|
48
|
-
|
49
|
-
|
48
|
+
TranscendentalCacheStub(TranscendentalCache::Type type,
|
49
|
+
ArgumentType argument_type)
|
50
50
|
: type_(type), argument_type_(argument_type) {}
|
51
51
|
void Generate(MacroAssembler* masm);
|
52
52
|
private:
|
@@ -306,6 +306,7 @@ class TypeRecordingBinaryOpStub: public CodeStub {
|
|
306
306
|
void GenerateSmiStub(MacroAssembler* masm);
|
307
307
|
void GenerateInt32Stub(MacroAssembler* masm);
|
308
308
|
void GenerateHeapNumberStub(MacroAssembler* masm);
|
309
|
+
void GenerateOddballStub(MacroAssembler* masm);
|
309
310
|
void GenerateStringStub(MacroAssembler* masm);
|
310
311
|
void GenerateGenericStub(MacroAssembler* masm);
|
311
312
|
void GenerateAddStrings(MacroAssembler* masm);
|
@@ -489,48 +490,6 @@ class NumberToStringStub: public CodeStub {
|
|
489
490
|
#endif
|
490
491
|
};
|
491
492
|
|
492
|
-
|
493
|
-
// Generate code to load an element from a pixel array. The receiver is assumed
|
494
|
-
// to not be a smi and to have elements, the caller must guarantee this
|
495
|
-
// precondition. If key is not a smi, then the generated code branches to
|
496
|
-
// key_not_smi. Callers can specify NULL for key_not_smi to signal that a smi
|
497
|
-
// check has already been performed on key so that the smi check is not
|
498
|
-
// generated. If key is not a valid index within the bounds of the pixel array,
|
499
|
-
// the generated code jumps to out_of_range. receiver, key and elements are
|
500
|
-
// unchanged throughout the generated code sequence.
|
501
|
-
void GenerateFastPixelArrayLoad(MacroAssembler* masm,
|
502
|
-
Register receiver,
|
503
|
-
Register key,
|
504
|
-
Register elements,
|
505
|
-
Register untagged_key,
|
506
|
-
Register result,
|
507
|
-
Label* not_pixel_array,
|
508
|
-
Label* key_not_smi,
|
509
|
-
Label* out_of_range);
|
510
|
-
|
511
|
-
// Generate code to store an element into a pixel array, clamping values between
|
512
|
-
// [0..255]. The receiver is assumed to not be a smi and to have elements, the
|
513
|
-
// caller must guarantee this precondition. If key is not a smi, then the
|
514
|
-
// generated code branches to key_not_smi. Callers can specify NULL for
|
515
|
-
// key_not_smi to signal that a smi check has already been performed on key so
|
516
|
-
// that the smi check is not generated. If the value is not a smi, the generated
|
517
|
-
// code will branch to value_not_smi. If the receiver doesn't have pixel array
|
518
|
-
// elements, the generated code will branch to not_pixel_array, unless
|
519
|
-
// not_pixel_array is NULL, in which case the caller must ensure that the
|
520
|
-
// receiver has pixel array elements. If key is not a valid index within the
|
521
|
-
// bounds of the pixel array, the generated code jumps to out_of_range.
|
522
|
-
void GenerateFastPixelArrayStore(MacroAssembler* masm,
|
523
|
-
Register receiver,
|
524
|
-
Register key,
|
525
|
-
Register value,
|
526
|
-
Register elements,
|
527
|
-
Register scratch1,
|
528
|
-
bool load_elements_from_receiver,
|
529
|
-
Label* key_not_smi,
|
530
|
-
Label* value_not_smi,
|
531
|
-
Label* not_pixel_array,
|
532
|
-
Label* out_of_range);
|
533
|
-
|
534
493
|
} } // namespace v8::internal
|
535
494
|
|
536
495
|
#endif // V8_IA32_CODE_STUBS_IA32_H_
|
@@ -154,7 +154,8 @@ CodeGenerator::CodeGenerator(MacroAssembler* masm)
|
|
154
154
|
safe_int32_mode_enabled_(true),
|
155
155
|
function_return_is_shadowed_(false),
|
156
156
|
in_spilled_code_(false),
|
157
|
-
jit_cookie_((FLAG_mask_constants_with_cookie) ?
|
157
|
+
jit_cookie_((FLAG_mask_constants_with_cookie) ?
|
158
|
+
V8::RandomPrivate(Isolate::Current()) : 0) {
|
158
159
|
}
|
159
160
|
|
160
161
|
|
@@ -182,7 +183,7 @@ void CodeGenerator::Generate(CompilationInfo* info) {
|
|
182
183
|
ASSERT_EQ(0, loop_nesting_);
|
183
184
|
loop_nesting_ = info->is_in_loop() ? 1 : 0;
|
184
185
|
|
185
|
-
|
186
|
+
masm()->isolate()->set_jump_target_compiling_deferred_code(false);
|
186
187
|
|
187
188
|
{
|
188
189
|
CodeGenState state(this);
|
@@ -284,7 +285,7 @@ void CodeGenerator::Generate(CompilationInfo* info) {
|
|
284
285
|
|
285
286
|
// Initialize ThisFunction reference if present.
|
286
287
|
if (scope()->is_function_scope() && scope()->function() != NULL) {
|
287
|
-
frame_->Push(
|
288
|
+
frame_->Push(FACTORY->the_hole_value());
|
288
289
|
StoreToSlot(scope()->function()->AsSlot(), NOT_CONST_INIT);
|
289
290
|
}
|
290
291
|
|
@@ -320,7 +321,7 @@ void CodeGenerator::Generate(CompilationInfo* info) {
|
|
320
321
|
if (!scope()->HasIllegalRedeclaration()) {
|
321
322
|
Comment cmnt(masm_, "[ function body");
|
322
323
|
#ifdef DEBUG
|
323
|
-
bool is_builtin =
|
324
|
+
bool is_builtin = info->isolate()->bootstrapper()->IsActive();
|
324
325
|
bool should_trace =
|
325
326
|
is_builtin ? FLAG_trace_builtin_calls : FLAG_trace_calls;
|
326
327
|
if (should_trace) {
|
@@ -337,7 +338,7 @@ void CodeGenerator::Generate(CompilationInfo* info) {
|
|
337
338
|
ASSERT(!function_return_is_shadowed_);
|
338
339
|
CodeForReturnPosition(info->function());
|
339
340
|
frame_->PrepareForReturn();
|
340
|
-
Result undefined(
|
341
|
+
Result undefined(FACTORY->undefined_value());
|
341
342
|
if (function_return_.is_bound()) {
|
342
343
|
function_return_.Jump(&undefined);
|
343
344
|
} else {
|
@@ -369,9 +370,9 @@ void CodeGenerator::Generate(CompilationInfo* info) {
|
|
369
370
|
|
370
371
|
// Process any deferred code using the register allocator.
|
371
372
|
if (!HasStackOverflow()) {
|
372
|
-
|
373
|
+
info->isolate()->set_jump_target_compiling_deferred_code(true);
|
373
374
|
ProcessDeferred();
|
374
|
-
|
375
|
+
info->isolate()->set_jump_target_compiling_deferred_code(false);
|
375
376
|
}
|
376
377
|
|
377
378
|
// There is no need to delete the register allocator, it is a
|
@@ -634,12 +635,12 @@ void CodeGenerator::Load(Expression* expr) {
|
|
634
635
|
if (dest.false_was_fall_through()) {
|
635
636
|
// The false target was just bound.
|
636
637
|
JumpTarget loaded;
|
637
|
-
frame_->Push(
|
638
|
+
frame_->Push(FACTORY->false_value());
|
638
639
|
// There may be dangling jumps to the true target.
|
639
640
|
if (true_target.is_linked()) {
|
640
641
|
loaded.Jump();
|
641
642
|
true_target.Bind();
|
642
|
-
frame_->Push(
|
643
|
+
frame_->Push(FACTORY->true_value());
|
643
644
|
loaded.Bind();
|
644
645
|
}
|
645
646
|
|
@@ -647,11 +648,11 @@ void CodeGenerator::Load(Expression* expr) {
|
|
647
648
|
// There is true, and possibly false, control flow (with true as
|
648
649
|
// the fall through).
|
649
650
|
JumpTarget loaded;
|
650
|
-
frame_->Push(
|
651
|
+
frame_->Push(FACTORY->true_value());
|
651
652
|
if (false_target.is_linked()) {
|
652
653
|
loaded.Jump();
|
653
654
|
false_target.Bind();
|
654
|
-
frame_->Push(
|
655
|
+
frame_->Push(FACTORY->false_value());
|
655
656
|
loaded.Bind();
|
656
657
|
}
|
657
658
|
|
@@ -666,14 +667,14 @@ void CodeGenerator::Load(Expression* expr) {
|
|
666
667
|
loaded.Jump(); // Don't lose the current TOS.
|
667
668
|
if (true_target.is_linked()) {
|
668
669
|
true_target.Bind();
|
669
|
-
frame_->Push(
|
670
|
+
frame_->Push(FACTORY->true_value());
|
670
671
|
if (false_target.is_linked()) {
|
671
672
|
loaded.Jump();
|
672
673
|
}
|
673
674
|
}
|
674
675
|
if (false_target.is_linked()) {
|
675
676
|
false_target.Bind();
|
676
|
-
frame_->Push(
|
677
|
+
frame_->Push(FACTORY->false_value());
|
677
678
|
}
|
678
679
|
loaded.Bind();
|
679
680
|
}
|
@@ -729,11 +730,14 @@ void CodeGenerator::LoadTypeofExpression(Expression* expr) {
|
|
729
730
|
|
730
731
|
ArgumentsAllocationMode CodeGenerator::ArgumentsMode() {
|
731
732
|
if (scope()->arguments() == NULL) return NO_ARGUMENTS_ALLOCATION;
|
732
|
-
|
733
|
+
|
734
|
+
// In strict mode there is no need for shadow arguments.
|
735
|
+
ASSERT(scope()->arguments_shadow() != NULL || scope()->is_strict_mode());
|
736
|
+
|
733
737
|
// We don't want to do lazy arguments allocation for functions that
|
734
738
|
// have heap-allocated contexts, because it interfers with the
|
735
739
|
// uninitialized const tracking in the context objects.
|
736
|
-
return (scope()->num_heap_slots() > 0)
|
740
|
+
return (scope()->num_heap_slots() > 0 || scope()->is_strict_mode())
|
737
741
|
? EAGER_ARGUMENTS_ALLOCATION
|
738
742
|
: LAZY_ARGUMENTS_ALLOCATION;
|
739
743
|
}
|
@@ -748,9 +752,11 @@ Result CodeGenerator::StoreArgumentsObject(bool initial) {
|
|
748
752
|
// When using lazy arguments allocation, we store the arguments marker value
|
749
753
|
// as a sentinel indicating that the arguments object hasn't been
|
750
754
|
// allocated yet.
|
751
|
-
frame_->Push(
|
755
|
+
frame_->Push(FACTORY->arguments_marker());
|
752
756
|
} else {
|
753
|
-
ArgumentsAccessStub stub(
|
757
|
+
ArgumentsAccessStub stub(is_strict_mode()
|
758
|
+
? ArgumentsAccessStub::NEW_STRICT
|
759
|
+
: ArgumentsAccessStub::NEW_NON_STRICT);
|
754
760
|
frame_->PushFunction();
|
755
761
|
frame_->PushReceiverSlotAddress();
|
756
762
|
frame_->Push(Smi::FromInt(scope()->num_parameters()));
|
@@ -760,8 +766,11 @@ Result CodeGenerator::StoreArgumentsObject(bool initial) {
|
|
760
766
|
|
761
767
|
Variable* arguments = scope()->arguments();
|
762
768
|
Variable* shadow = scope()->arguments_shadow();
|
769
|
+
|
763
770
|
ASSERT(arguments != NULL && arguments->AsSlot() != NULL);
|
764
|
-
ASSERT(shadow != NULL && shadow->AsSlot() != NULL)
|
771
|
+
ASSERT((shadow != NULL && shadow->AsSlot() != NULL) ||
|
772
|
+
scope()->is_strict_mode());
|
773
|
+
|
765
774
|
JumpTarget done;
|
766
775
|
bool skip_arguments = false;
|
767
776
|
if (mode == LAZY_ARGUMENTS_ALLOCATION && !initial) {
|
@@ -775,7 +784,7 @@ Result CodeGenerator::StoreArgumentsObject(bool initial) {
|
|
775
784
|
// been assigned a proper value.
|
776
785
|
skip_arguments = !probe.handle()->IsArgumentsMarker();
|
777
786
|
} else {
|
778
|
-
__ cmp(Operand(probe.reg()), Immediate(
|
787
|
+
__ cmp(Operand(probe.reg()), Immediate(FACTORY->arguments_marker()));
|
779
788
|
probe.Unuse();
|
780
789
|
done.Branch(not_equal);
|
781
790
|
}
|
@@ -784,7 +793,9 @@ Result CodeGenerator::StoreArgumentsObject(bool initial) {
|
|
784
793
|
StoreToSlot(arguments->AsSlot(), NOT_CONST_INIT);
|
785
794
|
if (mode == LAZY_ARGUMENTS_ALLOCATION) done.Bind();
|
786
795
|
}
|
787
|
-
|
796
|
+
if (shadow != NULL) {
|
797
|
+
StoreToSlot(shadow->AsSlot(), NOT_CONST_INIT);
|
798
|
+
}
|
788
799
|
return frame_->Pop();
|
789
800
|
}
|
790
801
|
|
@@ -904,15 +915,15 @@ void CodeGenerator::ToBoolean(ControlDestination* dest) {
|
|
904
915
|
} else {
|
905
916
|
// Fast case checks.
|
906
917
|
// 'false' => false.
|
907
|
-
__ cmp(value.reg(),
|
918
|
+
__ cmp(value.reg(), FACTORY->false_value());
|
908
919
|
dest->false_target()->Branch(equal);
|
909
920
|
|
910
921
|
// 'true' => true.
|
911
|
-
__ cmp(value.reg(),
|
922
|
+
__ cmp(value.reg(), FACTORY->true_value());
|
912
923
|
dest->true_target()->Branch(equal);
|
913
924
|
|
914
925
|
// 'undefined' => false.
|
915
|
-
__ cmp(value.reg(),
|
926
|
+
__ cmp(value.reg(), FACTORY->undefined_value());
|
916
927
|
dest->false_target()->Branch(equal);
|
917
928
|
|
918
929
|
// Smi => false iff zero.
|
@@ -983,7 +994,8 @@ class DeferredInlineBinaryOperation: public DeferredCode {
|
|
983
994
|
|
984
995
|
|
985
996
|
Label* DeferredInlineBinaryOperation::NonSmiInputLabel() {
|
986
|
-
if (Token::IsBitOp(op_) &&
|
997
|
+
if (Token::IsBitOp(op_) &&
|
998
|
+
CpuFeatures::IsSupported(SSE2)) {
|
987
999
|
return &non_smi_input_;
|
988
1000
|
} else {
|
989
1001
|
return entry_label();
|
@@ -1019,7 +1031,7 @@ void DeferredInlineBinaryOperation::Generate() {
|
|
1019
1031
|
__ j(zero, &left_smi);
|
1020
1032
|
if (!left_info_.IsNumber()) {
|
1021
1033
|
__ cmp(FieldOperand(left_, HeapObject::kMapOffset),
|
1022
|
-
|
1034
|
+
FACTORY->heap_number_map());
|
1023
1035
|
__ j(not_equal, &call_runtime);
|
1024
1036
|
}
|
1025
1037
|
__ movdbl(xmm0, FieldOperand(left_, HeapNumber::kValueOffset));
|
@@ -1048,7 +1060,7 @@ void DeferredInlineBinaryOperation::Generate() {
|
|
1048
1060
|
__ j(zero, &right_smi);
|
1049
1061
|
if (!right_info_.IsNumber()) {
|
1050
1062
|
__ cmp(FieldOperand(right_, HeapObject::kMapOffset),
|
1051
|
-
|
1063
|
+
FACTORY->heap_number_map());
|
1052
1064
|
__ j(not_equal, &call_runtime);
|
1053
1065
|
}
|
1054
1066
|
__ movdbl(xmm1, FieldOperand(right_, HeapNumber::kValueOffset));
|
@@ -1255,7 +1267,8 @@ void DeferredInlineBinaryOperation::GenerateAnswerOutOfRange() {
|
|
1255
1267
|
// This trashes right_.
|
1256
1268
|
__ AllocateHeapNumber(left_, right_, no_reg, &after_alloc_failure2);
|
1257
1269
|
__ bind(&allocation_ok);
|
1258
|
-
if (CpuFeatures::IsSupported(SSE2) &&
|
1270
|
+
if (CpuFeatures::IsSupported(SSE2) &&
|
1271
|
+
op_ != Token::SHR) {
|
1259
1272
|
CpuFeatures::Scope use_sse2(SSE2);
|
1260
1273
|
ASSERT(Token::IsBitOp(op_));
|
1261
1274
|
// Signed conversion.
|
@@ -1497,7 +1510,7 @@ Result CodeGenerator::GenerateGenericBinaryOpStubCall(GenericBinaryOpStub* stub,
|
|
1497
1510
|
|
1498
1511
|
|
1499
1512
|
bool CodeGenerator::FoldConstantSmis(Token::Value op, int left, int right) {
|
1500
|
-
Object* answer_object =
|
1513
|
+
Object* answer_object = HEAP->undefined_value();
|
1501
1514
|
switch (op) {
|
1502
1515
|
case Token::ADD:
|
1503
1516
|
if (Smi::IsValid(left + right)) {
|
@@ -1569,7 +1582,7 @@ bool CodeGenerator::FoldConstantSmis(Token::Value op, int left, int right) {
|
|
1569
1582
|
UNREACHABLE();
|
1570
1583
|
break;
|
1571
1584
|
}
|
1572
|
-
if (answer_object
|
1585
|
+
if (answer_object->IsUndefined()) {
|
1573
1586
|
return false;
|
1574
1587
|
}
|
1575
1588
|
frame_->Push(Handle<Object>(answer_object));
|
@@ -3018,13 +3031,14 @@ void CodeGenerator::ConstantSmiComparison(Condition cc,
|
|
3018
3031
|
// Jump or fall through to here if we are comparing a non-smi to a
|
3019
3032
|
// constant smi. If the non-smi is a heap number and this is not
|
3020
3033
|
// a loop condition, inline the floating point code.
|
3021
|
-
if (!is_loop_condition &&
|
3034
|
+
if (!is_loop_condition &&
|
3035
|
+
CpuFeatures::IsSupported(SSE2)) {
|
3022
3036
|
// Right side is a constant smi and left side has been checked
|
3023
3037
|
// not to be a smi.
|
3024
3038
|
CpuFeatures::Scope use_sse2(SSE2);
|
3025
3039
|
JumpTarget not_number;
|
3026
3040
|
__ cmp(FieldOperand(left_reg, HeapObject::kMapOffset),
|
3027
|
-
Immediate(
|
3041
|
+
Immediate(FACTORY->heap_number_map()));
|
3028
3042
|
not_number.Branch(not_equal, left_side);
|
3029
3043
|
__ movdbl(xmm1,
|
3030
3044
|
FieldOperand(left_reg, HeapNumber::kValueOffset));
|
@@ -3090,7 +3104,7 @@ static void CheckComparisonOperand(MacroAssembler* masm_,
|
|
3090
3104
|
__ test(operand->reg(), Immediate(kSmiTagMask));
|
3091
3105
|
__ j(zero, &done);
|
3092
3106
|
__ cmp(FieldOperand(operand->reg(), HeapObject::kMapOffset),
|
3093
|
-
Immediate(
|
3107
|
+
Immediate(FACTORY->heap_number_map()));
|
3094
3108
|
not_numbers->Branch(not_equal, left_side, right_side, not_taken);
|
3095
3109
|
__ bind(&done);
|
3096
3110
|
}
|
@@ -3157,7 +3171,7 @@ static void LoadComparisonOperandSSE2(MacroAssembler* masm_,
|
|
3157
3171
|
__ j(zero, &smi);
|
3158
3172
|
if (!operand->type_info().IsNumber()) {
|
3159
3173
|
__ cmp(FieldOperand(operand->reg(), HeapObject::kMapOffset),
|
3160
|
-
Immediate(
|
3174
|
+
Immediate(FACTORY->heap_number_map()));
|
3161
3175
|
not_numbers->Branch(not_equal, left_side, right_side, taken);
|
3162
3176
|
}
|
3163
3177
|
__ movdbl(xmm_reg, FieldOperand(operand->reg(), HeapNumber::kValueOffset));
|
@@ -3264,7 +3278,7 @@ void CodeGenerator::CallApplyLazy(Expression* applicand,
|
|
3264
3278
|
// give us a megamorphic load site. Not super, but it works.
|
3265
3279
|
Load(applicand);
|
3266
3280
|
frame()->Dup();
|
3267
|
-
Handle<String> name =
|
3281
|
+
Handle<String> name = FACTORY->LookupAsciiSymbol("apply");
|
3268
3282
|
frame()->Push(name);
|
3269
3283
|
Result answer = frame()->CallLoadIC(RelocInfo::CODE_TARGET);
|
3270
3284
|
__ nop();
|
@@ -3296,7 +3310,7 @@ void CodeGenerator::CallApplyLazy(Expression* applicand,
|
|
3296
3310
|
if (probe.is_constant()) {
|
3297
3311
|
try_lazy = probe.handle()->IsArgumentsMarker();
|
3298
3312
|
} else {
|
3299
|
-
__ cmp(Operand(probe.reg()), Immediate(
|
3313
|
+
__ cmp(Operand(probe.reg()), Immediate(FACTORY->arguments_marker()));
|
3300
3314
|
probe.Unuse();
|
3301
3315
|
__ j(not_equal, &slow);
|
3302
3316
|
}
|
@@ -3332,7 +3346,8 @@ void CodeGenerator::CallApplyLazy(Expression* applicand,
|
|
3332
3346
|
__ j(not_equal, &build_args);
|
3333
3347
|
__ mov(ecx, FieldOperand(eax, JSFunction::kCodeEntryOffset));
|
3334
3348
|
__ sub(Operand(ecx), Immediate(Code::kHeaderSize - kHeapObjectTag));
|
3335
|
-
Handle<Code> apply_code(
|
3349
|
+
Handle<Code> apply_code(masm()->isolate()->builtins()->builtin(
|
3350
|
+
Builtins::kFunctionApply));
|
3336
3351
|
__ cmp(Operand(ecx), Immediate(apply_code));
|
3337
3352
|
__ j(not_equal, &build_args);
|
3338
3353
|
|
@@ -3458,7 +3473,7 @@ void DeferredStackCheck::Generate() {
|
|
3458
3473
|
void CodeGenerator::CheckStack() {
|
3459
3474
|
DeferredStackCheck* deferred = new DeferredStackCheck;
|
3460
3475
|
ExternalReference stack_limit =
|
3461
|
-
ExternalReference::address_of_stack_limit();
|
3476
|
+
ExternalReference::address_of_stack_limit(masm()->isolate());
|
3462
3477
|
__ cmp(esp, Operand::StaticVariable(stack_limit));
|
3463
3478
|
deferred->Branch(below);
|
3464
3479
|
deferred->BindExit();
|
@@ -3526,7 +3541,8 @@ void CodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) {
|
|
3526
3541
|
frame_->EmitPush(esi); // The context is the first argument.
|
3527
3542
|
frame_->EmitPush(Immediate(pairs));
|
3528
3543
|
frame_->EmitPush(Immediate(Smi::FromInt(is_eval() ? 1 : 0)));
|
3529
|
-
|
3544
|
+
frame_->EmitPush(Immediate(Smi::FromInt(strict_mode_flag())));
|
3545
|
+
Result ignored = frame_->CallRuntime(Runtime::kDeclareGlobals, 4);
|
3530
3546
|
// Return value is ignored.
|
3531
3547
|
}
|
3532
3548
|
|
@@ -3558,7 +3574,7 @@ void CodeGenerator::VisitDeclaration(Declaration* node) {
|
|
3558
3574
|
// 'undefined') because we may have a (legal) redeclaration and we
|
3559
3575
|
// must not destroy the current value.
|
3560
3576
|
if (node->mode() == Variable::CONST) {
|
3561
|
-
frame_->EmitPush(Immediate(
|
3577
|
+
frame_->EmitPush(Immediate(FACTORY->the_hole_value()));
|
3562
3578
|
} else if (node->fun() != NULL) {
|
3563
3579
|
Load(node->fun());
|
3564
3580
|
} else {
|
@@ -3574,7 +3590,7 @@ void CodeGenerator::VisitDeclaration(Declaration* node) {
|
|
3574
3590
|
// If we have a function or a constant, we need to initialize the variable.
|
3575
3591
|
Expression* val = NULL;
|
3576
3592
|
if (node->mode() == Variable::CONST) {
|
3577
|
-
val = new Literal(
|
3593
|
+
val = new Literal(FACTORY->the_hole_value());
|
3578
3594
|
} else {
|
3579
3595
|
val = node->fun(); // NULL if we don't have a function
|
3580
3596
|
}
|
@@ -4355,9 +4371,9 @@ void CodeGenerator::VisitForInStatement(ForInStatement* node) {
|
|
4355
4371
|
frame_->EmitPop(eax);
|
4356
4372
|
|
4357
4373
|
// eax: value to be iterated over
|
4358
|
-
__ cmp(eax,
|
4374
|
+
__ cmp(eax, FACTORY->undefined_value());
|
4359
4375
|
exit.Branch(equal);
|
4360
|
-
__ cmp(eax,
|
4376
|
+
__ cmp(eax, FACTORY->null_value());
|
4361
4377
|
exit.Branch(equal);
|
4362
4378
|
|
4363
4379
|
// Stack layout in body:
|
@@ -4396,14 +4412,14 @@ void CodeGenerator::VisitForInStatement(ForInStatement* node) {
|
|
4396
4412
|
loop.Bind();
|
4397
4413
|
// Check that there are no elements.
|
4398
4414
|
__ mov(edx, FieldOperand(ecx, JSObject::kElementsOffset));
|
4399
|
-
__ cmp(Operand(edx), Immediate(
|
4415
|
+
__ cmp(Operand(edx), Immediate(FACTORY->empty_fixed_array()));
|
4400
4416
|
call_runtime.Branch(not_equal);
|
4401
4417
|
// Check that instance descriptors are not empty so that we can
|
4402
4418
|
// check for an enum cache. Leave the map in ebx for the subsequent
|
4403
4419
|
// prototype load.
|
4404
4420
|
__ mov(ebx, FieldOperand(ecx, HeapObject::kMapOffset));
|
4405
4421
|
__ mov(edx, FieldOperand(ebx, Map::kInstanceDescriptorsOffset));
|
4406
|
-
__ cmp(Operand(edx), Immediate(
|
4422
|
+
__ cmp(Operand(edx), Immediate(FACTORY->empty_descriptor_array()));
|
4407
4423
|
call_runtime.Branch(equal);
|
4408
4424
|
// Check that there in an enum cache in the non-empty instance
|
4409
4425
|
// descriptors. This is the case if the next enumeration index
|
@@ -4415,12 +4431,12 @@ void CodeGenerator::VisitForInStatement(ForInStatement* node) {
|
|
4415
4431
|
__ cmp(ecx, Operand(eax));
|
4416
4432
|
check_prototype.Branch(equal);
|
4417
4433
|
__ mov(edx, FieldOperand(edx, DescriptorArray::kEnumCacheBridgeCacheOffset));
|
4418
|
-
__ cmp(Operand(edx), Immediate(
|
4434
|
+
__ cmp(Operand(edx), Immediate(FACTORY->empty_fixed_array()));
|
4419
4435
|
call_runtime.Branch(not_equal);
|
4420
4436
|
check_prototype.Bind();
|
4421
4437
|
// Load the prototype from the map and loop if non-null.
|
4422
4438
|
__ mov(ecx, FieldOperand(ebx, Map::kPrototypeOffset));
|
4423
|
-
__ cmp(Operand(ecx), Immediate(
|
4439
|
+
__ cmp(Operand(ecx), Immediate(FACTORY->null_value()));
|
4424
4440
|
loop.Branch(not_equal);
|
4425
4441
|
// The enum cache is valid. Load the map of the object being
|
4426
4442
|
// iterated over and use the cache for the iteration.
|
@@ -4439,7 +4455,7 @@ void CodeGenerator::VisitForInStatement(ForInStatement* node) {
|
|
4439
4455
|
// Runtime::kGetPropertyNamesFast)
|
4440
4456
|
__ mov(edx, Operand(eax));
|
4441
4457
|
__ mov(ecx, FieldOperand(edx, HeapObject::kMapOffset));
|
4442
|
-
__ cmp(ecx,
|
4458
|
+
__ cmp(ecx, FACTORY->meta_map());
|
4443
4459
|
fixed_array.Branch(not_equal);
|
4444
4460
|
|
4445
4461
|
use_cache.Bind();
|
@@ -4631,7 +4647,8 @@ void CodeGenerator::VisitTryCatchStatement(TryCatchStatement* node) {
|
|
4631
4647
|
function_return_is_shadowed_ = function_return_was_shadowed;
|
4632
4648
|
|
4633
4649
|
// Get an external reference to the handler address.
|
4634
|
-
ExternalReference handler_address(
|
4650
|
+
ExternalReference handler_address(Isolate::k_handler_address,
|
4651
|
+
masm()->isolate());
|
4635
4652
|
|
4636
4653
|
// Make sure that there's nothing left on the stack above the
|
4637
4654
|
// handler structure.
|
@@ -4757,7 +4774,8 @@ void CodeGenerator::VisitTryFinallyStatement(TryFinallyStatement* node) {
|
|
4757
4774
|
function_return_is_shadowed_ = function_return_was_shadowed;
|
4758
4775
|
|
4759
4776
|
// Get an external reference to the handler address.
|
4760
|
-
ExternalReference handler_address(
|
4777
|
+
ExternalReference handler_address(Isolate::k_handler_address,
|
4778
|
+
masm()->isolate());
|
4761
4779
|
|
4762
4780
|
// If we can fall off the end of the try block, unlink from the try
|
4763
4781
|
// chain and set the state on the frame to FALLING.
|
@@ -4769,7 +4787,7 @@ void CodeGenerator::VisitTryFinallyStatement(TryFinallyStatement* node) {
|
|
4769
4787
|
|
4770
4788
|
// Fake a top of stack value (unneeded when FALLING) and set the
|
4771
4789
|
// state in ecx, then jump around the unlink blocks if any.
|
4772
|
-
frame_->EmitPush(Immediate(
|
4790
|
+
frame_->EmitPush(Immediate(FACTORY->undefined_value()));
|
4773
4791
|
__ Set(ecx, Immediate(Smi::FromInt(FALLING)));
|
4774
4792
|
if (nof_unlinks > 0) {
|
4775
4793
|
finally_block.Jump();
|
@@ -4812,7 +4830,7 @@ void CodeGenerator::VisitTryFinallyStatement(TryFinallyStatement* node) {
|
|
4812
4830
|
frame_->EmitPush(eax);
|
4813
4831
|
} else {
|
4814
4832
|
// Fake TOS for targets that shadowed breaks and continues.
|
4815
|
-
frame_->EmitPush(Immediate(
|
4833
|
+
frame_->EmitPush(Immediate(FACTORY->undefined_value()));
|
4816
4834
|
}
|
4817
4835
|
__ Set(ecx, Immediate(Smi::FromInt(JUMPING + i)));
|
4818
4836
|
if (--nof_unlinks > 0) {
|
@@ -4907,10 +4925,11 @@ Result CodeGenerator::InstantiateFunction(
|
|
4907
4925
|
|
4908
4926
|
// Use the fast case closure allocation code that allocates in new
|
4909
4927
|
// space for nested functions that don't need literals cloning.
|
4910
|
-
if (
|
4911
|
-
|
4912
|
-
|
4913
|
-
FastNewClosureStub stub
|
4928
|
+
if (!pretenure &&
|
4929
|
+
scope()->is_function_scope() &&
|
4930
|
+
function_info->num_literals() == 0) {
|
4931
|
+
FastNewClosureStub stub(
|
4932
|
+
function_info->strict_mode() ? kStrictMode : kNonStrictMode);
|
4914
4933
|
frame()->EmitPush(Immediate(function_info));
|
4915
4934
|
return frame()->CallStub(&stub, 1);
|
4916
4935
|
} else {
|
@@ -4919,8 +4938,8 @@ Result CodeGenerator::InstantiateFunction(
|
|
4919
4938
|
frame()->EmitPush(esi);
|
4920
4939
|
frame()->EmitPush(Immediate(function_info));
|
4921
4940
|
frame()->EmitPush(Immediate(pretenure
|
4922
|
-
?
|
4923
|
-
:
|
4941
|
+
? FACTORY->true_value()
|
4942
|
+
: FACTORY->false_value()));
|
4924
4943
|
return frame()->CallRuntime(Runtime::kNewClosure, 3);
|
4925
4944
|
}
|
4926
4945
|
}
|
@@ -5028,9 +5047,9 @@ void CodeGenerator::LoadFromSlot(Slot* slot, TypeofState typeof_state) {
|
|
5028
5047
|
Comment cmnt(masm_, "[ Load const");
|
5029
5048
|
Label exit;
|
5030
5049
|
__ mov(ecx, SlotOperand(slot, ecx));
|
5031
|
-
__ cmp(ecx,
|
5050
|
+
__ cmp(ecx, FACTORY->the_hole_value());
|
5032
5051
|
__ j(not_equal, &exit);
|
5033
|
-
__ mov(ecx,
|
5052
|
+
__ mov(ecx, FACTORY->undefined_value());
|
5034
5053
|
__ bind(&exit);
|
5035
5054
|
frame()->EmitPush(ecx);
|
5036
5055
|
|
@@ -5080,7 +5099,7 @@ void CodeGenerator::LoadFromSlotCheckForArguments(Slot* slot,
|
|
5080
5099
|
// indicates that we haven't loaded the arguments object yet, we
|
5081
5100
|
// need to do it now.
|
5082
5101
|
JumpTarget exit;
|
5083
|
-
__ cmp(Operand(result.reg()), Immediate(
|
5102
|
+
__ cmp(Operand(result.reg()), Immediate(FACTORY->arguments_marker()));
|
5084
5103
|
frame()->Push(&result);
|
5085
5104
|
exit.Branch(not_equal);
|
5086
5105
|
|
@@ -5134,7 +5153,7 @@ Result CodeGenerator::LoadFromGlobalSlotCheckExtensions(
|
|
5134
5153
|
__ bind(&next);
|
5135
5154
|
// Terminate at global context.
|
5136
5155
|
__ cmp(FieldOperand(tmp.reg(), HeapObject::kMapOffset),
|
5137
|
-
Immediate(
|
5156
|
+
Immediate(FACTORY->global_context_map()));
|
5138
5157
|
__ j(equal, &fast);
|
5139
5158
|
// Check that extension is NULL.
|
5140
5159
|
__ cmp(ContextOperand(tmp.reg(), Context::EXTENSION_INDEX), Immediate(0));
|
@@ -5194,9 +5213,9 @@ void CodeGenerator::EmitDynamicLoadFromSlotFastCase(Slot* slot,
|
|
5194
5213
|
__ mov(result->reg(),
|
5195
5214
|
ContextSlotOperandCheckExtensions(potential_slot, *result, slow));
|
5196
5215
|
if (potential_slot->var()->mode() == Variable::CONST) {
|
5197
|
-
__ cmp(result->reg(),
|
5216
|
+
__ cmp(result->reg(), FACTORY->the_hole_value());
|
5198
5217
|
done->Branch(not_equal, result);
|
5199
|
-
__ mov(result->reg(),
|
5218
|
+
__ mov(result->reg(), FACTORY->undefined_value());
|
5200
5219
|
}
|
5201
5220
|
done->Jump(result);
|
5202
5221
|
} else if (rewrite != NULL) {
|
@@ -5259,7 +5278,8 @@ void CodeGenerator::StoreToSlot(Slot* slot, InitState init_state) {
|
|
5259
5278
|
// by initialization.
|
5260
5279
|
value = frame_->CallRuntime(Runtime::kInitializeConstContextSlot, 3);
|
5261
5280
|
} else {
|
5262
|
-
|
5281
|
+
frame_->Push(Smi::FromInt(strict_mode_flag()));
|
5282
|
+
value = frame_->CallRuntime(Runtime::kStoreContextSlot, 4);
|
5263
5283
|
}
|
5264
5284
|
// Storing a variable must keep the (new) value on the expression
|
5265
5285
|
// stack. This is necessary for compiling chained assignment
|
@@ -5282,7 +5302,7 @@ void CodeGenerator::StoreToSlot(Slot* slot, InitState init_state) {
|
|
5282
5302
|
VirtualFrame::SpilledScope spilled_scope;
|
5283
5303
|
Comment cmnt(masm_, "[ Init const");
|
5284
5304
|
__ mov(ecx, SlotOperand(slot, ecx));
|
5285
|
-
__ cmp(ecx,
|
5305
|
+
__ cmp(ecx, FACTORY->the_hole_value());
|
5286
5306
|
exit.Branch(not_equal);
|
5287
5307
|
}
|
5288
5308
|
|
@@ -5360,10 +5380,20 @@ void CodeGenerator::VisitVariableProxy(VariableProxy* node) {
|
|
5360
5380
|
|
5361
5381
|
void CodeGenerator::VisitLiteral(Literal* node) {
|
5362
5382
|
Comment cmnt(masm_, "[ Literal");
|
5363
|
-
if (
|
5364
|
-
|
5383
|
+
if (frame_->ConstantPoolOverflowed()) {
|
5384
|
+
Result temp = allocator_->Allocate();
|
5385
|
+
ASSERT(temp.is_valid());
|
5386
|
+
if (in_safe_int32_mode()) {
|
5387
|
+
temp.set_untagged_int32(true);
|
5388
|
+
}
|
5389
|
+
__ Set(temp.reg(), Immediate(node->handle()));
|
5390
|
+
frame_->Push(&temp);
|
5365
5391
|
} else {
|
5366
|
-
|
5392
|
+
if (in_safe_int32_mode()) {
|
5393
|
+
frame_->PushUntaggedElement(node->handle());
|
5394
|
+
} else {
|
5395
|
+
frame_->Push(node->handle());
|
5396
|
+
}
|
5367
5397
|
}
|
5368
5398
|
}
|
5369
5399
|
|
@@ -5443,7 +5473,7 @@ class DeferredAllocateInNewSpace: public DeferredCode {
|
|
5443
5473
|
Register target,
|
5444
5474
|
int registers_to_save = 0)
|
5445
5475
|
: size_(size), target_(target), registers_to_save_(registers_to_save) {
|
5446
|
-
ASSERT(size >= kPointerSize && size <=
|
5476
|
+
ASSERT(size >= kPointerSize && size <= HEAP->MaxObjectSizeInNewSpace());
|
5447
5477
|
ASSERT_EQ(0, registers_to_save & target.bit());
|
5448
5478
|
set_comment("[ DeferredAllocateInNewSpace");
|
5449
5479
|
}
|
@@ -5504,7 +5534,7 @@ void CodeGenerator::VisitRegExpLiteral(RegExpLiteral* node) {
|
|
5504
5534
|
// jump to the deferred code passing the literals array.
|
5505
5535
|
DeferredRegExpLiteral* deferred =
|
5506
5536
|
new DeferredRegExpLiteral(boilerplate.reg(), literals.reg(), node);
|
5507
|
-
__ cmp(boilerplate.reg(),
|
5537
|
+
__ cmp(boilerplate.reg(), FACTORY->undefined_value());
|
5508
5538
|
deferred->Branch(equal);
|
5509
5539
|
deferred->BindExit();
|
5510
5540
|
|
@@ -5608,8 +5638,9 @@ void CodeGenerator::VisitObjectLiteral(ObjectLiteral* node) {
|
|
5608
5638
|
Load(property->key());
|
5609
5639
|
Load(property->value());
|
5610
5640
|
if (property->emit_store()) {
|
5641
|
+
frame_->Push(Smi::FromInt(NONE)); // PropertyAttributes
|
5611
5642
|
// Ignore the result.
|
5612
|
-
Result ignored = frame_->CallRuntime(Runtime::kSetProperty,
|
5643
|
+
Result ignored = frame_->CallRuntime(Runtime::kSetProperty, 4);
|
5613
5644
|
} else {
|
5614
5645
|
frame_->Drop(3);
|
5615
5646
|
}
|
@@ -5661,11 +5692,12 @@ void CodeGenerator::VisitArrayLiteral(ArrayLiteral* node) {
|
|
5661
5692
|
frame_->Push(node->constant_elements());
|
5662
5693
|
int length = node->values()->length();
|
5663
5694
|
Result clone;
|
5664
|
-
if (node->constant_elements()->map() ==
|
5695
|
+
if (node->constant_elements()->map() == HEAP->fixed_cow_array_map()) {
|
5665
5696
|
FastCloneShallowArrayStub stub(
|
5666
5697
|
FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS, length);
|
5667
5698
|
clone = frame_->CallStub(&stub, 3);
|
5668
|
-
|
5699
|
+
Counters* counters = masm()->isolate()->counters();
|
5700
|
+
__ IncrementCounter(counters->cow_arrays_created_stub(), 1);
|
5669
5701
|
} else if (node->depth() > 1) {
|
5670
5702
|
clone = frame_->CallRuntime(Runtime::kCreateArrayLiteral, 3);
|
5671
5703
|
} else if (length > FastCloneShallowArrayStub::kMaximumClonedLength) {
|
@@ -6068,7 +6100,7 @@ void CodeGenerator::VisitCall(Call* node) {
|
|
6068
6100
|
Load(function);
|
6069
6101
|
|
6070
6102
|
// Allocate a frame slot for the receiver.
|
6071
|
-
frame_->Push(
|
6103
|
+
frame_->Push(FACTORY->undefined_value());
|
6072
6104
|
|
6073
6105
|
// Load the arguments.
|
6074
6106
|
int arg_count = args->length();
|
@@ -6100,7 +6132,7 @@ void CodeGenerator::VisitCall(Call* node) {
|
|
6100
6132
|
if (arg_count > 0) {
|
6101
6133
|
frame_->PushElementAt(arg_count);
|
6102
6134
|
} else {
|
6103
|
-
frame_->Push(
|
6135
|
+
frame_->Push(FACTORY->undefined_value());
|
6104
6136
|
}
|
6105
6137
|
frame_->PushParameterAt(-1);
|
6106
6138
|
|
@@ -6122,7 +6154,7 @@ void CodeGenerator::VisitCall(Call* node) {
|
|
6122
6154
|
if (arg_count > 0) {
|
6123
6155
|
frame_->PushElementAt(arg_count);
|
6124
6156
|
} else {
|
6125
|
-
frame_->Push(
|
6157
|
+
frame_->Push(FACTORY->undefined_value());
|
6126
6158
|
}
|
6127
6159
|
frame_->PushParameterAt(-1);
|
6128
6160
|
|
@@ -6416,7 +6448,7 @@ void CodeGenerator::GenerateLog(ZoneList<Expression*>* args) {
|
|
6416
6448
|
}
|
6417
6449
|
#endif
|
6418
6450
|
// Finally, we're expected to leave a value on the top of the stack.
|
6419
|
-
frame_->Push(
|
6451
|
+
frame_->Push(FACTORY->undefined_value());
|
6420
6452
|
}
|
6421
6453
|
|
6422
6454
|
|
@@ -6459,13 +6491,13 @@ class DeferredStringCharCodeAt : public DeferredCode {
|
|
6459
6491
|
__ bind(&need_conversion_);
|
6460
6492
|
// Move the undefined value into the result register, which will
|
6461
6493
|
// trigger conversion.
|
6462
|
-
__ Set(result_, Immediate(
|
6494
|
+
__ Set(result_, Immediate(FACTORY->undefined_value()));
|
6463
6495
|
__ jmp(exit_label());
|
6464
6496
|
|
6465
6497
|
__ bind(&index_out_of_range_);
|
6466
6498
|
// When the index is out of range, the spec requires us to return
|
6467
6499
|
// NaN.
|
6468
|
-
__ Set(result_, Immediate(
|
6500
|
+
__ Set(result_, Immediate(FACTORY->nan_value()));
|
6469
6501
|
__ jmp(exit_label());
|
6470
6502
|
}
|
6471
6503
|
|
@@ -6588,7 +6620,7 @@ class DeferredStringCharAt : public DeferredCode {
|
|
6588
6620
|
__ bind(&index_out_of_range_);
|
6589
6621
|
// When the index is out of range, the spec requires us to return
|
6590
6622
|
// the empty string.
|
6591
|
-
__ Set(result_, Immediate(
|
6623
|
+
__ Set(result_, Immediate(FACTORY->empty_string()));
|
6592
6624
|
__ jmp(exit_label());
|
6593
6625
|
}
|
6594
6626
|
|
@@ -6706,7 +6738,7 @@ void CodeGenerator::GenerateFastAsciiArrayJoin(ZoneList<Expression*>* args) {
|
|
6706
6738
|
__ mov(array_length, FieldOperand(array, JSArray::kLengthOffset));
|
6707
6739
|
__ sar(array_length, 1);
|
6708
6740
|
__ j(not_zero, &non_trivial_array);
|
6709
|
-
__ mov(result_operand,
|
6741
|
+
__ mov(result_operand, FACTORY->empty_string());
|
6710
6742
|
__ jmp(&done);
|
6711
6743
|
|
6712
6744
|
// Save the array length.
|
@@ -6917,7 +6949,7 @@ void CodeGenerator::GenerateFastAsciiArrayJoin(ZoneList<Expression*>* args) {
|
|
6917
6949
|
|
6918
6950
|
|
6919
6951
|
__ bind(&bailout);
|
6920
|
-
__ mov(result_operand,
|
6952
|
+
__ mov(result_operand, FACTORY->undefined_value());
|
6921
6953
|
__ bind(&done);
|
6922
6954
|
__ mov(eax, result_operand);
|
6923
6955
|
// Drop temp values from the stack, and restore context register.
|
@@ -6958,7 +6990,7 @@ void CodeGenerator::GenerateIsObject(ZoneList<Expression*>* args) {
|
|
6958
6990
|
|
6959
6991
|
__ test(obj.reg(), Immediate(kSmiTagMask));
|
6960
6992
|
destination()->false_target()->Branch(zero);
|
6961
|
-
__ cmp(obj.reg(),
|
6993
|
+
__ cmp(obj.reg(), FACTORY->null_value());
|
6962
6994
|
destination()->true_target()->Branch(equal);
|
6963
6995
|
|
6964
6996
|
Result map = allocator()->Allocate();
|
@@ -7029,7 +7061,7 @@ class DeferredIsStringWrapperSafeForDefaultValueOf : public DeferredCode {
|
|
7029
7061
|
// Check for fast case object. Generate false result for slow case object.
|
7030
7062
|
__ mov(scratch1_, FieldOperand(object_, JSObject::kPropertiesOffset));
|
7031
7063
|
__ mov(scratch1_, FieldOperand(scratch1_, HeapObject::kMapOffset));
|
7032
|
-
__ cmp(scratch1_,
|
7064
|
+
__ cmp(scratch1_, FACTORY->hash_table_map());
|
7033
7065
|
__ j(equal, &false_result);
|
7034
7066
|
|
7035
7067
|
// Look for valueOf symbol in the descriptor array, and indicate false if
|
@@ -7056,7 +7088,7 @@ class DeferredIsStringWrapperSafeForDefaultValueOf : public DeferredCode {
|
|
7056
7088
|
__ jmp(&entry);
|
7057
7089
|
__ bind(&loop);
|
7058
7090
|
__ mov(scratch2_, FieldOperand(map_result_, 0));
|
7059
|
-
__ cmp(scratch2_,
|
7091
|
+
__ cmp(scratch2_, FACTORY->value_of_symbol());
|
7060
7092
|
__ j(equal, &false_result);
|
7061
7093
|
__ add(Operand(map_result_), Immediate(kPointerSize));
|
7062
7094
|
__ bind(&entry);
|
@@ -7271,17 +7303,17 @@ void CodeGenerator::GenerateClassOf(ZoneList<Expression*>* args) {
|
|
7271
7303
|
|
7272
7304
|
// Functions have class 'Function'.
|
7273
7305
|
function.Bind();
|
7274
|
-
frame_->Push(
|
7306
|
+
frame_->Push(FACTORY->function_class_symbol());
|
7275
7307
|
leave.Jump();
|
7276
7308
|
|
7277
7309
|
// Objects with a non-function constructor have class 'Object'.
|
7278
7310
|
non_function_constructor.Bind();
|
7279
|
-
frame_->Push(
|
7311
|
+
frame_->Push(FACTORY->Object_symbol());
|
7280
7312
|
leave.Jump();
|
7281
7313
|
|
7282
7314
|
// Non-JS objects have class null.
|
7283
7315
|
null.Bind();
|
7284
|
-
frame_->Push(
|
7316
|
+
frame_->Push(FACTORY->null_value());
|
7285
7317
|
|
7286
7318
|
// All done.
|
7287
7319
|
leave.Bind();
|
@@ -7416,8 +7448,10 @@ void CodeGenerator::GenerateRandomHeapNumber(
|
|
7416
7448
|
|
7417
7449
|
__ bind(&heapnumber_allocated);
|
7418
7450
|
|
7419
|
-
__ PrepareCallCFunction(
|
7420
|
-
__
|
7451
|
+
__ PrepareCallCFunction(1, ebx);
|
7452
|
+
__ mov(Operand(esp, 0), Immediate(ExternalReference::isolate_address()));
|
7453
|
+
__ CallCFunction(ExternalReference::random_uint32_function(masm()->isolate()),
|
7454
|
+
1);
|
7421
7455
|
|
7422
7456
|
// Convert 32 random bits in eax to 0.(32 random bits) in a double
|
7423
7457
|
// by computing:
|
@@ -7640,10 +7674,10 @@ void CodeGenerator::GenerateGetFromCache(ZoneList<Expression*>* args) {
|
|
7640
7674
|
int cache_id = Smi::cast(*(args->at(0)->AsLiteral()->handle()))->value();
|
7641
7675
|
|
7642
7676
|
Handle<FixedArray> jsfunction_result_caches(
|
7643
|
-
|
7677
|
+
masm()->isolate()->global_context()->jsfunction_result_caches());
|
7644
7678
|
if (jsfunction_result_caches->length() <= cache_id) {
|
7645
7679
|
__ Abort("Attempt to use undefined cache.");
|
7646
|
-
frame_->Push(
|
7680
|
+
frame_->Push(FACTORY->undefined_value());
|
7647
7681
|
return;
|
7648
7682
|
}
|
7649
7683
|
|
@@ -7760,7 +7794,7 @@ void CodeGenerator::GenerateSwapElements(ZoneList<Expression*>* args) {
|
|
7760
7794
|
// Check the object's elements are in fast case and writable.
|
7761
7795
|
__ mov(tmp1.reg(), FieldOperand(object.reg(), JSObject::kElementsOffset));
|
7762
7796
|
__ cmp(FieldOperand(tmp1.reg(), HeapObject::kMapOffset),
|
7763
|
-
Immediate(
|
7797
|
+
Immediate(FACTORY->fixed_array_map()));
|
7764
7798
|
deferred->Branch(not_equal);
|
7765
7799
|
|
7766
7800
|
// Smi-tagging is equivalent to multiplying by 2.
|
@@ -7801,7 +7835,7 @@ void CodeGenerator::GenerateSwapElements(ZoneList<Expression*>* args) {
|
|
7801
7835
|
__ bind(&done);
|
7802
7836
|
|
7803
7837
|
deferred->BindExit();
|
7804
|
-
frame_->Push(
|
7838
|
+
frame_->Push(FACTORY->undefined_value());
|
7805
7839
|
}
|
7806
7840
|
|
7807
7841
|
|
@@ -7870,7 +7904,7 @@ void CodeGenerator::GenerateMathPow(ZoneList<Expression*>* args) {
|
|
7870
7904
|
// exponent is smi and base is a heapnumber.
|
7871
7905
|
__ bind(&base_nonsmi);
|
7872
7906
|
__ cmp(FieldOperand(base.reg(), HeapObject::kMapOffset),
|
7873
|
-
|
7907
|
+
FACTORY->heap_number_map());
|
7874
7908
|
call_runtime.Branch(not_equal);
|
7875
7909
|
|
7876
7910
|
__ movdbl(xmm0, FieldOperand(base.reg(), HeapNumber::kValueOffset));
|
@@ -7921,7 +7955,7 @@ void CodeGenerator::GenerateMathPow(ZoneList<Expression*>* args) {
|
|
7921
7955
|
// on doubles.
|
7922
7956
|
__ bind(&exponent_nonsmi);
|
7923
7957
|
__ cmp(FieldOperand(exponent.reg(), HeapObject::kMapOffset),
|
7924
|
-
|
7958
|
+
FACTORY->heap_number_map());
|
7925
7959
|
call_runtime.Branch(not_equal);
|
7926
7960
|
__ movdbl(xmm1, FieldOperand(exponent.reg(), HeapNumber::kValueOffset));
|
7927
7961
|
// Test if exponent is nan.
|
@@ -7937,7 +7971,7 @@ void CodeGenerator::GenerateMathPow(ZoneList<Expression*>* args) {
|
|
7937
7971
|
__ jmp(&handle_special_cases);
|
7938
7972
|
__ bind(&base_not_smi);
|
7939
7973
|
__ cmp(FieldOperand(base.reg(), HeapObject::kMapOffset),
|
7940
|
-
|
7974
|
+
FACTORY->heap_number_map());
|
7941
7975
|
call_runtime.Branch(not_equal);
|
7942
7976
|
__ mov(answer.reg(), FieldOperand(base.reg(), HeapNumber::kExponentOffset));
|
7943
7977
|
__ and_(answer.reg(), HeapNumber::kExponentMask);
|
@@ -8068,7 +8102,7 @@ void CodeGenerator::GenerateMathSqrt(ZoneList<Expression*>* args) {
|
|
8068
8102
|
__ jmp(&load_done);
|
8069
8103
|
__ bind(&non_smi);
|
8070
8104
|
__ cmp(FieldOperand(result.reg(), HeapObject::kMapOffset),
|
8071
|
-
|
8105
|
+
FACTORY->heap_number_map());
|
8072
8106
|
__ j(not_equal, &runtime);
|
8073
8107
|
__ movdbl(xmm0, FieldOperand(result.reg(), HeapNumber::kValueOffset));
|
8074
8108
|
|
@@ -8174,7 +8208,7 @@ void CodeGenerator::VisitCallRuntime(CallRuntime* node) {
|
|
8174
8208
|
|
8175
8209
|
ZoneList<Expression*>* args = node->arguments();
|
8176
8210
|
Comment cmnt(masm_, "[ CallRuntime");
|
8177
|
-
Runtime::Function* function = node->function();
|
8211
|
+
const Runtime::Function* function = node->function();
|
8178
8212
|
|
8179
8213
|
if (function == NULL) {
|
8180
8214
|
// Push the builtins object found in the current global object.
|
@@ -8257,12 +8291,12 @@ void CodeGenerator::VisitUnaryOperation(UnaryOperation* node) {
|
|
8257
8291
|
} else {
|
8258
8292
|
// Default: Result of deleting non-global, not dynamically
|
8259
8293
|
// introduced variables is false.
|
8260
|
-
frame_->Push(
|
8294
|
+
frame_->Push(FACTORY->false_value());
|
8261
8295
|
}
|
8262
8296
|
} else {
|
8263
8297
|
// Default: Result of deleting expressions is true.
|
8264
8298
|
Load(node->expression()); // may have side-effects
|
8265
|
-
frame_->SetElementAt(0,
|
8299
|
+
frame_->SetElementAt(0, FACTORY->true_value());
|
8266
8300
|
}
|
8267
8301
|
|
8268
8302
|
} else if (op == Token::TYPEOF) {
|
@@ -8283,10 +8317,10 @@ void CodeGenerator::VisitUnaryOperation(UnaryOperation* node) {
|
|
8283
8317
|
expression->AsLiteral()->IsNull())) {
|
8284
8318
|
// Omit evaluating the value of the primitive literal.
|
8285
8319
|
// It will be discarded anyway, and can have no side effect.
|
8286
|
-
frame_->Push(
|
8320
|
+
frame_->Push(FACTORY->undefined_value());
|
8287
8321
|
} else {
|
8288
8322
|
Load(node->expression());
|
8289
|
-
frame_->SetElementAt(0,
|
8323
|
+
frame_->SetElementAt(0, FACTORY->undefined_value());
|
8290
8324
|
}
|
8291
8325
|
|
8292
8326
|
} else {
|
@@ -8300,6 +8334,7 @@ void CodeGenerator::VisitUnaryOperation(UnaryOperation* node) {
|
|
8300
8334
|
switch (op) {
|
8301
8335
|
case Token::SUB: {
|
8302
8336
|
__ neg(value.reg());
|
8337
|
+
frame_->Push(&value);
|
8303
8338
|
if (node->no_negative_zero()) {
|
8304
8339
|
// -MIN_INT is MIN_INT with the overflow flag set.
|
8305
8340
|
unsafe_bailout_->Branch(overflow);
|
@@ -8312,17 +8347,18 @@ void CodeGenerator::VisitUnaryOperation(UnaryOperation* node) {
|
|
8312
8347
|
}
|
8313
8348
|
case Token::BIT_NOT: {
|
8314
8349
|
__ not_(value.reg());
|
8350
|
+
frame_->Push(&value);
|
8315
8351
|
break;
|
8316
8352
|
}
|
8317
8353
|
case Token::ADD: {
|
8318
8354
|
// Unary plus has no effect on int32 values.
|
8355
|
+
frame_->Push(&value);
|
8319
8356
|
break;
|
8320
8357
|
}
|
8321
8358
|
default:
|
8322
8359
|
UNREACHABLE();
|
8323
8360
|
break;
|
8324
8361
|
}
|
8325
|
-
frame_->Push(&value);
|
8326
8362
|
} else {
|
8327
8363
|
Load(node->expression());
|
8328
8364
|
bool can_overwrite = node->expression()->ResultOverwriteAllowed();
|
@@ -9086,16 +9122,16 @@ void CodeGenerator::VisitCompareOperation(CompareOperation* node) {
|
|
9086
9122
|
Result answer = frame_->Pop();
|
9087
9123
|
answer.ToRegister();
|
9088
9124
|
|
9089
|
-
if (check->Equals(
|
9125
|
+
if (check->Equals(HEAP->number_symbol())) {
|
9090
9126
|
__ test(answer.reg(), Immediate(kSmiTagMask));
|
9091
9127
|
destination()->true_target()->Branch(zero);
|
9092
9128
|
frame_->Spill(answer.reg());
|
9093
9129
|
__ mov(answer.reg(), FieldOperand(answer.reg(), HeapObject::kMapOffset));
|
9094
|
-
__ cmp(answer.reg(),
|
9130
|
+
__ cmp(answer.reg(), FACTORY->heap_number_map());
|
9095
9131
|
answer.Unuse();
|
9096
9132
|
destination()->Split(equal);
|
9097
9133
|
|
9098
|
-
} else if (check->Equals(
|
9134
|
+
} else if (check->Equals(HEAP->string_symbol())) {
|
9099
9135
|
__ test(answer.reg(), Immediate(kSmiTagMask));
|
9100
9136
|
destination()->false_target()->Branch(zero);
|
9101
9137
|
|
@@ -9111,15 +9147,15 @@ void CodeGenerator::VisitCompareOperation(CompareOperation* node) {
|
|
9111
9147
|
answer.Unuse();
|
9112
9148
|
destination()->Split(below);
|
9113
9149
|
|
9114
|
-
} else if (check->Equals(
|
9115
|
-
__ cmp(answer.reg(),
|
9150
|
+
} else if (check->Equals(HEAP->boolean_symbol())) {
|
9151
|
+
__ cmp(answer.reg(), FACTORY->true_value());
|
9116
9152
|
destination()->true_target()->Branch(equal);
|
9117
|
-
__ cmp(answer.reg(),
|
9153
|
+
__ cmp(answer.reg(), FACTORY->false_value());
|
9118
9154
|
answer.Unuse();
|
9119
9155
|
destination()->Split(equal);
|
9120
9156
|
|
9121
|
-
} else if (check->Equals(
|
9122
|
-
__ cmp(answer.reg(),
|
9157
|
+
} else if (check->Equals(HEAP->undefined_symbol())) {
|
9158
|
+
__ cmp(answer.reg(), FACTORY->undefined_value());
|
9123
9159
|
destination()->true_target()->Branch(equal);
|
9124
9160
|
|
9125
9161
|
__ test(answer.reg(), Immediate(kSmiTagMask));
|
@@ -9133,7 +9169,7 @@ void CodeGenerator::VisitCompareOperation(CompareOperation* node) {
|
|
9133
9169
|
answer.Unuse();
|
9134
9170
|
destination()->Split(not_zero);
|
9135
9171
|
|
9136
|
-
} else if (check->Equals(
|
9172
|
+
} else if (check->Equals(HEAP->function_symbol())) {
|
9137
9173
|
__ test(answer.reg(), Immediate(kSmiTagMask));
|
9138
9174
|
destination()->false_target()->Branch(zero);
|
9139
9175
|
frame_->Spill(answer.reg());
|
@@ -9143,10 +9179,10 @@ void CodeGenerator::VisitCompareOperation(CompareOperation* node) {
|
|
9143
9179
|
__ CmpInstanceType(answer.reg(), JS_REGEXP_TYPE);
|
9144
9180
|
answer.Unuse();
|
9145
9181
|
destination()->Split(equal);
|
9146
|
-
} else if (check->Equals(
|
9182
|
+
} else if (check->Equals(HEAP->object_symbol())) {
|
9147
9183
|
__ test(answer.reg(), Immediate(kSmiTagMask));
|
9148
9184
|
destination()->false_target()->Branch(zero);
|
9149
|
-
__ cmp(answer.reg(),
|
9185
|
+
__ cmp(answer.reg(), FACTORY->null_value());
|
9150
9186
|
destination()->true_target()->Branch(equal);
|
9151
9187
|
|
9152
9188
|
Result map = allocator()->Allocate();
|
@@ -9189,7 +9225,7 @@ void CodeGenerator::VisitCompareOperation(CompareOperation* node) {
|
|
9189
9225
|
Result scratch = allocator()->Allocate();
|
9190
9226
|
ASSERT(scratch.is_valid());
|
9191
9227
|
__ mov(scratch.reg(), FieldOperand(lhs.reg(), HeapObject::kMapOffset));
|
9192
|
-
__ cmp(scratch.reg(),
|
9228
|
+
__ cmp(scratch.reg(), FACTORY->heap_number_map());
|
9193
9229
|
JumpTarget not_a_number;
|
9194
9230
|
not_a_number.Branch(not_equal, &lhs);
|
9195
9231
|
__ mov(scratch.reg(),
|
@@ -9276,7 +9312,7 @@ void CodeGenerator::VisitCompareToNull(CompareToNull* node) {
|
|
9276
9312
|
Load(node->expression());
|
9277
9313
|
Result operand = frame_->Pop();
|
9278
9314
|
operand.ToRegister();
|
9279
|
-
__ cmp(operand.reg(),
|
9315
|
+
__ cmp(operand.reg(), FACTORY->null_value());
|
9280
9316
|
if (node->is_strict()) {
|
9281
9317
|
operand.Unuse();
|
9282
9318
|
destination()->Split(equal);
|
@@ -9284,7 +9320,7 @@ void CodeGenerator::VisitCompareToNull(CompareToNull* node) {
|
|
9284
9320
|
// The 'null' value is only equal to 'undefined' if using non-strict
|
9285
9321
|
// comparisons.
|
9286
9322
|
destination()->true_target()->Branch(equal);
|
9287
|
-
__ cmp(operand.reg(),
|
9323
|
+
__ cmp(operand.reg(), FACTORY->undefined_value());
|
9288
9324
|
destination()->true_target()->Branch(equal);
|
9289
9325
|
__ test(operand.reg(), Immediate(kSmiTagMask));
|
9290
9326
|
destination()->false_target()->Branch(equal);
|
@@ -9357,7 +9393,8 @@ void DeferredReferenceGetNamedValue::Generate() {
|
|
9357
9393
|
__ mov(eax, receiver_);
|
9358
9394
|
}
|
9359
9395
|
__ Set(ecx, Immediate(name_));
|
9360
|
-
Handle<Code> ic(
|
9396
|
+
Handle<Code> ic(masm()->isolate()->builtins()->builtin(
|
9397
|
+
Builtins::kLoadIC_Initialize));
|
9361
9398
|
RelocInfo::Mode mode = is_contextual_
|
9362
9399
|
? RelocInfo::CODE_TARGET_CONTEXT
|
9363
9400
|
: RelocInfo::CODE_TARGET;
|
@@ -9374,15 +9411,16 @@ void DeferredReferenceGetNamedValue::Generate() {
|
|
9374
9411
|
int delta_to_patch_site = masm_->SizeOfCodeGeneratedSince(patch_site());
|
9375
9412
|
// Here we use masm_-> instead of the __ macro because this is the
|
9376
9413
|
// instruction that gets patched and coverage code gets in the way.
|
9414
|
+
Counters* counters = masm()->isolate()->counters();
|
9377
9415
|
if (is_contextual_) {
|
9378
9416
|
masm_->mov(is_dont_delete_ ? edx : ecx, -delta_to_patch_site);
|
9379
|
-
__ IncrementCounter(
|
9417
|
+
__ IncrementCounter(counters->named_load_global_inline_miss(), 1);
|
9380
9418
|
if (is_dont_delete_) {
|
9381
|
-
__ IncrementCounter(
|
9419
|
+
__ IncrementCounter(counters->dont_delete_hint_miss(), 1);
|
9382
9420
|
}
|
9383
9421
|
} else {
|
9384
9422
|
masm_->test(eax, Immediate(-delta_to_patch_site));
|
9385
|
-
__ IncrementCounter(
|
9423
|
+
__ IncrementCounter(counters->named_load_inline_miss(), 1);
|
9386
9424
|
}
|
9387
9425
|
|
9388
9426
|
if (!dst_.is(eax)) __ mov(dst_, eax);
|
@@ -9436,7 +9474,8 @@ void DeferredReferenceGetKeyedValue::Generate() {
|
|
9436
9474
|
// it in the IC initialization code and patch the cmp instruction.
|
9437
9475
|
// This means that we cannot allow test instructions after calls to
|
9438
9476
|
// KeyedLoadIC stubs in other places.
|
9439
|
-
Handle<Code> ic(
|
9477
|
+
Handle<Code> ic(masm()->isolate()->builtins()->builtin(
|
9478
|
+
Builtins::kKeyedLoadIC_Initialize));
|
9440
9479
|
__ call(ic, RelocInfo::CODE_TARGET);
|
9441
9480
|
// The delta from the start of the map-compare instruction to the
|
9442
9481
|
// test instruction. We use masm_-> directly here instead of the __
|
@@ -9447,7 +9486,8 @@ void DeferredReferenceGetKeyedValue::Generate() {
|
|
9447
9486
|
// Here we use masm_-> instead of the __ macro because this is the
|
9448
9487
|
// instruction that gets patched and coverage code gets in the way.
|
9449
9488
|
masm_->test(eax, Immediate(-delta_to_patch_site));
|
9450
|
-
|
9489
|
+
Counters* counters = masm()->isolate()->counters();
|
9490
|
+
__ IncrementCounter(counters->keyed_load_inline_miss(), 1);
|
9451
9491
|
|
9452
9492
|
if (!dst_.is(eax)) __ mov(dst_, eax);
|
9453
9493
|
}
|
@@ -9458,11 +9498,13 @@ class DeferredReferenceSetKeyedValue: public DeferredCode {
|
|
9458
9498
|
DeferredReferenceSetKeyedValue(Register value,
|
9459
9499
|
Register key,
|
9460
9500
|
Register receiver,
|
9461
|
-
Register scratch
|
9501
|
+
Register scratch,
|
9502
|
+
StrictModeFlag strict_mode)
|
9462
9503
|
: value_(value),
|
9463
9504
|
key_(key),
|
9464
9505
|
receiver_(receiver),
|
9465
|
-
scratch_(scratch)
|
9506
|
+
scratch_(scratch),
|
9507
|
+
strict_mode_(strict_mode) {
|
9466
9508
|
set_comment("[ DeferredReferenceSetKeyedValue");
|
9467
9509
|
}
|
9468
9510
|
|
@@ -9476,11 +9518,13 @@ class DeferredReferenceSetKeyedValue: public DeferredCode {
|
|
9476
9518
|
Register receiver_;
|
9477
9519
|
Register scratch_;
|
9478
9520
|
Label patch_site_;
|
9521
|
+
StrictModeFlag strict_mode_;
|
9479
9522
|
};
|
9480
9523
|
|
9481
9524
|
|
9482
9525
|
void DeferredReferenceSetKeyedValue::Generate() {
|
9483
|
-
|
9526
|
+
Counters* counters = masm()->isolate()->counters();
|
9527
|
+
__ IncrementCounter(counters->keyed_store_inline_miss(), 1);
|
9484
9528
|
// Move value_ to eax, key_ to ecx, and receiver_ to edx.
|
9485
9529
|
Register old_value = value_;
|
9486
9530
|
|
@@ -9534,7 +9578,9 @@ void DeferredReferenceSetKeyedValue::Generate() {
|
|
9534
9578
|
}
|
9535
9579
|
|
9536
9580
|
// Call the IC stub.
|
9537
|
-
Handle<Code> ic(
|
9581
|
+
Handle<Code> ic(masm()->isolate()->builtins()->builtin(
|
9582
|
+
(strict_mode_ == kStrictMode) ? Builtins::kKeyedStoreIC_Initialize_Strict
|
9583
|
+
: Builtins::kKeyedStoreIC_Initialize));
|
9538
9584
|
__ call(ic, RelocInfo::CODE_TARGET);
|
9539
9585
|
// The delta from the start of the map-compare instruction to the
|
9540
9586
|
// test instruction. We use masm_-> directly here instead of the
|
@@ -9555,9 +9601,13 @@ Result CodeGenerator::EmitNamedLoad(Handle<String> name, bool is_contextual) {
|
|
9555
9601
|
int original_height = frame()->height();
|
9556
9602
|
#endif
|
9557
9603
|
|
9604
|
+
Isolate* isolate = masm()->isolate();
|
9605
|
+
Factory* factory = isolate->factory();
|
9606
|
+
Counters* counters = isolate->counters();
|
9607
|
+
|
9558
9608
|
bool contextual_load_in_builtin =
|
9559
9609
|
is_contextual &&
|
9560
|
-
(
|
9610
|
+
(isolate->bootstrapper()->IsActive() ||
|
9561
9611
|
(!info_->closure().is_null() && info_->closure()->IsBuiltin()));
|
9562
9612
|
|
9563
9613
|
Result result;
|
@@ -9603,7 +9653,7 @@ Result CodeGenerator::EmitNamedLoad(Handle<String> name, bool is_contextual) {
|
|
9603
9653
|
// use the double underscore macro that may insert instructions).
|
9604
9654
|
// Initially use an invalid map to force a failure.
|
9605
9655
|
masm()->cmp(FieldOperand(receiver.reg(), HeapObject::kMapOffset),
|
9606
|
-
Immediate(
|
9656
|
+
Immediate(factory->null_value()));
|
9607
9657
|
// This branch is always a forwards branch so it's always a fixed size
|
9608
9658
|
// which allows the assert below to succeed and patching to work.
|
9609
9659
|
deferred->Branch(not_equal);
|
@@ -9615,14 +9665,16 @@ Result CodeGenerator::EmitNamedLoad(Handle<String> name, bool is_contextual) {
|
|
9615
9665
|
|
9616
9666
|
if (is_contextual) {
|
9617
9667
|
// Load the (initialy invalid) cell and get its value.
|
9618
|
-
masm()->mov(result.reg(),
|
9668
|
+
masm()->mov(result.reg(), factory->null_value());
|
9619
9669
|
if (FLAG_debug_code) {
|
9620
9670
|
__ cmp(FieldOperand(result.reg(), HeapObject::kMapOffset),
|
9621
|
-
|
9671
|
+
factory->global_property_cell_map());
|
9622
9672
|
__ Assert(equal, "Uninitialized inlined contextual load");
|
9623
9673
|
}
|
9624
9674
|
__ mov(result.reg(),
|
9625
9675
|
FieldOperand(result.reg(), JSGlobalPropertyCell::kValueOffset));
|
9676
|
+
__ cmp(result.reg(), factory->the_hole_value());
|
9677
|
+
deferred->Branch(equal);
|
9626
9678
|
bool is_dont_delete = false;
|
9627
9679
|
if (!info_->closure().is_null()) {
|
9628
9680
|
// When doing lazy compilation we can check if the global cell
|
@@ -9641,15 +9693,15 @@ Result CodeGenerator::EmitNamedLoad(Handle<String> name, bool is_contextual) {
|
|
9641
9693
|
}
|
9642
9694
|
deferred->set_is_dont_delete(is_dont_delete);
|
9643
9695
|
if (!is_dont_delete) {
|
9644
|
-
__ cmp(result.reg(),
|
9696
|
+
__ cmp(result.reg(), factory->the_hole_value());
|
9645
9697
|
deferred->Branch(equal);
|
9646
9698
|
} else if (FLAG_debug_code) {
|
9647
|
-
__ cmp(result.reg(),
|
9699
|
+
__ cmp(result.reg(), factory->the_hole_value());
|
9648
9700
|
__ Check(not_equal, "DontDelete cells can't contain the hole");
|
9649
9701
|
}
|
9650
|
-
__ IncrementCounter(
|
9702
|
+
__ IncrementCounter(counters->named_load_global_inline(), 1);
|
9651
9703
|
if (is_dont_delete) {
|
9652
|
-
__ IncrementCounter(
|
9704
|
+
__ IncrementCounter(counters->dont_delete_hint_hit(), 1);
|
9653
9705
|
}
|
9654
9706
|
} else {
|
9655
9707
|
// The initial (invalid) offset has to be large enough to force a 32-bit
|
@@ -9657,7 +9709,7 @@ Result CodeGenerator::EmitNamedLoad(Handle<String> name, bool is_contextual) {
|
|
9657
9709
|
// kMaxInt (minus kHeapObjectTag).
|
9658
9710
|
int offset = kMaxInt;
|
9659
9711
|
masm()->mov(result.reg(), FieldOperand(receiver.reg(), offset));
|
9660
|
-
__ IncrementCounter(
|
9712
|
+
__ IncrementCounter(counters->named_load_inline(), 1);
|
9661
9713
|
}
|
9662
9714
|
|
9663
9715
|
deferred->BindExit();
|
@@ -9703,7 +9755,7 @@ Result CodeGenerator::EmitNamedStore(Handle<String> name, bool is_contextual) {
|
|
9703
9755
|
// Initially use an invalid map to force a failure.
|
9704
9756
|
__ bind(&patch_site);
|
9705
9757
|
masm()->cmp(FieldOperand(receiver.reg(), HeapObject::kMapOffset),
|
9706
|
-
Immediate(
|
9758
|
+
Immediate(FACTORY->null_value()));
|
9707
9759
|
// This branch is always a forwards branch so it's always a fixed size
|
9708
9760
|
// which allows the assert below to succeed and patching to work.
|
9709
9761
|
slow.Branch(not_equal, &value, &receiver);
|
@@ -9813,7 +9865,7 @@ Result CodeGenerator::EmitKeyedLoad() {
|
|
9813
9865
|
// Use masm-> here instead of the double underscore macro since extra
|
9814
9866
|
// coverage code can interfere with the patching.
|
9815
9867
|
masm_->cmp(FieldOperand(receiver.reg(), HeapObject::kMapOffset),
|
9816
|
-
Immediate(
|
9868
|
+
Immediate(FACTORY->null_value()));
|
9817
9869
|
deferred->Branch(not_equal);
|
9818
9870
|
|
9819
9871
|
// Check that the key is a smi.
|
@@ -9843,9 +9895,9 @@ Result CodeGenerator::EmitKeyedLoad() {
|
|
9843
9895
|
times_2,
|
9844
9896
|
FixedArray::kHeaderSize));
|
9845
9897
|
result = elements;
|
9846
|
-
__ cmp(Operand(result.reg()), Immediate(
|
9898
|
+
__ cmp(Operand(result.reg()), Immediate(FACTORY->the_hole_value()));
|
9847
9899
|
deferred->Branch(equal);
|
9848
|
-
__ IncrementCounter(
|
9900
|
+
__ IncrementCounter(masm_->isolate()->counters()->keyed_load_inline(), 1);
|
9849
9901
|
|
9850
9902
|
deferred->BindExit();
|
9851
9903
|
} else {
|
@@ -9896,7 +9948,8 @@ Result CodeGenerator::EmitKeyedStore(StaticType* key_type) {
|
|
9896
9948
|
new DeferredReferenceSetKeyedValue(result.reg(),
|
9897
9949
|
key.reg(),
|
9898
9950
|
receiver.reg(),
|
9899
|
-
tmp.reg()
|
9951
|
+
tmp.reg(),
|
9952
|
+
strict_mode_flag());
|
9900
9953
|
|
9901
9954
|
// Check that the receiver is not a smi.
|
9902
9955
|
__ test(receiver.reg(), Immediate(kSmiTagMask));
|
@@ -9914,12 +9967,6 @@ Result CodeGenerator::EmitKeyedStore(StaticType* key_type) {
|
|
9914
9967
|
__ CmpObjectType(receiver.reg(), JS_ARRAY_TYPE, tmp.reg());
|
9915
9968
|
deferred->Branch(not_equal);
|
9916
9969
|
|
9917
|
-
// Check that the key is within bounds. Both the key and the length of
|
9918
|
-
// the JSArray are smis. Use unsigned comparison to handle negative keys.
|
9919
|
-
__ cmp(key.reg(),
|
9920
|
-
FieldOperand(receiver.reg(), JSArray::kLengthOffset));
|
9921
|
-
deferred->Branch(above_equal);
|
9922
|
-
|
9923
9970
|
// Get the elements array from the receiver and check that it is not a
|
9924
9971
|
// dictionary.
|
9925
9972
|
__ mov(tmp.reg(),
|
@@ -9942,16 +9989,24 @@ Result CodeGenerator::EmitKeyedStore(StaticType* key_type) {
|
|
9942
9989
|
// which will allow the debugger to break for fast case stores.
|
9943
9990
|
__ bind(deferred->patch_site());
|
9944
9991
|
__ cmp(FieldOperand(tmp.reg(), HeapObject::kMapOffset),
|
9945
|
-
Immediate(
|
9992
|
+
Immediate(FACTORY->fixed_array_map()));
|
9946
9993
|
deferred->Branch(not_equal);
|
9947
9994
|
|
9995
|
+
// Check that the key is within bounds. Both the key and the length of
|
9996
|
+
// the JSArray are smis (because the fixed array check above ensures the
|
9997
|
+
// elements are in fast case). Use unsigned comparison to handle negative
|
9998
|
+
// keys.
|
9999
|
+
__ cmp(key.reg(),
|
10000
|
+
FieldOperand(receiver.reg(), JSArray::kLengthOffset));
|
10001
|
+
deferred->Branch(above_equal);
|
10002
|
+
|
9948
10003
|
// Store the value.
|
9949
10004
|
__ mov(FixedArrayElementOperand(tmp.reg(), key.reg()), result.reg());
|
9950
|
-
__ IncrementCounter(
|
10005
|
+
__ IncrementCounter(masm_->isolate()->counters()->keyed_store_inline(), 1);
|
9951
10006
|
|
9952
10007
|
deferred->BindExit();
|
9953
10008
|
} else {
|
9954
|
-
result = frame()->CallKeyedStoreIC();
|
10009
|
+
result = frame()->CallKeyedStoreIC(strict_mode_flag());
|
9955
10010
|
// Make sure that we do not have a test instruction after the
|
9956
10011
|
// call. A test instruction after the call is used to
|
9957
10012
|
// indicate that we have generated an inline version of the
|
@@ -10120,9 +10175,14 @@ static void MemCopyWrapper(void* dest, const void* src, size_t size) {
|
|
10120
10175
|
}
|
10121
10176
|
|
10122
10177
|
|
10123
|
-
MemCopyFunction CreateMemCopyFunction() {
|
10124
|
-
|
10125
|
-
|
10178
|
+
OS::MemCopyFunction CreateMemCopyFunction() {
|
10179
|
+
size_t actual_size;
|
10180
|
+
// Allocate buffer in executable space.
|
10181
|
+
byte* buffer = static_cast<byte*>(OS::Allocate(1 * KB,
|
10182
|
+
&actual_size,
|
10183
|
+
true));
|
10184
|
+
if (buffer == NULL) return &MemCopyWrapper;
|
10185
|
+
MacroAssembler masm(NULL, buffer, static_cast<int>(actual_size));
|
10126
10186
|
|
10127
10187
|
// Generated code is put into a fixed, unmovable, buffer, and not into
|
10128
10188
|
// the V8 heap. We can't, and don't, refer to any relocatable addresses
|
@@ -10144,7 +10204,7 @@ MemCopyFunction CreateMemCopyFunction() {
|
|
10144
10204
|
|
10145
10205
|
if (FLAG_debug_code) {
|
10146
10206
|
__ cmp(Operand(esp, kSizeOffset + stack_offset),
|
10147
|
-
Immediate(kMinComplexMemCopy));
|
10207
|
+
Immediate(OS::kMinComplexMemCopy));
|
10148
10208
|
Label ok;
|
10149
10209
|
__ j(greater_equal, &ok);
|
10150
10210
|
__ int3();
|
@@ -10178,7 +10238,6 @@ MemCopyFunction CreateMemCopyFunction() {
|
|
10178
10238
|
__ test(Operand(src), Immediate(0x0F));
|
10179
10239
|
__ j(not_zero, &unaligned_source);
|
10180
10240
|
{
|
10181
|
-
__ IncrementCounter(&Counters::memcopy_aligned, 1);
|
10182
10241
|
// Copy loop for aligned source and destination.
|
10183
10242
|
__ mov(edx, count);
|
10184
10243
|
Register loop_count = ecx;
|
@@ -10226,7 +10285,6 @@ MemCopyFunction CreateMemCopyFunction() {
|
|
10226
10285
|
// Copy loop for unaligned source and aligned destination.
|
10227
10286
|
// If source is not aligned, we can't read it as efficiently.
|
10228
10287
|
__ bind(&unaligned_source);
|
10229
|
-
__ IncrementCounter(&Counters::memcopy_unaligned, 1);
|
10230
10288
|
__ mov(edx, ecx);
|
10231
10289
|
Register loop_count = ecx;
|
10232
10290
|
Register count = edx;
|
@@ -10270,7 +10328,6 @@ MemCopyFunction CreateMemCopyFunction() {
|
|
10270
10328
|
}
|
10271
10329
|
|
10272
10330
|
} else {
|
10273
|
-
__ IncrementCounter(&Counters::memcopy_noxmm, 1);
|
10274
10331
|
// SSE2 not supported. Unlikely to happen in practice.
|
10275
10332
|
__ push(edi);
|
10276
10333
|
__ push(esi);
|
@@ -10317,13 +10374,8 @@ MemCopyFunction CreateMemCopyFunction() {
|
|
10317
10374
|
masm.GetCode(&desc);
|
10318
10375
|
ASSERT(desc.reloc_size == 0);
|
10319
10376
|
|
10320
|
-
|
10321
|
-
|
10322
|
-
LargeObjectChunk* chunk = LargeObjectChunk::New(desc.instr_size, EXECUTABLE);
|
10323
|
-
if (chunk == NULL) return &MemCopyWrapper;
|
10324
|
-
memcpy(chunk->GetStartAddress(), desc.buffer, desc.instr_size);
|
10325
|
-
CPU::FlushICache(chunk->GetStartAddress(), desc.instr_size);
|
10326
|
-
return FUNCTION_CAST<MemCopyFunction>(chunk->GetStartAddress());
|
10377
|
+
CPU::FlushICache(buffer, actual_size);
|
10378
|
+
return FUNCTION_CAST<OS::MemCopyFunction>(buffer);
|
10327
10379
|
}
|
10328
10380
|
|
10329
10381
|
#undef __
|