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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
281 // Emit a single byte. Must always be inlined. | 281 // Emit a single byte. Must always be inlined. |
282 #define EMIT(x) \ | 282 #define EMIT(x) \ |
283 *pc_++ = (x) | 283 *pc_++ = (x) |
284 | 284 |
285 | 285 |
286 #ifdef GENERATED_CODE_COVERAGE | 286 #ifdef GENERATED_CODE_COVERAGE |
287 static void InitCoverageLog(); | 287 static void InitCoverageLog(); |
288 #endif | 288 #endif |
289 | 289 |
290 // spare_buffer_ | 290 // spare_buffer_ |
291 static byte* spare_buffer_ = NULL; | 291 byte* Assembler::spare_buffer_ = NULL; |
Lasse Reichstein
2009/05/20 12:00:25
I think this one should be static. It's for reusin
William Hesse
2009/05/20 16:14:30
The declaration in the class definition is static.
| |
292 | 292 |
293 Assembler::Assembler(void* buffer, int buffer_size) { | 293 Assembler::Assembler(void* buffer, int buffer_size) { |
294 if (buffer == NULL) { | 294 if (buffer == NULL) { |
295 // do our own buffer management | 295 // do our own buffer management |
296 if (buffer_size <= kMinimalBufferSize) { | 296 if (buffer_size <= kMinimalBufferSize) { |
297 buffer_size = kMinimalBufferSize; | 297 buffer_size = kMinimalBufferSize; |
298 | 298 |
299 if (spare_buffer_ != NULL) { | 299 if (spare_buffer_ != NULL) { |
300 buffer = spare_buffer_; | 300 buffer = spare_buffer_; |
301 spare_buffer_ = NULL; | 301 spare_buffer_ = NULL; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
361 desc->buffer = buffer_; | 361 desc->buffer = buffer_; |
362 desc->buffer_size = buffer_size_; | 362 desc->buffer_size = buffer_size_; |
363 desc->instr_size = pc_offset(); | 363 desc->instr_size = pc_offset(); |
364 desc->reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos(); | 364 desc->reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos(); |
365 desc->origin = this; | 365 desc->origin = this; |
366 | 366 |
367 Counters::reloc_info_size.Increment(desc->reloc_size); | 367 Counters::reloc_info_size.Increment(desc->reloc_size); |
368 } | 368 } |
369 | 369 |
370 | 370 |
371 void Assembler::Align(int m) { | 371 void Assembler::Align(intptr_t m) { |
372 ASSERT(IsPowerOf2(m)); | 372 ASSERT(IsPowerOf2(m)); |
373 while ((pc_offset() & (m - 1)) != 0) { | 373 while ((pc_offset() & (m - 1)) != 0) { |
374 nop(); | 374 nop(); |
375 } | 375 } |
376 } | 376 } |
377 | 377 |
378 | 378 |
379 void Assembler::cpuid() { | 379 void Assembler::cpuid() { |
380 ASSERT(CpuFeatures::IsEnabled(CpuFeatures::CPUID)); | 380 ASSERT(CpuFeatures::IsEnabled(CpuFeatures::CPUID)); |
381 EnsureSpace ensure_space(this); | 381 EnsureSpace ensure_space(this); |
(...skipping 1849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2231 push_insn[1] = 13; // Skip over coverage insns. | 2231 push_insn[1] = 13; // Skip over coverage insns. |
2232 if (coverage_log != NULL) { | 2232 if (coverage_log != NULL) { |
2233 fprintf(coverage_log, "%s\n", file_line); | 2233 fprintf(coverage_log, "%s\n", file_line); |
2234 fflush(coverage_log); | 2234 fflush(coverage_log); |
2235 } | 2235 } |
2236 } | 2236 } |
2237 | 2237 |
2238 #endif | 2238 #endif |
2239 | 2239 |
2240 } } // namespace v8::internal | 2240 } } // namespace v8::internal |
OLD | NEW |