Port revision 6934 (plus fix from 6935) and refactoring in revision 6993 to the 3.0 branch.

Review URL: http://codereview.chromium.org/6592007

git-svn-id: http://v8.googlecode.com/svn/branches/3.0@7156 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
7 files changed