| 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 495 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 506 | 506 | 
| 507   int visited_count_; | 507   int visited_count_; | 
| 508   ZoneList<HBasicBlock*> stack_; | 508   ZoneList<HBasicBlock*> stack_; | 
| 509   BitVector reachable_; | 509   BitVector reachable_; | 
| 510   HBasicBlock* dont_visit_; | 510   HBasicBlock* dont_visit_; | 
| 511 }; | 511 }; | 
| 512 | 512 | 
| 513 | 513 | 
| 514 void HGraph::Verify(bool do_full_verify) const { | 514 void HGraph::Verify(bool do_full_verify) const { | 
| 515   Heap::RelocationLock(isolate()->heap()); | 515   Heap::RelocationLock(isolate()->heap()); | 
| 516   ALLOW_HANDLE_DEREF(isolate(), "debug mode verification"); | 516   ALLOW_DEFERRED_HANDLE_DEREF(isolate(), "debug mode verification"); | 
| 517   for (int i = 0; i < blocks_.length(); i++) { | 517   for (int i = 0; i < blocks_.length(); i++) { | 
| 518     HBasicBlock* block = blocks_.at(i); | 518     HBasicBlock* block = blocks_.at(i); | 
| 519 | 519 | 
| 520     block->Verify(); | 520     block->Verify(); | 
| 521 | 521 | 
| 522     // Check that every block contains at least one node and that only the last | 522     // Check that every block contains at least one node and that only the last | 
| 523     // node is a control instruction. | 523     // node is a control instruction. | 
| 524     HInstruction* current = block->first(); | 524     HInstruction* current = block->first(); | 
| 525     ASSERT(current != NULL && current->IsBlockEntry()); | 525     ASSERT(current != NULL && current->IsBlockEntry()); | 
| 526     while (current != NULL) { | 526     while (current != NULL) { | 
| (...skipping 1506 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2033 | 2033 | 
| 2034 | 2034 | 
| 2035 HBasicBlock* HGraph::CreateBasicBlock() { | 2035 HBasicBlock* HGraph::CreateBasicBlock() { | 
| 2036   HBasicBlock* result = new(zone()) HBasicBlock(this); | 2036   HBasicBlock* result = new(zone()) HBasicBlock(this); | 
| 2037   blocks_.Add(result, zone()); | 2037   blocks_.Add(result, zone()); | 
| 2038   return result; | 2038   return result; | 
| 2039 } | 2039 } | 
| 2040 | 2040 | 
| 2041 | 2041 | 
| 2042 void HGraph::FinalizeUniqueValueIds() { | 2042 void HGraph::FinalizeUniqueValueIds() { | 
| 2043   AssertNoAllocation no_gc; | 2043   DisallowHeapAllocation no_gc; | 
| 2044   ASSERT(!isolate()->optimizing_compiler_thread()->IsOptimizerThread()); | 2044   ASSERT(!isolate()->optimizing_compiler_thread()->IsOptimizerThread()); | 
| 2045   for (int i = 0; i < blocks()->length(); ++i) { | 2045   for (int i = 0; i < blocks()->length(); ++i) { | 
| 2046     for (HInstruction* instr = blocks()->at(i)->first(); | 2046     for (HInstruction* instr = blocks()->at(i)->first(); | 
| 2047         instr != NULL; | 2047         instr != NULL; | 
| 2048         instr = instr->next()) { | 2048         instr = instr->next()) { | 
| 2049       instr->FinalizeUniqueValueId(); | 2049       instr->FinalizeUniqueValueId(); | 
| 2050     } | 2050     } | 
| 2051   } | 2051   } | 
| 2052 } | 2052 } | 
| 2053 | 2053 | 
| (...skipping 2476 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 4530 | 4530 | 
| 4531 | 4531 | 
| 4532 void HGraph::MarkLive(HValue* ref, HValue* instr, ZoneList<HValue*>* worklist) { | 4532 void HGraph::MarkLive(HValue* ref, HValue* instr, ZoneList<HValue*>* worklist) { | 
| 4533   if (!instr->CheckFlag(HValue::kIsLive)) { | 4533   if (!instr->CheckFlag(HValue::kIsLive)) { | 
| 4534     instr->SetFlag(HValue::kIsLive); | 4534     instr->SetFlag(HValue::kIsLive); | 
| 4535     worklist->Add(instr, zone()); | 4535     worklist->Add(instr, zone()); | 
| 4536 | 4536 | 
| 4537     if (FLAG_trace_dead_code_elimination) { | 4537     if (FLAG_trace_dead_code_elimination) { | 
| 4538       HeapStringAllocator allocator; | 4538       HeapStringAllocator allocator; | 
| 4539       StringStream stream(&allocator); | 4539       StringStream stream(&allocator); | 
| 4540       ALLOW_HANDLE_DEREF(isolate(), "debug mode printing"); | 4540       ALLOW_DEFERRED_HANDLE_DEREF(isolate(), "debug mode printing"); | 
| 4541       if (ref != NULL) { | 4541       if (ref != NULL) { | 
| 4542         ref->PrintTo(&stream); | 4542         ref->PrintTo(&stream); | 
| 4543       } else { | 4543       } else { | 
| 4544         stream.Add("root "); | 4544         stream.Add("root "); | 
| 4545       } | 4545       } | 
| 4546       stream.Add(" -> "); | 4546       stream.Add(" -> "); | 
| 4547       instr->PrintTo(&stream); | 4547       instr->PrintTo(&stream); | 
| 4548       PrintF("[MarkLive %s]\n", *stream.ToCString()); | 4548       PrintF("[MarkLive %s]\n", *stream.ToCString()); | 
| 4549     } | 4549     } | 
| 4550   } | 4550   } | 
| (...skipping 6587 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 11138     CodeStub::Major major_key = info->code_stub()->MajorKey(); | 11138     CodeStub::Major major_key = info->code_stub()->MajorKey(); | 
| 11139     PrintStringProperty("name", CodeStub::MajorName(major_key, false)); | 11139     PrintStringProperty("name", CodeStub::MajorName(major_key, false)); | 
| 11140     PrintStringProperty("method", "stub"); | 11140     PrintStringProperty("method", "stub"); | 
| 11141   } | 11141   } | 
| 11142   PrintLongProperty("date", static_cast<int64_t>(OS::TimeCurrentMillis())); | 11142   PrintLongProperty("date", static_cast<int64_t>(OS::TimeCurrentMillis())); | 
| 11143 } | 11143 } | 
| 11144 | 11144 | 
| 11145 | 11145 | 
| 11146 void HTracer::TraceLithium(const char* name, LChunk* chunk) { | 11146 void HTracer::TraceLithium(const char* name, LChunk* chunk) { | 
| 11147   ASSERT(!FLAG_parallel_recompilation); | 11147   ASSERT(!FLAG_parallel_recompilation); | 
| 11148   ALLOW_HANDLE_DEREF(chunk->isolate(), "debug output"); | 11148   ALLOW_DEFERRED_HANDLE_DEREF(chunk->isolate(), "debug output"); | 
| 11149   Trace(name, chunk->graph(), chunk); | 11149   Trace(name, chunk->graph(), chunk); | 
| 11150 } | 11150 } | 
| 11151 | 11151 | 
| 11152 | 11152 | 
| 11153 void HTracer::TraceHydrogen(const char* name, HGraph* graph) { | 11153 void HTracer::TraceHydrogen(const char* name, HGraph* graph) { | 
| 11154   ASSERT(!FLAG_parallel_recompilation); | 11154   ASSERT(!FLAG_parallel_recompilation); | 
| 11155   ALLOW_HANDLE_DEREF(graph->isolate(), "debug output"); | 11155   ALLOW_DEFERRED_HANDLE_DEREF(graph->isolate(), "debug output"); | 
| 11156   Trace(name, graph, NULL); | 11156   Trace(name, graph, NULL); | 
| 11157 } | 11157 } | 
| 11158 | 11158 | 
| 11159 | 11159 | 
| 11160 void HTracer::Trace(const char* name, HGraph* graph, LChunk* chunk) { | 11160 void HTracer::Trace(const char* name, HGraph* graph, LChunk* chunk) { | 
| 11161   Tag tag(this, "cfg"); | 11161   Tag tag(this, "cfg"); | 
| 11162   PrintStringProperty("name", name); | 11162   PrintStringProperty("name", name); | 
| 11163   const ZoneList<HBasicBlock*>* blocks = graph->blocks(); | 11163   const ZoneList<HBasicBlock*>* blocks = graph->blocks(); | 
| 11164   for (int i = 0; i < blocks->length(); i++) { | 11164   for (int i = 0; i < blocks->length(); i++) { | 
| 11165     HBasicBlock* current = blocks->at(i); | 11165     HBasicBlock* current = blocks->at(i); | 
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 11496     } | 11496     } | 
| 11497   } | 11497   } | 
| 11498 | 11498 | 
| 11499 #ifdef DEBUG | 11499 #ifdef DEBUG | 
| 11500   if (graph_ != NULL) graph_->Verify(false);  // No full verify. | 11500   if (graph_ != NULL) graph_->Verify(false);  // No full verify. | 
| 11501   if (allocator_ != NULL) allocator_->Verify(); | 11501   if (allocator_ != NULL) allocator_->Verify(); | 
| 11502 #endif | 11502 #endif | 
| 11503 } | 11503 } | 
| 11504 | 11504 | 
| 11505 } }  // namespace v8::internal | 11505 } }  // namespace v8::internal | 
| OLD | NEW | 
|---|