port r22947
original commit message:
We should never allocate a 0-sized buffer, so never grow from 0.
BUG=
R=weiliang.lin@intel.com
Review URL: https://codereview.chromium.org/
444403002
Patch from Chunyang Dai <chunyang.dai@intel.com>.
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22958
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
// Compute new buffer size.
CodeDesc desc; // the new buffer
- if (buffer_size_ < 4*KB) {
- desc.buffer_size = 4*KB;
- } else {
- desc.buffer_size = 2*buffer_size_;
- }
+ desc.buffer_size = 2 * buffer_size_;
+
// Some internal data structures overflow for very large buffers,
// they must ensure that kMaximalBufferSize is not too large.
if ((desc.buffer_size > kMaximalBufferSize) ||