| OLD | NEW |
| 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 2894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2905 void Assembler::GrowBuffer() { | 2905 void Assembler::GrowBuffer() { |
| 2906 DCHECK(buffer_overflow()); | 2906 DCHECK(buffer_overflow()); |
| 2907 if (!own_buffer_) FATAL("external code buffer is too small"); | 2907 if (!own_buffer_) FATAL("external code buffer is too small"); |
| 2908 | 2908 |
| 2909 // Compute new buffer size. | 2909 // Compute new buffer size. |
| 2910 CodeDesc desc; // the new buffer | 2910 CodeDesc desc; // the new buffer |
| 2911 desc.buffer_size = 2 * buffer_size_; | 2911 desc.buffer_size = 2 * buffer_size_; |
| 2912 | 2912 |
| 2913 // Some internal data structures overflow for very large buffers, | 2913 // Some internal data structures overflow for very large buffers, |
| 2914 // they must ensure that kMaximalBufferSize is not too large. | 2914 // they must ensure that kMaximalBufferSize is not too large. |
| 2915 if ((desc.buffer_size > kMaximalBufferSize) || | 2915 if (desc.buffer_size > kMaximalBufferSize || |
| 2916 (desc.buffer_size > isolate()->heap()->MaxOldGenerationSize())) { | 2916 static_cast<size_t>(desc.buffer_size) > |
| 2917 isolate()->heap()->MaxOldGenerationSize()) { |
| 2917 V8::FatalProcessOutOfMemory("Assembler::GrowBuffer"); | 2918 V8::FatalProcessOutOfMemory("Assembler::GrowBuffer"); |
| 2918 } | 2919 } |
| 2919 | 2920 |
| 2920 // Set up new buffer. | 2921 // Set up new buffer. |
| 2921 desc.buffer = NewArray<byte>(desc.buffer_size); | 2922 desc.buffer = NewArray<byte>(desc.buffer_size); |
| 2922 desc.origin = this; | 2923 desc.origin = this; |
| 2923 desc.instr_size = pc_offset(); | 2924 desc.instr_size = pc_offset(); |
| 2924 desc.reloc_size = (buffer_ + buffer_size_) - (reloc_info_writer.pos()); | 2925 desc.reloc_size = (buffer_ + buffer_size_) - (reloc_info_writer.pos()); |
| 2925 | 2926 |
| 2926 // Clear the buffer in debug mode. Use 'int3' instructions to make | 2927 // Clear the buffer in debug mode. Use 'int3' instructions to make |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3058 } | 3059 } |
| 3059 RelocInfo rinfo(isolate(), pc_, rmode, data, NULL); | 3060 RelocInfo rinfo(isolate(), pc_, rmode, data, NULL); |
| 3060 reloc_info_writer.Write(&rinfo); | 3061 reloc_info_writer.Write(&rinfo); |
| 3061 } | 3062 } |
| 3062 | 3063 |
| 3063 | 3064 |
| 3064 } // namespace internal | 3065 } // namespace internal |
| 3065 } // namespace v8 | 3066 } // namespace v8 |
| 3066 | 3067 |
| 3067 #endif // V8_TARGET_ARCH_IA32 | 3068 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |