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

Side by Side Diff: src/hydrogen.cc

Issue 12389075: Bugfix: allow handle dereference only when we have a valid hydrogen graph or lithium chunk. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix trailing whitespace Created 7 years, 9 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 10493 matching lines...) Expand 10 before | Expand all | Expand 10 after
10504 } else { 10504 } else {
10505 CodeStub::Major major_key = info->code_stub()->MajorKey(); 10505 CodeStub::Major major_key = info->code_stub()->MajorKey();
10506 PrintStringProperty("name", CodeStub::MajorName(major_key, false)); 10506 PrintStringProperty("name", CodeStub::MajorName(major_key, false));
10507 PrintStringProperty("method", "stub"); 10507 PrintStringProperty("method", "stub");
10508 } 10508 }
10509 PrintLongProperty("date", static_cast<int64_t>(OS::TimeCurrentMillis())); 10509 PrintLongProperty("date", static_cast<int64_t>(OS::TimeCurrentMillis()));
10510 } 10510 }
10511 10511
10512 10512
10513 void HTracer::TraceLithium(const char* name, LChunk* chunk) { 10513 void HTracer::TraceLithium(const char* name, LChunk* chunk) {
10514 AllowHandleDereference allow_handle_deref(chunk->graph()->isolate());
10514 Trace(name, chunk->graph(), chunk); 10515 Trace(name, chunk->graph(), chunk);
10515 } 10516 }
10516 10517
10517 10518
10518 void HTracer::TraceHydrogen(const char* name, HGraph* graph) { 10519 void HTracer::TraceHydrogen(const char* name, HGraph* graph) {
10520 AllowHandleDereference allow_handle_deref(graph->isolate());
10519 Trace(name, graph, NULL); 10521 Trace(name, graph, NULL);
10520 } 10522 }
10521 10523
10522 10524
10523 void HTracer::Trace(const char* name, HGraph* graph, LChunk* chunk) { 10525 void HTracer::Trace(const char* name, HGraph* graph, LChunk* chunk) {
10524 Tag tag(this, "cfg"); 10526 Tag tag(this, "cfg");
10525 PrintStringProperty("name", name); 10527 PrintStringProperty("name", name);
10526 const ZoneList<HBasicBlock*>* blocks = graph->blocks(); 10528 const ZoneList<HBasicBlock*>* blocks = graph->blocks();
10527 for (int i = 0; i < blocks->length(); i++) { 10529 for (int i = 0; i < blocks->length(); i++) {
10528 HBasicBlock* current = blocks->at(i); 10530 HBasicBlock* current = blocks->at(i);
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
10816 if (FLAG_hydrogen_stats) { 10818 if (FLAG_hydrogen_stats) {
10817 int64_t end = OS::Ticks(); 10819 int64_t end = OS::Ticks();
10818 unsigned size = Zone::allocation_size_ - start_allocation_size_; 10820 unsigned size = Zone::allocation_size_ - start_allocation_size_;
10819 HStatistics::Instance()->SaveTiming(name_, end - start_, size); 10821 HStatistics::Instance()->SaveTiming(name_, end - start_, size);
10820 } 10822 }
10821 10823
10822 // Produce trace output if flag is set so that the first letter of the 10824 // Produce trace output if flag is set so that the first letter of the
10823 // phase name matches the command line parameter FLAG_trace_phase. 10825 // phase name matches the command line parameter FLAG_trace_phase.
10824 if (FLAG_trace_hydrogen && 10826 if (FLAG_trace_hydrogen &&
10825 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL) { 10827 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL) {
10826 AllowHandleDereference allow_handle_deref(graph_->isolate());
10827 if (graph_ != NULL) HTracer::Instance()->TraceHydrogen(name_, graph_); 10828 if (graph_ != NULL) HTracer::Instance()->TraceHydrogen(name_, graph_);
10828 if (chunk_ != NULL) HTracer::Instance()->TraceLithium(name_, chunk_); 10829 if (chunk_ != NULL) HTracer::Instance()->TraceLithium(name_, chunk_);
10829 if (allocator_ != NULL) { 10830 if (allocator_ != NULL) {
10830 HTracer::Instance()->TraceLiveRanges(name_, allocator_); 10831 HTracer::Instance()->TraceLiveRanges(name_, allocator_);
10831 } 10832 }
10832 } 10833 }
10833 10834
10834 #ifdef DEBUG 10835 #ifdef DEBUG
10835 if (graph_ != NULL) graph_->Verify(false); // No full verify. 10836 if (graph_ != NULL) graph_->Verify(false); // No full verify.
10836 if (allocator_ != NULL) allocator_->Verify(); 10837 if (allocator_ != NULL) allocator_->Verify();
10837 #endif 10838 #endif
10838 } 10839 }
10839 10840
10840 } } // namespace v8::internal 10841 } } // 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