| 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/parsing/parser.h" | 5 #include "src/parsing/parser.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "src/api.h" | 9 #include "src/api.h" |
| 10 #include "src/ast/ast-expression-rewriter.h" | 10 #include "src/ast/ast-expression-rewriter.h" |
| (...skipping 2680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2691 scope->AnalyzePartially(&previous_zone_ast_node_factory); | 2691 scope->AnalyzePartially(&previous_zone_ast_node_factory); |
| 2692 } | 2692 } |
| 2693 | 2693 |
| 2694 if (FLAG_trace_preparse) { | 2694 if (FLAG_trace_preparse) { |
| 2695 PrintF(" [%s]: %i-%i %.*s\n", | 2695 PrintF(" [%s]: %i-%i %.*s\n", |
| 2696 is_lazy_top_level_function | 2696 is_lazy_top_level_function |
| 2697 ? "Preparse no-resolution" | 2697 ? "Preparse no-resolution" |
| 2698 : (use_temp_zone ? "Preparse resolution" : "Full parse"), | 2698 : (use_temp_zone ? "Preparse resolution" : "Full parse"), |
| 2699 scope->start_position(), scope->end_position(), | 2699 scope->start_position(), scope->end_position(), |
| 2700 function_name->byte_length(), function_name->raw_data()); | 2700 function_name->byte_length(), function_name->raw_data()); |
| 2701 if (is_lazy_top_level_function) { | 2701 } |
| 2702 CHANGE_CURRENT_RUNTIME_COUNTER(runtime_call_stats_, | 2702 if (is_lazy_top_level_function) { |
| 2703 PreParseNoVariableResolution); | 2703 CHANGE_CURRENT_RUNTIME_COUNTER(runtime_call_stats_, |
| 2704 } else if (use_temp_zone) { | 2704 PreParseNoVariableResolution); |
| 2705 CHANGE_CURRENT_RUNTIME_COUNTER(runtime_call_stats_, | 2705 } else if (use_temp_zone) { |
| 2706 PreParseWithVariableResolution); | 2706 CHANGE_CURRENT_RUNTIME_COUNTER(runtime_call_stats_, |
| 2707 } | 2707 PreParseWithVariableResolution); |
| 2708 } | 2708 } |
| 2709 | 2709 |
| 2710 // Validate function name. We can do this only after parsing the function, | 2710 // Validate function name. We can do this only after parsing the function, |
| 2711 // since the function can declare itself strict. | 2711 // since the function can declare itself strict. |
| 2712 language_mode = scope->language_mode(); | 2712 language_mode = scope->language_mode(); |
| 2713 CheckFunctionName(language_mode, function_name, function_name_validity, | 2713 CheckFunctionName(language_mode, function_name, function_name_validity, |
| 2714 function_name_location, CHECK_OK); | 2714 function_name_location, CHECK_OK); |
| 2715 | 2715 |
| 2716 if (is_strict(language_mode)) { | 2716 if (is_strict(language_mode)) { |
| 2717 CheckStrictOctalLiteral(scope->start_position(), scope->end_position(), | 2717 CheckStrictOctalLiteral(scope->start_position(), scope->end_position(), |
| (...skipping 2719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5437 | 5437 |
| 5438 return final_loop; | 5438 return final_loop; |
| 5439 } | 5439 } |
| 5440 | 5440 |
| 5441 #undef CHECK_OK | 5441 #undef CHECK_OK |
| 5442 #undef CHECK_OK_VOID | 5442 #undef CHECK_OK_VOID |
| 5443 #undef CHECK_FAILED | 5443 #undef CHECK_FAILED |
| 5444 | 5444 |
| 5445 } // namespace internal | 5445 } // namespace internal |
| 5446 } // namespace v8 | 5446 } // namespace v8 |
| OLD | NEW |