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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 | 292 |
293 | 293 |
294 #ifdef GENERATED_CODE_COVERAGE | 294 #ifdef GENERATED_CODE_COVERAGE |
295 static void InitCoverageLog(); | 295 static void InitCoverageLog(); |
296 #endif | 296 #endif |
297 | 297 |
298 // Spare buffer. | 298 // Spare buffer. |
299 byte* Assembler::spare_buffer_ = NULL; | 299 byte* Assembler::spare_buffer_ = NULL; |
300 | 300 |
301 Assembler::Assembler(void* buffer, int buffer_size) | 301 Assembler::Assembler(void* buffer, int buffer_size) |
302 : positions_recorder_(this) { | 302 : positions_recorder_(this), |
| 303 emit_debug_code_(FLAG_debug_code) { |
303 if (buffer == NULL) { | 304 if (buffer == NULL) { |
304 // Do our own buffer management. | 305 // Do our own buffer management. |
305 if (buffer_size <= kMinimalBufferSize) { | 306 if (buffer_size <= kMinimalBufferSize) { |
306 buffer_size = kMinimalBufferSize; | 307 buffer_size = kMinimalBufferSize; |
307 | 308 |
308 if (spare_buffer_ != NULL) { | 309 if (spare_buffer_ != NULL) { |
309 buffer = spare_buffer_; | 310 buffer = spare_buffer_; |
310 spare_buffer_ = NULL; | 311 spare_buffer_ = NULL; |
311 } | 312 } |
312 } | 313 } |
(...skipping 2441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2754 | 2755 |
2755 void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) { | 2756 void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) { |
2756 ASSERT(rmode != RelocInfo::NONE); | 2757 ASSERT(rmode != RelocInfo::NONE); |
2757 // Don't record external references unless the heap will be serialized. | 2758 // Don't record external references unless the heap will be serialized. |
2758 if (rmode == RelocInfo::EXTERNAL_REFERENCE) { | 2759 if (rmode == RelocInfo::EXTERNAL_REFERENCE) { |
2759 #ifdef DEBUG | 2760 #ifdef DEBUG |
2760 if (!Serializer::enabled()) { | 2761 if (!Serializer::enabled()) { |
2761 Serializer::TooLateToEnableNow(); | 2762 Serializer::TooLateToEnableNow(); |
2762 } | 2763 } |
2763 #endif | 2764 #endif |
2764 if (!Serializer::enabled() && !FLAG_debug_code) { | 2765 if (!Serializer::enabled() && !emit_debug_code()) { |
2765 return; | 2766 return; |
2766 } | 2767 } |
2767 } | 2768 } |
2768 RelocInfo rinfo(pc_, rmode, data); | 2769 RelocInfo rinfo(pc_, rmode, data); |
2769 reloc_info_writer.Write(&rinfo); | 2770 reloc_info_writer.Write(&rinfo); |
2770 } | 2771 } |
2771 | 2772 |
2772 | 2773 |
2773 #ifdef GENERATED_CODE_COVERAGE | 2774 #ifdef GENERATED_CODE_COVERAGE |
2774 static FILE* coverage_log = NULL; | 2775 static FILE* coverage_log = NULL; |
(...skipping 16 matching lines...) Expand all Loading... |
2791 fprintf(coverage_log, "%s\n", file_line); | 2792 fprintf(coverage_log, "%s\n", file_line); |
2792 fflush(coverage_log); | 2793 fflush(coverage_log); |
2793 } | 2794 } |
2794 } | 2795 } |
2795 | 2796 |
2796 #endif | 2797 #endif |
2797 | 2798 |
2798 } } // namespace v8::internal | 2799 } } // namespace v8::internal |
2799 | 2800 |
2800 #endif // V8_TARGET_ARCH_IA32 | 2801 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |