OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 // compute new buffer size | 386 // compute new buffer size |
387 CodeDesc desc; // the new buffer | 387 CodeDesc desc; // the new buffer |
388 if (buffer_size_ < 4*KB) { | 388 if (buffer_size_ < 4*KB) { |
389 desc.buffer_size = 4*KB; | 389 desc.buffer_size = 4*KB; |
390 } else { | 390 } else { |
391 desc.buffer_size = 2*buffer_size_; | 391 desc.buffer_size = 2*buffer_size_; |
392 } | 392 } |
393 // Some internal data structures overflow for very large buffers, | 393 // Some internal data structures overflow for very large buffers, |
394 // they must ensure that kMaximalBufferSize is not too large. | 394 // they must ensure that kMaximalBufferSize is not too large. |
395 if ((desc.buffer_size > kMaximalBufferSize) || | 395 if ((desc.buffer_size > kMaximalBufferSize) || |
396 (desc.buffer_size > Heap::OldGenerationSize())) { | 396 (desc.buffer_size > Heap::MaxOldGenerationSize())) { |
397 V8::FatalProcessOutOfMemory("Assembler::GrowBuffer"); | 397 V8::FatalProcessOutOfMemory("Assembler::GrowBuffer"); |
398 } | 398 } |
399 | 399 |
400 // setup new buffer | 400 // setup new buffer |
401 desc.buffer = NewArray<byte>(desc.buffer_size); | 401 desc.buffer = NewArray<byte>(desc.buffer_size); |
402 desc.instr_size = pc_offset(); | 402 desc.instr_size = pc_offset(); |
403 desc.reloc_size = (buffer_ + buffer_size_) - (reloc_info_writer.pos()); | 403 desc.reloc_size = (buffer_ + buffer_size_) - (reloc_info_writer.pos()); |
404 | 404 |
405 // Clear the buffer in debug mode. Use 'int3' instructions to make | 405 // Clear the buffer in debug mode. Use 'int3' instructions to make |
406 // sure to get into problems if we ever run uninitialized code. | 406 // sure to get into problems if we ever run uninitialized code. |
(...skipping 2060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2467 written_position_ = current_position_; | 2467 written_position_ = current_position_; |
2468 } | 2468 } |
2469 } | 2469 } |
2470 | 2470 |
2471 | 2471 |
2472 const int RelocInfo::kApplyMask = RelocInfo::kCodeTargetMask | | 2472 const int RelocInfo::kApplyMask = RelocInfo::kCodeTargetMask | |
2473 1 << RelocInfo::INTERNAL_REFERENCE | | 2473 1 << RelocInfo::INTERNAL_REFERENCE | |
2474 1 << RelocInfo::JS_RETURN; | 2474 1 << RelocInfo::JS_RETURN; |
2475 | 2475 |
2476 } } // namespace v8::internal | 2476 } } // namespace v8::internal |
OLD | NEW |