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

Side by Side Diff: src/parser.cc

Issue 480543002: Parse 'super' keyword. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Patch for landing (minor fix for tests in release mode) Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « src/parser.h ('k') | src/preparser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/api.h" 7 #include "src/api.h"
8 #include "src/ast.h" 8 #include "src/ast.h"
9 #include "src/base/platform/platform.h" 9 #include "src/base/platform/platform.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 const AstRawString* ParserTraits::GetNextSymbol(Scanner* scanner) { 612 const AstRawString* ParserTraits::GetNextSymbol(Scanner* scanner) {
613 return parser_->scanner()->NextSymbol(parser_->ast_value_factory_); 613 return parser_->scanner()->NextSymbol(parser_->ast_value_factory_);
614 } 614 }
615 615
616 616
617 Expression* ParserTraits::ThisExpression( 617 Expression* ParserTraits::ThisExpression(
618 Scope* scope, AstNodeFactory<AstConstructionVisitor>* factory, int pos) { 618 Scope* scope, AstNodeFactory<AstConstructionVisitor>* factory, int pos) {
619 return factory->NewVariableProxy(scope->receiver(), pos); 619 return factory->NewVariableProxy(scope->receiver(), pos);
620 } 620 }
621 621
622 Expression* ParserTraits::SuperReference(
623 Scope* scope, AstNodeFactory<AstConstructionVisitor>* factory, int pos) {
624 return factory->NewSuperReference(
625 ThisExpression(scope, factory, pos)->AsVariableProxy(),
626 pos);
627 }
622 628
623 Literal* ParserTraits::ExpressionFromLiteral( 629 Literal* ParserTraits::ExpressionFromLiteral(
624 Token::Value token, int pos, 630 Token::Value token, int pos,
625 Scanner* scanner, 631 Scanner* scanner,
626 AstNodeFactory<AstConstructionVisitor>* factory) { 632 AstNodeFactory<AstConstructionVisitor>* factory) {
627 switch (token) { 633 switch (token) {
628 case Token::NULL_LITERAL: 634 case Token::NULL_LITERAL:
629 return factory->NewNullLiteral(pos); 635 return factory->NewNullLiteral(pos);
630 case Token::TRUE_LITERAL: 636 case Token::TRUE_LITERAL:
631 return factory->NewBooleanLiteral(true, pos); 637 return factory->NewBooleanLiteral(true, pos);
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 pending_error_char_arg_(NULL) { 730 pending_error_char_arg_(NULL) {
725 DCHECK(!script_.is_null()); 731 DCHECK(!script_.is_null());
726 isolate_->set_ast_node_id(0); 732 isolate_->set_ast_node_id(0);
727 set_allow_harmony_scoping(!info->is_native() && FLAG_harmony_scoping); 733 set_allow_harmony_scoping(!info->is_native() && FLAG_harmony_scoping);
728 set_allow_modules(!info->is_native() && FLAG_harmony_modules); 734 set_allow_modules(!info->is_native() && FLAG_harmony_modules);
729 set_allow_natives_syntax(FLAG_allow_natives_syntax || info->is_native()); 735 set_allow_natives_syntax(FLAG_allow_natives_syntax || info->is_native());
730 set_allow_lazy(false); // Must be explicitly enabled. 736 set_allow_lazy(false); // Must be explicitly enabled.
731 set_allow_generators(FLAG_harmony_generators); 737 set_allow_generators(FLAG_harmony_generators);
732 set_allow_arrow_functions(FLAG_harmony_arrow_functions); 738 set_allow_arrow_functions(FLAG_harmony_arrow_functions);
733 set_allow_harmony_numeric_literals(FLAG_harmony_numeric_literals); 739 set_allow_harmony_numeric_literals(FLAG_harmony_numeric_literals);
740 set_allow_classes(FLAG_harmony_classes);
734 for (int feature = 0; feature < v8::Isolate::kUseCounterFeatureCount; 741 for (int feature = 0; feature < v8::Isolate::kUseCounterFeatureCount;
735 ++feature) { 742 ++feature) {
736 use_counts_[feature] = 0; 743 use_counts_[feature] = 0;
737 } 744 }
738 } 745 }
739 746
740 747
741 FunctionLiteral* Parser::ParseProgram() { 748 FunctionLiteral* Parser::ParseProgram() {
742 // TODO(bmeurer): We temporarily need to pass allow_nesting = true here, 749 // TODO(bmeurer): We temporarily need to pass allow_nesting = true here,
743 // see comment for HistogramTimerScope class. 750 // see comment for HistogramTimerScope class.
(...skipping 4058 matching lines...) Expand 10 before | Expand all | Expand 10 after
4802 info()->SetAstValueFactory(ast_value_factory_); 4809 info()->SetAstValueFactory(ast_value_factory_);
4803 } 4810 }
4804 ast_value_factory_ = NULL; 4811 ast_value_factory_ = NULL;
4805 4812
4806 InternalizeUseCounts(); 4813 InternalizeUseCounts();
4807 4814
4808 return (result != NULL); 4815 return (result != NULL);
4809 } 4816 }
4810 4817
4811 } } // namespace v8::internal 4818 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/parser.h ('k') | src/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698