OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 return cur->block_id(); | 300 return cur->block_id(); |
301 } | 301 } |
302 | 302 |
303 Label* LChunk::GetAssemblyLabel(int block_id) const { | 303 Label* LChunk::GetAssemblyLabel(int block_id) const { |
304 LLabel* label = GetLabel(block_id); | 304 LLabel* label = GetLabel(block_id); |
305 ASSERT(!label->HasReplacement()); | 305 ASSERT(!label->HasReplacement()); |
306 return label->label(); | 306 return label->label(); |
307 } | 307 } |
308 | 308 |
309 void LChunk::MarkEmptyBlocks() { | 309 void LChunk::MarkEmptyBlocks() { |
310 HPhase phase("L_Mark empty blocks", this); | 310 LPhase phase("L_Mark empty blocks", this); |
311 for (int i = 0; i < graph()->blocks()->length(); ++i) { | 311 for (int i = 0; i < graph()->blocks()->length(); ++i) { |
312 HBasicBlock* block = graph()->blocks()->at(i); | 312 HBasicBlock* block = graph()->blocks()->at(i); |
313 int first = block->first_instruction_index(); | 313 int first = block->first_instruction_index(); |
314 int last = block->last_instruction_index(); | 314 int last = block->last_instruction_index(); |
315 LInstruction* first_instr = instructions()->at(first); | 315 LInstruction* first_instr = instructions()->at(first); |
316 LInstruction* last_instr = instructions()->at(last); | 316 LInstruction* last_instr = instructions()->at(last); |
317 | 317 |
318 LLabel* label = LLabel::cast(first_instr); | 318 LLabel* label = LLabel::cast(first_instr); |
319 if (last_instr->IsGoto()) { | 319 if (last_instr->IsGoto()) { |
320 LGoto* goto_instr = LGoto::cast(last_instr); | 320 LGoto* goto_instr = LGoto::cast(last_instr); |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 spill_slot_count_ += 2; | 484 spill_slot_count_ += 2; |
485 } else { | 485 } else { |
486 spill_slot_count_++; | 486 spill_slot_count_++; |
487 } | 487 } |
488 } | 488 } |
489 iterator.Advance(); | 489 iterator.Advance(); |
490 } | 490 } |
491 } | 491 } |
492 | 492 |
493 | 493 |
| 494 LPhase::LPhase(const char* name, LAllocator* allocator) |
| 495 : CompilationPhase(name, allocator->isolate(), allocator->zone()), |
| 496 allocator_(allocator), chunk_(allocator->chunk()) { } |
| 497 |
| 498 |
| 499 LPhase::LPhase(const char* name, LChunk* chunk) |
| 500 : CompilationPhase(name, chunk->isolate(), chunk->zone()), |
| 501 allocator_(NULL), chunk_(chunk) { } |
| 502 |
| 503 |
| 504 LPhase::~LPhase() { |
| 505 if (ShouldProduceTraceOutput()) { |
| 506 isolate()->GetHTracer()->TraceLithium(name(), chunk_); |
| 507 if (allocator_ != NULL) { |
| 508 isolate()->GetHTracer()->TraceLiveRanges(name(), allocator_); |
| 509 } |
| 510 } |
| 511 |
| 512 #ifdef DEBUG |
| 513 if (allocator_ != NULL) allocator_->Verify(); |
| 514 #endif |
| 515 } |
| 516 |
| 517 |
494 } } // namespace v8::internal | 518 } } // namespace v8::internal |
OLD | NEW |