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/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 1552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1563 bool tracing_on = info()->IsStub() | 1563 bool tracing_on = info()->IsStub() |
1564 ? FLAG_trace_hydrogen_stubs | 1564 ? FLAG_trace_hydrogen_stubs |
1565 : (FLAG_trace_hydrogen && | 1565 : (FLAG_trace_hydrogen && |
1566 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); | 1566 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); |
1567 return (tracing_on && | 1567 return (tracing_on && |
1568 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); | 1568 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); |
1569 } | 1569 } |
1570 | 1570 |
1571 | 1571 |
1572 CompilationInfoWithZone::CompilationInfoWithZone(Handle<Script> script) | 1572 CompilationInfoWithZone::CompilationInfoWithZone(Handle<Script> script) |
1573 : CompilationInfo((new ParseInfo(&zone_))->InitializeFromScript(script)) {} | 1573 : CompilationInfo(new ParseInfo(&zone_, script)) {} |
1574 | 1574 |
1575 | 1575 |
1576 CompilationInfoWithZone::CompilationInfoWithZone(Handle<JSFunction> function) | 1576 CompilationInfoWithZone::CompilationInfoWithZone(Handle<JSFunction> function) |
1577 : CompilationInfo( | 1577 : CompilationInfo(new ParseInfo(&zone_, function)) {} |
1578 (new ParseInfo(&zone_))->InitializeFromJSFunction(function)) {} | |
1579 | 1578 |
1580 | 1579 |
1581 CompilationInfoWithZone::CompilationInfoWithZone( | 1580 CompilationInfoWithZone::CompilationInfoWithZone( |
1582 Handle<SharedFunctionInfo> shared_info) | 1581 Handle<SharedFunctionInfo> shared_info) |
1583 : CompilationInfo((new ParseInfo(&zone_)) | 1582 : CompilationInfo(new ParseInfo(&zone_, shared_info)) {} |
1584 ->InitializeFromSharedFunctionInfo(shared_info)) {} | |
1585 | 1583 |
1586 | 1584 |
1587 CompilationInfoWithZone::~CompilationInfoWithZone() { | 1585 CompilationInfoWithZone::~CompilationInfoWithZone() { |
1588 DisableFutureOptimization(); | 1586 DisableFutureOptimization(); |
1589 RollbackDependencies(); | 1587 RollbackDependencies(); |
1590 delete parse_info_; | 1588 delete parse_info_; |
1591 parse_info_ = nullptr; | 1589 parse_info_ = nullptr; |
1592 } | 1590 } |
1593 | 1591 |
1594 #if DEBUG | 1592 #if DEBUG |
1595 void CompilationInfo::PrintAstForTesting() { | 1593 void CompilationInfo::PrintAstForTesting() { |
1596 PrintF("--- Source from AST ---\n%s\n", | 1594 PrintF("--- Source from AST ---\n%s\n", |
1597 PrettyPrinter(isolate(), zone()).PrintProgram(function())); | 1595 PrettyPrinter(isolate(), zone()).PrintProgram(function())); |
1598 } | 1596 } |
1599 #endif | 1597 #endif |
1600 } } // namespace v8::internal | 1598 } } // namespace v8::internal |
OLD | NEW |