therubyracer 0.8.1.pre2 → 0.8.1
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/Changelog.md +2 -1
- data/README.md +6 -3
- data/ext/v8/upstream/3.1.8/.gitignore +31 -0
- data/ext/v8/upstream/3.1.8/AUTHORS +40 -0
- data/ext/v8/upstream/3.1.8/ChangeLog +2566 -0
- data/ext/v8/upstream/3.1.8/LICENSE +52 -0
- data/ext/v8/upstream/3.1.8/LICENSE.strongtalk +29 -0
- data/ext/v8/upstream/3.1.8/LICENSE.v8 +26 -0
- data/ext/v8/upstream/3.1.8/LICENSE.valgrind +45 -0
- data/ext/v8/upstream/3.1.8/SConstruct +1192 -0
- data/ext/v8/upstream/3.1.8/build/README.txt +25 -0
- data/ext/v8/upstream/3.1.8/build/all.gyp +18 -0
- data/ext/v8/upstream/3.1.8/build/armu.gypi +32 -0
- data/ext/v8/upstream/3.1.8/build/common.gypi +82 -0
- data/ext/v8/upstream/3.1.8/build/gyp_v8 +145 -0
- data/ext/v8/upstream/3.1.8/include/v8-debug.h +384 -0
- data/ext/v8/upstream/3.1.8/include/v8-preparser.h +116 -0
- data/ext/v8/upstream/3.1.8/include/v8-profiler.h +426 -0
- data/ext/v8/upstream/3.1.8/include/v8-testing.h +99 -0
- data/ext/v8/upstream/3.1.8/include/v8.h +3846 -0
- data/ext/v8/upstream/3.1.8/include/v8stdint.h +53 -0
- data/ext/v8/upstream/3.1.8/preparser/preparser-process.cc +206 -0
- data/ext/v8/upstream/3.1.8/src/SConscript +356 -0
- data/ext/v8/upstream/3.1.8/src/accessors.cc +907 -0
- data/ext/v8/upstream/3.1.8/src/accessors.h +121 -0
- data/ext/v8/upstream/3.1.8/src/allocation.cc +204 -0
- data/ext/v8/upstream/3.1.8/src/allocation.h +176 -0
- data/ext/v8/upstream/3.1.8/src/api.cc +5191 -0
- data/ext/v8/upstream/3.1.8/src/api.h +508 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/apinatives.js +0 -0
- data/ext/v8/upstream/3.1.8/src/apiutils.h +80 -0
- data/ext/v8/upstream/3.1.8/src/arguments.h +105 -0
- data/ext/v8/upstream/3.1.8/src/arm/assembler-arm-inl.h +352 -0
- data/ext/v8/upstream/3.1.8/src/arm/assembler-arm.cc +2756 -0
- data/ext/v8/upstream/3.1.8/src/arm/assembler-arm.h +1294 -0
- data/ext/v8/upstream/3.1.8/src/arm/builtins-arm.cc +1628 -0
- data/ext/v8/upstream/3.1.8/src/arm/code-stubs-arm.cc +6783 -0
- data/ext/v8/upstream/3.1.8/src/arm/code-stubs-arm.h +657 -0
- data/ext/v8/upstream/3.1.8/src/arm/codegen-arm-inl.h +48 -0
- data/ext/v8/upstream/3.1.8/src/arm/codegen-arm.cc +7403 -0
- data/ext/v8/upstream/3.1.8/src/arm/codegen-arm.h +595 -0
- data/ext/v8/upstream/3.1.8/src/arm/constants-arm.cc +152 -0
- data/ext/v8/upstream/3.1.8/src/arm/constants-arm.h +769 -0
- data/ext/v8/upstream/3.1.8/src/arm/cpu-arm.cc +147 -0
- data/ext/v8/upstream/3.1.8/src/arm/debug-arm.cc +315 -0
- data/ext/v8/upstream/3.1.8/src/arm/deoptimizer-arm.cc +700 -0
- data/ext/v8/upstream/3.1.8/src/arm/disasm-arm.cc +1439 -0
- data/ext/v8/upstream/3.1.8/src/arm/frames-arm.cc +45 -0
- data/ext/v8/upstream/3.1.8/src/arm/frames-arm.h +168 -0
- data/ext/v8/upstream/3.1.8/src/arm/full-codegen-arm.cc +4230 -0
- data/ext/v8/upstream/3.1.8/src/arm/ic-arm.cc +1799 -0
- data/ext/v8/upstream/3.1.8/src/arm/jump-target-arm.cc +174 -0
- data/ext/v8/upstream/3.1.8/src/arm/lithium-arm.cc +2041 -0
- data/ext/v8/upstream/3.1.8/src/arm/lithium-arm.h +2046 -0
- data/ext/v8/upstream/3.1.8/src/arm/lithium-codegen-arm.cc +3822 -0
- data/ext/v8/upstream/3.1.8/src/arm/lithium-codegen-arm.h +312 -0
- data/ext/v8/upstream/3.1.8/src/arm/lithium-gap-resolver-arm.cc +303 -0
- data/ext/v8/upstream/3.1.8/src/arm/lithium-gap-resolver-arm.h +84 -0
- data/ext/v8/upstream/3.1.8/src/arm/macro-assembler-arm.cc +2701 -0
- data/ext/v8/upstream/3.1.8/src/arm/macro-assembler-arm.h +1015 -0
- data/ext/v8/upstream/3.1.8/src/arm/regexp-macro-assembler-arm.cc +1280 -0
- data/ext/v8/upstream/3.1.8/src/arm/regexp-macro-assembler-arm.h +252 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/arm/register-allocator-arm-inl.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/arm/register-allocator-arm.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/arm/register-allocator-arm.h +0 -0
- data/ext/v8/upstream/3.1.8/src/arm/simulator-arm.cc +3165 -0
- data/ext/v8/upstream/3.1.8/src/arm/simulator-arm.h +402 -0
- data/ext/v8/upstream/3.1.8/src/arm/stub-cache-arm.cc +4077 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/arm/virtual-frame-arm-inl.h +0 -0
- data/ext/v8/upstream/3.1.8/src/arm/virtual-frame-arm.cc +843 -0
- data/ext/v8/upstream/3.1.8/src/arm/virtual-frame-arm.h +520 -0
- data/ext/v8/upstream/3.1.8/src/array.js +1231 -0
- data/ext/v8/upstream/3.1.8/src/assembler.cc +973 -0
- data/ext/v8/upstream/3.1.8/src/assembler.h +787 -0
- data/ext/v8/upstream/3.1.8/src/ast-inl.h +107 -0
- data/ext/v8/upstream/3.1.8/src/ast.cc +1067 -0
- data/ext/v8/upstream/3.1.8/src/ast.h +2177 -0
- data/ext/v8/upstream/3.1.8/src/atomicops.h +165 -0
- data/ext/v8/upstream/3.1.8/src/atomicops_internals_arm_gcc.h +145 -0
- data/ext/v8/upstream/3.1.8/src/atomicops_internals_x86_gcc.cc +126 -0
- data/ext/v8/upstream/3.1.8/src/atomicops_internals_x86_gcc.h +287 -0
- data/ext/v8/upstream/3.1.8/src/atomicops_internals_x86_macosx.h +301 -0
- data/ext/v8/upstream/3.1.8/src/atomicops_internals_x86_msvc.h +203 -0
- data/ext/v8/upstream/3.1.8/src/bignum-dtoa.cc +655 -0
- data/ext/v8/upstream/3.1.8/src/bignum-dtoa.h +81 -0
- data/ext/v8/upstream/3.1.8/src/bignum.cc +768 -0
- data/ext/v8/upstream/3.1.8/src/bignum.h +140 -0
- data/ext/v8/upstream/3.1.8/src/bootstrapper.cc +1888 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/bootstrapper.h +0 -0
- data/ext/v8/upstream/3.1.8/src/builtins.cc +1586 -0
- data/ext/v8/upstream/3.1.8/src/builtins.h +339 -0
- data/ext/v8/upstream/3.1.8/src/bytecodes-irregexp.h +105 -0
- data/ext/v8/upstream/3.1.8/src/cached-powers.cc +177 -0
- data/ext/v8/upstream/3.1.8/src/cached-powers.h +65 -0
- data/ext/v8/upstream/3.1.8/src/char-predicates-inl.h +94 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/char-predicates.h +0 -0
- data/ext/v8/upstream/3.1.8/src/checks.cc +110 -0
- data/ext/v8/upstream/3.1.8/src/checks.h +292 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/circular-queue-inl.h +0 -0
- data/ext/v8/upstream/3.1.8/src/circular-queue.cc +122 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/circular-queue.h +0 -0
- data/ext/v8/upstream/3.1.8/src/code-stubs.cc +230 -0
- data/ext/v8/upstream/3.1.8/src/code-stubs.h +950 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/code.h +0 -0
- data/ext/v8/upstream/3.1.8/src/codegen-inl.h +64 -0
- data/ext/v8/upstream/3.1.8/src/codegen.cc +495 -0
- data/ext/v8/upstream/3.1.8/src/codegen.h +245 -0
- data/ext/v8/upstream/3.1.8/src/compilation-cache.cc +654 -0
- data/ext/v8/upstream/3.1.8/src/compilation-cache.h +112 -0
- data/ext/v8/upstream/3.1.8/src/compiler.cc +806 -0
- data/ext/v8/upstream/3.1.8/src/compiler.h +290 -0
- data/ext/v8/upstream/3.1.8/src/contexts.cc +320 -0
- data/ext/v8/upstream/3.1.8/src/contexts.h +376 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/conversions-inl.h +0 -0
- data/ext/v8/upstream/3.1.8/src/conversions.cc +1069 -0
- data/ext/v8/upstream/3.1.8/src/conversions.h +122 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/counters.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/counters.h +242 -0
- data/ext/v8/upstream/3.1.8/src/cpu-profiler-inl.h +100 -0
- data/ext/v8/upstream/3.1.8/src/cpu-profiler.cc +554 -0
- data/ext/v8/upstream/3.1.8/src/cpu-profiler.h +291 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/cpu.h +0 -0
- data/ext/v8/upstream/3.1.8/src/d8-debug.cc +367 -0
- data/ext/v8/upstream/3.1.8/src/d8-debug.h +157 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/d8-posix.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/d8-readline.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/d8-windows.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/d8.cc +792 -0
- data/ext/v8/upstream/3.1.8/src/d8.gyp +85 -0
- data/ext/v8/upstream/3.1.8/src/d8.h +231 -0
- data/ext/v8/upstream/3.1.8/src/d8.js +2798 -0
- data/ext/v8/upstream/3.1.8/src/data-flow.cc +545 -0
- data/ext/v8/upstream/3.1.8/src/data-flow.h +379 -0
- data/ext/v8/upstream/3.1.8/src/date.js +1103 -0
- data/ext/v8/upstream/3.1.8/src/dateparser-inl.h +125 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/dateparser.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/dateparser.h +263 -0
- data/ext/v8/upstream/3.1.8/src/debug-agent.cc +446 -0
- data/ext/v8/upstream/3.1.8/src/debug-agent.h +131 -0
- data/ext/v8/upstream/3.1.8/src/debug-debugger.js +2569 -0
- data/ext/v8/upstream/3.1.8/src/debug.cc +3085 -0
- data/ext/v8/upstream/3.1.8/src/debug.h +1025 -0
- data/ext/v8/upstream/3.1.8/src/deoptimizer.cc +1185 -0
- data/ext/v8/upstream/3.1.8/src/deoptimizer.h +529 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/disasm.h +0 -0
- data/ext/v8/upstream/3.1.8/src/disassembler.cc +338 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/disassembler.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/diy-fp.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/diy-fp.h +0 -0
- data/ext/v8/upstream/3.1.8/src/double.h +238 -0
- data/ext/v8/upstream/3.1.8/src/dtoa.cc +103 -0
- data/ext/v8/upstream/3.1.8/src/dtoa.h +85 -0
- data/ext/v8/upstream/3.1.8/src/execution.cc +735 -0
- data/ext/v8/upstream/3.1.8/src/execution.h +322 -0
- data/ext/v8/upstream/3.1.8/src/extensions/experimental/experimental.gyp +53 -0
- data/ext/v8/upstream/3.1.8/src/extensions/experimental/i18n-extension.cc +264 -0
- data/ext/v8/upstream/3.1.8/src/extensions/experimental/i18n-extension.h +64 -0
- data/ext/v8/upstream/3.1.8/src/extensions/externalize-string-extension.cc +141 -0
- data/ext/v8/upstream/3.1.8/src/extensions/externalize-string-extension.h +50 -0
- data/ext/v8/upstream/3.1.8/src/extensions/gc-extension.cc +58 -0
- data/ext/v8/upstream/3.1.8/src/extensions/gc-extension.h +49 -0
- data/ext/v8/upstream/3.1.8/src/factory.cc +1087 -0
- data/ext/v8/upstream/3.1.8/src/factory.h +432 -0
- data/ext/v8/upstream/3.1.8/src/fast-dtoa.cc +736 -0
- data/ext/v8/upstream/3.1.8/src/fast-dtoa.h +83 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/fixed-dtoa.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/fixed-dtoa.h +0 -0
- data/ext/v8/upstream/3.1.8/src/flag-definitions.h +552 -0
- data/ext/v8/upstream/3.1.8/src/flags.cc +551 -0
- data/ext/v8/upstream/3.1.8/src/flags.h +79 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/frame-element.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/frame-element.h +277 -0
- data/ext/v8/upstream/3.1.8/src/frames-inl.h +210 -0
- data/ext/v8/upstream/3.1.8/src/frames.cc +1232 -0
- data/ext/v8/upstream/3.1.8/src/frames.h +826 -0
- data/ext/v8/upstream/3.1.8/src/full-codegen.cc +1382 -0
- data/ext/v8/upstream/3.1.8/src/full-codegen.h +751 -0
- data/ext/v8/upstream/3.1.8/src/func-name-inferrer.cc +90 -0
- data/ext/v8/upstream/3.1.8/src/func-name-inferrer.h +111 -0
- data/ext/v8/upstream/3.1.8/src/gdb-jit.cc +1547 -0
- data/ext/v8/upstream/3.1.8/src/gdb-jit.h +138 -0
- data/ext/v8/upstream/3.1.8/src/global-handles.cc +534 -0
- data/ext/v8/upstream/3.1.8/src/global-handles.h +181 -0
- data/ext/v8/upstream/3.1.8/src/globals.h +325 -0
- data/ext/v8/upstream/3.1.8/src/handles-inl.h +80 -0
- data/ext/v8/upstream/3.1.8/src/handles.cc +910 -0
- data/ext/v8/upstream/3.1.8/src/handles.h +424 -0
- data/ext/v8/upstream/3.1.8/src/hashmap.cc +230 -0
- data/ext/v8/upstream/3.1.8/src/hashmap.h +121 -0
- data/ext/v8/upstream/3.1.8/src/heap-inl.h +587 -0
- data/ext/v8/upstream/3.1.8/src/heap-profiler.cc +1128 -0
- data/ext/v8/upstream/3.1.8/src/heap-profiler.h +381 -0
- data/ext/v8/upstream/3.1.8/src/heap.cc +5610 -0
- data/ext/v8/upstream/3.1.8/src/heap.h +2218 -0
- data/ext/v8/upstream/3.1.8/src/hydrogen-instructions.cc +1490 -0
- data/ext/v8/upstream/3.1.8/src/hydrogen-instructions.h +3493 -0
- data/ext/v8/upstream/3.1.8/src/hydrogen.cc +6056 -0
- data/ext/v8/upstream/3.1.8/src/hydrogen.h +1091 -0
- data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32-inl.h +429 -0
- data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32.cc +2800 -0
- data/ext/v8/upstream/3.1.8/src/ia32/assembler-ia32.h +1093 -0
- data/ext/v8/upstream/3.1.8/src/ia32/builtins-ia32.cc +1590 -0
- data/ext/v8/upstream/3.1.8/src/ia32/code-stubs-ia32.cc +6624 -0
- data/ext/v8/upstream/3.1.8/src/ia32/code-stubs-ia32.h +536 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/codegen-ia32-inl.h +0 -0
- data/ext/v8/upstream/3.1.8/src/ia32/codegen-ia32.cc +10354 -0
- data/ext/v8/upstream/3.1.8/src/ia32/codegen-ia32.h +798 -0
- data/ext/v8/upstream/3.1.8/src/ia32/cpu-ia32.cc +87 -0
- data/ext/v8/upstream/3.1.8/src/ia32/debug-ia32.cc +309 -0
- data/ext/v8/upstream/3.1.8/src/ia32/deoptimizer-ia32.cc +664 -0
- data/ext/v8/upstream/3.1.8/src/ia32/disasm-ia32.cc +1597 -0
- data/ext/v8/upstream/3.1.8/src/ia32/frames-ia32.cc +45 -0
- data/ext/v8/upstream/3.1.8/src/ia32/frames-ia32.h +140 -0
- data/ext/v8/upstream/3.1.8/src/ia32/full-codegen-ia32.cc +4278 -0
- data/ext/v8/upstream/3.1.8/src/ia32/ic-ia32.cc +1786 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/jump-target-ia32.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/ia32/lithium-codegen-ia32.cc +3880 -0
- data/ext/v8/upstream/3.1.8/src/ia32/lithium-codegen-ia32.h +309 -0
- data/ext/v8/upstream/3.1.8/src/ia32/lithium-gap-resolver-ia32.cc +460 -0
- data/ext/v8/upstream/3.1.8/src/ia32/lithium-gap-resolver-ia32.h +110 -0
- data/ext/v8/upstream/3.1.8/src/ia32/lithium-ia32.cc +2095 -0
- data/ext/v8/upstream/3.1.8/src/ia32/lithium-ia32.h +2127 -0
- data/ext/v8/upstream/3.1.8/src/ia32/macro-assembler-ia32.cc +2031 -0
- data/ext/v8/upstream/3.1.8/src/ia32/macro-assembler-ia32.h +798 -0
- data/ext/v8/upstream/3.1.8/src/ia32/regexp-macro-assembler-ia32.cc +1253 -0
- data/ext/v8/upstream/3.1.8/src/ia32/regexp-macro-assembler-ia32.h +215 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/register-allocator-ia32-inl.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/register-allocator-ia32.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/register-allocator-ia32.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/ia32/simulator-ia32.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/ia32/simulator-ia32.h +72 -0
- data/ext/v8/upstream/3.1.8/src/ia32/stub-cache-ia32.cc +3732 -0
- data/ext/v8/upstream/3.1.8/src/ia32/virtual-frame-ia32.cc +1360 -0
- data/ext/v8/upstream/3.1.8/src/ia32/virtual-frame-ia32.h +646 -0
- data/ext/v8/upstream/3.1.8/src/ic-inl.h +129 -0
- data/ext/v8/upstream/3.1.8/src/ic.cc +2333 -0
- data/ext/v8/upstream/3.1.8/src/ic.h +639 -0
- data/ext/v8/upstream/3.1.8/src/inspector.cc +63 -0
- data/ext/v8/upstream/3.1.8/src/inspector.h +62 -0
- data/ext/v8/upstream/3.1.8/src/interpreter-irregexp.cc +655 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/interpreter-irregexp.h +0 -0
- data/ext/v8/upstream/3.1.8/src/json.js +342 -0
- data/ext/v8/upstream/3.1.8/src/jsregexp.cc +5340 -0
- data/ext/v8/upstream/3.1.8/src/jsregexp.h +1484 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/jump-target-heavy-inl.h +0 -0
- data/ext/v8/upstream/3.1.8/src/jump-target-heavy.cc +430 -0
- data/ext/v8/upstream/3.1.8/src/jump-target-heavy.h +244 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/jump-target-inl.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/jump-target-light-inl.h +0 -0
- data/ext/v8/upstream/3.1.8/src/jump-target-light.cc +111 -0
- data/ext/v8/upstream/3.1.8/src/jump-target-light.h +193 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/jump-target.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/jump-target.h +0 -0
- data/ext/v8/upstream/3.1.8/src/list-inl.h +206 -0
- data/ext/v8/upstream/3.1.8/src/list.h +164 -0
- data/ext/v8/upstream/3.1.8/src/lithium-allocator-inl.h +140 -0
- data/ext/v8/upstream/3.1.8/src/lithium-allocator.cc +2093 -0
- data/ext/v8/upstream/3.1.8/src/lithium-allocator.h +644 -0
- data/ext/v8/upstream/3.1.8/src/lithium.cc +168 -0
- data/ext/v8/upstream/3.1.8/src/lithium.h +592 -0
- data/ext/v8/upstream/3.1.8/src/liveedit-debugger.js +1082 -0
- data/ext/v8/upstream/3.1.8/src/liveedit.cc +1650 -0
- data/ext/v8/upstream/3.1.8/src/liveedit.h +174 -0
- data/ext/v8/upstream/3.1.8/src/liveobjectlist-inl.h +126 -0
- data/ext/v8/upstream/3.1.8/src/liveobjectlist.cc +2527 -0
- data/ext/v8/upstream/3.1.8/src/liveobjectlist.h +322 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/log-inl.h +0 -0
- data/ext/v8/upstream/3.1.8/src/log-utils.cc +336 -0
- data/ext/v8/upstream/3.1.8/src/log-utils.h +232 -0
- data/ext/v8/upstream/3.1.8/src/log.cc +1608 -0
- data/ext/v8/upstream/3.1.8/src/log.h +379 -0
- data/ext/v8/upstream/3.1.8/src/macro-assembler.h +120 -0
- data/ext/v8/upstream/3.1.8/src/macros.py +178 -0
- data/ext/v8/upstream/3.1.8/src/mark-compact.cc +2957 -0
- data/ext/v8/upstream/3.1.8/src/mark-compact.h +433 -0
- data/ext/v8/upstream/3.1.8/src/math.js +264 -0
- data/ext/v8/upstream/3.1.8/src/memory.h +82 -0
- data/ext/v8/upstream/3.1.8/src/messages.cc +164 -0
- data/ext/v8/upstream/3.1.8/src/messages.h +114 -0
- data/ext/v8/upstream/3.1.8/src/messages.js +1071 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/assembler-mips-inl.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/assembler-mips.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/mips/assembler-mips.h +667 -0
- data/ext/v8/upstream/3.1.8/src/mips/builtins-mips.cc +205 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/codegen-mips-inl.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/codegen-mips.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/mips/codegen-mips.h +431 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/constants-mips.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/constants-mips.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/cpu-mips.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/mips/debug-mips.cc +127 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/disasm-mips.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/fast-codegen-mips.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/mips/frames-mips.cc +96 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/frames-mips.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/full-codegen-mips.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/mips/ic-mips.cc +208 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/jump-target-mips.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/macro-assembler-mips.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/macro-assembler-mips.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/register-allocator-mips-inl.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/register-allocator-mips.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/register-allocator-mips.h +0 -0
- data/ext/v8/upstream/3.1.8/src/mips/simulator-mips.cc +1650 -0
- data/ext/v8/upstream/3.1.8/src/mips/simulator-mips.h +311 -0
- data/ext/v8/upstream/3.1.8/src/mips/stub-cache-mips.cc +418 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/virtual-frame-mips.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mips/virtual-frame-mips.h +0 -0
- data/ext/v8/upstream/3.1.8/src/mirror-debugger.js +2380 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/mksnapshot.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/natives.h +0 -0
- data/ext/v8/upstream/3.1.8/src/objects-debug.cc +722 -0
- data/ext/v8/upstream/3.1.8/src/objects-inl.h +3946 -0
- data/ext/v8/upstream/3.1.8/src/objects-printer.cc +801 -0
- data/ext/v8/upstream/3.1.8/src/objects-visiting.cc +142 -0
- data/ext/v8/upstream/3.1.8/src/objects-visiting.h +401 -0
- data/ext/v8/upstream/3.1.8/src/objects.cc +10044 -0
- data/ext/v8/upstream/3.1.8/src/objects.h +6571 -0
- data/ext/v8/upstream/3.1.8/src/parser.cc +5165 -0
- data/ext/v8/upstream/3.1.8/src/parser.h +802 -0
- data/ext/v8/upstream/3.1.8/src/platform-cygwin.cc +745 -0
- data/ext/v8/upstream/3.1.8/src/platform-freebsd.cc +702 -0
- data/ext/v8/upstream/3.1.8/src/platform-linux.cc +981 -0
- data/ext/v8/upstream/3.1.8/src/platform-macos.cc +732 -0
- data/ext/v8/upstream/3.1.8/src/platform-nullos.cc +498 -0
- data/ext/v8/upstream/3.1.8/src/platform-openbsd.cc +657 -0
- data/ext/v8/upstream/3.1.8/src/platform-posix.cc +399 -0
- data/ext/v8/upstream/3.1.8/src/platform-solaris.cc +714 -0
- data/ext/v8/upstream/3.1.8/src/platform-win32.cc +1974 -0
- data/ext/v8/upstream/3.1.8/src/platform.h +636 -0
- data/ext/v8/upstream/3.1.8/src/preparse-data.cc +183 -0
- data/ext/v8/upstream/3.1.8/src/preparse-data.h +249 -0
- data/ext/v8/upstream/3.1.8/src/preparser-api.cc +213 -0
- data/ext/v8/upstream/3.1.8/src/preparser.cc +1205 -0
- data/ext/v8/upstream/3.1.8/src/preparser.h +278 -0
- data/ext/v8/upstream/3.1.8/src/prettyprinter.cc +1539 -0
- data/ext/v8/upstream/3.1.8/src/prettyprinter.h +223 -0
- data/ext/v8/upstream/3.1.8/src/profile-generator-inl.h +128 -0
- data/ext/v8/upstream/3.1.8/src/profile-generator.cc +2899 -0
- data/ext/v8/upstream/3.1.8/src/profile-generator.h +1151 -0
- data/ext/v8/upstream/3.1.8/src/property.cc +96 -0
- data/ext/v8/upstream/3.1.8/src/property.h +337 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/regexp-macro-assembler-irregexp-inl.h +0 -0
- data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler-irregexp.cc +470 -0
- data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler-irregexp.h +142 -0
- data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler-tracer.cc +373 -0
- data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler-tracer.h +104 -0
- data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler.cc +257 -0
- data/ext/v8/upstream/3.1.8/src/regexp-macro-assembler.h +231 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/regexp-stack.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/regexp-stack.h +0 -0
- data/ext/v8/upstream/3.1.8/src/regexp.js +483 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/register-allocator-inl.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/register-allocator.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/register-allocator.h +0 -0
- data/ext/v8/upstream/3.1.8/src/rewriter.cc +1023 -0
- data/ext/v8/upstream/3.1.8/src/rewriter.h +59 -0
- data/ext/v8/upstream/3.1.8/src/runtime-profiler.cc +443 -0
- data/ext/v8/upstream/3.1.8/src/runtime-profiler.h +77 -0
- data/ext/v8/upstream/3.1.8/src/runtime.cc +11592 -0
- data/ext/v8/upstream/3.1.8/src/runtime.h +582 -0
- data/ext/v8/upstream/3.1.8/src/runtime.js +643 -0
- data/ext/v8/upstream/3.1.8/src/safepoint-table.cc +253 -0
- data/ext/v8/upstream/3.1.8/src/safepoint-table.h +263 -0
- data/ext/v8/upstream/3.1.8/src/scanner-base.cc +971 -0
- data/ext/v8/upstream/3.1.8/src/scanner-base.h +653 -0
- data/ext/v8/upstream/3.1.8/src/scanner.cc +586 -0
- data/ext/v8/upstream/3.1.8/src/scanner.h +194 -0
- data/ext/v8/upstream/3.1.8/src/scopeinfo.cc +636 -0
- data/ext/v8/upstream/3.1.8/src/scopeinfo.h +238 -0
- data/ext/v8/upstream/3.1.8/src/scopes.cc +1063 -0
- data/ext/v8/upstream/3.1.8/src/scopes.h +494 -0
- data/ext/v8/upstream/3.1.8/src/serialize.cc +1535 -0
- data/ext/v8/upstream/3.1.8/src/serialize.h +584 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/shell.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/simulator.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/smart-pointer.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/snapshot-common.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/snapshot-empty.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/snapshot.h +0 -0
- data/ext/v8/upstream/3.1.8/src/spaces-inl.h +524 -0
- data/ext/v8/upstream/3.1.8/src/spaces.cc +3254 -0
- data/ext/v8/upstream/3.1.8/src/spaces.h +2362 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/splay-tree-inl.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/splay-tree.h +0 -0
- data/ext/v8/upstream/3.1.8/src/string-search.cc +40 -0
- data/ext/v8/upstream/3.1.8/src/string-search.h +567 -0
- data/ext/v8/upstream/3.1.8/src/string-stream.cc +584 -0
- data/ext/v8/upstream/3.1.8/src/string-stream.h +191 -0
- data/ext/v8/upstream/3.1.8/src/string.js +915 -0
- data/ext/v8/upstream/3.1.8/src/strtod.cc +440 -0
- data/ext/v8/upstream/3.1.8/src/strtod.h +40 -0
- data/ext/v8/upstream/3.1.8/src/stub-cache.cc +1878 -0
- data/ext/v8/upstream/3.1.8/src/stub-cache.h +849 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/third_party/valgrind/valgrind.h +0 -0
- data/ext/v8/upstream/3.1.8/src/token.cc +63 -0
- data/ext/v8/upstream/3.1.8/src/token.h +288 -0
- data/ext/v8/upstream/3.1.8/src/top.cc +1152 -0
- data/ext/v8/upstream/3.1.8/src/top.h +608 -0
- data/ext/v8/upstream/3.1.8/src/type-info.cc +406 -0
- data/ext/v8/upstream/3.1.8/src/type-info.h +283 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/unbound-queue-inl.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/unbound-queue.h +0 -0
- data/ext/v8/upstream/3.1.8/src/unicode-inl.h +238 -0
- data/ext/v8/upstream/3.1.8/src/unicode.cc +1624 -0
- data/ext/v8/upstream/3.1.8/src/unicode.h +280 -0
- data/ext/v8/upstream/3.1.8/src/uri.js +402 -0
- data/ext/v8/upstream/3.1.8/src/utils.cc +371 -0
- data/ext/v8/upstream/3.1.8/src/utils.h +793 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/v8-counters.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/v8-counters.h +290 -0
- data/ext/v8/upstream/3.1.8/src/v8.cc +270 -0
- data/ext/v8/upstream/3.1.8/src/v8.h +127 -0
- data/ext/v8/upstream/3.1.8/src/v8checks.h +64 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/v8dll-main.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/v8globals.h +480 -0
- data/ext/v8/upstream/3.1.8/src/v8natives.js +1252 -0
- data/ext/v8/upstream/3.1.8/src/v8preparserdll-main.cc +39 -0
- data/ext/v8/upstream/3.1.8/src/v8threads.cc +440 -0
- data/ext/v8/upstream/3.1.8/src/v8threads.h +157 -0
- data/ext/v8/upstream/3.1.8/src/v8utils.h +354 -0
- data/ext/v8/upstream/3.1.8/src/variables.cc +132 -0
- data/ext/v8/upstream/3.1.8/src/variables.h +212 -0
- data/ext/v8/upstream/3.1.8/src/version.cc +95 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/version.h +0 -0
- data/ext/v8/upstream/3.1.8/src/virtual-frame-heavy-inl.h +190 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/virtual-frame-heavy.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/virtual-frame-inl.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/virtual-frame-light-inl.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/virtual-frame-light.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/virtual-frame.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/virtual-frame.h +59 -0
- data/ext/v8/upstream/3.1.8/src/vm-state-inl.h +134 -0
- data/ext/v8/upstream/3.1.8/src/vm-state.h +68 -0
- data/ext/v8/upstream/3.1.8/src/win32-headers.h +95 -0
- data/ext/v8/upstream/3.1.8/src/x64/assembler-x64-inl.h +455 -0
- data/ext/v8/upstream/3.1.8/src/x64/assembler-x64.cc +3162 -0
- data/ext/v8/upstream/3.1.8/src/x64/assembler-x64.h +1584 -0
- data/ext/v8/upstream/3.1.8/src/x64/builtins-x64.cc +1492 -0
- data/ext/v8/upstream/3.1.8/src/x64/code-stubs-x64.cc +5150 -0
- data/ext/v8/upstream/3.1.8/src/x64/code-stubs-x64.h +519 -0
- data/ext/v8/upstream/3.1.8/src/x64/codegen-x64-inl.h +46 -0
- data/ext/v8/upstream/3.1.8/src/x64/codegen-x64.cc +8835 -0
- data/ext/v8/upstream/3.1.8/src/x64/codegen-x64.h +750 -0
- data/ext/v8/upstream/3.1.8/src/x64/cpu-x64.cc +86 -0
- data/ext/v8/upstream/3.1.8/src/x64/debug-x64.cc +316 -0
- data/ext/v8/upstream/3.1.8/src/x64/deoptimizer-x64.cc +781 -0
- data/ext/v8/upstream/3.1.8/src/x64/disasm-x64.cc +1737 -0
- data/ext/v8/upstream/3.1.8/src/x64/frames-x64.cc +45 -0
- data/ext/v8/upstream/3.1.8/src/x64/frames-x64.h +130 -0
- data/ext/v8/upstream/3.1.8/src/x64/full-codegen-x64.cc +3984 -0
- data/ext/v8/upstream/3.1.8/src/x64/ic-x64.cc +1761 -0
- data/ext/v8/upstream/3.1.8/src/x64/jump-target-x64.cc +437 -0
- data/ext/v8/upstream/3.1.8/src/x64/lithium-codegen-x64.cc +3639 -0
- data/ext/v8/upstream/3.1.8/src/x64/lithium-codegen-x64.h +305 -0
- data/ext/v8/upstream/3.1.8/src/x64/lithium-gap-resolver-x64.cc +320 -0
- data/ext/v8/upstream/3.1.8/src/x64/lithium-gap-resolver-x64.h +74 -0
- data/ext/v8/upstream/3.1.8/src/x64/lithium-x64.cc +2044 -0
- data/ext/v8/upstream/3.1.8/src/x64/lithium-x64.h +2052 -0
- data/ext/v8/upstream/3.1.8/src/x64/macro-assembler-x64.cc +2660 -0
- data/ext/v8/upstream/3.1.8/src/x64/macro-assembler-x64.h +1852 -0
- data/ext/v8/upstream/3.1.8/src/x64/regexp-macro-assembler-x64.cc +1382 -0
- data/ext/v8/upstream/3.1.8/src/x64/regexp-macro-assembler-x64.h +278 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/x64/register-allocator-x64-inl.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/x64/register-allocator-x64.cc +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/x64/register-allocator-x64.h +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/src/x64/simulator-x64.cc +0 -0
- data/ext/v8/upstream/3.1.8/src/x64/simulator-x64.h +71 -0
- data/ext/v8/upstream/3.1.8/src/x64/stub-cache-x64.cc +3509 -0
- data/ext/v8/upstream/3.1.8/src/x64/virtual-frame-x64.cc +1292 -0
- data/ext/v8/upstream/3.1.8/src/x64/virtual-frame-x64.h +593 -0
- data/ext/v8/upstream/3.1.8/src/zone-inl.h +83 -0
- data/ext/v8/upstream/3.1.8/src/zone.cc +195 -0
- data/ext/v8/upstream/3.1.8/src/zone.h +233 -0
- data/ext/v8/upstream/3.1.8/tools/codemap.js +265 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/consarray.js +0 -0
- data/ext/v8/upstream/3.1.8/tools/csvparser.js +78 -0
- data/ext/v8/upstream/3.1.8/tools/disasm.py +92 -0
- data/ext/v8/upstream/3.1.8/tools/gc-nvp-trace-processor.py +328 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/generate-ten-powers.scm +0 -0
- data/ext/v8/upstream/3.1.8/tools/grokdump.py +840 -0
- data/ext/v8/upstream/3.1.8/tools/gyp/v8.gyp +869 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/js2c.py +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/jsmin.py +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/linux-tick-processor +0 -0
- data/ext/v8/upstream/3.1.8/tools/ll_prof.py +919 -0
- data/ext/v8/upstream/3.1.8/tools/logreader.js +185 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/mac-nm +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/mac-tick-processor +0 -0
- data/ext/v8/upstream/3.1.8/tools/oom_dump/README +31 -0
- data/ext/v8/upstream/3.1.8/tools/oom_dump/SConstruct +42 -0
- data/ext/v8/upstream/3.1.8/tools/oom_dump/oom_dump.cc +288 -0
- data/ext/v8/upstream/3.1.8/tools/presubmit.py +305 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/process-heap-prof.py +0 -0
- data/ext/v8/upstream/3.1.8/tools/profile.js +751 -0
- data/ext/v8/upstream/3.1.8/tools/profile_view.js +219 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/run-valgrind.py +0 -0
- data/ext/v8/upstream/3.1.8/tools/splaytree.js +316 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/stats-viewer.py +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/tickprocessor-driver.js +0 -0
- data/ext/v8/upstream/3.1.8/tools/tickprocessor.js +863 -0
- data/ext/v8/upstream/3.1.8/tools/utils.py +96 -0
- data/ext/v8/upstream/3.1.8/tools/visual_studio/README.txt +70 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/arm.vsprops +0 -0
- data/ext/v8/upstream/3.1.8/tools/visual_studio/common.vsprops +34 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/d8.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/d8_arm.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/d8_x64.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/d8js2c.cmd +0 -0
- data/ext/v8/upstream/3.1.8/tools/visual_studio/debug.vsprops +17 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/ia32.vsprops +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/js2c.cmd +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/release.vsprops +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8.sln +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_arm.sln +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_arm.vcproj +0 -0
- data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base.vcproj +1296 -0
- data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base_arm.vcproj +1234 -0
- data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_base_x64.vcproj +1296 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_cctest.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_cctest_arm.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_cctest_x64.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_mksnapshot.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_mksnapshot_x64.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_process_sample.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_process_sample_arm.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_process_sample_x64.vcproj +0 -0
- data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_shell_sample.vcproj +147 -0
- data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_shell_sample_arm.vcproj +147 -0
- data/ext/v8/upstream/3.1.8/tools/visual_studio/v8_shell_sample_x64.vcproj +163 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_snapshot.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_snapshot_cc.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_snapshot_cc_x64.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_snapshot_x64.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_x64.sln +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/v8_x64.vcproj +0 -0
- data/ext/v8/upstream/{2.3.3 → 3.1.8}/tools/visual_studio/x64.vsprops +0 -0
- data/ext/v8/upstream/3.1.8/tools/windows-tick-processor.bat +30 -0
- data/ext/v8/upstream/Makefile +2 -1
- data/ext/v8/v8_template.cpp +2 -2
- data/lib/v8/version.rb +1 -1
- data/spec/redjs/jsapi_spec.rb +2 -2
- metadata +552 -490
- data/ext/v8/upstream/2.3.3/.gitignore +0 -26
- data/ext/v8/upstream/2.3.3/AUTHORS +0 -31
- data/ext/v8/upstream/2.3.3/ChangeLog +0 -1916
- data/ext/v8/upstream/2.3.3/LICENSE +0 -55
- data/ext/v8/upstream/2.3.3/SConstruct +0 -1154
- data/ext/v8/upstream/2.3.3/include/v8-debug.h +0 -381
- data/ext/v8/upstream/2.3.3/include/v8-profiler.h +0 -353
- data/ext/v8/upstream/2.3.3/include/v8.h +0 -3616
- data/ext/v8/upstream/2.3.3/src/SConscript +0 -330
- data/ext/v8/upstream/2.3.3/src/accessors.cc +0 -661
- data/ext/v8/upstream/2.3.3/src/accessors.h +0 -114
- data/ext/v8/upstream/2.3.3/src/allocation.cc +0 -198
- data/ext/v8/upstream/2.3.3/src/allocation.h +0 -169
- data/ext/v8/upstream/2.3.3/src/api.cc +0 -4795
- data/ext/v8/upstream/2.3.3/src/api.h +0 -485
- data/ext/v8/upstream/2.3.3/src/apiutils.h +0 -69
- data/ext/v8/upstream/2.3.3/src/arguments.h +0 -96
- data/ext/v8/upstream/2.3.3/src/arm/assembler-arm-inl.h +0 -305
- data/ext/v8/upstream/2.3.3/src/arm/assembler-arm.cc +0 -2580
- data/ext/v8/upstream/2.3.3/src/arm/assembler-arm.h +0 -1275
- data/ext/v8/upstream/2.3.3/src/arm/builtins-arm.cc +0 -1320
- data/ext/v8/upstream/2.3.3/src/arm/codegen-arm-inl.h +0 -48
- data/ext/v8/upstream/2.3.3/src/arm/codegen-arm.cc +0 -11398
- data/ext/v8/upstream/2.3.3/src/arm/codegen-arm.h +0 -1102
- data/ext/v8/upstream/2.3.3/src/arm/constants-arm.cc +0 -154
- data/ext/v8/upstream/2.3.3/src/arm/constants-arm.h +0 -388
- data/ext/v8/upstream/2.3.3/src/arm/cpu-arm.cc +0 -142
- data/ext/v8/upstream/2.3.3/src/arm/debug-arm.cc +0 -309
- data/ext/v8/upstream/2.3.3/src/arm/disasm-arm.cc +0 -1459
- data/ext/v8/upstream/2.3.3/src/arm/fast-codegen-arm.cc +0 -241
- data/ext/v8/upstream/2.3.3/src/arm/frames-arm.cc +0 -123
- data/ext/v8/upstream/2.3.3/src/arm/frames-arm.h +0 -162
- data/ext/v8/upstream/2.3.3/src/arm/full-codegen-arm.cc +0 -3178
- data/ext/v8/upstream/2.3.3/src/arm/ic-arm.cc +0 -2258
- data/ext/v8/upstream/2.3.3/src/arm/jump-target-arm.cc +0 -164
- data/ext/v8/upstream/2.3.3/src/arm/macro-assembler-arm.cc +0 -1892
- data/ext/v8/upstream/2.3.3/src/arm/macro-assembler-arm.h +0 -727
- data/ext/v8/upstream/2.3.3/src/arm/regexp-macro-assembler-arm.cc +0 -1261
- data/ext/v8/upstream/2.3.3/src/arm/regexp-macro-assembler-arm.h +0 -266
- data/ext/v8/upstream/2.3.3/src/arm/simulator-arm.cc +0 -2822
- data/ext/v8/upstream/2.3.3/src/arm/simulator-arm.h +0 -361
- data/ext/v8/upstream/2.3.3/src/arm/stub-cache-arm.cc +0 -2387
- data/ext/v8/upstream/2.3.3/src/arm/virtual-frame-arm.cc +0 -834
- data/ext/v8/upstream/2.3.3/src/arm/virtual-frame-arm.h +0 -519
- data/ext/v8/upstream/2.3.3/src/array.js +0 -1127
- data/ext/v8/upstream/2.3.3/src/assembler.cc +0 -801
- data/ext/v8/upstream/2.3.3/src/assembler.h +0 -573
- data/ext/v8/upstream/2.3.3/src/ast-inl.h +0 -81
- data/ext/v8/upstream/2.3.3/src/ast.cc +0 -1152
- data/ext/v8/upstream/2.3.3/src/ast.h +0 -2106
- data/ext/v8/upstream/2.3.3/src/bootstrapper.cc +0 -1819
- data/ext/v8/upstream/2.3.3/src/builtins.cc +0 -1529
- data/ext/v8/upstream/2.3.3/src/builtins.h +0 -263
- data/ext/v8/upstream/2.3.3/src/bytecodes-irregexp.h +0 -104
- data/ext/v8/upstream/2.3.3/src/cached-powers.h +0 -119
- data/ext/v8/upstream/2.3.3/src/char-predicates-inl.h +0 -86
- data/ext/v8/upstream/2.3.3/src/checks.cc +0 -100
- data/ext/v8/upstream/2.3.3/src/checks.h +0 -310
- data/ext/v8/upstream/2.3.3/src/circular-queue.cc +0 -121
- data/ext/v8/upstream/2.3.3/src/code-stubs.cc +0 -177
- data/ext/v8/upstream/2.3.3/src/code-stubs.h +0 -177
- data/ext/v8/upstream/2.3.3/src/codegen-inl.h +0 -60
- data/ext/v8/upstream/2.3.3/src/codegen.cc +0 -516
- data/ext/v8/upstream/2.3.3/src/codegen.h +0 -897
- data/ext/v8/upstream/2.3.3/src/compilation-cache.cc +0 -562
- data/ext/v8/upstream/2.3.3/src/compilation-cache.h +0 -102
- data/ext/v8/upstream/2.3.3/src/compiler.cc +0 -654
- data/ext/v8/upstream/2.3.3/src/compiler.h +0 -299
- data/ext/v8/upstream/2.3.3/src/contexts.cc +0 -256
- data/ext/v8/upstream/2.3.3/src/contexts.h +0 -342
- data/ext/v8/upstream/2.3.3/src/conversions.cc +0 -1119
- data/ext/v8/upstream/2.3.3/src/conversions.h +0 -123
- data/ext/v8/upstream/2.3.3/src/counters.h +0 -239
- data/ext/v8/upstream/2.3.3/src/cpu-profiler-inl.h +0 -100
- data/ext/v8/upstream/2.3.3/src/cpu-profiler.cc +0 -538
- data/ext/v8/upstream/2.3.3/src/cpu-profiler.h +0 -285
- data/ext/v8/upstream/2.3.3/src/d8-debug.cc +0 -356
- data/ext/v8/upstream/2.3.3/src/d8-debug.h +0 -155
- data/ext/v8/upstream/2.3.3/src/d8.cc +0 -783
- data/ext/v8/upstream/2.3.3/src/d8.h +0 -227
- data/ext/v8/upstream/2.3.3/src/d8.js +0 -1683
- data/ext/v8/upstream/2.3.3/src/data-flow.cc +0 -758
- data/ext/v8/upstream/2.3.3/src/data-flow.h +0 -278
- data/ext/v8/upstream/2.3.3/src/date.js +0 -1059
- data/ext/v8/upstream/2.3.3/src/dateparser-inl.h +0 -123
- data/ext/v8/upstream/2.3.3/src/dateparser.h +0 -244
- data/ext/v8/upstream/2.3.3/src/debug-agent.cc +0 -427
- data/ext/v8/upstream/2.3.3/src/debug-agent.h +0 -129
- data/ext/v8/upstream/2.3.3/src/debug-debugger.js +0 -2227
- data/ext/v8/upstream/2.3.3/src/debug.cc +0 -3005
- data/ext/v8/upstream/2.3.3/src/debug.h +0 -993
- data/ext/v8/upstream/2.3.3/src/disassembler.cc +0 -312
- data/ext/v8/upstream/2.3.3/src/double.h +0 -169
- data/ext/v8/upstream/2.3.3/src/dtoa-config.c +0 -92
- data/ext/v8/upstream/2.3.3/src/dtoa.cc +0 -77
- data/ext/v8/upstream/2.3.3/src/dtoa.h +0 -81
- data/ext/v8/upstream/2.3.3/src/execution.cc +0 -809
- data/ext/v8/upstream/2.3.3/src/execution.h +0 -336
- data/ext/v8/upstream/2.3.3/src/factory.cc +0 -1003
- data/ext/v8/upstream/2.3.3/src/factory.h +0 -410
- data/ext/v8/upstream/2.3.3/src/fast-codegen.cc +0 -746
- data/ext/v8/upstream/2.3.3/src/fast-codegen.h +0 -161
- data/ext/v8/upstream/2.3.3/src/fast-dtoa.cc +0 -505
- data/ext/v8/upstream/2.3.3/src/fast-dtoa.h +0 -58
- data/ext/v8/upstream/2.3.3/src/flag-definitions.h +0 -455
- data/ext/v8/upstream/2.3.3/src/flags.cc +0 -551
- data/ext/v8/upstream/2.3.3/src/flags.h +0 -81
- data/ext/v8/upstream/2.3.3/src/flow-graph.cc +0 -763
- data/ext/v8/upstream/2.3.3/src/flow-graph.h +0 -180
- data/ext/v8/upstream/2.3.3/src/frame-element.h +0 -273
- data/ext/v8/upstream/2.3.3/src/frames-inl.h +0 -217
- data/ext/v8/upstream/2.3.3/src/frames.cc +0 -826
- data/ext/v8/upstream/2.3.3/src/frames.h +0 -682
- data/ext/v8/upstream/2.3.3/src/full-codegen.cc +0 -1443
- data/ext/v8/upstream/2.3.3/src/full-codegen.h +0 -548
- data/ext/v8/upstream/2.3.3/src/func-name-inferrer.cc +0 -76
- data/ext/v8/upstream/2.3.3/src/func-name-inferrer.h +0 -135
- data/ext/v8/upstream/2.3.3/src/global-handles.cc +0 -520
- data/ext/v8/upstream/2.3.3/src/global-handles.h +0 -180
- data/ext/v8/upstream/2.3.3/src/globals.h +0 -669
- data/ext/v8/upstream/2.3.3/src/handles-inl.h +0 -76
- data/ext/v8/upstream/2.3.3/src/handles.cc +0 -825
- data/ext/v8/upstream/2.3.3/src/handles.h +0 -393
- data/ext/v8/upstream/2.3.3/src/hashmap.cc +0 -226
- data/ext/v8/upstream/2.3.3/src/hashmap.h +0 -120
- data/ext/v8/upstream/2.3.3/src/heap-inl.h +0 -493
- data/ext/v8/upstream/2.3.3/src/heap-profiler.cc +0 -779
- data/ext/v8/upstream/2.3.3/src/heap-profiler.h +0 -323
- data/ext/v8/upstream/2.3.3/src/heap.cc +0 -4994
- data/ext/v8/upstream/2.3.3/src/heap.h +0 -1984
- data/ext/v8/upstream/2.3.3/src/ia32/assembler-ia32-inl.h +0 -360
- data/ext/v8/upstream/2.3.3/src/ia32/assembler-ia32.cc +0 -2600
- data/ext/v8/upstream/2.3.3/src/ia32/assembler-ia32.h +0 -969
- data/ext/v8/upstream/2.3.3/src/ia32/builtins-ia32.cc +0 -1261
- data/ext/v8/upstream/2.3.3/src/ia32/codegen-ia32.cc +0 -13968
- data/ext/v8/upstream/2.3.3/src/ia32/codegen-ia32.h +0 -1097
- data/ext/v8/upstream/2.3.3/src/ia32/cpu-ia32.cc +0 -83
- data/ext/v8/upstream/2.3.3/src/ia32/debug-ia32.cc +0 -309
- data/ext/v8/upstream/2.3.3/src/ia32/disasm-ia32.cc +0 -1471
- data/ext/v8/upstream/2.3.3/src/ia32/fast-codegen-ia32.cc +0 -954
- data/ext/v8/upstream/2.3.3/src/ia32/fast-codegen-ia32.h +0 -155
- data/ext/v8/upstream/2.3.3/src/ia32/frames-ia32.cc +0 -115
- data/ext/v8/upstream/2.3.3/src/ia32/frames-ia32.h +0 -135
- data/ext/v8/upstream/2.3.3/src/ia32/full-codegen-ia32.cc +0 -3281
- data/ext/v8/upstream/2.3.3/src/ia32/ic-ia32.cc +0 -1966
- data/ext/v8/upstream/2.3.3/src/ia32/macro-assembler-ia32.cc +0 -1610
- data/ext/v8/upstream/2.3.3/src/ia32/macro-assembler-ia32.h +0 -610
- data/ext/v8/upstream/2.3.3/src/ia32/regexp-macro-assembler-ia32.cc +0 -1247
- data/ext/v8/upstream/2.3.3/src/ia32/regexp-macro-assembler-ia32.h +0 -214
- data/ext/v8/upstream/2.3.3/src/ia32/simulator-ia32.h +0 -62
- data/ext/v8/upstream/2.3.3/src/ia32/stub-cache-ia32.cc +0 -2750
- data/ext/v8/upstream/2.3.3/src/ia32/virtual-frame-ia32.cc +0 -1334
- data/ext/v8/upstream/2.3.3/src/ia32/virtual-frame-ia32.h +0 -627
- data/ext/v8/upstream/2.3.3/src/ic-inl.h +0 -120
- data/ext/v8/upstream/2.3.3/src/ic.cc +0 -1827
- data/ext/v8/upstream/2.3.3/src/ic.h +0 -515
- data/ext/v8/upstream/2.3.3/src/interpreter-irregexp.cc +0 -646
- data/ext/v8/upstream/2.3.3/src/json.js +0 -268
- data/ext/v8/upstream/2.3.3/src/jsregexp.cc +0 -5283
- data/ext/v8/upstream/2.3.3/src/jsregexp.h +0 -1463
- data/ext/v8/upstream/2.3.3/src/jump-target-heavy.cc +0 -429
- data/ext/v8/upstream/2.3.3/src/jump-target-heavy.h +0 -244
- data/ext/v8/upstream/2.3.3/src/jump-target-light.cc +0 -110
- data/ext/v8/upstream/2.3.3/src/jump-target-light.h +0 -192
- data/ext/v8/upstream/2.3.3/src/list-inl.h +0 -166
- data/ext/v8/upstream/2.3.3/src/list.h +0 -159
- data/ext/v8/upstream/2.3.3/src/liveedit-debugger.js +0 -1057
- data/ext/v8/upstream/2.3.3/src/liveedit.cc +0 -1480
- data/ext/v8/upstream/2.3.3/src/liveedit.h +0 -170
- data/ext/v8/upstream/2.3.3/src/log-utils.cc +0 -497
- data/ext/v8/upstream/2.3.3/src/log-utils.h +0 -289
- data/ext/v8/upstream/2.3.3/src/log.cc +0 -1561
- data/ext/v8/upstream/2.3.3/src/log.h +0 -384
- data/ext/v8/upstream/2.3.3/src/macro-assembler.h +0 -86
- data/ext/v8/upstream/2.3.3/src/macros.py +0 -177
- data/ext/v8/upstream/2.3.3/src/mark-compact.cc +0 -2330
- data/ext/v8/upstream/2.3.3/src/mark-compact.h +0 -451
- data/ext/v8/upstream/2.3.3/src/math.js +0 -264
- data/ext/v8/upstream/2.3.3/src/memory.h +0 -74
- data/ext/v8/upstream/2.3.3/src/messages.cc +0 -183
- data/ext/v8/upstream/2.3.3/src/messages.h +0 -113
- data/ext/v8/upstream/2.3.3/src/messages.js +0 -982
- data/ext/v8/upstream/2.3.3/src/mips/assembler-mips.h +0 -668
- data/ext/v8/upstream/2.3.3/src/mips/builtins-mips.cc +0 -205
- data/ext/v8/upstream/2.3.3/src/mips/codegen-mips.h +0 -434
- data/ext/v8/upstream/2.3.3/src/mips/debug-mips.cc +0 -131
- data/ext/v8/upstream/2.3.3/src/mips/frames-mips.cc +0 -102
- data/ext/v8/upstream/2.3.3/src/mips/ic-mips.cc +0 -220
- data/ext/v8/upstream/2.3.3/src/mips/simulator-mips.cc +0 -1651
- data/ext/v8/upstream/2.3.3/src/mips/simulator-mips.h +0 -311
- data/ext/v8/upstream/2.3.3/src/mips/stub-cache-mips.cc +0 -403
- data/ext/v8/upstream/2.3.3/src/mirror-debugger.js +0 -2380
- data/ext/v8/upstream/2.3.3/src/objects-debug.cc +0 -1366
- data/ext/v8/upstream/2.3.3/src/objects-inl.h +0 -3333
- data/ext/v8/upstream/2.3.3/src/objects.cc +0 -8820
- data/ext/v8/upstream/2.3.3/src/objects.h +0 -5373
- data/ext/v8/upstream/2.3.3/src/oprofile-agent.cc +0 -108
- data/ext/v8/upstream/2.3.3/src/oprofile-agent.h +0 -77
- data/ext/v8/upstream/2.3.3/src/parser.cc +0 -5207
- data/ext/v8/upstream/2.3.3/src/parser.h +0 -197
- data/ext/v8/upstream/2.3.3/src/platform-freebsd.cc +0 -667
- data/ext/v8/upstream/2.3.3/src/platform-linux.cc +0 -862
- data/ext/v8/upstream/2.3.3/src/platform-macos.cc +0 -665
- data/ext/v8/upstream/2.3.3/src/platform-nullos.cc +0 -454
- data/ext/v8/upstream/2.3.3/src/platform-openbsd.cc +0 -622
- data/ext/v8/upstream/2.3.3/src/platform-posix.cc +0 -362
- data/ext/v8/upstream/2.3.3/src/platform-solaris.cc +0 -653
- data/ext/v8/upstream/2.3.3/src/platform-win32.cc +0 -1911
- data/ext/v8/upstream/2.3.3/src/platform.h +0 -577
- data/ext/v8/upstream/2.3.3/src/powers-ten.h +0 -2461
- data/ext/v8/upstream/2.3.3/src/prettyprinter.cc +0 -1531
- data/ext/v8/upstream/2.3.3/src/prettyprinter.h +0 -221
- data/ext/v8/upstream/2.3.3/src/profile-generator-inl.h +0 -148
- data/ext/v8/upstream/2.3.3/src/profile-generator.cc +0 -1830
- data/ext/v8/upstream/2.3.3/src/profile-generator.h +0 -853
- data/ext/v8/upstream/2.3.3/src/property.cc +0 -96
- data/ext/v8/upstream/2.3.3/src/property.h +0 -315
- data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler-irregexp.cc +0 -464
- data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler-irregexp.h +0 -141
- data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler-tracer.cc +0 -356
- data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler-tracer.h +0 -103
- data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler.cc +0 -261
- data/ext/v8/upstream/2.3.3/src/regexp-macro-assembler.h +0 -228
- data/ext/v8/upstream/2.3.3/src/regexp.js +0 -549
- data/ext/v8/upstream/2.3.3/src/rewriter.cc +0 -1038
- data/ext/v8/upstream/2.3.3/src/rewriter.h +0 -54
- data/ext/v8/upstream/2.3.3/src/runtime.cc +0 -10599
- data/ext/v8/upstream/2.3.3/src/runtime.h +0 -459
- data/ext/v8/upstream/2.3.3/src/runtime.js +0 -629
- data/ext/v8/upstream/2.3.3/src/scanner.cc +0 -1346
- data/ext/v8/upstream/2.3.3/src/scanner.h +0 -503
- data/ext/v8/upstream/2.3.3/src/scopeinfo.cc +0 -637
- data/ext/v8/upstream/2.3.3/src/scopeinfo.h +0 -233
- data/ext/v8/upstream/2.3.3/src/scopes.cc +0 -962
- data/ext/v8/upstream/2.3.3/src/scopes.h +0 -400
- data/ext/v8/upstream/2.3.3/src/serialize.cc +0 -1461
- data/ext/v8/upstream/2.3.3/src/serialize.h +0 -581
- data/ext/v8/upstream/2.3.3/src/spaces-inl.h +0 -483
- data/ext/v8/upstream/2.3.3/src/spaces.cc +0 -2901
- data/ext/v8/upstream/2.3.3/src/spaces.h +0 -2197
- data/ext/v8/upstream/2.3.3/src/string-stream.cc +0 -584
- data/ext/v8/upstream/2.3.3/src/string-stream.h +0 -189
- data/ext/v8/upstream/2.3.3/src/string.js +0 -1006
- data/ext/v8/upstream/2.3.3/src/stub-cache.cc +0 -1379
- data/ext/v8/upstream/2.3.3/src/stub-cache.h +0 -756
- data/ext/v8/upstream/2.3.3/src/third_party/dtoa/COPYING +0 -15
- data/ext/v8/upstream/2.3.3/src/third_party/dtoa/dtoa.c +0 -3334
- data/ext/v8/upstream/2.3.3/src/token.cc +0 -56
- data/ext/v8/upstream/2.3.3/src/token.h +0 -270
- data/ext/v8/upstream/2.3.3/src/top.cc +0 -1067
- data/ext/v8/upstream/2.3.3/src/top.h +0 -463
- data/ext/v8/upstream/2.3.3/src/type-info.cc +0 -53
- data/ext/v8/upstream/2.3.3/src/type-info.h +0 -244
- data/ext/v8/upstream/2.3.3/src/unicode-inl.h +0 -238
- data/ext/v8/upstream/2.3.3/src/unicode.cc +0 -749
- data/ext/v8/upstream/2.3.3/src/unicode.h +0 -279
- data/ext/v8/upstream/2.3.3/src/uri.js +0 -415
- data/ext/v8/upstream/2.3.3/src/utils.cc +0 -285
- data/ext/v8/upstream/2.3.3/src/utils.h +0 -745
- data/ext/v8/upstream/2.3.3/src/v8-counters.h +0 -250
- data/ext/v8/upstream/2.3.3/src/v8.cc +0 -228
- data/ext/v8/upstream/2.3.3/src/v8.h +0 -121
- data/ext/v8/upstream/2.3.3/src/v8natives.js +0 -1188
- data/ext/v8/upstream/2.3.3/src/v8threads.cc +0 -461
- data/ext/v8/upstream/2.3.3/src/v8threads.h +0 -159
- data/ext/v8/upstream/2.3.3/src/variables.cc +0 -119
- data/ext/v8/upstream/2.3.3/src/variables.h +0 -205
- data/ext/v8/upstream/2.3.3/src/version.cc +0 -88
- data/ext/v8/upstream/2.3.3/src/virtual-frame-heavy-inl.h +0 -192
- data/ext/v8/upstream/2.3.3/src/virtual-frame.h +0 -46
- data/ext/v8/upstream/2.3.3/src/vm-state-inl.h +0 -137
- data/ext/v8/upstream/2.3.3/src/vm-state.cc +0 -39
- data/ext/v8/upstream/2.3.3/src/vm-state.h +0 -77
- data/ext/v8/upstream/2.3.3/src/x64/assembler-x64-inl.h +0 -400
- data/ext/v8/upstream/2.3.3/src/x64/assembler-x64.cc +0 -2963
- data/ext/v8/upstream/2.3.3/src/x64/assembler-x64.h +0 -1438
- data/ext/v8/upstream/2.3.3/src/x64/builtins-x64.cc +0 -1296
- data/ext/v8/upstream/2.3.3/src/x64/codegen-x64-inl.h +0 -46
- data/ext/v8/upstream/2.3.3/src/x64/codegen-x64.cc +0 -12491
- data/ext/v8/upstream/2.3.3/src/x64/codegen-x64.h +0 -1090
- data/ext/v8/upstream/2.3.3/src/x64/cpu-x64.cc +0 -83
- data/ext/v8/upstream/2.3.3/src/x64/debug-x64.cc +0 -267
- data/ext/v8/upstream/2.3.3/src/x64/disasm-x64.cc +0 -1696
- data/ext/v8/upstream/2.3.3/src/x64/fast-codegen-x64.cc +0 -250
- data/ext/v8/upstream/2.3.3/src/x64/frames-x64.cc +0 -113
- data/ext/v8/upstream/2.3.3/src/x64/frames-x64.h +0 -125
- data/ext/v8/upstream/2.3.3/src/x64/full-codegen-x64.cc +0 -3270
- data/ext/v8/upstream/2.3.3/src/x64/ic-x64.cc +0 -1907
- data/ext/v8/upstream/2.3.3/src/x64/jump-target-x64.cc +0 -437
- data/ext/v8/upstream/2.3.3/src/x64/macro-assembler-x64.cc +0 -2793
- data/ext/v8/upstream/2.3.3/src/x64/macro-assembler-x64.h +0 -916
- data/ext/v8/upstream/2.3.3/src/x64/regexp-macro-assembler-x64.cc +0 -1374
- data/ext/v8/upstream/2.3.3/src/x64/regexp-macro-assembler-x64.h +0 -277
- data/ext/v8/upstream/2.3.3/src/x64/simulator-x64.h +0 -63
- data/ext/v8/upstream/2.3.3/src/x64/stub-cache-x64.cc +0 -2560
- data/ext/v8/upstream/2.3.3/src/x64/virtual-frame-x64.cc +0 -1264
- data/ext/v8/upstream/2.3.3/src/x64/virtual-frame-x64.h +0 -590
- data/ext/v8/upstream/2.3.3/src/zone-inl.h +0 -82
- data/ext/v8/upstream/2.3.3/src/zone.cc +0 -194
- data/ext/v8/upstream/2.3.3/src/zone.h +0 -221
- data/ext/v8/upstream/2.3.3/tools/codemap.js +0 -270
- data/ext/v8/upstream/2.3.3/tools/csvparser.js +0 -83
- data/ext/v8/upstream/2.3.3/tools/gc-nvp-trace-processor.py +0 -317
- data/ext/v8/upstream/2.3.3/tools/gyp/v8.gyp +0 -749
- data/ext/v8/upstream/2.3.3/tools/linux-tick-processor.py +0 -78
- data/ext/v8/upstream/2.3.3/tools/logreader.js +0 -338
- data/ext/v8/upstream/2.3.3/tools/oprofile/annotate +0 -7
- data/ext/v8/upstream/2.3.3/tools/oprofile/common +0 -19
- data/ext/v8/upstream/2.3.3/tools/oprofile/dump +0 -7
- data/ext/v8/upstream/2.3.3/tools/oprofile/report +0 -7
- data/ext/v8/upstream/2.3.3/tools/oprofile/reset +0 -7
- data/ext/v8/upstream/2.3.3/tools/oprofile/run +0 -14
- data/ext/v8/upstream/2.3.3/tools/oprofile/shutdown +0 -7
- data/ext/v8/upstream/2.3.3/tools/oprofile/start +0 -7
- data/ext/v8/upstream/2.3.3/tools/presubmit.py +0 -299
- data/ext/v8/upstream/2.3.3/tools/profile.js +0 -691
- data/ext/v8/upstream/2.3.3/tools/profile_view.js +0 -224
- data/ext/v8/upstream/2.3.3/tools/splaytree.js +0 -322
- data/ext/v8/upstream/2.3.3/tools/splaytree.py +0 -226
- data/ext/v8/upstream/2.3.3/tools/tickprocessor.js +0 -862
- data/ext/v8/upstream/2.3.3/tools/tickprocessor.py +0 -571
- data/ext/v8/upstream/2.3.3/tools/utils.py +0 -88
- data/ext/v8/upstream/2.3.3/tools/visual_studio/README.txt +0 -71
- data/ext/v8/upstream/2.3.3/tools/visual_studio/common.vsprops +0 -34
- data/ext/v8/upstream/2.3.3/tools/visual_studio/debug.vsprops +0 -17
- data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_base.vcproj +0 -1143
- data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_base_arm.vcproj +0 -1115
- data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_base_x64.vcproj +0 -1096
- data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_shell_sample.vcproj +0 -145
- data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_shell_sample_arm.vcproj +0 -145
- data/ext/v8/upstream/2.3.3/tools/visual_studio/v8_shell_sample_x64.vcproj +0 -161
- data/ext/v8/upstream/2.3.3/tools/windows-tick-processor.bat +0 -29
- data/ext/v8/upstream/2.3.3/tools/windows-tick-processor.py +0 -137
@@ -0,0 +1,2031 @@
|
|
1
|
+
// Copyright 2011 the V8 project authors. All rights reserved.
|
2
|
+
// Redistribution and use in source and binary forms, with or without
|
3
|
+
// modification, are permitted provided that the following conditions are
|
4
|
+
// met:
|
5
|
+
//
|
6
|
+
// * Redistributions of source code must retain the above copyright
|
7
|
+
// notice, this list of conditions and the following disclaimer.
|
8
|
+
// * Redistributions in binary form must reproduce the above
|
9
|
+
// copyright notice, this list of conditions and the following
|
10
|
+
// disclaimer in the documentation and/or other materials provided
|
11
|
+
// with the distribution.
|
12
|
+
// * Neither the name of Google Inc. nor the names of its
|
13
|
+
// contributors may be used to endorse or promote products derived
|
14
|
+
// from this software without specific prior written permission.
|
15
|
+
//
|
16
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
17
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
18
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
19
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
20
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
21
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
22
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
23
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
24
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
25
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
26
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27
|
+
|
28
|
+
#include "v8.h"
|
29
|
+
|
30
|
+
#if defined(V8_TARGET_ARCH_IA32)
|
31
|
+
|
32
|
+
#include "bootstrapper.h"
|
33
|
+
#include "codegen-inl.h"
|
34
|
+
#include "debug.h"
|
35
|
+
#include "runtime.h"
|
36
|
+
#include "serialize.h"
|
37
|
+
|
38
|
+
namespace v8 {
|
39
|
+
namespace internal {
|
40
|
+
|
41
|
+
// -------------------------------------------------------------------------
|
42
|
+
// MacroAssembler implementation.
|
43
|
+
|
44
|
+
MacroAssembler::MacroAssembler(void* buffer, int size)
|
45
|
+
: Assembler(buffer, size),
|
46
|
+
generating_stub_(false),
|
47
|
+
allow_stub_calls_(true),
|
48
|
+
code_object_(Heap::undefined_value()) {
|
49
|
+
}
|
50
|
+
|
51
|
+
|
52
|
+
void MacroAssembler::RecordWriteHelper(Register object,
|
53
|
+
Register addr,
|
54
|
+
Register scratch) {
|
55
|
+
if (FLAG_debug_code) {
|
56
|
+
// Check that the object is not in new space.
|
57
|
+
Label not_in_new_space;
|
58
|
+
InNewSpace(object, scratch, not_equal, ¬_in_new_space);
|
59
|
+
Abort("new-space object passed to RecordWriteHelper");
|
60
|
+
bind(¬_in_new_space);
|
61
|
+
}
|
62
|
+
|
63
|
+
// Compute the page start address from the heap object pointer, and reuse
|
64
|
+
// the 'object' register for it.
|
65
|
+
and_(object, ~Page::kPageAlignmentMask);
|
66
|
+
|
67
|
+
// Compute number of region covering addr. See Page::GetRegionNumberForAddress
|
68
|
+
// method for more details.
|
69
|
+
and_(addr, Page::kPageAlignmentMask);
|
70
|
+
shr(addr, Page::kRegionSizeLog2);
|
71
|
+
|
72
|
+
// Set dirty mark for region.
|
73
|
+
bts(Operand(object, Page::kDirtyFlagOffset), addr);
|
74
|
+
}
|
75
|
+
|
76
|
+
|
77
|
+
void MacroAssembler::RecordWrite(Register object,
|
78
|
+
int offset,
|
79
|
+
Register value,
|
80
|
+
Register scratch) {
|
81
|
+
// First, check if a write barrier is even needed. The tests below
|
82
|
+
// catch stores of Smis and stores into young gen.
|
83
|
+
NearLabel done;
|
84
|
+
|
85
|
+
// Skip barrier if writing a smi.
|
86
|
+
ASSERT_EQ(0, kSmiTag);
|
87
|
+
test(value, Immediate(kSmiTagMask));
|
88
|
+
j(zero, &done);
|
89
|
+
|
90
|
+
InNewSpace(object, value, equal, &done);
|
91
|
+
|
92
|
+
// The offset is relative to a tagged or untagged HeapObject pointer,
|
93
|
+
// so either offset or offset + kHeapObjectTag must be a
|
94
|
+
// multiple of kPointerSize.
|
95
|
+
ASSERT(IsAligned(offset, kPointerSize) ||
|
96
|
+
IsAligned(offset + kHeapObjectTag, kPointerSize));
|
97
|
+
|
98
|
+
Register dst = scratch;
|
99
|
+
if (offset != 0) {
|
100
|
+
lea(dst, Operand(object, offset));
|
101
|
+
} else {
|
102
|
+
// Array access: calculate the destination address in the same manner as
|
103
|
+
// KeyedStoreIC::GenerateGeneric. Multiply a smi by 2 to get an offset
|
104
|
+
// into an array of words.
|
105
|
+
ASSERT_EQ(1, kSmiTagSize);
|
106
|
+
ASSERT_EQ(0, kSmiTag);
|
107
|
+
lea(dst, Operand(object, dst, times_half_pointer_size,
|
108
|
+
FixedArray::kHeaderSize - kHeapObjectTag));
|
109
|
+
}
|
110
|
+
RecordWriteHelper(object, dst, value);
|
111
|
+
|
112
|
+
bind(&done);
|
113
|
+
|
114
|
+
// Clobber all input registers when running with the debug-code flag
|
115
|
+
// turned on to provoke errors.
|
116
|
+
if (FLAG_debug_code) {
|
117
|
+
mov(object, Immediate(BitCast<int32_t>(kZapValue)));
|
118
|
+
mov(value, Immediate(BitCast<int32_t>(kZapValue)));
|
119
|
+
mov(scratch, Immediate(BitCast<int32_t>(kZapValue)));
|
120
|
+
}
|
121
|
+
}
|
122
|
+
|
123
|
+
|
124
|
+
void MacroAssembler::RecordWrite(Register object,
|
125
|
+
Register address,
|
126
|
+
Register value) {
|
127
|
+
// First, check if a write barrier is even needed. The tests below
|
128
|
+
// catch stores of Smis and stores into young gen.
|
129
|
+
Label done;
|
130
|
+
|
131
|
+
// Skip barrier if writing a smi.
|
132
|
+
ASSERT_EQ(0, kSmiTag);
|
133
|
+
test(value, Immediate(kSmiTagMask));
|
134
|
+
j(zero, &done);
|
135
|
+
|
136
|
+
InNewSpace(object, value, equal, &done);
|
137
|
+
|
138
|
+
RecordWriteHelper(object, address, value);
|
139
|
+
|
140
|
+
bind(&done);
|
141
|
+
|
142
|
+
// Clobber all input registers when running with the debug-code flag
|
143
|
+
// turned on to provoke errors.
|
144
|
+
if (FLAG_debug_code) {
|
145
|
+
mov(object, Immediate(BitCast<int32_t>(kZapValue)));
|
146
|
+
mov(address, Immediate(BitCast<int32_t>(kZapValue)));
|
147
|
+
mov(value, Immediate(BitCast<int32_t>(kZapValue)));
|
148
|
+
}
|
149
|
+
}
|
150
|
+
|
151
|
+
|
152
|
+
#ifdef ENABLE_DEBUGGER_SUPPORT
|
153
|
+
void MacroAssembler::DebugBreak() {
|
154
|
+
Set(eax, Immediate(0));
|
155
|
+
mov(ebx, Immediate(ExternalReference(Runtime::kDebugBreak)));
|
156
|
+
CEntryStub ces(1);
|
157
|
+
call(ces.GetCode(), RelocInfo::DEBUG_BREAK);
|
158
|
+
}
|
159
|
+
#endif
|
160
|
+
|
161
|
+
|
162
|
+
void MacroAssembler::Set(Register dst, const Immediate& x) {
|
163
|
+
if (x.is_zero()) {
|
164
|
+
xor_(dst, Operand(dst)); // shorter than mov
|
165
|
+
} else {
|
166
|
+
mov(dst, x);
|
167
|
+
}
|
168
|
+
}
|
169
|
+
|
170
|
+
|
171
|
+
void MacroAssembler::Set(const Operand& dst, const Immediate& x) {
|
172
|
+
mov(dst, x);
|
173
|
+
}
|
174
|
+
|
175
|
+
|
176
|
+
void MacroAssembler::CmpObjectType(Register heap_object,
|
177
|
+
InstanceType type,
|
178
|
+
Register map) {
|
179
|
+
mov(map, FieldOperand(heap_object, HeapObject::kMapOffset));
|
180
|
+
CmpInstanceType(map, type);
|
181
|
+
}
|
182
|
+
|
183
|
+
|
184
|
+
void MacroAssembler::CmpInstanceType(Register map, InstanceType type) {
|
185
|
+
cmpb(FieldOperand(map, Map::kInstanceTypeOffset),
|
186
|
+
static_cast<int8_t>(type));
|
187
|
+
}
|
188
|
+
|
189
|
+
|
190
|
+
void MacroAssembler::CheckMap(Register obj,
|
191
|
+
Handle<Map> map,
|
192
|
+
Label* fail,
|
193
|
+
bool is_heap_object) {
|
194
|
+
if (!is_heap_object) {
|
195
|
+
test(obj, Immediate(kSmiTagMask));
|
196
|
+
j(zero, fail);
|
197
|
+
}
|
198
|
+
cmp(FieldOperand(obj, HeapObject::kMapOffset), Immediate(map));
|
199
|
+
j(not_equal, fail);
|
200
|
+
}
|
201
|
+
|
202
|
+
|
203
|
+
Condition MacroAssembler::IsObjectStringType(Register heap_object,
|
204
|
+
Register map,
|
205
|
+
Register instance_type) {
|
206
|
+
mov(map, FieldOperand(heap_object, HeapObject::kMapOffset));
|
207
|
+
movzx_b(instance_type, FieldOperand(map, Map::kInstanceTypeOffset));
|
208
|
+
ASSERT(kNotStringTag != 0);
|
209
|
+
test(instance_type, Immediate(kIsNotStringMask));
|
210
|
+
return zero;
|
211
|
+
}
|
212
|
+
|
213
|
+
|
214
|
+
void MacroAssembler::IsObjectJSObjectType(Register heap_object,
|
215
|
+
Register map,
|
216
|
+
Register scratch,
|
217
|
+
Label* fail) {
|
218
|
+
mov(map, FieldOperand(heap_object, HeapObject::kMapOffset));
|
219
|
+
IsInstanceJSObjectType(map, scratch, fail);
|
220
|
+
}
|
221
|
+
|
222
|
+
|
223
|
+
void MacroAssembler::IsInstanceJSObjectType(Register map,
|
224
|
+
Register scratch,
|
225
|
+
Label* fail) {
|
226
|
+
movzx_b(scratch, FieldOperand(map, Map::kInstanceTypeOffset));
|
227
|
+
sub(Operand(scratch), Immediate(FIRST_JS_OBJECT_TYPE));
|
228
|
+
cmp(scratch, LAST_JS_OBJECT_TYPE - FIRST_JS_OBJECT_TYPE);
|
229
|
+
j(above, fail);
|
230
|
+
}
|
231
|
+
|
232
|
+
|
233
|
+
void MacroAssembler::FCmp() {
|
234
|
+
if (CpuFeatures::IsSupported(CMOV)) {
|
235
|
+
fucomip();
|
236
|
+
ffree(0);
|
237
|
+
fincstp();
|
238
|
+
} else {
|
239
|
+
fucompp();
|
240
|
+
push(eax);
|
241
|
+
fnstsw_ax();
|
242
|
+
sahf();
|
243
|
+
pop(eax);
|
244
|
+
}
|
245
|
+
}
|
246
|
+
|
247
|
+
|
248
|
+
void MacroAssembler::AbortIfNotNumber(Register object) {
|
249
|
+
Label ok;
|
250
|
+
test(object, Immediate(kSmiTagMask));
|
251
|
+
j(zero, &ok);
|
252
|
+
cmp(FieldOperand(object, HeapObject::kMapOffset),
|
253
|
+
Factory::heap_number_map());
|
254
|
+
Assert(equal, "Operand not a number");
|
255
|
+
bind(&ok);
|
256
|
+
}
|
257
|
+
|
258
|
+
|
259
|
+
void MacroAssembler::AbortIfNotSmi(Register object) {
|
260
|
+
test(object, Immediate(kSmiTagMask));
|
261
|
+
Assert(equal, "Operand is not a smi");
|
262
|
+
}
|
263
|
+
|
264
|
+
|
265
|
+
void MacroAssembler::AbortIfNotString(Register object) {
|
266
|
+
test(object, Immediate(kSmiTagMask));
|
267
|
+
Assert(not_equal, "Operand is not a string");
|
268
|
+
push(object);
|
269
|
+
mov(object, FieldOperand(object, HeapObject::kMapOffset));
|
270
|
+
CmpInstanceType(object, FIRST_NONSTRING_TYPE);
|
271
|
+
pop(object);
|
272
|
+
Assert(below, "Operand is not a string");
|
273
|
+
}
|
274
|
+
|
275
|
+
|
276
|
+
void MacroAssembler::AbortIfSmi(Register object) {
|
277
|
+
test(object, Immediate(kSmiTagMask));
|
278
|
+
Assert(not_equal, "Operand is a smi");
|
279
|
+
}
|
280
|
+
|
281
|
+
|
282
|
+
void MacroAssembler::EnterFrame(StackFrame::Type type) {
|
283
|
+
push(ebp);
|
284
|
+
mov(ebp, Operand(esp));
|
285
|
+
push(esi);
|
286
|
+
push(Immediate(Smi::FromInt(type)));
|
287
|
+
push(Immediate(CodeObject()));
|
288
|
+
if (FLAG_debug_code) {
|
289
|
+
cmp(Operand(esp, 0), Immediate(Factory::undefined_value()));
|
290
|
+
Check(not_equal, "code object not properly patched");
|
291
|
+
}
|
292
|
+
}
|
293
|
+
|
294
|
+
|
295
|
+
void MacroAssembler::LeaveFrame(StackFrame::Type type) {
|
296
|
+
if (FLAG_debug_code) {
|
297
|
+
cmp(Operand(ebp, StandardFrameConstants::kMarkerOffset),
|
298
|
+
Immediate(Smi::FromInt(type)));
|
299
|
+
Check(equal, "stack frame types must match");
|
300
|
+
}
|
301
|
+
leave();
|
302
|
+
}
|
303
|
+
|
304
|
+
|
305
|
+
void MacroAssembler::EnterExitFramePrologue() {
|
306
|
+
// Setup the frame structure on the stack.
|
307
|
+
ASSERT(ExitFrameConstants::kCallerSPDisplacement == +2 * kPointerSize);
|
308
|
+
ASSERT(ExitFrameConstants::kCallerPCOffset == +1 * kPointerSize);
|
309
|
+
ASSERT(ExitFrameConstants::kCallerFPOffset == 0 * kPointerSize);
|
310
|
+
push(ebp);
|
311
|
+
mov(ebp, Operand(esp));
|
312
|
+
|
313
|
+
// Reserve room for entry stack pointer and push the code object.
|
314
|
+
ASSERT(ExitFrameConstants::kSPOffset == -1 * kPointerSize);
|
315
|
+
push(Immediate(0)); // Saved entry sp, patched before call.
|
316
|
+
push(Immediate(CodeObject())); // Accessed from ExitFrame::code_slot.
|
317
|
+
|
318
|
+
// Save the frame pointer and the context in top.
|
319
|
+
ExternalReference c_entry_fp_address(Top::k_c_entry_fp_address);
|
320
|
+
ExternalReference context_address(Top::k_context_address);
|
321
|
+
mov(Operand::StaticVariable(c_entry_fp_address), ebp);
|
322
|
+
mov(Operand::StaticVariable(context_address), esi);
|
323
|
+
}
|
324
|
+
|
325
|
+
|
326
|
+
void MacroAssembler::EnterExitFrameEpilogue(int argc, bool save_doubles) {
|
327
|
+
// Optionally save all XMM registers.
|
328
|
+
if (save_doubles) {
|
329
|
+
CpuFeatures::Scope scope(SSE2);
|
330
|
+
int space = XMMRegister::kNumRegisters * kDoubleSize + argc * kPointerSize;
|
331
|
+
sub(Operand(esp), Immediate(space));
|
332
|
+
const int offset = -2 * kPointerSize;
|
333
|
+
for (int i = 0; i < XMMRegister::kNumRegisters; i++) {
|
334
|
+
XMMRegister reg = XMMRegister::from_code(i);
|
335
|
+
movdbl(Operand(ebp, offset - ((i + 1) * kDoubleSize)), reg);
|
336
|
+
}
|
337
|
+
} else {
|
338
|
+
sub(Operand(esp), Immediate(argc * kPointerSize));
|
339
|
+
}
|
340
|
+
|
341
|
+
// Get the required frame alignment for the OS.
|
342
|
+
static const int kFrameAlignment = OS::ActivationFrameAlignment();
|
343
|
+
if (kFrameAlignment > 0) {
|
344
|
+
ASSERT(IsPowerOf2(kFrameAlignment));
|
345
|
+
and_(esp, -kFrameAlignment);
|
346
|
+
}
|
347
|
+
|
348
|
+
// Patch the saved entry sp.
|
349
|
+
mov(Operand(ebp, ExitFrameConstants::kSPOffset), esp);
|
350
|
+
}
|
351
|
+
|
352
|
+
|
353
|
+
void MacroAssembler::EnterExitFrame(bool save_doubles) {
|
354
|
+
EnterExitFramePrologue();
|
355
|
+
|
356
|
+
// Setup argc and argv in callee-saved registers.
|
357
|
+
int offset = StandardFrameConstants::kCallerSPOffset - kPointerSize;
|
358
|
+
mov(edi, Operand(eax));
|
359
|
+
lea(esi, Operand(ebp, eax, times_4, offset));
|
360
|
+
|
361
|
+
EnterExitFrameEpilogue(2, save_doubles);
|
362
|
+
}
|
363
|
+
|
364
|
+
|
365
|
+
void MacroAssembler::EnterApiExitFrame(int argc) {
|
366
|
+
EnterExitFramePrologue();
|
367
|
+
EnterExitFrameEpilogue(argc, false);
|
368
|
+
}
|
369
|
+
|
370
|
+
|
371
|
+
void MacroAssembler::LeaveExitFrame(bool save_doubles) {
|
372
|
+
// Optionally restore all XMM registers.
|
373
|
+
if (save_doubles) {
|
374
|
+
CpuFeatures::Scope scope(SSE2);
|
375
|
+
const int offset = -2 * kPointerSize;
|
376
|
+
for (int i = 0; i < XMMRegister::kNumRegisters; i++) {
|
377
|
+
XMMRegister reg = XMMRegister::from_code(i);
|
378
|
+
movdbl(reg, Operand(ebp, offset - ((i + 1) * kDoubleSize)));
|
379
|
+
}
|
380
|
+
}
|
381
|
+
|
382
|
+
// Get the return address from the stack and restore the frame pointer.
|
383
|
+
mov(ecx, Operand(ebp, 1 * kPointerSize));
|
384
|
+
mov(ebp, Operand(ebp, 0 * kPointerSize));
|
385
|
+
|
386
|
+
// Pop the arguments and the receiver from the caller stack.
|
387
|
+
lea(esp, Operand(esi, 1 * kPointerSize));
|
388
|
+
|
389
|
+
// Push the return address to get ready to return.
|
390
|
+
push(ecx);
|
391
|
+
|
392
|
+
LeaveExitFrameEpilogue();
|
393
|
+
}
|
394
|
+
|
395
|
+
void MacroAssembler::LeaveExitFrameEpilogue() {
|
396
|
+
// Restore current context from top and clear it in debug mode.
|
397
|
+
ExternalReference context_address(Top::k_context_address);
|
398
|
+
mov(esi, Operand::StaticVariable(context_address));
|
399
|
+
#ifdef DEBUG
|
400
|
+
mov(Operand::StaticVariable(context_address), Immediate(0));
|
401
|
+
#endif
|
402
|
+
|
403
|
+
// Clear the top frame.
|
404
|
+
ExternalReference c_entry_fp_address(Top::k_c_entry_fp_address);
|
405
|
+
mov(Operand::StaticVariable(c_entry_fp_address), Immediate(0));
|
406
|
+
}
|
407
|
+
|
408
|
+
|
409
|
+
void MacroAssembler::LeaveApiExitFrame() {
|
410
|
+
mov(esp, Operand(ebp));
|
411
|
+
pop(ebp);
|
412
|
+
|
413
|
+
LeaveExitFrameEpilogue();
|
414
|
+
}
|
415
|
+
|
416
|
+
|
417
|
+
void MacroAssembler::PushTryHandler(CodeLocation try_location,
|
418
|
+
HandlerType type) {
|
419
|
+
// Adjust this code if not the case.
|
420
|
+
ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize);
|
421
|
+
// The pc (return address) is already on TOS.
|
422
|
+
if (try_location == IN_JAVASCRIPT) {
|
423
|
+
if (type == TRY_CATCH_HANDLER) {
|
424
|
+
push(Immediate(StackHandler::TRY_CATCH));
|
425
|
+
} else {
|
426
|
+
push(Immediate(StackHandler::TRY_FINALLY));
|
427
|
+
}
|
428
|
+
push(ebp);
|
429
|
+
} else {
|
430
|
+
ASSERT(try_location == IN_JS_ENTRY);
|
431
|
+
// The frame pointer does not point to a JS frame so we save NULL
|
432
|
+
// for ebp. We expect the code throwing an exception to check ebp
|
433
|
+
// before dereferencing it to restore the context.
|
434
|
+
push(Immediate(StackHandler::ENTRY));
|
435
|
+
push(Immediate(0)); // NULL frame pointer.
|
436
|
+
}
|
437
|
+
// Save the current handler as the next handler.
|
438
|
+
push(Operand::StaticVariable(ExternalReference(Top::k_handler_address)));
|
439
|
+
// Link this handler as the new current one.
|
440
|
+
mov(Operand::StaticVariable(ExternalReference(Top::k_handler_address)), esp);
|
441
|
+
}
|
442
|
+
|
443
|
+
|
444
|
+
void MacroAssembler::PopTryHandler() {
|
445
|
+
ASSERT_EQ(0, StackHandlerConstants::kNextOffset);
|
446
|
+
pop(Operand::StaticVariable(ExternalReference(Top::k_handler_address)));
|
447
|
+
add(Operand(esp), Immediate(StackHandlerConstants::kSize - kPointerSize));
|
448
|
+
}
|
449
|
+
|
450
|
+
|
451
|
+
void MacroAssembler::Throw(Register value) {
|
452
|
+
// Adjust this code if not the case.
|
453
|
+
STATIC_ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize);
|
454
|
+
|
455
|
+
// eax must hold the exception.
|
456
|
+
if (!value.is(eax)) {
|
457
|
+
mov(eax, value);
|
458
|
+
}
|
459
|
+
|
460
|
+
// Drop the sp to the top of the handler.
|
461
|
+
ExternalReference handler_address(Top::k_handler_address);
|
462
|
+
mov(esp, Operand::StaticVariable(handler_address));
|
463
|
+
|
464
|
+
// Restore next handler and frame pointer, discard handler state.
|
465
|
+
STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0);
|
466
|
+
pop(Operand::StaticVariable(handler_address));
|
467
|
+
STATIC_ASSERT(StackHandlerConstants::kFPOffset == 1 * kPointerSize);
|
468
|
+
pop(ebp);
|
469
|
+
pop(edx); // Remove state.
|
470
|
+
|
471
|
+
// Before returning we restore the context from the frame pointer if
|
472
|
+
// not NULL. The frame pointer is NULL in the exception handler of
|
473
|
+
// a JS entry frame.
|
474
|
+
Set(esi, Immediate(0)); // Tentatively set context pointer to NULL.
|
475
|
+
NearLabel skip;
|
476
|
+
cmp(ebp, 0);
|
477
|
+
j(equal, &skip, not_taken);
|
478
|
+
mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
|
479
|
+
bind(&skip);
|
480
|
+
|
481
|
+
STATIC_ASSERT(StackHandlerConstants::kPCOffset == 3 * kPointerSize);
|
482
|
+
ret(0);
|
483
|
+
}
|
484
|
+
|
485
|
+
|
486
|
+
void MacroAssembler::ThrowUncatchable(UncatchableExceptionType type,
|
487
|
+
Register value) {
|
488
|
+
// Adjust this code if not the case.
|
489
|
+
STATIC_ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize);
|
490
|
+
|
491
|
+
// eax must hold the exception.
|
492
|
+
if (!value.is(eax)) {
|
493
|
+
mov(eax, value);
|
494
|
+
}
|
495
|
+
|
496
|
+
// Drop sp to the top stack handler.
|
497
|
+
ExternalReference handler_address(Top::k_handler_address);
|
498
|
+
mov(esp, Operand::StaticVariable(handler_address));
|
499
|
+
|
500
|
+
// Unwind the handlers until the ENTRY handler is found.
|
501
|
+
NearLabel loop, done;
|
502
|
+
bind(&loop);
|
503
|
+
// Load the type of the current stack handler.
|
504
|
+
const int kStateOffset = StackHandlerConstants::kStateOffset;
|
505
|
+
cmp(Operand(esp, kStateOffset), Immediate(StackHandler::ENTRY));
|
506
|
+
j(equal, &done);
|
507
|
+
// Fetch the next handler in the list.
|
508
|
+
const int kNextOffset = StackHandlerConstants::kNextOffset;
|
509
|
+
mov(esp, Operand(esp, kNextOffset));
|
510
|
+
jmp(&loop);
|
511
|
+
bind(&done);
|
512
|
+
|
513
|
+
// Set the top handler address to next handler past the current ENTRY handler.
|
514
|
+
STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0);
|
515
|
+
pop(Operand::StaticVariable(handler_address));
|
516
|
+
|
517
|
+
if (type == OUT_OF_MEMORY) {
|
518
|
+
// Set external caught exception to false.
|
519
|
+
ExternalReference external_caught(Top::k_external_caught_exception_address);
|
520
|
+
mov(eax, false);
|
521
|
+
mov(Operand::StaticVariable(external_caught), eax);
|
522
|
+
|
523
|
+
// Set pending exception and eax to out of memory exception.
|
524
|
+
ExternalReference pending_exception(Top::k_pending_exception_address);
|
525
|
+
mov(eax, reinterpret_cast<int32_t>(Failure::OutOfMemoryException()));
|
526
|
+
mov(Operand::StaticVariable(pending_exception), eax);
|
527
|
+
}
|
528
|
+
|
529
|
+
// Clear the context pointer.
|
530
|
+
Set(esi, Immediate(0));
|
531
|
+
|
532
|
+
// Restore fp from handler and discard handler state.
|
533
|
+
STATIC_ASSERT(StackHandlerConstants::kFPOffset == 1 * kPointerSize);
|
534
|
+
pop(ebp);
|
535
|
+
pop(edx); // State.
|
536
|
+
|
537
|
+
STATIC_ASSERT(StackHandlerConstants::kPCOffset == 3 * kPointerSize);
|
538
|
+
ret(0);
|
539
|
+
}
|
540
|
+
|
541
|
+
|
542
|
+
void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg,
|
543
|
+
Register scratch,
|
544
|
+
Label* miss) {
|
545
|
+
Label same_contexts;
|
546
|
+
|
547
|
+
ASSERT(!holder_reg.is(scratch));
|
548
|
+
|
549
|
+
// Load current lexical context from the stack frame.
|
550
|
+
mov(scratch, Operand(ebp, StandardFrameConstants::kContextOffset));
|
551
|
+
|
552
|
+
// When generating debug code, make sure the lexical context is set.
|
553
|
+
if (FLAG_debug_code) {
|
554
|
+
cmp(Operand(scratch), Immediate(0));
|
555
|
+
Check(not_equal, "we should not have an empty lexical context");
|
556
|
+
}
|
557
|
+
// Load the global context of the current context.
|
558
|
+
int offset = Context::kHeaderSize + Context::GLOBAL_INDEX * kPointerSize;
|
559
|
+
mov(scratch, FieldOperand(scratch, offset));
|
560
|
+
mov(scratch, FieldOperand(scratch, GlobalObject::kGlobalContextOffset));
|
561
|
+
|
562
|
+
// Check the context is a global context.
|
563
|
+
if (FLAG_debug_code) {
|
564
|
+
push(scratch);
|
565
|
+
// Read the first word and compare to global_context_map.
|
566
|
+
mov(scratch, FieldOperand(scratch, HeapObject::kMapOffset));
|
567
|
+
cmp(scratch, Factory::global_context_map());
|
568
|
+
Check(equal, "JSGlobalObject::global_context should be a global context.");
|
569
|
+
pop(scratch);
|
570
|
+
}
|
571
|
+
|
572
|
+
// Check if both contexts are the same.
|
573
|
+
cmp(scratch, FieldOperand(holder_reg, JSGlobalProxy::kContextOffset));
|
574
|
+
j(equal, &same_contexts, taken);
|
575
|
+
|
576
|
+
// Compare security tokens, save holder_reg on the stack so we can use it
|
577
|
+
// as a temporary register.
|
578
|
+
//
|
579
|
+
// TODO(119): avoid push(holder_reg)/pop(holder_reg)
|
580
|
+
push(holder_reg);
|
581
|
+
// Check that the security token in the calling global object is
|
582
|
+
// compatible with the security token in the receiving global
|
583
|
+
// object.
|
584
|
+
mov(holder_reg, FieldOperand(holder_reg, JSGlobalProxy::kContextOffset));
|
585
|
+
|
586
|
+
// Check the context is a global context.
|
587
|
+
if (FLAG_debug_code) {
|
588
|
+
cmp(holder_reg, Factory::null_value());
|
589
|
+
Check(not_equal, "JSGlobalProxy::context() should not be null.");
|
590
|
+
|
591
|
+
push(holder_reg);
|
592
|
+
// Read the first word and compare to global_context_map(),
|
593
|
+
mov(holder_reg, FieldOperand(holder_reg, HeapObject::kMapOffset));
|
594
|
+
cmp(holder_reg, Factory::global_context_map());
|
595
|
+
Check(equal, "JSGlobalObject::global_context should be a global context.");
|
596
|
+
pop(holder_reg);
|
597
|
+
}
|
598
|
+
|
599
|
+
int token_offset = Context::kHeaderSize +
|
600
|
+
Context::SECURITY_TOKEN_INDEX * kPointerSize;
|
601
|
+
mov(scratch, FieldOperand(scratch, token_offset));
|
602
|
+
cmp(scratch, FieldOperand(holder_reg, token_offset));
|
603
|
+
pop(holder_reg);
|
604
|
+
j(not_equal, miss, not_taken);
|
605
|
+
|
606
|
+
bind(&same_contexts);
|
607
|
+
}
|
608
|
+
|
609
|
+
|
610
|
+
void MacroAssembler::LoadAllocationTopHelper(Register result,
|
611
|
+
Register scratch,
|
612
|
+
AllocationFlags flags) {
|
613
|
+
ExternalReference new_space_allocation_top =
|
614
|
+
ExternalReference::new_space_allocation_top_address();
|
615
|
+
|
616
|
+
// Just return if allocation top is already known.
|
617
|
+
if ((flags & RESULT_CONTAINS_TOP) != 0) {
|
618
|
+
// No use of scratch if allocation top is provided.
|
619
|
+
ASSERT(scratch.is(no_reg));
|
620
|
+
#ifdef DEBUG
|
621
|
+
// Assert that result actually contains top on entry.
|
622
|
+
cmp(result, Operand::StaticVariable(new_space_allocation_top));
|
623
|
+
Check(equal, "Unexpected allocation top");
|
624
|
+
#endif
|
625
|
+
return;
|
626
|
+
}
|
627
|
+
|
628
|
+
// Move address of new object to result. Use scratch register if available.
|
629
|
+
if (scratch.is(no_reg)) {
|
630
|
+
mov(result, Operand::StaticVariable(new_space_allocation_top));
|
631
|
+
} else {
|
632
|
+
mov(Operand(scratch), Immediate(new_space_allocation_top));
|
633
|
+
mov(result, Operand(scratch, 0));
|
634
|
+
}
|
635
|
+
}
|
636
|
+
|
637
|
+
|
638
|
+
void MacroAssembler::UpdateAllocationTopHelper(Register result_end,
|
639
|
+
Register scratch) {
|
640
|
+
if (FLAG_debug_code) {
|
641
|
+
test(result_end, Immediate(kObjectAlignmentMask));
|
642
|
+
Check(zero, "Unaligned allocation in new space");
|
643
|
+
}
|
644
|
+
|
645
|
+
ExternalReference new_space_allocation_top =
|
646
|
+
ExternalReference::new_space_allocation_top_address();
|
647
|
+
|
648
|
+
// Update new top. Use scratch if available.
|
649
|
+
if (scratch.is(no_reg)) {
|
650
|
+
mov(Operand::StaticVariable(new_space_allocation_top), result_end);
|
651
|
+
} else {
|
652
|
+
mov(Operand(scratch, 0), result_end);
|
653
|
+
}
|
654
|
+
}
|
655
|
+
|
656
|
+
|
657
|
+
void MacroAssembler::AllocateInNewSpace(int object_size,
|
658
|
+
Register result,
|
659
|
+
Register result_end,
|
660
|
+
Register scratch,
|
661
|
+
Label* gc_required,
|
662
|
+
AllocationFlags flags) {
|
663
|
+
if (!FLAG_inline_new) {
|
664
|
+
if (FLAG_debug_code) {
|
665
|
+
// Trash the registers to simulate an allocation failure.
|
666
|
+
mov(result, Immediate(0x7091));
|
667
|
+
if (result_end.is_valid()) {
|
668
|
+
mov(result_end, Immediate(0x7191));
|
669
|
+
}
|
670
|
+
if (scratch.is_valid()) {
|
671
|
+
mov(scratch, Immediate(0x7291));
|
672
|
+
}
|
673
|
+
}
|
674
|
+
jmp(gc_required);
|
675
|
+
return;
|
676
|
+
}
|
677
|
+
ASSERT(!result.is(result_end));
|
678
|
+
|
679
|
+
// Load address of new object into result.
|
680
|
+
LoadAllocationTopHelper(result, scratch, flags);
|
681
|
+
|
682
|
+
Register top_reg = result_end.is_valid() ? result_end : result;
|
683
|
+
|
684
|
+
// Calculate new top and bail out if new space is exhausted.
|
685
|
+
ExternalReference new_space_allocation_limit =
|
686
|
+
ExternalReference::new_space_allocation_limit_address();
|
687
|
+
|
688
|
+
if (!top_reg.is(result)) {
|
689
|
+
mov(top_reg, result);
|
690
|
+
}
|
691
|
+
add(Operand(top_reg), Immediate(object_size));
|
692
|
+
j(carry, gc_required, not_taken);
|
693
|
+
cmp(top_reg, Operand::StaticVariable(new_space_allocation_limit));
|
694
|
+
j(above, gc_required, not_taken);
|
695
|
+
|
696
|
+
// Update allocation top.
|
697
|
+
UpdateAllocationTopHelper(top_reg, scratch);
|
698
|
+
|
699
|
+
// Tag result if requested.
|
700
|
+
if (top_reg.is(result)) {
|
701
|
+
if ((flags & TAG_OBJECT) != 0) {
|
702
|
+
sub(Operand(result), Immediate(object_size - kHeapObjectTag));
|
703
|
+
} else {
|
704
|
+
sub(Operand(result), Immediate(object_size));
|
705
|
+
}
|
706
|
+
} else if ((flags & TAG_OBJECT) != 0) {
|
707
|
+
add(Operand(result), Immediate(kHeapObjectTag));
|
708
|
+
}
|
709
|
+
}
|
710
|
+
|
711
|
+
|
712
|
+
void MacroAssembler::AllocateInNewSpace(int header_size,
|
713
|
+
ScaleFactor element_size,
|
714
|
+
Register element_count,
|
715
|
+
Register result,
|
716
|
+
Register result_end,
|
717
|
+
Register scratch,
|
718
|
+
Label* gc_required,
|
719
|
+
AllocationFlags flags) {
|
720
|
+
if (!FLAG_inline_new) {
|
721
|
+
if (FLAG_debug_code) {
|
722
|
+
// Trash the registers to simulate an allocation failure.
|
723
|
+
mov(result, Immediate(0x7091));
|
724
|
+
mov(result_end, Immediate(0x7191));
|
725
|
+
if (scratch.is_valid()) {
|
726
|
+
mov(scratch, Immediate(0x7291));
|
727
|
+
}
|
728
|
+
// Register element_count is not modified by the function.
|
729
|
+
}
|
730
|
+
jmp(gc_required);
|
731
|
+
return;
|
732
|
+
}
|
733
|
+
ASSERT(!result.is(result_end));
|
734
|
+
|
735
|
+
// Load address of new object into result.
|
736
|
+
LoadAllocationTopHelper(result, scratch, flags);
|
737
|
+
|
738
|
+
// Calculate new top and bail out if new space is exhausted.
|
739
|
+
ExternalReference new_space_allocation_limit =
|
740
|
+
ExternalReference::new_space_allocation_limit_address();
|
741
|
+
|
742
|
+
// We assume that element_count*element_size + header_size does not
|
743
|
+
// overflow.
|
744
|
+
lea(result_end, Operand(element_count, element_size, header_size));
|
745
|
+
add(result_end, Operand(result));
|
746
|
+
j(carry, gc_required);
|
747
|
+
cmp(result_end, Operand::StaticVariable(new_space_allocation_limit));
|
748
|
+
j(above, gc_required);
|
749
|
+
|
750
|
+
// Tag result if requested.
|
751
|
+
if ((flags & TAG_OBJECT) != 0) {
|
752
|
+
lea(result, Operand(result, kHeapObjectTag));
|
753
|
+
}
|
754
|
+
|
755
|
+
// Update allocation top.
|
756
|
+
UpdateAllocationTopHelper(result_end, scratch);
|
757
|
+
}
|
758
|
+
|
759
|
+
|
760
|
+
void MacroAssembler::AllocateInNewSpace(Register object_size,
|
761
|
+
Register result,
|
762
|
+
Register result_end,
|
763
|
+
Register scratch,
|
764
|
+
Label* gc_required,
|
765
|
+
AllocationFlags flags) {
|
766
|
+
if (!FLAG_inline_new) {
|
767
|
+
if (FLAG_debug_code) {
|
768
|
+
// Trash the registers to simulate an allocation failure.
|
769
|
+
mov(result, Immediate(0x7091));
|
770
|
+
mov(result_end, Immediate(0x7191));
|
771
|
+
if (scratch.is_valid()) {
|
772
|
+
mov(scratch, Immediate(0x7291));
|
773
|
+
}
|
774
|
+
// object_size is left unchanged by this function.
|
775
|
+
}
|
776
|
+
jmp(gc_required);
|
777
|
+
return;
|
778
|
+
}
|
779
|
+
ASSERT(!result.is(result_end));
|
780
|
+
|
781
|
+
// Load address of new object into result.
|
782
|
+
LoadAllocationTopHelper(result, scratch, flags);
|
783
|
+
|
784
|
+
// Calculate new top and bail out if new space is exhausted.
|
785
|
+
ExternalReference new_space_allocation_limit =
|
786
|
+
ExternalReference::new_space_allocation_limit_address();
|
787
|
+
if (!object_size.is(result_end)) {
|
788
|
+
mov(result_end, object_size);
|
789
|
+
}
|
790
|
+
add(result_end, Operand(result));
|
791
|
+
j(carry, gc_required, not_taken);
|
792
|
+
cmp(result_end, Operand::StaticVariable(new_space_allocation_limit));
|
793
|
+
j(above, gc_required, not_taken);
|
794
|
+
|
795
|
+
// Tag result if requested.
|
796
|
+
if ((flags & TAG_OBJECT) != 0) {
|
797
|
+
lea(result, Operand(result, kHeapObjectTag));
|
798
|
+
}
|
799
|
+
|
800
|
+
// Update allocation top.
|
801
|
+
UpdateAllocationTopHelper(result_end, scratch);
|
802
|
+
}
|
803
|
+
|
804
|
+
|
805
|
+
void MacroAssembler::UndoAllocationInNewSpace(Register object) {
|
806
|
+
ExternalReference new_space_allocation_top =
|
807
|
+
ExternalReference::new_space_allocation_top_address();
|
808
|
+
|
809
|
+
// Make sure the object has no tag before resetting top.
|
810
|
+
and_(Operand(object), Immediate(~kHeapObjectTagMask));
|
811
|
+
#ifdef DEBUG
|
812
|
+
cmp(object, Operand::StaticVariable(new_space_allocation_top));
|
813
|
+
Check(below, "Undo allocation of non allocated memory");
|
814
|
+
#endif
|
815
|
+
mov(Operand::StaticVariable(new_space_allocation_top), object);
|
816
|
+
}
|
817
|
+
|
818
|
+
|
819
|
+
void MacroAssembler::AllocateHeapNumber(Register result,
|
820
|
+
Register scratch1,
|
821
|
+
Register scratch2,
|
822
|
+
Label* gc_required) {
|
823
|
+
// Allocate heap number in new space.
|
824
|
+
AllocateInNewSpace(HeapNumber::kSize,
|
825
|
+
result,
|
826
|
+
scratch1,
|
827
|
+
scratch2,
|
828
|
+
gc_required,
|
829
|
+
TAG_OBJECT);
|
830
|
+
|
831
|
+
// Set the map.
|
832
|
+
mov(FieldOperand(result, HeapObject::kMapOffset),
|
833
|
+
Immediate(Factory::heap_number_map()));
|
834
|
+
}
|
835
|
+
|
836
|
+
|
837
|
+
void MacroAssembler::AllocateTwoByteString(Register result,
|
838
|
+
Register length,
|
839
|
+
Register scratch1,
|
840
|
+
Register scratch2,
|
841
|
+
Register scratch3,
|
842
|
+
Label* gc_required) {
|
843
|
+
// Calculate the number of bytes needed for the characters in the string while
|
844
|
+
// observing object alignment.
|
845
|
+
ASSERT((SeqTwoByteString::kHeaderSize & kObjectAlignmentMask) == 0);
|
846
|
+
ASSERT(kShortSize == 2);
|
847
|
+
// scratch1 = length * 2 + kObjectAlignmentMask.
|
848
|
+
lea(scratch1, Operand(length, length, times_1, kObjectAlignmentMask));
|
849
|
+
and_(Operand(scratch1), Immediate(~kObjectAlignmentMask));
|
850
|
+
|
851
|
+
// Allocate two byte string in new space.
|
852
|
+
AllocateInNewSpace(SeqTwoByteString::kHeaderSize,
|
853
|
+
times_1,
|
854
|
+
scratch1,
|
855
|
+
result,
|
856
|
+
scratch2,
|
857
|
+
scratch3,
|
858
|
+
gc_required,
|
859
|
+
TAG_OBJECT);
|
860
|
+
|
861
|
+
// Set the map, length and hash field.
|
862
|
+
mov(FieldOperand(result, HeapObject::kMapOffset),
|
863
|
+
Immediate(Factory::string_map()));
|
864
|
+
mov(scratch1, length);
|
865
|
+
SmiTag(scratch1);
|
866
|
+
mov(FieldOperand(result, String::kLengthOffset), scratch1);
|
867
|
+
mov(FieldOperand(result, String::kHashFieldOffset),
|
868
|
+
Immediate(String::kEmptyHashField));
|
869
|
+
}
|
870
|
+
|
871
|
+
|
872
|
+
void MacroAssembler::AllocateAsciiString(Register result,
|
873
|
+
Register length,
|
874
|
+
Register scratch1,
|
875
|
+
Register scratch2,
|
876
|
+
Register scratch3,
|
877
|
+
Label* gc_required) {
|
878
|
+
// Calculate the number of bytes needed for the characters in the string while
|
879
|
+
// observing object alignment.
|
880
|
+
ASSERT((SeqAsciiString::kHeaderSize & kObjectAlignmentMask) == 0);
|
881
|
+
mov(scratch1, length);
|
882
|
+
ASSERT(kCharSize == 1);
|
883
|
+
add(Operand(scratch1), Immediate(kObjectAlignmentMask));
|
884
|
+
and_(Operand(scratch1), Immediate(~kObjectAlignmentMask));
|
885
|
+
|
886
|
+
// Allocate ascii string in new space.
|
887
|
+
AllocateInNewSpace(SeqAsciiString::kHeaderSize,
|
888
|
+
times_1,
|
889
|
+
scratch1,
|
890
|
+
result,
|
891
|
+
scratch2,
|
892
|
+
scratch3,
|
893
|
+
gc_required,
|
894
|
+
TAG_OBJECT);
|
895
|
+
|
896
|
+
// Set the map, length and hash field.
|
897
|
+
mov(FieldOperand(result, HeapObject::kMapOffset),
|
898
|
+
Immediate(Factory::ascii_string_map()));
|
899
|
+
mov(scratch1, length);
|
900
|
+
SmiTag(scratch1);
|
901
|
+
mov(FieldOperand(result, String::kLengthOffset), scratch1);
|
902
|
+
mov(FieldOperand(result, String::kHashFieldOffset),
|
903
|
+
Immediate(String::kEmptyHashField));
|
904
|
+
}
|
905
|
+
|
906
|
+
|
907
|
+
void MacroAssembler::AllocateAsciiString(Register result,
|
908
|
+
int length,
|
909
|
+
Register scratch1,
|
910
|
+
Register scratch2,
|
911
|
+
Label* gc_required) {
|
912
|
+
ASSERT(length > 0);
|
913
|
+
|
914
|
+
// Allocate ascii string in new space.
|
915
|
+
AllocateInNewSpace(SeqAsciiString::SizeFor(length),
|
916
|
+
result,
|
917
|
+
scratch1,
|
918
|
+
scratch2,
|
919
|
+
gc_required,
|
920
|
+
TAG_OBJECT);
|
921
|
+
|
922
|
+
// Set the map, length and hash field.
|
923
|
+
mov(FieldOperand(result, HeapObject::kMapOffset),
|
924
|
+
Immediate(Factory::ascii_string_map()));
|
925
|
+
mov(FieldOperand(result, String::kLengthOffset),
|
926
|
+
Immediate(Smi::FromInt(length)));
|
927
|
+
mov(FieldOperand(result, String::kHashFieldOffset),
|
928
|
+
Immediate(String::kEmptyHashField));
|
929
|
+
}
|
930
|
+
|
931
|
+
|
932
|
+
void MacroAssembler::AllocateConsString(Register result,
|
933
|
+
Register scratch1,
|
934
|
+
Register scratch2,
|
935
|
+
Label* gc_required) {
|
936
|
+
// Allocate heap number in new space.
|
937
|
+
AllocateInNewSpace(ConsString::kSize,
|
938
|
+
result,
|
939
|
+
scratch1,
|
940
|
+
scratch2,
|
941
|
+
gc_required,
|
942
|
+
TAG_OBJECT);
|
943
|
+
|
944
|
+
// Set the map. The other fields are left uninitialized.
|
945
|
+
mov(FieldOperand(result, HeapObject::kMapOffset),
|
946
|
+
Immediate(Factory::cons_string_map()));
|
947
|
+
}
|
948
|
+
|
949
|
+
|
950
|
+
void MacroAssembler::AllocateAsciiConsString(Register result,
|
951
|
+
Register scratch1,
|
952
|
+
Register scratch2,
|
953
|
+
Label* gc_required) {
|
954
|
+
// Allocate heap number in new space.
|
955
|
+
AllocateInNewSpace(ConsString::kSize,
|
956
|
+
result,
|
957
|
+
scratch1,
|
958
|
+
scratch2,
|
959
|
+
gc_required,
|
960
|
+
TAG_OBJECT);
|
961
|
+
|
962
|
+
// Set the map. The other fields are left uninitialized.
|
963
|
+
mov(FieldOperand(result, HeapObject::kMapOffset),
|
964
|
+
Immediate(Factory::cons_ascii_string_map()));
|
965
|
+
}
|
966
|
+
|
967
|
+
|
968
|
+
// Copy memory, byte-by-byte, from source to destination. Not optimized for
|
969
|
+
// long or aligned copies. The contents of scratch and length are destroyed.
|
970
|
+
// Source and destination are incremented by length.
|
971
|
+
// Many variants of movsb, loop unrolling, word moves, and indexed operands
|
972
|
+
// have been tried here already, and this is fastest.
|
973
|
+
// A simpler loop is faster on small copies, but 30% slower on large ones.
|
974
|
+
// The cld() instruction must have been emitted, to set the direction flag(),
|
975
|
+
// before calling this function.
|
976
|
+
void MacroAssembler::CopyBytes(Register source,
|
977
|
+
Register destination,
|
978
|
+
Register length,
|
979
|
+
Register scratch) {
|
980
|
+
Label loop, done, short_string, short_loop;
|
981
|
+
// Experimentation shows that the short string loop is faster if length < 10.
|
982
|
+
cmp(Operand(length), Immediate(10));
|
983
|
+
j(less_equal, &short_string);
|
984
|
+
|
985
|
+
ASSERT(source.is(esi));
|
986
|
+
ASSERT(destination.is(edi));
|
987
|
+
ASSERT(length.is(ecx));
|
988
|
+
|
989
|
+
// Because source is 4-byte aligned in our uses of this function,
|
990
|
+
// we keep source aligned for the rep_movs call by copying the odd bytes
|
991
|
+
// at the end of the ranges.
|
992
|
+
mov(scratch, Operand(source, length, times_1, -4));
|
993
|
+
mov(Operand(destination, length, times_1, -4), scratch);
|
994
|
+
mov(scratch, ecx);
|
995
|
+
shr(ecx, 2);
|
996
|
+
rep_movs();
|
997
|
+
and_(Operand(scratch), Immediate(0x3));
|
998
|
+
add(destination, Operand(scratch));
|
999
|
+
jmp(&done);
|
1000
|
+
|
1001
|
+
bind(&short_string);
|
1002
|
+
test(length, Operand(length));
|
1003
|
+
j(zero, &done);
|
1004
|
+
|
1005
|
+
bind(&short_loop);
|
1006
|
+
mov_b(scratch, Operand(source, 0));
|
1007
|
+
mov_b(Operand(destination, 0), scratch);
|
1008
|
+
inc(source);
|
1009
|
+
inc(destination);
|
1010
|
+
dec(length);
|
1011
|
+
j(not_zero, &short_loop);
|
1012
|
+
|
1013
|
+
bind(&done);
|
1014
|
+
}
|
1015
|
+
|
1016
|
+
|
1017
|
+
void MacroAssembler::NegativeZeroTest(CodeGenerator* cgen,
|
1018
|
+
Register result,
|
1019
|
+
Register op,
|
1020
|
+
JumpTarget* then_target) {
|
1021
|
+
JumpTarget ok;
|
1022
|
+
test(result, Operand(result));
|
1023
|
+
ok.Branch(not_zero, taken);
|
1024
|
+
test(op, Operand(op));
|
1025
|
+
then_target->Branch(sign, not_taken);
|
1026
|
+
ok.Bind();
|
1027
|
+
}
|
1028
|
+
|
1029
|
+
|
1030
|
+
void MacroAssembler::NegativeZeroTest(Register result,
|
1031
|
+
Register op,
|
1032
|
+
Label* then_label) {
|
1033
|
+
Label ok;
|
1034
|
+
test(result, Operand(result));
|
1035
|
+
j(not_zero, &ok, taken);
|
1036
|
+
test(op, Operand(op));
|
1037
|
+
j(sign, then_label, not_taken);
|
1038
|
+
bind(&ok);
|
1039
|
+
}
|
1040
|
+
|
1041
|
+
|
1042
|
+
void MacroAssembler::NegativeZeroTest(Register result,
|
1043
|
+
Register op1,
|
1044
|
+
Register op2,
|
1045
|
+
Register scratch,
|
1046
|
+
Label* then_label) {
|
1047
|
+
Label ok;
|
1048
|
+
test(result, Operand(result));
|
1049
|
+
j(not_zero, &ok, taken);
|
1050
|
+
mov(scratch, Operand(op1));
|
1051
|
+
or_(scratch, Operand(op2));
|
1052
|
+
j(sign, then_label, not_taken);
|
1053
|
+
bind(&ok);
|
1054
|
+
}
|
1055
|
+
|
1056
|
+
|
1057
|
+
void MacroAssembler::TryGetFunctionPrototype(Register function,
|
1058
|
+
Register result,
|
1059
|
+
Register scratch,
|
1060
|
+
Label* miss) {
|
1061
|
+
// Check that the receiver isn't a smi.
|
1062
|
+
test(function, Immediate(kSmiTagMask));
|
1063
|
+
j(zero, miss, not_taken);
|
1064
|
+
|
1065
|
+
// Check that the function really is a function.
|
1066
|
+
CmpObjectType(function, JS_FUNCTION_TYPE, result);
|
1067
|
+
j(not_equal, miss, not_taken);
|
1068
|
+
|
1069
|
+
// Make sure that the function has an instance prototype.
|
1070
|
+
Label non_instance;
|
1071
|
+
movzx_b(scratch, FieldOperand(result, Map::kBitFieldOffset));
|
1072
|
+
test(scratch, Immediate(1 << Map::kHasNonInstancePrototype));
|
1073
|
+
j(not_zero, &non_instance, not_taken);
|
1074
|
+
|
1075
|
+
// Get the prototype or initial map from the function.
|
1076
|
+
mov(result,
|
1077
|
+
FieldOperand(function, JSFunction::kPrototypeOrInitialMapOffset));
|
1078
|
+
|
1079
|
+
// If the prototype or initial map is the hole, don't return it and
|
1080
|
+
// simply miss the cache instead. This will allow us to allocate a
|
1081
|
+
// prototype object on-demand in the runtime system.
|
1082
|
+
cmp(Operand(result), Immediate(Factory::the_hole_value()));
|
1083
|
+
j(equal, miss, not_taken);
|
1084
|
+
|
1085
|
+
// If the function does not have an initial map, we're done.
|
1086
|
+
Label done;
|
1087
|
+
CmpObjectType(result, MAP_TYPE, scratch);
|
1088
|
+
j(not_equal, &done);
|
1089
|
+
|
1090
|
+
// Get the prototype from the initial map.
|
1091
|
+
mov(result, FieldOperand(result, Map::kPrototypeOffset));
|
1092
|
+
jmp(&done);
|
1093
|
+
|
1094
|
+
// Non-instance prototype: Fetch prototype from constructor field
|
1095
|
+
// in initial map.
|
1096
|
+
bind(&non_instance);
|
1097
|
+
mov(result, FieldOperand(result, Map::kConstructorOffset));
|
1098
|
+
|
1099
|
+
// All done.
|
1100
|
+
bind(&done);
|
1101
|
+
}
|
1102
|
+
|
1103
|
+
|
1104
|
+
void MacroAssembler::CallStub(CodeStub* stub) {
|
1105
|
+
ASSERT(allow_stub_calls()); // Calls are not allowed in some stubs.
|
1106
|
+
call(stub->GetCode(), RelocInfo::CODE_TARGET);
|
1107
|
+
}
|
1108
|
+
|
1109
|
+
|
1110
|
+
MaybeObject* MacroAssembler::TryCallStub(CodeStub* stub) {
|
1111
|
+
ASSERT(allow_stub_calls()); // Calls are not allowed in some stubs.
|
1112
|
+
Object* result;
|
1113
|
+
{ MaybeObject* maybe_result = stub->TryGetCode();
|
1114
|
+
if (!maybe_result->ToObject(&result)) return maybe_result;
|
1115
|
+
}
|
1116
|
+
call(Handle<Code>(Code::cast(result)), RelocInfo::CODE_TARGET);
|
1117
|
+
return result;
|
1118
|
+
}
|
1119
|
+
|
1120
|
+
|
1121
|
+
void MacroAssembler::TailCallStub(CodeStub* stub) {
|
1122
|
+
ASSERT(allow_stub_calls()); // Calls are not allowed in some stubs.
|
1123
|
+
jmp(stub->GetCode(), RelocInfo::CODE_TARGET);
|
1124
|
+
}
|
1125
|
+
|
1126
|
+
|
1127
|
+
MaybeObject* MacroAssembler::TryTailCallStub(CodeStub* stub) {
|
1128
|
+
ASSERT(allow_stub_calls()); // Calls are not allowed in some stubs.
|
1129
|
+
Object* result;
|
1130
|
+
{ MaybeObject* maybe_result = stub->TryGetCode();
|
1131
|
+
if (!maybe_result->ToObject(&result)) return maybe_result;
|
1132
|
+
}
|
1133
|
+
jmp(Handle<Code>(Code::cast(result)), RelocInfo::CODE_TARGET);
|
1134
|
+
return result;
|
1135
|
+
}
|
1136
|
+
|
1137
|
+
|
1138
|
+
void MacroAssembler::StubReturn(int argc) {
|
1139
|
+
ASSERT(argc >= 1 && generating_stub());
|
1140
|
+
ret((argc - 1) * kPointerSize);
|
1141
|
+
}
|
1142
|
+
|
1143
|
+
|
1144
|
+
void MacroAssembler::IllegalOperation(int num_arguments) {
|
1145
|
+
if (num_arguments > 0) {
|
1146
|
+
add(Operand(esp), Immediate(num_arguments * kPointerSize));
|
1147
|
+
}
|
1148
|
+
mov(eax, Immediate(Factory::undefined_value()));
|
1149
|
+
}
|
1150
|
+
|
1151
|
+
|
1152
|
+
void MacroAssembler::IndexFromHash(Register hash, Register index) {
|
1153
|
+
// The assert checks that the constants for the maximum number of digits
|
1154
|
+
// for an array index cached in the hash field and the number of bits
|
1155
|
+
// reserved for it does not conflict.
|
1156
|
+
ASSERT(TenToThe(String::kMaxCachedArrayIndexLength) <
|
1157
|
+
(1 << String::kArrayIndexValueBits));
|
1158
|
+
// We want the smi-tagged index in key. kArrayIndexValueMask has zeros in
|
1159
|
+
// the low kHashShift bits.
|
1160
|
+
and_(hash, String::kArrayIndexValueMask);
|
1161
|
+
STATIC_ASSERT(String::kHashShift >= kSmiTagSize && kSmiTag == 0);
|
1162
|
+
if (String::kHashShift > kSmiTagSize) {
|
1163
|
+
shr(hash, String::kHashShift - kSmiTagSize);
|
1164
|
+
}
|
1165
|
+
if (!index.is(hash)) {
|
1166
|
+
mov(index, hash);
|
1167
|
+
}
|
1168
|
+
}
|
1169
|
+
|
1170
|
+
|
1171
|
+
void MacroAssembler::CallRuntime(Runtime::FunctionId id, int num_arguments) {
|
1172
|
+
CallRuntime(Runtime::FunctionForId(id), num_arguments);
|
1173
|
+
}
|
1174
|
+
|
1175
|
+
|
1176
|
+
void MacroAssembler::CallRuntimeSaveDoubles(Runtime::FunctionId id) {
|
1177
|
+
Runtime::Function* function = Runtime::FunctionForId(id);
|
1178
|
+
Set(eax, Immediate(function->nargs));
|
1179
|
+
mov(ebx, Immediate(ExternalReference(function)));
|
1180
|
+
CEntryStub ces(1);
|
1181
|
+
ces.SaveDoubles();
|
1182
|
+
CallStub(&ces);
|
1183
|
+
}
|
1184
|
+
|
1185
|
+
|
1186
|
+
MaybeObject* MacroAssembler::TryCallRuntime(Runtime::FunctionId id,
|
1187
|
+
int num_arguments) {
|
1188
|
+
return TryCallRuntime(Runtime::FunctionForId(id), num_arguments);
|
1189
|
+
}
|
1190
|
+
|
1191
|
+
|
1192
|
+
void MacroAssembler::CallRuntime(Runtime::Function* f, int num_arguments) {
|
1193
|
+
// If the expected number of arguments of the runtime function is
|
1194
|
+
// constant, we check that the actual number of arguments match the
|
1195
|
+
// expectation.
|
1196
|
+
if (f->nargs >= 0 && f->nargs != num_arguments) {
|
1197
|
+
IllegalOperation(num_arguments);
|
1198
|
+
return;
|
1199
|
+
}
|
1200
|
+
|
1201
|
+
// TODO(1236192): Most runtime routines don't need the number of
|
1202
|
+
// arguments passed in because it is constant. At some point we
|
1203
|
+
// should remove this need and make the runtime routine entry code
|
1204
|
+
// smarter.
|
1205
|
+
Set(eax, Immediate(num_arguments));
|
1206
|
+
mov(ebx, Immediate(ExternalReference(f)));
|
1207
|
+
CEntryStub ces(1);
|
1208
|
+
CallStub(&ces);
|
1209
|
+
}
|
1210
|
+
|
1211
|
+
|
1212
|
+
MaybeObject* MacroAssembler::TryCallRuntime(Runtime::Function* f,
|
1213
|
+
int num_arguments) {
|
1214
|
+
if (f->nargs >= 0 && f->nargs != num_arguments) {
|
1215
|
+
IllegalOperation(num_arguments);
|
1216
|
+
// Since we did not call the stub, there was no allocation failure.
|
1217
|
+
// Return some non-failure object.
|
1218
|
+
return Heap::undefined_value();
|
1219
|
+
}
|
1220
|
+
|
1221
|
+
// TODO(1236192): Most runtime routines don't need the number of
|
1222
|
+
// arguments passed in because it is constant. At some point we
|
1223
|
+
// should remove this need and make the runtime routine entry code
|
1224
|
+
// smarter.
|
1225
|
+
Set(eax, Immediate(num_arguments));
|
1226
|
+
mov(ebx, Immediate(ExternalReference(f)));
|
1227
|
+
CEntryStub ces(1);
|
1228
|
+
return TryCallStub(&ces);
|
1229
|
+
}
|
1230
|
+
|
1231
|
+
|
1232
|
+
void MacroAssembler::CallExternalReference(ExternalReference ref,
|
1233
|
+
int num_arguments) {
|
1234
|
+
mov(eax, Immediate(num_arguments));
|
1235
|
+
mov(ebx, Immediate(ref));
|
1236
|
+
|
1237
|
+
CEntryStub stub(1);
|
1238
|
+
CallStub(&stub);
|
1239
|
+
}
|
1240
|
+
|
1241
|
+
|
1242
|
+
void MacroAssembler::TailCallExternalReference(const ExternalReference& ext,
|
1243
|
+
int num_arguments,
|
1244
|
+
int result_size) {
|
1245
|
+
// TODO(1236192): Most runtime routines don't need the number of
|
1246
|
+
// arguments passed in because it is constant. At some point we
|
1247
|
+
// should remove this need and make the runtime routine entry code
|
1248
|
+
// smarter.
|
1249
|
+
Set(eax, Immediate(num_arguments));
|
1250
|
+
JumpToExternalReference(ext);
|
1251
|
+
}
|
1252
|
+
|
1253
|
+
|
1254
|
+
MaybeObject* MacroAssembler::TryTailCallExternalReference(
|
1255
|
+
const ExternalReference& ext, int num_arguments, int result_size) {
|
1256
|
+
// TODO(1236192): Most runtime routines don't need the number of
|
1257
|
+
// arguments passed in because it is constant. At some point we
|
1258
|
+
// should remove this need and make the runtime routine entry code
|
1259
|
+
// smarter.
|
1260
|
+
Set(eax, Immediate(num_arguments));
|
1261
|
+
return TryJumpToExternalReference(ext);
|
1262
|
+
}
|
1263
|
+
|
1264
|
+
|
1265
|
+
void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid,
|
1266
|
+
int num_arguments,
|
1267
|
+
int result_size) {
|
1268
|
+
TailCallExternalReference(ExternalReference(fid), num_arguments, result_size);
|
1269
|
+
}
|
1270
|
+
|
1271
|
+
|
1272
|
+
MaybeObject* MacroAssembler::TryTailCallRuntime(Runtime::FunctionId fid,
|
1273
|
+
int num_arguments,
|
1274
|
+
int result_size) {
|
1275
|
+
return TryTailCallExternalReference(
|
1276
|
+
ExternalReference(fid), num_arguments, result_size);
|
1277
|
+
}
|
1278
|
+
|
1279
|
+
|
1280
|
+
// If true, a Handle<T> returned by value from a function with cdecl calling
|
1281
|
+
// convention will be returned directly as a value of location_ field in a
|
1282
|
+
// register eax.
|
1283
|
+
// If false, it is returned as a pointer to a preallocated by caller memory
|
1284
|
+
// region. Pointer to this region should be passed to a function as an
|
1285
|
+
// implicit first argument.
|
1286
|
+
#if defined(USING_BSD_ABI) || defined(__MINGW32__) || defined(__CYGWIN__)
|
1287
|
+
static const bool kReturnHandlesDirectly = true;
|
1288
|
+
#else
|
1289
|
+
static const bool kReturnHandlesDirectly = false;
|
1290
|
+
#endif
|
1291
|
+
|
1292
|
+
|
1293
|
+
Operand ApiParameterOperand(int index) {
|
1294
|
+
return Operand(
|
1295
|
+
esp, (index + (kReturnHandlesDirectly ? 0 : 1)) * kPointerSize);
|
1296
|
+
}
|
1297
|
+
|
1298
|
+
|
1299
|
+
void MacroAssembler::PrepareCallApiFunction(int argc, Register scratch) {
|
1300
|
+
if (kReturnHandlesDirectly) {
|
1301
|
+
EnterApiExitFrame(argc);
|
1302
|
+
// When handles are returned directly we don't have to allocate extra
|
1303
|
+
// space for and pass an out parameter.
|
1304
|
+
} else {
|
1305
|
+
// We allocate two additional slots: return value and pointer to it.
|
1306
|
+
EnterApiExitFrame(argc + 2);
|
1307
|
+
|
1308
|
+
// The argument slots are filled as follows:
|
1309
|
+
//
|
1310
|
+
// n + 1: output cell
|
1311
|
+
// n: arg n
|
1312
|
+
// ...
|
1313
|
+
// 1: arg1
|
1314
|
+
// 0: pointer to the output cell
|
1315
|
+
//
|
1316
|
+
// Note that this is one more "argument" than the function expects
|
1317
|
+
// so the out cell will have to be popped explicitly after returning
|
1318
|
+
// from the function. The out cell contains Handle.
|
1319
|
+
|
1320
|
+
// pointer to out cell.
|
1321
|
+
lea(scratch, Operand(esp, (argc + 1) * kPointerSize));
|
1322
|
+
mov(Operand(esp, 0 * kPointerSize), scratch); // output.
|
1323
|
+
if (FLAG_debug_code) {
|
1324
|
+
mov(Operand(esp, (argc + 1) * kPointerSize), Immediate(0)); // out cell.
|
1325
|
+
}
|
1326
|
+
}
|
1327
|
+
}
|
1328
|
+
|
1329
|
+
|
1330
|
+
MaybeObject* MacroAssembler::TryCallApiFunctionAndReturn(ApiFunction* function,
|
1331
|
+
int stack_space) {
|
1332
|
+
ExternalReference next_address =
|
1333
|
+
ExternalReference::handle_scope_next_address();
|
1334
|
+
ExternalReference limit_address =
|
1335
|
+
ExternalReference::handle_scope_limit_address();
|
1336
|
+
ExternalReference level_address =
|
1337
|
+
ExternalReference::handle_scope_level_address();
|
1338
|
+
|
1339
|
+
// Allocate HandleScope in callee-save registers.
|
1340
|
+
mov(ebx, Operand::StaticVariable(next_address));
|
1341
|
+
mov(edi, Operand::StaticVariable(limit_address));
|
1342
|
+
add(Operand::StaticVariable(level_address), Immediate(1));
|
1343
|
+
|
1344
|
+
// Call the api function!
|
1345
|
+
call(function->address(), RelocInfo::RUNTIME_ENTRY);
|
1346
|
+
|
1347
|
+
if (!kReturnHandlesDirectly) {
|
1348
|
+
// The returned value is a pointer to the handle holding the result.
|
1349
|
+
// Dereference this to get to the location.
|
1350
|
+
mov(eax, Operand(eax, 0));
|
1351
|
+
}
|
1352
|
+
|
1353
|
+
Label empty_handle;
|
1354
|
+
Label prologue;
|
1355
|
+
Label promote_scheduled_exception;
|
1356
|
+
Label delete_allocated_handles;
|
1357
|
+
Label leave_exit_frame;
|
1358
|
+
|
1359
|
+
// Check if the result handle holds 0.
|
1360
|
+
test(eax, Operand(eax));
|
1361
|
+
j(zero, &empty_handle, not_taken);
|
1362
|
+
// It was non-zero. Dereference to get the result value.
|
1363
|
+
mov(eax, Operand(eax, 0));
|
1364
|
+
bind(&prologue);
|
1365
|
+
// No more valid handles (the result handle was the last one). Restore
|
1366
|
+
// previous handle scope.
|
1367
|
+
mov(Operand::StaticVariable(next_address), ebx);
|
1368
|
+
sub(Operand::StaticVariable(level_address), Immediate(1));
|
1369
|
+
Assert(above_equal, "Invalid HandleScope level");
|
1370
|
+
cmp(edi, Operand::StaticVariable(limit_address));
|
1371
|
+
j(not_equal, &delete_allocated_handles, not_taken);
|
1372
|
+
bind(&leave_exit_frame);
|
1373
|
+
|
1374
|
+
// Check if the function scheduled an exception.
|
1375
|
+
ExternalReference scheduled_exception_address =
|
1376
|
+
ExternalReference::scheduled_exception_address();
|
1377
|
+
cmp(Operand::StaticVariable(scheduled_exception_address),
|
1378
|
+
Immediate(Factory::the_hole_value()));
|
1379
|
+
j(not_equal, &promote_scheduled_exception, not_taken);
|
1380
|
+
LeaveApiExitFrame();
|
1381
|
+
ret(stack_space * kPointerSize);
|
1382
|
+
bind(&promote_scheduled_exception);
|
1383
|
+
MaybeObject* result =
|
1384
|
+
TryTailCallRuntime(Runtime::kPromoteScheduledException, 0, 1);
|
1385
|
+
if (result->IsFailure()) {
|
1386
|
+
return result;
|
1387
|
+
}
|
1388
|
+
bind(&empty_handle);
|
1389
|
+
// It was zero; the result is undefined.
|
1390
|
+
mov(eax, Factory::undefined_value());
|
1391
|
+
jmp(&prologue);
|
1392
|
+
|
1393
|
+
// HandleScope limit has changed. Delete allocated extensions.
|
1394
|
+
bind(&delete_allocated_handles);
|
1395
|
+
mov(Operand::StaticVariable(limit_address), edi);
|
1396
|
+
mov(edi, eax);
|
1397
|
+
mov(eax, Immediate(ExternalReference::delete_handle_scope_extensions()));
|
1398
|
+
call(Operand(eax));
|
1399
|
+
mov(eax, edi);
|
1400
|
+
jmp(&leave_exit_frame);
|
1401
|
+
|
1402
|
+
return result;
|
1403
|
+
}
|
1404
|
+
|
1405
|
+
|
1406
|
+
void MacroAssembler::JumpToExternalReference(const ExternalReference& ext) {
|
1407
|
+
// Set the entry point and jump to the C entry runtime stub.
|
1408
|
+
mov(ebx, Immediate(ext));
|
1409
|
+
CEntryStub ces(1);
|
1410
|
+
jmp(ces.GetCode(), RelocInfo::CODE_TARGET);
|
1411
|
+
}
|
1412
|
+
|
1413
|
+
|
1414
|
+
MaybeObject* MacroAssembler::TryJumpToExternalReference(
|
1415
|
+
const ExternalReference& ext) {
|
1416
|
+
// Set the entry point and jump to the C entry runtime stub.
|
1417
|
+
mov(ebx, Immediate(ext));
|
1418
|
+
CEntryStub ces(1);
|
1419
|
+
return TryTailCallStub(&ces);
|
1420
|
+
}
|
1421
|
+
|
1422
|
+
|
1423
|
+
void MacroAssembler::InvokePrologue(const ParameterCount& expected,
|
1424
|
+
const ParameterCount& actual,
|
1425
|
+
Handle<Code> code_constant,
|
1426
|
+
const Operand& code_operand,
|
1427
|
+
Label* done,
|
1428
|
+
InvokeFlag flag,
|
1429
|
+
PostCallGenerator* post_call_generator) {
|
1430
|
+
bool definitely_matches = false;
|
1431
|
+
Label invoke;
|
1432
|
+
if (expected.is_immediate()) {
|
1433
|
+
ASSERT(actual.is_immediate());
|
1434
|
+
if (expected.immediate() == actual.immediate()) {
|
1435
|
+
definitely_matches = true;
|
1436
|
+
} else {
|
1437
|
+
mov(eax, actual.immediate());
|
1438
|
+
const int sentinel = SharedFunctionInfo::kDontAdaptArgumentsSentinel;
|
1439
|
+
if (expected.immediate() == sentinel) {
|
1440
|
+
// Don't worry about adapting arguments for builtins that
|
1441
|
+
// don't want that done. Skip adaption code by making it look
|
1442
|
+
// like we have a match between expected and actual number of
|
1443
|
+
// arguments.
|
1444
|
+
definitely_matches = true;
|
1445
|
+
} else {
|
1446
|
+
mov(ebx, expected.immediate());
|
1447
|
+
}
|
1448
|
+
}
|
1449
|
+
} else {
|
1450
|
+
if (actual.is_immediate()) {
|
1451
|
+
// Expected is in register, actual is immediate. This is the
|
1452
|
+
// case when we invoke function values without going through the
|
1453
|
+
// IC mechanism.
|
1454
|
+
cmp(expected.reg(), actual.immediate());
|
1455
|
+
j(equal, &invoke);
|
1456
|
+
ASSERT(expected.reg().is(ebx));
|
1457
|
+
mov(eax, actual.immediate());
|
1458
|
+
} else if (!expected.reg().is(actual.reg())) {
|
1459
|
+
// Both expected and actual are in (different) registers. This
|
1460
|
+
// is the case when we invoke functions using call and apply.
|
1461
|
+
cmp(expected.reg(), Operand(actual.reg()));
|
1462
|
+
j(equal, &invoke);
|
1463
|
+
ASSERT(actual.reg().is(eax));
|
1464
|
+
ASSERT(expected.reg().is(ebx));
|
1465
|
+
}
|
1466
|
+
}
|
1467
|
+
|
1468
|
+
if (!definitely_matches) {
|
1469
|
+
Handle<Code> adaptor =
|
1470
|
+
Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline));
|
1471
|
+
if (!code_constant.is_null()) {
|
1472
|
+
mov(edx, Immediate(code_constant));
|
1473
|
+
add(Operand(edx), Immediate(Code::kHeaderSize - kHeapObjectTag));
|
1474
|
+
} else if (!code_operand.is_reg(edx)) {
|
1475
|
+
mov(edx, code_operand);
|
1476
|
+
}
|
1477
|
+
|
1478
|
+
if (flag == CALL_FUNCTION) {
|
1479
|
+
call(adaptor, RelocInfo::CODE_TARGET);
|
1480
|
+
if (post_call_generator != NULL) post_call_generator->Generate();
|
1481
|
+
jmp(done);
|
1482
|
+
} else {
|
1483
|
+
jmp(adaptor, RelocInfo::CODE_TARGET);
|
1484
|
+
}
|
1485
|
+
bind(&invoke);
|
1486
|
+
}
|
1487
|
+
}
|
1488
|
+
|
1489
|
+
|
1490
|
+
void MacroAssembler::InvokeCode(const Operand& code,
|
1491
|
+
const ParameterCount& expected,
|
1492
|
+
const ParameterCount& actual,
|
1493
|
+
InvokeFlag flag,
|
1494
|
+
PostCallGenerator* post_call_generator) {
|
1495
|
+
Label done;
|
1496
|
+
InvokePrologue(expected, actual, Handle<Code>::null(), code,
|
1497
|
+
&done, flag, post_call_generator);
|
1498
|
+
if (flag == CALL_FUNCTION) {
|
1499
|
+
call(code);
|
1500
|
+
if (post_call_generator != NULL) post_call_generator->Generate();
|
1501
|
+
} else {
|
1502
|
+
ASSERT(flag == JUMP_FUNCTION);
|
1503
|
+
jmp(code);
|
1504
|
+
}
|
1505
|
+
bind(&done);
|
1506
|
+
}
|
1507
|
+
|
1508
|
+
|
1509
|
+
void MacroAssembler::InvokeCode(Handle<Code> code,
|
1510
|
+
const ParameterCount& expected,
|
1511
|
+
const ParameterCount& actual,
|
1512
|
+
RelocInfo::Mode rmode,
|
1513
|
+
InvokeFlag flag,
|
1514
|
+
PostCallGenerator* post_call_generator) {
|
1515
|
+
Label done;
|
1516
|
+
Operand dummy(eax);
|
1517
|
+
InvokePrologue(expected, actual, code, dummy, &done,
|
1518
|
+
flag, post_call_generator);
|
1519
|
+
if (flag == CALL_FUNCTION) {
|
1520
|
+
call(code, rmode);
|
1521
|
+
if (post_call_generator != NULL) post_call_generator->Generate();
|
1522
|
+
} else {
|
1523
|
+
ASSERT(flag == JUMP_FUNCTION);
|
1524
|
+
jmp(code, rmode);
|
1525
|
+
}
|
1526
|
+
bind(&done);
|
1527
|
+
}
|
1528
|
+
|
1529
|
+
|
1530
|
+
void MacroAssembler::InvokeFunction(Register fun,
|
1531
|
+
const ParameterCount& actual,
|
1532
|
+
InvokeFlag flag,
|
1533
|
+
PostCallGenerator* post_call_generator) {
|
1534
|
+
ASSERT(fun.is(edi));
|
1535
|
+
mov(edx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset));
|
1536
|
+
mov(esi, FieldOperand(edi, JSFunction::kContextOffset));
|
1537
|
+
mov(ebx, FieldOperand(edx, SharedFunctionInfo::kFormalParameterCountOffset));
|
1538
|
+
SmiUntag(ebx);
|
1539
|
+
|
1540
|
+
ParameterCount expected(ebx);
|
1541
|
+
InvokeCode(FieldOperand(edi, JSFunction::kCodeEntryOffset),
|
1542
|
+
expected, actual, flag, post_call_generator);
|
1543
|
+
}
|
1544
|
+
|
1545
|
+
|
1546
|
+
void MacroAssembler::InvokeFunction(JSFunction* function,
|
1547
|
+
const ParameterCount& actual,
|
1548
|
+
InvokeFlag flag,
|
1549
|
+
PostCallGenerator* post_call_generator) {
|
1550
|
+
ASSERT(function->is_compiled());
|
1551
|
+
// Get the function and setup the context.
|
1552
|
+
mov(edi, Immediate(Handle<JSFunction>(function)));
|
1553
|
+
mov(esi, FieldOperand(edi, JSFunction::kContextOffset));
|
1554
|
+
|
1555
|
+
ParameterCount expected(function->shared()->formal_parameter_count());
|
1556
|
+
if (V8::UseCrankshaft()) {
|
1557
|
+
// TODO(kasperl): For now, we always call indirectly through the
|
1558
|
+
// code field in the function to allow recompilation to take effect
|
1559
|
+
// without changing any of the call sites.
|
1560
|
+
InvokeCode(FieldOperand(edi, JSFunction::kCodeEntryOffset),
|
1561
|
+
expected, actual, flag, post_call_generator);
|
1562
|
+
} else {
|
1563
|
+
Handle<Code> code(function->code());
|
1564
|
+
InvokeCode(code, expected, actual, RelocInfo::CODE_TARGET,
|
1565
|
+
flag, post_call_generator);
|
1566
|
+
}
|
1567
|
+
}
|
1568
|
+
|
1569
|
+
|
1570
|
+
void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id,
|
1571
|
+
InvokeFlag flag,
|
1572
|
+
PostCallGenerator* post_call_generator) {
|
1573
|
+
// Calls are not allowed in some stubs.
|
1574
|
+
ASSERT(flag == JUMP_FUNCTION || allow_stub_calls());
|
1575
|
+
|
1576
|
+
// Rely on the assertion to check that the number of provided
|
1577
|
+
// arguments match the expected number of arguments. Fake a
|
1578
|
+
// parameter count to avoid emitting code to do the check.
|
1579
|
+
ParameterCount expected(0);
|
1580
|
+
GetBuiltinFunction(edi, id);
|
1581
|
+
InvokeCode(FieldOperand(edi, JSFunction::kCodeEntryOffset),
|
1582
|
+
expected, expected, flag, post_call_generator);
|
1583
|
+
}
|
1584
|
+
|
1585
|
+
void MacroAssembler::GetBuiltinFunction(Register target,
|
1586
|
+
Builtins::JavaScript id) {
|
1587
|
+
// Load the JavaScript builtin function from the builtins object.
|
1588
|
+
mov(target, Operand(esi, Context::SlotOffset(Context::GLOBAL_INDEX)));
|
1589
|
+
mov(target, FieldOperand(target, GlobalObject::kBuiltinsOffset));
|
1590
|
+
mov(target, FieldOperand(target,
|
1591
|
+
JSBuiltinsObject::OffsetOfFunctionWithId(id)));
|
1592
|
+
}
|
1593
|
+
|
1594
|
+
void MacroAssembler::GetBuiltinEntry(Register target, Builtins::JavaScript id) {
|
1595
|
+
ASSERT(!target.is(edi));
|
1596
|
+
// Load the JavaScript builtin function from the builtins object.
|
1597
|
+
GetBuiltinFunction(edi, id);
|
1598
|
+
// Load the code entry point from the function into the target register.
|
1599
|
+
mov(target, FieldOperand(edi, JSFunction::kCodeEntryOffset));
|
1600
|
+
}
|
1601
|
+
|
1602
|
+
|
1603
|
+
void MacroAssembler::LoadContext(Register dst, int context_chain_length) {
|
1604
|
+
if (context_chain_length > 0) {
|
1605
|
+
// Move up the chain of contexts to the context containing the slot.
|
1606
|
+
mov(dst, Operand(esi, Context::SlotOffset(Context::CLOSURE_INDEX)));
|
1607
|
+
// Load the function context (which is the incoming, outer context).
|
1608
|
+
mov(dst, FieldOperand(dst, JSFunction::kContextOffset));
|
1609
|
+
for (int i = 1; i < context_chain_length; i++) {
|
1610
|
+
mov(dst, Operand(dst, Context::SlotOffset(Context::CLOSURE_INDEX)));
|
1611
|
+
mov(dst, FieldOperand(dst, JSFunction::kContextOffset));
|
1612
|
+
}
|
1613
|
+
} else {
|
1614
|
+
// Slot is in the current function context. Move it into the
|
1615
|
+
// destination register in case we store into it (the write barrier
|
1616
|
+
// cannot be allowed to destroy the context in esi).
|
1617
|
+
mov(dst, esi);
|
1618
|
+
}
|
1619
|
+
|
1620
|
+
// We should not have found a 'with' context by walking the context chain
|
1621
|
+
// (i.e., the static scope chain and runtime context chain do not agree).
|
1622
|
+
// A variable occurring in such a scope should have slot type LOOKUP and
|
1623
|
+
// not CONTEXT.
|
1624
|
+
if (FLAG_debug_code) {
|
1625
|
+
cmp(dst, Operand(dst, Context::SlotOffset(Context::FCONTEXT_INDEX)));
|
1626
|
+
Check(equal, "Yo dawg, I heard you liked function contexts "
|
1627
|
+
"so I put function contexts in all your contexts");
|
1628
|
+
}
|
1629
|
+
}
|
1630
|
+
|
1631
|
+
|
1632
|
+
void MacroAssembler::LoadGlobalFunction(int index, Register function) {
|
1633
|
+
// Load the global or builtins object from the current context.
|
1634
|
+
mov(function, Operand(esi, Context::SlotOffset(Context::GLOBAL_INDEX)));
|
1635
|
+
// Load the global context from the global or builtins object.
|
1636
|
+
mov(function, FieldOperand(function, GlobalObject::kGlobalContextOffset));
|
1637
|
+
// Load the function from the global context.
|
1638
|
+
mov(function, Operand(function, Context::SlotOffset(index)));
|
1639
|
+
}
|
1640
|
+
|
1641
|
+
|
1642
|
+
void MacroAssembler::LoadGlobalFunctionInitialMap(Register function,
|
1643
|
+
Register map) {
|
1644
|
+
// Load the initial map. The global functions all have initial maps.
|
1645
|
+
mov(map, FieldOperand(function, JSFunction::kPrototypeOrInitialMapOffset));
|
1646
|
+
if (FLAG_debug_code) {
|
1647
|
+
Label ok, fail;
|
1648
|
+
CheckMap(map, Factory::meta_map(), &fail, false);
|
1649
|
+
jmp(&ok);
|
1650
|
+
bind(&fail);
|
1651
|
+
Abort("Global functions must have initial map");
|
1652
|
+
bind(&ok);
|
1653
|
+
}
|
1654
|
+
}
|
1655
|
+
|
1656
|
+
|
1657
|
+
// Store the value in register src in the safepoint register stack
|
1658
|
+
// slot for register dst.
|
1659
|
+
void MacroAssembler::StoreToSafepointRegisterSlot(Register dst, Register src) {
|
1660
|
+
mov(SafepointRegisterSlot(dst), src);
|
1661
|
+
}
|
1662
|
+
|
1663
|
+
|
1664
|
+
void MacroAssembler::StoreToSafepointRegisterSlot(Register dst, Immediate src) {
|
1665
|
+
mov(SafepointRegisterSlot(dst), src);
|
1666
|
+
}
|
1667
|
+
|
1668
|
+
|
1669
|
+
void MacroAssembler::LoadFromSafepointRegisterSlot(Register dst, Register src) {
|
1670
|
+
mov(dst, SafepointRegisterSlot(src));
|
1671
|
+
}
|
1672
|
+
|
1673
|
+
|
1674
|
+
Operand MacroAssembler::SafepointRegisterSlot(Register reg) {
|
1675
|
+
return Operand(esp, SafepointRegisterStackIndex(reg.code()) * kPointerSize);
|
1676
|
+
}
|
1677
|
+
|
1678
|
+
|
1679
|
+
int MacroAssembler::SafepointRegisterStackIndex(int reg_code) {
|
1680
|
+
// The registers are pushed starting with the lowest encoding,
|
1681
|
+
// which means that lowest encodings are furthest away from
|
1682
|
+
// the stack pointer.
|
1683
|
+
ASSERT(reg_code >= 0 && reg_code < kNumSafepointRegisters);
|
1684
|
+
return kNumSafepointRegisters - reg_code - 1;
|
1685
|
+
}
|
1686
|
+
|
1687
|
+
|
1688
|
+
void MacroAssembler::Ret() {
|
1689
|
+
ret(0);
|
1690
|
+
}
|
1691
|
+
|
1692
|
+
|
1693
|
+
void MacroAssembler::Ret(int bytes_dropped, Register scratch) {
|
1694
|
+
if (is_uint16(bytes_dropped)) {
|
1695
|
+
ret(bytes_dropped);
|
1696
|
+
} else {
|
1697
|
+
pop(scratch);
|
1698
|
+
add(Operand(esp), Immediate(bytes_dropped));
|
1699
|
+
push(scratch);
|
1700
|
+
ret(0);
|
1701
|
+
}
|
1702
|
+
}
|
1703
|
+
|
1704
|
+
|
1705
|
+
|
1706
|
+
|
1707
|
+
void MacroAssembler::Drop(int stack_elements) {
|
1708
|
+
if (stack_elements > 0) {
|
1709
|
+
add(Operand(esp), Immediate(stack_elements * kPointerSize));
|
1710
|
+
}
|
1711
|
+
}
|
1712
|
+
|
1713
|
+
|
1714
|
+
void MacroAssembler::Move(Register dst, Register src) {
|
1715
|
+
if (!dst.is(src)) {
|
1716
|
+
mov(dst, src);
|
1717
|
+
}
|
1718
|
+
}
|
1719
|
+
|
1720
|
+
|
1721
|
+
void MacroAssembler::Move(Register dst, Handle<Object> value) {
|
1722
|
+
mov(dst, value);
|
1723
|
+
}
|
1724
|
+
|
1725
|
+
|
1726
|
+
void MacroAssembler::SetCounter(StatsCounter* counter, int value) {
|
1727
|
+
if (FLAG_native_code_counters && counter->Enabled()) {
|
1728
|
+
mov(Operand::StaticVariable(ExternalReference(counter)), Immediate(value));
|
1729
|
+
}
|
1730
|
+
}
|
1731
|
+
|
1732
|
+
|
1733
|
+
void MacroAssembler::IncrementCounter(StatsCounter* counter, int value) {
|
1734
|
+
ASSERT(value > 0);
|
1735
|
+
if (FLAG_native_code_counters && counter->Enabled()) {
|
1736
|
+
Operand operand = Operand::StaticVariable(ExternalReference(counter));
|
1737
|
+
if (value == 1) {
|
1738
|
+
inc(operand);
|
1739
|
+
} else {
|
1740
|
+
add(operand, Immediate(value));
|
1741
|
+
}
|
1742
|
+
}
|
1743
|
+
}
|
1744
|
+
|
1745
|
+
|
1746
|
+
void MacroAssembler::DecrementCounter(StatsCounter* counter, int value) {
|
1747
|
+
ASSERT(value > 0);
|
1748
|
+
if (FLAG_native_code_counters && counter->Enabled()) {
|
1749
|
+
Operand operand = Operand::StaticVariable(ExternalReference(counter));
|
1750
|
+
if (value == 1) {
|
1751
|
+
dec(operand);
|
1752
|
+
} else {
|
1753
|
+
sub(operand, Immediate(value));
|
1754
|
+
}
|
1755
|
+
}
|
1756
|
+
}
|
1757
|
+
|
1758
|
+
|
1759
|
+
void MacroAssembler::IncrementCounter(Condition cc,
|
1760
|
+
StatsCounter* counter,
|
1761
|
+
int value) {
|
1762
|
+
ASSERT(value > 0);
|
1763
|
+
if (FLAG_native_code_counters && counter->Enabled()) {
|
1764
|
+
Label skip;
|
1765
|
+
j(NegateCondition(cc), &skip);
|
1766
|
+
pushfd();
|
1767
|
+
IncrementCounter(counter, value);
|
1768
|
+
popfd();
|
1769
|
+
bind(&skip);
|
1770
|
+
}
|
1771
|
+
}
|
1772
|
+
|
1773
|
+
|
1774
|
+
void MacroAssembler::DecrementCounter(Condition cc,
|
1775
|
+
StatsCounter* counter,
|
1776
|
+
int value) {
|
1777
|
+
ASSERT(value > 0);
|
1778
|
+
if (FLAG_native_code_counters && counter->Enabled()) {
|
1779
|
+
Label skip;
|
1780
|
+
j(NegateCondition(cc), &skip);
|
1781
|
+
pushfd();
|
1782
|
+
DecrementCounter(counter, value);
|
1783
|
+
popfd();
|
1784
|
+
bind(&skip);
|
1785
|
+
}
|
1786
|
+
}
|
1787
|
+
|
1788
|
+
|
1789
|
+
void MacroAssembler::Assert(Condition cc, const char* msg) {
|
1790
|
+
if (FLAG_debug_code) Check(cc, msg);
|
1791
|
+
}
|
1792
|
+
|
1793
|
+
|
1794
|
+
void MacroAssembler::AssertFastElements(Register elements) {
|
1795
|
+
if (FLAG_debug_code) {
|
1796
|
+
Label ok;
|
1797
|
+
cmp(FieldOperand(elements, HeapObject::kMapOffset),
|
1798
|
+
Immediate(Factory::fixed_array_map()));
|
1799
|
+
j(equal, &ok);
|
1800
|
+
cmp(FieldOperand(elements, HeapObject::kMapOffset),
|
1801
|
+
Immediate(Factory::fixed_cow_array_map()));
|
1802
|
+
j(equal, &ok);
|
1803
|
+
Abort("JSObject with fast elements map has slow elements");
|
1804
|
+
bind(&ok);
|
1805
|
+
}
|
1806
|
+
}
|
1807
|
+
|
1808
|
+
|
1809
|
+
void MacroAssembler::Check(Condition cc, const char* msg) {
|
1810
|
+
Label L;
|
1811
|
+
j(cc, &L, taken);
|
1812
|
+
Abort(msg);
|
1813
|
+
// will not return here
|
1814
|
+
bind(&L);
|
1815
|
+
}
|
1816
|
+
|
1817
|
+
|
1818
|
+
void MacroAssembler::CheckStackAlignment() {
|
1819
|
+
int frame_alignment = OS::ActivationFrameAlignment();
|
1820
|
+
int frame_alignment_mask = frame_alignment - 1;
|
1821
|
+
if (frame_alignment > kPointerSize) {
|
1822
|
+
ASSERT(IsPowerOf2(frame_alignment));
|
1823
|
+
Label alignment_as_expected;
|
1824
|
+
test(esp, Immediate(frame_alignment_mask));
|
1825
|
+
j(zero, &alignment_as_expected);
|
1826
|
+
// Abort if stack is not aligned.
|
1827
|
+
int3();
|
1828
|
+
bind(&alignment_as_expected);
|
1829
|
+
}
|
1830
|
+
}
|
1831
|
+
|
1832
|
+
|
1833
|
+
void MacroAssembler::Abort(const char* msg) {
|
1834
|
+
// We want to pass the msg string like a smi to avoid GC
|
1835
|
+
// problems, however msg is not guaranteed to be aligned
|
1836
|
+
// properly. Instead, we pass an aligned pointer that is
|
1837
|
+
// a proper v8 smi, but also pass the alignment difference
|
1838
|
+
// from the real pointer as a smi.
|
1839
|
+
intptr_t p1 = reinterpret_cast<intptr_t>(msg);
|
1840
|
+
intptr_t p0 = (p1 & ~kSmiTagMask) + kSmiTag;
|
1841
|
+
ASSERT(reinterpret_cast<Object*>(p0)->IsSmi());
|
1842
|
+
#ifdef DEBUG
|
1843
|
+
if (msg != NULL) {
|
1844
|
+
RecordComment("Abort message: ");
|
1845
|
+
RecordComment(msg);
|
1846
|
+
}
|
1847
|
+
#endif
|
1848
|
+
// Disable stub call restrictions to always allow calls to abort.
|
1849
|
+
AllowStubCallsScope allow_scope(this, true);
|
1850
|
+
|
1851
|
+
push(eax);
|
1852
|
+
push(Immediate(p0));
|
1853
|
+
push(Immediate(reinterpret_cast<intptr_t>(Smi::FromInt(p1 - p0))));
|
1854
|
+
CallRuntime(Runtime::kAbort, 2);
|
1855
|
+
// will not return here
|
1856
|
+
int3();
|
1857
|
+
}
|
1858
|
+
|
1859
|
+
|
1860
|
+
void MacroAssembler::JumpIfNotNumber(Register reg,
|
1861
|
+
TypeInfo info,
|
1862
|
+
Label* on_not_number) {
|
1863
|
+
if (FLAG_debug_code) AbortIfSmi(reg);
|
1864
|
+
if (!info.IsNumber()) {
|
1865
|
+
cmp(FieldOperand(reg, HeapObject::kMapOffset),
|
1866
|
+
Factory::heap_number_map());
|
1867
|
+
j(not_equal, on_not_number);
|
1868
|
+
}
|
1869
|
+
}
|
1870
|
+
|
1871
|
+
|
1872
|
+
void MacroAssembler::ConvertToInt32(Register dst,
|
1873
|
+
Register source,
|
1874
|
+
Register scratch,
|
1875
|
+
TypeInfo info,
|
1876
|
+
Label* on_not_int32) {
|
1877
|
+
if (FLAG_debug_code) {
|
1878
|
+
AbortIfSmi(source);
|
1879
|
+
AbortIfNotNumber(source);
|
1880
|
+
}
|
1881
|
+
if (info.IsInteger32()) {
|
1882
|
+
cvttsd2si(dst, FieldOperand(source, HeapNumber::kValueOffset));
|
1883
|
+
} else {
|
1884
|
+
Label done;
|
1885
|
+
bool push_pop = (scratch.is(no_reg) && dst.is(source));
|
1886
|
+
ASSERT(!scratch.is(source));
|
1887
|
+
if (push_pop) {
|
1888
|
+
push(dst);
|
1889
|
+
scratch = dst;
|
1890
|
+
}
|
1891
|
+
if (scratch.is(no_reg)) scratch = dst;
|
1892
|
+
cvttsd2si(scratch, FieldOperand(source, HeapNumber::kValueOffset));
|
1893
|
+
cmp(scratch, 0x80000000u);
|
1894
|
+
if (push_pop) {
|
1895
|
+
j(not_equal, &done);
|
1896
|
+
pop(dst);
|
1897
|
+
jmp(on_not_int32);
|
1898
|
+
} else {
|
1899
|
+
j(equal, on_not_int32);
|
1900
|
+
}
|
1901
|
+
|
1902
|
+
bind(&done);
|
1903
|
+
if (push_pop) {
|
1904
|
+
add(Operand(esp), Immediate(kPointerSize)); // Pop.
|
1905
|
+
}
|
1906
|
+
if (!scratch.is(dst)) {
|
1907
|
+
mov(dst, scratch);
|
1908
|
+
}
|
1909
|
+
}
|
1910
|
+
}
|
1911
|
+
|
1912
|
+
|
1913
|
+
void MacroAssembler::LoadPowerOf2(XMMRegister dst,
|
1914
|
+
Register scratch,
|
1915
|
+
int power) {
|
1916
|
+
ASSERT(is_uintn(power + HeapNumber::kExponentBias,
|
1917
|
+
HeapNumber::kExponentBits));
|
1918
|
+
mov(scratch, Immediate(power + HeapNumber::kExponentBias));
|
1919
|
+
movd(dst, Operand(scratch));
|
1920
|
+
psllq(dst, HeapNumber::kMantissaBits);
|
1921
|
+
}
|
1922
|
+
|
1923
|
+
|
1924
|
+
void MacroAssembler::JumpIfInstanceTypeIsNotSequentialAscii(
|
1925
|
+
Register instance_type,
|
1926
|
+
Register scratch,
|
1927
|
+
Label* failure) {
|
1928
|
+
if (!scratch.is(instance_type)) {
|
1929
|
+
mov(scratch, instance_type);
|
1930
|
+
}
|
1931
|
+
and_(scratch,
|
1932
|
+
kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask);
|
1933
|
+
cmp(scratch, kStringTag | kSeqStringTag | kAsciiStringTag);
|
1934
|
+
j(not_equal, failure);
|
1935
|
+
}
|
1936
|
+
|
1937
|
+
|
1938
|
+
void MacroAssembler::JumpIfNotBothSequentialAsciiStrings(Register object1,
|
1939
|
+
Register object2,
|
1940
|
+
Register scratch1,
|
1941
|
+
Register scratch2,
|
1942
|
+
Label* failure) {
|
1943
|
+
// Check that both objects are not smis.
|
1944
|
+
ASSERT_EQ(0, kSmiTag);
|
1945
|
+
mov(scratch1, Operand(object1));
|
1946
|
+
and_(scratch1, Operand(object2));
|
1947
|
+
test(scratch1, Immediate(kSmiTagMask));
|
1948
|
+
j(zero, failure);
|
1949
|
+
|
1950
|
+
// Load instance type for both strings.
|
1951
|
+
mov(scratch1, FieldOperand(object1, HeapObject::kMapOffset));
|
1952
|
+
mov(scratch2, FieldOperand(object2, HeapObject::kMapOffset));
|
1953
|
+
movzx_b(scratch1, FieldOperand(scratch1, Map::kInstanceTypeOffset));
|
1954
|
+
movzx_b(scratch2, FieldOperand(scratch2, Map::kInstanceTypeOffset));
|
1955
|
+
|
1956
|
+
// Check that both are flat ascii strings.
|
1957
|
+
const int kFlatAsciiStringMask =
|
1958
|
+
kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask;
|
1959
|
+
const int kFlatAsciiStringTag = ASCII_STRING_TYPE;
|
1960
|
+
// Interleave bits from both instance types and compare them in one check.
|
1961
|
+
ASSERT_EQ(0, kFlatAsciiStringMask & (kFlatAsciiStringMask << 3));
|
1962
|
+
and_(scratch1, kFlatAsciiStringMask);
|
1963
|
+
and_(scratch2, kFlatAsciiStringMask);
|
1964
|
+
lea(scratch1, Operand(scratch1, scratch2, times_8, 0));
|
1965
|
+
cmp(scratch1, kFlatAsciiStringTag | (kFlatAsciiStringTag << 3));
|
1966
|
+
j(not_equal, failure);
|
1967
|
+
}
|
1968
|
+
|
1969
|
+
|
1970
|
+
void MacroAssembler::PrepareCallCFunction(int num_arguments, Register scratch) {
|
1971
|
+
int frameAlignment = OS::ActivationFrameAlignment();
|
1972
|
+
if (frameAlignment != 0) {
|
1973
|
+
// Make stack end at alignment and make room for num_arguments words
|
1974
|
+
// and the original value of esp.
|
1975
|
+
mov(scratch, esp);
|
1976
|
+
sub(Operand(esp), Immediate((num_arguments + 1) * kPointerSize));
|
1977
|
+
ASSERT(IsPowerOf2(frameAlignment));
|
1978
|
+
and_(esp, -frameAlignment);
|
1979
|
+
mov(Operand(esp, num_arguments * kPointerSize), scratch);
|
1980
|
+
} else {
|
1981
|
+
sub(Operand(esp), Immediate(num_arguments * kPointerSize));
|
1982
|
+
}
|
1983
|
+
}
|
1984
|
+
|
1985
|
+
|
1986
|
+
void MacroAssembler::CallCFunction(ExternalReference function,
|
1987
|
+
int num_arguments) {
|
1988
|
+
// Trashing eax is ok as it will be the return value.
|
1989
|
+
mov(Operand(eax), Immediate(function));
|
1990
|
+
CallCFunction(eax, num_arguments);
|
1991
|
+
}
|
1992
|
+
|
1993
|
+
|
1994
|
+
void MacroAssembler::CallCFunction(Register function,
|
1995
|
+
int num_arguments) {
|
1996
|
+
// Check stack alignment.
|
1997
|
+
if (FLAG_debug_code) {
|
1998
|
+
CheckStackAlignment();
|
1999
|
+
}
|
2000
|
+
|
2001
|
+
call(Operand(function));
|
2002
|
+
if (OS::ActivationFrameAlignment() != 0) {
|
2003
|
+
mov(esp, Operand(esp, num_arguments * kPointerSize));
|
2004
|
+
} else {
|
2005
|
+
add(Operand(esp), Immediate(num_arguments * sizeof(int32_t)));
|
2006
|
+
}
|
2007
|
+
}
|
2008
|
+
|
2009
|
+
|
2010
|
+
CodePatcher::CodePatcher(byte* address, int size)
|
2011
|
+
: address_(address), size_(size), masm_(address, size + Assembler::kGap) {
|
2012
|
+
// Create a new macro assembler pointing to the address of the code to patch.
|
2013
|
+
// The size is adjusted with kGap on order for the assembler to generate size
|
2014
|
+
// bytes of instructions without failing with buffer size constraints.
|
2015
|
+
ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap);
|
2016
|
+
}
|
2017
|
+
|
2018
|
+
|
2019
|
+
CodePatcher::~CodePatcher() {
|
2020
|
+
// Indicate that code has changed.
|
2021
|
+
CPU::FlushICache(address_, size_);
|
2022
|
+
|
2023
|
+
// Check that the code was patched as expected.
|
2024
|
+
ASSERT(masm_.pc_ == address_ + size_);
|
2025
|
+
ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap);
|
2026
|
+
}
|
2027
|
+
|
2028
|
+
|
2029
|
+
} } // namespace v8::internal
|
2030
|
+
|
2031
|
+
#endif // V8_TARGET_ARCH_IA32
|