| 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/compiler.h" | 5 #include "src/compiler.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "src/ast/ast-numbering.h" | 9 #include "src/ast/ast-numbering.h" |
| 10 #include "src/ast/prettyprinter.h" | 10 #include "src/ast/prettyprinter.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 #include "src/parsing/rewriter.h" | 30 #include "src/parsing/rewriter.h" |
| 31 #include "src/parsing/scanner-character-streams.h" | 31 #include "src/parsing/scanner-character-streams.h" |
| 32 #include "src/profiler/cpu-profiler.h" | 32 #include "src/profiler/cpu-profiler.h" |
| 33 #include "src/runtime-profiler.h" | 33 #include "src/runtime-profiler.h" |
| 34 #include "src/snapshot/serialize.h" | 34 #include "src/snapshot/serialize.h" |
| 35 #include "src/vm-state-inl.h" | 35 #include "src/vm-state-inl.h" |
| 36 | 36 |
| 37 namespace v8 { | 37 namespace v8 { |
| 38 namespace internal { | 38 namespace internal { |
| 39 | 39 |
| 40 std::ostream& operator<<(std::ostream& os, const SourcePosition& p) { | |
| 41 if (p.IsUnknown()) { | |
| 42 return os << "<?>"; | |
| 43 } else if (FLAG_hydrogen_track_positions) { | |
| 44 return os << "<" << p.inlining_id() << ":" << p.position() << ">"; | |
| 45 } else { | |
| 46 return os << "<0:" << p.raw() << ">"; | |
| 47 } | |
| 48 } | |
| 49 | |
| 50 | 40 |
| 51 #define PARSE_INFO_GETTER(type, name) \ | 41 #define PARSE_INFO_GETTER(type, name) \ |
| 52 type CompilationInfo::name() const { \ | 42 type CompilationInfo::name() const { \ |
| 53 CHECK(parse_info()); \ | 43 CHECK(parse_info()); \ |
| 54 return parse_info()->name(); \ | 44 return parse_info()->name(); \ |
| 55 } | 45 } |
| 56 | 46 |
| 57 | 47 |
| 58 #define PARSE_INFO_GETTER_WITH_DEFAULT(type, name, def) \ | 48 #define PARSE_INFO_GETTER_WITH_DEFAULT(type, name, def) \ |
| 59 type CompilationInfo::name() const { \ | 49 type CompilationInfo::name() const { \ |
| (...skipping 1795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1855 } | 1845 } |
| 1856 | 1846 |
| 1857 #if DEBUG | 1847 #if DEBUG |
| 1858 void CompilationInfo::PrintAstForTesting() { | 1848 void CompilationInfo::PrintAstForTesting() { |
| 1859 PrintF("--- Source from AST ---\n%s\n", | 1849 PrintF("--- Source from AST ---\n%s\n", |
| 1860 PrettyPrinter(isolate()).PrintProgram(literal())); | 1850 PrettyPrinter(isolate()).PrintProgram(literal())); |
| 1861 } | 1851 } |
| 1862 #endif | 1852 #endif |
| 1863 } // namespace internal | 1853 } // namespace internal |
| 1864 } // namespace v8 | 1854 } // namespace v8 |
| OLD | NEW |