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

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

Issue 446923003: MIPS: We should never allocate a 0-sized buffer, so never grow from 0. (Closed) Base URL: https://v8.googlecode.com/svn/branches/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 | Annotate | Revision Log
« no previous file with comments | « src/mips/assembler-mips.cc ('k') | 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 are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // 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 2613 matching lines...) Expand 10 before | Expand all | Expand 10 after
2624 return 1; // Number of instructions patched. 2624 return 1; // Number of instructions patched.
2625 } 2625 }
2626 } 2626 }
2627 2627
2628 2628
2629 void Assembler::GrowBuffer() { 2629 void Assembler::GrowBuffer() {
2630 if (!own_buffer_) FATAL("external code buffer is too small"); 2630 if (!own_buffer_) FATAL("external code buffer is too small");
2631 2631
2632 // Compute new buffer size. 2632 // Compute new buffer size.
2633 CodeDesc desc; // The new buffer. 2633 CodeDesc desc; // The new buffer.
2634 if (buffer_size_ < 4*KB) { 2634 if (buffer_size_ < 1 * MB) {
2635 desc.buffer_size = 4*KB;
2636 } else if (buffer_size_ < 1*MB) {
2637 desc.buffer_size = 2*buffer_size_; 2635 desc.buffer_size = 2*buffer_size_;
2638 } else { 2636 } else {
2639 desc.buffer_size = buffer_size_ + 1*MB; 2637 desc.buffer_size = buffer_size_ + 1*MB;
2640 } 2638 }
2641 CHECK_GT(desc.buffer_size, 0); // No overflow. 2639 CHECK_GT(desc.buffer_size, 0); // No overflow.
2642 2640
2643 // Set up new buffer. 2641 // Set up new buffer.
2644 desc.buffer = NewArray<byte>(desc.buffer_size); 2642 desc.buffer = NewArray<byte>(desc.buffer_size);
2645 2643
2646 desc.instr_size = pc_offset(); 2644 desc.instr_size = pc_offset();
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
2926 void Assembler::PopulateConstantPool(ConstantPoolArray* constant_pool) { 2924 void Assembler::PopulateConstantPool(ConstantPoolArray* constant_pool) {
2927 // No out-of-line constant pool support. 2925 // No out-of-line constant pool support.
2928 DCHECK(!FLAG_enable_ool_constant_pool); 2926 DCHECK(!FLAG_enable_ool_constant_pool);
2929 return; 2927 return;
2930 } 2928 }
2931 2929
2932 2930
2933 } } // namespace v8::internal 2931 } } // namespace v8::internal
2934 2932
2935 #endif // V8_TARGET_ARCH_MIPS64 2933 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips/assembler-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698