therubyracer 0.4.9-x86-linux
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of therubyracer might be problematic. Click here for more details.
- data/.gitignore +11 -0
- data/.gitmodules +3 -0
- data/Doxyfile +1514 -0
- data/History.txt +43 -0
- data/README.rdoc +157 -0
- data/Rakefile +51 -0
- data/docs/data_conversion.txt +18 -0
- data/ext/v8/callbacks.cpp +160 -0
- data/ext/v8/callbacks.h +14 -0
- data/ext/v8/convert_ruby.cpp +8 -0
- data/ext/v8/convert_ruby.h +99 -0
- data/ext/v8/convert_string.cpp +10 -0
- data/ext/v8/convert_string.h +73 -0
- data/ext/v8/convert_v8.cpp +9 -0
- data/ext/v8/convert_v8.h +121 -0
- data/ext/v8/converters.cpp +83 -0
- data/ext/v8/converters.h +23 -0
- data/ext/v8/extconf.rb +36 -0
- data/ext/v8/upstream/2.0.6/.gitignore +26 -0
- data/ext/v8/upstream/2.0.6/AUTHORS +23 -0
- data/ext/v8/upstream/2.0.6/ChangeLog +1479 -0
- data/ext/v8/upstream/2.0.6/LICENSE +55 -0
- data/ext/v8/upstream/2.0.6/SConstruct +1028 -0
- data/ext/v8/upstream/2.0.6/include/v8-debug.h +275 -0
- data/ext/v8/upstream/2.0.6/include/v8.h +3236 -0
- data/ext/v8/upstream/2.0.6/src/SConscript +283 -0
- data/ext/v8/upstream/2.0.6/src/accessors.cc +695 -0
- data/ext/v8/upstream/2.0.6/src/accessors.h +114 -0
- data/ext/v8/upstream/2.0.6/src/allocation.cc +198 -0
- data/ext/v8/upstream/2.0.6/src/allocation.h +169 -0
- data/ext/v8/upstream/2.0.6/src/api.cc +3831 -0
- data/ext/v8/upstream/2.0.6/src/api.h +479 -0
- data/ext/v8/upstream/2.0.6/src/apinatives.js +110 -0
- data/ext/v8/upstream/2.0.6/src/apiutils.h +69 -0
- data/ext/v8/upstream/2.0.6/src/arguments.h +97 -0
- data/ext/v8/upstream/2.0.6/src/arm/assembler-arm-inl.h +277 -0
- data/ext/v8/upstream/2.0.6/src/arm/assembler-arm.cc +1821 -0
- data/ext/v8/upstream/2.0.6/src/arm/assembler-arm.h +1027 -0
- data/ext/v8/upstream/2.0.6/src/arm/assembler-thumb2-inl.h +267 -0
- data/ext/v8/upstream/2.0.6/src/arm/assembler-thumb2.cc +1821 -0
- data/ext/v8/upstream/2.0.6/src/arm/assembler-thumb2.h +1027 -0
- data/ext/v8/upstream/2.0.6/src/arm/builtins-arm.cc +1271 -0
- data/ext/v8/upstream/2.0.6/src/arm/codegen-arm-inl.h +74 -0
- data/ext/v8/upstream/2.0.6/src/arm/codegen-arm.cc +6682 -0
- data/ext/v8/upstream/2.0.6/src/arm/codegen-arm.h +535 -0
- data/ext/v8/upstream/2.0.6/src/arm/constants-arm.cc +112 -0
- data/ext/v8/upstream/2.0.6/src/arm/constants-arm.h +347 -0
- data/ext/v8/upstream/2.0.6/src/arm/cpu-arm.cc +132 -0
- data/ext/v8/upstream/2.0.6/src/arm/debug-arm.cc +213 -0
- data/ext/v8/upstream/2.0.6/src/arm/disasm-arm.cc +1166 -0
- data/ext/v8/upstream/2.0.6/src/arm/fast-codegen-arm.cc +1698 -0
- data/ext/v8/upstream/2.0.6/src/arm/frames-arm.cc +123 -0
- data/ext/v8/upstream/2.0.6/src/arm/frames-arm.h +162 -0
- data/ext/v8/upstream/2.0.6/src/arm/ic-arm.cc +849 -0
- data/ext/v8/upstream/2.0.6/src/arm/jump-target-arm.cc +238 -0
- data/ext/v8/upstream/2.0.6/src/arm/macro-assembler-arm.cc +1259 -0
- data/ext/v8/upstream/2.0.6/src/arm/macro-assembler-arm.h +423 -0
- data/ext/v8/upstream/2.0.6/src/arm/regexp-macro-assembler-arm.cc +1266 -0
- data/ext/v8/upstream/2.0.6/src/arm/regexp-macro-assembler-arm.h +282 -0
- data/ext/v8/upstream/2.0.6/src/arm/register-allocator-arm-inl.h +103 -0
- data/ext/v8/upstream/2.0.6/src/arm/register-allocator-arm.cc +59 -0
- data/ext/v8/upstream/2.0.6/src/arm/register-allocator-arm.h +43 -0
- data/ext/v8/upstream/2.0.6/src/arm/simulator-arm.cc +2264 -0
- data/ext/v8/upstream/2.0.6/src/arm/simulator-arm.h +306 -0
- data/ext/v8/upstream/2.0.6/src/arm/stub-cache-arm.cc +1516 -0
- data/ext/v8/upstream/2.0.6/src/arm/virtual-frame-arm.cc +412 -0
- data/ext/v8/upstream/2.0.6/src/arm/virtual-frame-arm.h +532 -0
- data/ext/v8/upstream/2.0.6/src/array.js +1154 -0
- data/ext/v8/upstream/2.0.6/src/assembler.cc +772 -0
- data/ext/v8/upstream/2.0.6/src/assembler.h +525 -0
- data/ext/v8/upstream/2.0.6/src/ast.cc +512 -0
- data/ext/v8/upstream/2.0.6/src/ast.h +1820 -0
- data/ext/v8/upstream/2.0.6/src/bootstrapper.cc +1680 -0
- data/ext/v8/upstream/2.0.6/src/bootstrapper.h +103 -0
- data/ext/v8/upstream/2.0.6/src/builtins.cc +851 -0
- data/ext/v8/upstream/2.0.6/src/builtins.h +245 -0
- data/ext/v8/upstream/2.0.6/src/bytecodes-irregexp.h +104 -0
- data/ext/v8/upstream/2.0.6/src/char-predicates-inl.h +86 -0
- data/ext/v8/upstream/2.0.6/src/char-predicates.h +65 -0
- data/ext/v8/upstream/2.0.6/src/checks.cc +100 -0
- data/ext/v8/upstream/2.0.6/src/checks.h +284 -0
- data/ext/v8/upstream/2.0.6/src/code-stubs.cc +164 -0
- data/ext/v8/upstream/2.0.6/src/code-stubs.h +164 -0
- data/ext/v8/upstream/2.0.6/src/code.h +68 -0
- data/ext/v8/upstream/2.0.6/src/codegen-inl.h +88 -0
- data/ext/v8/upstream/2.0.6/src/codegen.cc +504 -0
- data/ext/v8/upstream/2.0.6/src/codegen.h +522 -0
- data/ext/v8/upstream/2.0.6/src/compilation-cache.cc +490 -0
- data/ext/v8/upstream/2.0.6/src/compilation-cache.h +98 -0
- data/ext/v8/upstream/2.0.6/src/compiler.cc +1132 -0
- data/ext/v8/upstream/2.0.6/src/compiler.h +107 -0
- data/ext/v8/upstream/2.0.6/src/contexts.cc +256 -0
- data/ext/v8/upstream/2.0.6/src/contexts.h +345 -0
- data/ext/v8/upstream/2.0.6/src/conversions-inl.h +95 -0
- data/ext/v8/upstream/2.0.6/src/conversions.cc +709 -0
- data/ext/v8/upstream/2.0.6/src/conversions.h +118 -0
- data/ext/v8/upstream/2.0.6/src/counters.cc +78 -0
- data/ext/v8/upstream/2.0.6/src/counters.h +239 -0
- data/ext/v8/upstream/2.0.6/src/cpu.h +65 -0
- data/ext/v8/upstream/2.0.6/src/d8-debug.cc +345 -0
- data/ext/v8/upstream/2.0.6/src/d8-debug.h +155 -0
- data/ext/v8/upstream/2.0.6/src/d8-posix.cc +675 -0
- data/ext/v8/upstream/2.0.6/src/d8-readline.cc +128 -0
- data/ext/v8/upstream/2.0.6/src/d8-windows.cc +42 -0
- data/ext/v8/upstream/2.0.6/src/d8.cc +776 -0
- data/ext/v8/upstream/2.0.6/src/d8.h +225 -0
- data/ext/v8/upstream/2.0.6/src/d8.js +1625 -0
- data/ext/v8/upstream/2.0.6/src/date-delay.js +1138 -0
- data/ext/v8/upstream/2.0.6/src/dateparser-inl.h +114 -0
- data/ext/v8/upstream/2.0.6/src/dateparser.cc +186 -0
- data/ext/v8/upstream/2.0.6/src/dateparser.h +240 -0
- data/ext/v8/upstream/2.0.6/src/debug-agent.cc +425 -0
- data/ext/v8/upstream/2.0.6/src/debug-agent.h +129 -0
- data/ext/v8/upstream/2.0.6/src/debug-delay.js +2073 -0
- data/ext/v8/upstream/2.0.6/src/debug.cc +2751 -0
- data/ext/v8/upstream/2.0.6/src/debug.h +866 -0
- data/ext/v8/upstream/2.0.6/src/disasm.h +77 -0
- data/ext/v8/upstream/2.0.6/src/disassembler.cc +318 -0
- data/ext/v8/upstream/2.0.6/src/disassembler.h +56 -0
- data/ext/v8/upstream/2.0.6/src/dtoa-config.c +91 -0
- data/ext/v8/upstream/2.0.6/src/execution.cc +701 -0
- data/ext/v8/upstream/2.0.6/src/execution.h +312 -0
- data/ext/v8/upstream/2.0.6/src/factory.cc +957 -0
- data/ext/v8/upstream/2.0.6/src/factory.h +393 -0
- data/ext/v8/upstream/2.0.6/src/fast-codegen.cc +725 -0
- data/ext/v8/upstream/2.0.6/src/fast-codegen.h +371 -0
- data/ext/v8/upstream/2.0.6/src/flag-definitions.h +426 -0
- data/ext/v8/upstream/2.0.6/src/flags.cc +555 -0
- data/ext/v8/upstream/2.0.6/src/flags.h +81 -0
- data/ext/v8/upstream/2.0.6/src/frame-element.cc +45 -0
- data/ext/v8/upstream/2.0.6/src/frame-element.h +235 -0
- data/ext/v8/upstream/2.0.6/src/frames-inl.h +215 -0
- data/ext/v8/upstream/2.0.6/src/frames.cc +749 -0
- data/ext/v8/upstream/2.0.6/src/frames.h +659 -0
- data/ext/v8/upstream/2.0.6/src/func-name-inferrer.cc +76 -0
- data/ext/v8/upstream/2.0.6/src/func-name-inferrer.h +135 -0
- data/ext/v8/upstream/2.0.6/src/global-handles.cc +516 -0
- data/ext/v8/upstream/2.0.6/src/global-handles.h +180 -0
- data/ext/v8/upstream/2.0.6/src/globals.h +608 -0
- data/ext/v8/upstream/2.0.6/src/handles-inl.h +76 -0
- data/ext/v8/upstream/2.0.6/src/handles.cc +811 -0
- data/ext/v8/upstream/2.0.6/src/handles.h +367 -0
- data/ext/v8/upstream/2.0.6/src/hashmap.cc +226 -0
- data/ext/v8/upstream/2.0.6/src/hashmap.h +120 -0
- data/ext/v8/upstream/2.0.6/src/heap-inl.h +407 -0
- data/ext/v8/upstream/2.0.6/src/heap-profiler.cc +695 -0
- data/ext/v8/upstream/2.0.6/src/heap-profiler.h +277 -0
- data/ext/v8/upstream/2.0.6/src/heap.cc +4204 -0
- data/ext/v8/upstream/2.0.6/src/heap.h +1704 -0
- data/ext/v8/upstream/2.0.6/src/ia32/assembler-ia32-inl.h +325 -0
- data/ext/v8/upstream/2.0.6/src/ia32/assembler-ia32.cc +2375 -0
- data/ext/v8/upstream/2.0.6/src/ia32/assembler-ia32.h +914 -0
- data/ext/v8/upstream/2.0.6/src/ia32/builtins-ia32.cc +1222 -0
- data/ext/v8/upstream/2.0.6/src/ia32/codegen-ia32-inl.h +46 -0
- data/ext/v8/upstream/2.0.6/src/ia32/codegen-ia32.cc +9770 -0
- data/ext/v8/upstream/2.0.6/src/ia32/codegen-ia32.h +834 -0
- data/ext/v8/upstream/2.0.6/src/ia32/cpu-ia32.cc +79 -0
- data/ext/v8/upstream/2.0.6/src/ia32/debug-ia32.cc +208 -0
- data/ext/v8/upstream/2.0.6/src/ia32/disasm-ia32.cc +1357 -0
- data/ext/v8/upstream/2.0.6/src/ia32/fast-codegen-ia32.cc +1813 -0
- data/ext/v8/upstream/2.0.6/src/ia32/frames-ia32.cc +111 -0
- data/ext/v8/upstream/2.0.6/src/ia32/frames-ia32.h +135 -0
- data/ext/v8/upstream/2.0.6/src/ia32/ic-ia32.cc +1490 -0
- data/ext/v8/upstream/2.0.6/src/ia32/jump-target-ia32.cc +432 -0
- data/ext/v8/upstream/2.0.6/src/ia32/macro-assembler-ia32.cc +1517 -0
- data/ext/v8/upstream/2.0.6/src/ia32/macro-assembler-ia32.h +528 -0
- data/ext/v8/upstream/2.0.6/src/ia32/regexp-macro-assembler-ia32.cc +1219 -0
- data/ext/v8/upstream/2.0.6/src/ia32/regexp-macro-assembler-ia32.h +230 -0
- data/ext/v8/upstream/2.0.6/src/ia32/register-allocator-ia32-inl.h +82 -0
- data/ext/v8/upstream/2.0.6/src/ia32/register-allocator-ia32.cc +99 -0
- data/ext/v8/upstream/2.0.6/src/ia32/register-allocator-ia32.h +43 -0
- data/ext/v8/upstream/2.0.6/src/ia32/simulator-ia32.cc +30 -0
- data/ext/v8/upstream/2.0.6/src/ia32/simulator-ia32.h +62 -0
- data/ext/v8/upstream/2.0.6/src/ia32/stub-cache-ia32.cc +1961 -0
- data/ext/v8/upstream/2.0.6/src/ia32/virtual-frame-ia32.cc +1105 -0
- data/ext/v8/upstream/2.0.6/src/ia32/virtual-frame-ia32.h +580 -0
- data/ext/v8/upstream/2.0.6/src/ic-inl.h +93 -0
- data/ext/v8/upstream/2.0.6/src/ic.cc +1426 -0
- data/ext/v8/upstream/2.0.6/src/ic.h +443 -0
- data/ext/v8/upstream/2.0.6/src/interpreter-irregexp.cc +646 -0
- data/ext/v8/upstream/2.0.6/src/interpreter-irregexp.h +48 -0
- data/ext/v8/upstream/2.0.6/src/json-delay.js +254 -0
- data/ext/v8/upstream/2.0.6/src/jsregexp.cc +5234 -0
- data/ext/v8/upstream/2.0.6/src/jsregexp.h +1439 -0
- data/ext/v8/upstream/2.0.6/src/jump-target-inl.h +49 -0
- data/ext/v8/upstream/2.0.6/src/jump-target.cc +383 -0
- data/ext/v8/upstream/2.0.6/src/jump-target.h +280 -0
- data/ext/v8/upstream/2.0.6/src/list-inl.h +166 -0
- data/ext/v8/upstream/2.0.6/src/list.h +158 -0
- data/ext/v8/upstream/2.0.6/src/log-inl.h +126 -0
- data/ext/v8/upstream/2.0.6/src/log-utils.cc +503 -0
- data/ext/v8/upstream/2.0.6/src/log-utils.h +292 -0
- data/ext/v8/upstream/2.0.6/src/log.cc +1457 -0
- data/ext/v8/upstream/2.0.6/src/log.h +371 -0
- data/ext/v8/upstream/2.0.6/src/macro-assembler.h +93 -0
- data/ext/v8/upstream/2.0.6/src/macros.py +137 -0
- data/ext/v8/upstream/2.0.6/src/mark-compact.cc +2007 -0
- data/ext/v8/upstream/2.0.6/src/mark-compact.h +442 -0
- data/ext/v8/upstream/2.0.6/src/math.js +263 -0
- data/ext/v8/upstream/2.0.6/src/memory.h +74 -0
- data/ext/v8/upstream/2.0.6/src/messages.cc +177 -0
- data/ext/v8/upstream/2.0.6/src/messages.h +112 -0
- data/ext/v8/upstream/2.0.6/src/messages.js +937 -0
- data/ext/v8/upstream/2.0.6/src/mirror-delay.js +2332 -0
- data/ext/v8/upstream/2.0.6/src/mksnapshot.cc +169 -0
- data/ext/v8/upstream/2.0.6/src/natives.h +63 -0
- data/ext/v8/upstream/2.0.6/src/objects-debug.cc +1317 -0
- data/ext/v8/upstream/2.0.6/src/objects-inl.h +3044 -0
- data/ext/v8/upstream/2.0.6/src/objects.cc +8306 -0
- data/ext/v8/upstream/2.0.6/src/objects.h +4960 -0
- data/ext/v8/upstream/2.0.6/src/oprofile-agent.cc +116 -0
- data/ext/v8/upstream/2.0.6/src/oprofile-agent.h +69 -0
- data/ext/v8/upstream/2.0.6/src/parser.cc +4810 -0
- data/ext/v8/upstream/2.0.6/src/parser.h +195 -0
- data/ext/v8/upstream/2.0.6/src/platform-freebsd.cc +645 -0
- data/ext/v8/upstream/2.0.6/src/platform-linux.cc +808 -0
- data/ext/v8/upstream/2.0.6/src/platform-macos.cc +643 -0
- data/ext/v8/upstream/2.0.6/src/platform-nullos.cc +454 -0
- data/ext/v8/upstream/2.0.6/src/platform-openbsd.cc +597 -0
- data/ext/v8/upstream/2.0.6/src/platform-posix.cc +380 -0
- data/ext/v8/upstream/2.0.6/src/platform-win32.cc +1908 -0
- data/ext/v8/upstream/2.0.6/src/platform.h +556 -0
- data/ext/v8/upstream/2.0.6/src/prettyprinter.cc +1511 -0
- data/ext/v8/upstream/2.0.6/src/prettyprinter.h +219 -0
- data/ext/v8/upstream/2.0.6/src/property.cc +96 -0
- data/ext/v8/upstream/2.0.6/src/property.h +327 -0
- data/ext/v8/upstream/2.0.6/src/regexp-delay.js +406 -0
- data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-irregexp-inl.h +78 -0
- data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-irregexp.cc +464 -0
- data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-irregexp.h +141 -0
- data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-tracer.cc +356 -0
- data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-tracer.h +103 -0
- data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler.cc +240 -0
- data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler.h +220 -0
- data/ext/v8/upstream/2.0.6/src/regexp-stack.cc +103 -0
- data/ext/v8/upstream/2.0.6/src/regexp-stack.h +123 -0
- data/ext/v8/upstream/2.0.6/src/register-allocator-inl.h +74 -0
- data/ext/v8/upstream/2.0.6/src/register-allocator.cc +100 -0
- data/ext/v8/upstream/2.0.6/src/register-allocator.h +295 -0
- data/ext/v8/upstream/2.0.6/src/rewriter.cc +855 -0
- data/ext/v8/upstream/2.0.6/src/rewriter.h +54 -0
- data/ext/v8/upstream/2.0.6/src/runtime.cc +8163 -0
- data/ext/v8/upstream/2.0.6/src/runtime.h +432 -0
- data/ext/v8/upstream/2.0.6/src/runtime.js +626 -0
- data/ext/v8/upstream/2.0.6/src/scanner.cc +1098 -0
- data/ext/v8/upstream/2.0.6/src/scanner.h +425 -0
- data/ext/v8/upstream/2.0.6/src/scopeinfo.cc +649 -0
- data/ext/v8/upstream/2.0.6/src/scopeinfo.h +236 -0
- data/ext/v8/upstream/2.0.6/src/scopes.cc +963 -0
- data/ext/v8/upstream/2.0.6/src/scopes.h +401 -0
- data/ext/v8/upstream/2.0.6/src/serialize.cc +1260 -0
- data/ext/v8/upstream/2.0.6/src/serialize.h +404 -0
- data/ext/v8/upstream/2.0.6/src/shell.h +55 -0
- data/ext/v8/upstream/2.0.6/src/simulator.h +41 -0
- data/ext/v8/upstream/2.0.6/src/smart-pointer.h +109 -0
- data/ext/v8/upstream/2.0.6/src/snapshot-common.cc +97 -0
- data/ext/v8/upstream/2.0.6/src/snapshot-empty.cc +40 -0
- data/ext/v8/upstream/2.0.6/src/snapshot.h +59 -0
- data/ext/v8/upstream/2.0.6/src/spaces-inl.h +372 -0
- data/ext/v8/upstream/2.0.6/src/spaces.cc +2864 -0
- data/ext/v8/upstream/2.0.6/src/spaces.h +2072 -0
- data/ext/v8/upstream/2.0.6/src/string-stream.cc +584 -0
- data/ext/v8/upstream/2.0.6/src/string-stream.h +189 -0
- data/ext/v8/upstream/2.0.6/src/string.js +901 -0
- data/ext/v8/upstream/2.0.6/src/stub-cache.cc +1108 -0
- data/ext/v8/upstream/2.0.6/src/stub-cache.h +578 -0
- data/ext/v8/upstream/2.0.6/src/third_party/dtoa/COPYING +15 -0
- data/ext/v8/upstream/2.0.6/src/third_party/dtoa/dtoa.c +3330 -0
- data/ext/v8/upstream/2.0.6/src/third_party/valgrind/valgrind.h +3925 -0
- data/ext/v8/upstream/2.0.6/src/token.cc +56 -0
- data/ext/v8/upstream/2.0.6/src/token.h +270 -0
- data/ext/v8/upstream/2.0.6/src/top.cc +991 -0
- data/ext/v8/upstream/2.0.6/src/top.h +459 -0
- data/ext/v8/upstream/2.0.6/src/unicode-inl.h +238 -0
- data/ext/v8/upstream/2.0.6/src/unicode.cc +749 -0
- data/ext/v8/upstream/2.0.6/src/unicode.h +279 -0
- data/ext/v8/upstream/2.0.6/src/uri.js +415 -0
- data/ext/v8/upstream/2.0.6/src/usage-analyzer.cc +426 -0
- data/ext/v8/upstream/2.0.6/src/usage-analyzer.h +40 -0
- data/ext/v8/upstream/2.0.6/src/utils.cc +322 -0
- data/ext/v8/upstream/2.0.6/src/utils.h +592 -0
- data/ext/v8/upstream/2.0.6/src/v8-counters.cc +55 -0
- data/ext/v8/upstream/2.0.6/src/v8-counters.h +198 -0
- data/ext/v8/upstream/2.0.6/src/v8.cc +193 -0
- data/ext/v8/upstream/2.0.6/src/v8.h +119 -0
- data/ext/v8/upstream/2.0.6/src/v8natives.js +846 -0
- data/ext/v8/upstream/2.0.6/src/v8threads.cc +450 -0
- data/ext/v8/upstream/2.0.6/src/v8threads.h +144 -0
- data/ext/v8/upstream/2.0.6/src/variables.cc +163 -0
- data/ext/v8/upstream/2.0.6/src/variables.h +235 -0
- data/ext/v8/upstream/2.0.6/src/version.cc +88 -0
- data/ext/v8/upstream/2.0.6/src/version.h +64 -0
- data/ext/v8/upstream/2.0.6/src/virtual-frame.cc +381 -0
- data/ext/v8/upstream/2.0.6/src/virtual-frame.h +44 -0
- data/ext/v8/upstream/2.0.6/src/x64/assembler-x64-inl.h +352 -0
- data/ext/v8/upstream/2.0.6/src/x64/assembler-x64.cc +2539 -0
- data/ext/v8/upstream/2.0.6/src/x64/assembler-x64.h +1399 -0
- data/ext/v8/upstream/2.0.6/src/x64/builtins-x64.cc +1255 -0
- data/ext/v8/upstream/2.0.6/src/x64/codegen-x64-inl.h +46 -0
- data/ext/v8/upstream/2.0.6/src/x64/codegen-x64.cc +8223 -0
- data/ext/v8/upstream/2.0.6/src/x64/codegen-x64.h +785 -0
- data/ext/v8/upstream/2.0.6/src/x64/cpu-x64.cc +79 -0
- data/ext/v8/upstream/2.0.6/src/x64/debug-x64.cc +202 -0
- data/ext/v8/upstream/2.0.6/src/x64/disasm-x64.cc +1596 -0
- data/ext/v8/upstream/2.0.6/src/x64/fast-codegen-x64.cc +1820 -0
- data/ext/v8/upstream/2.0.6/src/x64/frames-x64.cc +109 -0
- data/ext/v8/upstream/2.0.6/src/x64/frames-x64.h +121 -0
- data/ext/v8/upstream/2.0.6/src/x64/ic-x64.cc +1392 -0
- data/ext/v8/upstream/2.0.6/src/x64/jump-target-x64.cc +432 -0
- data/ext/v8/upstream/2.0.6/src/x64/macro-assembler-x64.cc +2409 -0
- data/ext/v8/upstream/2.0.6/src/x64/macro-assembler-x64.h +765 -0
- data/ext/v8/upstream/2.0.6/src/x64/regexp-macro-assembler-x64.cc +1337 -0
- data/ext/v8/upstream/2.0.6/src/x64/regexp-macro-assembler-x64.h +295 -0
- data/ext/v8/upstream/2.0.6/src/x64/register-allocator-x64-inl.h +86 -0
- data/ext/v8/upstream/2.0.6/src/x64/register-allocator-x64.cc +84 -0
- data/ext/v8/upstream/2.0.6/src/x64/register-allocator-x64.h +43 -0
- data/ext/v8/upstream/2.0.6/src/x64/simulator-x64.cc +27 -0
- data/ext/v8/upstream/2.0.6/src/x64/simulator-x64.h +63 -0
- data/ext/v8/upstream/2.0.6/src/x64/stub-cache-x64.cc +1884 -0
- data/ext/v8/upstream/2.0.6/src/x64/virtual-frame-x64.cc +1089 -0
- data/ext/v8/upstream/2.0.6/src/x64/virtual-frame-x64.h +560 -0
- data/ext/v8/upstream/2.0.6/src/zone-inl.h +297 -0
- data/ext/v8/upstream/2.0.6/src/zone.cc +193 -0
- data/ext/v8/upstream/2.0.6/src/zone.h +305 -0
- data/ext/v8/upstream/2.0.6/tools/codemap.js +258 -0
- data/ext/v8/upstream/2.0.6/tools/consarray.js +93 -0
- data/ext/v8/upstream/2.0.6/tools/csvparser.js +98 -0
- data/ext/v8/upstream/2.0.6/tools/gyp/v8.gyp +620 -0
- data/ext/v8/upstream/2.0.6/tools/js2c.py +376 -0
- data/ext/v8/upstream/2.0.6/tools/jsmin.py +280 -0
- data/ext/v8/upstream/2.0.6/tools/linux-tick-processor +24 -0
- data/ext/v8/upstream/2.0.6/tools/linux-tick-processor.py +78 -0
- data/ext/v8/upstream/2.0.6/tools/logreader.js +320 -0
- data/ext/v8/upstream/2.0.6/tools/mac-nm +18 -0
- data/ext/v8/upstream/2.0.6/tools/mac-tick-processor +6 -0
- data/ext/v8/upstream/2.0.6/tools/oprofile/annotate +7 -0
- data/ext/v8/upstream/2.0.6/tools/oprofile/common +19 -0
- data/ext/v8/upstream/2.0.6/tools/oprofile/dump +7 -0
- data/ext/v8/upstream/2.0.6/tools/oprofile/report +7 -0
- data/ext/v8/upstream/2.0.6/tools/oprofile/reset +7 -0
- data/ext/v8/upstream/2.0.6/tools/oprofile/run +14 -0
- data/ext/v8/upstream/2.0.6/tools/oprofile/shutdown +7 -0
- data/ext/v8/upstream/2.0.6/tools/oprofile/start +7 -0
- data/ext/v8/upstream/2.0.6/tools/presubmit.py +299 -0
- data/ext/v8/upstream/2.0.6/tools/process-heap-prof.py +120 -0
- data/ext/v8/upstream/2.0.6/tools/profile.js +621 -0
- data/ext/v8/upstream/2.0.6/tools/profile_view.js +224 -0
- data/ext/v8/upstream/2.0.6/tools/run-valgrind.py +77 -0
- data/ext/v8/upstream/2.0.6/tools/splaytree.js +322 -0
- data/ext/v8/upstream/2.0.6/tools/splaytree.py +226 -0
- data/ext/v8/upstream/2.0.6/tools/stats-viewer.py +456 -0
- data/ext/v8/upstream/2.0.6/tools/test.py +1370 -0
- data/ext/v8/upstream/2.0.6/tools/tickprocessor-driver.js +53 -0
- data/ext/v8/upstream/2.0.6/tools/tickprocessor.js +731 -0
- data/ext/v8/upstream/2.0.6/tools/tickprocessor.py +535 -0
- data/ext/v8/upstream/2.0.6/tools/utils.py +82 -0
- data/ext/v8/upstream/2.0.6/tools/visual_studio/README.txt +71 -0
- data/ext/v8/upstream/2.0.6/tools/visual_studio/arm.vsprops +14 -0
- data/ext/v8/upstream/2.0.6/tools/visual_studio/common.vsprops +35 -0
- data/ext/v8/upstream/2.0.6/tools/visual_studio/d8.vcproj +199 -0
- data/ext/v8/upstream/2.0.6/tools/visual_studio/d8_arm.vcproj +199 -0
- data/ext/v8/upstream/2.0.6/tools/visual_studio/d8_x64.vcproj +201 -0
- data/ext/v8/upstream/2.0.6/tools/visual_studio/d8js2c.cmd +6 -0
- data/ext/v8/upstream/2.0.6/tools/visual_studio/debug.vsprops +17 -0
- data/ext/v8/upstream/2.0.6/tools/visual_studio/ia32.vsprops +13 -0
- data/ext/v8/upstream/2.0.6/tools/visual_studio/js2c.cmd +6 -0
- data/ext/v8/upstream/2.0.6/tools/visual_studio/release.vsprops +24 -0
- data/ext/v8/upstream/2.0.6/tools/visual_studio/v8.sln +101 -0
- data/ext/v8/upstream/2.0.6/tools/visual_studio/v8.vcproj +223 -0
- data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_arm.sln +74 -0
- data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_arm.vcproj +223 -0
- data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_base.vcproj +971 -0
- data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_base_arm.vcproj +983 -0
- data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_base_x64.vcproj +959 -0
- data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_cctest.vcproj +255 -0
- data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_cctest_arm.vcproj +243 -0
- data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_cctest_x64.vcproj +257 -0
- data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_mksnapshot.vcproj +151 -0
- data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_mksnapshot_x64.vcproj +151 -0
- data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_process_sample.vcproj +151 -0
- data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_process_sample_arm.vcproj +151 -0
- data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_process_sample_x64.vcproj +151 -0
- data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_shell_sample.vcproj +151 -0
- data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_shell_sample_arm.vcproj +151 -0
- data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_shell_sample_x64.vcproj +153 -0
- data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_snapshot.vcproj +142 -0
- data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_snapshot_cc.vcproj +92 -0
- data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_snapshot_cc_x64.vcproj +92 -0
- data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_snapshot_x64.vcproj +142 -0
- data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_x64.sln +101 -0
- data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_x64.vcproj +223 -0
- data/ext/v8/upstream/2.0.6/tools/visual_studio/x64.vsprops +13 -0
- data/ext/v8/upstream/2.0.6/tools/windows-tick-processor.bat +5 -0
- data/ext/v8/upstream/2.0.6/tools/windows-tick-processor.py +137 -0
- data/ext/v8/upstream/Makefile +31 -0
- data/ext/v8/upstream/no-strict-aliasing.patch +13 -0
- data/ext/v8/upstream/scons/CHANGES.txt +5183 -0
- data/ext/v8/upstream/scons/LICENSE.txt +20 -0
- data/ext/v8/upstream/scons/MANIFEST +202 -0
- data/ext/v8/upstream/scons/PKG-INFO +13 -0
- data/ext/v8/upstream/scons/README.txt +273 -0
- data/ext/v8/upstream/scons/RELEASE.txt +1040 -0
- data/ext/v8/upstream/scons/engine/SCons/Action.py +1256 -0
- data/ext/v8/upstream/scons/engine/SCons/Builder.py +868 -0
- data/ext/v8/upstream/scons/engine/SCons/CacheDir.py +217 -0
- data/ext/v8/upstream/scons/engine/SCons/Conftest.py +794 -0
- data/ext/v8/upstream/scons/engine/SCons/Debug.py +237 -0
- data/ext/v8/upstream/scons/engine/SCons/Defaults.py +485 -0
- data/ext/v8/upstream/scons/engine/SCons/Environment.py +2327 -0
- data/ext/v8/upstream/scons/engine/SCons/Errors.py +207 -0
- data/ext/v8/upstream/scons/engine/SCons/Executor.py +636 -0
- data/ext/v8/upstream/scons/engine/SCons/Job.py +435 -0
- data/ext/v8/upstream/scons/engine/SCons/Memoize.py +292 -0
- data/ext/v8/upstream/scons/engine/SCons/Node/Alias.py +153 -0
- data/ext/v8/upstream/scons/engine/SCons/Node/FS.py +3220 -0
- data/ext/v8/upstream/scons/engine/SCons/Node/Python.py +128 -0
- data/ext/v8/upstream/scons/engine/SCons/Node/__init__.py +1341 -0
- data/ext/v8/upstream/scons/engine/SCons/Options/BoolOption.py +50 -0
- data/ext/v8/upstream/scons/engine/SCons/Options/EnumOption.py +50 -0
- data/ext/v8/upstream/scons/engine/SCons/Options/ListOption.py +50 -0
- data/ext/v8/upstream/scons/engine/SCons/Options/PackageOption.py +50 -0
- data/ext/v8/upstream/scons/engine/SCons/Options/PathOption.py +76 -0
- data/ext/v8/upstream/scons/engine/SCons/Options/__init__.py +74 -0
- data/ext/v8/upstream/scons/engine/SCons/PathList.py +232 -0
- data/ext/v8/upstream/scons/engine/SCons/Platform/__init__.py +236 -0
- data/ext/v8/upstream/scons/engine/SCons/Platform/aix.py +70 -0
- data/ext/v8/upstream/scons/engine/SCons/Platform/cygwin.py +55 -0
- data/ext/v8/upstream/scons/engine/SCons/Platform/darwin.py +46 -0
- data/ext/v8/upstream/scons/engine/SCons/Platform/hpux.py +46 -0
- data/ext/v8/upstream/scons/engine/SCons/Platform/irix.py +44 -0
- data/ext/v8/upstream/scons/engine/SCons/Platform/os2.py +58 -0
- data/ext/v8/upstream/scons/engine/SCons/Platform/posix.py +264 -0
- data/ext/v8/upstream/scons/engine/SCons/Platform/sunos.py +50 -0
- data/ext/v8/upstream/scons/engine/SCons/Platform/win32.py +386 -0
- data/ext/v8/upstream/scons/engine/SCons/SConf.py +1038 -0
- data/ext/v8/upstream/scons/engine/SCons/SConsign.py +381 -0
- data/ext/v8/upstream/scons/engine/SCons/Scanner/C.py +132 -0
- data/ext/v8/upstream/scons/engine/SCons/Scanner/D.py +74 -0
- data/ext/v8/upstream/scons/engine/SCons/Scanner/Dir.py +111 -0
- data/ext/v8/upstream/scons/engine/SCons/Scanner/Fortran.py +320 -0
- data/ext/v8/upstream/scons/engine/SCons/Scanner/IDL.py +48 -0
- data/ext/v8/upstream/scons/engine/SCons/Scanner/LaTeX.py +378 -0
- data/ext/v8/upstream/scons/engine/SCons/Scanner/Prog.py +103 -0
- data/ext/v8/upstream/scons/engine/SCons/Scanner/RC.py +55 -0
- data/ext/v8/upstream/scons/engine/SCons/Scanner/__init__.py +415 -0
- data/ext/v8/upstream/scons/engine/SCons/Script/Interactive.py +386 -0
- data/ext/v8/upstream/scons/engine/SCons/Script/Main.py +1360 -0
- data/ext/v8/upstream/scons/engine/SCons/Script/SConsOptions.py +944 -0
- data/ext/v8/upstream/scons/engine/SCons/Script/SConscript.py +642 -0
- data/ext/v8/upstream/scons/engine/SCons/Script/__init__.py +414 -0
- data/ext/v8/upstream/scons/engine/SCons/Sig.py +63 -0
- data/ext/v8/upstream/scons/engine/SCons/Subst.py +911 -0
- data/ext/v8/upstream/scons/engine/SCons/Taskmaster.py +1030 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/386asm.py +61 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/BitKeeper.py +65 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/CVS.py +73 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/FortranCommon.py +247 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/JavaCommon.py +324 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/__init__.py +56 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/arch.py +61 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/common.py +210 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/netframework.py +84 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/sdk.py +321 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/vc.py +367 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/vs.py +497 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/Perforce.py +104 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/PharLapCommon.py +138 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/RCS.py +64 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/SCCS.py +64 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/Subversion.py +71 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/__init__.py +675 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/aixc++.py +82 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/aixcc.py +74 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/aixf77.py +80 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/aixlink.py +76 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/applelink.py +71 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/ar.py +63 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/as.py +78 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/bcc32.py +82 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/c++.py +99 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/cc.py +114 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/cvf.py +58 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/default.py +50 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/dmd.py +224 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/dvi.py +64 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/dvipdf.py +125 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/dvips.py +94 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/f77.py +62 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/f90.py +62 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/f95.py +63 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/filesystem.py +98 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/fortran.py +63 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/g++.py +90 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/g77.py +73 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/gas.py +53 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/gcc.py +80 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/gfortran.py +64 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/gnulink.py +63 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/gs.py +81 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/hpc++.py +85 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/hpcc.py +53 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/hplink.py +77 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/icc.py +59 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/icl.py +52 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/ifl.py +72 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/ifort.py +90 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/ilink.py +59 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/ilink32.py +60 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/install.py +229 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/intelc.py +490 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/ipkg.py +71 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/jar.py +110 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/javac.py +234 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/javah.py +138 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/latex.py +79 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/lex.py +99 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/link.py +121 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/linkloc.py +112 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/m4.py +63 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/masm.py +77 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/midl.py +90 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/mingw.py +159 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/mslib.py +64 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/mslink.py +266 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/mssdk.py +50 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/msvc.py +269 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/msvs.py +1439 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/mwcc.py +208 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/mwld.py +107 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/nasm.py +72 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/__init__.py +314 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/ipk.py +185 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/msi.py +526 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/rpm.py +367 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_tarbz2.py +43 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_targz.py +43 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_zip.py +43 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/tarbz2.py +44 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/targz.py +44 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/zip.py +44 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/pdf.py +78 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/pdflatex.py +83 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/pdftex.py +108 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/qt.py +336 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/rmic.py +121 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/rpcgen.py +70 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/rpm.py +132 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/sgiar.py +68 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/sgic++.py +58 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/sgicc.py +53 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/sgilink.py +63 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/sunar.py +67 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/sunc++.py +142 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/suncc.py +58 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/sunf77.py +63 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/sunf90.py +64 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/sunf95.py +64 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/sunlink.py +77 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/swig.py +186 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/tar.py +73 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/tex.py +805 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/textfile.py +175 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/tlib.py +53 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/wix.py +100 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/yacc.py +131 -0
- data/ext/v8/upstream/scons/engine/SCons/Tool/zip.py +100 -0
- data/ext/v8/upstream/scons/engine/SCons/Util.py +1645 -0
- data/ext/v8/upstream/scons/engine/SCons/Variables/BoolVariable.py +91 -0
- data/ext/v8/upstream/scons/engine/SCons/Variables/EnumVariable.py +107 -0
- data/ext/v8/upstream/scons/engine/SCons/Variables/ListVariable.py +139 -0
- data/ext/v8/upstream/scons/engine/SCons/Variables/PackageVariable.py +109 -0
- data/ext/v8/upstream/scons/engine/SCons/Variables/PathVariable.py +147 -0
- data/ext/v8/upstream/scons/engine/SCons/Variables/__init__.py +317 -0
- data/ext/v8/upstream/scons/engine/SCons/Warnings.py +228 -0
- data/ext/v8/upstream/scons/engine/SCons/__init__.py +49 -0
- data/ext/v8/upstream/scons/engine/SCons/compat/__init__.py +302 -0
- data/ext/v8/upstream/scons/engine/SCons/compat/_scons_UserString.py +98 -0
- data/ext/v8/upstream/scons/engine/SCons/compat/_scons_hashlib.py +91 -0
- data/ext/v8/upstream/scons/engine/SCons/compat/_scons_itertools.py +124 -0
- data/ext/v8/upstream/scons/engine/SCons/compat/_scons_optparse.py +1725 -0
- data/ext/v8/upstream/scons/engine/SCons/compat/_scons_sets.py +583 -0
- data/ext/v8/upstream/scons/engine/SCons/compat/_scons_sets15.py +176 -0
- data/ext/v8/upstream/scons/engine/SCons/compat/_scons_shlex.py +325 -0
- data/ext/v8/upstream/scons/engine/SCons/compat/_scons_subprocess.py +1296 -0
- data/ext/v8/upstream/scons/engine/SCons/compat/_scons_textwrap.py +382 -0
- data/ext/v8/upstream/scons/engine/SCons/compat/builtins.py +187 -0
- data/ext/v8/upstream/scons/engine/SCons/cpp.py +598 -0
- data/ext/v8/upstream/scons/engine/SCons/dblite.py +248 -0
- data/ext/v8/upstream/scons/engine/SCons/exitfuncs.py +77 -0
- data/ext/v8/upstream/scons/os_spawnv_fix.diff +83 -0
- data/ext/v8/upstream/scons/scons-time.1 +1017 -0
- data/ext/v8/upstream/scons/scons.1 +15179 -0
- data/ext/v8/upstream/scons/sconsign.1 +208 -0
- data/ext/v8/upstream/scons/script/scons +184 -0
- data/ext/v8/upstream/scons/script/scons-time +1529 -0
- data/ext/v8/upstream/scons/script/scons.bat +31 -0
- data/ext/v8/upstream/scons/script/sconsign +508 -0
- data/ext/v8/upstream/scons/setup.cfg +6 -0
- data/ext/v8/upstream/scons/setup.py +427 -0
- data/ext/v8/v8.cpp +89 -0
- data/ext/v8/v8_cxt.cpp +92 -0
- data/ext/v8/v8_cxt.h +20 -0
- data/ext/v8/v8_func.cpp +10 -0
- data/ext/v8/v8_func.h +11 -0
- data/ext/v8/v8_msg.cpp +54 -0
- data/ext/v8/v8_msg.h +18 -0
- data/ext/v8/v8_obj.cpp +52 -0
- data/ext/v8/v8_obj.h +13 -0
- data/ext/v8/v8_ref.cpp +26 -0
- data/ext/v8/v8_ref.h +31 -0
- data/ext/v8/v8_script.cpp +20 -0
- data/ext/v8/v8_script.h +8 -0
- data/ext/v8/v8_standalone.cpp +69 -0
- data/ext/v8/v8_standalone.h +31 -0
- data/ext/v8/v8_str.cpp +17 -0
- data/ext/v8/v8_str.h +9 -0
- data/ext/v8/v8_template.cpp +53 -0
- data/ext/v8/v8_template.h +13 -0
- data/lib/v8.rb +10 -0
- data/lib/v8/context.rb +101 -0
- data/lib/v8/object.rb +38 -0
- data/lib/v8/to.rb +33 -0
- data/lib/v8/v8.so +0 -0
- data/script/console +10 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/spec/ext/cxt_spec.rb +25 -0
- data/spec/ext/obj_spec.rb +13 -0
- data/spec/redjs/jsapi_spec.rb +405 -0
- data/spec/redjs/tap.rb +8 -0
- data/spec/redjs_helper.rb +3 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +14 -0
- data/spec/v8/to_spec.rb +15 -0
- data/tasks/rspec.rake +21 -0
- data/therubyracer.gemspec +680 -0
- metadata +697 -0
@@ -0,0 +1,325 @@
|
|
1
|
+
// Copyright (c) 1994-2006 Sun Microsystems Inc.
|
2
|
+
// All Rights Reserved.
|
3
|
+
//
|
4
|
+
// Redistribution and use in source and binary forms, with or without
|
5
|
+
// modification, are permitted provided that the following conditions are
|
6
|
+
// met:
|
7
|
+
//
|
8
|
+
// - Redistributions of source code must retain the above copyright notice,
|
9
|
+
// this list of conditions and the following disclaimer.
|
10
|
+
//
|
11
|
+
// - Redistribution in binary form must reproduce the above copyright
|
12
|
+
// notice, this list of conditions and the following disclaimer in the
|
13
|
+
// documentation and/or other materials provided with the distribution.
|
14
|
+
//
|
15
|
+
// - Neither the name of Sun Microsystems or the names of contributors may
|
16
|
+
// be used to endorse or promote products derived from this software without
|
17
|
+
// specific prior written permission.
|
18
|
+
//
|
19
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
20
|
+
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
21
|
+
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
22
|
+
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
23
|
+
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
24
|
+
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
25
|
+
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
26
|
+
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
27
|
+
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
28
|
+
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
29
|
+
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
30
|
+
|
31
|
+
// The original source code covered by the above license above has been
|
32
|
+
// modified significantly by Google Inc.
|
33
|
+
// Copyright 2006-2008 the V8 project authors. All rights reserved.
|
34
|
+
|
35
|
+
// A light-weight IA32 Assembler.
|
36
|
+
|
37
|
+
#ifndef V8_IA32_ASSEMBLER_IA32_INL_H_
|
38
|
+
#define V8_IA32_ASSEMBLER_IA32_INL_H_
|
39
|
+
|
40
|
+
#include "cpu.h"
|
41
|
+
|
42
|
+
namespace v8 {
|
43
|
+
namespace internal {
|
44
|
+
|
45
|
+
Condition NegateCondition(Condition cc) {
|
46
|
+
return static_cast<Condition>(cc ^ 1);
|
47
|
+
}
|
48
|
+
|
49
|
+
|
50
|
+
// The modes possibly affected by apply must be in kApplyMask.
|
51
|
+
void RelocInfo::apply(intptr_t delta) {
|
52
|
+
if (rmode_ == RUNTIME_ENTRY || IsCodeTarget(rmode_)) {
|
53
|
+
int32_t* p = reinterpret_cast<int32_t*>(pc_);
|
54
|
+
*p -= delta; // relocate entry
|
55
|
+
} else if (rmode_ == JS_RETURN && IsPatchedReturnSequence()) {
|
56
|
+
// Special handling of js_return when a break point is set (call
|
57
|
+
// instruction has been inserted).
|
58
|
+
int32_t* p = reinterpret_cast<int32_t*>(pc_ + 1);
|
59
|
+
*p -= delta; // relocate entry
|
60
|
+
} else if (IsInternalReference(rmode_)) {
|
61
|
+
// absolute code pointer inside code object moves with the code object.
|
62
|
+
int32_t* p = reinterpret_cast<int32_t*>(pc_);
|
63
|
+
*p += delta; // relocate entry
|
64
|
+
}
|
65
|
+
}
|
66
|
+
|
67
|
+
|
68
|
+
Address RelocInfo::target_address() {
|
69
|
+
ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY);
|
70
|
+
return Assembler::target_address_at(pc_);
|
71
|
+
}
|
72
|
+
|
73
|
+
|
74
|
+
Address RelocInfo::target_address_address() {
|
75
|
+
ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY);
|
76
|
+
return reinterpret_cast<Address>(pc_);
|
77
|
+
}
|
78
|
+
|
79
|
+
|
80
|
+
void RelocInfo::set_target_address(Address target) {
|
81
|
+
ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY);
|
82
|
+
Assembler::set_target_address_at(pc_, target);
|
83
|
+
}
|
84
|
+
|
85
|
+
|
86
|
+
Object* RelocInfo::target_object() {
|
87
|
+
ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
|
88
|
+
return Memory::Object_at(pc_);
|
89
|
+
}
|
90
|
+
|
91
|
+
|
92
|
+
Handle<Object> RelocInfo::target_object_handle(Assembler* origin) {
|
93
|
+
ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
|
94
|
+
return Memory::Object_Handle_at(pc_);
|
95
|
+
}
|
96
|
+
|
97
|
+
|
98
|
+
Object** RelocInfo::target_object_address() {
|
99
|
+
ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
|
100
|
+
return &Memory::Object_at(pc_);
|
101
|
+
}
|
102
|
+
|
103
|
+
|
104
|
+
void RelocInfo::set_target_object(Object* target) {
|
105
|
+
ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
|
106
|
+
Memory::Object_at(pc_) = target;
|
107
|
+
}
|
108
|
+
|
109
|
+
|
110
|
+
Address* RelocInfo::target_reference_address() {
|
111
|
+
ASSERT(rmode_ == RelocInfo::EXTERNAL_REFERENCE);
|
112
|
+
return reinterpret_cast<Address*>(pc_);
|
113
|
+
}
|
114
|
+
|
115
|
+
|
116
|
+
Address RelocInfo::call_address() {
|
117
|
+
ASSERT(IsPatchedReturnSequence());
|
118
|
+
return Assembler::target_address_at(pc_ + 1);
|
119
|
+
}
|
120
|
+
|
121
|
+
|
122
|
+
void RelocInfo::set_call_address(Address target) {
|
123
|
+
ASSERT(IsPatchedReturnSequence());
|
124
|
+
Assembler::set_target_address_at(pc_ + 1, target);
|
125
|
+
}
|
126
|
+
|
127
|
+
|
128
|
+
Object* RelocInfo::call_object() {
|
129
|
+
ASSERT(IsPatchedReturnSequence());
|
130
|
+
return *call_object_address();
|
131
|
+
}
|
132
|
+
|
133
|
+
|
134
|
+
Object** RelocInfo::call_object_address() {
|
135
|
+
ASSERT(IsPatchedReturnSequence());
|
136
|
+
return reinterpret_cast<Object**>(pc_ + 1);
|
137
|
+
}
|
138
|
+
|
139
|
+
|
140
|
+
void RelocInfo::set_call_object(Object* target) {
|
141
|
+
ASSERT(IsPatchedReturnSequence());
|
142
|
+
*call_object_address() = target;
|
143
|
+
}
|
144
|
+
|
145
|
+
|
146
|
+
bool RelocInfo::IsPatchedReturnSequence() {
|
147
|
+
return *pc_ == 0xE8;
|
148
|
+
}
|
149
|
+
|
150
|
+
|
151
|
+
Immediate::Immediate(int x) {
|
152
|
+
x_ = x;
|
153
|
+
rmode_ = RelocInfo::NONE;
|
154
|
+
}
|
155
|
+
|
156
|
+
|
157
|
+
Immediate::Immediate(const ExternalReference& ext) {
|
158
|
+
x_ = reinterpret_cast<int32_t>(ext.address());
|
159
|
+
rmode_ = RelocInfo::EXTERNAL_REFERENCE;
|
160
|
+
}
|
161
|
+
|
162
|
+
Immediate::Immediate(const char* s) {
|
163
|
+
x_ = reinterpret_cast<int32_t>(s);
|
164
|
+
rmode_ = RelocInfo::EMBEDDED_STRING;
|
165
|
+
}
|
166
|
+
|
167
|
+
|
168
|
+
Immediate::Immediate(Label* internal_offset) {
|
169
|
+
x_ = reinterpret_cast<int32_t>(internal_offset);
|
170
|
+
rmode_ = RelocInfo::INTERNAL_REFERENCE;
|
171
|
+
}
|
172
|
+
|
173
|
+
|
174
|
+
Immediate::Immediate(Handle<Object> handle) {
|
175
|
+
// Verify all Objects referred by code are NOT in new space.
|
176
|
+
Object* obj = *handle;
|
177
|
+
ASSERT(!Heap::InNewSpace(obj));
|
178
|
+
if (obj->IsHeapObject()) {
|
179
|
+
x_ = reinterpret_cast<intptr_t>(handle.location());
|
180
|
+
rmode_ = RelocInfo::EMBEDDED_OBJECT;
|
181
|
+
} else {
|
182
|
+
// no relocation needed
|
183
|
+
x_ = reinterpret_cast<intptr_t>(obj);
|
184
|
+
rmode_ = RelocInfo::NONE;
|
185
|
+
}
|
186
|
+
}
|
187
|
+
|
188
|
+
|
189
|
+
Immediate::Immediate(Smi* value) {
|
190
|
+
x_ = reinterpret_cast<intptr_t>(value);
|
191
|
+
rmode_ = RelocInfo::NONE;
|
192
|
+
}
|
193
|
+
|
194
|
+
|
195
|
+
void Assembler::emit(uint32_t x) {
|
196
|
+
*reinterpret_cast<uint32_t*>(pc_) = x;
|
197
|
+
pc_ += sizeof(uint32_t);
|
198
|
+
}
|
199
|
+
|
200
|
+
|
201
|
+
void Assembler::emit(Handle<Object> handle) {
|
202
|
+
// Verify all Objects referred by code are NOT in new space.
|
203
|
+
Object* obj = *handle;
|
204
|
+
ASSERT(!Heap::InNewSpace(obj));
|
205
|
+
if (obj->IsHeapObject()) {
|
206
|
+
emit(reinterpret_cast<intptr_t>(handle.location()),
|
207
|
+
RelocInfo::EMBEDDED_OBJECT);
|
208
|
+
} else {
|
209
|
+
// no relocation needed
|
210
|
+
emit(reinterpret_cast<intptr_t>(obj));
|
211
|
+
}
|
212
|
+
}
|
213
|
+
|
214
|
+
|
215
|
+
void Assembler::emit(uint32_t x, RelocInfo::Mode rmode) {
|
216
|
+
if (rmode != RelocInfo::NONE) RecordRelocInfo(rmode);
|
217
|
+
emit(x);
|
218
|
+
}
|
219
|
+
|
220
|
+
|
221
|
+
void Assembler::emit(const Immediate& x) {
|
222
|
+
if (x.rmode_ == RelocInfo::INTERNAL_REFERENCE) {
|
223
|
+
Label* label = reinterpret_cast<Label*>(x.x_);
|
224
|
+
emit_code_relative_offset(label);
|
225
|
+
return;
|
226
|
+
}
|
227
|
+
if (x.rmode_ != RelocInfo::NONE) RecordRelocInfo(x.rmode_);
|
228
|
+
emit(x.x_);
|
229
|
+
}
|
230
|
+
|
231
|
+
|
232
|
+
void Assembler::emit_code_relative_offset(Label* label) {
|
233
|
+
if (label->is_bound()) {
|
234
|
+
int32_t pos;
|
235
|
+
pos = label->pos() + Code::kHeaderSize - kHeapObjectTag;
|
236
|
+
emit(pos);
|
237
|
+
} else {
|
238
|
+
emit_disp(label, Displacement::CODE_RELATIVE);
|
239
|
+
}
|
240
|
+
}
|
241
|
+
|
242
|
+
|
243
|
+
void Assembler::emit_w(const Immediate& x) {
|
244
|
+
ASSERT(x.rmode_ == RelocInfo::NONE);
|
245
|
+
uint16_t value = static_cast<uint16_t>(x.x_);
|
246
|
+
reinterpret_cast<uint16_t*>(pc_)[0] = value;
|
247
|
+
pc_ += sizeof(uint16_t);
|
248
|
+
}
|
249
|
+
|
250
|
+
|
251
|
+
Address Assembler::target_address_at(Address pc) {
|
252
|
+
return pc + sizeof(int32_t) + *reinterpret_cast<int32_t*>(pc);
|
253
|
+
}
|
254
|
+
|
255
|
+
|
256
|
+
void Assembler::set_target_address_at(Address pc, Address target) {
|
257
|
+
int32_t* p = reinterpret_cast<int32_t*>(pc);
|
258
|
+
*p = target - (pc + sizeof(int32_t));
|
259
|
+
CPU::FlushICache(p, sizeof(int32_t));
|
260
|
+
}
|
261
|
+
|
262
|
+
|
263
|
+
Displacement Assembler::disp_at(Label* L) {
|
264
|
+
return Displacement(long_at(L->pos()));
|
265
|
+
}
|
266
|
+
|
267
|
+
|
268
|
+
void Assembler::disp_at_put(Label* L, Displacement disp) {
|
269
|
+
long_at_put(L->pos(), disp.data());
|
270
|
+
}
|
271
|
+
|
272
|
+
|
273
|
+
void Assembler::emit_disp(Label* L, Displacement::Type type) {
|
274
|
+
Displacement disp(L, type);
|
275
|
+
L->link_to(pc_offset());
|
276
|
+
emit(static_cast<int>(disp.data()));
|
277
|
+
}
|
278
|
+
|
279
|
+
|
280
|
+
void Operand::set_modrm(int mod, Register rm) {
|
281
|
+
ASSERT((mod & -4) == 0);
|
282
|
+
buf_[0] = mod << 6 | rm.code();
|
283
|
+
len_ = 1;
|
284
|
+
}
|
285
|
+
|
286
|
+
|
287
|
+
void Operand::set_sib(ScaleFactor scale, Register index, Register base) {
|
288
|
+
ASSERT(len_ == 1);
|
289
|
+
ASSERT((scale & -4) == 0);
|
290
|
+
// Use SIB with no index register only for base esp.
|
291
|
+
ASSERT(!index.is(esp) || base.is(esp));
|
292
|
+
buf_[1] = scale << 6 | index.code() << 3 | base.code();
|
293
|
+
len_ = 2;
|
294
|
+
}
|
295
|
+
|
296
|
+
|
297
|
+
void Operand::set_disp8(int8_t disp) {
|
298
|
+
ASSERT(len_ == 1 || len_ == 2);
|
299
|
+
*reinterpret_cast<int8_t*>(&buf_[len_++]) = disp;
|
300
|
+
}
|
301
|
+
|
302
|
+
|
303
|
+
void Operand::set_dispr(int32_t disp, RelocInfo::Mode rmode) {
|
304
|
+
ASSERT(len_ == 1 || len_ == 2);
|
305
|
+
int32_t* p = reinterpret_cast<int32_t*>(&buf_[len_]);
|
306
|
+
*p = disp;
|
307
|
+
len_ += sizeof(int32_t);
|
308
|
+
rmode_ = rmode;
|
309
|
+
}
|
310
|
+
|
311
|
+
Operand::Operand(Register reg) {
|
312
|
+
// reg
|
313
|
+
set_modrm(3, reg);
|
314
|
+
}
|
315
|
+
|
316
|
+
|
317
|
+
Operand::Operand(int32_t disp, RelocInfo::Mode rmode) {
|
318
|
+
// [disp/r]
|
319
|
+
set_modrm(0, ebp);
|
320
|
+
set_dispr(disp, rmode);
|
321
|
+
}
|
322
|
+
|
323
|
+
} } // namespace v8::internal
|
324
|
+
|
325
|
+
#endif // V8_IA32_ASSEMBLER_IA32_INL_H_
|
@@ -0,0 +1,2375 @@
|
|
1
|
+
// Copyright (c) 1994-2006 Sun Microsystems Inc.
|
2
|
+
// All Rights Reserved.
|
3
|
+
//
|
4
|
+
// Redistribution and use in source and binary forms, with or without
|
5
|
+
// modification, are permitted provided that the following conditions
|
6
|
+
// are met:
|
7
|
+
//
|
8
|
+
// - Redistributions of source code must retain the above copyright notice,
|
9
|
+
// this list of conditions and the following disclaimer.
|
10
|
+
//
|
11
|
+
// - Redistribution in binary form must reproduce the above copyright
|
12
|
+
// notice, this list of conditions and the following disclaimer in the
|
13
|
+
// documentation and/or other materials provided with the
|
14
|
+
// distribution.
|
15
|
+
//
|
16
|
+
// - Neither the name of Sun Microsystems or the names of contributors may
|
17
|
+
// be used to endorse or promote products derived from this software without
|
18
|
+
// specific prior written permission.
|
19
|
+
//
|
20
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
21
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
22
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
23
|
+
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
24
|
+
// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
25
|
+
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
26
|
+
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
27
|
+
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
28
|
+
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
29
|
+
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
30
|
+
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
31
|
+
// OF THE POSSIBILITY OF SUCH DAMAGE.
|
32
|
+
|
33
|
+
// The original source code covered by the above license above has been modified
|
34
|
+
// significantly by Google Inc.
|
35
|
+
// Copyright 2006-2008 the V8 project authors. All rights reserved.
|
36
|
+
|
37
|
+
#include "v8.h"
|
38
|
+
|
39
|
+
#include "disassembler.h"
|
40
|
+
#include "macro-assembler.h"
|
41
|
+
#include "serialize.h"
|
42
|
+
|
43
|
+
namespace v8 {
|
44
|
+
namespace internal {
|
45
|
+
|
46
|
+
// -----------------------------------------------------------------------------
|
47
|
+
// Implementation of CpuFeatures
|
48
|
+
|
49
|
+
// Safe default is no features.
|
50
|
+
uint64_t CpuFeatures::supported_ = 0;
|
51
|
+
uint64_t CpuFeatures::enabled_ = 0;
|
52
|
+
uint64_t CpuFeatures::found_by_runtime_probing_ = 0;
|
53
|
+
|
54
|
+
|
55
|
+
// The Probe method needs executable memory, so it uses Heap::CreateCode.
|
56
|
+
// Allocation failure is silent and leads to safe default.
|
57
|
+
void CpuFeatures::Probe() {
|
58
|
+
ASSERT(Heap::HasBeenSetup());
|
59
|
+
ASSERT(supported_ == 0);
|
60
|
+
if (Serializer::enabled()) {
|
61
|
+
supported_ |= OS::CpuFeaturesImpliedByPlatform();
|
62
|
+
return; // No features if we might serialize.
|
63
|
+
}
|
64
|
+
|
65
|
+
Assembler assm(NULL, 0);
|
66
|
+
Label cpuid, done;
|
67
|
+
#define __ assm.
|
68
|
+
// Save old esp, since we are going to modify the stack.
|
69
|
+
__ push(ebp);
|
70
|
+
__ pushfd();
|
71
|
+
__ push(ecx);
|
72
|
+
__ push(ebx);
|
73
|
+
__ mov(ebp, Operand(esp));
|
74
|
+
|
75
|
+
// If we can modify bit 21 of the EFLAGS register, then CPUID is supported.
|
76
|
+
__ pushfd();
|
77
|
+
__ pop(eax);
|
78
|
+
__ mov(edx, Operand(eax));
|
79
|
+
__ xor_(eax, 0x200000); // Flip bit 21.
|
80
|
+
__ push(eax);
|
81
|
+
__ popfd();
|
82
|
+
__ pushfd();
|
83
|
+
__ pop(eax);
|
84
|
+
__ xor_(eax, Operand(edx)); // Different if CPUID is supported.
|
85
|
+
__ j(not_zero, &cpuid);
|
86
|
+
|
87
|
+
// CPUID not supported. Clear the supported features in edx:eax.
|
88
|
+
__ xor_(eax, Operand(eax));
|
89
|
+
__ xor_(edx, Operand(edx));
|
90
|
+
__ jmp(&done);
|
91
|
+
|
92
|
+
// Invoke CPUID with 1 in eax to get feature information in
|
93
|
+
// ecx:edx. Temporarily enable CPUID support because we know it's
|
94
|
+
// safe here.
|
95
|
+
__ bind(&cpuid);
|
96
|
+
__ mov(eax, 1);
|
97
|
+
supported_ = (1 << CPUID);
|
98
|
+
{ Scope fscope(CPUID);
|
99
|
+
__ cpuid();
|
100
|
+
}
|
101
|
+
supported_ = 0;
|
102
|
+
|
103
|
+
// Move the result from ecx:edx to edx:eax and make sure to mark the
|
104
|
+
// CPUID feature as supported.
|
105
|
+
__ mov(eax, Operand(edx));
|
106
|
+
__ or_(eax, 1 << CPUID);
|
107
|
+
__ mov(edx, Operand(ecx));
|
108
|
+
|
109
|
+
// Done.
|
110
|
+
__ bind(&done);
|
111
|
+
__ mov(esp, Operand(ebp));
|
112
|
+
__ pop(ebx);
|
113
|
+
__ pop(ecx);
|
114
|
+
__ popfd();
|
115
|
+
__ pop(ebp);
|
116
|
+
__ ret(0);
|
117
|
+
#undef __
|
118
|
+
|
119
|
+
CodeDesc desc;
|
120
|
+
assm.GetCode(&desc);
|
121
|
+
Object* code = Heap::CreateCode(desc,
|
122
|
+
NULL,
|
123
|
+
Code::ComputeFlags(Code::STUB),
|
124
|
+
Handle<Code>::null());
|
125
|
+
if (!code->IsCode()) return;
|
126
|
+
LOG(CodeCreateEvent(Logger::BUILTIN_TAG,
|
127
|
+
Code::cast(code), "CpuFeatures::Probe"));
|
128
|
+
typedef uint64_t (*F0)();
|
129
|
+
F0 probe = FUNCTION_CAST<F0>(Code::cast(code)->entry());
|
130
|
+
supported_ = probe();
|
131
|
+
found_by_runtime_probing_ = supported_;
|
132
|
+
uint64_t os_guarantees = OS::CpuFeaturesImpliedByPlatform();
|
133
|
+
supported_ |= os_guarantees;
|
134
|
+
found_by_runtime_probing_ &= ~os_guarantees;
|
135
|
+
}
|
136
|
+
|
137
|
+
|
138
|
+
// -----------------------------------------------------------------------------
|
139
|
+
// Implementation of Displacement
|
140
|
+
|
141
|
+
void Displacement::init(Label* L, Type type) {
|
142
|
+
ASSERT(!L->is_bound());
|
143
|
+
int next = 0;
|
144
|
+
if (L->is_linked()) {
|
145
|
+
next = L->pos();
|
146
|
+
ASSERT(next > 0); // Displacements must be at positions > 0
|
147
|
+
}
|
148
|
+
// Ensure that we _never_ overflow the next field.
|
149
|
+
ASSERT(NextField::is_valid(Assembler::kMaximalBufferSize));
|
150
|
+
data_ = NextField::encode(next) | TypeField::encode(type);
|
151
|
+
}
|
152
|
+
|
153
|
+
|
154
|
+
// -----------------------------------------------------------------------------
|
155
|
+
// Implementation of RelocInfo
|
156
|
+
|
157
|
+
|
158
|
+
const int RelocInfo::kApplyMask =
|
159
|
+
RelocInfo::kCodeTargetMask | 1 << RelocInfo::RUNTIME_ENTRY |
|
160
|
+
1 << RelocInfo::JS_RETURN | 1 << RelocInfo::INTERNAL_REFERENCE;
|
161
|
+
|
162
|
+
|
163
|
+
void RelocInfo::PatchCode(byte* instructions, int instruction_count) {
|
164
|
+
// Patch the code at the current address with the supplied instructions.
|
165
|
+
for (int i = 0; i < instruction_count; i++) {
|
166
|
+
*(pc_ + i) = *(instructions + i);
|
167
|
+
}
|
168
|
+
|
169
|
+
// Indicate that code has changed.
|
170
|
+
CPU::FlushICache(pc_, instruction_count);
|
171
|
+
}
|
172
|
+
|
173
|
+
|
174
|
+
// Patch the code at the current PC with a call to the target address.
|
175
|
+
// Additional guard int3 instructions can be added if required.
|
176
|
+
void RelocInfo::PatchCodeWithCall(Address target, int guard_bytes) {
|
177
|
+
// Call instruction takes up 5 bytes and int3 takes up one byte.
|
178
|
+
static const int kCallCodeSize = 5;
|
179
|
+
int code_size = kCallCodeSize + guard_bytes;
|
180
|
+
|
181
|
+
// Create a code patcher.
|
182
|
+
CodePatcher patcher(pc_, code_size);
|
183
|
+
|
184
|
+
// Add a label for checking the size of the code used for returning.
|
185
|
+
#ifdef DEBUG
|
186
|
+
Label check_codesize;
|
187
|
+
patcher.masm()->bind(&check_codesize);
|
188
|
+
#endif
|
189
|
+
|
190
|
+
// Patch the code.
|
191
|
+
patcher.masm()->call(target, RelocInfo::NONE);
|
192
|
+
|
193
|
+
// Check that the size of the code generated is as expected.
|
194
|
+
ASSERT_EQ(kCallCodeSize,
|
195
|
+
patcher.masm()->SizeOfCodeGeneratedSince(&check_codesize));
|
196
|
+
|
197
|
+
// Add the requested number of int3 instructions after the call.
|
198
|
+
for (int i = 0; i < guard_bytes; i++) {
|
199
|
+
patcher.masm()->int3();
|
200
|
+
}
|
201
|
+
}
|
202
|
+
|
203
|
+
|
204
|
+
// -----------------------------------------------------------------------------
|
205
|
+
// Implementation of Operand
|
206
|
+
|
207
|
+
Operand::Operand(Register base, int32_t disp, RelocInfo::Mode rmode) {
|
208
|
+
// [base + disp/r]
|
209
|
+
if (disp == 0 && rmode == RelocInfo::NONE && !base.is(ebp)) {
|
210
|
+
// [base]
|
211
|
+
set_modrm(0, base);
|
212
|
+
if (base.is(esp)) set_sib(times_1, esp, base);
|
213
|
+
} else if (is_int8(disp) && rmode == RelocInfo::NONE) {
|
214
|
+
// [base + disp8]
|
215
|
+
set_modrm(1, base);
|
216
|
+
if (base.is(esp)) set_sib(times_1, esp, base);
|
217
|
+
set_disp8(disp);
|
218
|
+
} else {
|
219
|
+
// [base + disp/r]
|
220
|
+
set_modrm(2, base);
|
221
|
+
if (base.is(esp)) set_sib(times_1, esp, base);
|
222
|
+
set_dispr(disp, rmode);
|
223
|
+
}
|
224
|
+
}
|
225
|
+
|
226
|
+
|
227
|
+
Operand::Operand(Register base,
|
228
|
+
Register index,
|
229
|
+
ScaleFactor scale,
|
230
|
+
int32_t disp,
|
231
|
+
RelocInfo::Mode rmode) {
|
232
|
+
ASSERT(!index.is(esp)); // illegal addressing mode
|
233
|
+
// [base + index*scale + disp/r]
|
234
|
+
if (disp == 0 && rmode == RelocInfo::NONE && !base.is(ebp)) {
|
235
|
+
// [base + index*scale]
|
236
|
+
set_modrm(0, esp);
|
237
|
+
set_sib(scale, index, base);
|
238
|
+
} else if (is_int8(disp) && rmode == RelocInfo::NONE) {
|
239
|
+
// [base + index*scale + disp8]
|
240
|
+
set_modrm(1, esp);
|
241
|
+
set_sib(scale, index, base);
|
242
|
+
set_disp8(disp);
|
243
|
+
} else {
|
244
|
+
// [base + index*scale + disp/r]
|
245
|
+
set_modrm(2, esp);
|
246
|
+
set_sib(scale, index, base);
|
247
|
+
set_dispr(disp, rmode);
|
248
|
+
}
|
249
|
+
}
|
250
|
+
|
251
|
+
|
252
|
+
Operand::Operand(Register index,
|
253
|
+
ScaleFactor scale,
|
254
|
+
int32_t disp,
|
255
|
+
RelocInfo::Mode rmode) {
|
256
|
+
ASSERT(!index.is(esp)); // illegal addressing mode
|
257
|
+
// [index*scale + disp/r]
|
258
|
+
set_modrm(0, esp);
|
259
|
+
set_sib(scale, index, ebp);
|
260
|
+
set_dispr(disp, rmode);
|
261
|
+
}
|
262
|
+
|
263
|
+
|
264
|
+
bool Operand::is_reg(Register reg) const {
|
265
|
+
return ((buf_[0] & 0xF8) == 0xC0) // addressing mode is register only.
|
266
|
+
&& ((buf_[0] & 0x07) == reg.code()); // register codes match.
|
267
|
+
}
|
268
|
+
|
269
|
+
// -----------------------------------------------------------------------------
|
270
|
+
// Implementation of Assembler
|
271
|
+
|
272
|
+
// Emit a single byte. Must always be inlined.
|
273
|
+
#define EMIT(x) \
|
274
|
+
*pc_++ = (x)
|
275
|
+
|
276
|
+
|
277
|
+
#ifdef GENERATED_CODE_COVERAGE
|
278
|
+
static void InitCoverageLog();
|
279
|
+
#endif
|
280
|
+
|
281
|
+
// spare_buffer_
|
282
|
+
byte* Assembler::spare_buffer_ = NULL;
|
283
|
+
|
284
|
+
Assembler::Assembler(void* buffer, int buffer_size) {
|
285
|
+
if (buffer == NULL) {
|
286
|
+
// do our own buffer management
|
287
|
+
if (buffer_size <= kMinimalBufferSize) {
|
288
|
+
buffer_size = kMinimalBufferSize;
|
289
|
+
|
290
|
+
if (spare_buffer_ != NULL) {
|
291
|
+
buffer = spare_buffer_;
|
292
|
+
spare_buffer_ = NULL;
|
293
|
+
}
|
294
|
+
}
|
295
|
+
if (buffer == NULL) {
|
296
|
+
buffer_ = NewArray<byte>(buffer_size);
|
297
|
+
} else {
|
298
|
+
buffer_ = static_cast<byte*>(buffer);
|
299
|
+
}
|
300
|
+
buffer_size_ = buffer_size;
|
301
|
+
own_buffer_ = true;
|
302
|
+
} else {
|
303
|
+
// use externally provided buffer instead
|
304
|
+
ASSERT(buffer_size > 0);
|
305
|
+
buffer_ = static_cast<byte*>(buffer);
|
306
|
+
buffer_size_ = buffer_size;
|
307
|
+
own_buffer_ = false;
|
308
|
+
}
|
309
|
+
|
310
|
+
// Clear the buffer in debug mode unless it was provided by the
|
311
|
+
// caller in which case we can't be sure it's okay to overwrite
|
312
|
+
// existing code in it; see CodePatcher::CodePatcher(...).
|
313
|
+
#ifdef DEBUG
|
314
|
+
if (own_buffer_) {
|
315
|
+
memset(buffer_, 0xCC, buffer_size); // int3
|
316
|
+
}
|
317
|
+
#endif
|
318
|
+
|
319
|
+
// setup buffer pointers
|
320
|
+
ASSERT(buffer_ != NULL);
|
321
|
+
pc_ = buffer_;
|
322
|
+
reloc_info_writer.Reposition(buffer_ + buffer_size, pc_);
|
323
|
+
|
324
|
+
last_pc_ = NULL;
|
325
|
+
current_statement_position_ = RelocInfo::kNoPosition;
|
326
|
+
current_position_ = RelocInfo::kNoPosition;
|
327
|
+
written_statement_position_ = current_statement_position_;
|
328
|
+
written_position_ = current_position_;
|
329
|
+
#ifdef GENERATED_CODE_COVERAGE
|
330
|
+
InitCoverageLog();
|
331
|
+
#endif
|
332
|
+
}
|
333
|
+
|
334
|
+
|
335
|
+
Assembler::~Assembler() {
|
336
|
+
if (own_buffer_) {
|
337
|
+
if (spare_buffer_ == NULL && buffer_size_ == kMinimalBufferSize) {
|
338
|
+
spare_buffer_ = buffer_;
|
339
|
+
} else {
|
340
|
+
DeleteArray(buffer_);
|
341
|
+
}
|
342
|
+
}
|
343
|
+
}
|
344
|
+
|
345
|
+
|
346
|
+
void Assembler::GetCode(CodeDesc* desc) {
|
347
|
+
// finalize code
|
348
|
+
// (at this point overflow() may be true, but the gap ensures that
|
349
|
+
// we are still not overlapping instructions and relocation info)
|
350
|
+
ASSERT(pc_ <= reloc_info_writer.pos()); // no overlap
|
351
|
+
// setup desc
|
352
|
+
desc->buffer = buffer_;
|
353
|
+
desc->buffer_size = buffer_size_;
|
354
|
+
desc->instr_size = pc_offset();
|
355
|
+
desc->reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos();
|
356
|
+
desc->origin = this;
|
357
|
+
|
358
|
+
Counters::reloc_info_size.Increment(desc->reloc_size);
|
359
|
+
}
|
360
|
+
|
361
|
+
|
362
|
+
void Assembler::Align(int m) {
|
363
|
+
ASSERT(IsPowerOf2(m));
|
364
|
+
while ((pc_offset() & (m - 1)) != 0) {
|
365
|
+
nop();
|
366
|
+
}
|
367
|
+
}
|
368
|
+
|
369
|
+
|
370
|
+
void Assembler::cpuid() {
|
371
|
+
ASSERT(CpuFeatures::IsEnabled(CPUID));
|
372
|
+
EnsureSpace ensure_space(this);
|
373
|
+
last_pc_ = pc_;
|
374
|
+
EMIT(0x0F);
|
375
|
+
EMIT(0xA2);
|
376
|
+
}
|
377
|
+
|
378
|
+
|
379
|
+
void Assembler::pushad() {
|
380
|
+
EnsureSpace ensure_space(this);
|
381
|
+
last_pc_ = pc_;
|
382
|
+
EMIT(0x60);
|
383
|
+
}
|
384
|
+
|
385
|
+
|
386
|
+
void Assembler::popad() {
|
387
|
+
EnsureSpace ensure_space(this);
|
388
|
+
last_pc_ = pc_;
|
389
|
+
EMIT(0x61);
|
390
|
+
}
|
391
|
+
|
392
|
+
|
393
|
+
void Assembler::pushfd() {
|
394
|
+
EnsureSpace ensure_space(this);
|
395
|
+
last_pc_ = pc_;
|
396
|
+
EMIT(0x9C);
|
397
|
+
}
|
398
|
+
|
399
|
+
|
400
|
+
void Assembler::popfd() {
|
401
|
+
EnsureSpace ensure_space(this);
|
402
|
+
last_pc_ = pc_;
|
403
|
+
EMIT(0x9D);
|
404
|
+
}
|
405
|
+
|
406
|
+
|
407
|
+
void Assembler::push(const Immediate& x) {
|
408
|
+
EnsureSpace ensure_space(this);
|
409
|
+
last_pc_ = pc_;
|
410
|
+
if (x.is_int8()) {
|
411
|
+
EMIT(0x6a);
|
412
|
+
EMIT(x.x_);
|
413
|
+
} else {
|
414
|
+
EMIT(0x68);
|
415
|
+
emit(x);
|
416
|
+
}
|
417
|
+
}
|
418
|
+
|
419
|
+
|
420
|
+
void Assembler::push(Register src) {
|
421
|
+
EnsureSpace ensure_space(this);
|
422
|
+
last_pc_ = pc_;
|
423
|
+
EMIT(0x50 | src.code());
|
424
|
+
}
|
425
|
+
|
426
|
+
|
427
|
+
void Assembler::push(const Operand& src) {
|
428
|
+
EnsureSpace ensure_space(this);
|
429
|
+
last_pc_ = pc_;
|
430
|
+
EMIT(0xFF);
|
431
|
+
emit_operand(esi, src);
|
432
|
+
}
|
433
|
+
|
434
|
+
|
435
|
+
void Assembler::pop(Register dst) {
|
436
|
+
ASSERT(reloc_info_writer.last_pc() != NULL);
|
437
|
+
if (FLAG_push_pop_elimination && (reloc_info_writer.last_pc() <= last_pc_)) {
|
438
|
+
// (last_pc_ != NULL) is rolled into the above check
|
439
|
+
// If a last_pc_ is set, we need to make sure that there has not been any
|
440
|
+
// relocation information generated between the last instruction and this
|
441
|
+
// pop instruction.
|
442
|
+
byte instr = last_pc_[0];
|
443
|
+
if ((instr & ~0x7) == 0x50) {
|
444
|
+
int push_reg_code = instr & 0x7;
|
445
|
+
if (push_reg_code == dst.code()) {
|
446
|
+
pc_ = last_pc_;
|
447
|
+
if (FLAG_print_push_pop_elimination) {
|
448
|
+
PrintF("%d push/pop (same reg) eliminated\n", pc_offset());
|
449
|
+
}
|
450
|
+
} else {
|
451
|
+
// Convert 'push src; pop dst' to 'mov dst, src'.
|
452
|
+
last_pc_[0] = 0x8b;
|
453
|
+
Register src = { push_reg_code };
|
454
|
+
EnsureSpace ensure_space(this);
|
455
|
+
emit_operand(dst, Operand(src));
|
456
|
+
if (FLAG_print_push_pop_elimination) {
|
457
|
+
PrintF("%d push/pop (reg->reg) eliminated\n", pc_offset());
|
458
|
+
}
|
459
|
+
}
|
460
|
+
last_pc_ = NULL;
|
461
|
+
return;
|
462
|
+
} else if (instr == 0xff) { // push of an operand, convert to a move
|
463
|
+
byte op1 = last_pc_[1];
|
464
|
+
// Check if the operation is really a push
|
465
|
+
if ((op1 & 0x38) == (6 << 3)) {
|
466
|
+
op1 = (op1 & ~0x38) | static_cast<byte>(dst.code() << 3);
|
467
|
+
last_pc_[0] = 0x8b;
|
468
|
+
last_pc_[1] = op1;
|
469
|
+
last_pc_ = NULL;
|
470
|
+
if (FLAG_print_push_pop_elimination) {
|
471
|
+
PrintF("%d push/pop (op->reg) eliminated\n", pc_offset());
|
472
|
+
}
|
473
|
+
return;
|
474
|
+
}
|
475
|
+
} else if ((instr == 0x89) &&
|
476
|
+
(last_pc_[1] == 0x04) &&
|
477
|
+
(last_pc_[2] == 0x24)) {
|
478
|
+
// 0x71283c 396 890424 mov [esp],eax
|
479
|
+
// 0x71283f 399 58 pop eax
|
480
|
+
if (dst.is(eax)) {
|
481
|
+
// change to
|
482
|
+
// 0x710fac 216 83c404 add esp,0x4
|
483
|
+
last_pc_[0] = 0x83;
|
484
|
+
last_pc_[1] = 0xc4;
|
485
|
+
last_pc_[2] = 0x04;
|
486
|
+
last_pc_ = NULL;
|
487
|
+
if (FLAG_print_push_pop_elimination) {
|
488
|
+
PrintF("%d push/pop (mov-pop) eliminated\n", pc_offset());
|
489
|
+
}
|
490
|
+
return;
|
491
|
+
}
|
492
|
+
} else if (instr == 0x6a && dst.is(eax)) { // push of immediate 8 bit
|
493
|
+
byte imm8 = last_pc_[1];
|
494
|
+
if (imm8 == 0) {
|
495
|
+
// 6a00 push 0x0
|
496
|
+
// 58 pop eax
|
497
|
+
last_pc_[0] = 0x31;
|
498
|
+
last_pc_[1] = 0xc0;
|
499
|
+
// change to
|
500
|
+
// 31c0 xor eax,eax
|
501
|
+
last_pc_ = NULL;
|
502
|
+
if (FLAG_print_push_pop_elimination) {
|
503
|
+
PrintF("%d push/pop (imm->reg) eliminated\n", pc_offset());
|
504
|
+
}
|
505
|
+
return;
|
506
|
+
} else {
|
507
|
+
// 6a00 push 0xXX
|
508
|
+
// 58 pop eax
|
509
|
+
last_pc_[0] = 0xb8;
|
510
|
+
EnsureSpace ensure_space(this);
|
511
|
+
if ((imm8 & 0x80) != 0) {
|
512
|
+
EMIT(0xff);
|
513
|
+
EMIT(0xff);
|
514
|
+
EMIT(0xff);
|
515
|
+
// change to
|
516
|
+
// b8XXffffff mov eax,0xffffffXX
|
517
|
+
} else {
|
518
|
+
EMIT(0x00);
|
519
|
+
EMIT(0x00);
|
520
|
+
EMIT(0x00);
|
521
|
+
// change to
|
522
|
+
// b8XX000000 mov eax,0x000000XX
|
523
|
+
}
|
524
|
+
last_pc_ = NULL;
|
525
|
+
if (FLAG_print_push_pop_elimination) {
|
526
|
+
PrintF("%d push/pop (imm->reg) eliminated\n", pc_offset());
|
527
|
+
}
|
528
|
+
return;
|
529
|
+
}
|
530
|
+
} else if (instr == 0x68 && dst.is(eax)) { // push of immediate 32 bit
|
531
|
+
// 68XXXXXXXX push 0xXXXXXXXX
|
532
|
+
// 58 pop eax
|
533
|
+
last_pc_[0] = 0xb8;
|
534
|
+
last_pc_ = NULL;
|
535
|
+
// change to
|
536
|
+
// b8XXXXXXXX mov eax,0xXXXXXXXX
|
537
|
+
if (FLAG_print_push_pop_elimination) {
|
538
|
+
PrintF("%d push/pop (imm->reg) eliminated\n", pc_offset());
|
539
|
+
}
|
540
|
+
return;
|
541
|
+
}
|
542
|
+
|
543
|
+
// Other potential patterns for peephole:
|
544
|
+
// 0x712716 102 890424 mov [esp], eax
|
545
|
+
// 0x712719 105 8b1424 mov edx, [esp]
|
546
|
+
}
|
547
|
+
EnsureSpace ensure_space(this);
|
548
|
+
last_pc_ = pc_;
|
549
|
+
EMIT(0x58 | dst.code());
|
550
|
+
}
|
551
|
+
|
552
|
+
|
553
|
+
void Assembler::pop(const Operand& dst) {
|
554
|
+
EnsureSpace ensure_space(this);
|
555
|
+
last_pc_ = pc_;
|
556
|
+
EMIT(0x8F);
|
557
|
+
emit_operand(eax, dst);
|
558
|
+
}
|
559
|
+
|
560
|
+
|
561
|
+
void Assembler::enter(const Immediate& size) {
|
562
|
+
EnsureSpace ensure_space(this);
|
563
|
+
last_pc_ = pc_;
|
564
|
+
EMIT(0xC8);
|
565
|
+
emit_w(size);
|
566
|
+
EMIT(0);
|
567
|
+
}
|
568
|
+
|
569
|
+
|
570
|
+
void Assembler::leave() {
|
571
|
+
EnsureSpace ensure_space(this);
|
572
|
+
last_pc_ = pc_;
|
573
|
+
EMIT(0xC9);
|
574
|
+
}
|
575
|
+
|
576
|
+
|
577
|
+
void Assembler::mov_b(Register dst, const Operand& src) {
|
578
|
+
ASSERT(dst.code() < 4);
|
579
|
+
EnsureSpace ensure_space(this);
|
580
|
+
last_pc_ = pc_;
|
581
|
+
EMIT(0x8A);
|
582
|
+
emit_operand(dst, src);
|
583
|
+
}
|
584
|
+
|
585
|
+
|
586
|
+
void Assembler::mov_b(const Operand& dst, int8_t imm8) {
|
587
|
+
EnsureSpace ensure_space(this);
|
588
|
+
last_pc_ = pc_;
|
589
|
+
EMIT(0xC6);
|
590
|
+
emit_operand(eax, dst);
|
591
|
+
EMIT(imm8);
|
592
|
+
}
|
593
|
+
|
594
|
+
|
595
|
+
void Assembler::mov_b(const Operand& dst, Register src) {
|
596
|
+
ASSERT(src.code() < 4);
|
597
|
+
EnsureSpace ensure_space(this);
|
598
|
+
last_pc_ = pc_;
|
599
|
+
EMIT(0x88);
|
600
|
+
emit_operand(src, dst);
|
601
|
+
}
|
602
|
+
|
603
|
+
|
604
|
+
void Assembler::mov_w(Register dst, const Operand& src) {
|
605
|
+
EnsureSpace ensure_space(this);
|
606
|
+
last_pc_ = pc_;
|
607
|
+
EMIT(0x66);
|
608
|
+
EMIT(0x8B);
|
609
|
+
emit_operand(dst, src);
|
610
|
+
}
|
611
|
+
|
612
|
+
|
613
|
+
void Assembler::mov_w(const Operand& dst, Register src) {
|
614
|
+
EnsureSpace ensure_space(this);
|
615
|
+
last_pc_ = pc_;
|
616
|
+
EMIT(0x66);
|
617
|
+
EMIT(0x89);
|
618
|
+
emit_operand(src, dst);
|
619
|
+
}
|
620
|
+
|
621
|
+
|
622
|
+
void Assembler::mov(Register dst, int32_t imm32) {
|
623
|
+
EnsureSpace ensure_space(this);
|
624
|
+
last_pc_ = pc_;
|
625
|
+
EMIT(0xB8 | dst.code());
|
626
|
+
emit(imm32);
|
627
|
+
}
|
628
|
+
|
629
|
+
|
630
|
+
void Assembler::mov(Register dst, const Immediate& x) {
|
631
|
+
EnsureSpace ensure_space(this);
|
632
|
+
last_pc_ = pc_;
|
633
|
+
EMIT(0xB8 | dst.code());
|
634
|
+
emit(x);
|
635
|
+
}
|
636
|
+
|
637
|
+
|
638
|
+
void Assembler::mov(Register dst, Handle<Object> handle) {
|
639
|
+
EnsureSpace ensure_space(this);
|
640
|
+
last_pc_ = pc_;
|
641
|
+
EMIT(0xB8 | dst.code());
|
642
|
+
emit(handle);
|
643
|
+
}
|
644
|
+
|
645
|
+
|
646
|
+
void Assembler::mov(Register dst, const Operand& src) {
|
647
|
+
EnsureSpace ensure_space(this);
|
648
|
+
last_pc_ = pc_;
|
649
|
+
EMIT(0x8B);
|
650
|
+
emit_operand(dst, src);
|
651
|
+
}
|
652
|
+
|
653
|
+
|
654
|
+
void Assembler::mov(Register dst, Register src) {
|
655
|
+
EnsureSpace ensure_space(this);
|
656
|
+
last_pc_ = pc_;
|
657
|
+
EMIT(0x89);
|
658
|
+
EMIT(0xC0 | src.code() << 3 | dst.code());
|
659
|
+
}
|
660
|
+
|
661
|
+
|
662
|
+
void Assembler::mov(const Operand& dst, const Immediate& x) {
|
663
|
+
EnsureSpace ensure_space(this);
|
664
|
+
last_pc_ = pc_;
|
665
|
+
EMIT(0xC7);
|
666
|
+
emit_operand(eax, dst);
|
667
|
+
emit(x);
|
668
|
+
}
|
669
|
+
|
670
|
+
|
671
|
+
void Assembler::mov(const Operand& dst, Handle<Object> handle) {
|
672
|
+
EnsureSpace ensure_space(this);
|
673
|
+
last_pc_ = pc_;
|
674
|
+
EMIT(0xC7);
|
675
|
+
emit_operand(eax, dst);
|
676
|
+
emit(handle);
|
677
|
+
}
|
678
|
+
|
679
|
+
|
680
|
+
void Assembler::mov(const Operand& dst, Register src) {
|
681
|
+
EnsureSpace ensure_space(this);
|
682
|
+
last_pc_ = pc_;
|
683
|
+
EMIT(0x89);
|
684
|
+
emit_operand(src, dst);
|
685
|
+
}
|
686
|
+
|
687
|
+
|
688
|
+
void Assembler::movsx_b(Register dst, const Operand& src) {
|
689
|
+
EnsureSpace ensure_space(this);
|
690
|
+
last_pc_ = pc_;
|
691
|
+
EMIT(0x0F);
|
692
|
+
EMIT(0xBE);
|
693
|
+
emit_operand(dst, src);
|
694
|
+
}
|
695
|
+
|
696
|
+
|
697
|
+
void Assembler::movsx_w(Register dst, const Operand& src) {
|
698
|
+
EnsureSpace ensure_space(this);
|
699
|
+
last_pc_ = pc_;
|
700
|
+
EMIT(0x0F);
|
701
|
+
EMIT(0xBF);
|
702
|
+
emit_operand(dst, src);
|
703
|
+
}
|
704
|
+
|
705
|
+
|
706
|
+
void Assembler::movzx_b(Register dst, const Operand& src) {
|
707
|
+
EnsureSpace ensure_space(this);
|
708
|
+
last_pc_ = pc_;
|
709
|
+
EMIT(0x0F);
|
710
|
+
EMIT(0xB6);
|
711
|
+
emit_operand(dst, src);
|
712
|
+
}
|
713
|
+
|
714
|
+
|
715
|
+
void Assembler::movzx_w(Register dst, const Operand& src) {
|
716
|
+
EnsureSpace ensure_space(this);
|
717
|
+
last_pc_ = pc_;
|
718
|
+
EMIT(0x0F);
|
719
|
+
EMIT(0xB7);
|
720
|
+
emit_operand(dst, src);
|
721
|
+
}
|
722
|
+
|
723
|
+
|
724
|
+
void Assembler::cmov(Condition cc, Register dst, int32_t imm32) {
|
725
|
+
ASSERT(CpuFeatures::IsEnabled(CMOV));
|
726
|
+
EnsureSpace ensure_space(this);
|
727
|
+
last_pc_ = pc_;
|
728
|
+
UNIMPLEMENTED();
|
729
|
+
USE(cc);
|
730
|
+
USE(dst);
|
731
|
+
USE(imm32);
|
732
|
+
}
|
733
|
+
|
734
|
+
|
735
|
+
void Assembler::cmov(Condition cc, Register dst, Handle<Object> handle) {
|
736
|
+
ASSERT(CpuFeatures::IsEnabled(CMOV));
|
737
|
+
EnsureSpace ensure_space(this);
|
738
|
+
last_pc_ = pc_;
|
739
|
+
UNIMPLEMENTED();
|
740
|
+
USE(cc);
|
741
|
+
USE(dst);
|
742
|
+
USE(handle);
|
743
|
+
}
|
744
|
+
|
745
|
+
|
746
|
+
void Assembler::cmov(Condition cc, Register dst, const Operand& src) {
|
747
|
+
ASSERT(CpuFeatures::IsEnabled(CMOV));
|
748
|
+
EnsureSpace ensure_space(this);
|
749
|
+
last_pc_ = pc_;
|
750
|
+
// Opcode: 0f 40 + cc /r
|
751
|
+
EMIT(0x0F);
|
752
|
+
EMIT(0x40 + cc);
|
753
|
+
emit_operand(dst, src);
|
754
|
+
}
|
755
|
+
|
756
|
+
|
757
|
+
void Assembler::rep_movs() {
|
758
|
+
EnsureSpace ensure_space(this);
|
759
|
+
last_pc_ = pc_;
|
760
|
+
EMIT(0xF3);
|
761
|
+
EMIT(0xA5);
|
762
|
+
}
|
763
|
+
|
764
|
+
|
765
|
+
void Assembler::xchg(Register dst, Register src) {
|
766
|
+
EnsureSpace ensure_space(this);
|
767
|
+
last_pc_ = pc_;
|
768
|
+
if (src.is(eax) || dst.is(eax)) { // Single-byte encoding
|
769
|
+
EMIT(0x90 | (src.is(eax) ? dst.code() : src.code()));
|
770
|
+
} else {
|
771
|
+
EMIT(0x87);
|
772
|
+
EMIT(0xC0 | src.code() << 3 | dst.code());
|
773
|
+
}
|
774
|
+
}
|
775
|
+
|
776
|
+
|
777
|
+
void Assembler::adc(Register dst, int32_t imm32) {
|
778
|
+
EnsureSpace ensure_space(this);
|
779
|
+
last_pc_ = pc_;
|
780
|
+
emit_arith(2, Operand(dst), Immediate(imm32));
|
781
|
+
}
|
782
|
+
|
783
|
+
|
784
|
+
void Assembler::adc(Register dst, const Operand& src) {
|
785
|
+
EnsureSpace ensure_space(this);
|
786
|
+
last_pc_ = pc_;
|
787
|
+
EMIT(0x13);
|
788
|
+
emit_operand(dst, src);
|
789
|
+
}
|
790
|
+
|
791
|
+
|
792
|
+
void Assembler::add(Register dst, const Operand& src) {
|
793
|
+
EnsureSpace ensure_space(this);
|
794
|
+
last_pc_ = pc_;
|
795
|
+
EMIT(0x03);
|
796
|
+
emit_operand(dst, src);
|
797
|
+
}
|
798
|
+
|
799
|
+
|
800
|
+
void Assembler::add(const Operand& dst, const Immediate& x) {
|
801
|
+
ASSERT(reloc_info_writer.last_pc() != NULL);
|
802
|
+
if (FLAG_push_pop_elimination && (reloc_info_writer.last_pc() <= last_pc_)) {
|
803
|
+
byte instr = last_pc_[0];
|
804
|
+
if ((instr & 0xf8) == 0x50) {
|
805
|
+
// Last instruction was a push. Check whether this is a pop without a
|
806
|
+
// result.
|
807
|
+
if ((dst.is_reg(esp)) &&
|
808
|
+
(x.x_ == kPointerSize) && (x.rmode_ == RelocInfo::NONE)) {
|
809
|
+
pc_ = last_pc_;
|
810
|
+
last_pc_ = NULL;
|
811
|
+
if (FLAG_print_push_pop_elimination) {
|
812
|
+
PrintF("%d push/pop(noreg) eliminated\n", pc_offset());
|
813
|
+
}
|
814
|
+
return;
|
815
|
+
}
|
816
|
+
}
|
817
|
+
}
|
818
|
+
EnsureSpace ensure_space(this);
|
819
|
+
last_pc_ = pc_;
|
820
|
+
emit_arith(0, dst, x);
|
821
|
+
}
|
822
|
+
|
823
|
+
|
824
|
+
void Assembler::and_(Register dst, int32_t imm32) {
|
825
|
+
EnsureSpace ensure_space(this);
|
826
|
+
last_pc_ = pc_;
|
827
|
+
emit_arith(4, Operand(dst), Immediate(imm32));
|
828
|
+
}
|
829
|
+
|
830
|
+
|
831
|
+
void Assembler::and_(Register dst, const Operand& src) {
|
832
|
+
EnsureSpace ensure_space(this);
|
833
|
+
last_pc_ = pc_;
|
834
|
+
EMIT(0x23);
|
835
|
+
emit_operand(dst, src);
|
836
|
+
}
|
837
|
+
|
838
|
+
|
839
|
+
void Assembler::and_(const Operand& dst, const Immediate& x) {
|
840
|
+
EnsureSpace ensure_space(this);
|
841
|
+
last_pc_ = pc_;
|
842
|
+
emit_arith(4, dst, x);
|
843
|
+
}
|
844
|
+
|
845
|
+
|
846
|
+
void Assembler::and_(const Operand& dst, Register src) {
|
847
|
+
EnsureSpace ensure_space(this);
|
848
|
+
last_pc_ = pc_;
|
849
|
+
EMIT(0x21);
|
850
|
+
emit_operand(src, dst);
|
851
|
+
}
|
852
|
+
|
853
|
+
|
854
|
+
void Assembler::cmpb(const Operand& op, int8_t imm8) {
|
855
|
+
EnsureSpace ensure_space(this);
|
856
|
+
last_pc_ = pc_;
|
857
|
+
EMIT(0x80);
|
858
|
+
emit_operand(edi, op); // edi == 7
|
859
|
+
EMIT(imm8);
|
860
|
+
}
|
861
|
+
|
862
|
+
|
863
|
+
void Assembler::cmpw(const Operand& op, Immediate imm16) {
|
864
|
+
ASSERT(imm16.is_int16());
|
865
|
+
EnsureSpace ensure_space(this);
|
866
|
+
last_pc_ = pc_;
|
867
|
+
EMIT(0x66);
|
868
|
+
EMIT(0x81);
|
869
|
+
emit_operand(edi, op);
|
870
|
+
emit_w(imm16);
|
871
|
+
}
|
872
|
+
|
873
|
+
|
874
|
+
void Assembler::cmp(Register reg, int32_t imm32) {
|
875
|
+
EnsureSpace ensure_space(this);
|
876
|
+
last_pc_ = pc_;
|
877
|
+
emit_arith(7, Operand(reg), Immediate(imm32));
|
878
|
+
}
|
879
|
+
|
880
|
+
|
881
|
+
void Assembler::cmp(Register reg, Handle<Object> handle) {
|
882
|
+
EnsureSpace ensure_space(this);
|
883
|
+
last_pc_ = pc_;
|
884
|
+
emit_arith(7, Operand(reg), Immediate(handle));
|
885
|
+
}
|
886
|
+
|
887
|
+
|
888
|
+
void Assembler::cmp(Register reg, const Operand& op) {
|
889
|
+
EnsureSpace ensure_space(this);
|
890
|
+
last_pc_ = pc_;
|
891
|
+
EMIT(0x3B);
|
892
|
+
emit_operand(reg, op);
|
893
|
+
}
|
894
|
+
|
895
|
+
|
896
|
+
void Assembler::cmp(const Operand& op, const Immediate& imm) {
|
897
|
+
EnsureSpace ensure_space(this);
|
898
|
+
last_pc_ = pc_;
|
899
|
+
emit_arith(7, op, imm);
|
900
|
+
}
|
901
|
+
|
902
|
+
|
903
|
+
void Assembler::cmp(const Operand& op, Handle<Object> handle) {
|
904
|
+
EnsureSpace ensure_space(this);
|
905
|
+
last_pc_ = pc_;
|
906
|
+
emit_arith(7, op, Immediate(handle));
|
907
|
+
}
|
908
|
+
|
909
|
+
|
910
|
+
void Assembler::cmpb_al(const Operand& op) {
|
911
|
+
EnsureSpace ensure_space(this);
|
912
|
+
last_pc_ = pc_;
|
913
|
+
EMIT(0x38); // CMP r/m8, r8
|
914
|
+
emit_operand(eax, op); // eax has same code as register al.
|
915
|
+
}
|
916
|
+
|
917
|
+
|
918
|
+
void Assembler::cmpw_ax(const Operand& op) {
|
919
|
+
EnsureSpace ensure_space(this);
|
920
|
+
last_pc_ = pc_;
|
921
|
+
EMIT(0x66);
|
922
|
+
EMIT(0x39); // CMP r/m16, r16
|
923
|
+
emit_operand(eax, op); // eax has same code as register ax.
|
924
|
+
}
|
925
|
+
|
926
|
+
|
927
|
+
void Assembler::dec_b(Register dst) {
|
928
|
+
EnsureSpace ensure_space(this);
|
929
|
+
last_pc_ = pc_;
|
930
|
+
EMIT(0xFE);
|
931
|
+
EMIT(0xC8 | dst.code());
|
932
|
+
}
|
933
|
+
|
934
|
+
|
935
|
+
void Assembler::dec(Register dst) {
|
936
|
+
EnsureSpace ensure_space(this);
|
937
|
+
last_pc_ = pc_;
|
938
|
+
EMIT(0x48 | dst.code());
|
939
|
+
}
|
940
|
+
|
941
|
+
|
942
|
+
void Assembler::dec(const Operand& dst) {
|
943
|
+
EnsureSpace ensure_space(this);
|
944
|
+
last_pc_ = pc_;
|
945
|
+
EMIT(0xFF);
|
946
|
+
emit_operand(ecx, dst);
|
947
|
+
}
|
948
|
+
|
949
|
+
|
950
|
+
void Assembler::cdq() {
|
951
|
+
EnsureSpace ensure_space(this);
|
952
|
+
last_pc_ = pc_;
|
953
|
+
EMIT(0x99);
|
954
|
+
}
|
955
|
+
|
956
|
+
|
957
|
+
void Assembler::idiv(Register src) {
|
958
|
+
EnsureSpace ensure_space(this);
|
959
|
+
last_pc_ = pc_;
|
960
|
+
EMIT(0xF7);
|
961
|
+
EMIT(0xF8 | src.code());
|
962
|
+
}
|
963
|
+
|
964
|
+
|
965
|
+
void Assembler::imul(Register reg) {
|
966
|
+
EnsureSpace ensure_space(this);
|
967
|
+
last_pc_ = pc_;
|
968
|
+
EMIT(0xF7);
|
969
|
+
EMIT(0xE8 | reg.code());
|
970
|
+
}
|
971
|
+
|
972
|
+
|
973
|
+
void Assembler::imul(Register dst, const Operand& src) {
|
974
|
+
EnsureSpace ensure_space(this);
|
975
|
+
last_pc_ = pc_;
|
976
|
+
EMIT(0x0F);
|
977
|
+
EMIT(0xAF);
|
978
|
+
emit_operand(dst, src);
|
979
|
+
}
|
980
|
+
|
981
|
+
|
982
|
+
void Assembler::imul(Register dst, Register src, int32_t imm32) {
|
983
|
+
EnsureSpace ensure_space(this);
|
984
|
+
last_pc_ = pc_;
|
985
|
+
if (is_int8(imm32)) {
|
986
|
+
EMIT(0x6B);
|
987
|
+
EMIT(0xC0 | dst.code() << 3 | src.code());
|
988
|
+
EMIT(imm32);
|
989
|
+
} else {
|
990
|
+
EMIT(0x69);
|
991
|
+
EMIT(0xC0 | dst.code() << 3 | src.code());
|
992
|
+
emit(imm32);
|
993
|
+
}
|
994
|
+
}
|
995
|
+
|
996
|
+
|
997
|
+
void Assembler::inc(Register dst) {
|
998
|
+
EnsureSpace ensure_space(this);
|
999
|
+
last_pc_ = pc_;
|
1000
|
+
EMIT(0x40 | dst.code());
|
1001
|
+
}
|
1002
|
+
|
1003
|
+
|
1004
|
+
void Assembler::inc(const Operand& dst) {
|
1005
|
+
EnsureSpace ensure_space(this);
|
1006
|
+
last_pc_ = pc_;
|
1007
|
+
EMIT(0xFF);
|
1008
|
+
emit_operand(eax, dst);
|
1009
|
+
}
|
1010
|
+
|
1011
|
+
|
1012
|
+
void Assembler::lea(Register dst, const Operand& src) {
|
1013
|
+
EnsureSpace ensure_space(this);
|
1014
|
+
last_pc_ = pc_;
|
1015
|
+
EMIT(0x8D);
|
1016
|
+
emit_operand(dst, src);
|
1017
|
+
}
|
1018
|
+
|
1019
|
+
|
1020
|
+
void Assembler::mul(Register src) {
|
1021
|
+
EnsureSpace ensure_space(this);
|
1022
|
+
last_pc_ = pc_;
|
1023
|
+
EMIT(0xF7);
|
1024
|
+
EMIT(0xE0 | src.code());
|
1025
|
+
}
|
1026
|
+
|
1027
|
+
|
1028
|
+
void Assembler::neg(Register dst) {
|
1029
|
+
EnsureSpace ensure_space(this);
|
1030
|
+
last_pc_ = pc_;
|
1031
|
+
EMIT(0xF7);
|
1032
|
+
EMIT(0xD8 | dst.code());
|
1033
|
+
}
|
1034
|
+
|
1035
|
+
|
1036
|
+
void Assembler::not_(Register dst) {
|
1037
|
+
EnsureSpace ensure_space(this);
|
1038
|
+
last_pc_ = pc_;
|
1039
|
+
EMIT(0xF7);
|
1040
|
+
EMIT(0xD0 | dst.code());
|
1041
|
+
}
|
1042
|
+
|
1043
|
+
|
1044
|
+
void Assembler::or_(Register dst, int32_t imm32) {
|
1045
|
+
EnsureSpace ensure_space(this);
|
1046
|
+
last_pc_ = pc_;
|
1047
|
+
emit_arith(1, Operand(dst), Immediate(imm32));
|
1048
|
+
}
|
1049
|
+
|
1050
|
+
|
1051
|
+
void Assembler::or_(Register dst, const Operand& src) {
|
1052
|
+
EnsureSpace ensure_space(this);
|
1053
|
+
last_pc_ = pc_;
|
1054
|
+
EMIT(0x0B);
|
1055
|
+
emit_operand(dst, src);
|
1056
|
+
}
|
1057
|
+
|
1058
|
+
|
1059
|
+
void Assembler::or_(const Operand& dst, const Immediate& x) {
|
1060
|
+
EnsureSpace ensure_space(this);
|
1061
|
+
last_pc_ = pc_;
|
1062
|
+
emit_arith(1, dst, x);
|
1063
|
+
}
|
1064
|
+
|
1065
|
+
|
1066
|
+
void Assembler::or_(const Operand& dst, Register src) {
|
1067
|
+
EnsureSpace ensure_space(this);
|
1068
|
+
last_pc_ = pc_;
|
1069
|
+
EMIT(0x09);
|
1070
|
+
emit_operand(src, dst);
|
1071
|
+
}
|
1072
|
+
|
1073
|
+
|
1074
|
+
void Assembler::rcl(Register dst, uint8_t imm8) {
|
1075
|
+
EnsureSpace ensure_space(this);
|
1076
|
+
last_pc_ = pc_;
|
1077
|
+
ASSERT(is_uint5(imm8)); // illegal shift count
|
1078
|
+
if (imm8 == 1) {
|
1079
|
+
EMIT(0xD1);
|
1080
|
+
EMIT(0xD0 | dst.code());
|
1081
|
+
} else {
|
1082
|
+
EMIT(0xC1);
|
1083
|
+
EMIT(0xD0 | dst.code());
|
1084
|
+
EMIT(imm8);
|
1085
|
+
}
|
1086
|
+
}
|
1087
|
+
|
1088
|
+
|
1089
|
+
void Assembler::sar(Register dst, uint8_t imm8) {
|
1090
|
+
EnsureSpace ensure_space(this);
|
1091
|
+
last_pc_ = pc_;
|
1092
|
+
ASSERT(is_uint5(imm8)); // illegal shift count
|
1093
|
+
if (imm8 == 1) {
|
1094
|
+
EMIT(0xD1);
|
1095
|
+
EMIT(0xF8 | dst.code());
|
1096
|
+
} else {
|
1097
|
+
EMIT(0xC1);
|
1098
|
+
EMIT(0xF8 | dst.code());
|
1099
|
+
EMIT(imm8);
|
1100
|
+
}
|
1101
|
+
}
|
1102
|
+
|
1103
|
+
|
1104
|
+
void Assembler::sar_cl(Register dst) {
|
1105
|
+
EnsureSpace ensure_space(this);
|
1106
|
+
last_pc_ = pc_;
|
1107
|
+
EMIT(0xD3);
|
1108
|
+
EMIT(0xF8 | dst.code());
|
1109
|
+
}
|
1110
|
+
|
1111
|
+
|
1112
|
+
void Assembler::sbb(Register dst, const Operand& src) {
|
1113
|
+
EnsureSpace ensure_space(this);
|
1114
|
+
last_pc_ = pc_;
|
1115
|
+
EMIT(0x1B);
|
1116
|
+
emit_operand(dst, src);
|
1117
|
+
}
|
1118
|
+
|
1119
|
+
|
1120
|
+
void Assembler::shld(Register dst, const Operand& src) {
|
1121
|
+
EnsureSpace ensure_space(this);
|
1122
|
+
last_pc_ = pc_;
|
1123
|
+
EMIT(0x0F);
|
1124
|
+
EMIT(0xA5);
|
1125
|
+
emit_operand(dst, src);
|
1126
|
+
}
|
1127
|
+
|
1128
|
+
|
1129
|
+
void Assembler::shl(Register dst, uint8_t imm8) {
|
1130
|
+
EnsureSpace ensure_space(this);
|
1131
|
+
last_pc_ = pc_;
|
1132
|
+
ASSERT(is_uint5(imm8)); // illegal shift count
|
1133
|
+
if (imm8 == 1) {
|
1134
|
+
EMIT(0xD1);
|
1135
|
+
EMIT(0xE0 | dst.code());
|
1136
|
+
} else {
|
1137
|
+
EMIT(0xC1);
|
1138
|
+
EMIT(0xE0 | dst.code());
|
1139
|
+
EMIT(imm8);
|
1140
|
+
}
|
1141
|
+
}
|
1142
|
+
|
1143
|
+
|
1144
|
+
void Assembler::shl_cl(Register dst) {
|
1145
|
+
EnsureSpace ensure_space(this);
|
1146
|
+
last_pc_ = pc_;
|
1147
|
+
EMIT(0xD3);
|
1148
|
+
EMIT(0xE0 | dst.code());
|
1149
|
+
}
|
1150
|
+
|
1151
|
+
|
1152
|
+
void Assembler::shrd(Register dst, const Operand& src) {
|
1153
|
+
EnsureSpace ensure_space(this);
|
1154
|
+
last_pc_ = pc_;
|
1155
|
+
EMIT(0x0F);
|
1156
|
+
EMIT(0xAD);
|
1157
|
+
emit_operand(dst, src);
|
1158
|
+
}
|
1159
|
+
|
1160
|
+
|
1161
|
+
void Assembler::shr(Register dst, uint8_t imm8) {
|
1162
|
+
EnsureSpace ensure_space(this);
|
1163
|
+
last_pc_ = pc_;
|
1164
|
+
ASSERT(is_uint5(imm8)); // illegal shift count
|
1165
|
+
if (imm8 == 1) {
|
1166
|
+
EMIT(0xD1);
|
1167
|
+
EMIT(0xE8 | dst.code());
|
1168
|
+
} else {
|
1169
|
+
EMIT(0xC1);
|
1170
|
+
EMIT(0xE8 | dst.code());
|
1171
|
+
EMIT(imm8);
|
1172
|
+
}
|
1173
|
+
}
|
1174
|
+
|
1175
|
+
|
1176
|
+
void Assembler::shr_cl(Register dst) {
|
1177
|
+
EnsureSpace ensure_space(this);
|
1178
|
+
last_pc_ = pc_;
|
1179
|
+
EMIT(0xD3);
|
1180
|
+
EMIT(0xE8 | dst.code());
|
1181
|
+
}
|
1182
|
+
|
1183
|
+
|
1184
|
+
void Assembler::subb(const Operand& op, int8_t imm8) {
|
1185
|
+
EnsureSpace ensure_space(this);
|
1186
|
+
last_pc_ = pc_;
|
1187
|
+
if (op.is_reg(eax)) {
|
1188
|
+
EMIT(0x2c);
|
1189
|
+
} else {
|
1190
|
+
EMIT(0x80);
|
1191
|
+
emit_operand(ebp, op); // ebp == 5
|
1192
|
+
}
|
1193
|
+
EMIT(imm8);
|
1194
|
+
}
|
1195
|
+
|
1196
|
+
|
1197
|
+
void Assembler::sub(const Operand& dst, const Immediate& x) {
|
1198
|
+
EnsureSpace ensure_space(this);
|
1199
|
+
last_pc_ = pc_;
|
1200
|
+
emit_arith(5, dst, x);
|
1201
|
+
}
|
1202
|
+
|
1203
|
+
|
1204
|
+
void Assembler::sub(Register dst, const Operand& src) {
|
1205
|
+
EnsureSpace ensure_space(this);
|
1206
|
+
last_pc_ = pc_;
|
1207
|
+
EMIT(0x2B);
|
1208
|
+
emit_operand(dst, src);
|
1209
|
+
}
|
1210
|
+
|
1211
|
+
|
1212
|
+
void Assembler::subb(Register dst, const Operand& src) {
|
1213
|
+
ASSERT(dst.code() < 4);
|
1214
|
+
EnsureSpace ensure_space(this);
|
1215
|
+
last_pc_ = pc_;
|
1216
|
+
EMIT(0x2A);
|
1217
|
+
emit_operand(dst, src);
|
1218
|
+
}
|
1219
|
+
|
1220
|
+
|
1221
|
+
void Assembler::sub(const Operand& dst, Register src) {
|
1222
|
+
EnsureSpace ensure_space(this);
|
1223
|
+
last_pc_ = pc_;
|
1224
|
+
EMIT(0x29);
|
1225
|
+
emit_operand(src, dst);
|
1226
|
+
}
|
1227
|
+
|
1228
|
+
|
1229
|
+
void Assembler::test(Register reg, const Immediate& imm) {
|
1230
|
+
EnsureSpace ensure_space(this);
|
1231
|
+
last_pc_ = pc_;
|
1232
|
+
// Only use test against byte for registers that have a byte
|
1233
|
+
// variant: eax, ebx, ecx, and edx.
|
1234
|
+
if (imm.rmode_ == RelocInfo::NONE && is_uint8(imm.x_) && reg.code() < 4) {
|
1235
|
+
uint8_t imm8 = imm.x_;
|
1236
|
+
if (reg.is(eax)) {
|
1237
|
+
EMIT(0xA8);
|
1238
|
+
EMIT(imm8);
|
1239
|
+
} else {
|
1240
|
+
emit_arith_b(0xF6, 0xC0, reg, imm8);
|
1241
|
+
}
|
1242
|
+
} else {
|
1243
|
+
// This is not using emit_arith because test doesn't support
|
1244
|
+
// sign-extension of 8-bit operands.
|
1245
|
+
if (reg.is(eax)) {
|
1246
|
+
EMIT(0xA9);
|
1247
|
+
} else {
|
1248
|
+
EMIT(0xF7);
|
1249
|
+
EMIT(0xC0 | reg.code());
|
1250
|
+
}
|
1251
|
+
emit(imm);
|
1252
|
+
}
|
1253
|
+
}
|
1254
|
+
|
1255
|
+
|
1256
|
+
void Assembler::test(Register reg, const Operand& op) {
|
1257
|
+
EnsureSpace ensure_space(this);
|
1258
|
+
last_pc_ = pc_;
|
1259
|
+
EMIT(0x85);
|
1260
|
+
emit_operand(reg, op);
|
1261
|
+
}
|
1262
|
+
|
1263
|
+
|
1264
|
+
void Assembler::test(const Operand& op, const Immediate& imm) {
|
1265
|
+
EnsureSpace ensure_space(this);
|
1266
|
+
last_pc_ = pc_;
|
1267
|
+
EMIT(0xF7);
|
1268
|
+
emit_operand(eax, op);
|
1269
|
+
emit(imm);
|
1270
|
+
}
|
1271
|
+
|
1272
|
+
|
1273
|
+
void Assembler::xor_(Register dst, int32_t imm32) {
|
1274
|
+
EnsureSpace ensure_space(this);
|
1275
|
+
last_pc_ = pc_;
|
1276
|
+
emit_arith(6, Operand(dst), Immediate(imm32));
|
1277
|
+
}
|
1278
|
+
|
1279
|
+
|
1280
|
+
void Assembler::xor_(Register dst, const Operand& src) {
|
1281
|
+
EnsureSpace ensure_space(this);
|
1282
|
+
last_pc_ = pc_;
|
1283
|
+
EMIT(0x33);
|
1284
|
+
emit_operand(dst, src);
|
1285
|
+
}
|
1286
|
+
|
1287
|
+
|
1288
|
+
void Assembler::xor_(const Operand& src, Register dst) {
|
1289
|
+
EnsureSpace ensure_space(this);
|
1290
|
+
last_pc_ = pc_;
|
1291
|
+
EMIT(0x31);
|
1292
|
+
emit_operand(dst, src);
|
1293
|
+
}
|
1294
|
+
|
1295
|
+
|
1296
|
+
void Assembler::xor_(const Operand& dst, const Immediate& x) {
|
1297
|
+
EnsureSpace ensure_space(this);
|
1298
|
+
last_pc_ = pc_;
|
1299
|
+
emit_arith(6, dst, x);
|
1300
|
+
}
|
1301
|
+
|
1302
|
+
|
1303
|
+
void Assembler::bt(const Operand& dst, Register src) {
|
1304
|
+
EnsureSpace ensure_space(this);
|
1305
|
+
last_pc_ = pc_;
|
1306
|
+
EMIT(0x0F);
|
1307
|
+
EMIT(0xA3);
|
1308
|
+
emit_operand(src, dst);
|
1309
|
+
}
|
1310
|
+
|
1311
|
+
|
1312
|
+
void Assembler::bts(const Operand& dst, Register src) {
|
1313
|
+
EnsureSpace ensure_space(this);
|
1314
|
+
last_pc_ = pc_;
|
1315
|
+
EMIT(0x0F);
|
1316
|
+
EMIT(0xAB);
|
1317
|
+
emit_operand(src, dst);
|
1318
|
+
}
|
1319
|
+
|
1320
|
+
|
1321
|
+
void Assembler::hlt() {
|
1322
|
+
EnsureSpace ensure_space(this);
|
1323
|
+
last_pc_ = pc_;
|
1324
|
+
EMIT(0xF4);
|
1325
|
+
}
|
1326
|
+
|
1327
|
+
|
1328
|
+
void Assembler::int3() {
|
1329
|
+
EnsureSpace ensure_space(this);
|
1330
|
+
last_pc_ = pc_;
|
1331
|
+
EMIT(0xCC);
|
1332
|
+
}
|
1333
|
+
|
1334
|
+
|
1335
|
+
void Assembler::nop() {
|
1336
|
+
EnsureSpace ensure_space(this);
|
1337
|
+
last_pc_ = pc_;
|
1338
|
+
EMIT(0x90);
|
1339
|
+
}
|
1340
|
+
|
1341
|
+
|
1342
|
+
void Assembler::rdtsc() {
|
1343
|
+
ASSERT(CpuFeatures::IsEnabled(RDTSC));
|
1344
|
+
EnsureSpace ensure_space(this);
|
1345
|
+
last_pc_ = pc_;
|
1346
|
+
EMIT(0x0F);
|
1347
|
+
EMIT(0x31);
|
1348
|
+
}
|
1349
|
+
|
1350
|
+
|
1351
|
+
void Assembler::ret(int imm16) {
|
1352
|
+
EnsureSpace ensure_space(this);
|
1353
|
+
last_pc_ = pc_;
|
1354
|
+
ASSERT(is_uint16(imm16));
|
1355
|
+
if (imm16 == 0) {
|
1356
|
+
EMIT(0xC3);
|
1357
|
+
} else {
|
1358
|
+
EMIT(0xC2);
|
1359
|
+
EMIT(imm16 & 0xFF);
|
1360
|
+
EMIT((imm16 >> 8) & 0xFF);
|
1361
|
+
}
|
1362
|
+
}
|
1363
|
+
|
1364
|
+
|
1365
|
+
// Labels refer to positions in the (to be) generated code.
|
1366
|
+
// There are bound, linked, and unused labels.
|
1367
|
+
//
|
1368
|
+
// Bound labels refer to known positions in the already
|
1369
|
+
// generated code. pos() is the position the label refers to.
|
1370
|
+
//
|
1371
|
+
// Linked labels refer to unknown positions in the code
|
1372
|
+
// to be generated; pos() is the position of the 32bit
|
1373
|
+
// Displacement of the last instruction using the label.
|
1374
|
+
|
1375
|
+
|
1376
|
+
void Assembler::print(Label* L) {
|
1377
|
+
if (L->is_unused()) {
|
1378
|
+
PrintF("unused label\n");
|
1379
|
+
} else if (L->is_bound()) {
|
1380
|
+
PrintF("bound label to %d\n", L->pos());
|
1381
|
+
} else if (L->is_linked()) {
|
1382
|
+
Label l = *L;
|
1383
|
+
PrintF("unbound label");
|
1384
|
+
while (l.is_linked()) {
|
1385
|
+
Displacement disp = disp_at(&l);
|
1386
|
+
PrintF("@ %d ", l.pos());
|
1387
|
+
disp.print();
|
1388
|
+
PrintF("\n");
|
1389
|
+
disp.next(&l);
|
1390
|
+
}
|
1391
|
+
} else {
|
1392
|
+
PrintF("label in inconsistent state (pos = %d)\n", L->pos_);
|
1393
|
+
}
|
1394
|
+
}
|
1395
|
+
|
1396
|
+
|
1397
|
+
void Assembler::bind_to(Label* L, int pos) {
|
1398
|
+
EnsureSpace ensure_space(this);
|
1399
|
+
last_pc_ = NULL;
|
1400
|
+
ASSERT(0 <= pos && pos <= pc_offset()); // must have a valid binding position
|
1401
|
+
while (L->is_linked()) {
|
1402
|
+
Displacement disp = disp_at(L);
|
1403
|
+
int fixup_pos = L->pos();
|
1404
|
+
if (disp.type() == Displacement::CODE_RELATIVE) {
|
1405
|
+
// Relative to Code* heap object pointer.
|
1406
|
+
long_at_put(fixup_pos, pos + Code::kHeaderSize - kHeapObjectTag);
|
1407
|
+
} else {
|
1408
|
+
if (disp.type() == Displacement::UNCONDITIONAL_JUMP) {
|
1409
|
+
ASSERT(byte_at(fixup_pos - 1) == 0xE9); // jmp expected
|
1410
|
+
}
|
1411
|
+
// relative address, relative to point after address
|
1412
|
+
int imm32 = pos - (fixup_pos + sizeof(int32_t));
|
1413
|
+
long_at_put(fixup_pos, imm32);
|
1414
|
+
}
|
1415
|
+
disp.next(L);
|
1416
|
+
}
|
1417
|
+
L->bind_to(pos);
|
1418
|
+
}
|
1419
|
+
|
1420
|
+
|
1421
|
+
void Assembler::link_to(Label* L, Label* appendix) {
|
1422
|
+
EnsureSpace ensure_space(this);
|
1423
|
+
last_pc_ = NULL;
|
1424
|
+
if (appendix->is_linked()) {
|
1425
|
+
if (L->is_linked()) {
|
1426
|
+
// append appendix to L's list
|
1427
|
+
Label p;
|
1428
|
+
Label q = *L;
|
1429
|
+
do {
|
1430
|
+
p = q;
|
1431
|
+
Displacement disp = disp_at(&q);
|
1432
|
+
disp.next(&q);
|
1433
|
+
} while (q.is_linked());
|
1434
|
+
Displacement disp = disp_at(&p);
|
1435
|
+
disp.link_to(appendix);
|
1436
|
+
disp_at_put(&p, disp);
|
1437
|
+
p.Unuse(); // to avoid assertion failure in ~Label
|
1438
|
+
} else {
|
1439
|
+
// L is empty, simply use appendix
|
1440
|
+
*L = *appendix;
|
1441
|
+
}
|
1442
|
+
}
|
1443
|
+
appendix->Unuse(); // appendix should not be used anymore
|
1444
|
+
}
|
1445
|
+
|
1446
|
+
|
1447
|
+
void Assembler::bind(Label* L) {
|
1448
|
+
EnsureSpace ensure_space(this);
|
1449
|
+
last_pc_ = NULL;
|
1450
|
+
ASSERT(!L->is_bound()); // label can only be bound once
|
1451
|
+
bind_to(L, pc_offset());
|
1452
|
+
}
|
1453
|
+
|
1454
|
+
|
1455
|
+
void Assembler::call(Label* L) {
|
1456
|
+
EnsureSpace ensure_space(this);
|
1457
|
+
last_pc_ = pc_;
|
1458
|
+
if (L->is_bound()) {
|
1459
|
+
const int long_size = 5;
|
1460
|
+
int offs = L->pos() - pc_offset();
|
1461
|
+
ASSERT(offs <= 0);
|
1462
|
+
// 1110 1000 #32-bit disp
|
1463
|
+
EMIT(0xE8);
|
1464
|
+
emit(offs - long_size);
|
1465
|
+
} else {
|
1466
|
+
// 1110 1000 #32-bit disp
|
1467
|
+
EMIT(0xE8);
|
1468
|
+
emit_disp(L, Displacement::OTHER);
|
1469
|
+
}
|
1470
|
+
}
|
1471
|
+
|
1472
|
+
|
1473
|
+
void Assembler::call(byte* entry, RelocInfo::Mode rmode) {
|
1474
|
+
EnsureSpace ensure_space(this);
|
1475
|
+
last_pc_ = pc_;
|
1476
|
+
ASSERT(!RelocInfo::IsCodeTarget(rmode));
|
1477
|
+
EMIT(0xE8);
|
1478
|
+
emit(entry - (pc_ + sizeof(int32_t)), rmode);
|
1479
|
+
}
|
1480
|
+
|
1481
|
+
|
1482
|
+
void Assembler::call(const Operand& adr) {
|
1483
|
+
EnsureSpace ensure_space(this);
|
1484
|
+
last_pc_ = pc_;
|
1485
|
+
EMIT(0xFF);
|
1486
|
+
emit_operand(edx, adr);
|
1487
|
+
}
|
1488
|
+
|
1489
|
+
|
1490
|
+
void Assembler::call(Handle<Code> code, RelocInfo::Mode rmode) {
|
1491
|
+
WriteRecordedPositions();
|
1492
|
+
EnsureSpace ensure_space(this);
|
1493
|
+
last_pc_ = pc_;
|
1494
|
+
ASSERT(RelocInfo::IsCodeTarget(rmode));
|
1495
|
+
EMIT(0xE8);
|
1496
|
+
emit(reinterpret_cast<intptr_t>(code.location()), rmode);
|
1497
|
+
}
|
1498
|
+
|
1499
|
+
|
1500
|
+
void Assembler::jmp(Label* L) {
|
1501
|
+
EnsureSpace ensure_space(this);
|
1502
|
+
last_pc_ = pc_;
|
1503
|
+
if (L->is_bound()) {
|
1504
|
+
const int short_size = 2;
|
1505
|
+
const int long_size = 5;
|
1506
|
+
int offs = L->pos() - pc_offset();
|
1507
|
+
ASSERT(offs <= 0);
|
1508
|
+
if (is_int8(offs - short_size)) {
|
1509
|
+
// 1110 1011 #8-bit disp
|
1510
|
+
EMIT(0xEB);
|
1511
|
+
EMIT((offs - short_size) & 0xFF);
|
1512
|
+
} else {
|
1513
|
+
// 1110 1001 #32-bit disp
|
1514
|
+
EMIT(0xE9);
|
1515
|
+
emit(offs - long_size);
|
1516
|
+
}
|
1517
|
+
} else {
|
1518
|
+
// 1110 1001 #32-bit disp
|
1519
|
+
EMIT(0xE9);
|
1520
|
+
emit_disp(L, Displacement::UNCONDITIONAL_JUMP);
|
1521
|
+
}
|
1522
|
+
}
|
1523
|
+
|
1524
|
+
|
1525
|
+
void Assembler::jmp(byte* entry, RelocInfo::Mode rmode) {
|
1526
|
+
EnsureSpace ensure_space(this);
|
1527
|
+
last_pc_ = pc_;
|
1528
|
+
ASSERT(!RelocInfo::IsCodeTarget(rmode));
|
1529
|
+
EMIT(0xE9);
|
1530
|
+
emit(entry - (pc_ + sizeof(int32_t)), rmode);
|
1531
|
+
}
|
1532
|
+
|
1533
|
+
|
1534
|
+
void Assembler::jmp(const Operand& adr) {
|
1535
|
+
EnsureSpace ensure_space(this);
|
1536
|
+
last_pc_ = pc_;
|
1537
|
+
EMIT(0xFF);
|
1538
|
+
emit_operand(esp, adr);
|
1539
|
+
}
|
1540
|
+
|
1541
|
+
|
1542
|
+
void Assembler::jmp(Handle<Code> code, RelocInfo::Mode rmode) {
|
1543
|
+
EnsureSpace ensure_space(this);
|
1544
|
+
last_pc_ = pc_;
|
1545
|
+
ASSERT(RelocInfo::IsCodeTarget(rmode));
|
1546
|
+
EMIT(0xE9);
|
1547
|
+
emit(reinterpret_cast<intptr_t>(code.location()), rmode);
|
1548
|
+
}
|
1549
|
+
|
1550
|
+
|
1551
|
+
|
1552
|
+
void Assembler::j(Condition cc, Label* L, Hint hint) {
|
1553
|
+
EnsureSpace ensure_space(this);
|
1554
|
+
last_pc_ = pc_;
|
1555
|
+
ASSERT(0 <= cc && cc < 16);
|
1556
|
+
if (FLAG_emit_branch_hints && hint != no_hint) EMIT(hint);
|
1557
|
+
if (L->is_bound()) {
|
1558
|
+
const int short_size = 2;
|
1559
|
+
const int long_size = 6;
|
1560
|
+
int offs = L->pos() - pc_offset();
|
1561
|
+
ASSERT(offs <= 0);
|
1562
|
+
if (is_int8(offs - short_size)) {
|
1563
|
+
// 0111 tttn #8-bit disp
|
1564
|
+
EMIT(0x70 | cc);
|
1565
|
+
EMIT((offs - short_size) & 0xFF);
|
1566
|
+
} else {
|
1567
|
+
// 0000 1111 1000 tttn #32-bit disp
|
1568
|
+
EMIT(0x0F);
|
1569
|
+
EMIT(0x80 | cc);
|
1570
|
+
emit(offs - long_size);
|
1571
|
+
}
|
1572
|
+
} else {
|
1573
|
+
// 0000 1111 1000 tttn #32-bit disp
|
1574
|
+
// Note: could eliminate cond. jumps to this jump if condition
|
1575
|
+
// is the same however, seems to be rather unlikely case.
|
1576
|
+
EMIT(0x0F);
|
1577
|
+
EMIT(0x80 | cc);
|
1578
|
+
emit_disp(L, Displacement::OTHER);
|
1579
|
+
}
|
1580
|
+
}
|
1581
|
+
|
1582
|
+
|
1583
|
+
void Assembler::j(Condition cc, byte* entry, RelocInfo::Mode rmode, Hint hint) {
|
1584
|
+
EnsureSpace ensure_space(this);
|
1585
|
+
last_pc_ = pc_;
|
1586
|
+
ASSERT((0 <= cc) && (cc < 16));
|
1587
|
+
if (FLAG_emit_branch_hints && hint != no_hint) EMIT(hint);
|
1588
|
+
// 0000 1111 1000 tttn #32-bit disp
|
1589
|
+
EMIT(0x0F);
|
1590
|
+
EMIT(0x80 | cc);
|
1591
|
+
emit(entry - (pc_ + sizeof(int32_t)), rmode);
|
1592
|
+
}
|
1593
|
+
|
1594
|
+
|
1595
|
+
void Assembler::j(Condition cc, Handle<Code> code, Hint hint) {
|
1596
|
+
EnsureSpace ensure_space(this);
|
1597
|
+
last_pc_ = pc_;
|
1598
|
+
if (FLAG_emit_branch_hints && hint != no_hint) EMIT(hint);
|
1599
|
+
// 0000 1111 1000 tttn #32-bit disp
|
1600
|
+
EMIT(0x0F);
|
1601
|
+
EMIT(0x80 | cc);
|
1602
|
+
emit(reinterpret_cast<intptr_t>(code.location()), RelocInfo::CODE_TARGET);
|
1603
|
+
}
|
1604
|
+
|
1605
|
+
|
1606
|
+
// FPU instructions
|
1607
|
+
|
1608
|
+
void Assembler::fld(int i) {
|
1609
|
+
EnsureSpace ensure_space(this);
|
1610
|
+
last_pc_ = pc_;
|
1611
|
+
emit_farith(0xD9, 0xC0, i);
|
1612
|
+
}
|
1613
|
+
|
1614
|
+
|
1615
|
+
void Assembler::fld1() {
|
1616
|
+
EnsureSpace ensure_space(this);
|
1617
|
+
last_pc_ = pc_;
|
1618
|
+
EMIT(0xD9);
|
1619
|
+
EMIT(0xE8);
|
1620
|
+
}
|
1621
|
+
|
1622
|
+
|
1623
|
+
void Assembler::fldz() {
|
1624
|
+
EnsureSpace ensure_space(this);
|
1625
|
+
last_pc_ = pc_;
|
1626
|
+
EMIT(0xD9);
|
1627
|
+
EMIT(0xEE);
|
1628
|
+
}
|
1629
|
+
|
1630
|
+
|
1631
|
+
void Assembler::fld_s(const Operand& adr) {
|
1632
|
+
EnsureSpace ensure_space(this);
|
1633
|
+
last_pc_ = pc_;
|
1634
|
+
EMIT(0xD9);
|
1635
|
+
emit_operand(eax, adr);
|
1636
|
+
}
|
1637
|
+
|
1638
|
+
|
1639
|
+
void Assembler::fld_d(const Operand& adr) {
|
1640
|
+
EnsureSpace ensure_space(this);
|
1641
|
+
last_pc_ = pc_;
|
1642
|
+
EMIT(0xDD);
|
1643
|
+
emit_operand(eax, adr);
|
1644
|
+
}
|
1645
|
+
|
1646
|
+
|
1647
|
+
void Assembler::fstp_s(const Operand& adr) {
|
1648
|
+
EnsureSpace ensure_space(this);
|
1649
|
+
last_pc_ = pc_;
|
1650
|
+
EMIT(0xD9);
|
1651
|
+
emit_operand(ebx, adr);
|
1652
|
+
}
|
1653
|
+
|
1654
|
+
|
1655
|
+
void Assembler::fstp_d(const Operand& adr) {
|
1656
|
+
EnsureSpace ensure_space(this);
|
1657
|
+
last_pc_ = pc_;
|
1658
|
+
EMIT(0xDD);
|
1659
|
+
emit_operand(ebx, adr);
|
1660
|
+
}
|
1661
|
+
|
1662
|
+
|
1663
|
+
void Assembler::fild_s(const Operand& adr) {
|
1664
|
+
EnsureSpace ensure_space(this);
|
1665
|
+
last_pc_ = pc_;
|
1666
|
+
EMIT(0xDB);
|
1667
|
+
emit_operand(eax, adr);
|
1668
|
+
}
|
1669
|
+
|
1670
|
+
|
1671
|
+
void Assembler::fild_d(const Operand& adr) {
|
1672
|
+
EnsureSpace ensure_space(this);
|
1673
|
+
last_pc_ = pc_;
|
1674
|
+
EMIT(0xDF);
|
1675
|
+
emit_operand(ebp, adr);
|
1676
|
+
}
|
1677
|
+
|
1678
|
+
|
1679
|
+
void Assembler::fistp_s(const Operand& adr) {
|
1680
|
+
EnsureSpace ensure_space(this);
|
1681
|
+
last_pc_ = pc_;
|
1682
|
+
EMIT(0xDB);
|
1683
|
+
emit_operand(ebx, adr);
|
1684
|
+
}
|
1685
|
+
|
1686
|
+
|
1687
|
+
void Assembler::fisttp_s(const Operand& adr) {
|
1688
|
+
ASSERT(CpuFeatures::IsEnabled(SSE3));
|
1689
|
+
EnsureSpace ensure_space(this);
|
1690
|
+
last_pc_ = pc_;
|
1691
|
+
EMIT(0xDB);
|
1692
|
+
emit_operand(ecx, adr);
|
1693
|
+
}
|
1694
|
+
|
1695
|
+
|
1696
|
+
void Assembler::fisttp_d(const Operand& adr) {
|
1697
|
+
ASSERT(CpuFeatures::IsEnabled(SSE3));
|
1698
|
+
EnsureSpace ensure_space(this);
|
1699
|
+
last_pc_ = pc_;
|
1700
|
+
EMIT(0xDD);
|
1701
|
+
emit_operand(ecx, adr);
|
1702
|
+
}
|
1703
|
+
|
1704
|
+
|
1705
|
+
void Assembler::fist_s(const Operand& adr) {
|
1706
|
+
EnsureSpace ensure_space(this);
|
1707
|
+
last_pc_ = pc_;
|
1708
|
+
EMIT(0xDB);
|
1709
|
+
emit_operand(edx, adr);
|
1710
|
+
}
|
1711
|
+
|
1712
|
+
|
1713
|
+
void Assembler::fistp_d(const Operand& adr) {
|
1714
|
+
EnsureSpace ensure_space(this);
|
1715
|
+
last_pc_ = pc_;
|
1716
|
+
EMIT(0xDF);
|
1717
|
+
emit_operand(edi, adr);
|
1718
|
+
}
|
1719
|
+
|
1720
|
+
|
1721
|
+
void Assembler::fabs() {
|
1722
|
+
EnsureSpace ensure_space(this);
|
1723
|
+
last_pc_ = pc_;
|
1724
|
+
EMIT(0xD9);
|
1725
|
+
EMIT(0xE1);
|
1726
|
+
}
|
1727
|
+
|
1728
|
+
|
1729
|
+
void Assembler::fchs() {
|
1730
|
+
EnsureSpace ensure_space(this);
|
1731
|
+
last_pc_ = pc_;
|
1732
|
+
EMIT(0xD9);
|
1733
|
+
EMIT(0xE0);
|
1734
|
+
}
|
1735
|
+
|
1736
|
+
|
1737
|
+
void Assembler::fcos() {
|
1738
|
+
EnsureSpace ensure_space(this);
|
1739
|
+
last_pc_ = pc_;
|
1740
|
+
EMIT(0xD9);
|
1741
|
+
EMIT(0xFF);
|
1742
|
+
}
|
1743
|
+
|
1744
|
+
|
1745
|
+
void Assembler::fsin() {
|
1746
|
+
EnsureSpace ensure_space(this);
|
1747
|
+
last_pc_ = pc_;
|
1748
|
+
EMIT(0xD9);
|
1749
|
+
EMIT(0xFE);
|
1750
|
+
}
|
1751
|
+
|
1752
|
+
|
1753
|
+
void Assembler::fadd(int i) {
|
1754
|
+
EnsureSpace ensure_space(this);
|
1755
|
+
last_pc_ = pc_;
|
1756
|
+
emit_farith(0xDC, 0xC0, i);
|
1757
|
+
}
|
1758
|
+
|
1759
|
+
|
1760
|
+
void Assembler::fsub(int i) {
|
1761
|
+
EnsureSpace ensure_space(this);
|
1762
|
+
last_pc_ = pc_;
|
1763
|
+
emit_farith(0xDC, 0xE8, i);
|
1764
|
+
}
|
1765
|
+
|
1766
|
+
|
1767
|
+
void Assembler::fisub_s(const Operand& adr) {
|
1768
|
+
EnsureSpace ensure_space(this);
|
1769
|
+
last_pc_ = pc_;
|
1770
|
+
EMIT(0xDA);
|
1771
|
+
emit_operand(esp, adr);
|
1772
|
+
}
|
1773
|
+
|
1774
|
+
|
1775
|
+
void Assembler::fmul(int i) {
|
1776
|
+
EnsureSpace ensure_space(this);
|
1777
|
+
last_pc_ = pc_;
|
1778
|
+
emit_farith(0xDC, 0xC8, i);
|
1779
|
+
}
|
1780
|
+
|
1781
|
+
|
1782
|
+
void Assembler::fdiv(int i) {
|
1783
|
+
EnsureSpace ensure_space(this);
|
1784
|
+
last_pc_ = pc_;
|
1785
|
+
emit_farith(0xDC, 0xF8, i);
|
1786
|
+
}
|
1787
|
+
|
1788
|
+
|
1789
|
+
void Assembler::faddp(int i) {
|
1790
|
+
EnsureSpace ensure_space(this);
|
1791
|
+
last_pc_ = pc_;
|
1792
|
+
emit_farith(0xDE, 0xC0, i);
|
1793
|
+
}
|
1794
|
+
|
1795
|
+
|
1796
|
+
void Assembler::fsubp(int i) {
|
1797
|
+
EnsureSpace ensure_space(this);
|
1798
|
+
last_pc_ = pc_;
|
1799
|
+
emit_farith(0xDE, 0xE8, i);
|
1800
|
+
}
|
1801
|
+
|
1802
|
+
|
1803
|
+
void Assembler::fsubrp(int i) {
|
1804
|
+
EnsureSpace ensure_space(this);
|
1805
|
+
last_pc_ = pc_;
|
1806
|
+
emit_farith(0xDE, 0xE0, i);
|
1807
|
+
}
|
1808
|
+
|
1809
|
+
|
1810
|
+
void Assembler::fmulp(int i) {
|
1811
|
+
EnsureSpace ensure_space(this);
|
1812
|
+
last_pc_ = pc_;
|
1813
|
+
emit_farith(0xDE, 0xC8, i);
|
1814
|
+
}
|
1815
|
+
|
1816
|
+
|
1817
|
+
void Assembler::fdivp(int i) {
|
1818
|
+
EnsureSpace ensure_space(this);
|
1819
|
+
last_pc_ = pc_;
|
1820
|
+
emit_farith(0xDE, 0xF8, i);
|
1821
|
+
}
|
1822
|
+
|
1823
|
+
|
1824
|
+
void Assembler::fprem() {
|
1825
|
+
EnsureSpace ensure_space(this);
|
1826
|
+
last_pc_ = pc_;
|
1827
|
+
EMIT(0xD9);
|
1828
|
+
EMIT(0xF8);
|
1829
|
+
}
|
1830
|
+
|
1831
|
+
|
1832
|
+
void Assembler::fprem1() {
|
1833
|
+
EnsureSpace ensure_space(this);
|
1834
|
+
last_pc_ = pc_;
|
1835
|
+
EMIT(0xD9);
|
1836
|
+
EMIT(0xF5);
|
1837
|
+
}
|
1838
|
+
|
1839
|
+
|
1840
|
+
void Assembler::fxch(int i) {
|
1841
|
+
EnsureSpace ensure_space(this);
|
1842
|
+
last_pc_ = pc_;
|
1843
|
+
emit_farith(0xD9, 0xC8, i);
|
1844
|
+
}
|
1845
|
+
|
1846
|
+
|
1847
|
+
void Assembler::fincstp() {
|
1848
|
+
EnsureSpace ensure_space(this);
|
1849
|
+
last_pc_ = pc_;
|
1850
|
+
EMIT(0xD9);
|
1851
|
+
EMIT(0xF7);
|
1852
|
+
}
|
1853
|
+
|
1854
|
+
|
1855
|
+
void Assembler::ffree(int i) {
|
1856
|
+
EnsureSpace ensure_space(this);
|
1857
|
+
last_pc_ = pc_;
|
1858
|
+
emit_farith(0xDD, 0xC0, i);
|
1859
|
+
}
|
1860
|
+
|
1861
|
+
|
1862
|
+
void Assembler::ftst() {
|
1863
|
+
EnsureSpace ensure_space(this);
|
1864
|
+
last_pc_ = pc_;
|
1865
|
+
EMIT(0xD9);
|
1866
|
+
EMIT(0xE4);
|
1867
|
+
}
|
1868
|
+
|
1869
|
+
|
1870
|
+
void Assembler::fucomp(int i) {
|
1871
|
+
EnsureSpace ensure_space(this);
|
1872
|
+
last_pc_ = pc_;
|
1873
|
+
emit_farith(0xDD, 0xE8, i);
|
1874
|
+
}
|
1875
|
+
|
1876
|
+
|
1877
|
+
void Assembler::fucompp() {
|
1878
|
+
EnsureSpace ensure_space(this);
|
1879
|
+
last_pc_ = pc_;
|
1880
|
+
EMIT(0xDA);
|
1881
|
+
EMIT(0xE9);
|
1882
|
+
}
|
1883
|
+
|
1884
|
+
|
1885
|
+
void Assembler::fucomi(int i) {
|
1886
|
+
EnsureSpace ensure_space(this);
|
1887
|
+
last_pc_ = pc_;
|
1888
|
+
EMIT(0xDB);
|
1889
|
+
EMIT(0xE8 + i);
|
1890
|
+
}
|
1891
|
+
|
1892
|
+
|
1893
|
+
void Assembler::fucomip() {
|
1894
|
+
EnsureSpace ensure_space(this);
|
1895
|
+
last_pc_ = pc_;
|
1896
|
+
EMIT(0xDF);
|
1897
|
+
EMIT(0xE9);
|
1898
|
+
}
|
1899
|
+
|
1900
|
+
|
1901
|
+
void Assembler::fcompp() {
|
1902
|
+
EnsureSpace ensure_space(this);
|
1903
|
+
last_pc_ = pc_;
|
1904
|
+
EMIT(0xDE);
|
1905
|
+
EMIT(0xD9);
|
1906
|
+
}
|
1907
|
+
|
1908
|
+
|
1909
|
+
void Assembler::fnstsw_ax() {
|
1910
|
+
EnsureSpace ensure_space(this);
|
1911
|
+
last_pc_ = pc_;
|
1912
|
+
EMIT(0xDF);
|
1913
|
+
EMIT(0xE0);
|
1914
|
+
}
|
1915
|
+
|
1916
|
+
|
1917
|
+
void Assembler::fwait() {
|
1918
|
+
EnsureSpace ensure_space(this);
|
1919
|
+
last_pc_ = pc_;
|
1920
|
+
EMIT(0x9B);
|
1921
|
+
}
|
1922
|
+
|
1923
|
+
|
1924
|
+
void Assembler::frndint() {
|
1925
|
+
EnsureSpace ensure_space(this);
|
1926
|
+
last_pc_ = pc_;
|
1927
|
+
EMIT(0xD9);
|
1928
|
+
EMIT(0xFC);
|
1929
|
+
}
|
1930
|
+
|
1931
|
+
|
1932
|
+
void Assembler::fnclex() {
|
1933
|
+
EnsureSpace ensure_space(this);
|
1934
|
+
last_pc_ = pc_;
|
1935
|
+
EMIT(0xDB);
|
1936
|
+
EMIT(0xE2);
|
1937
|
+
}
|
1938
|
+
|
1939
|
+
|
1940
|
+
void Assembler::sahf() {
|
1941
|
+
EnsureSpace ensure_space(this);
|
1942
|
+
last_pc_ = pc_;
|
1943
|
+
EMIT(0x9E);
|
1944
|
+
}
|
1945
|
+
|
1946
|
+
|
1947
|
+
void Assembler::setcc(Condition cc, Register reg) {
|
1948
|
+
ASSERT(reg.is_byte_register());
|
1949
|
+
EnsureSpace ensure_space(this);
|
1950
|
+
last_pc_ = pc_;
|
1951
|
+
EMIT(0x0F);
|
1952
|
+
EMIT(0x90 | cc);
|
1953
|
+
EMIT(0xC0 | reg.code());
|
1954
|
+
}
|
1955
|
+
|
1956
|
+
|
1957
|
+
void Assembler::cvttss2si(Register dst, const Operand& src) {
|
1958
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
1959
|
+
EnsureSpace ensure_space(this);
|
1960
|
+
last_pc_ = pc_;
|
1961
|
+
EMIT(0xF3);
|
1962
|
+
EMIT(0x0F);
|
1963
|
+
EMIT(0x2C);
|
1964
|
+
emit_operand(dst, src);
|
1965
|
+
}
|
1966
|
+
|
1967
|
+
|
1968
|
+
void Assembler::cvttsd2si(Register dst, const Operand& src) {
|
1969
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
1970
|
+
EnsureSpace ensure_space(this);
|
1971
|
+
last_pc_ = pc_;
|
1972
|
+
EMIT(0xF2);
|
1973
|
+
EMIT(0x0F);
|
1974
|
+
EMIT(0x2C);
|
1975
|
+
emit_operand(dst, src);
|
1976
|
+
}
|
1977
|
+
|
1978
|
+
|
1979
|
+
void Assembler::cvtsi2sd(XMMRegister dst, const Operand& src) {
|
1980
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
1981
|
+
EnsureSpace ensure_space(this);
|
1982
|
+
last_pc_ = pc_;
|
1983
|
+
EMIT(0xF2);
|
1984
|
+
EMIT(0x0F);
|
1985
|
+
EMIT(0x2A);
|
1986
|
+
emit_sse_operand(dst, src);
|
1987
|
+
}
|
1988
|
+
|
1989
|
+
|
1990
|
+
void Assembler::addsd(XMMRegister dst, XMMRegister src) {
|
1991
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
1992
|
+
EnsureSpace ensure_space(this);
|
1993
|
+
last_pc_ = pc_;
|
1994
|
+
EMIT(0xF2);
|
1995
|
+
EMIT(0x0F);
|
1996
|
+
EMIT(0x58);
|
1997
|
+
emit_sse_operand(dst, src);
|
1998
|
+
}
|
1999
|
+
|
2000
|
+
|
2001
|
+
void Assembler::mulsd(XMMRegister dst, XMMRegister src) {
|
2002
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2003
|
+
EnsureSpace ensure_space(this);
|
2004
|
+
last_pc_ = pc_;
|
2005
|
+
EMIT(0xF2);
|
2006
|
+
EMIT(0x0F);
|
2007
|
+
EMIT(0x59);
|
2008
|
+
emit_sse_operand(dst, src);
|
2009
|
+
}
|
2010
|
+
|
2011
|
+
|
2012
|
+
void Assembler::subsd(XMMRegister dst, XMMRegister src) {
|
2013
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2014
|
+
EnsureSpace ensure_space(this);
|
2015
|
+
last_pc_ = pc_;
|
2016
|
+
EMIT(0xF2);
|
2017
|
+
EMIT(0x0F);
|
2018
|
+
EMIT(0x5C);
|
2019
|
+
emit_sse_operand(dst, src);
|
2020
|
+
}
|
2021
|
+
|
2022
|
+
|
2023
|
+
void Assembler::divsd(XMMRegister dst, XMMRegister src) {
|
2024
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2025
|
+
EnsureSpace ensure_space(this);
|
2026
|
+
last_pc_ = pc_;
|
2027
|
+
EMIT(0xF2);
|
2028
|
+
EMIT(0x0F);
|
2029
|
+
EMIT(0x5E);
|
2030
|
+
emit_sse_operand(dst, src);
|
2031
|
+
}
|
2032
|
+
|
2033
|
+
|
2034
|
+
void Assembler::xorpd(XMMRegister dst, XMMRegister src) {
|
2035
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2036
|
+
EnsureSpace ensure_space(this);
|
2037
|
+
last_pc_ = pc_;
|
2038
|
+
EMIT(0x66);
|
2039
|
+
EMIT(0x0F);
|
2040
|
+
EMIT(0x57);
|
2041
|
+
emit_sse_operand(dst, src);
|
2042
|
+
}
|
2043
|
+
|
2044
|
+
|
2045
|
+
void Assembler::comisd(XMMRegister dst, XMMRegister src) {
|
2046
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2047
|
+
EnsureSpace ensure_space(this);
|
2048
|
+
last_pc_ = pc_;
|
2049
|
+
EMIT(0x66);
|
2050
|
+
EMIT(0x0F);
|
2051
|
+
EMIT(0x2F);
|
2052
|
+
emit_sse_operand(dst, src);
|
2053
|
+
}
|
2054
|
+
|
2055
|
+
|
2056
|
+
void Assembler::movdqa(const Operand& dst, XMMRegister src ) {
|
2057
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2058
|
+
EnsureSpace ensure_space(this);
|
2059
|
+
last_pc_ = pc_;
|
2060
|
+
EMIT(0x66);
|
2061
|
+
EMIT(0x0F);
|
2062
|
+
EMIT(0x7F);
|
2063
|
+
emit_sse_operand(src, dst);
|
2064
|
+
}
|
2065
|
+
|
2066
|
+
|
2067
|
+
void Assembler::movdqa(XMMRegister dst, const Operand& src) {
|
2068
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2069
|
+
EnsureSpace ensure_space(this);
|
2070
|
+
last_pc_ = pc_;
|
2071
|
+
EMIT(0x66);
|
2072
|
+
EMIT(0x0F);
|
2073
|
+
EMIT(0x6F);
|
2074
|
+
emit_sse_operand(dst, src);
|
2075
|
+
}
|
2076
|
+
|
2077
|
+
|
2078
|
+
void Assembler::movdqu(const Operand& dst, XMMRegister src ) {
|
2079
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2080
|
+
EnsureSpace ensure_space(this);
|
2081
|
+
last_pc_ = pc_;
|
2082
|
+
EMIT(0xF3);
|
2083
|
+
EMIT(0x0F);
|
2084
|
+
EMIT(0x7F);
|
2085
|
+
emit_sse_operand(src, dst);
|
2086
|
+
}
|
2087
|
+
|
2088
|
+
|
2089
|
+
void Assembler::movdqu(XMMRegister dst, const Operand& src) {
|
2090
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2091
|
+
EnsureSpace ensure_space(this);
|
2092
|
+
last_pc_ = pc_;
|
2093
|
+
EMIT(0xF3);
|
2094
|
+
EMIT(0x0F);
|
2095
|
+
EMIT(0x6F);
|
2096
|
+
emit_sse_operand(dst, src);
|
2097
|
+
}
|
2098
|
+
|
2099
|
+
|
2100
|
+
void Assembler::movdbl(XMMRegister dst, const Operand& src) {
|
2101
|
+
EnsureSpace ensure_space(this);
|
2102
|
+
last_pc_ = pc_;
|
2103
|
+
movsd(dst, src);
|
2104
|
+
}
|
2105
|
+
|
2106
|
+
|
2107
|
+
void Assembler::movdbl(const Operand& dst, XMMRegister src) {
|
2108
|
+
EnsureSpace ensure_space(this);
|
2109
|
+
last_pc_ = pc_;
|
2110
|
+
movsd(dst, src);
|
2111
|
+
}
|
2112
|
+
|
2113
|
+
|
2114
|
+
void Assembler::movsd(const Operand& dst, XMMRegister src ) {
|
2115
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2116
|
+
EnsureSpace ensure_space(this);
|
2117
|
+
last_pc_ = pc_;
|
2118
|
+
EMIT(0xF2); // double
|
2119
|
+
EMIT(0x0F);
|
2120
|
+
EMIT(0x11); // store
|
2121
|
+
emit_sse_operand(src, dst);
|
2122
|
+
}
|
2123
|
+
|
2124
|
+
|
2125
|
+
void Assembler::movsd(XMMRegister dst, const Operand& src) {
|
2126
|
+
ASSERT(CpuFeatures::IsEnabled(SSE2));
|
2127
|
+
EnsureSpace ensure_space(this);
|
2128
|
+
last_pc_ = pc_;
|
2129
|
+
EMIT(0xF2); // double
|
2130
|
+
EMIT(0x0F);
|
2131
|
+
EMIT(0x10); // load
|
2132
|
+
emit_sse_operand(dst, src);
|
2133
|
+
}
|
2134
|
+
|
2135
|
+
|
2136
|
+
void Assembler::emit_sse_operand(XMMRegister reg, const Operand& adr) {
|
2137
|
+
Register ireg = { reg.code() };
|
2138
|
+
emit_operand(ireg, adr);
|
2139
|
+
}
|
2140
|
+
|
2141
|
+
|
2142
|
+
void Assembler::emit_sse_operand(XMMRegister dst, XMMRegister src) {
|
2143
|
+
EMIT(0xC0 | dst.code() << 3 | src.code());
|
2144
|
+
}
|
2145
|
+
|
2146
|
+
|
2147
|
+
void Assembler::Print() {
|
2148
|
+
Disassembler::Decode(stdout, buffer_, pc_);
|
2149
|
+
}
|
2150
|
+
|
2151
|
+
|
2152
|
+
void Assembler::RecordJSReturn() {
|
2153
|
+
WriteRecordedPositions();
|
2154
|
+
EnsureSpace ensure_space(this);
|
2155
|
+
RecordRelocInfo(RelocInfo::JS_RETURN);
|
2156
|
+
}
|
2157
|
+
|
2158
|
+
|
2159
|
+
void Assembler::RecordComment(const char* msg) {
|
2160
|
+
if (FLAG_debug_code) {
|
2161
|
+
EnsureSpace ensure_space(this);
|
2162
|
+
RecordRelocInfo(RelocInfo::COMMENT, reinterpret_cast<intptr_t>(msg));
|
2163
|
+
}
|
2164
|
+
}
|
2165
|
+
|
2166
|
+
|
2167
|
+
void Assembler::RecordPosition(int pos) {
|
2168
|
+
ASSERT(pos != RelocInfo::kNoPosition);
|
2169
|
+
ASSERT(pos >= 0);
|
2170
|
+
current_position_ = pos;
|
2171
|
+
}
|
2172
|
+
|
2173
|
+
|
2174
|
+
void Assembler::RecordStatementPosition(int pos) {
|
2175
|
+
ASSERT(pos != RelocInfo::kNoPosition);
|
2176
|
+
ASSERT(pos >= 0);
|
2177
|
+
current_statement_position_ = pos;
|
2178
|
+
}
|
2179
|
+
|
2180
|
+
|
2181
|
+
void Assembler::WriteRecordedPositions() {
|
2182
|
+
// Write the statement position if it is different from what was written last
|
2183
|
+
// time.
|
2184
|
+
if (current_statement_position_ != written_statement_position_) {
|
2185
|
+
EnsureSpace ensure_space(this);
|
2186
|
+
RecordRelocInfo(RelocInfo::STATEMENT_POSITION, current_statement_position_);
|
2187
|
+
written_statement_position_ = current_statement_position_;
|
2188
|
+
}
|
2189
|
+
|
2190
|
+
// Write the position if it is different from what was written last time and
|
2191
|
+
// also different from the written statement position.
|
2192
|
+
if (current_position_ != written_position_ &&
|
2193
|
+
current_position_ != written_statement_position_) {
|
2194
|
+
EnsureSpace ensure_space(this);
|
2195
|
+
RecordRelocInfo(RelocInfo::POSITION, current_position_);
|
2196
|
+
written_position_ = current_position_;
|
2197
|
+
}
|
2198
|
+
}
|
2199
|
+
|
2200
|
+
|
2201
|
+
void Assembler::GrowBuffer() {
|
2202
|
+
ASSERT(overflow()); // should not call this otherwise
|
2203
|
+
if (!own_buffer_) FATAL("external code buffer is too small");
|
2204
|
+
|
2205
|
+
// compute new buffer size
|
2206
|
+
CodeDesc desc; // the new buffer
|
2207
|
+
if (buffer_size_ < 4*KB) {
|
2208
|
+
desc.buffer_size = 4*KB;
|
2209
|
+
} else {
|
2210
|
+
desc.buffer_size = 2*buffer_size_;
|
2211
|
+
}
|
2212
|
+
// Some internal data structures overflow for very large buffers,
|
2213
|
+
// they must ensure that kMaximalBufferSize is not too large.
|
2214
|
+
if ((desc.buffer_size > kMaximalBufferSize) ||
|
2215
|
+
(desc.buffer_size > Heap::MaxOldGenerationSize())) {
|
2216
|
+
V8::FatalProcessOutOfMemory("Assembler::GrowBuffer");
|
2217
|
+
}
|
2218
|
+
|
2219
|
+
// setup new buffer
|
2220
|
+
desc.buffer = NewArray<byte>(desc.buffer_size);
|
2221
|
+
desc.instr_size = pc_offset();
|
2222
|
+
desc.reloc_size = (buffer_ + buffer_size_) - (reloc_info_writer.pos());
|
2223
|
+
|
2224
|
+
// Clear the buffer in debug mode. Use 'int3' instructions to make
|
2225
|
+
// sure to get into problems if we ever run uninitialized code.
|
2226
|
+
#ifdef DEBUG
|
2227
|
+
memset(desc.buffer, 0xCC, desc.buffer_size);
|
2228
|
+
#endif
|
2229
|
+
|
2230
|
+
// copy the data
|
2231
|
+
int pc_delta = desc.buffer - buffer_;
|
2232
|
+
int rc_delta = (desc.buffer + desc.buffer_size) - (buffer_ + buffer_size_);
|
2233
|
+
memmove(desc.buffer, buffer_, desc.instr_size);
|
2234
|
+
memmove(rc_delta + reloc_info_writer.pos(),
|
2235
|
+
reloc_info_writer.pos(), desc.reloc_size);
|
2236
|
+
|
2237
|
+
// switch buffers
|
2238
|
+
if (spare_buffer_ == NULL && buffer_size_ == kMinimalBufferSize) {
|
2239
|
+
spare_buffer_ = buffer_;
|
2240
|
+
} else {
|
2241
|
+
DeleteArray(buffer_);
|
2242
|
+
}
|
2243
|
+
buffer_ = desc.buffer;
|
2244
|
+
buffer_size_ = desc.buffer_size;
|
2245
|
+
pc_ += pc_delta;
|
2246
|
+
if (last_pc_ != NULL) {
|
2247
|
+
last_pc_ += pc_delta;
|
2248
|
+
}
|
2249
|
+
reloc_info_writer.Reposition(reloc_info_writer.pos() + rc_delta,
|
2250
|
+
reloc_info_writer.last_pc() + pc_delta);
|
2251
|
+
|
2252
|
+
// relocate runtime entries
|
2253
|
+
for (RelocIterator it(desc); !it.done(); it.next()) {
|
2254
|
+
RelocInfo::Mode rmode = it.rinfo()->rmode();
|
2255
|
+
if (rmode == RelocInfo::RUNTIME_ENTRY) {
|
2256
|
+
int32_t* p = reinterpret_cast<int32_t*>(it.rinfo()->pc());
|
2257
|
+
*p -= pc_delta; // relocate entry
|
2258
|
+
} else if (rmode == RelocInfo::INTERNAL_REFERENCE) {
|
2259
|
+
int32_t* p = reinterpret_cast<int32_t*>(it.rinfo()->pc());
|
2260
|
+
if (*p != 0) { // 0 means uninitialized.
|
2261
|
+
*p += pc_delta;
|
2262
|
+
}
|
2263
|
+
}
|
2264
|
+
}
|
2265
|
+
|
2266
|
+
ASSERT(!overflow());
|
2267
|
+
}
|
2268
|
+
|
2269
|
+
|
2270
|
+
void Assembler::emit_arith_b(int op1, int op2, Register dst, int imm8) {
|
2271
|
+
ASSERT(is_uint8(op1) && is_uint8(op2)); // wrong opcode
|
2272
|
+
ASSERT(is_uint8(imm8));
|
2273
|
+
ASSERT((op1 & 0x01) == 0); // should be 8bit operation
|
2274
|
+
EMIT(op1);
|
2275
|
+
EMIT(op2 | dst.code());
|
2276
|
+
EMIT(imm8);
|
2277
|
+
}
|
2278
|
+
|
2279
|
+
|
2280
|
+
void Assembler::emit_arith(int sel, Operand dst, const Immediate& x) {
|
2281
|
+
ASSERT((0 <= sel) && (sel <= 7));
|
2282
|
+
Register ireg = { sel };
|
2283
|
+
if (x.is_int8()) {
|
2284
|
+
EMIT(0x83); // using a sign-extended 8-bit immediate.
|
2285
|
+
emit_operand(ireg, dst);
|
2286
|
+
EMIT(x.x_ & 0xFF);
|
2287
|
+
} else if (dst.is_reg(eax)) {
|
2288
|
+
EMIT((sel << 3) | 0x05); // short form if the destination is eax.
|
2289
|
+
emit(x);
|
2290
|
+
} else {
|
2291
|
+
EMIT(0x81); // using a literal 32-bit immediate.
|
2292
|
+
emit_operand(ireg, dst);
|
2293
|
+
emit(x);
|
2294
|
+
}
|
2295
|
+
}
|
2296
|
+
|
2297
|
+
|
2298
|
+
void Assembler::emit_operand(Register reg, const Operand& adr) {
|
2299
|
+
const unsigned length = adr.len_;
|
2300
|
+
ASSERT(length > 0);
|
2301
|
+
|
2302
|
+
// Emit updated ModRM byte containing the given register.
|
2303
|
+
pc_[0] = (adr.buf_[0] & ~0x38) | (reg.code() << 3);
|
2304
|
+
|
2305
|
+
// Emit the rest of the encoded operand.
|
2306
|
+
for (unsigned i = 1; i < length; i++) pc_[i] = adr.buf_[i];
|
2307
|
+
pc_ += length;
|
2308
|
+
|
2309
|
+
// Emit relocation information if necessary.
|
2310
|
+
if (length >= sizeof(int32_t) && adr.rmode_ != RelocInfo::NONE) {
|
2311
|
+
pc_ -= sizeof(int32_t); // pc_ must be *at* disp32
|
2312
|
+
RecordRelocInfo(adr.rmode_);
|
2313
|
+
pc_ += sizeof(int32_t);
|
2314
|
+
}
|
2315
|
+
}
|
2316
|
+
|
2317
|
+
|
2318
|
+
void Assembler::emit_farith(int b1, int b2, int i) {
|
2319
|
+
ASSERT(is_uint8(b1) && is_uint8(b2)); // wrong opcode
|
2320
|
+
ASSERT(0 <= i && i < 8); // illegal stack offset
|
2321
|
+
EMIT(b1);
|
2322
|
+
EMIT(b2 + i);
|
2323
|
+
}
|
2324
|
+
|
2325
|
+
|
2326
|
+
void Assembler::dd(uint32_t data, RelocInfo::Mode reloc_info) {
|
2327
|
+
EnsureSpace ensure_space(this);
|
2328
|
+
emit(data, reloc_info);
|
2329
|
+
}
|
2330
|
+
|
2331
|
+
|
2332
|
+
void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
|
2333
|
+
ASSERT(rmode != RelocInfo::NONE);
|
2334
|
+
// Don't record external references unless the heap will be serialized.
|
2335
|
+
if (rmode == RelocInfo::EXTERNAL_REFERENCE) {
|
2336
|
+
#ifdef DEBUG
|
2337
|
+
if (!Serializer::enabled()) {
|
2338
|
+
Serializer::TooLateToEnableNow();
|
2339
|
+
}
|
2340
|
+
#endif
|
2341
|
+
if (!Serializer::enabled() && !FLAG_debug_code) {
|
2342
|
+
return;
|
2343
|
+
}
|
2344
|
+
}
|
2345
|
+
RelocInfo rinfo(pc_, rmode, data);
|
2346
|
+
reloc_info_writer.Write(&rinfo);
|
2347
|
+
}
|
2348
|
+
|
2349
|
+
|
2350
|
+
#ifdef GENERATED_CODE_COVERAGE
|
2351
|
+
static FILE* coverage_log = NULL;
|
2352
|
+
|
2353
|
+
|
2354
|
+
static void InitCoverageLog() {
|
2355
|
+
char* file_name = getenv("V8_GENERATED_CODE_COVERAGE_LOG");
|
2356
|
+
if (file_name != NULL) {
|
2357
|
+
coverage_log = fopen(file_name, "aw+");
|
2358
|
+
}
|
2359
|
+
}
|
2360
|
+
|
2361
|
+
|
2362
|
+
void LogGeneratedCodeCoverage(const char* file_line) {
|
2363
|
+
const char* return_address = (&file_line)[-1];
|
2364
|
+
char* push_insn = const_cast<char*>(return_address - 12);
|
2365
|
+
push_insn[0] = 0xeb; // Relative branch insn.
|
2366
|
+
push_insn[1] = 13; // Skip over coverage insns.
|
2367
|
+
if (coverage_log != NULL) {
|
2368
|
+
fprintf(coverage_log, "%s\n", file_line);
|
2369
|
+
fflush(coverage_log);
|
2370
|
+
}
|
2371
|
+
}
|
2372
|
+
|
2373
|
+
#endif
|
2374
|
+
|
2375
|
+
} } // namespace v8::internal
|