Retry: Parser & internalization fix: ensure no heap allocs during GetString(Handle...
authormarja@chromium.org <marja@chromium.org>
Thu, 6 Nov 2014 08:28:37 +0000 (08:28 +0000)
committermarja@chromium.org <marja@chromium.org>
Thu, 6 Nov 2014 08:29:17 +0000 (08:29 +0000)
commitabb5fd1ee187148a478c08e4722ed8c34572a423
tree6df79f32982d216b267957520ef80731e5228d70
parent57b42dc51f5ee292897f24ba7fdcc955824331cd
Retry: Parser & internalization fix: ensure no heap allocs during GetString(Handle<String>).

The bug has always been there: when the parser is operating in the "immediately
internalize" mode and calls GetString, we get FlatContent of a string and then
do heap allocation.

The bug was uncovered by https://codereview.chromium.org/693803004/ (which put
the parser to the "immediately internalize" mode more often), but looking at the
code, it's possible that it can happen in other cases too.

This CL makes AstValueFactory handle this situation gracefully: it won't try to
internalize inside GetString(Handle<String>); it's unnecessary anyway since we
have the Handle<String> already.

BUG=
R=rossberg@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#25179}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@25179 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
src/ast-value-factory.cc
src/ast-value-factory.h