Clear optimized code cache in shared function info when code gets deoptimized.
authorulan@chromium.org <ulan@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 3 Mar 2014 11:11:39 +0000 (11:11 +0000)
committerulan@chromium.org <ulan@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 3 Mar 2014 11:11:39 +0000 (11:11 +0000)
commitb9e0b87a5a15a7f39c9f967f63eee345566e892b
treed6a9171d741b945410ec8ca3c45fa48a17ac5b26
parent5acdc942f67c5ac1a8c47252e605b90f689d8fbb
Clear optimized code cache in shared function info when code gets deoptimized.

This adds a pointer to the shared function info into deoptimization data of an optimized code. Whenever the code is deoptimized, it clears the cache in the shared function info.

This fixes the problem when the optimized function dies in new space GC before the code is deoptimized due to code dependency and before the optimized code cache is cleared in old space GC (see mjsunit/regress/regress-343609.js).

This partially reverts r19603 because we need to be able to evict specific code from the optimized code cache.

BUG=343609
LOG=Y
TEST=mjsunit/regress/regress-343609.js
R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/184923002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19635 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
19 files changed:
src/a64/deoptimizer-a64.cc
src/a64/lithium-codegen-a64.cc
src/arm/deoptimizer-arm.cc
src/arm/lithium-codegen-arm.cc
src/compiler.cc
src/deoptimizer.cc
src/factory.cc
src/ia32/deoptimizer-ia32.cc
src/ia32/lithium-codegen-ia32.cc
src/mips/deoptimizer-mips.cc
src/mips/lithium-codegen-mips.cc
src/objects-inl.h
src/objects.cc
src/objects.h
src/runtime.cc
src/x64/deoptimizer-x64.cc
src/x64/lithium-codegen-x64.cc
test/cctest/test-heap.cc
test/mjsunit/regress/regress-343609.js [new file with mode: 0644]