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

Side by Side Diff: src/preparser.cc

Issue 923683002: Fix lazy parsing for functions that use super. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Increment the PreparserData version 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
« no previous file with comments | « src/preparse-data-format.h ('k') | src/scopes.cc » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 <cmath> 5 #include <cmath>
6 6
7 #include "src/allocation.h" 7 #include "src/allocation.h"
8 #include "src/base/logging.h" 8 #include "src/base/logging.h"
9 #include "src/conversions-inl.h" 9 #include "src/conversions-inl.h"
10 #include "src/conversions.h" 10 #include "src/conversions.h"
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after
946 946
947 947
948 void PreParser::ParseLazyFunctionLiteralBody(bool* ok) { 948 void PreParser::ParseLazyFunctionLiteralBody(bool* ok) {
949 int body_start = position(); 949 int body_start = position();
950 ParseStatementList(Token::RBRACE, ok); 950 ParseStatementList(Token::RBRACE, ok);
951 if (!*ok) return; 951 if (!*ok) return;
952 952
953 // Position right after terminal '}'. 953 // Position right after terminal '}'.
954 DCHECK_EQ(Token::RBRACE, scanner()->peek()); 954 DCHECK_EQ(Token::RBRACE, scanner()->peek());
955 int body_end = scanner()->peek_location().end_pos; 955 int body_end = scanner()->peek_location().end_pos;
956 log_->LogFunction( 956 log_->LogFunction(body_start, body_end,
957 body_start, body_end, function_state_->materialized_literal_count(), 957 function_state_->materialized_literal_count(),
958 function_state_->expected_property_count(), language_mode()); 958 function_state_->expected_property_count(), language_mode(),
959 scope_->uses_super_property());
959 } 960 }
960 961
961 962
962 PreParserExpression PreParser::ParseClassLiteral( 963 PreParserExpression PreParser::ParseClassLiteral(
963 PreParserIdentifier name, Scanner::Location class_name_location, 964 PreParserIdentifier name, Scanner::Location class_name_location,
964 bool name_is_strict_reserved, int pos, bool* ok) { 965 bool name_is_strict_reserved, int pos, bool* ok) {
965 // All parts of a ClassDeclaration and ClassExpression are strict code. 966 // All parts of a ClassDeclaration and ClassExpression are strict code.
966 if (name_is_strict_reserved) { 967 if (name_is_strict_reserved) {
967 ReportMessageAt(class_name_location, "unexpected_strict_reserved"); 968 ReportMessageAt(class_name_location, "unexpected_strict_reserved");
968 *ok = false; 969 *ok = false;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
1018 ParseIdentifier(kAllowEvalOrArguments, CHECK_OK); 1019 ParseIdentifier(kAllowEvalOrArguments, CHECK_OK);
1019 ParseArguments(ok); 1020 ParseArguments(ok);
1020 1021
1021 return Expression::Default(); 1022 return Expression::Default();
1022 } 1023 }
1023 1024
1024 #undef CHECK_OK 1025 #undef CHECK_OK
1025 1026
1026 1027
1027 } } // v8::internal 1028 } } // v8::internal
OLDNEW
« no previous file with comments | « src/preparse-data-format.h ('k') | src/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698