| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // | 2 // |
| 3 // Redistribution and use in source and binary forms, with or without | 3 // Redistribution and use in source and binary forms, with or without |
| 4 // modification, are permitted provided that the following conditions are | 4 // modification, are permitted provided that the following conditions are |
| 5 // met: | 5 // met: |
| 6 // | 6 // |
| 7 // * Redistributions of source code must retain the above copyright | 7 // * Redistributions of source code must retain the above copyright |
| 8 // notice, this list of conditions and the following disclaimer. | 8 // notice, this list of conditions and the following disclaimer. |
| 9 // * Redistributions in binary form must reproduce the above | 9 // * Redistributions in binary form must reproduce the above |
| 10 // copyright notice, this list of conditions and the following | 10 // copyright notice, this list of conditions and the following |
| (...skipping 2887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2898 void Assembler::GrowBuffer() { | 2898 void Assembler::GrowBuffer() { |
| 2899 if (!own_buffer_) FATAL("external code buffer is too small"); | 2899 if (!own_buffer_) FATAL("external code buffer is too small"); |
| 2900 | 2900 |
| 2901 // Compute new buffer size. | 2901 // Compute new buffer size. |
| 2902 CodeDesc desc; // the new buffer | 2902 CodeDesc desc; // the new buffer |
| 2903 if (buffer_size_ < 1 * MB) { | 2903 if (buffer_size_ < 1 * MB) { |
| 2904 desc.buffer_size = 2 * buffer_size_; | 2904 desc.buffer_size = 2 * buffer_size_; |
| 2905 } else { | 2905 } else { |
| 2906 desc.buffer_size = buffer_size_ + 1 * MB; | 2906 desc.buffer_size = buffer_size_ + 1 * MB; |
| 2907 } | 2907 } |
| 2908 CHECK_GT(desc.buffer_size, 0); // No overflow. | 2908 |
| 2909 // Some internal data structures overflow for very large buffers, |
| 2910 // they must ensure that kMaximalBufferSize is not too large. |
| 2911 if (desc.buffer_size > kMaximalBufferSize || |
| 2912 static_cast<size_t>(desc.buffer_size) > |
| 2913 isolate_data().max_old_generation_size_) { |
| 2914 V8::FatalProcessOutOfMemory("Assembler::GrowBuffer"); |
| 2915 } |
| 2909 | 2916 |
| 2910 byte* buffer = reinterpret_cast<byte*>(buffer_); | 2917 byte* buffer = reinterpret_cast<byte*>(buffer_); |
| 2911 | 2918 |
| 2912 // Set up new buffer. | 2919 // Set up new buffer. |
| 2913 desc.buffer = NewArray<byte>(desc.buffer_size); | 2920 desc.buffer = NewArray<byte>(desc.buffer_size); |
| 2914 desc.origin = this; | 2921 desc.origin = this; |
| 2915 | 2922 |
| 2916 desc.instr_size = pc_offset(); | 2923 desc.instr_size = pc_offset(); |
| 2917 desc.reloc_size = | 2924 desc.reloc_size = |
| 2918 static_cast<int>((buffer + buffer_size_) - reloc_info_writer.pos()); | 2925 static_cast<int>((buffer + buffer_size_) - reloc_info_writer.pos()); |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3218 movk(scratch, (target_offset >> 32) & 0xFFFF, 32); | 3225 movk(scratch, (target_offset >> 32) & 0xFFFF, 32); |
| 3219 DCHECK((target_offset >> 48) == 0); | 3226 DCHECK((target_offset >> 48) == 0); |
| 3220 add(rd, rd, scratch); | 3227 add(rd, rd, scratch); |
| 3221 } | 3228 } |
| 3222 | 3229 |
| 3223 | 3230 |
| 3224 } // namespace internal | 3231 } // namespace internal |
| 3225 } // namespace v8 | 3232 } // namespace v8 |
| 3226 | 3233 |
| 3227 #endif // V8_TARGET_ARCH_ARM64 | 3234 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |