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 2710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2721 | 2721 |
2722 DCHECK_IMPLIES(use_temp_zone, temp_zoned_); | 2722 DCHECK_IMPLIES(use_temp_zone, temp_zoned_); |
2723 if (FLAG_trace_preparse) { | 2723 if (FLAG_trace_preparse) { |
2724 PrintF(" [%s]: %i-%i %.*s\n", | 2724 PrintF(" [%s]: %i-%i %.*s\n", |
2725 is_lazy_top_level_function | 2725 is_lazy_top_level_function |
2726 ? "Preparse no-resolution" | 2726 ? "Preparse no-resolution" |
2727 : (temp_zoned_ ? "Preparse resolution" : "Full parse"), | 2727 : (temp_zoned_ ? "Preparse resolution" : "Full parse"), |
2728 scope->start_position(), scope->end_position(), | 2728 scope->start_position(), scope->end_position(), |
2729 function_name->byte_length(), function_name->raw_data()); | 2729 function_name->byte_length(), function_name->raw_data()); |
2730 } | 2730 } |
2731 if (is_lazy_top_level_function) { | 2731 if (V8_UNLIKELY(FLAG_runtime_stats)) { |
2732 CHANGE_CURRENT_RUNTIME_COUNTER(runtime_call_stats_, | 2732 if (is_lazy_top_level_function) { |
2733 PreParseNoVariableResolution); | 2733 RuntimeCallStats::CorrectCurrentCounterId( |
2734 } else if (temp_zoned_) { | 2734 runtime_call_stats_, |
2735 CHANGE_CURRENT_RUNTIME_COUNTER(runtime_call_stats_, | 2735 parsing_on_main_thread_ |
2736 PreParseWithVariableResolution); | 2736 ? &RuntimeCallStats::PreParseNoVariableResolution |
2737 : &RuntimeCallStats::PreParseBackgroundNoVariableResolution); | |
2738 } else if (temp_zoned_) { | |
2739 RuntimeCallStats::CorrectCurrentCounterId( | |
2740 runtime_call_stats_, | |
2741 parsing_on_main_thread_ | |
2742 ? &RuntimeCallStats::PreParseWithVariableResolution | |
2743 : &RuntimeCallStats::PreParseBackgroundWithVariableResolution); | |
2744 } | |
vogelheim
2016/12/01 15:57:42
For my understanding: What about the 'else' case,
| |
2737 } | 2745 } |
2738 | 2746 |
2739 // Validate function name. We can do this only after parsing the function, | 2747 // Validate function name. We can do this only after parsing the function, |
2740 // since the function can declare itself strict. | 2748 // since the function can declare itself strict. |
2741 language_mode = scope->language_mode(); | 2749 language_mode = scope->language_mode(); |
2742 CheckFunctionName(language_mode, function_name, function_name_validity, | 2750 CheckFunctionName(language_mode, function_name, function_name_validity, |
2743 function_name_location, CHECK_OK); | 2751 function_name_location, CHECK_OK); |
2744 | 2752 |
2745 if (is_strict(language_mode)) { | 2753 if (is_strict(language_mode)) { |
2746 CheckStrictOctalLiteral(scope->start_position(), scope->end_position(), | 2754 CheckStrictOctalLiteral(scope->start_position(), scope->end_position(), |
(...skipping 2722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5469 | 5477 |
5470 return final_loop; | 5478 return final_loop; |
5471 } | 5479 } |
5472 | 5480 |
5473 #undef CHECK_OK | 5481 #undef CHECK_OK |
5474 #undef CHECK_OK_VOID | 5482 #undef CHECK_OK_VOID |
5475 #undef CHECK_FAILED | 5483 #undef CHECK_FAILED |
5476 | 5484 |
5477 } // namespace internal | 5485 } // namespace internal |
5478 } // namespace v8 | 5486 } // namespace v8 |
OLD | NEW |