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