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,1704 @@
|
|
1
|
+
// Copyright 2006-2008 the V8 project authors. All rights reserved.
|
2
|
+
// Redistribution and use in source and binary forms, with or without
|
3
|
+
// modification, are permitted provided that the following conditions are
|
4
|
+
// met:
|
5
|
+
//
|
6
|
+
// * Redistributions of source code must retain the above copyright
|
7
|
+
// notice, this list of conditions and the following disclaimer.
|
8
|
+
// * Redistributions in binary form must reproduce the above
|
9
|
+
// copyright notice, this list of conditions and the following
|
10
|
+
// disclaimer in the documentation and/or other materials provided
|
11
|
+
// with the distribution.
|
12
|
+
// * Neither the name of Google Inc. nor the names of its
|
13
|
+
// contributors may be used to endorse or promote products derived
|
14
|
+
// from this software without specific prior written permission.
|
15
|
+
//
|
16
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
17
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
18
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
19
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
20
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
21
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
22
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
23
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
24
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
25
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
26
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27
|
+
|
28
|
+
#ifndef V8_HEAP_H_
|
29
|
+
#define V8_HEAP_H_
|
30
|
+
|
31
|
+
#include <math.h>
|
32
|
+
|
33
|
+
#include "zone-inl.h"
|
34
|
+
|
35
|
+
|
36
|
+
namespace v8 {
|
37
|
+
namespace internal {
|
38
|
+
|
39
|
+
// Defines all the roots in Heap.
|
40
|
+
#define UNCONDITIONAL_STRONG_ROOT_LIST(V) \
|
41
|
+
/* Put the byte array map early. We need it to be in place by the time */ \
|
42
|
+
/* the deserializer hits the next page, since it wants to put a byte */ \
|
43
|
+
/* array in the unused space at the end of the page. */ \
|
44
|
+
V(Map, byte_array_map, ByteArrayMap) \
|
45
|
+
V(Map, one_pointer_filler_map, OnePointerFillerMap) \
|
46
|
+
V(Map, two_pointer_filler_map, TwoPointerFillerMap) \
|
47
|
+
/* Cluster the most popular ones in a few cache lines here at the top. */ \
|
48
|
+
V(Smi, stack_limit, StackLimit) \
|
49
|
+
V(Object, undefined_value, UndefinedValue) \
|
50
|
+
V(Object, the_hole_value, TheHoleValue) \
|
51
|
+
V(Object, null_value, NullValue) \
|
52
|
+
V(Object, true_value, TrueValue) \
|
53
|
+
V(Object, false_value, FalseValue) \
|
54
|
+
V(Map, heap_number_map, HeapNumberMap) \
|
55
|
+
V(Map, global_context_map, GlobalContextMap) \
|
56
|
+
V(Map, fixed_array_map, FixedArrayMap) \
|
57
|
+
V(Object, no_interceptor_result_sentinel, NoInterceptorResultSentinel) \
|
58
|
+
V(Map, meta_map, MetaMap) \
|
59
|
+
V(Object, termination_exception, TerminationException) \
|
60
|
+
V(Map, hash_table_map, HashTableMap) \
|
61
|
+
V(FixedArray, empty_fixed_array, EmptyFixedArray) \
|
62
|
+
V(Map, string_map, StringMap) \
|
63
|
+
V(Map, ascii_string_map, AsciiStringMap) \
|
64
|
+
V(Map, symbol_map, SymbolMap) \
|
65
|
+
V(Map, ascii_symbol_map, AsciiSymbolMap) \
|
66
|
+
V(Map, cons_symbol_map, ConsSymbolMap) \
|
67
|
+
V(Map, cons_ascii_symbol_map, ConsAsciiSymbolMap) \
|
68
|
+
V(Map, external_symbol_map, ExternalSymbolMap) \
|
69
|
+
V(Map, external_ascii_symbol_map, ExternalAsciiSymbolMap) \
|
70
|
+
V(Map, cons_string_map, ConsStringMap) \
|
71
|
+
V(Map, cons_ascii_string_map, ConsAsciiStringMap) \
|
72
|
+
V(Map, external_string_map, ExternalStringMap) \
|
73
|
+
V(Map, external_ascii_string_map, ExternalAsciiStringMap) \
|
74
|
+
V(Map, undetectable_string_map, UndetectableStringMap) \
|
75
|
+
V(Map, undetectable_ascii_string_map, UndetectableAsciiStringMap) \
|
76
|
+
V(Map, pixel_array_map, PixelArrayMap) \
|
77
|
+
V(Map, external_byte_array_map, ExternalByteArrayMap) \
|
78
|
+
V(Map, external_unsigned_byte_array_map, ExternalUnsignedByteArrayMap) \
|
79
|
+
V(Map, external_short_array_map, ExternalShortArrayMap) \
|
80
|
+
V(Map, external_unsigned_short_array_map, ExternalUnsignedShortArrayMap) \
|
81
|
+
V(Map, external_int_array_map, ExternalIntArrayMap) \
|
82
|
+
V(Map, external_unsigned_int_array_map, ExternalUnsignedIntArrayMap) \
|
83
|
+
V(Map, external_float_array_map, ExternalFloatArrayMap) \
|
84
|
+
V(Map, context_map, ContextMap) \
|
85
|
+
V(Map, catch_context_map, CatchContextMap) \
|
86
|
+
V(Map, code_map, CodeMap) \
|
87
|
+
V(Map, oddball_map, OddballMap) \
|
88
|
+
V(Map, global_property_cell_map, GlobalPropertyCellMap) \
|
89
|
+
V(Map, boilerplate_function_map, BoilerplateFunctionMap) \
|
90
|
+
V(Map, shared_function_info_map, SharedFunctionInfoMap) \
|
91
|
+
V(Map, proxy_map, ProxyMap) \
|
92
|
+
V(Object, nan_value, NanValue) \
|
93
|
+
V(Object, minus_zero_value, MinusZeroValue) \
|
94
|
+
V(String, empty_string, EmptyString) \
|
95
|
+
V(DescriptorArray, empty_descriptor_array, EmptyDescriptorArray) \
|
96
|
+
V(Map, neander_map, NeanderMap) \
|
97
|
+
V(JSObject, message_listeners, MessageListeners) \
|
98
|
+
V(Proxy, prototype_accessors, PrototypeAccessors) \
|
99
|
+
V(NumberDictionary, code_stubs, CodeStubs) \
|
100
|
+
V(NumberDictionary, non_monomorphic_cache, NonMonomorphicCache) \
|
101
|
+
V(Code, js_entry_code, JsEntryCode) \
|
102
|
+
V(Code, js_construct_entry_code, JsConstructEntryCode) \
|
103
|
+
V(Code, c_entry_code, CEntryCode) \
|
104
|
+
V(Code, c_entry_debug_break_code, CEntryDebugBreakCode) \
|
105
|
+
V(FixedArray, number_string_cache, NumberStringCache) \
|
106
|
+
V(FixedArray, single_character_string_cache, SingleCharacterStringCache) \
|
107
|
+
V(FixedArray, natives_source_cache, NativesSourceCache) \
|
108
|
+
V(Object, last_script_id, LastScriptId) \
|
109
|
+
V(Smi, real_stack_limit, RealStackLimit) \
|
110
|
+
|
111
|
+
#if V8_TARGET_ARCH_ARM && V8_NATIVE_REGEXP
|
112
|
+
#define STRONG_ROOT_LIST(V) \
|
113
|
+
UNCONDITIONAL_STRONG_ROOT_LIST(V) \
|
114
|
+
V(Code, re_c_entry_code, RegExpCEntryCode)
|
115
|
+
#else
|
116
|
+
#define STRONG_ROOT_LIST(V) UNCONDITIONAL_STRONG_ROOT_LIST(V)
|
117
|
+
#endif
|
118
|
+
|
119
|
+
#define ROOT_LIST(V) \
|
120
|
+
STRONG_ROOT_LIST(V) \
|
121
|
+
V(SymbolTable, symbol_table, SymbolTable)
|
122
|
+
|
123
|
+
#define SYMBOL_LIST(V) \
|
124
|
+
V(Array_symbol, "Array") \
|
125
|
+
V(Object_symbol, "Object") \
|
126
|
+
V(Proto_symbol, "__proto__") \
|
127
|
+
V(StringImpl_symbol, "StringImpl") \
|
128
|
+
V(arguments_symbol, "arguments") \
|
129
|
+
V(Arguments_symbol, "Arguments") \
|
130
|
+
V(arguments_shadow_symbol, ".arguments") \
|
131
|
+
V(call_symbol, "call") \
|
132
|
+
V(apply_symbol, "apply") \
|
133
|
+
V(caller_symbol, "caller") \
|
134
|
+
V(boolean_symbol, "boolean") \
|
135
|
+
V(Boolean_symbol, "Boolean") \
|
136
|
+
V(callee_symbol, "callee") \
|
137
|
+
V(constructor_symbol, "constructor") \
|
138
|
+
V(code_symbol, ".code") \
|
139
|
+
V(result_symbol, ".result") \
|
140
|
+
V(catch_var_symbol, ".catch-var") \
|
141
|
+
V(empty_symbol, "") \
|
142
|
+
V(eval_symbol, "eval") \
|
143
|
+
V(function_symbol, "function") \
|
144
|
+
V(length_symbol, "length") \
|
145
|
+
V(name_symbol, "name") \
|
146
|
+
V(number_symbol, "number") \
|
147
|
+
V(Number_symbol, "Number") \
|
148
|
+
V(RegExp_symbol, "RegExp") \
|
149
|
+
V(object_symbol, "object") \
|
150
|
+
V(prototype_symbol, "prototype") \
|
151
|
+
V(string_symbol, "string") \
|
152
|
+
V(String_symbol, "String") \
|
153
|
+
V(Date_symbol, "Date") \
|
154
|
+
V(this_symbol, "this") \
|
155
|
+
V(to_string_symbol, "toString") \
|
156
|
+
V(char_at_symbol, "CharAt") \
|
157
|
+
V(undefined_symbol, "undefined") \
|
158
|
+
V(value_of_symbol, "valueOf") \
|
159
|
+
V(InitializeVarGlobal_symbol, "InitializeVarGlobal") \
|
160
|
+
V(InitializeConstGlobal_symbol, "InitializeConstGlobal") \
|
161
|
+
V(stack_overflow_symbol, "kStackOverflowBoilerplate") \
|
162
|
+
V(illegal_access_symbol, "illegal access") \
|
163
|
+
V(out_of_memory_symbol, "out-of-memory") \
|
164
|
+
V(illegal_execution_state_symbol, "illegal execution state") \
|
165
|
+
V(get_symbol, "get") \
|
166
|
+
V(set_symbol, "set") \
|
167
|
+
V(function_class_symbol, "Function") \
|
168
|
+
V(illegal_argument_symbol, "illegal argument") \
|
169
|
+
V(MakeReferenceError_symbol, "MakeReferenceError") \
|
170
|
+
V(MakeSyntaxError_symbol, "MakeSyntaxError") \
|
171
|
+
V(MakeTypeError_symbol, "MakeTypeError") \
|
172
|
+
V(invalid_lhs_in_assignment_symbol, "invalid_lhs_in_assignment") \
|
173
|
+
V(invalid_lhs_in_for_in_symbol, "invalid_lhs_in_for_in") \
|
174
|
+
V(invalid_lhs_in_postfix_op_symbol, "invalid_lhs_in_postfix_op") \
|
175
|
+
V(invalid_lhs_in_prefix_op_symbol, "invalid_lhs_in_prefix_op") \
|
176
|
+
V(illegal_return_symbol, "illegal_return") \
|
177
|
+
V(illegal_break_symbol, "illegal_break") \
|
178
|
+
V(illegal_continue_symbol, "illegal_continue") \
|
179
|
+
V(unknown_label_symbol, "unknown_label") \
|
180
|
+
V(redeclaration_symbol, "redeclaration") \
|
181
|
+
V(failure_symbol, "<failure>") \
|
182
|
+
V(space_symbol, " ") \
|
183
|
+
V(exec_symbol, "exec") \
|
184
|
+
V(zero_symbol, "0") \
|
185
|
+
V(global_eval_symbol, "GlobalEval") \
|
186
|
+
V(identity_hash_symbol, "v8::IdentityHash") \
|
187
|
+
V(closure_symbol, "(closure)")
|
188
|
+
|
189
|
+
|
190
|
+
// Forward declaration of the GCTracer class.
|
191
|
+
class GCTracer;
|
192
|
+
class HeapStats;
|
193
|
+
|
194
|
+
|
195
|
+
// The all static Heap captures the interface to the global object heap.
|
196
|
+
// All JavaScript contexts by this process share the same object heap.
|
197
|
+
|
198
|
+
class Heap : public AllStatic {
|
199
|
+
public:
|
200
|
+
// Configure heap size before setup. Return false if the heap has been
|
201
|
+
// setup already.
|
202
|
+
static bool ConfigureHeap(int max_semispace_size, int max_old_gen_size);
|
203
|
+
static bool ConfigureHeapDefault();
|
204
|
+
|
205
|
+
// Initializes the global object heap. If create_heap_objects is true,
|
206
|
+
// also creates the basic non-mutable objects.
|
207
|
+
// Returns whether it succeeded.
|
208
|
+
static bool Setup(bool create_heap_objects);
|
209
|
+
|
210
|
+
// Destroys all memory allocated by the heap.
|
211
|
+
static void TearDown();
|
212
|
+
|
213
|
+
// Set the stack limit in the roots_ array. Some architectures generate
|
214
|
+
// code that looks here, because it is faster than loading from the static
|
215
|
+
// jslimit_/real_jslimit_ variable in the StackGuard.
|
216
|
+
static void SetStackLimits();
|
217
|
+
|
218
|
+
// Returns whether Setup has been called.
|
219
|
+
static bool HasBeenSetup();
|
220
|
+
|
221
|
+
// Returns the maximum amount of memory reserved for the heap. For
|
222
|
+
// the young generation, we reserve 4 times the amount needed for a
|
223
|
+
// semi space. The young generation consists of two semi spaces and
|
224
|
+
// we reserve twice the amount needed for those in order to ensure
|
225
|
+
// that new space can be aligned to its size.
|
226
|
+
static int MaxReserved() {
|
227
|
+
return 4 * reserved_semispace_size_ + max_old_generation_size_;
|
228
|
+
}
|
229
|
+
static int MaxSemiSpaceSize() { return max_semispace_size_; }
|
230
|
+
static int ReservedSemiSpaceSize() { return reserved_semispace_size_; }
|
231
|
+
static int InitialSemiSpaceSize() { return initial_semispace_size_; }
|
232
|
+
static int MaxOldGenerationSize() { return max_old_generation_size_; }
|
233
|
+
|
234
|
+
// Returns the capacity of the heap in bytes w/o growing. Heap grows when
|
235
|
+
// more spaces are needed until it reaches the limit.
|
236
|
+
static int Capacity();
|
237
|
+
|
238
|
+
// Returns the amount of memory currently committed for the heap.
|
239
|
+
static int CommittedMemory();
|
240
|
+
|
241
|
+
// Returns the available bytes in space w/o growing.
|
242
|
+
// Heap doesn't guarantee that it can allocate an object that requires
|
243
|
+
// all available bytes. Check MaxHeapObjectSize() instead.
|
244
|
+
static int Available();
|
245
|
+
|
246
|
+
// Returns the maximum object size in paged space.
|
247
|
+
static inline int MaxObjectSizeInPagedSpace();
|
248
|
+
|
249
|
+
// Returns of size of all objects residing in the heap.
|
250
|
+
static int SizeOfObjects();
|
251
|
+
|
252
|
+
// Return the starting address and a mask for the new space. And-masking an
|
253
|
+
// address with the mask will result in the start address of the new space
|
254
|
+
// for all addresses in either semispace.
|
255
|
+
static Address NewSpaceStart() { return new_space_.start(); }
|
256
|
+
static uintptr_t NewSpaceMask() { return new_space_.mask(); }
|
257
|
+
static Address NewSpaceTop() { return new_space_.top(); }
|
258
|
+
|
259
|
+
static NewSpace* new_space() { return &new_space_; }
|
260
|
+
static OldSpace* old_pointer_space() { return old_pointer_space_; }
|
261
|
+
static OldSpace* old_data_space() { return old_data_space_; }
|
262
|
+
static OldSpace* code_space() { return code_space_; }
|
263
|
+
static MapSpace* map_space() { return map_space_; }
|
264
|
+
static CellSpace* cell_space() { return cell_space_; }
|
265
|
+
static LargeObjectSpace* lo_space() { return lo_space_; }
|
266
|
+
|
267
|
+
static bool always_allocate() { return always_allocate_scope_depth_ != 0; }
|
268
|
+
static Address always_allocate_scope_depth_address() {
|
269
|
+
return reinterpret_cast<Address>(&always_allocate_scope_depth_);
|
270
|
+
}
|
271
|
+
static bool linear_allocation() {
|
272
|
+
return linear_allocation_scope_depth_ != 0;
|
273
|
+
}
|
274
|
+
|
275
|
+
static Address* NewSpaceAllocationTopAddress() {
|
276
|
+
return new_space_.allocation_top_address();
|
277
|
+
}
|
278
|
+
static Address* NewSpaceAllocationLimitAddress() {
|
279
|
+
return new_space_.allocation_limit_address();
|
280
|
+
}
|
281
|
+
|
282
|
+
// Uncommit unused semi space.
|
283
|
+
static bool UncommitFromSpace() { return new_space_.UncommitFromSpace(); }
|
284
|
+
|
285
|
+
#ifdef ENABLE_HEAP_PROTECTION
|
286
|
+
// Protect/unprotect the heap by marking all spaces read-only/writable.
|
287
|
+
static void Protect();
|
288
|
+
static void Unprotect();
|
289
|
+
#endif
|
290
|
+
|
291
|
+
// Allocates and initializes a new JavaScript object based on a
|
292
|
+
// constructor.
|
293
|
+
// Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
294
|
+
// failed.
|
295
|
+
// Please note this does not perform a garbage collection.
|
296
|
+
static Object* AllocateJSObject(JSFunction* constructor,
|
297
|
+
PretenureFlag pretenure = NOT_TENURED);
|
298
|
+
|
299
|
+
// Allocates and initializes a new global object based on a constructor.
|
300
|
+
// Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
301
|
+
// failed.
|
302
|
+
// Please note this does not perform a garbage collection.
|
303
|
+
static Object* AllocateGlobalObject(JSFunction* constructor);
|
304
|
+
|
305
|
+
// Returns a deep copy of the JavaScript object.
|
306
|
+
// Properties and elements are copied too.
|
307
|
+
// Returns failure if allocation failed.
|
308
|
+
static Object* CopyJSObject(JSObject* source);
|
309
|
+
|
310
|
+
// Allocates the function prototype.
|
311
|
+
// Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
312
|
+
// failed.
|
313
|
+
// Please note this does not perform a garbage collection.
|
314
|
+
static Object* AllocateFunctionPrototype(JSFunction* function);
|
315
|
+
|
316
|
+
// Reinitialize an JSGlobalProxy based on a constructor. The object
|
317
|
+
// must have the same size as objects allocated using the
|
318
|
+
// constructor. The object is reinitialized and behaves as an
|
319
|
+
// object that has been freshly allocated using the constructor.
|
320
|
+
static Object* ReinitializeJSGlobalProxy(JSFunction* constructor,
|
321
|
+
JSGlobalProxy* global);
|
322
|
+
|
323
|
+
// Allocates and initializes a new JavaScript object based on a map.
|
324
|
+
// Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
325
|
+
// failed.
|
326
|
+
// Please note this does not perform a garbage collection.
|
327
|
+
static Object* AllocateJSObjectFromMap(Map* map,
|
328
|
+
PretenureFlag pretenure = NOT_TENURED);
|
329
|
+
|
330
|
+
// Allocates a heap object based on the map.
|
331
|
+
// Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
332
|
+
// failed.
|
333
|
+
// Please note this function does not perform a garbage collection.
|
334
|
+
static Object* Allocate(Map* map, AllocationSpace space);
|
335
|
+
|
336
|
+
// Allocates a JS Map in the heap.
|
337
|
+
// Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
338
|
+
// failed.
|
339
|
+
// Please note this function does not perform a garbage collection.
|
340
|
+
static Object* AllocateMap(InstanceType instance_type, int instance_size);
|
341
|
+
|
342
|
+
// Allocates a partial map for bootstrapping.
|
343
|
+
static Object* AllocatePartialMap(InstanceType instance_type,
|
344
|
+
int instance_size);
|
345
|
+
|
346
|
+
// Allocate a map for the specified function
|
347
|
+
static Object* AllocateInitialMap(JSFunction* fun);
|
348
|
+
|
349
|
+
// Allocates and fully initializes a String. There are two String
|
350
|
+
// encodings: ASCII and two byte. One should choose between the three string
|
351
|
+
// allocation functions based on the encoding of the string buffer used to
|
352
|
+
// initialized the string.
|
353
|
+
// - ...FromAscii initializes the string from a buffer that is ASCII
|
354
|
+
// encoded (it does not check that the buffer is ASCII encoded) and the
|
355
|
+
// result will be ASCII encoded.
|
356
|
+
// - ...FromUTF8 initializes the string from a buffer that is UTF-8
|
357
|
+
// encoded. If the characters are all single-byte characters, the
|
358
|
+
// result will be ASCII encoded, otherwise it will converted to two
|
359
|
+
// byte.
|
360
|
+
// - ...FromTwoByte initializes the string from a buffer that is two-byte
|
361
|
+
// encoded. If the characters are all single-byte characters, the
|
362
|
+
// result will be converted to ASCII, otherwise it will be left as
|
363
|
+
// two-byte.
|
364
|
+
// Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
365
|
+
// failed.
|
366
|
+
// Please note this does not perform a garbage collection.
|
367
|
+
static Object* AllocateStringFromAscii(
|
368
|
+
Vector<const char> str,
|
369
|
+
PretenureFlag pretenure = NOT_TENURED);
|
370
|
+
static Object* AllocateStringFromUtf8(
|
371
|
+
Vector<const char> str,
|
372
|
+
PretenureFlag pretenure = NOT_TENURED);
|
373
|
+
static Object* AllocateStringFromTwoByte(
|
374
|
+
Vector<const uc16> str,
|
375
|
+
PretenureFlag pretenure = NOT_TENURED);
|
376
|
+
|
377
|
+
// Allocates a symbol in old space based on the character stream.
|
378
|
+
// Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
379
|
+
// failed.
|
380
|
+
// Please note this function does not perform a garbage collection.
|
381
|
+
static inline Object* AllocateSymbol(Vector<const char> str,
|
382
|
+
int chars,
|
383
|
+
uint32_t hash_field);
|
384
|
+
|
385
|
+
static Object* AllocateInternalSymbol(unibrow::CharacterStream* buffer,
|
386
|
+
int chars,
|
387
|
+
uint32_t hash_field);
|
388
|
+
|
389
|
+
static Object* AllocateExternalSymbol(Vector<const char> str,
|
390
|
+
int chars);
|
391
|
+
|
392
|
+
|
393
|
+
// Allocates and partially initializes a String. There are two String
|
394
|
+
// encodings: ASCII and two byte. These functions allocate a string of the
|
395
|
+
// given length and set its map and length fields. The characters of the
|
396
|
+
// string are uninitialized.
|
397
|
+
// Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
398
|
+
// failed.
|
399
|
+
// Please note this does not perform a garbage collection.
|
400
|
+
static Object* AllocateRawAsciiString(
|
401
|
+
int length,
|
402
|
+
PretenureFlag pretenure = NOT_TENURED);
|
403
|
+
static Object* AllocateRawTwoByteString(
|
404
|
+
int length,
|
405
|
+
PretenureFlag pretenure = NOT_TENURED);
|
406
|
+
|
407
|
+
// Computes a single character string where the character has code.
|
408
|
+
// A cache is used for ascii codes.
|
409
|
+
// Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
410
|
+
// failed. Please note this does not perform a garbage collection.
|
411
|
+
static Object* LookupSingleCharacterStringFromCode(uint16_t code);
|
412
|
+
|
413
|
+
// Allocate a byte array of the specified length
|
414
|
+
// Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
415
|
+
// failed.
|
416
|
+
// Please note this does not perform a garbage collection.
|
417
|
+
static Object* AllocateByteArray(int length, PretenureFlag pretenure);
|
418
|
+
|
419
|
+
// Allocate a non-tenured byte array of the specified length
|
420
|
+
// Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
421
|
+
// failed.
|
422
|
+
// Please note this does not perform a garbage collection.
|
423
|
+
static Object* AllocateByteArray(int length);
|
424
|
+
|
425
|
+
// Allocate a pixel array of the specified length
|
426
|
+
// Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
427
|
+
// failed.
|
428
|
+
// Please note this does not perform a garbage collection.
|
429
|
+
static Object* AllocatePixelArray(int length,
|
430
|
+
uint8_t* external_pointer,
|
431
|
+
PretenureFlag pretenure);
|
432
|
+
|
433
|
+
// Allocates an external array of the specified length and type.
|
434
|
+
// Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
435
|
+
// failed.
|
436
|
+
// Please note this does not perform a garbage collection.
|
437
|
+
static Object* AllocateExternalArray(int length,
|
438
|
+
ExternalArrayType array_type,
|
439
|
+
void* external_pointer,
|
440
|
+
PretenureFlag pretenure);
|
441
|
+
|
442
|
+
// Allocate a tenured JS global property cell.
|
443
|
+
// Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
444
|
+
// failed.
|
445
|
+
// Please note this does not perform a garbage collection.
|
446
|
+
static Object* AllocateJSGlobalPropertyCell(Object* value);
|
447
|
+
|
448
|
+
// Allocates a fixed array initialized with undefined values
|
449
|
+
// Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
450
|
+
// failed.
|
451
|
+
// Please note this does not perform a garbage collection.
|
452
|
+
static Object* AllocateFixedArray(int length, PretenureFlag pretenure);
|
453
|
+
// Allocate uninitialized, non-tenured fixed array with length elements.
|
454
|
+
static Object* AllocateFixedArray(int length);
|
455
|
+
|
456
|
+
// Make a copy of src and return it. Returns
|
457
|
+
// Failure::RetryAfterGC(requested_bytes, space) if the allocation failed.
|
458
|
+
static Object* CopyFixedArray(FixedArray* src);
|
459
|
+
|
460
|
+
// Allocates a fixed array initialized with the hole values.
|
461
|
+
// Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
462
|
+
// failed.
|
463
|
+
// Please note this does not perform a garbage collection.
|
464
|
+
static Object* AllocateFixedArrayWithHoles(int length);
|
465
|
+
|
466
|
+
// AllocateHashTable is identical to AllocateFixedArray except
|
467
|
+
// that the resulting object has hash_table_map as map.
|
468
|
+
static Object* AllocateHashTable(int length);
|
469
|
+
|
470
|
+
// Allocate a global (but otherwise uninitialized) context.
|
471
|
+
static Object* AllocateGlobalContext();
|
472
|
+
|
473
|
+
// Allocate a function context.
|
474
|
+
static Object* AllocateFunctionContext(int length, JSFunction* closure);
|
475
|
+
|
476
|
+
// Allocate a 'with' context.
|
477
|
+
static Object* AllocateWithContext(Context* previous,
|
478
|
+
JSObject* extension,
|
479
|
+
bool is_catch_context);
|
480
|
+
|
481
|
+
// Allocates a new utility object in the old generation.
|
482
|
+
static Object* AllocateStruct(InstanceType type);
|
483
|
+
|
484
|
+
// Allocates a function initialized with a shared part.
|
485
|
+
// Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
486
|
+
// failed.
|
487
|
+
// Please note this does not perform a garbage collection.
|
488
|
+
static Object* AllocateFunction(Map* function_map,
|
489
|
+
SharedFunctionInfo* shared,
|
490
|
+
Object* prototype,
|
491
|
+
PretenureFlag pretenure = TENURED);
|
492
|
+
|
493
|
+
// Indicies for direct access into argument objects.
|
494
|
+
static const int kArgumentsObjectSize =
|
495
|
+
JSObject::kHeaderSize + 2 * kPointerSize;
|
496
|
+
static const int arguments_callee_index = 0;
|
497
|
+
static const int arguments_length_index = 1;
|
498
|
+
|
499
|
+
// Allocates an arguments object - optionally with an elements array.
|
500
|
+
// Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
501
|
+
// failed.
|
502
|
+
// Please note this does not perform a garbage collection.
|
503
|
+
static Object* AllocateArgumentsObject(Object* callee, int length);
|
504
|
+
|
505
|
+
// Converts a double into either a Smi or a HeapNumber object.
|
506
|
+
// Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
507
|
+
// failed.
|
508
|
+
// Please note this does not perform a garbage collection.
|
509
|
+
static Object* NewNumberFromDouble(double value,
|
510
|
+
PretenureFlag pretenure = NOT_TENURED);
|
511
|
+
|
512
|
+
// Same as NewNumberFromDouble, but may return a preallocated/immutable
|
513
|
+
// number object (e.g., minus_zero_value_, nan_value_)
|
514
|
+
static Object* NumberFromDouble(double value,
|
515
|
+
PretenureFlag pretenure = NOT_TENURED);
|
516
|
+
|
517
|
+
// Allocated a HeapNumber from value.
|
518
|
+
static Object* AllocateHeapNumber(double value, PretenureFlag pretenure);
|
519
|
+
static Object* AllocateHeapNumber(double value); // pretenure = NOT_TENURED
|
520
|
+
|
521
|
+
// Converts an int into either a Smi or a HeapNumber object.
|
522
|
+
// Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
523
|
+
// failed.
|
524
|
+
// Please note this does not perform a garbage collection.
|
525
|
+
static inline Object* NumberFromInt32(int32_t value);
|
526
|
+
|
527
|
+
// Converts an int into either a Smi or a HeapNumber object.
|
528
|
+
// Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
529
|
+
// failed.
|
530
|
+
// Please note this does not perform a garbage collection.
|
531
|
+
static inline Object* NumberFromUint32(uint32_t value);
|
532
|
+
|
533
|
+
// Allocates a new proxy object.
|
534
|
+
// Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
535
|
+
// failed.
|
536
|
+
// Please note this does not perform a garbage collection.
|
537
|
+
static Object* AllocateProxy(Address proxy,
|
538
|
+
PretenureFlag pretenure = NOT_TENURED);
|
539
|
+
|
540
|
+
// Allocates a new SharedFunctionInfo object.
|
541
|
+
// Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
542
|
+
// failed.
|
543
|
+
// Please note this does not perform a garbage collection.
|
544
|
+
static Object* AllocateSharedFunctionInfo(Object* name);
|
545
|
+
|
546
|
+
// Allocates a new cons string object.
|
547
|
+
// Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
548
|
+
// failed.
|
549
|
+
// Please note this does not perform a garbage collection.
|
550
|
+
static Object* AllocateConsString(String* first, String* second);
|
551
|
+
|
552
|
+
// Allocates a new sub string object which is a substring of an underlying
|
553
|
+
// string buffer stretching from the index start (inclusive) to the index
|
554
|
+
// end (exclusive).
|
555
|
+
// Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
556
|
+
// failed.
|
557
|
+
// Please note this does not perform a garbage collection.
|
558
|
+
static Object* AllocateSubString(String* buffer,
|
559
|
+
int start,
|
560
|
+
int end);
|
561
|
+
|
562
|
+
// Allocate a new external string object, which is backed by a string
|
563
|
+
// resource that resides outside the V8 heap.
|
564
|
+
// Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
565
|
+
// failed.
|
566
|
+
// Please note this does not perform a garbage collection.
|
567
|
+
static Object* AllocateExternalStringFromAscii(
|
568
|
+
ExternalAsciiString::Resource* resource);
|
569
|
+
static Object* AllocateExternalStringFromTwoByte(
|
570
|
+
ExternalTwoByteString::Resource* resource);
|
571
|
+
|
572
|
+
// Finalizes an external string by deleting the associated external
|
573
|
+
// data and clearing the resource pointer.
|
574
|
+
static inline void FinalizeExternalString(String* string);
|
575
|
+
|
576
|
+
// Allocates an uninitialized object. The memory is non-executable if the
|
577
|
+
// hardware and OS allow.
|
578
|
+
// Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
579
|
+
// failed.
|
580
|
+
// Please note this function does not perform a garbage collection.
|
581
|
+
static inline Object* AllocateRaw(int size_in_bytes,
|
582
|
+
AllocationSpace space,
|
583
|
+
AllocationSpace retry_space);
|
584
|
+
|
585
|
+
// Initialize a filler object to keep the ability to iterate over the heap
|
586
|
+
// when shortening objects.
|
587
|
+
static void CreateFillerObjectAt(Address addr, int size);
|
588
|
+
|
589
|
+
// Makes a new native code object
|
590
|
+
// Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
591
|
+
// failed. On success, the pointer to the Code object is stored in the
|
592
|
+
// self_reference. This allows generated code to reference its own Code
|
593
|
+
// object by containing this pointer.
|
594
|
+
// Please note this function does not perform a garbage collection.
|
595
|
+
static Object* CreateCode(const CodeDesc& desc,
|
596
|
+
ZoneScopeInfo* sinfo,
|
597
|
+
Code::Flags flags,
|
598
|
+
Handle<Object> self_reference);
|
599
|
+
|
600
|
+
static Object* CopyCode(Code* code);
|
601
|
+
// Finds the symbol for string in the symbol table.
|
602
|
+
// If not found, a new symbol is added to the table and returned.
|
603
|
+
// Returns Failure::RetryAfterGC(requested_bytes, space) if allocation
|
604
|
+
// failed.
|
605
|
+
// Please note this function does not perform a garbage collection.
|
606
|
+
static Object* LookupSymbol(Vector<const char> str);
|
607
|
+
static Object* LookupAsciiSymbol(const char* str) {
|
608
|
+
return LookupSymbol(CStrVector(str));
|
609
|
+
}
|
610
|
+
static Object* LookupSymbol(String* str);
|
611
|
+
static bool LookupSymbolIfExists(String* str, String** symbol);
|
612
|
+
static bool LookupTwoCharsSymbolIfExists(String* str, String** symbol);
|
613
|
+
|
614
|
+
// Compute the matching symbol map for a string if possible.
|
615
|
+
// NULL is returned if string is in new space or not flattened.
|
616
|
+
static Map* SymbolMapForString(String* str);
|
617
|
+
|
618
|
+
// Converts the given boolean condition to JavaScript boolean value.
|
619
|
+
static Object* ToBoolean(bool condition) {
|
620
|
+
return condition ? true_value() : false_value();
|
621
|
+
}
|
622
|
+
|
623
|
+
// Code that should be run before and after each GC. Includes some
|
624
|
+
// reporting/verification activities when compiled with DEBUG set.
|
625
|
+
static void GarbageCollectionPrologue();
|
626
|
+
static void GarbageCollectionEpilogue();
|
627
|
+
|
628
|
+
// Performs garbage collection operation.
|
629
|
+
// Returns whether required_space bytes are available after the collection.
|
630
|
+
static bool CollectGarbage(int required_space, AllocationSpace space);
|
631
|
+
|
632
|
+
// Performs a full garbage collection. Force compaction if the
|
633
|
+
// parameter is true.
|
634
|
+
static void CollectAllGarbage(bool force_compaction);
|
635
|
+
|
636
|
+
// Performs a full garbage collection if a context has been disposed
|
637
|
+
// since the last time the check was performed.
|
638
|
+
static void CollectAllGarbageIfContextDisposed();
|
639
|
+
|
640
|
+
// Notify the heap that a context has been disposed.
|
641
|
+
static void NotifyContextDisposed();
|
642
|
+
|
643
|
+
// Utility to invoke the scavenger. This is needed in test code to
|
644
|
+
// ensure correct callback for weak global handles.
|
645
|
+
static void PerformScavenge();
|
646
|
+
|
647
|
+
#ifdef DEBUG
|
648
|
+
// Utility used with flag gc-greedy.
|
649
|
+
static bool GarbageCollectionGreedyCheck();
|
650
|
+
#endif
|
651
|
+
|
652
|
+
static void SetGlobalGCPrologueCallback(GCCallback callback) {
|
653
|
+
global_gc_prologue_callback_ = callback;
|
654
|
+
}
|
655
|
+
static void SetGlobalGCEpilogueCallback(GCCallback callback) {
|
656
|
+
global_gc_epilogue_callback_ = callback;
|
657
|
+
}
|
658
|
+
|
659
|
+
// Heap root getters. We have versions with and without type::cast() here.
|
660
|
+
// You can't use type::cast during GC because the assert fails.
|
661
|
+
#define ROOT_ACCESSOR(type, name, camel_name) \
|
662
|
+
static inline type* name() { \
|
663
|
+
return type::cast(roots_[k##camel_name##RootIndex]); \
|
664
|
+
} \
|
665
|
+
static inline type* raw_unchecked_##name() { \
|
666
|
+
return reinterpret_cast<type*>(roots_[k##camel_name##RootIndex]); \
|
667
|
+
}
|
668
|
+
ROOT_LIST(ROOT_ACCESSOR)
|
669
|
+
#undef ROOT_ACCESSOR
|
670
|
+
|
671
|
+
// Utility type maps
|
672
|
+
#define STRUCT_MAP_ACCESSOR(NAME, Name, name) \
|
673
|
+
static inline Map* name##_map() { \
|
674
|
+
return Map::cast(roots_[k##Name##MapRootIndex]); \
|
675
|
+
}
|
676
|
+
STRUCT_LIST(STRUCT_MAP_ACCESSOR)
|
677
|
+
#undef STRUCT_MAP_ACCESSOR
|
678
|
+
|
679
|
+
#define SYMBOL_ACCESSOR(name, str) static inline String* name() { \
|
680
|
+
return String::cast(roots_[k##name##RootIndex]); \
|
681
|
+
}
|
682
|
+
SYMBOL_LIST(SYMBOL_ACCESSOR)
|
683
|
+
#undef SYMBOL_ACCESSOR
|
684
|
+
|
685
|
+
// The hidden_symbol is special because it is the empty string, but does
|
686
|
+
// not match the empty string.
|
687
|
+
static String* hidden_symbol() { return hidden_symbol_; }
|
688
|
+
|
689
|
+
// Iterates over all roots in the heap.
|
690
|
+
static void IterateRoots(ObjectVisitor* v, VisitMode mode);
|
691
|
+
// Iterates over all strong roots in the heap.
|
692
|
+
static void IterateStrongRoots(ObjectVisitor* v, VisitMode mode);
|
693
|
+
|
694
|
+
// Iterates remembered set of an old space.
|
695
|
+
static void IterateRSet(PagedSpace* space, ObjectSlotCallback callback);
|
696
|
+
|
697
|
+
// Iterates a range of remembered set addresses starting with rset_start
|
698
|
+
// corresponding to the range of allocated pointers
|
699
|
+
// [object_start, object_end).
|
700
|
+
// Returns the number of bits that were set.
|
701
|
+
static int IterateRSetRange(Address object_start,
|
702
|
+
Address object_end,
|
703
|
+
Address rset_start,
|
704
|
+
ObjectSlotCallback copy_object_func);
|
705
|
+
|
706
|
+
// Returns whether the object resides in new space.
|
707
|
+
static inline bool InNewSpace(Object* object);
|
708
|
+
static inline bool InFromSpace(Object* object);
|
709
|
+
static inline bool InToSpace(Object* object);
|
710
|
+
|
711
|
+
// Checks whether an address/object in the heap (including auxiliary
|
712
|
+
// area and unused area).
|
713
|
+
static bool Contains(Address addr);
|
714
|
+
static bool Contains(HeapObject* value);
|
715
|
+
|
716
|
+
// Checks whether an address/object in a space.
|
717
|
+
// Currently used by tests, serialization and heap verification only.
|
718
|
+
static bool InSpace(Address addr, AllocationSpace space);
|
719
|
+
static bool InSpace(HeapObject* value, AllocationSpace space);
|
720
|
+
|
721
|
+
// Finds out which space an object should get promoted to based on its type.
|
722
|
+
static inline OldSpace* TargetSpace(HeapObject* object);
|
723
|
+
static inline AllocationSpace TargetSpaceId(InstanceType type);
|
724
|
+
|
725
|
+
// Sets the stub_cache_ (only used when expanding the dictionary).
|
726
|
+
static void public_set_code_stubs(NumberDictionary* value) {
|
727
|
+
roots_[kCodeStubsRootIndex] = value;
|
728
|
+
}
|
729
|
+
|
730
|
+
// Sets the non_monomorphic_cache_ (only used when expanding the dictionary).
|
731
|
+
static void public_set_non_monomorphic_cache(NumberDictionary* value) {
|
732
|
+
roots_[kNonMonomorphicCacheRootIndex] = value;
|
733
|
+
}
|
734
|
+
|
735
|
+
// Update the next script id.
|
736
|
+
static inline void SetLastScriptId(Object* last_script_id);
|
737
|
+
|
738
|
+
// Generated code can embed this address to get access to the roots.
|
739
|
+
static Object** roots_address() { return roots_; }
|
740
|
+
|
741
|
+
#ifdef DEBUG
|
742
|
+
static void Print();
|
743
|
+
static void PrintHandles();
|
744
|
+
|
745
|
+
// Verify the heap is in its normal state before or after a GC.
|
746
|
+
static void Verify();
|
747
|
+
|
748
|
+
// Report heap statistics.
|
749
|
+
static void ReportHeapStatistics(const char* title);
|
750
|
+
static void ReportCodeStatistics(const char* title);
|
751
|
+
|
752
|
+
// Fill in bogus values in from space
|
753
|
+
static void ZapFromSpace();
|
754
|
+
#endif
|
755
|
+
|
756
|
+
#if defined(ENABLE_LOGGING_AND_PROFILING)
|
757
|
+
// Print short heap statistics.
|
758
|
+
static void PrintShortHeapStatistics();
|
759
|
+
#endif
|
760
|
+
|
761
|
+
// Makes a new symbol object
|
762
|
+
// Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
763
|
+
// failed.
|
764
|
+
// Please note this function does not perform a garbage collection.
|
765
|
+
static Object* CreateSymbol(const char* str, int length, int hash);
|
766
|
+
static Object* CreateSymbol(String* str);
|
767
|
+
|
768
|
+
// Write barrier support for address[offset] = o.
|
769
|
+
static inline void RecordWrite(Address address, int offset);
|
770
|
+
|
771
|
+
// Given an address occupied by a live code object, return that object.
|
772
|
+
static Object* FindCodeObject(Address a);
|
773
|
+
|
774
|
+
// Invoke Shrink on shrinkable spaces.
|
775
|
+
static void Shrink();
|
776
|
+
|
777
|
+
enum HeapState { NOT_IN_GC, SCAVENGE, MARK_COMPACT };
|
778
|
+
static inline HeapState gc_state() { return gc_state_; }
|
779
|
+
|
780
|
+
#ifdef DEBUG
|
781
|
+
static bool IsAllocationAllowed() { return allocation_allowed_; }
|
782
|
+
static inline bool allow_allocation(bool enable);
|
783
|
+
|
784
|
+
static bool disallow_allocation_failure() {
|
785
|
+
return disallow_allocation_failure_;
|
786
|
+
}
|
787
|
+
|
788
|
+
static void TracePathToObject(Object* target);
|
789
|
+
static void TracePathToGlobal();
|
790
|
+
#endif
|
791
|
+
|
792
|
+
// Callback function passed to Heap::Iterate etc. Copies an object if
|
793
|
+
// necessary, the object might be promoted to an old space. The caller must
|
794
|
+
// ensure the precondition that the object is (a) a heap object and (b) in
|
795
|
+
// the heap's from space.
|
796
|
+
static void ScavengePointer(HeapObject** p);
|
797
|
+
static inline void ScavengeObject(HeapObject** p, HeapObject* object);
|
798
|
+
|
799
|
+
// Clear a range of remembered set addresses corresponding to the object
|
800
|
+
// area address 'start' with size 'size_in_bytes', eg, when adding blocks
|
801
|
+
// to the free list.
|
802
|
+
static void ClearRSetRange(Address start, int size_in_bytes);
|
803
|
+
|
804
|
+
// Rebuild remembered set in old and map spaces.
|
805
|
+
static void RebuildRSets();
|
806
|
+
|
807
|
+
// Update an old object's remembered set
|
808
|
+
static int UpdateRSet(HeapObject* obj);
|
809
|
+
|
810
|
+
// Commits from space if it is uncommitted.
|
811
|
+
static void EnsureFromSpaceIsCommitted();
|
812
|
+
|
813
|
+
// Support for partial snapshots. After calling this we can allocate a
|
814
|
+
// certain number of bytes using only linear allocation (with a
|
815
|
+
// LinearAllocationScope and an AlwaysAllocateScope) without using freelists
|
816
|
+
// or causing a GC. It returns true of space was reserved or false if a GC is
|
817
|
+
// needed. For paged spaces the space requested must include the space wasted
|
818
|
+
// at the end of each page when allocating linearly.
|
819
|
+
static void ReserveSpace(
|
820
|
+
int new_space_size,
|
821
|
+
int pointer_space_size,
|
822
|
+
int data_space_size,
|
823
|
+
int code_space_size,
|
824
|
+
int map_space_size,
|
825
|
+
int cell_space_size,
|
826
|
+
int large_object_size);
|
827
|
+
|
828
|
+
//
|
829
|
+
// Support for the API.
|
830
|
+
//
|
831
|
+
|
832
|
+
static bool CreateApiObjects();
|
833
|
+
|
834
|
+
// Attempt to find the number in a small cache. If we finds it, return
|
835
|
+
// the string representation of the number. Otherwise return undefined.
|
836
|
+
static Object* GetNumberStringCache(Object* number);
|
837
|
+
|
838
|
+
// Update the cache with a new number-string pair.
|
839
|
+
static void SetNumberStringCache(Object* number, String* str);
|
840
|
+
|
841
|
+
// Adjusts the amount of registered external memory.
|
842
|
+
// Returns the adjusted value.
|
843
|
+
static inline int AdjustAmountOfExternalAllocatedMemory(int change_in_bytes);
|
844
|
+
|
845
|
+
// Allocate unitialized fixed array (pretenure == NON_TENURE).
|
846
|
+
static Object* AllocateRawFixedArray(int length);
|
847
|
+
|
848
|
+
// True if we have reached the allocation limit in the old generation that
|
849
|
+
// should force the next GC (caused normally) to be a full one.
|
850
|
+
static bool OldGenerationPromotionLimitReached() {
|
851
|
+
return (PromotedSpaceSize() + PromotedExternalMemorySize())
|
852
|
+
> old_gen_promotion_limit_;
|
853
|
+
}
|
854
|
+
|
855
|
+
static intptr_t OldGenerationSpaceAvailable() {
|
856
|
+
return old_gen_allocation_limit_ -
|
857
|
+
(PromotedSpaceSize() + PromotedExternalMemorySize());
|
858
|
+
}
|
859
|
+
|
860
|
+
// True if we have reached the allocation limit in the old generation that
|
861
|
+
// should artificially cause a GC right now.
|
862
|
+
static bool OldGenerationAllocationLimitReached() {
|
863
|
+
return OldGenerationSpaceAvailable() < 0;
|
864
|
+
}
|
865
|
+
|
866
|
+
// Can be called when the embedding application is idle.
|
867
|
+
static bool IdleNotification();
|
868
|
+
|
869
|
+
// Declare all the root indices.
|
870
|
+
enum RootListIndex {
|
871
|
+
#define ROOT_INDEX_DECLARATION(type, name, camel_name) k##camel_name##RootIndex,
|
872
|
+
STRONG_ROOT_LIST(ROOT_INDEX_DECLARATION)
|
873
|
+
#undef ROOT_INDEX_DECLARATION
|
874
|
+
|
875
|
+
// Utility type maps
|
876
|
+
#define DECLARE_STRUCT_MAP(NAME, Name, name) k##Name##MapRootIndex,
|
877
|
+
STRUCT_LIST(DECLARE_STRUCT_MAP)
|
878
|
+
#undef DECLARE_STRUCT_MAP
|
879
|
+
|
880
|
+
#define SYMBOL_INDEX_DECLARATION(name, str) k##name##RootIndex,
|
881
|
+
SYMBOL_LIST(SYMBOL_INDEX_DECLARATION)
|
882
|
+
#undef SYMBOL_DECLARATION
|
883
|
+
|
884
|
+
kSymbolTableRootIndex,
|
885
|
+
kStrongRootListLength = kSymbolTableRootIndex,
|
886
|
+
kRootListLength
|
887
|
+
};
|
888
|
+
|
889
|
+
static Object* NumberToString(Object* number);
|
890
|
+
|
891
|
+
static Map* MapForExternalArrayType(ExternalArrayType array_type);
|
892
|
+
static RootListIndex RootIndexForExternalArrayType(
|
893
|
+
ExternalArrayType array_type);
|
894
|
+
|
895
|
+
static void RecordStats(HeapStats* stats);
|
896
|
+
|
897
|
+
private:
|
898
|
+
static int reserved_semispace_size_;
|
899
|
+
static int max_semispace_size_;
|
900
|
+
static int initial_semispace_size_;
|
901
|
+
static int max_old_generation_size_;
|
902
|
+
static size_t code_range_size_;
|
903
|
+
|
904
|
+
// For keeping track of how much data has survived
|
905
|
+
// scavenge since last new space expansion.
|
906
|
+
static int survived_since_last_expansion_;
|
907
|
+
|
908
|
+
static int always_allocate_scope_depth_;
|
909
|
+
static int linear_allocation_scope_depth_;
|
910
|
+
static bool context_disposed_pending_;
|
911
|
+
|
912
|
+
#if defined(V8_TARGET_ARCH_X64)
|
913
|
+
static const int kMaxObjectSizeInNewSpace = 512*KB;
|
914
|
+
#else
|
915
|
+
static const int kMaxObjectSizeInNewSpace = 256*KB;
|
916
|
+
#endif
|
917
|
+
|
918
|
+
static NewSpace new_space_;
|
919
|
+
static OldSpace* old_pointer_space_;
|
920
|
+
static OldSpace* old_data_space_;
|
921
|
+
static OldSpace* code_space_;
|
922
|
+
static MapSpace* map_space_;
|
923
|
+
static CellSpace* cell_space_;
|
924
|
+
static LargeObjectSpace* lo_space_;
|
925
|
+
static HeapState gc_state_;
|
926
|
+
|
927
|
+
// Returns the size of object residing in non new spaces.
|
928
|
+
static int PromotedSpaceSize();
|
929
|
+
|
930
|
+
// Returns the amount of external memory registered since last global gc.
|
931
|
+
static int PromotedExternalMemorySize();
|
932
|
+
|
933
|
+
static int mc_count_; // how many mark-compact collections happened
|
934
|
+
static int gc_count_; // how many gc happened
|
935
|
+
|
936
|
+
#define ROOT_ACCESSOR(type, name, camel_name) \
|
937
|
+
static inline void set_##name(type* value) { \
|
938
|
+
roots_[k##camel_name##RootIndex] = value; \
|
939
|
+
}
|
940
|
+
ROOT_LIST(ROOT_ACCESSOR)
|
941
|
+
#undef ROOT_ACCESSOR
|
942
|
+
|
943
|
+
#ifdef DEBUG
|
944
|
+
static bool allocation_allowed_;
|
945
|
+
|
946
|
+
// If the --gc-interval flag is set to a positive value, this
|
947
|
+
// variable holds the value indicating the number of allocations
|
948
|
+
// remain until the next failure and garbage collection.
|
949
|
+
static int allocation_timeout_;
|
950
|
+
|
951
|
+
// Do we expect to be able to handle allocation failure at this
|
952
|
+
// time?
|
953
|
+
static bool disallow_allocation_failure_;
|
954
|
+
#endif // DEBUG
|
955
|
+
|
956
|
+
// Limit that triggers a global GC on the next (normally caused) GC. This
|
957
|
+
// is checked when we have already decided to do a GC to help determine
|
958
|
+
// which collector to invoke.
|
959
|
+
static int old_gen_promotion_limit_;
|
960
|
+
|
961
|
+
// Limit that triggers a global GC as soon as is reasonable. This is
|
962
|
+
// checked before expanding a paged space in the old generation and on
|
963
|
+
// every allocation in large object space.
|
964
|
+
static int old_gen_allocation_limit_;
|
965
|
+
|
966
|
+
// Limit on the amount of externally allocated memory allowed
|
967
|
+
// between global GCs. If reached a global GC is forced.
|
968
|
+
static int external_allocation_limit_;
|
969
|
+
|
970
|
+
// The amount of external memory registered through the API kept alive
|
971
|
+
// by global handles
|
972
|
+
static int amount_of_external_allocated_memory_;
|
973
|
+
|
974
|
+
// Caches the amount of external memory registered at the last global gc.
|
975
|
+
static int amount_of_external_allocated_memory_at_last_global_gc_;
|
976
|
+
|
977
|
+
// Indicates that an allocation has failed in the old generation since the
|
978
|
+
// last GC.
|
979
|
+
static int old_gen_exhausted_;
|
980
|
+
|
981
|
+
static Object* roots_[kRootListLength];
|
982
|
+
|
983
|
+
struct StringTypeTable {
|
984
|
+
InstanceType type;
|
985
|
+
int size;
|
986
|
+
RootListIndex index;
|
987
|
+
};
|
988
|
+
|
989
|
+
struct ConstantSymbolTable {
|
990
|
+
const char* contents;
|
991
|
+
RootListIndex index;
|
992
|
+
};
|
993
|
+
|
994
|
+
struct StructTable {
|
995
|
+
InstanceType type;
|
996
|
+
int size;
|
997
|
+
RootListIndex index;
|
998
|
+
};
|
999
|
+
|
1000
|
+
static const StringTypeTable string_type_table[];
|
1001
|
+
static const ConstantSymbolTable constant_symbol_table[];
|
1002
|
+
static const StructTable struct_table[];
|
1003
|
+
|
1004
|
+
// The special hidden symbol which is an empty string, but does not match
|
1005
|
+
// any string when looked up in properties.
|
1006
|
+
static String* hidden_symbol_;
|
1007
|
+
|
1008
|
+
// GC callback function, called before and after mark-compact GC.
|
1009
|
+
// Allocations in the callback function are disallowed.
|
1010
|
+
static GCCallback global_gc_prologue_callback_;
|
1011
|
+
static GCCallback global_gc_epilogue_callback_;
|
1012
|
+
|
1013
|
+
// Checks whether a global GC is necessary
|
1014
|
+
static GarbageCollector SelectGarbageCollector(AllocationSpace space);
|
1015
|
+
|
1016
|
+
// Performs garbage collection
|
1017
|
+
static void PerformGarbageCollection(AllocationSpace space,
|
1018
|
+
GarbageCollector collector,
|
1019
|
+
GCTracer* tracer);
|
1020
|
+
|
1021
|
+
// Returns either a Smi or a Number object from 'value'. If 'new_object'
|
1022
|
+
// is false, it may return a preallocated immutable object.
|
1023
|
+
static Object* SmiOrNumberFromDouble(double value,
|
1024
|
+
bool new_object,
|
1025
|
+
PretenureFlag pretenure = NOT_TENURED);
|
1026
|
+
|
1027
|
+
// Allocate an uninitialized object in map space. The behavior is identical
|
1028
|
+
// to Heap::AllocateRaw(size_in_bytes, MAP_SPACE), except that (a) it doesn't
|
1029
|
+
// have to test the allocation space argument and (b) can reduce code size
|
1030
|
+
// (since both AllocateRaw and AllocateRawMap are inlined).
|
1031
|
+
static inline Object* AllocateRawMap();
|
1032
|
+
|
1033
|
+
// Allocate an uninitialized object in the global property cell space.
|
1034
|
+
static inline Object* AllocateRawCell();
|
1035
|
+
|
1036
|
+
// Initializes a JSObject based on its map.
|
1037
|
+
static void InitializeJSObjectFromMap(JSObject* obj,
|
1038
|
+
FixedArray* properties,
|
1039
|
+
Map* map);
|
1040
|
+
|
1041
|
+
static bool CreateInitialMaps();
|
1042
|
+
static bool CreateInitialObjects();
|
1043
|
+
|
1044
|
+
// These four Create*EntryStub functions are here because of a gcc-4.4 bug
|
1045
|
+
// that assigns wrong vtable entries.
|
1046
|
+
static void CreateCEntryStub();
|
1047
|
+
static void CreateCEntryDebugBreakStub();
|
1048
|
+
static void CreateJSEntryStub();
|
1049
|
+
static void CreateJSConstructEntryStub();
|
1050
|
+
static void CreateRegExpCEntryStub();
|
1051
|
+
|
1052
|
+
static void CreateFixedStubs();
|
1053
|
+
|
1054
|
+
static Object* CreateOddball(Map* map,
|
1055
|
+
const char* to_string,
|
1056
|
+
Object* to_number);
|
1057
|
+
|
1058
|
+
// Allocate empty fixed array.
|
1059
|
+
static Object* AllocateEmptyFixedArray();
|
1060
|
+
|
1061
|
+
// Performs a minor collection in new generation.
|
1062
|
+
static void Scavenge();
|
1063
|
+
static void ScavengeExternalStringTable();
|
1064
|
+
static Address DoScavenge(ObjectVisitor* scavenge_visitor,
|
1065
|
+
Address new_space_front);
|
1066
|
+
|
1067
|
+
// Performs a major collection in the whole heap.
|
1068
|
+
static void MarkCompact(GCTracer* tracer);
|
1069
|
+
|
1070
|
+
// Code to be run before and after mark-compact.
|
1071
|
+
static void MarkCompactPrologue(bool is_compacting);
|
1072
|
+
static void MarkCompactEpilogue(bool is_compacting);
|
1073
|
+
|
1074
|
+
// Helper function used by CopyObject to copy a source object to an
|
1075
|
+
// allocated target object and update the forwarding pointer in the source
|
1076
|
+
// object. Returns the target object.
|
1077
|
+
static inline HeapObject* MigrateObject(HeapObject* source,
|
1078
|
+
HeapObject* target,
|
1079
|
+
int size);
|
1080
|
+
|
1081
|
+
// Helper function that governs the promotion policy from new space to
|
1082
|
+
// old. If the object's old address lies below the new space's age
|
1083
|
+
// mark or if we've already filled the bottom 1/16th of the to space,
|
1084
|
+
// we try to promote this object.
|
1085
|
+
static inline bool ShouldBePromoted(Address old_address, int object_size);
|
1086
|
+
#if defined(DEBUG) || defined(ENABLE_LOGGING_AND_PROFILING)
|
1087
|
+
// Record the copy of an object in the NewSpace's statistics.
|
1088
|
+
static void RecordCopiedObject(HeapObject* obj);
|
1089
|
+
|
1090
|
+
// Record statistics before and after garbage collection.
|
1091
|
+
static void ReportStatisticsBeforeGC();
|
1092
|
+
static void ReportStatisticsAfterGC();
|
1093
|
+
#endif
|
1094
|
+
|
1095
|
+
// Rebuild remembered set in an old space.
|
1096
|
+
static void RebuildRSets(PagedSpace* space);
|
1097
|
+
|
1098
|
+
// Rebuild remembered set in the large object space.
|
1099
|
+
static void RebuildRSets(LargeObjectSpace* space);
|
1100
|
+
|
1101
|
+
// Slow part of scavenge object.
|
1102
|
+
static void ScavengeObjectSlow(HeapObject** p, HeapObject* object);
|
1103
|
+
|
1104
|
+
// Copy memory from src to dst.
|
1105
|
+
static inline void CopyBlock(Object** dst, Object** src, int byte_size);
|
1106
|
+
|
1107
|
+
// Initializes a function with a shared part and prototype.
|
1108
|
+
// Returns the function.
|
1109
|
+
// Note: this code was factored out of AllocateFunction such that
|
1110
|
+
// other parts of the VM could use it. Specifically, a function that creates
|
1111
|
+
// instances of type JS_FUNCTION_TYPE benefit from the use of this function.
|
1112
|
+
// Please note this does not perform a garbage collection.
|
1113
|
+
static inline Object* InitializeFunction(JSFunction* function,
|
1114
|
+
SharedFunctionInfo* shared,
|
1115
|
+
Object* prototype);
|
1116
|
+
|
1117
|
+
|
1118
|
+
// Initializes the number to string cache based on the max semispace size.
|
1119
|
+
static Object* InitializeNumberStringCache();
|
1120
|
+
// Flush the number to string cache.
|
1121
|
+
static void FlushNumberStringCache();
|
1122
|
+
|
1123
|
+
static const int kInitialSymbolTableSize = 2048;
|
1124
|
+
static const int kInitialEvalCacheSize = 64;
|
1125
|
+
|
1126
|
+
friend class Factory;
|
1127
|
+
friend class DisallowAllocationFailure;
|
1128
|
+
friend class AlwaysAllocateScope;
|
1129
|
+
friend class LinearAllocationScope;
|
1130
|
+
};
|
1131
|
+
|
1132
|
+
|
1133
|
+
class HeapStats {
|
1134
|
+
public:
|
1135
|
+
int *start_marker;
|
1136
|
+
int *new_space_size;
|
1137
|
+
int *new_space_capacity;
|
1138
|
+
int *old_pointer_space_size;
|
1139
|
+
int *old_pointer_space_capacity;
|
1140
|
+
int *old_data_space_size;
|
1141
|
+
int *old_data_space_capacity;
|
1142
|
+
int *code_space_size;
|
1143
|
+
int *code_space_capacity;
|
1144
|
+
int *map_space_size;
|
1145
|
+
int *map_space_capacity;
|
1146
|
+
int *cell_space_size;
|
1147
|
+
int *cell_space_capacity;
|
1148
|
+
int *lo_space_size;
|
1149
|
+
int *global_handle_count;
|
1150
|
+
int *weak_global_handle_count;
|
1151
|
+
int *pending_global_handle_count;
|
1152
|
+
int *near_death_global_handle_count;
|
1153
|
+
int *destroyed_global_handle_count;
|
1154
|
+
int *end_marker;
|
1155
|
+
};
|
1156
|
+
|
1157
|
+
|
1158
|
+
class AlwaysAllocateScope {
|
1159
|
+
public:
|
1160
|
+
AlwaysAllocateScope() {
|
1161
|
+
// We shouldn't hit any nested scopes, because that requires
|
1162
|
+
// non-handle code to call handle code. The code still works but
|
1163
|
+
// performance will degrade, so we want to catch this situation
|
1164
|
+
// in debug mode.
|
1165
|
+
ASSERT(Heap::always_allocate_scope_depth_ == 0);
|
1166
|
+
Heap::always_allocate_scope_depth_++;
|
1167
|
+
}
|
1168
|
+
|
1169
|
+
~AlwaysAllocateScope() {
|
1170
|
+
Heap::always_allocate_scope_depth_--;
|
1171
|
+
ASSERT(Heap::always_allocate_scope_depth_ == 0);
|
1172
|
+
}
|
1173
|
+
};
|
1174
|
+
|
1175
|
+
|
1176
|
+
class LinearAllocationScope {
|
1177
|
+
public:
|
1178
|
+
LinearAllocationScope() {
|
1179
|
+
Heap::linear_allocation_scope_depth_++;
|
1180
|
+
}
|
1181
|
+
|
1182
|
+
~LinearAllocationScope() {
|
1183
|
+
Heap::linear_allocation_scope_depth_--;
|
1184
|
+
ASSERT(Heap::linear_allocation_scope_depth_ >= 0);
|
1185
|
+
}
|
1186
|
+
};
|
1187
|
+
|
1188
|
+
|
1189
|
+
#ifdef DEBUG
|
1190
|
+
// Visitor class to verify interior pointers that do not have remembered set
|
1191
|
+
// bits. All heap object pointers have to point into the heap to a location
|
1192
|
+
// that has a map pointer at its first word. Caveat: Heap::Contains is an
|
1193
|
+
// approximation because it can return true for objects in a heap space but
|
1194
|
+
// above the allocation pointer.
|
1195
|
+
class VerifyPointersVisitor: public ObjectVisitor {
|
1196
|
+
public:
|
1197
|
+
void VisitPointers(Object** start, Object** end) {
|
1198
|
+
for (Object** current = start; current < end; current++) {
|
1199
|
+
if ((*current)->IsHeapObject()) {
|
1200
|
+
HeapObject* object = HeapObject::cast(*current);
|
1201
|
+
ASSERT(Heap::Contains(object));
|
1202
|
+
ASSERT(object->map()->IsMap());
|
1203
|
+
}
|
1204
|
+
}
|
1205
|
+
}
|
1206
|
+
};
|
1207
|
+
|
1208
|
+
|
1209
|
+
// Visitor class to verify interior pointers that have remembered set bits.
|
1210
|
+
// As VerifyPointersVisitor but also checks that remembered set bits are
|
1211
|
+
// always set for pointers into new space.
|
1212
|
+
class VerifyPointersAndRSetVisitor: public ObjectVisitor {
|
1213
|
+
public:
|
1214
|
+
void VisitPointers(Object** start, Object** end) {
|
1215
|
+
for (Object** current = start; current < end; current++) {
|
1216
|
+
if ((*current)->IsHeapObject()) {
|
1217
|
+
HeapObject* object = HeapObject::cast(*current);
|
1218
|
+
ASSERT(Heap::Contains(object));
|
1219
|
+
ASSERT(object->map()->IsMap());
|
1220
|
+
if (Heap::InNewSpace(object)) {
|
1221
|
+
ASSERT(Page::IsRSetSet(reinterpret_cast<Address>(current), 0));
|
1222
|
+
}
|
1223
|
+
}
|
1224
|
+
}
|
1225
|
+
}
|
1226
|
+
};
|
1227
|
+
#endif
|
1228
|
+
|
1229
|
+
|
1230
|
+
// Space iterator for iterating over all spaces of the heap.
|
1231
|
+
// Returns each space in turn, and null when it is done.
|
1232
|
+
class AllSpaces BASE_EMBEDDED {
|
1233
|
+
public:
|
1234
|
+
Space* next();
|
1235
|
+
AllSpaces() { counter_ = FIRST_SPACE; }
|
1236
|
+
private:
|
1237
|
+
int counter_;
|
1238
|
+
};
|
1239
|
+
|
1240
|
+
|
1241
|
+
// Space iterator for iterating over all old spaces of the heap: Old pointer
|
1242
|
+
// space, old data space and code space.
|
1243
|
+
// Returns each space in turn, and null when it is done.
|
1244
|
+
class OldSpaces BASE_EMBEDDED {
|
1245
|
+
public:
|
1246
|
+
OldSpace* next();
|
1247
|
+
OldSpaces() { counter_ = OLD_POINTER_SPACE; }
|
1248
|
+
private:
|
1249
|
+
int counter_;
|
1250
|
+
};
|
1251
|
+
|
1252
|
+
|
1253
|
+
// Space iterator for iterating over all the paged spaces of the heap:
|
1254
|
+
// Map space, old pointer space, old data space, code space and cell space.
|
1255
|
+
// Returns each space in turn, and null when it is done.
|
1256
|
+
class PagedSpaces BASE_EMBEDDED {
|
1257
|
+
public:
|
1258
|
+
PagedSpace* next();
|
1259
|
+
PagedSpaces() { counter_ = OLD_POINTER_SPACE; }
|
1260
|
+
private:
|
1261
|
+
int counter_;
|
1262
|
+
};
|
1263
|
+
|
1264
|
+
|
1265
|
+
// Space iterator for iterating over all spaces of the heap.
|
1266
|
+
// For each space an object iterator is provided. The deallocation of the
|
1267
|
+
// returned object iterators is handled by the space iterator.
|
1268
|
+
class SpaceIterator : public Malloced {
|
1269
|
+
public:
|
1270
|
+
SpaceIterator();
|
1271
|
+
virtual ~SpaceIterator();
|
1272
|
+
|
1273
|
+
bool has_next();
|
1274
|
+
ObjectIterator* next();
|
1275
|
+
|
1276
|
+
private:
|
1277
|
+
ObjectIterator* CreateIterator();
|
1278
|
+
|
1279
|
+
int current_space_; // from enum AllocationSpace.
|
1280
|
+
ObjectIterator* iterator_; // object iterator for the current space.
|
1281
|
+
};
|
1282
|
+
|
1283
|
+
|
1284
|
+
// A HeapIterator provides iteration over the whole heap It aggregates a the
|
1285
|
+
// specific iterators for the different spaces as these can only iterate over
|
1286
|
+
// one space only.
|
1287
|
+
|
1288
|
+
class HeapIterator BASE_EMBEDDED {
|
1289
|
+
public:
|
1290
|
+
explicit HeapIterator();
|
1291
|
+
virtual ~HeapIterator();
|
1292
|
+
|
1293
|
+
bool has_next();
|
1294
|
+
HeapObject* next();
|
1295
|
+
void reset();
|
1296
|
+
|
1297
|
+
private:
|
1298
|
+
// Perform the initialization.
|
1299
|
+
void Init();
|
1300
|
+
|
1301
|
+
// Perform all necessary shutdown (destruction) work.
|
1302
|
+
void Shutdown();
|
1303
|
+
|
1304
|
+
// Space iterator for iterating all the spaces.
|
1305
|
+
SpaceIterator* space_iterator_;
|
1306
|
+
// Object iterator for the space currently being iterated.
|
1307
|
+
ObjectIterator* object_iterator_;
|
1308
|
+
};
|
1309
|
+
|
1310
|
+
|
1311
|
+
// Cache for mapping (map, property name) into field offset.
|
1312
|
+
// Cleared at startup and prior to mark sweep collection.
|
1313
|
+
class KeyedLookupCache {
|
1314
|
+
public:
|
1315
|
+
// Lookup field offset for (map, name). If absent, -1 is returned.
|
1316
|
+
static int Lookup(Map* map, String* name);
|
1317
|
+
|
1318
|
+
// Update an element in the cache.
|
1319
|
+
static void Update(Map* map, String* name, int field_offset);
|
1320
|
+
|
1321
|
+
// Clear the cache.
|
1322
|
+
static void Clear();
|
1323
|
+
|
1324
|
+
static const int kLength = 64;
|
1325
|
+
static const int kCapacityMask = kLength - 1;
|
1326
|
+
static const int kMapHashShift = 2;
|
1327
|
+
|
1328
|
+
private:
|
1329
|
+
static inline int Hash(Map* map, String* name);
|
1330
|
+
|
1331
|
+
// Get the address of the keys and field_offsets arrays. Used in
|
1332
|
+
// generated code to perform cache lookups.
|
1333
|
+
static Address keys_address() {
|
1334
|
+
return reinterpret_cast<Address>(&keys_);
|
1335
|
+
}
|
1336
|
+
|
1337
|
+
static Address field_offsets_address() {
|
1338
|
+
return reinterpret_cast<Address>(&field_offsets_);
|
1339
|
+
}
|
1340
|
+
|
1341
|
+
struct Key {
|
1342
|
+
Map* map;
|
1343
|
+
String* name;
|
1344
|
+
};
|
1345
|
+
static Key keys_[kLength];
|
1346
|
+
static int field_offsets_[kLength];
|
1347
|
+
|
1348
|
+
friend class ExternalReference;
|
1349
|
+
};
|
1350
|
+
|
1351
|
+
|
1352
|
+
// Cache for mapping (array, property name) into descriptor index.
|
1353
|
+
// The cache contains both positive and negative results.
|
1354
|
+
// Descriptor index equals kNotFound means the property is absent.
|
1355
|
+
// Cleared at startup and prior to any gc.
|
1356
|
+
class DescriptorLookupCache {
|
1357
|
+
public:
|
1358
|
+
// Lookup descriptor index for (map, name).
|
1359
|
+
// If absent, kAbsent is returned.
|
1360
|
+
static int Lookup(DescriptorArray* array, String* name) {
|
1361
|
+
if (!StringShape(name).IsSymbol()) return kAbsent;
|
1362
|
+
int index = Hash(array, name);
|
1363
|
+
Key& key = keys_[index];
|
1364
|
+
if ((key.array == array) && (key.name == name)) return results_[index];
|
1365
|
+
return kAbsent;
|
1366
|
+
}
|
1367
|
+
|
1368
|
+
// Update an element in the cache.
|
1369
|
+
static void Update(DescriptorArray* array, String* name, int result) {
|
1370
|
+
ASSERT(result != kAbsent);
|
1371
|
+
if (StringShape(name).IsSymbol()) {
|
1372
|
+
int index = Hash(array, name);
|
1373
|
+
Key& key = keys_[index];
|
1374
|
+
key.array = array;
|
1375
|
+
key.name = name;
|
1376
|
+
results_[index] = result;
|
1377
|
+
}
|
1378
|
+
}
|
1379
|
+
|
1380
|
+
// Clear the cache.
|
1381
|
+
static void Clear();
|
1382
|
+
|
1383
|
+
static const int kAbsent = -2;
|
1384
|
+
private:
|
1385
|
+
static int Hash(DescriptorArray* array, String* name) {
|
1386
|
+
// Uses only lower 32 bits if pointers are larger.
|
1387
|
+
uintptr_t array_hash =
|
1388
|
+
static_cast<uint32_t>(reinterpret_cast<uintptr_t>(array)) >> 2;
|
1389
|
+
uintptr_t name_hash =
|
1390
|
+
static_cast<uint32_t>(reinterpret_cast<uintptr_t>(name)) >> 2;
|
1391
|
+
return (array_hash ^ name_hash) % kLength;
|
1392
|
+
}
|
1393
|
+
|
1394
|
+
static const int kLength = 64;
|
1395
|
+
struct Key {
|
1396
|
+
DescriptorArray* array;
|
1397
|
+
String* name;
|
1398
|
+
};
|
1399
|
+
|
1400
|
+
static Key keys_[kLength];
|
1401
|
+
static int results_[kLength];
|
1402
|
+
};
|
1403
|
+
|
1404
|
+
|
1405
|
+
// ----------------------------------------------------------------------------
|
1406
|
+
// Marking stack for tracing live objects.
|
1407
|
+
|
1408
|
+
class MarkingStack {
|
1409
|
+
public:
|
1410
|
+
void Initialize(Address low, Address high) {
|
1411
|
+
top_ = low_ = reinterpret_cast<HeapObject**>(low);
|
1412
|
+
high_ = reinterpret_cast<HeapObject**>(high);
|
1413
|
+
overflowed_ = false;
|
1414
|
+
}
|
1415
|
+
|
1416
|
+
bool is_full() { return top_ >= high_; }
|
1417
|
+
|
1418
|
+
bool is_empty() { return top_ <= low_; }
|
1419
|
+
|
1420
|
+
bool overflowed() { return overflowed_; }
|
1421
|
+
|
1422
|
+
void clear_overflowed() { overflowed_ = false; }
|
1423
|
+
|
1424
|
+
// Push the (marked) object on the marking stack if there is room,
|
1425
|
+
// otherwise mark the object as overflowed and wait for a rescan of the
|
1426
|
+
// heap.
|
1427
|
+
void Push(HeapObject* object) {
|
1428
|
+
CHECK(object->IsHeapObject());
|
1429
|
+
if (is_full()) {
|
1430
|
+
object->SetOverflow();
|
1431
|
+
overflowed_ = true;
|
1432
|
+
} else {
|
1433
|
+
*(top_++) = object;
|
1434
|
+
}
|
1435
|
+
}
|
1436
|
+
|
1437
|
+
HeapObject* Pop() {
|
1438
|
+
ASSERT(!is_empty());
|
1439
|
+
HeapObject* object = *(--top_);
|
1440
|
+
CHECK(object->IsHeapObject());
|
1441
|
+
return object;
|
1442
|
+
}
|
1443
|
+
|
1444
|
+
private:
|
1445
|
+
HeapObject** low_;
|
1446
|
+
HeapObject** top_;
|
1447
|
+
HeapObject** high_;
|
1448
|
+
bool overflowed_;
|
1449
|
+
};
|
1450
|
+
|
1451
|
+
|
1452
|
+
// A helper class to document/test C++ scopes where we do not
|
1453
|
+
// expect a GC. Usage:
|
1454
|
+
//
|
1455
|
+
// /* Allocation not allowed: we cannot handle a GC in this scope. */
|
1456
|
+
// { AssertNoAllocation nogc;
|
1457
|
+
// ...
|
1458
|
+
// }
|
1459
|
+
|
1460
|
+
#ifdef DEBUG
|
1461
|
+
|
1462
|
+
class DisallowAllocationFailure {
|
1463
|
+
public:
|
1464
|
+
DisallowAllocationFailure() {
|
1465
|
+
old_state_ = Heap::disallow_allocation_failure_;
|
1466
|
+
Heap::disallow_allocation_failure_ = true;
|
1467
|
+
}
|
1468
|
+
~DisallowAllocationFailure() {
|
1469
|
+
Heap::disallow_allocation_failure_ = old_state_;
|
1470
|
+
}
|
1471
|
+
private:
|
1472
|
+
bool old_state_;
|
1473
|
+
};
|
1474
|
+
|
1475
|
+
class AssertNoAllocation {
|
1476
|
+
public:
|
1477
|
+
AssertNoAllocation() {
|
1478
|
+
old_state_ = Heap::allow_allocation(false);
|
1479
|
+
}
|
1480
|
+
|
1481
|
+
~AssertNoAllocation() {
|
1482
|
+
Heap::allow_allocation(old_state_);
|
1483
|
+
}
|
1484
|
+
|
1485
|
+
private:
|
1486
|
+
bool old_state_;
|
1487
|
+
};
|
1488
|
+
|
1489
|
+
class DisableAssertNoAllocation {
|
1490
|
+
public:
|
1491
|
+
DisableAssertNoAllocation() {
|
1492
|
+
old_state_ = Heap::allow_allocation(true);
|
1493
|
+
}
|
1494
|
+
|
1495
|
+
~DisableAssertNoAllocation() {
|
1496
|
+
Heap::allow_allocation(old_state_);
|
1497
|
+
}
|
1498
|
+
|
1499
|
+
private:
|
1500
|
+
bool old_state_;
|
1501
|
+
};
|
1502
|
+
|
1503
|
+
#else // ndef DEBUG
|
1504
|
+
|
1505
|
+
class AssertNoAllocation {
|
1506
|
+
public:
|
1507
|
+
AssertNoAllocation() { }
|
1508
|
+
~AssertNoAllocation() { }
|
1509
|
+
};
|
1510
|
+
|
1511
|
+
class DisableAssertNoAllocation {
|
1512
|
+
public:
|
1513
|
+
DisableAssertNoAllocation() { }
|
1514
|
+
~DisableAssertNoAllocation() { }
|
1515
|
+
};
|
1516
|
+
|
1517
|
+
#endif
|
1518
|
+
|
1519
|
+
// GCTracer collects and prints ONE line after each garbage collector
|
1520
|
+
// invocation IFF --trace_gc is used.
|
1521
|
+
|
1522
|
+
class GCTracer BASE_EMBEDDED {
|
1523
|
+
public:
|
1524
|
+
GCTracer();
|
1525
|
+
|
1526
|
+
~GCTracer();
|
1527
|
+
|
1528
|
+
// Sets the collector.
|
1529
|
+
void set_collector(GarbageCollector collector) { collector_ = collector; }
|
1530
|
+
|
1531
|
+
// Sets the GC count.
|
1532
|
+
void set_gc_count(int count) { gc_count_ = count; }
|
1533
|
+
|
1534
|
+
// Sets the full GC count.
|
1535
|
+
void set_full_gc_count(int count) { full_gc_count_ = count; }
|
1536
|
+
|
1537
|
+
// Sets the flag that this is a compacting full GC.
|
1538
|
+
void set_is_compacting() { is_compacting_ = true; }
|
1539
|
+
|
1540
|
+
// Increment and decrement the count of marked objects.
|
1541
|
+
void increment_marked_count() { ++marked_count_; }
|
1542
|
+
void decrement_marked_count() { --marked_count_; }
|
1543
|
+
|
1544
|
+
int marked_count() { return marked_count_; }
|
1545
|
+
|
1546
|
+
private:
|
1547
|
+
// Returns a string matching the collector.
|
1548
|
+
const char* CollectorString();
|
1549
|
+
|
1550
|
+
// Returns size of object in heap (in MB).
|
1551
|
+
double SizeOfHeapObjects() {
|
1552
|
+
return (static_cast<double>(Heap::SizeOfObjects())) / MB;
|
1553
|
+
}
|
1554
|
+
|
1555
|
+
double start_time_; // Timestamp set in the constructor.
|
1556
|
+
double start_size_; // Size of objects in heap set in constructor.
|
1557
|
+
GarbageCollector collector_; // Type of collector.
|
1558
|
+
|
1559
|
+
// A count (including this one, eg, the first collection is 1) of the
|
1560
|
+
// number of garbage collections.
|
1561
|
+
int gc_count_;
|
1562
|
+
|
1563
|
+
// A count (including this one) of the number of full garbage collections.
|
1564
|
+
int full_gc_count_;
|
1565
|
+
|
1566
|
+
// True if the current GC is a compacting full collection, false
|
1567
|
+
// otherwise.
|
1568
|
+
bool is_compacting_;
|
1569
|
+
|
1570
|
+
// True if the *previous* full GC cwas a compacting collection (will be
|
1571
|
+
// false if there has not been a previous full GC).
|
1572
|
+
bool previous_has_compacted_;
|
1573
|
+
|
1574
|
+
// On a full GC, a count of the number of marked objects. Incremented
|
1575
|
+
// when an object is marked and decremented when an object's mark bit is
|
1576
|
+
// cleared. Will be zero on a scavenge collection.
|
1577
|
+
int marked_count_;
|
1578
|
+
|
1579
|
+
// The count from the end of the previous full GC. Will be zero if there
|
1580
|
+
// was no previous full GC.
|
1581
|
+
int previous_marked_count_;
|
1582
|
+
};
|
1583
|
+
|
1584
|
+
|
1585
|
+
class TranscendentalCache {
|
1586
|
+
public:
|
1587
|
+
enum Type {ACOS, ASIN, ATAN, COS, EXP, LOG, SIN, TAN, kNumberOfCaches};
|
1588
|
+
|
1589
|
+
explicit TranscendentalCache(Type t);
|
1590
|
+
|
1591
|
+
// Returns a heap number with f(input), where f is a math function specified
|
1592
|
+
// by the 'type' argument.
|
1593
|
+
static inline Object* Get(Type type, double input) {
|
1594
|
+
TranscendentalCache* cache = caches_[type];
|
1595
|
+
if (cache == NULL) {
|
1596
|
+
caches_[type] = cache = new TranscendentalCache(type);
|
1597
|
+
}
|
1598
|
+
return cache->Get(input);
|
1599
|
+
}
|
1600
|
+
|
1601
|
+
// The cache contains raw Object pointers. This method disposes of
|
1602
|
+
// them before a garbage collection.
|
1603
|
+
static void Clear();
|
1604
|
+
|
1605
|
+
private:
|
1606
|
+
inline Object* Get(double input) {
|
1607
|
+
Converter c;
|
1608
|
+
c.dbl = input;
|
1609
|
+
int hash = Hash(c);
|
1610
|
+
Element e = elements_[hash];
|
1611
|
+
if (e.in[0] == c.integers[0] &&
|
1612
|
+
e.in[1] == c.integers[1]) {
|
1613
|
+
ASSERT(e.output != NULL);
|
1614
|
+
return e.output;
|
1615
|
+
}
|
1616
|
+
double answer = Calculate(input);
|
1617
|
+
Object* heap_number = Heap::AllocateHeapNumber(answer);
|
1618
|
+
if (!heap_number->IsFailure()) {
|
1619
|
+
elements_[hash].in[0] = c.integers[0];
|
1620
|
+
elements_[hash].in[1] = c.integers[1];
|
1621
|
+
elements_[hash].output = heap_number;
|
1622
|
+
}
|
1623
|
+
return heap_number;
|
1624
|
+
}
|
1625
|
+
|
1626
|
+
inline double Calculate(double input) {
|
1627
|
+
switch (type_) {
|
1628
|
+
case ACOS:
|
1629
|
+
return acos(input);
|
1630
|
+
case ASIN:
|
1631
|
+
return asin(input);
|
1632
|
+
case ATAN:
|
1633
|
+
return atan(input);
|
1634
|
+
case COS:
|
1635
|
+
return cos(input);
|
1636
|
+
case EXP:
|
1637
|
+
return exp(input);
|
1638
|
+
case LOG:
|
1639
|
+
return log(input);
|
1640
|
+
case SIN:
|
1641
|
+
return sin(input);
|
1642
|
+
case TAN:
|
1643
|
+
return tan(input);
|
1644
|
+
default:
|
1645
|
+
return 0.0; // Never happens.
|
1646
|
+
}
|
1647
|
+
}
|
1648
|
+
static const int kCacheSize = 512;
|
1649
|
+
struct Element {
|
1650
|
+
uint32_t in[2];
|
1651
|
+
Object* output;
|
1652
|
+
};
|
1653
|
+
union Converter {
|
1654
|
+
double dbl;
|
1655
|
+
uint32_t integers[2];
|
1656
|
+
};
|
1657
|
+
inline static int Hash(const Converter& c) {
|
1658
|
+
uint32_t hash = (c.integers[0] ^ c.integers[1]);
|
1659
|
+
hash ^= hash >> 16;
|
1660
|
+
hash ^= hash >> 8;
|
1661
|
+
return (hash & (kCacheSize - 1));
|
1662
|
+
}
|
1663
|
+
static TranscendentalCache* caches_[kNumberOfCaches];
|
1664
|
+
Element elements_[kCacheSize];
|
1665
|
+
Type type_;
|
1666
|
+
};
|
1667
|
+
|
1668
|
+
|
1669
|
+
// External strings table is a place where all external strings are
|
1670
|
+
// registered. We need to keep track of such strings to properly
|
1671
|
+
// finalize them.
|
1672
|
+
class ExternalStringTable : public AllStatic {
|
1673
|
+
public:
|
1674
|
+
// Registers an external string.
|
1675
|
+
inline static void AddString(String* string);
|
1676
|
+
|
1677
|
+
inline static void Iterate(ObjectVisitor* v);
|
1678
|
+
|
1679
|
+
// Restores internal invariant and gets rid of collected strings.
|
1680
|
+
// Must be called after each Iterate() that modified the strings.
|
1681
|
+
static void CleanUp();
|
1682
|
+
|
1683
|
+
// Destroys all allocated memory.
|
1684
|
+
static void TearDown();
|
1685
|
+
|
1686
|
+
private:
|
1687
|
+
friend class Heap;
|
1688
|
+
|
1689
|
+
inline static void Verify();
|
1690
|
+
|
1691
|
+
inline static void AddOldString(String* string);
|
1692
|
+
|
1693
|
+
// Notifies the table that only a prefix of the new list is valid.
|
1694
|
+
inline static void ShrinkNewStrings(int position);
|
1695
|
+
|
1696
|
+
// To speed up scavenge collections new space string are kept
|
1697
|
+
// separate from old space strings.
|
1698
|
+
static List<Object*> new_space_strings_;
|
1699
|
+
static List<Object*> old_space_strings_;
|
1700
|
+
};
|
1701
|
+
|
1702
|
+
} } // namespace v8::internal
|
1703
|
+
|
1704
|
+
#endif // V8_HEAP_H_
|