OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/compiler.h" | 7 #include "src/compiler.h" |
8 | 8 |
9 #include "src/ast-numbering.h" | 9 #include "src/ast-numbering.h" |
10 #include "src/ast-this-access-visitor.h" | 10 #include "src/ast-this-access-visitor.h" |
(...skipping 1547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1558 : name_(name), info_(info) { | 1558 : name_(name), info_(info) { |
1559 if (FLAG_hydrogen_stats) { | 1559 if (FLAG_hydrogen_stats) { |
1560 info_zone_start_allocation_size_ = info->zone()->allocation_size(); | 1560 info_zone_start_allocation_size_ = info->zone()->allocation_size(); |
1561 timer_.Start(); | 1561 timer_.Start(); |
1562 } | 1562 } |
1563 } | 1563 } |
1564 | 1564 |
1565 | 1565 |
1566 CompilationPhase::~CompilationPhase() { | 1566 CompilationPhase::~CompilationPhase() { |
1567 if (FLAG_hydrogen_stats) { | 1567 if (FLAG_hydrogen_stats) { |
1568 unsigned size = zone()->allocation_size(); | 1568 size_t size = zone()->allocation_size(); |
1569 size += info_->zone()->allocation_size() - info_zone_start_allocation_size_; | 1569 size += info_->zone()->allocation_size() - info_zone_start_allocation_size_; |
1570 isolate()->GetHStatistics()->SaveTiming(name_, timer_.Elapsed(), size); | 1570 isolate()->GetHStatistics()->SaveTiming(name_, timer_.Elapsed(), size); |
1571 } | 1571 } |
1572 } | 1572 } |
1573 | 1573 |
1574 | 1574 |
1575 bool CompilationPhase::ShouldProduceTraceOutput() const { | 1575 bool CompilationPhase::ShouldProduceTraceOutput() const { |
1576 // Trace if the appropriate trace flag is set and the phase name's first | 1576 // Trace if the appropriate trace flag is set and the phase name's first |
1577 // character is in the FLAG_trace_phase command line parameter. | 1577 // character is in the FLAG_trace_phase command line parameter. |
1578 AllowHandleDereference allow_deref; | 1578 AllowHandleDereference allow_deref; |
1579 bool tracing_on = info()->IsStub() | 1579 bool tracing_on = info()->IsStub() |
1580 ? FLAG_trace_hydrogen_stubs | 1580 ? FLAG_trace_hydrogen_stubs |
1581 : (FLAG_trace_hydrogen && | 1581 : (FLAG_trace_hydrogen && |
1582 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); | 1582 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); |
1583 return (tracing_on && | 1583 return (tracing_on && |
1584 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); | 1584 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); |
1585 } | 1585 } |
1586 | 1586 |
1587 | 1587 |
1588 #if DEBUG | 1588 #if DEBUG |
1589 void CompilationInfo::PrintAstForTesting() { | 1589 void CompilationInfo::PrintAstForTesting() { |
1590 PrintF("--- Source from AST ---\n%s\n", | 1590 PrintF("--- Source from AST ---\n%s\n", |
1591 PrettyPrinter(isolate(), zone()).PrintProgram(function())); | 1591 PrettyPrinter(isolate(), zone()).PrintProgram(function())); |
1592 } | 1592 } |
1593 #endif | 1593 #endif |
1594 } } // namespace v8::internal | 1594 } } // namespace v8::internal |
OLD | NEW |