libv8-sgonyea 3.3.10
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +8 -0
- data/.gitmodules +3 -0
- data/Gemfile +4 -0
- data/README.md +76 -0
- data/Rakefile +113 -0
- data/ext/libv8/extconf.rb +28 -0
- data/lib/libv8.rb +15 -0
- data/lib/libv8/Makefile +30 -0
- data/lib/libv8/detect_cpu.rb +27 -0
- data/lib/libv8/fpic-on-linux-amd64.patch +13 -0
- data/lib/libv8/v8/.gitignore +35 -0
- data/lib/libv8/v8/AUTHORS +44 -0
- data/lib/libv8/v8/ChangeLog +2839 -0
- data/lib/libv8/v8/LICENSE +52 -0
- data/lib/libv8/v8/LICENSE.strongtalk +29 -0
- data/lib/libv8/v8/LICENSE.v8 +26 -0
- data/lib/libv8/v8/LICENSE.valgrind +45 -0
- data/lib/libv8/v8/SConstruct +1478 -0
- data/lib/libv8/v8/build/README.txt +49 -0
- data/lib/libv8/v8/build/all.gyp +18 -0
- data/lib/libv8/v8/build/armu.gypi +32 -0
- data/lib/libv8/v8/build/common.gypi +144 -0
- data/lib/libv8/v8/build/gyp_v8 +145 -0
- data/lib/libv8/v8/include/v8-debug.h +395 -0
- data/lib/libv8/v8/include/v8-preparser.h +117 -0
- data/lib/libv8/v8/include/v8-profiler.h +505 -0
- data/lib/libv8/v8/include/v8-testing.h +104 -0
- data/lib/libv8/v8/include/v8.h +4124 -0
- data/lib/libv8/v8/include/v8stdint.h +53 -0
- data/lib/libv8/v8/preparser/SConscript +38 -0
- data/lib/libv8/v8/preparser/preparser-process.cc +379 -0
- data/lib/libv8/v8/src/SConscript +368 -0
- data/lib/libv8/v8/src/accessors.cc +767 -0
- data/lib/libv8/v8/src/accessors.h +123 -0
- data/lib/libv8/v8/src/allocation-inl.h +49 -0
- data/lib/libv8/v8/src/allocation.cc +122 -0
- data/lib/libv8/v8/src/allocation.h +143 -0
- data/lib/libv8/v8/src/api.cc +5845 -0
- data/lib/libv8/v8/src/api.h +574 -0
- data/lib/libv8/v8/src/apinatives.js +110 -0
- data/lib/libv8/v8/src/apiutils.h +73 -0
- data/lib/libv8/v8/src/arguments.h +118 -0
- data/lib/libv8/v8/src/arm/assembler-arm-inl.h +353 -0
- data/lib/libv8/v8/src/arm/assembler-arm.cc +2661 -0
- data/lib/libv8/v8/src/arm/assembler-arm.h +1375 -0
- data/lib/libv8/v8/src/arm/builtins-arm.cc +1658 -0
- data/lib/libv8/v8/src/arm/code-stubs-arm.cc +6398 -0
- data/lib/libv8/v8/src/arm/code-stubs-arm.h +673 -0
- data/lib/libv8/v8/src/arm/codegen-arm.cc +52 -0
- data/lib/libv8/v8/src/arm/codegen-arm.h +91 -0
- data/lib/libv8/v8/src/arm/constants-arm.cc +152 -0
- data/lib/libv8/v8/src/arm/constants-arm.h +775 -0
- data/lib/libv8/v8/src/arm/cpu-arm.cc +120 -0
- data/lib/libv8/v8/src/arm/debug-arm.cc +317 -0
- data/lib/libv8/v8/src/arm/deoptimizer-arm.cc +754 -0
- data/lib/libv8/v8/src/arm/disasm-arm.cc +1506 -0
- data/lib/libv8/v8/src/arm/frames-arm.cc +45 -0
- data/lib/libv8/v8/src/arm/frames-arm.h +168 -0
- data/lib/libv8/v8/src/arm/full-codegen-arm.cc +4375 -0
- data/lib/libv8/v8/src/arm/ic-arm.cc +1562 -0
- data/lib/libv8/v8/src/arm/lithium-arm.cc +2206 -0
- data/lib/libv8/v8/src/arm/lithium-arm.h +2348 -0
- data/lib/libv8/v8/src/arm/lithium-codegen-arm.cc +4526 -0
- data/lib/libv8/v8/src/arm/lithium-codegen-arm.h +403 -0
- data/lib/libv8/v8/src/arm/lithium-gap-resolver-arm.cc +305 -0
- data/lib/libv8/v8/src/arm/lithium-gap-resolver-arm.h +84 -0
- data/lib/libv8/v8/src/arm/macro-assembler-arm.cc +3163 -0
- data/lib/libv8/v8/src/arm/macro-assembler-arm.h +1126 -0
- data/lib/libv8/v8/src/arm/regexp-macro-assembler-arm.cc +1287 -0
- data/lib/libv8/v8/src/arm/regexp-macro-assembler-arm.h +253 -0
- data/lib/libv8/v8/src/arm/simulator-arm.cc +3424 -0
- data/lib/libv8/v8/src/arm/simulator-arm.h +431 -0
- data/lib/libv8/v8/src/arm/stub-cache-arm.cc +4243 -0
- data/lib/libv8/v8/src/array.js +1366 -0
- data/lib/libv8/v8/src/assembler.cc +1207 -0
- data/lib/libv8/v8/src/assembler.h +858 -0
- data/lib/libv8/v8/src/ast-inl.h +112 -0
- data/lib/libv8/v8/src/ast.cc +1146 -0
- data/lib/libv8/v8/src/ast.h +2188 -0
- data/lib/libv8/v8/src/atomicops.h +167 -0
- data/lib/libv8/v8/src/atomicops_internals_arm_gcc.h +145 -0
- data/lib/libv8/v8/src/atomicops_internals_mips_gcc.h +169 -0
- data/lib/libv8/v8/src/atomicops_internals_x86_gcc.cc +133 -0
- data/lib/libv8/v8/src/atomicops_internals_x86_gcc.h +287 -0
- data/lib/libv8/v8/src/atomicops_internals_x86_macosx.h +301 -0
- data/lib/libv8/v8/src/atomicops_internals_x86_msvc.h +203 -0
- data/lib/libv8/v8/src/bignum-dtoa.cc +655 -0
- data/lib/libv8/v8/src/bignum-dtoa.h +81 -0
- data/lib/libv8/v8/src/bignum.cc +768 -0
- data/lib/libv8/v8/src/bignum.h +140 -0
- data/lib/libv8/v8/src/bootstrapper.cc +2184 -0
- data/lib/libv8/v8/src/bootstrapper.h +188 -0
- data/lib/libv8/v8/src/builtins.cc +1707 -0
- data/lib/libv8/v8/src/builtins.h +371 -0
- data/lib/libv8/v8/src/bytecodes-irregexp.h +105 -0
- data/lib/libv8/v8/src/cached-powers.cc +177 -0
- data/lib/libv8/v8/src/cached-powers.h +65 -0
- data/lib/libv8/v8/src/char-predicates-inl.h +94 -0
- data/lib/libv8/v8/src/char-predicates.h +67 -0
- data/lib/libv8/v8/src/checks.cc +110 -0
- data/lib/libv8/v8/src/checks.h +296 -0
- data/lib/libv8/v8/src/circular-queue-inl.h +53 -0
- data/lib/libv8/v8/src/circular-queue.cc +122 -0
- data/lib/libv8/v8/src/circular-queue.h +103 -0
- data/lib/libv8/v8/src/code-stubs.cc +267 -0
- data/lib/libv8/v8/src/code-stubs.h +1011 -0
- data/lib/libv8/v8/src/code.h +70 -0
- data/lib/libv8/v8/src/codegen.cc +231 -0
- data/lib/libv8/v8/src/codegen.h +84 -0
- data/lib/libv8/v8/src/compilation-cache.cc +540 -0
- data/lib/libv8/v8/src/compilation-cache.h +287 -0
- data/lib/libv8/v8/src/compiler.cc +786 -0
- data/lib/libv8/v8/src/compiler.h +312 -0
- data/lib/libv8/v8/src/contexts.cc +347 -0
- data/lib/libv8/v8/src/contexts.h +391 -0
- data/lib/libv8/v8/src/conversions-inl.h +106 -0
- data/lib/libv8/v8/src/conversions.cc +1131 -0
- data/lib/libv8/v8/src/conversions.h +135 -0
- data/lib/libv8/v8/src/counters.cc +93 -0
- data/lib/libv8/v8/src/counters.h +254 -0
- data/lib/libv8/v8/src/cpu-profiler-inl.h +101 -0
- data/lib/libv8/v8/src/cpu-profiler.cc +609 -0
- data/lib/libv8/v8/src/cpu-profiler.h +302 -0
- data/lib/libv8/v8/src/cpu.h +69 -0
- data/lib/libv8/v8/src/d8-debug.cc +367 -0
- data/lib/libv8/v8/src/d8-debug.h +158 -0
- data/lib/libv8/v8/src/d8-posix.cc +695 -0
- data/lib/libv8/v8/src/d8-readline.cc +130 -0
- data/lib/libv8/v8/src/d8-windows.cc +42 -0
- data/lib/libv8/v8/src/d8.cc +803 -0
- data/lib/libv8/v8/src/d8.gyp +91 -0
- data/lib/libv8/v8/src/d8.h +235 -0
- data/lib/libv8/v8/src/d8.js +2798 -0
- data/lib/libv8/v8/src/data-flow.cc +66 -0
- data/lib/libv8/v8/src/data-flow.h +205 -0
- data/lib/libv8/v8/src/date.js +1103 -0
- data/lib/libv8/v8/src/dateparser-inl.h +127 -0
- data/lib/libv8/v8/src/dateparser.cc +178 -0
- data/lib/libv8/v8/src/dateparser.h +266 -0
- data/lib/libv8/v8/src/debug-agent.cc +447 -0
- data/lib/libv8/v8/src/debug-agent.h +129 -0
- data/lib/libv8/v8/src/debug-debugger.js +2569 -0
- data/lib/libv8/v8/src/debug.cc +3165 -0
- data/lib/libv8/v8/src/debug.h +1057 -0
- data/lib/libv8/v8/src/deoptimizer.cc +1256 -0
- data/lib/libv8/v8/src/deoptimizer.h +602 -0
- data/lib/libv8/v8/src/disasm.h +80 -0
- data/lib/libv8/v8/src/disassembler.cc +343 -0
- data/lib/libv8/v8/src/disassembler.h +58 -0
- data/lib/libv8/v8/src/diy-fp.cc +58 -0
- data/lib/libv8/v8/src/diy-fp.h +117 -0
- data/lib/libv8/v8/src/double.h +238 -0
- data/lib/libv8/v8/src/dtoa.cc +103 -0
- data/lib/libv8/v8/src/dtoa.h +85 -0
- data/lib/libv8/v8/src/execution.cc +849 -0
- data/lib/libv8/v8/src/execution.h +297 -0
- data/lib/libv8/v8/src/extensions/experimental/break-iterator.cc +250 -0
- data/lib/libv8/v8/src/extensions/experimental/break-iterator.h +89 -0
- data/lib/libv8/v8/src/extensions/experimental/collator.cc +218 -0
- data/lib/libv8/v8/src/extensions/experimental/collator.h +69 -0
- data/lib/libv8/v8/src/extensions/experimental/experimental.gyp +94 -0
- data/lib/libv8/v8/src/extensions/experimental/i18n-extension.cc +78 -0
- data/lib/libv8/v8/src/extensions/experimental/i18n-extension.h +54 -0
- data/lib/libv8/v8/src/extensions/experimental/i18n-locale.cc +112 -0
- data/lib/libv8/v8/src/extensions/experimental/i18n-locale.h +60 -0
- data/lib/libv8/v8/src/extensions/experimental/i18n-utils.cc +43 -0
- data/lib/libv8/v8/src/extensions/experimental/i18n-utils.h +49 -0
- data/lib/libv8/v8/src/extensions/experimental/i18n.js +180 -0
- data/lib/libv8/v8/src/extensions/experimental/language-matcher.cc +251 -0
- data/lib/libv8/v8/src/extensions/experimental/language-matcher.h +95 -0
- data/lib/libv8/v8/src/extensions/externalize-string-extension.cc +141 -0
- data/lib/libv8/v8/src/extensions/externalize-string-extension.h +50 -0
- data/lib/libv8/v8/src/extensions/gc-extension.cc +58 -0
- data/lib/libv8/v8/src/extensions/gc-extension.h +49 -0
- data/lib/libv8/v8/src/factory.cc +1222 -0
- data/lib/libv8/v8/src/factory.h +442 -0
- data/lib/libv8/v8/src/fast-dtoa.cc +736 -0
- data/lib/libv8/v8/src/fast-dtoa.h +83 -0
- data/lib/libv8/v8/src/fixed-dtoa.cc +405 -0
- data/lib/libv8/v8/src/fixed-dtoa.h +55 -0
- data/lib/libv8/v8/src/flag-definitions.h +560 -0
- data/lib/libv8/v8/src/flags.cc +551 -0
- data/lib/libv8/v8/src/flags.h +79 -0
- data/lib/libv8/v8/src/frames-inl.h +247 -0
- data/lib/libv8/v8/src/frames.cc +1243 -0
- data/lib/libv8/v8/src/frames.h +870 -0
- data/lib/libv8/v8/src/full-codegen.cc +1374 -0
- data/lib/libv8/v8/src/full-codegen.h +771 -0
- data/lib/libv8/v8/src/func-name-inferrer.cc +92 -0
- data/lib/libv8/v8/src/func-name-inferrer.h +111 -0
- data/lib/libv8/v8/src/gdb-jit.cc +1555 -0
- data/lib/libv8/v8/src/gdb-jit.h +143 -0
- data/lib/libv8/v8/src/global-handles.cc +665 -0
- data/lib/libv8/v8/src/global-handles.h +284 -0
- data/lib/libv8/v8/src/globals.h +325 -0
- data/lib/libv8/v8/src/handles-inl.h +177 -0
- data/lib/libv8/v8/src/handles.cc +987 -0
- data/lib/libv8/v8/src/handles.h +382 -0
- data/lib/libv8/v8/src/hashmap.cc +230 -0
- data/lib/libv8/v8/src/hashmap.h +123 -0
- data/lib/libv8/v8/src/heap-inl.h +704 -0
- data/lib/libv8/v8/src/heap-profiler.cc +1173 -0
- data/lib/libv8/v8/src/heap-profiler.h +397 -0
- data/lib/libv8/v8/src/heap.cc +5930 -0
- data/lib/libv8/v8/src/heap.h +2268 -0
- data/lib/libv8/v8/src/hydrogen-instructions.cc +1769 -0
- data/lib/libv8/v8/src/hydrogen-instructions.h +3971 -0
- data/lib/libv8/v8/src/hydrogen.cc +6239 -0
- data/lib/libv8/v8/src/hydrogen.h +1202 -0
- data/lib/libv8/v8/src/ia32/assembler-ia32-inl.h +446 -0
- data/lib/libv8/v8/src/ia32/assembler-ia32.cc +2487 -0
- data/lib/libv8/v8/src/ia32/assembler-ia32.h +1144 -0
- data/lib/libv8/v8/src/ia32/builtins-ia32.cc +1621 -0
- data/lib/libv8/v8/src/ia32/code-stubs-ia32.cc +6198 -0
- data/lib/libv8/v8/src/ia32/code-stubs-ia32.h +517 -0
- data/lib/libv8/v8/src/ia32/codegen-ia32.cc +265 -0
- data/lib/libv8/v8/src/ia32/codegen-ia32.h +79 -0
- data/lib/libv8/v8/src/ia32/cpu-ia32.cc +88 -0
- data/lib/libv8/v8/src/ia32/debug-ia32.cc +312 -0
- data/lib/libv8/v8/src/ia32/deoptimizer-ia32.cc +774 -0
- data/lib/libv8/v8/src/ia32/disasm-ia32.cc +1628 -0
- data/lib/libv8/v8/src/ia32/frames-ia32.cc +45 -0
- data/lib/libv8/v8/src/ia32/frames-ia32.h +142 -0
- data/lib/libv8/v8/src/ia32/full-codegen-ia32.cc +4338 -0
- data/lib/libv8/v8/src/ia32/ic-ia32.cc +1597 -0
- data/lib/libv8/v8/src/ia32/lithium-codegen-ia32.cc +4461 -0
- data/lib/libv8/v8/src/ia32/lithium-codegen-ia32.h +375 -0
- data/lib/libv8/v8/src/ia32/lithium-gap-resolver-ia32.cc +475 -0
- data/lib/libv8/v8/src/ia32/lithium-gap-resolver-ia32.h +110 -0
- data/lib/libv8/v8/src/ia32/lithium-ia32.cc +2261 -0
- data/lib/libv8/v8/src/ia32/lithium-ia32.h +2396 -0
- data/lib/libv8/v8/src/ia32/macro-assembler-ia32.cc +2136 -0
- data/lib/libv8/v8/src/ia32/macro-assembler-ia32.h +775 -0
- data/lib/libv8/v8/src/ia32/regexp-macro-assembler-ia32.cc +1263 -0
- data/lib/libv8/v8/src/ia32/regexp-macro-assembler-ia32.h +216 -0
- data/lib/libv8/v8/src/ia32/simulator-ia32.cc +30 -0
- data/lib/libv8/v8/src/ia32/simulator-ia32.h +74 -0
- data/lib/libv8/v8/src/ia32/stub-cache-ia32.cc +3847 -0
- data/lib/libv8/v8/src/ic-inl.h +130 -0
- data/lib/libv8/v8/src/ic.cc +2577 -0
- data/lib/libv8/v8/src/ic.h +736 -0
- data/lib/libv8/v8/src/inspector.cc +63 -0
- data/lib/libv8/v8/src/inspector.h +62 -0
- data/lib/libv8/v8/src/interpreter-irregexp.cc +659 -0
- data/lib/libv8/v8/src/interpreter-irregexp.h +49 -0
- data/lib/libv8/v8/src/isolate-inl.h +50 -0
- data/lib/libv8/v8/src/isolate.cc +1869 -0
- data/lib/libv8/v8/src/isolate.h +1382 -0
- data/lib/libv8/v8/src/json-parser.cc +504 -0
- data/lib/libv8/v8/src/json-parser.h +161 -0
- data/lib/libv8/v8/src/json.js +342 -0
- data/lib/libv8/v8/src/jsregexp.cc +5385 -0
- data/lib/libv8/v8/src/jsregexp.h +1492 -0
- data/lib/libv8/v8/src/list-inl.h +212 -0
- data/lib/libv8/v8/src/list.h +174 -0
- data/lib/libv8/v8/src/lithium-allocator-inl.h +142 -0
- data/lib/libv8/v8/src/lithium-allocator.cc +2123 -0
- data/lib/libv8/v8/src/lithium-allocator.h +630 -0
- data/lib/libv8/v8/src/lithium.cc +190 -0
- data/lib/libv8/v8/src/lithium.h +597 -0
- data/lib/libv8/v8/src/liveedit-debugger.js +1082 -0
- data/lib/libv8/v8/src/liveedit.cc +1691 -0
- data/lib/libv8/v8/src/liveedit.h +180 -0
- data/lib/libv8/v8/src/liveobjectlist-inl.h +126 -0
- data/lib/libv8/v8/src/liveobjectlist.cc +2589 -0
- data/lib/libv8/v8/src/liveobjectlist.h +322 -0
- data/lib/libv8/v8/src/log-inl.h +59 -0
- data/lib/libv8/v8/src/log-utils.cc +428 -0
- data/lib/libv8/v8/src/log-utils.h +231 -0
- data/lib/libv8/v8/src/log.cc +1993 -0
- data/lib/libv8/v8/src/log.h +476 -0
- data/lib/libv8/v8/src/macro-assembler.h +120 -0
- data/lib/libv8/v8/src/macros.py +178 -0
- data/lib/libv8/v8/src/mark-compact.cc +3143 -0
- data/lib/libv8/v8/src/mark-compact.h +506 -0
- data/lib/libv8/v8/src/math.js +264 -0
- data/lib/libv8/v8/src/messages.cc +179 -0
- data/lib/libv8/v8/src/messages.h +113 -0
- data/lib/libv8/v8/src/messages.js +1096 -0
- data/lib/libv8/v8/src/mips/assembler-mips-inl.h +312 -0
- data/lib/libv8/v8/src/mips/assembler-mips.cc +1960 -0
- data/lib/libv8/v8/src/mips/assembler-mips.h +1138 -0
- data/lib/libv8/v8/src/mips/builtins-mips.cc +1628 -0
- data/lib/libv8/v8/src/mips/code-stubs-mips.cc +6656 -0
- data/lib/libv8/v8/src/mips/code-stubs-mips.h +682 -0
- data/lib/libv8/v8/src/mips/codegen-mips.cc +52 -0
- data/lib/libv8/v8/src/mips/codegen-mips.h +98 -0
- data/lib/libv8/v8/src/mips/constants-mips.cc +352 -0
- data/lib/libv8/v8/src/mips/constants-mips.h +739 -0
- data/lib/libv8/v8/src/mips/cpu-mips.cc +96 -0
- data/lib/libv8/v8/src/mips/debug-mips.cc +308 -0
- data/lib/libv8/v8/src/mips/deoptimizer-mips.cc +91 -0
- data/lib/libv8/v8/src/mips/disasm-mips.cc +1050 -0
- data/lib/libv8/v8/src/mips/frames-mips.cc +47 -0
- data/lib/libv8/v8/src/mips/frames-mips.h +219 -0
- data/lib/libv8/v8/src/mips/full-codegen-mips.cc +4388 -0
- data/lib/libv8/v8/src/mips/ic-mips.cc +1580 -0
- data/lib/libv8/v8/src/mips/lithium-codegen-mips.h +65 -0
- data/lib/libv8/v8/src/mips/lithium-mips.h +307 -0
- data/lib/libv8/v8/src/mips/macro-assembler-mips.cc +4056 -0
- data/lib/libv8/v8/src/mips/macro-assembler-mips.h +1214 -0
- data/lib/libv8/v8/src/mips/regexp-macro-assembler-mips.cc +1251 -0
- data/lib/libv8/v8/src/mips/regexp-macro-assembler-mips.h +252 -0
- data/lib/libv8/v8/src/mips/simulator-mips.cc +2621 -0
- data/lib/libv8/v8/src/mips/simulator-mips.h +401 -0
- data/lib/libv8/v8/src/mips/stub-cache-mips.cc +4285 -0
- data/lib/libv8/v8/src/mirror-debugger.js +2382 -0
- data/lib/libv8/v8/src/mksnapshot.cc +328 -0
- data/lib/libv8/v8/src/natives.h +64 -0
- data/lib/libv8/v8/src/objects-debug.cc +738 -0
- data/lib/libv8/v8/src/objects-inl.h +4323 -0
- data/lib/libv8/v8/src/objects-printer.cc +829 -0
- data/lib/libv8/v8/src/objects-visiting.cc +148 -0
- data/lib/libv8/v8/src/objects-visiting.h +424 -0
- data/lib/libv8/v8/src/objects.cc +10585 -0
- data/lib/libv8/v8/src/objects.h +6838 -0
- data/lib/libv8/v8/src/parser.cc +4997 -0
- data/lib/libv8/v8/src/parser.h +765 -0
- data/lib/libv8/v8/src/platform-cygwin.cc +779 -0
- data/lib/libv8/v8/src/platform-freebsd.cc +826 -0
- data/lib/libv8/v8/src/platform-linux.cc +1149 -0
- data/lib/libv8/v8/src/platform-macos.cc +830 -0
- data/lib/libv8/v8/src/platform-nullos.cc +479 -0
- data/lib/libv8/v8/src/platform-openbsd.cc +640 -0
- data/lib/libv8/v8/src/platform-posix.cc +424 -0
- data/lib/libv8/v8/src/platform-solaris.cc +762 -0
- data/lib/libv8/v8/src/platform-tls-mac.h +62 -0
- data/lib/libv8/v8/src/platform-tls-win32.h +62 -0
- data/lib/libv8/v8/src/platform-tls.h +50 -0
- data/lib/libv8/v8/src/platform-win32.cc +2021 -0
- data/lib/libv8/v8/src/platform.h +667 -0
- data/lib/libv8/v8/src/preparse-data-format.h +62 -0
- data/lib/libv8/v8/src/preparse-data.cc +183 -0
- data/lib/libv8/v8/src/preparse-data.h +225 -0
- data/lib/libv8/v8/src/preparser-api.cc +220 -0
- data/lib/libv8/v8/src/preparser.cc +1450 -0
- data/lib/libv8/v8/src/preparser.h +493 -0
- data/lib/libv8/v8/src/prettyprinter.cc +1493 -0
- data/lib/libv8/v8/src/prettyprinter.h +223 -0
- data/lib/libv8/v8/src/profile-generator-inl.h +128 -0
- data/lib/libv8/v8/src/profile-generator.cc +3098 -0
- data/lib/libv8/v8/src/profile-generator.h +1126 -0
- data/lib/libv8/v8/src/property.cc +105 -0
- data/lib/libv8/v8/src/property.h +365 -0
- data/lib/libv8/v8/src/proxy.js +83 -0
- data/lib/libv8/v8/src/regexp-macro-assembler-irregexp-inl.h +78 -0
- data/lib/libv8/v8/src/regexp-macro-assembler-irregexp.cc +471 -0
- data/lib/libv8/v8/src/regexp-macro-assembler-irregexp.h +142 -0
- data/lib/libv8/v8/src/regexp-macro-assembler-tracer.cc +373 -0
- data/lib/libv8/v8/src/regexp-macro-assembler-tracer.h +104 -0
- data/lib/libv8/v8/src/regexp-macro-assembler.cc +267 -0
- data/lib/libv8/v8/src/regexp-macro-assembler.h +243 -0
- data/lib/libv8/v8/src/regexp-stack.cc +111 -0
- data/lib/libv8/v8/src/regexp-stack.h +147 -0
- data/lib/libv8/v8/src/regexp.js +483 -0
- data/lib/libv8/v8/src/rewriter.cc +360 -0
- data/lib/libv8/v8/src/rewriter.h +50 -0
- data/lib/libv8/v8/src/runtime-profiler.cc +489 -0
- data/lib/libv8/v8/src/runtime-profiler.h +201 -0
- data/lib/libv8/v8/src/runtime.cc +12227 -0
- data/lib/libv8/v8/src/runtime.h +652 -0
- data/lib/libv8/v8/src/runtime.js +649 -0
- data/lib/libv8/v8/src/safepoint-table.cc +256 -0
- data/lib/libv8/v8/src/safepoint-table.h +270 -0
- data/lib/libv8/v8/src/scanner-base.cc +952 -0
- data/lib/libv8/v8/src/scanner-base.h +670 -0
- data/lib/libv8/v8/src/scanner.cc +345 -0
- data/lib/libv8/v8/src/scanner.h +146 -0
- data/lib/libv8/v8/src/scopeinfo.cc +646 -0
- data/lib/libv8/v8/src/scopeinfo.h +254 -0
- data/lib/libv8/v8/src/scopes.cc +1150 -0
- data/lib/libv8/v8/src/scopes.h +507 -0
- data/lib/libv8/v8/src/serialize.cc +1574 -0
- data/lib/libv8/v8/src/serialize.h +589 -0
- data/lib/libv8/v8/src/shell.h +55 -0
- data/lib/libv8/v8/src/simulator.h +43 -0
- data/lib/libv8/v8/src/small-pointer-list.h +163 -0
- data/lib/libv8/v8/src/smart-pointer.h +109 -0
- data/lib/libv8/v8/src/snapshot-common.cc +83 -0
- data/lib/libv8/v8/src/snapshot-empty.cc +54 -0
- data/lib/libv8/v8/src/snapshot.h +91 -0
- data/lib/libv8/v8/src/spaces-inl.h +529 -0
- data/lib/libv8/v8/src/spaces.cc +3145 -0
- data/lib/libv8/v8/src/spaces.h +2369 -0
- data/lib/libv8/v8/src/splay-tree-inl.h +310 -0
- data/lib/libv8/v8/src/splay-tree.h +205 -0
- data/lib/libv8/v8/src/string-search.cc +41 -0
- data/lib/libv8/v8/src/string-search.h +568 -0
- data/lib/libv8/v8/src/string-stream.cc +592 -0
- data/lib/libv8/v8/src/string-stream.h +191 -0
- data/lib/libv8/v8/src/string.js +994 -0
- data/lib/libv8/v8/src/strtod.cc +440 -0
- data/lib/libv8/v8/src/strtod.h +40 -0
- data/lib/libv8/v8/src/stub-cache.cc +1965 -0
- data/lib/libv8/v8/src/stub-cache.h +924 -0
- data/lib/libv8/v8/src/third_party/valgrind/valgrind.h +3925 -0
- data/lib/libv8/v8/src/token.cc +63 -0
- data/lib/libv8/v8/src/token.h +288 -0
- data/lib/libv8/v8/src/type-info.cc +507 -0
- data/lib/libv8/v8/src/type-info.h +272 -0
- data/lib/libv8/v8/src/unbound-queue-inl.h +95 -0
- data/lib/libv8/v8/src/unbound-queue.h +69 -0
- data/lib/libv8/v8/src/unicode-inl.h +238 -0
- data/lib/libv8/v8/src/unicode.cc +1624 -0
- data/lib/libv8/v8/src/unicode.h +280 -0
- data/lib/libv8/v8/src/uri.js +408 -0
- data/lib/libv8/v8/src/utils-inl.h +48 -0
- data/lib/libv8/v8/src/utils.cc +371 -0
- data/lib/libv8/v8/src/utils.h +800 -0
- data/lib/libv8/v8/src/v8-counters.cc +62 -0
- data/lib/libv8/v8/src/v8-counters.h +314 -0
- data/lib/libv8/v8/src/v8.cc +213 -0
- data/lib/libv8/v8/src/v8.h +131 -0
- data/lib/libv8/v8/src/v8checks.h +64 -0
- data/lib/libv8/v8/src/v8dll-main.cc +44 -0
- data/lib/libv8/v8/src/v8globals.h +512 -0
- data/lib/libv8/v8/src/v8memory.h +82 -0
- data/lib/libv8/v8/src/v8natives.js +1310 -0
- data/lib/libv8/v8/src/v8preparserdll-main.cc +39 -0
- data/lib/libv8/v8/src/v8threads.cc +464 -0
- data/lib/libv8/v8/src/v8threads.h +165 -0
- data/lib/libv8/v8/src/v8utils.h +319 -0
- data/lib/libv8/v8/src/variables.cc +114 -0
- data/lib/libv8/v8/src/variables.h +167 -0
- data/lib/libv8/v8/src/version.cc +116 -0
- data/lib/libv8/v8/src/version.h +68 -0
- data/lib/libv8/v8/src/vm-state-inl.h +138 -0
- data/lib/libv8/v8/src/vm-state.h +71 -0
- data/lib/libv8/v8/src/win32-headers.h +96 -0
- data/lib/libv8/v8/src/x64/assembler-x64-inl.h +462 -0
- data/lib/libv8/v8/src/x64/assembler-x64.cc +3027 -0
- data/lib/libv8/v8/src/x64/assembler-x64.h +1633 -0
- data/lib/libv8/v8/src/x64/builtins-x64.cc +1520 -0
- data/lib/libv8/v8/src/x64/code-stubs-x64.cc +5132 -0
- data/lib/libv8/v8/src/x64/code-stubs-x64.h +514 -0
- data/lib/libv8/v8/src/x64/codegen-x64.cc +146 -0
- data/lib/libv8/v8/src/x64/codegen-x64.h +76 -0
- data/lib/libv8/v8/src/x64/cpu-x64.cc +88 -0
- data/lib/libv8/v8/src/x64/debug-x64.cc +319 -0
- data/lib/libv8/v8/src/x64/deoptimizer-x64.cc +815 -0
- data/lib/libv8/v8/src/x64/disasm-x64.cc +1832 -0
- data/lib/libv8/v8/src/x64/frames-x64.cc +45 -0
- data/lib/libv8/v8/src/x64/frames-x64.h +130 -0
- data/lib/libv8/v8/src/x64/full-codegen-x64.cc +4318 -0
- data/lib/libv8/v8/src/x64/ic-x64.cc +1608 -0
- data/lib/libv8/v8/src/x64/lithium-codegen-x64.cc +4267 -0
- data/lib/libv8/v8/src/x64/lithium-codegen-x64.h +367 -0
- data/lib/libv8/v8/src/x64/lithium-gap-resolver-x64.cc +320 -0
- data/lib/libv8/v8/src/x64/lithium-gap-resolver-x64.h +74 -0
- data/lib/libv8/v8/src/x64/lithium-x64.cc +2202 -0
- data/lib/libv8/v8/src/x64/lithium-x64.h +2333 -0
- data/lib/libv8/v8/src/x64/macro-assembler-x64.cc +3745 -0
- data/lib/libv8/v8/src/x64/macro-assembler-x64.h +1290 -0
- data/lib/libv8/v8/src/x64/regexp-macro-assembler-x64.cc +1398 -0
- data/lib/libv8/v8/src/x64/regexp-macro-assembler-x64.h +282 -0
- data/lib/libv8/v8/src/x64/simulator-x64.cc +27 -0
- data/lib/libv8/v8/src/x64/simulator-x64.h +72 -0
- data/lib/libv8/v8/src/x64/stub-cache-x64.cc +3610 -0
- data/lib/libv8/v8/src/zone-inl.h +140 -0
- data/lib/libv8/v8/src/zone.cc +196 -0
- data/lib/libv8/v8/src/zone.h +240 -0
- data/lib/libv8/v8/tools/codemap.js +265 -0
- data/lib/libv8/v8/tools/consarray.js +93 -0
- data/lib/libv8/v8/tools/csvparser.js +78 -0
- data/lib/libv8/v8/tools/disasm.py +92 -0
- data/lib/libv8/v8/tools/freebsd-tick-processor +10 -0
- data/lib/libv8/v8/tools/gc-nvp-trace-processor.py +342 -0
- data/lib/libv8/v8/tools/gcmole/README +62 -0
- data/lib/libv8/v8/tools/gcmole/gccause.lua +60 -0
- data/lib/libv8/v8/tools/gcmole/gcmole.cc +1261 -0
- data/lib/libv8/v8/tools/gcmole/gcmole.lua +378 -0
- data/lib/libv8/v8/tools/generate-ten-powers.scm +286 -0
- data/lib/libv8/v8/tools/grokdump.py +841 -0
- data/lib/libv8/v8/tools/gyp/v8.gyp +995 -0
- data/lib/libv8/v8/tools/js2c.py +364 -0
- data/lib/libv8/v8/tools/jsmin.py +280 -0
- data/lib/libv8/v8/tools/linux-tick-processor +35 -0
- data/lib/libv8/v8/tools/ll_prof.py +942 -0
- data/lib/libv8/v8/tools/logreader.js +185 -0
- data/lib/libv8/v8/tools/mac-nm +18 -0
- data/lib/libv8/v8/tools/mac-tick-processor +6 -0
- data/lib/libv8/v8/tools/oom_dump/README +31 -0
- data/lib/libv8/v8/tools/oom_dump/SConstruct +42 -0
- data/lib/libv8/v8/tools/oom_dump/oom_dump.cc +288 -0
- data/lib/libv8/v8/tools/presubmit.py +305 -0
- data/lib/libv8/v8/tools/process-heap-prof.py +120 -0
- data/lib/libv8/v8/tools/profile.js +751 -0
- data/lib/libv8/v8/tools/profile_view.js +219 -0
- data/lib/libv8/v8/tools/run-valgrind.py +77 -0
- data/lib/libv8/v8/tools/splaytree.js +316 -0
- data/lib/libv8/v8/tools/stats-viewer.py +468 -0
- data/lib/libv8/v8/tools/test.py +1510 -0
- data/lib/libv8/v8/tools/tickprocessor-driver.js +59 -0
- data/lib/libv8/v8/tools/tickprocessor.js +877 -0
- data/lib/libv8/v8/tools/utils.py +96 -0
- data/lib/libv8/v8/tools/visual_studio/README.txt +12 -0
- data/lib/libv8/v8/tools/windows-tick-processor.bat +30 -0
- data/lib/libv8/version.rb +5 -0
- data/libv8.gemspec +36 -0
- metadata +578 -0
@@ -0,0 +1,265 @@
|
|
1
|
+
// Copyright 2011 the V8 project authors. All rights reserved.
|
2
|
+
// Redistribution and use in source and binary forms, with or without
|
3
|
+
// modification, are permitted provided that the following conditions are
|
4
|
+
// met:
|
5
|
+
//
|
6
|
+
// * Redistributions of source code must retain the above copyright
|
7
|
+
// notice, this list of conditions and the following disclaimer.
|
8
|
+
// * Redistributions in binary form must reproduce the above
|
9
|
+
// copyright notice, this list of conditions and the following
|
10
|
+
// disclaimer in the documentation and/or other materials provided
|
11
|
+
// with the distribution.
|
12
|
+
// * Neither the name of Google Inc. nor the names of its
|
13
|
+
// contributors may be used to endorse or promote products derived
|
14
|
+
// from this software without specific prior written permission.
|
15
|
+
//
|
16
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
17
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
18
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
19
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
20
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
21
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
22
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
23
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
24
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
25
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
26
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27
|
+
|
28
|
+
#include "v8.h"
|
29
|
+
|
30
|
+
#if defined(V8_TARGET_ARCH_IA32)
|
31
|
+
|
32
|
+
#include "codegen.h"
|
33
|
+
|
34
|
+
namespace v8 {
|
35
|
+
namespace internal {
|
36
|
+
|
37
|
+
|
38
|
+
// -------------------------------------------------------------------------
|
39
|
+
// Platform-specific RuntimeCallHelper functions.
|
40
|
+
|
41
|
+
void StubRuntimeCallHelper::BeforeCall(MacroAssembler* masm) const {
|
42
|
+
masm->EnterInternalFrame();
|
43
|
+
}
|
44
|
+
|
45
|
+
|
46
|
+
void StubRuntimeCallHelper::AfterCall(MacroAssembler* masm) const {
|
47
|
+
masm->LeaveInternalFrame();
|
48
|
+
}
|
49
|
+
|
50
|
+
|
51
|
+
#define __ masm.
|
52
|
+
|
53
|
+
static void MemCopyWrapper(void* dest, const void* src, size_t size) {
|
54
|
+
memcpy(dest, src, size);
|
55
|
+
}
|
56
|
+
|
57
|
+
|
58
|
+
OS::MemCopyFunction CreateMemCopyFunction() {
|
59
|
+
size_t actual_size;
|
60
|
+
// Allocate buffer in executable space.
|
61
|
+
byte* buffer = static_cast<byte*>(OS::Allocate(1 * KB,
|
62
|
+
&actual_size,
|
63
|
+
true));
|
64
|
+
if (buffer == NULL) return &MemCopyWrapper;
|
65
|
+
MacroAssembler masm(NULL, buffer, static_cast<int>(actual_size));
|
66
|
+
|
67
|
+
// Generated code is put into a fixed, unmovable, buffer, and not into
|
68
|
+
// the V8 heap. We can't, and don't, refer to any relocatable addresses
|
69
|
+
// (e.g. the JavaScript nan-object).
|
70
|
+
|
71
|
+
// 32-bit C declaration function calls pass arguments on stack.
|
72
|
+
|
73
|
+
// Stack layout:
|
74
|
+
// esp[12]: Third argument, size.
|
75
|
+
// esp[8]: Second argument, source pointer.
|
76
|
+
// esp[4]: First argument, destination pointer.
|
77
|
+
// esp[0]: return address
|
78
|
+
|
79
|
+
const int kDestinationOffset = 1 * kPointerSize;
|
80
|
+
const int kSourceOffset = 2 * kPointerSize;
|
81
|
+
const int kSizeOffset = 3 * kPointerSize;
|
82
|
+
|
83
|
+
int stack_offset = 0; // Update if we change the stack height.
|
84
|
+
|
85
|
+
if (FLAG_debug_code) {
|
86
|
+
__ cmp(Operand(esp, kSizeOffset + stack_offset),
|
87
|
+
Immediate(OS::kMinComplexMemCopy));
|
88
|
+
Label ok;
|
89
|
+
__ j(greater_equal, &ok);
|
90
|
+
__ int3();
|
91
|
+
__ bind(&ok);
|
92
|
+
}
|
93
|
+
if (CpuFeatures::IsSupported(SSE2)) {
|
94
|
+
CpuFeatures::Scope enable(SSE2);
|
95
|
+
__ push(edi);
|
96
|
+
__ push(esi);
|
97
|
+
stack_offset += 2 * kPointerSize;
|
98
|
+
Register dst = edi;
|
99
|
+
Register src = esi;
|
100
|
+
Register count = ecx;
|
101
|
+
__ mov(dst, Operand(esp, stack_offset + kDestinationOffset));
|
102
|
+
__ mov(src, Operand(esp, stack_offset + kSourceOffset));
|
103
|
+
__ mov(count, Operand(esp, stack_offset + kSizeOffset));
|
104
|
+
|
105
|
+
|
106
|
+
__ movdqu(xmm0, Operand(src, 0));
|
107
|
+
__ movdqu(Operand(dst, 0), xmm0);
|
108
|
+
__ mov(edx, dst);
|
109
|
+
__ and_(edx, 0xF);
|
110
|
+
__ neg(edx);
|
111
|
+
__ add(Operand(edx), Immediate(16));
|
112
|
+
__ add(dst, Operand(edx));
|
113
|
+
__ add(src, Operand(edx));
|
114
|
+
__ sub(Operand(count), edx);
|
115
|
+
|
116
|
+
// edi is now aligned. Check if esi is also aligned.
|
117
|
+
Label unaligned_source;
|
118
|
+
__ test(Operand(src), Immediate(0x0F));
|
119
|
+
__ j(not_zero, &unaligned_source);
|
120
|
+
{
|
121
|
+
// Copy loop for aligned source and destination.
|
122
|
+
__ mov(edx, count);
|
123
|
+
Register loop_count = ecx;
|
124
|
+
Register count = edx;
|
125
|
+
__ shr(loop_count, 5);
|
126
|
+
{
|
127
|
+
// Main copy loop.
|
128
|
+
Label loop;
|
129
|
+
__ bind(&loop);
|
130
|
+
__ prefetch(Operand(src, 0x20), 1);
|
131
|
+
__ movdqa(xmm0, Operand(src, 0x00));
|
132
|
+
__ movdqa(xmm1, Operand(src, 0x10));
|
133
|
+
__ add(Operand(src), Immediate(0x20));
|
134
|
+
|
135
|
+
__ movdqa(Operand(dst, 0x00), xmm0);
|
136
|
+
__ movdqa(Operand(dst, 0x10), xmm1);
|
137
|
+
__ add(Operand(dst), Immediate(0x20));
|
138
|
+
|
139
|
+
__ dec(loop_count);
|
140
|
+
__ j(not_zero, &loop);
|
141
|
+
}
|
142
|
+
|
143
|
+
// At most 31 bytes to copy.
|
144
|
+
Label move_less_16;
|
145
|
+
__ test(Operand(count), Immediate(0x10));
|
146
|
+
__ j(zero, &move_less_16);
|
147
|
+
__ movdqa(xmm0, Operand(src, 0));
|
148
|
+
__ add(Operand(src), Immediate(0x10));
|
149
|
+
__ movdqa(Operand(dst, 0), xmm0);
|
150
|
+
__ add(Operand(dst), Immediate(0x10));
|
151
|
+
__ bind(&move_less_16);
|
152
|
+
|
153
|
+
// At most 15 bytes to copy. Copy 16 bytes at end of string.
|
154
|
+
__ and_(count, 0xF);
|
155
|
+
__ movdqu(xmm0, Operand(src, count, times_1, -0x10));
|
156
|
+
__ movdqu(Operand(dst, count, times_1, -0x10), xmm0);
|
157
|
+
|
158
|
+
__ mov(eax, Operand(esp, stack_offset + kDestinationOffset));
|
159
|
+
__ pop(esi);
|
160
|
+
__ pop(edi);
|
161
|
+
__ ret(0);
|
162
|
+
}
|
163
|
+
__ Align(16);
|
164
|
+
{
|
165
|
+
// Copy loop for unaligned source and aligned destination.
|
166
|
+
// If source is not aligned, we can't read it as efficiently.
|
167
|
+
__ bind(&unaligned_source);
|
168
|
+
__ mov(edx, ecx);
|
169
|
+
Register loop_count = ecx;
|
170
|
+
Register count = edx;
|
171
|
+
__ shr(loop_count, 5);
|
172
|
+
{
|
173
|
+
// Main copy loop
|
174
|
+
Label loop;
|
175
|
+
__ bind(&loop);
|
176
|
+
__ prefetch(Operand(src, 0x20), 1);
|
177
|
+
__ movdqu(xmm0, Operand(src, 0x00));
|
178
|
+
__ movdqu(xmm1, Operand(src, 0x10));
|
179
|
+
__ add(Operand(src), Immediate(0x20));
|
180
|
+
|
181
|
+
__ movdqa(Operand(dst, 0x00), xmm0);
|
182
|
+
__ movdqa(Operand(dst, 0x10), xmm1);
|
183
|
+
__ add(Operand(dst), Immediate(0x20));
|
184
|
+
|
185
|
+
__ dec(loop_count);
|
186
|
+
__ j(not_zero, &loop);
|
187
|
+
}
|
188
|
+
|
189
|
+
// At most 31 bytes to copy.
|
190
|
+
Label move_less_16;
|
191
|
+
__ test(Operand(count), Immediate(0x10));
|
192
|
+
__ j(zero, &move_less_16);
|
193
|
+
__ movdqu(xmm0, Operand(src, 0));
|
194
|
+
__ add(Operand(src), Immediate(0x10));
|
195
|
+
__ movdqa(Operand(dst, 0), xmm0);
|
196
|
+
__ add(Operand(dst), Immediate(0x10));
|
197
|
+
__ bind(&move_less_16);
|
198
|
+
|
199
|
+
// At most 15 bytes to copy. Copy 16 bytes at end of string.
|
200
|
+
__ and_(count, 0x0F);
|
201
|
+
__ movdqu(xmm0, Operand(src, count, times_1, -0x10));
|
202
|
+
__ movdqu(Operand(dst, count, times_1, -0x10), xmm0);
|
203
|
+
|
204
|
+
__ mov(eax, Operand(esp, stack_offset + kDestinationOffset));
|
205
|
+
__ pop(esi);
|
206
|
+
__ pop(edi);
|
207
|
+
__ ret(0);
|
208
|
+
}
|
209
|
+
|
210
|
+
} else {
|
211
|
+
// SSE2 not supported. Unlikely to happen in practice.
|
212
|
+
__ push(edi);
|
213
|
+
__ push(esi);
|
214
|
+
stack_offset += 2 * kPointerSize;
|
215
|
+
__ cld();
|
216
|
+
Register dst = edi;
|
217
|
+
Register src = esi;
|
218
|
+
Register count = ecx;
|
219
|
+
__ mov(dst, Operand(esp, stack_offset + kDestinationOffset));
|
220
|
+
__ mov(src, Operand(esp, stack_offset + kSourceOffset));
|
221
|
+
__ mov(count, Operand(esp, stack_offset + kSizeOffset));
|
222
|
+
|
223
|
+
// Copy the first word.
|
224
|
+
__ mov(eax, Operand(src, 0));
|
225
|
+
__ mov(Operand(dst, 0), eax);
|
226
|
+
|
227
|
+
// Increment src,dstso that dst is aligned.
|
228
|
+
__ mov(edx, dst);
|
229
|
+
__ and_(edx, 0x03);
|
230
|
+
__ neg(edx);
|
231
|
+
__ add(Operand(edx), Immediate(4)); // edx = 4 - (dst & 3)
|
232
|
+
__ add(dst, Operand(edx));
|
233
|
+
__ add(src, Operand(edx));
|
234
|
+
__ sub(Operand(count), edx);
|
235
|
+
// edi is now aligned, ecx holds number of remaning bytes to copy.
|
236
|
+
|
237
|
+
__ mov(edx, count);
|
238
|
+
count = edx;
|
239
|
+
__ shr(ecx, 2); // Make word count instead of byte count.
|
240
|
+
__ rep_movs();
|
241
|
+
|
242
|
+
// At most 3 bytes left to copy. Copy 4 bytes at end of string.
|
243
|
+
__ and_(count, 3);
|
244
|
+
__ mov(eax, Operand(src, count, times_1, -4));
|
245
|
+
__ mov(Operand(dst, count, times_1, -4), eax);
|
246
|
+
|
247
|
+
__ mov(eax, Operand(esp, stack_offset + kDestinationOffset));
|
248
|
+
__ pop(esi);
|
249
|
+
__ pop(edi);
|
250
|
+
__ ret(0);
|
251
|
+
}
|
252
|
+
|
253
|
+
CodeDesc desc;
|
254
|
+
masm.GetCode(&desc);
|
255
|
+
ASSERT(desc.reloc_size == 0);
|
256
|
+
|
257
|
+
CPU::FlushICache(buffer, actual_size);
|
258
|
+
return FUNCTION_CAST<OS::MemCopyFunction>(buffer);
|
259
|
+
}
|
260
|
+
|
261
|
+
#undef __
|
262
|
+
|
263
|
+
} } // namespace v8::internal
|
264
|
+
|
265
|
+
#endif // V8_TARGET_ARCH_IA32
|
@@ -0,0 +1,79 @@
|
|
1
|
+
// Copyright 2011 the V8 project authors. All rights reserved.
|
2
|
+
// Redistribution and use in source and binary forms, with or without
|
3
|
+
// modification, are permitted provided that the following conditions are
|
4
|
+
// met:
|
5
|
+
//
|
6
|
+
// * Redistributions of source code must retain the above copyright
|
7
|
+
// notice, this list of conditions and the following disclaimer.
|
8
|
+
// * Redistributions in binary form must reproduce the above
|
9
|
+
// copyright notice, this list of conditions and the following
|
10
|
+
// disclaimer in the documentation and/or other materials provided
|
11
|
+
// with the distribution.
|
12
|
+
// * Neither the name of Google Inc. nor the names of its
|
13
|
+
// contributors may be used to endorse or promote products derived
|
14
|
+
// from this software without specific prior written permission.
|
15
|
+
//
|
16
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
17
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
18
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
19
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
20
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
21
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
22
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
23
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
24
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
25
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
26
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27
|
+
|
28
|
+
#ifndef V8_IA32_CODEGEN_IA32_H_
|
29
|
+
#define V8_IA32_CODEGEN_IA32_H_
|
30
|
+
|
31
|
+
#include "ast.h"
|
32
|
+
#include "ic-inl.h"
|
33
|
+
|
34
|
+
namespace v8 {
|
35
|
+
namespace internal {
|
36
|
+
|
37
|
+
// Forward declarations
|
38
|
+
class CompilationInfo;
|
39
|
+
|
40
|
+
// -------------------------------------------------------------------------
|
41
|
+
// CodeGenerator
|
42
|
+
|
43
|
+
class CodeGenerator {
|
44
|
+
public:
|
45
|
+
// Printing of AST, etc. as requested by flags.
|
46
|
+
static void MakeCodePrologue(CompilationInfo* info);
|
47
|
+
|
48
|
+
// Allocate and install the code.
|
49
|
+
static Handle<Code> MakeCodeEpilogue(MacroAssembler* masm,
|
50
|
+
Code::Flags flags,
|
51
|
+
CompilationInfo* info);
|
52
|
+
|
53
|
+
// Print the code after compiling it.
|
54
|
+
static void PrintCode(Handle<Code> code, CompilationInfo* info);
|
55
|
+
|
56
|
+
#ifdef ENABLE_LOGGING_AND_PROFILING
|
57
|
+
static bool ShouldGenerateLog(Expression* type);
|
58
|
+
#endif
|
59
|
+
|
60
|
+
static bool RecordPositions(MacroAssembler* masm,
|
61
|
+
int pos,
|
62
|
+
bool right_here = false);
|
63
|
+
|
64
|
+
|
65
|
+
static Operand FixedArrayElementOperand(Register array,
|
66
|
+
Register index_as_smi,
|
67
|
+
int additional_offset = 0) {
|
68
|
+
int offset = FixedArray::kHeaderSize + additional_offset * kPointerSize;
|
69
|
+
return FieldOperand(array, index_as_smi, times_half_pointer_size, offset);
|
70
|
+
}
|
71
|
+
|
72
|
+
private:
|
73
|
+
DISALLOW_COPY_AND_ASSIGN(CodeGenerator);
|
74
|
+
};
|
75
|
+
|
76
|
+
|
77
|
+
} } // namespace v8::internal
|
78
|
+
|
79
|
+
#endif // V8_IA32_CODEGEN_IA32_H_
|
@@ -0,0 +1,88 @@
|
|
1
|
+
// Copyright 2006-2008 the V8 project authors. All rights reserved.
|
2
|
+
// Redistribution and use in source and binary forms, with or without
|
3
|
+
// modification, are permitted provided that the following conditions are
|
4
|
+
// met:
|
5
|
+
//
|
6
|
+
// * Redistributions of source code must retain the above copyright
|
7
|
+
// notice, this list of conditions and the following disclaimer.
|
8
|
+
// * Redistributions in binary form must reproduce the above
|
9
|
+
// copyright notice, this list of conditions and the following
|
10
|
+
// disclaimer in the documentation and/or other materials provided
|
11
|
+
// with the distribution.
|
12
|
+
// * Neither the name of Google Inc. nor the names of its
|
13
|
+
// contributors may be used to endorse or promote products derived
|
14
|
+
// from this software without specific prior written permission.
|
15
|
+
//
|
16
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
17
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
18
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
19
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
20
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
21
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
22
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
23
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
24
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
25
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
26
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27
|
+
|
28
|
+
// CPU specific code for ia32 independent of OS goes here.
|
29
|
+
|
30
|
+
#ifdef __GNUC__
|
31
|
+
#include "third_party/valgrind/valgrind.h"
|
32
|
+
#endif
|
33
|
+
|
34
|
+
#include "v8.h"
|
35
|
+
|
36
|
+
#if defined(V8_TARGET_ARCH_IA32)
|
37
|
+
|
38
|
+
#include "cpu.h"
|
39
|
+
#include "macro-assembler.h"
|
40
|
+
|
41
|
+
namespace v8 {
|
42
|
+
namespace internal {
|
43
|
+
|
44
|
+
void CPU::Setup() {
|
45
|
+
CpuFeatures::Probe();
|
46
|
+
}
|
47
|
+
|
48
|
+
|
49
|
+
bool CPU::SupportsCrankshaft() {
|
50
|
+
return CpuFeatures::IsSupported(SSE2);
|
51
|
+
}
|
52
|
+
|
53
|
+
|
54
|
+
void CPU::FlushICache(void* start, size_t size) {
|
55
|
+
// No need to flush the instruction cache on Intel. On Intel instruction
|
56
|
+
// cache flushing is only necessary when multiple cores running the same
|
57
|
+
// code simultaneously. V8 (and JavaScript) is single threaded and when code
|
58
|
+
// is patched on an intel CPU the core performing the patching will have its
|
59
|
+
// own instruction cache updated automatically.
|
60
|
+
|
61
|
+
// If flushing of the instruction cache becomes necessary Windows has the
|
62
|
+
// API function FlushInstructionCache.
|
63
|
+
|
64
|
+
// By default, valgrind only checks the stack for writes that might need to
|
65
|
+
// invalidate already cached translated code. This leads to random
|
66
|
+
// instability when code patches or moves are sometimes unnoticed. One
|
67
|
+
// solution is to run valgrind with --smc-check=all, but this comes at a big
|
68
|
+
// performance cost. We can notify valgrind to invalidate its cache.
|
69
|
+
#ifdef VALGRIND_DISCARD_TRANSLATIONS
|
70
|
+
VALGRIND_DISCARD_TRANSLATIONS(start, size);
|
71
|
+
#endif
|
72
|
+
}
|
73
|
+
|
74
|
+
|
75
|
+
void CPU::DebugBreak() {
|
76
|
+
#ifdef _MSC_VER
|
77
|
+
// To avoid Visual Studio runtime support the following code can be used
|
78
|
+
// instead
|
79
|
+
// __asm { int 3 }
|
80
|
+
__debugbreak();
|
81
|
+
#else
|
82
|
+
asm("int $3");
|
83
|
+
#endif
|
84
|
+
}
|
85
|
+
|
86
|
+
} } // namespace v8::internal
|
87
|
+
|
88
|
+
#endif // V8_TARGET_ARCH_IA32
|
@@ -0,0 +1,312 @@
|
|
1
|
+
// Copyright 2011 the V8 project authors. All rights reserved.
|
2
|
+
// Redistribution and use in source and binary forms, with or without
|
3
|
+
// modification, are permitted provided that the following conditions are
|
4
|
+
// met:
|
5
|
+
//
|
6
|
+
// * Redistributions of source code must retain the above copyright
|
7
|
+
// notice, this list of conditions and the following disclaimer.
|
8
|
+
// * Redistributions in binary form must reproduce the above
|
9
|
+
// copyright notice, this list of conditions and the following
|
10
|
+
// disclaimer in the documentation and/or other materials provided
|
11
|
+
// with the distribution.
|
12
|
+
// * Neither the name of Google Inc. nor the names of its
|
13
|
+
// contributors may be used to endorse or promote products derived
|
14
|
+
// from this software without specific prior written permission.
|
15
|
+
//
|
16
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
17
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
18
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
19
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
20
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
21
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
22
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
23
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
24
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
25
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
26
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27
|
+
|
28
|
+
#include "v8.h"
|
29
|
+
|
30
|
+
#if defined(V8_TARGET_ARCH_IA32)
|
31
|
+
|
32
|
+
#include "codegen.h"
|
33
|
+
#include "debug.h"
|
34
|
+
|
35
|
+
|
36
|
+
namespace v8 {
|
37
|
+
namespace internal {
|
38
|
+
|
39
|
+
#ifdef ENABLE_DEBUGGER_SUPPORT
|
40
|
+
|
41
|
+
bool BreakLocationIterator::IsDebugBreakAtReturn() {
|
42
|
+
return Debug::IsDebugBreakAtReturn(rinfo());
|
43
|
+
}
|
44
|
+
|
45
|
+
|
46
|
+
// Patch the JS frame exit code with a debug break call. See
|
47
|
+
// CodeGenerator::VisitReturnStatement and VirtualFrame::Exit in codegen-ia32.cc
|
48
|
+
// for the precise return instructions sequence.
|
49
|
+
void BreakLocationIterator::SetDebugBreakAtReturn() {
|
50
|
+
ASSERT(Assembler::kJSReturnSequenceLength >=
|
51
|
+
Assembler::kCallInstructionLength);
|
52
|
+
Isolate* isolate = Isolate::Current();
|
53
|
+
rinfo()->PatchCodeWithCall(isolate->debug()->debug_break_return()->entry(),
|
54
|
+
Assembler::kJSReturnSequenceLength - Assembler::kCallInstructionLength);
|
55
|
+
}
|
56
|
+
|
57
|
+
|
58
|
+
// Restore the JS frame exit code.
|
59
|
+
void BreakLocationIterator::ClearDebugBreakAtReturn() {
|
60
|
+
rinfo()->PatchCode(original_rinfo()->pc(),
|
61
|
+
Assembler::kJSReturnSequenceLength);
|
62
|
+
}
|
63
|
+
|
64
|
+
|
65
|
+
// A debug break in the frame exit code is identified by the JS frame exit code
|
66
|
+
// having been patched with a call instruction.
|
67
|
+
bool Debug::IsDebugBreakAtReturn(RelocInfo* rinfo) {
|
68
|
+
ASSERT(RelocInfo::IsJSReturn(rinfo->rmode()));
|
69
|
+
return rinfo->IsPatchedReturnSequence();
|
70
|
+
}
|
71
|
+
|
72
|
+
|
73
|
+
bool BreakLocationIterator::IsDebugBreakAtSlot() {
|
74
|
+
ASSERT(IsDebugBreakSlot());
|
75
|
+
// Check whether the debug break slot instructions have been patched.
|
76
|
+
return rinfo()->IsPatchedDebugBreakSlotSequence();
|
77
|
+
}
|
78
|
+
|
79
|
+
|
80
|
+
void BreakLocationIterator::SetDebugBreakAtSlot() {
|
81
|
+
ASSERT(IsDebugBreakSlot());
|
82
|
+
Isolate* isolate = Isolate::Current();
|
83
|
+
rinfo()->PatchCodeWithCall(
|
84
|
+
isolate->debug()->debug_break_slot()->entry(),
|
85
|
+
Assembler::kDebugBreakSlotLength - Assembler::kCallInstructionLength);
|
86
|
+
}
|
87
|
+
|
88
|
+
|
89
|
+
void BreakLocationIterator::ClearDebugBreakAtSlot() {
|
90
|
+
ASSERT(IsDebugBreakSlot());
|
91
|
+
rinfo()->PatchCode(original_rinfo()->pc(), Assembler::kDebugBreakSlotLength);
|
92
|
+
}
|
93
|
+
|
94
|
+
|
95
|
+
#define __ ACCESS_MASM(masm)
|
96
|
+
|
97
|
+
|
98
|
+
static void Generate_DebugBreakCallHelper(MacroAssembler* masm,
|
99
|
+
RegList object_regs,
|
100
|
+
RegList non_object_regs,
|
101
|
+
bool convert_call_to_jmp) {
|
102
|
+
// Enter an internal frame.
|
103
|
+
__ EnterInternalFrame();
|
104
|
+
|
105
|
+
// Store the registers containing live values on the expression stack to
|
106
|
+
// make sure that these are correctly updated during GC. Non object values
|
107
|
+
// are stored as a smi causing it to be untouched by GC.
|
108
|
+
ASSERT((object_regs & ~kJSCallerSaved) == 0);
|
109
|
+
ASSERT((non_object_regs & ~kJSCallerSaved) == 0);
|
110
|
+
ASSERT((object_regs & non_object_regs) == 0);
|
111
|
+
for (int i = 0; i < kNumJSCallerSaved; i++) {
|
112
|
+
int r = JSCallerSavedCode(i);
|
113
|
+
Register reg = { r };
|
114
|
+
if ((object_regs & (1 << r)) != 0) {
|
115
|
+
__ push(reg);
|
116
|
+
}
|
117
|
+
if ((non_object_regs & (1 << r)) != 0) {
|
118
|
+
if (FLAG_debug_code) {
|
119
|
+
__ test(reg, Immediate(0xc0000000));
|
120
|
+
__ Assert(zero, "Unable to encode value as smi");
|
121
|
+
}
|
122
|
+
__ SmiTag(reg);
|
123
|
+
__ push(reg);
|
124
|
+
}
|
125
|
+
}
|
126
|
+
|
127
|
+
#ifdef DEBUG
|
128
|
+
__ RecordComment("// Calling from debug break to runtime - come in - over");
|
129
|
+
#endif
|
130
|
+
__ Set(eax, Immediate(0)); // No arguments.
|
131
|
+
__ mov(ebx, Immediate(ExternalReference::debug_break(masm->isolate())));
|
132
|
+
|
133
|
+
CEntryStub ceb(1);
|
134
|
+
__ CallStub(&ceb);
|
135
|
+
|
136
|
+
// Restore the register values containing object pointers from the expression
|
137
|
+
// stack.
|
138
|
+
for (int i = kNumJSCallerSaved; --i >= 0;) {
|
139
|
+
int r = JSCallerSavedCode(i);
|
140
|
+
Register reg = { r };
|
141
|
+
if (FLAG_debug_code) {
|
142
|
+
__ Set(reg, Immediate(kDebugZapValue));
|
143
|
+
}
|
144
|
+
if ((object_regs & (1 << r)) != 0) {
|
145
|
+
__ pop(reg);
|
146
|
+
}
|
147
|
+
if ((non_object_regs & (1 << r)) != 0) {
|
148
|
+
__ pop(reg);
|
149
|
+
__ SmiUntag(reg);
|
150
|
+
}
|
151
|
+
}
|
152
|
+
|
153
|
+
// Get rid of the internal frame.
|
154
|
+
__ LeaveInternalFrame();
|
155
|
+
|
156
|
+
// If this call did not replace a call but patched other code then there will
|
157
|
+
// be an unwanted return address left on the stack. Here we get rid of that.
|
158
|
+
if (convert_call_to_jmp) {
|
159
|
+
__ add(Operand(esp), Immediate(kPointerSize));
|
160
|
+
}
|
161
|
+
|
162
|
+
// Now that the break point has been handled, resume normal execution by
|
163
|
+
// jumping to the target address intended by the caller and that was
|
164
|
+
// overwritten by the address of DebugBreakXXX.
|
165
|
+
ExternalReference after_break_target =
|
166
|
+
ExternalReference(Debug_Address::AfterBreakTarget(), masm->isolate());
|
167
|
+
__ jmp(Operand::StaticVariable(after_break_target));
|
168
|
+
}
|
169
|
+
|
170
|
+
|
171
|
+
void Debug::GenerateLoadICDebugBreak(MacroAssembler* masm) {
|
172
|
+
// Register state for IC load call (from ic-ia32.cc).
|
173
|
+
// ----------- S t a t e -------------
|
174
|
+
// -- eax : receiver
|
175
|
+
// -- ecx : name
|
176
|
+
// -----------------------------------
|
177
|
+
Generate_DebugBreakCallHelper(masm, eax.bit() | ecx.bit(), 0, false);
|
178
|
+
}
|
179
|
+
|
180
|
+
|
181
|
+
void Debug::GenerateStoreICDebugBreak(MacroAssembler* masm) {
|
182
|
+
// Register state for IC store call (from ic-ia32.cc).
|
183
|
+
// ----------- S t a t e -------------
|
184
|
+
// -- eax : value
|
185
|
+
// -- ecx : name
|
186
|
+
// -- edx : receiver
|
187
|
+
// -----------------------------------
|
188
|
+
Generate_DebugBreakCallHelper(
|
189
|
+
masm, eax.bit() | ecx.bit() | edx.bit(), 0, false);
|
190
|
+
}
|
191
|
+
|
192
|
+
|
193
|
+
void Debug::GenerateKeyedLoadICDebugBreak(MacroAssembler* masm) {
|
194
|
+
// Register state for keyed IC load call (from ic-ia32.cc).
|
195
|
+
// ----------- S t a t e -------------
|
196
|
+
// -- edx : receiver
|
197
|
+
// -- eax : key
|
198
|
+
// -----------------------------------
|
199
|
+
Generate_DebugBreakCallHelper(masm, eax.bit() | edx.bit(), 0, false);
|
200
|
+
}
|
201
|
+
|
202
|
+
|
203
|
+
void Debug::GenerateKeyedStoreICDebugBreak(MacroAssembler* masm) {
|
204
|
+
// Register state for keyed IC load call (from ic-ia32.cc).
|
205
|
+
// ----------- S t a t e -------------
|
206
|
+
// -- eax : value
|
207
|
+
// -- ecx : key
|
208
|
+
// -- edx : receiver
|
209
|
+
// -----------------------------------
|
210
|
+
Generate_DebugBreakCallHelper(
|
211
|
+
masm, eax.bit() | ecx.bit() | edx.bit(), 0, false);
|
212
|
+
}
|
213
|
+
|
214
|
+
|
215
|
+
void Debug::GenerateCallICDebugBreak(MacroAssembler* masm) {
|
216
|
+
// Register state for keyed IC call call (from ic-ia32.cc)
|
217
|
+
// ----------- S t a t e -------------
|
218
|
+
// -- ecx: name
|
219
|
+
// -----------------------------------
|
220
|
+
Generate_DebugBreakCallHelper(masm, ecx.bit(), 0, false);
|
221
|
+
}
|
222
|
+
|
223
|
+
|
224
|
+
void Debug::GenerateConstructCallDebugBreak(MacroAssembler* masm) {
|
225
|
+
// Register state just before return from JS function (from codegen-ia32.cc).
|
226
|
+
// eax is the actual number of arguments not encoded as a smi see comment
|
227
|
+
// above IC call.
|
228
|
+
// ----------- S t a t e -------------
|
229
|
+
// -- eax: number of arguments (not smi)
|
230
|
+
// -- edi: constructor function
|
231
|
+
// -----------------------------------
|
232
|
+
// The number of arguments in eax is not smi encoded.
|
233
|
+
Generate_DebugBreakCallHelper(masm, edi.bit(), eax.bit(), false);
|
234
|
+
}
|
235
|
+
|
236
|
+
|
237
|
+
void Debug::GenerateReturnDebugBreak(MacroAssembler* masm) {
|
238
|
+
// Register state just before return from JS function (from codegen-ia32.cc).
|
239
|
+
// ----------- S t a t e -------------
|
240
|
+
// -- eax: return value
|
241
|
+
// -----------------------------------
|
242
|
+
Generate_DebugBreakCallHelper(masm, eax.bit(), 0, true);
|
243
|
+
}
|
244
|
+
|
245
|
+
|
246
|
+
void Debug::GenerateStubNoRegistersDebugBreak(MacroAssembler* masm) {
|
247
|
+
// Register state for stub CallFunction (from CallFunctionStub in ic-ia32.cc).
|
248
|
+
// ----------- S t a t e -------------
|
249
|
+
// No registers used on entry.
|
250
|
+
// -----------------------------------
|
251
|
+
Generate_DebugBreakCallHelper(masm, 0, 0, false);
|
252
|
+
}
|
253
|
+
|
254
|
+
|
255
|
+
void Debug::GenerateSlot(MacroAssembler* masm) {
|
256
|
+
// Generate enough nop's to make space for a call instruction.
|
257
|
+
Label check_codesize;
|
258
|
+
__ bind(&check_codesize);
|
259
|
+
__ RecordDebugBreakSlot();
|
260
|
+
for (int i = 0; i < Assembler::kDebugBreakSlotLength; i++) {
|
261
|
+
__ nop();
|
262
|
+
}
|
263
|
+
ASSERT_EQ(Assembler::kDebugBreakSlotLength,
|
264
|
+
masm->SizeOfCodeGeneratedSince(&check_codesize));
|
265
|
+
}
|
266
|
+
|
267
|
+
|
268
|
+
void Debug::GenerateSlotDebugBreak(MacroAssembler* masm) {
|
269
|
+
// In the places where a debug break slot is inserted no registers can contain
|
270
|
+
// object pointers.
|
271
|
+
Generate_DebugBreakCallHelper(masm, 0, 0, true);
|
272
|
+
}
|
273
|
+
|
274
|
+
|
275
|
+
void Debug::GeneratePlainReturnLiveEdit(MacroAssembler* masm) {
|
276
|
+
masm->ret(0);
|
277
|
+
}
|
278
|
+
|
279
|
+
|
280
|
+
void Debug::GenerateFrameDropperLiveEdit(MacroAssembler* masm) {
|
281
|
+
ExternalReference restarter_frame_function_slot =
|
282
|
+
ExternalReference(Debug_Address::RestarterFrameFunctionPointer(),
|
283
|
+
masm->isolate());
|
284
|
+
__ mov(Operand::StaticVariable(restarter_frame_function_slot), Immediate(0));
|
285
|
+
|
286
|
+
// We do not know our frame height, but set esp based on ebp.
|
287
|
+
__ lea(esp, Operand(ebp, -1 * kPointerSize));
|
288
|
+
|
289
|
+
__ pop(edi); // Function.
|
290
|
+
__ pop(ebp);
|
291
|
+
|
292
|
+
// Load context from the function.
|
293
|
+
__ mov(esi, FieldOperand(edi, JSFunction::kContextOffset));
|
294
|
+
|
295
|
+
// Get function code.
|
296
|
+
__ mov(edx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset));
|
297
|
+
__ mov(edx, FieldOperand(edx, SharedFunctionInfo::kCodeOffset));
|
298
|
+
__ lea(edx, FieldOperand(edx, Code::kHeaderSize));
|
299
|
+
|
300
|
+
// Re-run JSFunction, edi is function, esi is context.
|
301
|
+
__ jmp(Operand(edx));
|
302
|
+
}
|
303
|
+
|
304
|
+
const bool Debug::kFrameDropperSupported = true;
|
305
|
+
|
306
|
+
#undef __
|
307
|
+
|
308
|
+
#endif // ENABLE_DEBUGGER_SUPPORT
|
309
|
+
|
310
|
+
} } // namespace v8::internal
|
311
|
+
|
312
|
+
#endif // V8_TARGET_ARCH_IA32
|