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 2758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2769 | 2769 |
2770 // Some internal data structures overflow for very large buffers, | 2770 // Some internal data structures overflow for very large buffers, |
2771 // they must ensure that kMaximalBufferSize is not too large. | 2771 // they must ensure that kMaximalBufferSize is not too large. |
2772 if ((desc.buffer_size > kMaximalBufferSize) || | 2772 if ((desc.buffer_size > kMaximalBufferSize) || |
2773 (desc.buffer_size > isolate()->heap()->MaxOldGenerationSize())) { | 2773 (desc.buffer_size > isolate()->heap()->MaxOldGenerationSize())) { |
2774 V8::FatalProcessOutOfMemory("Assembler::GrowBuffer"); | 2774 V8::FatalProcessOutOfMemory("Assembler::GrowBuffer"); |
2775 } | 2775 } |
2776 | 2776 |
2777 // Set up new buffer. | 2777 // Set up new buffer. |
2778 desc.buffer = NewArray<byte>(desc.buffer_size); | 2778 desc.buffer = NewArray<byte>(desc.buffer_size); |
| 2779 desc.origin = this; |
2779 desc.instr_size = pc_offset(); | 2780 desc.instr_size = pc_offset(); |
2780 desc.reloc_size = (buffer_ + buffer_size_) - (reloc_info_writer.pos()); | 2781 desc.reloc_size = (buffer_ + buffer_size_) - (reloc_info_writer.pos()); |
2781 | 2782 |
2782 // Clear the buffer in debug mode. Use 'int3' instructions to make | 2783 // Clear the buffer in debug mode. Use 'int3' instructions to make |
2783 // sure to get into problems if we ever run uninitialized code. | 2784 // sure to get into problems if we ever run uninitialized code. |
2784 #ifdef DEBUG | 2785 #ifdef DEBUG |
2785 memset(desc.buffer, 0xCC, desc.buffer_size); | 2786 memset(desc.buffer, 0xCC, desc.buffer_size); |
2786 #endif | 2787 #endif |
2787 | 2788 |
2788 // Copy the data. | 2789 // Copy the data. |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2905 } | 2906 } |
2906 | 2907 |
2907 | 2908 |
2908 void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) { | 2909 void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) { |
2909 DCHECK(!RelocInfo::IsNone(rmode)); | 2910 DCHECK(!RelocInfo::IsNone(rmode)); |
2910 // Don't record external references unless the heap will be serialized. | 2911 // Don't record external references unless the heap will be serialized. |
2911 if (rmode == RelocInfo::EXTERNAL_REFERENCE && | 2912 if (rmode == RelocInfo::EXTERNAL_REFERENCE && |
2912 !serializer_enabled() && !emit_debug_code()) { | 2913 !serializer_enabled() && !emit_debug_code()) { |
2913 return; | 2914 return; |
2914 } | 2915 } |
2915 RelocInfo rinfo(pc_, rmode, data, NULL); | 2916 RelocInfo rinfo(isolate(), pc_, rmode, data, NULL); |
2916 reloc_info_writer.Write(&rinfo); | 2917 reloc_info_writer.Write(&rinfo); |
2917 } | 2918 } |
2918 | 2919 |
2919 | 2920 |
2920 #ifdef GENERATED_CODE_COVERAGE | 2921 #ifdef GENERATED_CODE_COVERAGE |
2921 static FILE* coverage_log = NULL; | 2922 static FILE* coverage_log = NULL; |
2922 | 2923 |
2923 | 2924 |
2924 static void InitCoverageLog() { | 2925 static void InitCoverageLog() { |
2925 char* file_name = getenv("V8_GENERATED_CODE_COVERAGE_LOG"); | 2926 char* file_name = getenv("V8_GENERATED_CODE_COVERAGE_LOG"); |
(...skipping 13 matching lines...) Expand all Loading... |
2939 fflush(coverage_log); | 2940 fflush(coverage_log); |
2940 } | 2941 } |
2941 } | 2942 } |
2942 | 2943 |
2943 #endif | 2944 #endif |
2944 | 2945 |
2945 } // namespace internal | 2946 } // namespace internal |
2946 } // namespace v8 | 2947 } // namespace v8 |
2947 | 2948 |
2948 #endif // V8_TARGET_ARCH_IA32 | 2949 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |