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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/compiler.h" | 7 #include "src/compiler.h" |
8 | 8 |
9 #include "src/ast-numbering.h" | 9 #include "src/ast-numbering.h" |
10 #include "src/ast-this-access-visitor.h" | 10 #include "src/ast-this-access-visitor.h" |
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 | 611 |
612 // Sets the function info on a function. | 612 // Sets the function info on a function. |
613 // The start_position points to the first '(' character after the function name | 613 // The start_position points to the first '(' character after the function name |
614 // in the full script source. When counting characters in the script source the | 614 // in the full script source. When counting characters in the script source the |
615 // the first character is number 0 (not 1). | 615 // the first character is number 0 (not 1). |
616 static void SetFunctionInfo(Handle<SharedFunctionInfo> function_info, | 616 static void SetFunctionInfo(Handle<SharedFunctionInfo> function_info, |
617 FunctionLiteral* lit, | 617 FunctionLiteral* lit, |
618 bool is_toplevel, | 618 bool is_toplevel, |
619 Handle<Script> script) { | 619 Handle<Script> script) { |
620 function_info->set_length(lit->parameter_count()); | 620 function_info->set_length(lit->parameter_count()); |
621 function_info->set_formal_parameter_count(lit->parameter_count()); | 621 if (FLAG_experimental_classes && IsSubclassConstructor(lit->kind())) { |
| 622 function_info->set_internal_formal_parameter_count(lit->parameter_count() + |
| 623 1); |
| 624 } else { |
| 625 function_info->set_internal_formal_parameter_count(lit->parameter_count()); |
| 626 } |
622 function_info->set_script(*script); | 627 function_info->set_script(*script); |
623 function_info->set_function_token_position(lit->function_token_position()); | 628 function_info->set_function_token_position(lit->function_token_position()); |
624 function_info->set_start_position(lit->start_position()); | 629 function_info->set_start_position(lit->start_position()); |
625 function_info->set_end_position(lit->end_position()); | 630 function_info->set_end_position(lit->end_position()); |
626 function_info->set_is_expression(lit->is_expression()); | 631 function_info->set_is_expression(lit->is_expression()); |
627 function_info->set_is_anonymous(lit->is_anonymous()); | 632 function_info->set_is_anonymous(lit->is_anonymous()); |
628 function_info->set_is_toplevel(is_toplevel); | 633 function_info->set_is_toplevel(is_toplevel); |
629 function_info->set_inferred_name(*lit->inferred_name()); | 634 function_info->set_inferred_name(*lit->inferred_name()); |
630 function_info->set_allows_lazy_compilation(lit->AllowsLazyCompilation()); | 635 function_info->set_allows_lazy_compilation(lit->AllowsLazyCompilation()); |
631 function_info->set_allows_lazy_compilation_without_context( | 636 function_info->set_allows_lazy_compilation_without_context( |
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1615 } | 1620 } |
1616 | 1621 |
1617 | 1622 |
1618 #if DEBUG | 1623 #if DEBUG |
1619 void CompilationInfo::PrintAstForTesting() { | 1624 void CompilationInfo::PrintAstForTesting() { |
1620 PrintF("--- Source from AST ---\n%s\n", | 1625 PrintF("--- Source from AST ---\n%s\n", |
1621 PrettyPrinter(isolate(), zone()).PrintProgram(function())); | 1626 PrettyPrinter(isolate(), zone()).PrintProgram(function())); |
1622 } | 1627 } |
1623 #endif | 1628 #endif |
1624 } } // namespace v8::internal | 1629 } } // namespace v8::internal |
OLD | NEW |