| 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 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 897 static bool Renumber(ParseInfo* parse_info) { | 897 static bool Renumber(ParseInfo* parse_info) { |
| 898 if (!AstNumbering::Renumber(parse_info->isolate(), parse_info->zone(), | 898 if (!AstNumbering::Renumber(parse_info->isolate(), parse_info->zone(), |
| 899 parse_info->literal())) { | 899 parse_info->literal())) { |
| 900 return false; | 900 return false; |
| 901 } | 901 } |
| 902 Handle<SharedFunctionInfo> shared_info = parse_info->shared_info(); | 902 Handle<SharedFunctionInfo> shared_info = parse_info->shared_info(); |
| 903 if (!shared_info.is_null()) { | 903 if (!shared_info.is_null()) { |
| 904 FunctionLiteral* lit = parse_info->literal(); | 904 FunctionLiteral* lit = parse_info->literal(); |
| 905 shared_info->set_ast_node_count(lit->ast_node_count()); | 905 shared_info->set_ast_node_count(lit->ast_node_count()); |
| 906 MaybeDisableOptimization(shared_info, lit->dont_optimize_reason()); | 906 MaybeDisableOptimization(shared_info, lit->dont_optimize_reason()); |
| 907 shared_info->set_dont_crankshaft(lit->flags() & | 907 shared_info->set_dont_crankshaft( |
| 908 AstProperties::kDontCrankshaft); | 908 shared_info->dont_crankshaft() || |
| 909 (lit->flags() & AstProperties::kDontCrankshaft)); |
| 909 } | 910 } |
| 910 return true; | 911 return true; |
| 911 } | 912 } |
| 912 | 913 |
| 913 | 914 |
| 914 bool Compiler::Analyze(ParseInfo* info) { | 915 bool Compiler::Analyze(ParseInfo* info) { |
| 915 DCHECK_NOT_NULL(info->literal()); | 916 DCHECK_NOT_NULL(info->literal()); |
| 916 if (!Rewriter::Rewrite(info)) return false; | 917 if (!Rewriter::Rewrite(info)) return false; |
| 917 if (!Scope::Analyze(info)) return false; | 918 if (!Scope::Analyze(info)) return false; |
| 918 if (!Renumber(info)) return false; | 919 if (!Renumber(info)) return false; |
| (...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1887 } | 1888 } |
| 1888 | 1889 |
| 1889 #if DEBUG | 1890 #if DEBUG |
| 1890 void CompilationInfo::PrintAstForTesting() { | 1891 void CompilationInfo::PrintAstForTesting() { |
| 1891 PrintF("--- Source from AST ---\n%s\n", | 1892 PrintF("--- Source from AST ---\n%s\n", |
| 1892 PrettyPrinter(isolate()).PrintProgram(literal())); | 1893 PrettyPrinter(isolate()).PrintProgram(literal())); |
| 1893 } | 1894 } |
| 1894 #endif | 1895 #endif |
| 1895 } // namespace internal | 1896 } // namespace internal |
| 1896 } // namespace v8 | 1897 } // namespace v8 |
| OLD | NEW |