OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 // ----------------------------------------------------------------------------- | 331 // ----------------------------------------------------------------------------- |
332 // Implementation of Assembler. | 332 // Implementation of Assembler. |
333 | 333 |
334 #ifdef GENERATED_CODE_COVERAGE | 334 #ifdef GENERATED_CODE_COVERAGE |
335 static void InitCoverageLog(); | 335 static void InitCoverageLog(); |
336 #endif | 336 #endif |
337 | 337 |
338 byte* Assembler::spare_buffer_ = NULL; | 338 byte* Assembler::spare_buffer_ = NULL; |
339 | 339 |
340 Assembler::Assembler(void* buffer, int buffer_size) | 340 Assembler::Assembler(void* buffer, int buffer_size) |
341 : code_targets_(100), positions_recorder_(this) { | 341 : code_targets_(100), |
| 342 positions_recorder_(this), |
| 343 emit_debug_code_(FLAG_debug_code) { |
342 if (buffer == NULL) { | 344 if (buffer == NULL) { |
343 // Do our own buffer management. | 345 // Do our own buffer management. |
344 if (buffer_size <= kMinimalBufferSize) { | 346 if (buffer_size <= kMinimalBufferSize) { |
345 buffer_size = kMinimalBufferSize; | 347 buffer_size = kMinimalBufferSize; |
346 | 348 |
347 if (spare_buffer_ != NULL) { | 349 if (spare_buffer_ != NULL) { |
348 buffer = spare_buffer_; | 350 buffer = spare_buffer_; |
349 spare_buffer_ = NULL; | 351 spare_buffer_ = NULL; |
350 } | 352 } |
351 } | 353 } |
(...skipping 2755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3107 | 3109 |
3108 void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) { | 3110 void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) { |
3109 ASSERT(rmode != RelocInfo::NONE); | 3111 ASSERT(rmode != RelocInfo::NONE); |
3110 // Don't record external references unless the heap will be serialized. | 3112 // Don't record external references unless the heap will be serialized. |
3111 if (rmode == RelocInfo::EXTERNAL_REFERENCE) { | 3113 if (rmode == RelocInfo::EXTERNAL_REFERENCE) { |
3112 #ifdef DEBUG | 3114 #ifdef DEBUG |
3113 if (!Serializer::enabled()) { | 3115 if (!Serializer::enabled()) { |
3114 Serializer::TooLateToEnableNow(); | 3116 Serializer::TooLateToEnableNow(); |
3115 } | 3117 } |
3116 #endif | 3118 #endif |
3117 if (!Serializer::enabled() && !FLAG_debug_code) { | 3119 if (!Serializer::enabled() && !emit_debug_code()) { |
3118 return; | 3120 return; |
3119 } | 3121 } |
3120 } | 3122 } |
3121 RelocInfo rinfo(pc_, rmode, data); | 3123 RelocInfo rinfo(pc_, rmode, data); |
3122 reloc_info_writer.Write(&rinfo); | 3124 reloc_info_writer.Write(&rinfo); |
3123 } | 3125 } |
3124 | 3126 |
3125 void Assembler::RecordJSReturn() { | 3127 void Assembler::RecordJSReturn() { |
3126 positions_recorder()->WriteRecordedPositions(); | 3128 positions_recorder()->WriteRecordedPositions(); |
3127 EnsureSpace ensure_space(this); | 3129 EnsureSpace ensure_space(this); |
(...skipping 25 matching lines...) Expand all Loading... |
3153 // specially coded on x64 means that it is a relative 32 bit address, as used | 3155 // specially coded on x64 means that it is a relative 32 bit address, as used |
3154 // by branch instructions. | 3156 // by branch instructions. |
3155 return (1 << rmode_) & kApplyMask; | 3157 return (1 << rmode_) & kApplyMask; |
3156 } | 3158 } |
3157 | 3159 |
3158 | 3160 |
3159 | 3161 |
3160 } } // namespace v8::internal | 3162 } } // namespace v8::internal |
3161 | 3163 |
3162 #endif // V8_TARGET_ARCH_X64 | 3164 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |