X87: We should never allocate a 0-sized buffer, so never grow from 0.

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
parent b40af26e
......@@ -1880,11 +1880,8 @@ void Assembler::GrowBuffer() {
// 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) ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment