Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Side by Side Diff: src/x87/assembler-x87.cc

Issue 444403002: X87: We should never allocate a 0-sized buffer, so never grow from 0. (Closed) Base URL: https://chromium.googlesource.com/external/v8.git@bleeding_edge
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions 5 // modification, are permitted provided that the following conditions
6 // are met: 6 // are met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 1862 matching lines...) Expand 10 before | Expand all | Expand 10 after
1873 } 1873 }
1874 } 1874 }
1875 1875
1876 1876
1877 void Assembler::GrowBuffer() { 1877 void Assembler::GrowBuffer() {
1878 DCHECK(buffer_overflow()); 1878 DCHECK(buffer_overflow());
1879 if (!own_buffer_) FATAL("external code buffer is too small"); 1879 if (!own_buffer_) FATAL("external code buffer is too small");
1880 1880
1881 // Compute new buffer size. 1881 // Compute new buffer size.
1882 CodeDesc desc; // the new buffer 1882 CodeDesc desc; // the new buffer
1883 if (buffer_size_ < 4*KB) { 1883 desc.buffer_size = 2 * buffer_size_;
1884 desc.buffer_size = 4*KB; 1884
1885 } else {
1886 desc.buffer_size = 2*buffer_size_;
1887 }
1888 // Some internal data structures overflow for very large buffers, 1885 // Some internal data structures overflow for very large buffers,
1889 // they must ensure that kMaximalBufferSize is not too large. 1886 // they must ensure that kMaximalBufferSize is not too large.
1890 if ((desc.buffer_size > kMaximalBufferSize) || 1887 if ((desc.buffer_size > kMaximalBufferSize) ||
1891 (desc.buffer_size > isolate()->heap()->MaxOldGenerationSize())) { 1888 (desc.buffer_size > isolate()->heap()->MaxOldGenerationSize())) {
1892 V8::FatalProcessOutOfMemory("Assembler::GrowBuffer"); 1889 V8::FatalProcessOutOfMemory("Assembler::GrowBuffer");
1893 } 1890 }
1894 1891
1895 // Set up new buffer. 1892 // Set up new buffer.
1896 desc.buffer = NewArray<byte>(desc.buffer_size); 1893 desc.buffer = NewArray<byte>(desc.buffer_size);
1897 desc.instr_size = pc_offset(); 1894 desc.instr_size = pc_offset();
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
2047 fprintf(coverage_log, "%s\n", file_line); 2044 fprintf(coverage_log, "%s\n", file_line);
2048 fflush(coverage_log); 2045 fflush(coverage_log);
2049 } 2046 }
2050 } 2047 }
2051 2048
2052 #endif 2049 #endif
2053 2050
2054 } } // namespace v8::internal 2051 } } // namespace v8::internal
2055 2052
2056 #endif // V8_TARGET_ARCH_X87 2053 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698