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

Side by Side Diff: src/hydrogen.cc

Issue 15778012: Fix bogus assertions for tracing and verify. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 520
521 int visited_count_; 521 int visited_count_;
522 ZoneList<HBasicBlock*> stack_; 522 ZoneList<HBasicBlock*> stack_;
523 BitVector reachable_; 523 BitVector reachable_;
524 HBasicBlock* dont_visit_; 524 HBasicBlock* dont_visit_;
525 }; 525 };
526 526
527 527
528 void HGraph::Verify(bool do_full_verify) const { 528 void HGraph::Verify(bool do_full_verify) const {
529 Heap::RelocationLock(isolate()->heap()); 529 Heap::RelocationLock(isolate()->heap());
530 AllowDeferredHandleDereference allow_deferred_deref; 530 AllowHandleDereference ahd;
Michael Starzinger 2013/06/06 15:22:40 Can we rename these scopes to "allow_deref" and "a
531 AllowDeferredHandleDereference adhd;
531 for (int i = 0; i < blocks_.length(); i++) { 532 for (int i = 0; i < blocks_.length(); i++) {
532 HBasicBlock* block = blocks_.at(i); 533 HBasicBlock* block = blocks_.at(i);
533 534
534 block->Verify(); 535 block->Verify();
535 536
536 // Check that every block contains at least one node and that only the last 537 // Check that every block contains at least one node and that only the last
537 // node is a control instruction. 538 // node is a control instruction.
538 HInstruction* current = block->first(); 539 HInstruction* current = block->first();
539 ASSERT(current != NULL && current->IsBlockEntry()); 540 ASSERT(current != NULL && current->IsBlockEntry());
540 while (current != NULL) { 541 while (current != NULL) {
(...skipping 4016 matching lines...) Expand 10 before | Expand all | Expand 10 after
4557 4558
4558 4559
4559 void HGraph::MarkLive(HValue* ref, HValue* instr, ZoneList<HValue*>* worklist) { 4560 void HGraph::MarkLive(HValue* ref, HValue* instr, ZoneList<HValue*>* worklist) {
4560 if (!instr->CheckFlag(HValue::kIsLive)) { 4561 if (!instr->CheckFlag(HValue::kIsLive)) {
4561 instr->SetFlag(HValue::kIsLive); 4562 instr->SetFlag(HValue::kIsLive);
4562 worklist->Add(instr, zone()); 4563 worklist->Add(instr, zone());
4563 4564
4564 if (FLAG_trace_dead_code_elimination) { 4565 if (FLAG_trace_dead_code_elimination) {
4565 HeapStringAllocator allocator; 4566 HeapStringAllocator allocator;
4566 StringStream stream(&allocator); 4567 StringStream stream(&allocator);
4567 AllowDeferredHandleDereference debug_output; 4568 AllowHandleDereference ahd;
4569 AllowDeferredHandleDereference adhd;
4568 if (ref != NULL) { 4570 if (ref != NULL) {
4569 ref->PrintTo(&stream); 4571 ref->PrintTo(&stream);
4570 } else { 4572 } else {
4571 stream.Add("root "); 4573 stream.Add("root ");
4572 } 4574 }
4573 stream.Add(" -> "); 4575 stream.Add(" -> ");
4574 instr->PrintTo(&stream); 4576 instr->PrintTo(&stream);
4575 PrintF("[MarkLive %s]\n", *stream.ToCString()); 4577 PrintF("[MarkLive %s]\n", *stream.ToCString());
4576 } 4578 }
4577 } 4579 }
(...skipping 6663 matching lines...) Expand 10 before | Expand all | Expand 10 after
11241 CodeStub::Major major_key = info->code_stub()->MajorKey(); 11243 CodeStub::Major major_key = info->code_stub()->MajorKey();
11242 PrintStringProperty("name", CodeStub::MajorName(major_key, false)); 11244 PrintStringProperty("name", CodeStub::MajorName(major_key, false));
11243 PrintStringProperty("method", "stub"); 11245 PrintStringProperty("method", "stub");
11244 } 11246 }
11245 PrintLongProperty("date", static_cast<int64_t>(OS::TimeCurrentMillis())); 11247 PrintLongProperty("date", static_cast<int64_t>(OS::TimeCurrentMillis()));
11246 } 11248 }
11247 11249
11248 11250
11249 void HTracer::TraceLithium(const char* name, LChunk* chunk) { 11251 void HTracer::TraceLithium(const char* name, LChunk* chunk) {
11250 ASSERT(!FLAG_parallel_recompilation); 11252 ASSERT(!FLAG_parallel_recompilation);
11251 AllowDeferredHandleDereference debug_output; 11253 AllowHandleDereference ahd;
11254 AllowDeferredHandleDereference adhd;
11252 Trace(name, chunk->graph(), chunk); 11255 Trace(name, chunk->graph(), chunk);
11253 } 11256 }
11254 11257
11255 11258
11256 void HTracer::TraceHydrogen(const char* name, HGraph* graph) { 11259 void HTracer::TraceHydrogen(const char* name, HGraph* graph) {
11257 ASSERT(!FLAG_parallel_recompilation); 11260 ASSERT(!FLAG_parallel_recompilation);
11258 AllowDeferredHandleDereference debug_output; 11261 AllowHandleDereference ahd;
11262 AllowDeferredHandleDereference adhd;
11259 Trace(name, graph, NULL); 11263 Trace(name, graph, NULL);
11260 } 11264 }
11261 11265
11262 11266
11263 void HTracer::Trace(const char* name, HGraph* graph, LChunk* chunk) { 11267 void HTracer::Trace(const char* name, HGraph* graph, LChunk* chunk) {
11264 Tag tag(this, "cfg"); 11268 Tag tag(this, "cfg");
11265 PrintStringProperty("name", name); 11269 PrintStringProperty("name", name);
11266 const ZoneList<HBasicBlock*>* blocks = graph->blocks(); 11270 const ZoneList<HBasicBlock*>* blocks = graph->blocks();
11267 for (int i = 0; i < blocks->length(); i++) { 11271 for (int i = 0; i < blocks->length(); i++) {
11268 HBasicBlock* current = blocks->at(i); 11272 HBasicBlock* current = blocks->at(i);
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
11599 } 11603 }
11600 } 11604 }
11601 11605
11602 #ifdef DEBUG 11606 #ifdef DEBUG
11603 if (graph_ != NULL) graph_->Verify(false); // No full verify. 11607 if (graph_ != NULL) graph_->Verify(false); // No full verify.
11604 if (allocator_ != NULL) allocator_->Verify(); 11608 if (allocator_ != NULL) allocator_->Verify();
11605 #endif 11609 #endif
11606 } 11610 }
11607 11611
11608 } } // namespace v8::internal 11612 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698