Parser & internalization fix: ensure no heap allocs during GetString(Handle<String>).
authormarja@chromium.org <marja@chromium.org>
Wed, 5 Nov 2014 13:59:12 +0000 (13:59 +0000)
committermarja@chromium.org <marja@chromium.org>
Wed, 5 Nov 2014 13:59:51 +0000 (13:59 +0000)
commitdddeb98df98bae5afb66c3eb325e068afd30f9e8
tree93bc71342399db9c372ed66985a0b5de10f4bd97
parent73835421d25464defaf77d844234e08568983104
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.

R=rossberg@chromium.org
BUG=

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

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