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 1632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1643 } | 1643 } |
1644 script->set_origin_options(resource_options); | 1644 script->set_origin_options(resource_options); |
1645 if (!source_map_url.is_null()) { | 1645 if (!source_map_url.is_null()) { |
1646 script->set_source_mapping_url(*source_map_url); | 1646 script->set_source_mapping_url(*source_map_url); |
1647 } | 1647 } |
1648 | 1648 |
1649 // Compile the function and add it to the cache. | 1649 // Compile the function and add it to the cache. |
1650 Zone zone; | 1650 Zone zone; |
1651 ParseInfo parse_info(&zone, script); | 1651 ParseInfo parse_info(&zone, script); |
1652 CompilationInfo info(&parse_info); | 1652 CompilationInfo info(&parse_info); |
1653 if (FLAG_harmony_modules && is_module) { | 1653 if (is_module) { |
1654 parse_info.set_module(); | 1654 parse_info.set_module(); |
1655 } else { | 1655 } else { |
1656 parse_info.set_global(); | 1656 parse_info.set_global(); |
1657 } | 1657 } |
1658 if (compile_options != ScriptCompiler::kNoCompileOptions) { | 1658 if (compile_options != ScriptCompiler::kNoCompileOptions) { |
1659 parse_info.set_cached_data(cached_data); | 1659 parse_info.set_cached_data(cached_data); |
1660 } | 1660 } |
1661 parse_info.set_compile_options(compile_options); | 1661 parse_info.set_compile_options(compile_options); |
1662 parse_info.set_extension(extension); | 1662 parse_info.set_extension(extension); |
1663 parse_info.set_context(context); | 1663 parse_info.set_context(context); |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1972 | 1972 |
1973 #if DEBUG | 1973 #if DEBUG |
1974 void CompilationInfo::PrintAstForTesting() { | 1974 void CompilationInfo::PrintAstForTesting() { |
1975 PrintF("--- Source from AST ---\n%s\n", | 1975 PrintF("--- Source from AST ---\n%s\n", |
1976 PrettyPrinter(isolate()).PrintProgram(literal())); | 1976 PrettyPrinter(isolate()).PrintProgram(literal())); |
1977 } | 1977 } |
1978 #endif | 1978 #endif |
1979 | 1979 |
1980 } // namespace internal | 1980 } // namespace internal |
1981 } // namespace v8 | 1981 } // namespace v8 |
OLD | NEW |