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
@@ -30,11 +30,13 @@
|
|
30
30
|
#define V8_MIPS_VIRTUAL_FRAME_MIPS_H_
|
31
31
|
|
32
32
|
#include "register-allocator.h"
|
33
|
-
#include "scopes.h"
|
34
33
|
|
35
34
|
namespace v8 {
|
36
35
|
namespace internal {
|
37
36
|
|
37
|
+
// This dummy class is only used to create invalid virtual frames.
|
38
|
+
extern class InvalidVirtualFrameInitializer {}* kInvalidVirtualFrameInitializer;
|
39
|
+
|
38
40
|
|
39
41
|
// -------------------------------------------------------------------------
|
40
42
|
// Virtual frames
|
@@ -47,14 +49,54 @@ namespace internal {
|
|
47
49
|
|
48
50
|
class VirtualFrame : public ZoneObject {
|
49
51
|
public:
|
52
|
+
class RegisterAllocationScope;
|
50
53
|
// A utility class to introduce a scope where the virtual frame is
|
51
54
|
// expected to remain spilled. The constructor spills the code
|
52
|
-
// generator's current frame,
|
53
|
-
// to stay spilled. It is intended as documentation while the code
|
54
|
-
// generator is being transformed.
|
55
|
+
// generator's current frame, and keeps it spilled.
|
55
56
|
class SpilledScope BASE_EMBEDDED {
|
56
57
|
public:
|
58
|
+
explicit SpilledScope(VirtualFrame* frame)
|
59
|
+
: old_is_spilled_(
|
60
|
+
Isolate::Current()->is_virtual_frame_in_spilled_scope()) {
|
61
|
+
if (frame != NULL) {
|
62
|
+
if (!old_is_spilled_) {
|
63
|
+
frame->SpillAll();
|
64
|
+
} else {
|
65
|
+
frame->AssertIsSpilled();
|
66
|
+
}
|
67
|
+
}
|
68
|
+
Isolate::Current()->set_is_virtual_frame_in_spilled_scope(true);
|
69
|
+
}
|
70
|
+
~SpilledScope() {
|
71
|
+
Isolate::Current()->set_is_virtual_frame_in_spilled_scope(
|
72
|
+
old_is_spilled_);
|
73
|
+
}
|
74
|
+
static bool is_spilled() {
|
75
|
+
return Isolate::Current()->is_virtual_frame_in_spilled_scope();
|
76
|
+
}
|
77
|
+
|
78
|
+
private:
|
79
|
+
int old_is_spilled_;
|
80
|
+
|
57
81
|
SpilledScope() {}
|
82
|
+
|
83
|
+
friend class RegisterAllocationScope;
|
84
|
+
};
|
85
|
+
|
86
|
+
class RegisterAllocationScope BASE_EMBEDDED {
|
87
|
+
public:
|
88
|
+
// A utility class to introduce a scope where the virtual frame
|
89
|
+
// is not spilled, ie. where register allocation occurs. Eventually
|
90
|
+
// when RegisterAllocationScope is ubiquitous it can be removed
|
91
|
+
// along with the (by then unused) SpilledScope class.
|
92
|
+
inline explicit RegisterAllocationScope(CodeGenerator* cgen);
|
93
|
+
inline ~RegisterAllocationScope();
|
94
|
+
|
95
|
+
private:
|
96
|
+
CodeGenerator* cgen_;
|
97
|
+
bool old_is_spilled_;
|
98
|
+
|
99
|
+
RegisterAllocationScope() {}
|
58
100
|
};
|
59
101
|
|
60
102
|
// An illegal index into the virtual frame.
|
@@ -63,45 +105,49 @@ class VirtualFrame : public ZoneObject {
|
|
63
105
|
// Construct an initial virtual frame on entry to a JS function.
|
64
106
|
inline VirtualFrame();
|
65
107
|
|
108
|
+
// Construct an invalid virtual frame, used by JumpTargets.
|
109
|
+
inline VirtualFrame(InvalidVirtualFrameInitializer* dummy);
|
110
|
+
|
66
111
|
// Construct a virtual frame as a clone of an existing one.
|
67
112
|
explicit inline VirtualFrame(VirtualFrame* original);
|
68
113
|
|
69
|
-
CodeGenerator* cgen()
|
70
|
-
MacroAssembler* masm()
|
71
|
-
|
72
|
-
// Create a duplicate of an existing valid frame element.
|
73
|
-
FrameElement CopyElementAt(int index,
|
74
|
-
NumberInfo info = NumberInfo::Unknown());
|
114
|
+
inline CodeGenerator* cgen() const;
|
115
|
+
inline MacroAssembler* masm();
|
75
116
|
|
76
117
|
// The number of elements on the virtual frame.
|
77
|
-
int element_count() { return
|
118
|
+
int element_count() const { return element_count_; }
|
78
119
|
|
79
120
|
// The height of the virtual expression stack.
|
80
|
-
int height()
|
81
|
-
return element_count() - expression_base_index();
|
82
|
-
}
|
83
|
-
|
84
|
-
int register_location(int num) {
|
85
|
-
ASSERT(num >= 0 && num < RegisterAllocator::kNumRegisters);
|
86
|
-
return register_locations_[num];
|
87
|
-
}
|
88
|
-
|
89
|
-
int register_location(Register reg) {
|
90
|
-
return register_locations_[RegisterAllocator::ToNumber(reg)];
|
91
|
-
}
|
92
|
-
|
93
|
-
void set_register_location(Register reg, int index) {
|
94
|
-
register_locations_[RegisterAllocator::ToNumber(reg)] = index;
|
95
|
-
}
|
121
|
+
inline int height() const;
|
96
122
|
|
97
123
|
bool is_used(int num) {
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
124
|
+
switch (num) {
|
125
|
+
case 0: { // a0.
|
126
|
+
return kA0InUse[top_of_stack_state_];
|
127
|
+
}
|
128
|
+
case 1: { // a1.
|
129
|
+
return kA1InUse[top_of_stack_state_];
|
130
|
+
}
|
131
|
+
case 2:
|
132
|
+
case 3:
|
133
|
+
case 4:
|
134
|
+
case 5:
|
135
|
+
case 6: { // a2 to a3, t0 to t2.
|
136
|
+
ASSERT(num - kFirstAllocatedRegister < kNumberOfAllocatedRegisters);
|
137
|
+
ASSERT(num >= kFirstAllocatedRegister);
|
138
|
+
if ((register_allocation_map_ &
|
139
|
+
(1 << (num - kFirstAllocatedRegister))) == 0) {
|
140
|
+
return false;
|
141
|
+
} else {
|
142
|
+
return true;
|
143
|
+
}
|
144
|
+
}
|
145
|
+
default: {
|
146
|
+
ASSERT(num < kFirstAllocatedRegister ||
|
147
|
+
num >= kFirstAllocatedRegister + kNumberOfAllocatedRegisters);
|
148
|
+
return false;
|
149
|
+
}
|
150
|
+
}
|
105
151
|
}
|
106
152
|
|
107
153
|
// Add extra in-memory elements to the top of the frame to match an actual
|
@@ -110,53 +156,60 @@ class VirtualFrame : public ZoneObject {
|
|
110
156
|
void Adjust(int count);
|
111
157
|
|
112
158
|
// Forget elements from the top of the frame to match an actual frame (eg,
|
113
|
-
// the frame after a runtime call). No code is emitted
|
114
|
-
|
115
|
-
|
116
|
-
ASSERT(stack_pointer_ == element_count() - 1);
|
117
|
-
stack_pointer_ -= count;
|
118
|
-
// On mips, all elements are in memory, so there is no extra bookkeeping
|
119
|
-
// (registers, copies, etc.) beyond dropping the elements.
|
120
|
-
elements_.Rewind(stack_pointer_ + 1);
|
121
|
-
}
|
159
|
+
// the frame after a runtime call). No code is emitted except to bring the
|
160
|
+
// frame to a spilled state.
|
161
|
+
void Forget(int count);
|
122
162
|
|
123
|
-
// Forget count elements from the top of the frame and adjust the stack
|
124
|
-
// pointer downward. This is used, for example, before merging frames at
|
125
|
-
// break, continue, and return targets.
|
126
|
-
void ForgetElements(int count);
|
127
163
|
|
128
164
|
// Spill all values from the frame to memory.
|
129
165
|
void SpillAll();
|
130
166
|
|
167
|
+
void AssertIsSpilled() const {
|
168
|
+
ASSERT(top_of_stack_state_ == NO_TOS_REGISTERS);
|
169
|
+
ASSERT(register_allocation_map_ == 0);
|
170
|
+
}
|
171
|
+
|
172
|
+
void AssertIsNotSpilled() {
|
173
|
+
ASSERT(!SpilledScope::is_spilled());
|
174
|
+
}
|
175
|
+
|
131
176
|
// Spill all occurrences of a specific register from the frame.
|
132
177
|
void Spill(Register reg) {
|
133
|
-
|
178
|
+
UNIMPLEMENTED();
|
134
179
|
}
|
135
180
|
|
136
181
|
// Spill all occurrences of an arbitrary register if possible. Return the
|
137
182
|
// register spilled or no_reg if it was not possible to free any register
|
138
|
-
// (ie, they all have frame-external references).
|
183
|
+
// (ie, they all have frame-external references). Unimplemented.
|
139
184
|
Register SpillAnyRegister();
|
140
185
|
|
141
|
-
// Prepare this virtual frame for merging to an expected frame by
|
142
|
-
// performing some state changes that do not require generating
|
143
|
-
// code. It is guaranteed that no code will be generated.
|
144
|
-
void PrepareMergeTo(VirtualFrame* expected);
|
145
|
-
|
146
186
|
// Make this virtual frame have a state identical to an expected virtual
|
147
187
|
// frame. As a side effect, code may be emitted to make this frame match
|
148
188
|
// the expected one.
|
149
|
-
void MergeTo(VirtualFrame* expected
|
189
|
+
void MergeTo(const VirtualFrame* expected,
|
190
|
+
Condition cond = al,
|
191
|
+
Register r1 = no_reg,
|
192
|
+
const Operand& r2 = Operand(no_reg));
|
193
|
+
|
194
|
+
void MergeTo(VirtualFrame* expected,
|
195
|
+
Condition cond = al,
|
196
|
+
Register r1 = no_reg,
|
197
|
+
const Operand& r2 = Operand(no_reg));
|
198
|
+
|
199
|
+
// Checks whether this frame can be branched to by the other frame.
|
200
|
+
bool IsCompatibleWith(const VirtualFrame* other) const {
|
201
|
+
return (tos_known_smi_map_ & (~other->tos_known_smi_map_)) == 0;
|
202
|
+
}
|
203
|
+
|
204
|
+
inline void ForgetTypeInfo() {
|
205
|
+
tos_known_smi_map_ = 0;
|
206
|
+
}
|
150
207
|
|
151
208
|
// Detach a frame from its code generator, perhaps temporarily. This
|
152
209
|
// tells the register allocator that it is free to use frame-internal
|
153
210
|
// registers. Used when the code generator's frame is switched from this
|
154
211
|
// one to NULL by an unconditional jump.
|
155
212
|
void DetachFromCodeGenerator() {
|
156
|
-
RegisterAllocator* cgen_allocator = cgen()->allocator();
|
157
|
-
for (int i = 0; i < RegisterAllocator::kNumRegisters; i++) {
|
158
|
-
if (is_used(i)) cgen_allocator->Unuse(i);
|
159
|
-
}
|
160
213
|
}
|
161
214
|
|
162
215
|
// (Re)attach a frame to its code generator. This informs the register
|
@@ -164,10 +217,6 @@ class VirtualFrame : public ZoneObject {
|
|
164
217
|
// Used when a code generator's frame is switched from NULL to this one by
|
165
218
|
// binding a label.
|
166
219
|
void AttachToCodeGenerator() {
|
167
|
-
RegisterAllocator* cgen_allocator = cgen()->allocator();
|
168
|
-
for (int i = 0; i < RegisterAllocator::kNumRegisters; i++) {
|
169
|
-
if (is_used(i)) cgen_allocator->Unuse(i);
|
170
|
-
}
|
171
220
|
}
|
172
221
|
|
173
222
|
// Emit code for the physical JS entry and exit frame sequences. After
|
@@ -177,176 +226,142 @@ class VirtualFrame : public ZoneObject {
|
|
177
226
|
void Enter();
|
178
227
|
void Exit();
|
179
228
|
|
180
|
-
// Prepare for returning from the frame by
|
181
|
-
//
|
182
|
-
//
|
183
|
-
|
184
|
-
|
229
|
+
// Prepare for returning from the frame by elements in the virtual frame.
|
230
|
+
// This avoids generating unnecessary merge code when jumping to the shared
|
231
|
+
// return site. No spill code emitted. Value to return should be in v0.
|
232
|
+
inline void PrepareForReturn();
|
233
|
+
|
234
|
+
// Number of local variables after when we use a loop for allocating.
|
235
|
+
static const int kLocalVarBound = 5;
|
185
236
|
|
186
237
|
// Allocate and initialize the frame-allocated locals.
|
187
238
|
void AllocateStackSlots();
|
188
239
|
|
189
240
|
// The current top of the expression stack as an assembly operand.
|
190
|
-
MemOperand Top() {
|
241
|
+
MemOperand Top() {
|
242
|
+
AssertIsSpilled();
|
243
|
+
return MemOperand(sp, 0);
|
244
|
+
}
|
191
245
|
|
192
246
|
// An element of the expression stack as an assembly operand.
|
193
247
|
MemOperand ElementAt(int index) {
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
// Random-access store to a frame-top relative frame element. The result
|
198
|
-
// becomes owned by the frame and is invalidated.
|
199
|
-
void SetElementAt(int index, Result* value);
|
200
|
-
|
201
|
-
// Set a frame element to a constant. The index is frame-top relative.
|
202
|
-
void SetElementAt(int index, Handle<Object> value) {
|
203
|
-
Result temp(value);
|
204
|
-
SetElementAt(index, &temp);
|
248
|
+
int adjusted_index = index - kVirtualElements[top_of_stack_state_];
|
249
|
+
ASSERT(adjusted_index >= 0);
|
250
|
+
return MemOperand(sp, adjusted_index * kPointerSize);
|
205
251
|
}
|
206
252
|
|
207
|
-
|
208
|
-
|
253
|
+
bool KnownSmiAt(int index) {
|
254
|
+
if (index >= kTOSKnownSmiMapSize) return false;
|
255
|
+
return (tos_known_smi_map_ & (1 << index)) != 0;
|
209
256
|
}
|
210
|
-
|
211
257
|
// A frame-allocated local as an assembly operand.
|
212
|
-
MemOperand LocalAt(int index)
|
213
|
-
ASSERT(0 <= index);
|
214
|
-
ASSERT(index < local_count());
|
215
|
-
return MemOperand(s8_fp, kLocal0Offset - index * kPointerSize);
|
216
|
-
}
|
217
|
-
|
218
|
-
// Push a copy of the value of a local frame slot on top of the frame.
|
219
|
-
void PushLocalAt(int index) {
|
220
|
-
PushFrameSlotAt(local0_index() + index);
|
221
|
-
}
|
222
|
-
|
223
|
-
// Push the value of a local frame slot on top of the frame and invalidate
|
224
|
-
// the local slot. The slot should be written to before trying to read
|
225
|
-
// from it again.
|
226
|
-
void TakeLocalAt(int index) {
|
227
|
-
TakeFrameSlotAt(local0_index() + index);
|
228
|
-
}
|
229
|
-
|
230
|
-
// Store the top value on the virtual frame into a local frame slot. The
|
231
|
-
// value is left in place on top of the frame.
|
232
|
-
void StoreToLocalAt(int index) {
|
233
|
-
StoreToFrameSlotAt(local0_index() + index);
|
234
|
-
}
|
258
|
+
inline MemOperand LocalAt(int index);
|
235
259
|
|
236
260
|
// Push the address of the receiver slot on the frame.
|
237
261
|
void PushReceiverSlotAddress();
|
238
262
|
|
239
263
|
// The function frame slot.
|
240
|
-
MemOperand Function() { return MemOperand(
|
241
|
-
|
242
|
-
// Push the function on top of the frame.
|
243
|
-
void PushFunction() { PushFrameSlotAt(function_index()); }
|
264
|
+
MemOperand Function() { return MemOperand(fp, kFunctionOffset); }
|
244
265
|
|
245
266
|
// The context frame slot.
|
246
|
-
MemOperand Context() { return MemOperand(
|
247
|
-
|
248
|
-
// Save the value of the cp register to the context frame slot.
|
249
|
-
void SaveContextRegister();
|
250
|
-
|
251
|
-
// Restore the cp register from the value of the context frame
|
252
|
-
// slot.
|
253
|
-
void RestoreContextRegister();
|
267
|
+
MemOperand Context() { return MemOperand(fp, kContextOffset); }
|
254
268
|
|
255
269
|
// A parameter as an assembly operand.
|
256
|
-
MemOperand ParameterAt(int index)
|
257
|
-
// Index -1 corresponds to the receiver.
|
258
|
-
ASSERT(-1 <= index); // -1 is the receiver.
|
259
|
-
ASSERT(index <= parameter_count());
|
260
|
-
uint16_t a = 0; // Number of argument slots.
|
261
|
-
return MemOperand(s8_fp, (1 + parameter_count() + a - index) *kPointerSize);
|
262
|
-
}
|
263
|
-
|
264
|
-
// Push a copy of the value of a parameter frame slot on top of the frame.
|
265
|
-
void PushParameterAt(int index) {
|
266
|
-
PushFrameSlotAt(param0_index() + index);
|
267
|
-
}
|
268
|
-
|
269
|
-
// Push the value of a paramter frame slot on top of the frame and
|
270
|
-
// invalidate the parameter slot. The slot should be written to before
|
271
|
-
// trying to read from it again.
|
272
|
-
void TakeParameterAt(int index) {
|
273
|
-
TakeFrameSlotAt(param0_index() + index);
|
274
|
-
}
|
275
|
-
|
276
|
-
// Store the top value on the virtual frame into a parameter frame slot.
|
277
|
-
// The value is left in place on top of the frame.
|
278
|
-
void StoreToParameterAt(int index) {
|
279
|
-
StoreToFrameSlotAt(param0_index() + index);
|
280
|
-
}
|
270
|
+
inline MemOperand ParameterAt(int index);
|
281
271
|
|
282
272
|
// The receiver frame slot.
|
283
|
-
MemOperand Receiver()
|
273
|
+
inline MemOperand Receiver();
|
284
274
|
|
285
275
|
// Push a try-catch or try-finally handler on top of the virtual frame.
|
286
276
|
void PushTryHandler(HandlerType type);
|
287
277
|
|
288
278
|
// Call stub given the number of arguments it expects on (and
|
289
279
|
// removes from) the stack.
|
290
|
-
void CallStub(CodeStub* stub, int arg_count)
|
291
|
-
PrepareForCall(arg_count, arg_count);
|
292
|
-
RawCallStub(stub);
|
293
|
-
}
|
280
|
+
inline void CallStub(CodeStub* stub, int arg_count);
|
294
281
|
|
295
|
-
|
296
|
-
|
297
|
-
void
|
282
|
+
// Call JS function from top of the stack with arguments
|
283
|
+
// taken from the stack.
|
284
|
+
void CallJSFunction(int arg_count);
|
298
285
|
|
299
286
|
// Call runtime given the number of arguments expected on (and
|
300
287
|
// removed from) the stack.
|
301
|
-
void CallRuntime(Runtime::Function* f, int arg_count);
|
288
|
+
void CallRuntime(const Runtime::Function* f, int arg_count);
|
302
289
|
void CallRuntime(Runtime::FunctionId id, int arg_count);
|
303
290
|
|
304
|
-
|
305
|
-
void
|
306
|
-
|
291
|
+
#ifdef ENABLE_DEBUGGER_SUPPORT
|
292
|
+
void DebugBreak();
|
293
|
+
#endif
|
307
294
|
|
308
295
|
// Invoke builtin given the number of arguments it expects on (and
|
309
296
|
// removes from) the stack.
|
310
297
|
void InvokeBuiltin(Builtins::JavaScript id,
|
311
298
|
InvokeJSFlags flag,
|
312
|
-
Result* arg_count_register,
|
313
299
|
int arg_count);
|
314
300
|
|
301
|
+
// Call load IC. Receiver is on the stack and is consumed. Result is returned
|
302
|
+
// in v0.
|
303
|
+
void CallLoadIC(Handle<String> name, RelocInfo::Mode mode);
|
304
|
+
|
305
|
+
// Call store IC. If the load is contextual, value is found on top of the
|
306
|
+
// frame. If not, value and receiver are on the frame. Both are consumed.
|
307
|
+
// Result is returned in v0.
|
308
|
+
void CallStoreIC(Handle<String> name, bool is_contextual);
|
309
|
+
|
310
|
+
// Call keyed load IC. Key and receiver are on the stack. Both are consumed.
|
311
|
+
// Result is returned in v0.
|
312
|
+
void CallKeyedLoadIC();
|
313
|
+
|
314
|
+
// Call keyed store IC. Value, key and receiver are on the stack. All three
|
315
|
+
// are consumed. Result is returned in v0 (and a0).
|
316
|
+
void CallKeyedStoreIC();
|
317
|
+
|
315
318
|
// Call into an IC stub given the number of arguments it removes
|
316
|
-
// from the stack. Register arguments
|
317
|
-
//
|
318
|
-
void CallCodeObject(Handle<Code> ic,
|
319
|
-
RelocInfo::Mode rmode,
|
320
|
-
int dropped_args);
|
319
|
+
// from the stack. Register arguments to the IC stub are implicit,
|
320
|
+
// and depend on the type of IC stub.
|
321
321
|
void CallCodeObject(Handle<Code> ic,
|
322
322
|
RelocInfo::Mode rmode,
|
323
|
-
Result* arg,
|
324
323
|
int dropped_args);
|
325
|
-
void CallCodeObject(Handle<Code> ic,
|
326
|
-
RelocInfo::Mode rmode,
|
327
|
-
Result* arg0,
|
328
|
-
Result* arg1,
|
329
|
-
int dropped_args,
|
330
|
-
bool set_auto_args_slots = false);
|
331
324
|
|
332
325
|
// Drop a number of elements from the top of the expression stack. May
|
333
326
|
// emit code to affect the physical frame. Does not clobber any registers
|
334
327
|
// excepting possibly the stack pointer.
|
335
328
|
void Drop(int count);
|
336
|
-
// Similar to VirtualFrame::Drop but we don't modify the actual stack.
|
337
|
-
// This is because we need to manually restore sp to the correct position.
|
338
|
-
void DropFromVFrameOnly(int count);
|
339
329
|
|
340
330
|
// Drop one element.
|
341
331
|
void Drop() { Drop(1); }
|
342
|
-
void DropFromVFrameOnly() { DropFromVFrameOnly(1); }
|
343
332
|
|
344
|
-
//
|
345
|
-
|
333
|
+
// Pop an element from the top of the expression stack. Discards
|
334
|
+
// the result.
|
335
|
+
void Pop();
|
336
|
+
|
337
|
+
// Pop an element from the top of the expression stack. The register
|
338
|
+
// will be one normally used for the top of stack register allocation
|
339
|
+
// so you can't hold on to it if you push on the stack.
|
340
|
+
Register PopToRegister(Register but_not_to_this_one = no_reg);
|
341
|
+
|
342
|
+
// Look at the top of the stack. The register returned is aliased and
|
343
|
+
// must be copied to a scratch register before modification.
|
344
|
+
Register Peek();
|
345
|
+
|
346
|
+
// Look at the value beneath the top of the stack. The register returned is
|
347
|
+
// aliased and must be copied to a scratch register before modification.
|
348
|
+
Register Peek2();
|
349
|
+
|
350
|
+
// Duplicate the top of stack.
|
351
|
+
void Dup();
|
352
|
+
|
353
|
+
// Duplicate the two elements on top of stack.
|
354
|
+
void Dup2();
|
346
355
|
|
347
|
-
//
|
348
|
-
|
349
|
-
|
356
|
+
// Flushes all registers, but it puts a copy of the top-of-stack in a0.
|
357
|
+
void SpillAllButCopyTOSToA0();
|
358
|
+
|
359
|
+
// Flushes all registers, but it puts a copy of the top-of-stack in a1.
|
360
|
+
void SpillAllButCopyTOSToA1();
|
361
|
+
|
362
|
+
// Flushes all registers, but it puts a copy of the top-of-stack in a1
|
363
|
+
// and the next value on the stack in a0.
|
364
|
+
void SpillAllButCopyTOSToA1A0();
|
350
365
|
|
351
366
|
// Pop and save an element from the top of the expression stack and
|
352
367
|
// emit a corresponding pop instruction.
|
@@ -355,40 +370,41 @@ class VirtualFrame : public ZoneObject {
|
|
355
370
|
void EmitMultiPop(RegList regs);
|
356
371
|
void EmitMultiPopReversed(RegList regs);
|
357
372
|
|
373
|
+
|
374
|
+
// Takes the top two elements and puts them in a0 (top element) and a1
|
375
|
+
// (second element).
|
376
|
+
void PopToA1A0();
|
377
|
+
|
378
|
+
// Takes the top element and puts it in a1.
|
379
|
+
void PopToA1();
|
380
|
+
|
381
|
+
// Takes the top element and puts it in a0.
|
382
|
+
void PopToA0();
|
383
|
+
|
358
384
|
// Push an element on top of the expression stack and emit a
|
359
385
|
// corresponding push instruction.
|
360
|
-
void EmitPush(Register reg);
|
361
|
-
|
362
|
-
void
|
363
|
-
void
|
386
|
+
void EmitPush(Register reg, TypeInfo type_info = TypeInfo::Unknown());
|
387
|
+
void EmitPush(Operand operand, TypeInfo type_info = TypeInfo::Unknown());
|
388
|
+
void EmitPush(MemOperand operand, TypeInfo type_info = TypeInfo::Unknown());
|
389
|
+
void EmitPushRoot(Heap::RootListIndex index);
|
364
390
|
|
365
|
-
//
|
366
|
-
|
367
|
-
|
368
|
-
|
391
|
+
// Overwrite the nth thing on the stack. If the nth position is in a
|
392
|
+
// register then this turns into a Move, otherwise an sw. Afterwards
|
393
|
+
// you can still use the register even if it is a register that can be
|
394
|
+
// used for TOS (a0 or a1).
|
395
|
+
void SetElementAt(Register reg, int this_far_down);
|
369
396
|
|
370
|
-
//
|
371
|
-
|
372
|
-
|
373
|
-
Push(result->reg());
|
374
|
-
} else {
|
375
|
-
ASSERT(result->is_constant());
|
376
|
-
Push(result->handle());
|
377
|
-
}
|
378
|
-
result->Unuse();
|
379
|
-
}
|
380
|
-
|
381
|
-
// Nip removes zero or more elements from immediately below the top
|
382
|
-
// of the frame, leaving the previous top-of-frame value on top of
|
383
|
-
// the frame. Nip(k) is equivalent to x = Pop(), Drop(k), Push(x).
|
384
|
-
inline void Nip(int num_dropped);
|
397
|
+
// Get a register which is free and which must be immediately used to
|
398
|
+
// push on the top of the stack.
|
399
|
+
Register GetTOSRegister();
|
385
400
|
|
386
|
-
//
|
387
|
-
|
388
|
-
void
|
401
|
+
// Same but for multiple registers.
|
402
|
+
void EmitMultiPush(RegList regs);
|
403
|
+
void EmitMultiPushReversed(RegList regs);
|
389
404
|
|
390
|
-
|
391
|
-
|
405
|
+
static Register scratch0() { return t4; }
|
406
|
+
static Register scratch1() { return t5; }
|
407
|
+
static Register scratch2() { return t6; }
|
392
408
|
|
393
409
|
private:
|
394
410
|
static const int kLocal0Offset = JavaScriptFrameConstants::kLocal0Offset;
|
@@ -398,24 +414,51 @@ class VirtualFrame : public ZoneObject {
|
|
398
414
|
static const int kHandlerSize = StackHandlerConstants::kSize / kPointerSize;
|
399
415
|
static const int kPreallocatedElements = 5 + 8; // 8 expression stack slots.
|
400
416
|
|
401
|
-
|
417
|
+
// 5 states for the top of stack, which can be in memory or in a0 and a1.
|
418
|
+
enum TopOfStack { NO_TOS_REGISTERS, A0_TOS, A1_TOS, A1_A0_TOS, A0_A1_TOS,
|
419
|
+
TOS_STATES};
|
420
|
+
static const int kMaxTOSRegisters = 2;
|
421
|
+
|
422
|
+
static const bool kA0InUse[TOS_STATES];
|
423
|
+
static const bool kA1InUse[TOS_STATES];
|
424
|
+
static const int kVirtualElements[TOS_STATES];
|
425
|
+
static const TopOfStack kStateAfterPop[TOS_STATES];
|
426
|
+
static const TopOfStack kStateAfterPush[TOS_STATES];
|
427
|
+
static const Register kTopRegister[TOS_STATES];
|
428
|
+
static const Register kBottomRegister[TOS_STATES];
|
429
|
+
|
430
|
+
// We allocate up to 5 locals in registers.
|
431
|
+
static const int kNumberOfAllocatedRegisters = 5;
|
432
|
+
// r2 to r6 are allocated to locals.
|
433
|
+
static const int kFirstAllocatedRegister = 2;
|
434
|
+
|
435
|
+
static const Register kAllocatedRegisters[kNumberOfAllocatedRegisters];
|
436
|
+
|
437
|
+
static Register AllocatedRegister(int r) {
|
438
|
+
ASSERT(r >= 0 && r < kNumberOfAllocatedRegisters);
|
439
|
+
return kAllocatedRegisters[r];
|
440
|
+
}
|
402
441
|
|
403
|
-
// The
|
404
|
-
|
405
|
-
|
442
|
+
// The number of elements on the stack frame.
|
443
|
+
int element_count_;
|
444
|
+
TopOfStack top_of_stack_state_:3;
|
445
|
+
int register_allocation_map_:kNumberOfAllocatedRegisters;
|
446
|
+
static const int kTOSKnownSmiMapSize = 4;
|
447
|
+
unsigned tos_known_smi_map_:kTOSKnownSmiMapSize;
|
406
448
|
|
407
|
-
// The index of the
|
408
|
-
//
|
409
|
-
|
449
|
+
// The index of the element that is at the processor's stack pointer
|
450
|
+
// (the sp register). For now since everything is in memory it is given
|
451
|
+
// by the number of elements on the not-very-virtual stack frame.
|
452
|
+
int stack_pointer() { return element_count_ - 1; }
|
410
453
|
|
411
454
|
// The number of frame-allocated locals and parameters respectively.
|
412
|
-
int parameter_count()
|
413
|
-
int local_count()
|
455
|
+
inline int parameter_count() const;
|
456
|
+
inline int local_count() const;
|
414
457
|
|
415
458
|
// The index of the element that is at the processor's frame pointer
|
416
459
|
// (the fp register). The parameters, receiver, function, and context
|
417
460
|
// are below the frame pointer.
|
418
|
-
int frame_pointer()
|
461
|
+
inline int frame_pointer() const;
|
419
462
|
|
420
463
|
// The index of the first parameter. The receiver lies below the first
|
421
464
|
// parameter.
|
@@ -423,75 +466,22 @@ class VirtualFrame : public ZoneObject {
|
|
423
466
|
|
424
467
|
// The index of the context slot in the frame. It is immediately
|
425
468
|
// below the frame pointer.
|
426
|
-
int context_index()
|
469
|
+
inline int context_index();
|
427
470
|
|
428
471
|
// The index of the function slot in the frame. It is below the frame
|
429
472
|
// pointer and context slot.
|
430
|
-
int function_index()
|
473
|
+
inline int function_index();
|
431
474
|
|
432
475
|
// The index of the first local. Between the frame pointer and the
|
433
476
|
// locals lies the return address.
|
434
|
-
int local0_index()
|
477
|
+
inline int local0_index() const;
|
435
478
|
|
436
479
|
// The index of the base of the expression stack.
|
437
|
-
int expression_base_index()
|
480
|
+
inline int expression_base_index() const;
|
438
481
|
|
439
482
|
// Convert a frame index into a frame pointer relative offset into the
|
440
483
|
// actual stack.
|
441
|
-
int fp_relative(int index)
|
442
|
-
ASSERT(index < element_count());
|
443
|
-
ASSERT(frame_pointer() < element_count()); // FP is on the frame.
|
444
|
-
return (frame_pointer() - index) * kPointerSize;
|
445
|
-
}
|
446
|
-
|
447
|
-
// Record an occurrence of a register in the virtual frame. This has the
|
448
|
-
// effect of incrementing the register's external reference count and
|
449
|
-
// of updating the index of the register's location in the frame.
|
450
|
-
void Use(Register reg, int index) {
|
451
|
-
ASSERT(!is_used(reg));
|
452
|
-
set_register_location(reg, index);
|
453
|
-
cgen()->allocator()->Use(reg);
|
454
|
-
}
|
455
|
-
|
456
|
-
// Record that a register reference has been dropped from the frame. This
|
457
|
-
// decrements the register's external reference count and invalidates the
|
458
|
-
// index of the register's location in the frame.
|
459
|
-
void Unuse(Register reg) {
|
460
|
-
ASSERT(is_used(reg));
|
461
|
-
set_register_location(reg, kIllegalIndex);
|
462
|
-
cgen()->allocator()->Unuse(reg);
|
463
|
-
}
|
464
|
-
|
465
|
-
// Spill the element at a particular index---write it to memory if
|
466
|
-
// necessary, free any associated register, and forget its value if
|
467
|
-
// constant.
|
468
|
-
void SpillElementAt(int index);
|
469
|
-
|
470
|
-
// Sync the element at a particular index. If it is a register or
|
471
|
-
// constant that disagrees with the value on the stack, write it to memory.
|
472
|
-
// Keep the element type as register or constant, and clear the dirty bit.
|
473
|
-
void SyncElementAt(int index);
|
474
|
-
|
475
|
-
// Sync the range of elements in [begin, end] with memory.
|
476
|
-
void SyncRange(int begin, int end);
|
477
|
-
|
478
|
-
// Sync a single unsynced element that lies beneath or at the stack pointer.
|
479
|
-
void SyncElementBelowStackPointer(int index);
|
480
|
-
|
481
|
-
// Sync a single unsynced element that lies just above the stack pointer.
|
482
|
-
void SyncElementByPushing(int index);
|
483
|
-
|
484
|
-
// Push a copy of a frame slot (typically a local or parameter) on top of
|
485
|
-
// the frame.
|
486
|
-
inline void PushFrameSlotAt(int index);
|
487
|
-
|
488
|
-
// Push a the value of a frame slot (typically a local or parameter) on
|
489
|
-
// top of the frame and invalidate the slot.
|
490
|
-
void TakeFrameSlotAt(int index);
|
491
|
-
|
492
|
-
// Store the value on top of the frame to a frame slot (typically a local
|
493
|
-
// or parameter).
|
494
|
-
void StoreToFrameSlotAt(int index);
|
484
|
+
inline int fp_relative(int index);
|
495
485
|
|
496
486
|
// Spill all elements in registers. Spill the top spilled_args elements
|
497
487
|
// on the frame. Sync all other frame elements.
|
@@ -499,45 +489,37 @@ class VirtualFrame : public ZoneObject {
|
|
499
489
|
// the effect of an upcoming call that will drop them from the stack.
|
500
490
|
void PrepareForCall(int spilled_args, int dropped_args);
|
501
491
|
|
502
|
-
//
|
503
|
-
//
|
504
|
-
void
|
505
|
-
|
506
|
-
//
|
507
|
-
//
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
// Calls a code object which has already been prepared for calling
|
534
|
-
// (via PrepareForCall).
|
535
|
-
void RawCallCodeObject(Handle<Code> code, RelocInfo::Mode rmode);
|
536
|
-
|
537
|
-
inline bool Equals(VirtualFrame* other);
|
538
|
-
|
539
|
-
// Classes that need raw access to the elements_ array.
|
540
|
-
friend class DeferredCode;
|
492
|
+
// If all top-of-stack registers are in use then the lowest one is pushed
|
493
|
+
// onto the physical stack and made free.
|
494
|
+
void EnsureOneFreeTOSRegister();
|
495
|
+
|
496
|
+
// Emit instructions to get the top of stack state from where we are to where
|
497
|
+
// we want to be.
|
498
|
+
void MergeTOSTo(TopOfStack expected_state,
|
499
|
+
Condition cond = al,
|
500
|
+
Register r1 = no_reg,
|
501
|
+
const Operand& r2 = Operand(no_reg));
|
502
|
+
|
503
|
+
inline bool Equals(const VirtualFrame* other);
|
504
|
+
|
505
|
+
inline void LowerHeight(int count) {
|
506
|
+
element_count_ -= count;
|
507
|
+
if (count >= kTOSKnownSmiMapSize) {
|
508
|
+
tos_known_smi_map_ = 0;
|
509
|
+
} else {
|
510
|
+
tos_known_smi_map_ >>= count;
|
511
|
+
}
|
512
|
+
}
|
513
|
+
|
514
|
+
inline void RaiseHeight(int count, unsigned known_smi_map = 0) {
|
515
|
+
ASSERT(known_smi_map < (1u << count));
|
516
|
+
element_count_ += count;
|
517
|
+
if (count >= kTOSKnownSmiMapSize) {
|
518
|
+
tos_known_smi_map_ = known_smi_map;
|
519
|
+
} else {
|
520
|
+
tos_known_smi_map_ = ((tos_known_smi_map_ << count) | known_smi_map);
|
521
|
+
}
|
522
|
+
}
|
541
523
|
friend class JumpTarget;
|
542
524
|
};
|
543
525
|
|