Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: src/arm/assembler-arm.cc

Issue 6677044: Use a class field instead of global FLAG_debug_code in assember and (Closed)
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/arm/assembler-arm.h ('k') | src/arm/macro-assembler-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 const Instr kLdrStrOffsetMask = 0x00000fff; 264 const Instr kLdrStrOffsetMask = 0x00000fff;
265 265
266 266
267 // Spare buffer. 267 // Spare buffer.
268 static const int kMinimalBufferSize = 4*KB; 268 static const int kMinimalBufferSize = 4*KB;
269 static byte* spare_buffer_ = NULL; 269 static byte* spare_buffer_ = NULL;
270 270
271 271
272 Assembler::Assembler(void* buffer, int buffer_size) 272 Assembler::Assembler(void* buffer, int buffer_size)
273 : positions_recorder_(this), 273 : positions_recorder_(this),
274 allow_peephole_optimization_(false) { 274 allow_peephole_optimization_(false),
275 emit_debug_code_(FLAG_debug_code) {
275 allow_peephole_optimization_ = FLAG_peephole_optimization; 276 allow_peephole_optimization_ = FLAG_peephole_optimization;
276 if (buffer == NULL) { 277 if (buffer == NULL) {
277 // Do our own buffer management. 278 // Do our own buffer management.
278 if (buffer_size <= kMinimalBufferSize) { 279 if (buffer_size <= kMinimalBufferSize) {
279 buffer_size = kMinimalBufferSize; 280 buffer_size = kMinimalBufferSize;
280 281
281 if (spare_buffer_ != NULL) { 282 if (spare_buffer_ != NULL) {
282 buffer = spare_buffer_; 283 buffer = spare_buffer_;
283 spare_buffer_ = NULL; 284 spare_buffer_ = NULL;
284 } 285 }
(...skipping 2373 matching lines...) Expand 10 before | Expand all | Expand 10 after
2658 BlockConstPoolBefore(pc_offset() + kInstrSize); 2659 BlockConstPoolBefore(pc_offset() + kInstrSize);
2659 } 2660 }
2660 if (rinfo.rmode() != RelocInfo::NONE) { 2661 if (rinfo.rmode() != RelocInfo::NONE) {
2661 // Don't record external references unless the heap will be serialized. 2662 // Don't record external references unless the heap will be serialized.
2662 if (rmode == RelocInfo::EXTERNAL_REFERENCE) { 2663 if (rmode == RelocInfo::EXTERNAL_REFERENCE) {
2663 #ifdef DEBUG 2664 #ifdef DEBUG
2664 if (!Serializer::enabled()) { 2665 if (!Serializer::enabled()) {
2665 Serializer::TooLateToEnableNow(); 2666 Serializer::TooLateToEnableNow();
2666 } 2667 }
2667 #endif 2668 #endif
2668 if (!Serializer::enabled() && !FLAG_debug_code) { 2669 if (!Serializer::enabled() && !emit_debug_code()) {
2669 return; 2670 return;
2670 } 2671 }
2671 } 2672 }
2672 ASSERT(buffer_space() >= kMaxRelocSize); // too late to grow buffer here 2673 ASSERT(buffer_space() >= kMaxRelocSize); // too late to grow buffer here
2673 reloc_info_writer.Write(&rinfo); 2674 reloc_info_writer.Write(&rinfo);
2674 } 2675 }
2675 } 2676 }
2676 2677
2677 2678
2678 void Assembler::CheckConstPool(bool force_emit, bool require_jump) { 2679 void Assembler::CheckConstPool(bool force_emit, bool require_jump) {
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
2779 2780
2780 // Since a constant pool was just emitted, move the check offset forward by 2781 // Since a constant pool was just emitted, move the check offset forward by
2781 // the standard interval. 2782 // the standard interval.
2782 next_buffer_check_ = pc_offset() + kCheckConstInterval; 2783 next_buffer_check_ = pc_offset() + kCheckConstInterval;
2783 } 2784 }
2784 2785
2785 2786
2786 } } // namespace v8::internal 2787 } } // namespace v8::internal
2787 2788
2788 #endif // V8_TARGET_ARCH_ARM 2789 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/assembler-arm.h ('k') | src/arm/macro-assembler-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698