Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(920)

Side by Side Diff: src/compiler.cc

Issue 908883002: new classes: implement new.target passing to superclass constructor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Test Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 function_info->set_formal_parameter_count(lit->parameter_count()); 622 if (FLAG_experimental_classes && IsSubclassConstructor(lit->kind())) {
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 }
623 function_info->set_script(*script); 628 function_info->set_script(*script);
624 function_info->set_function_token_position(lit->function_token_position()); 629 function_info->set_function_token_position(lit->function_token_position());
625 function_info->set_start_position(lit->start_position()); 630 function_info->set_start_position(lit->start_position());
626 function_info->set_end_position(lit->end_position()); 631 function_info->set_end_position(lit->end_position());
627 function_info->set_is_expression(lit->is_expression()); 632 function_info->set_is_expression(lit->is_expression());
628 function_info->set_is_anonymous(lit->is_anonymous()); 633 function_info->set_is_anonymous(lit->is_anonymous());
629 function_info->set_is_toplevel(is_toplevel); 634 function_info->set_is_toplevel(is_toplevel);
630 function_info->set_inferred_name(*lit->inferred_name()); 635 function_info->set_inferred_name(*lit->inferred_name());
631 function_info->set_allows_lazy_compilation(lit->AllowsLazyCompilation()); 636 function_info->set_allows_lazy_compilation(lit->AllowsLazyCompilation());
632 function_info->set_allows_lazy_compilation_without_context( 637 function_info->set_allows_lazy_compilation_without_context(
(...skipping 981 matching lines...) Expand 10 before | Expand all | Expand 10 after
1614 } 1619 }
1615 1620
1616 1621
1617 #if DEBUG 1622 #if DEBUG
1618 void CompilationInfo::PrintAstForTesting() { 1623 void CompilationInfo::PrintAstForTesting() {
1619 PrintF("--- Source from AST ---\n%s\n", 1624 PrintF("--- Source from AST ---\n%s\n",
1620 PrettyPrinter(isolate(), zone()).PrintProgram(function())); 1625 PrettyPrinter(isolate(), zone()).PrintProgram(function()));
1621 } 1626 }
1622 #endif 1627 #endif
1623 } } // namespace v8::internal 1628 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698