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

Side by Side Diff: src/preparser.cc

Issue 1180943007: [strong] Make strong 'this' optional for experimentation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Comments Created 5 years, 6 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/preparser.h ('k') | no next file » | 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 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 switch (peek()) { 592 switch (peek()) {
593 case Token::FUNCTION: 593 case Token::FUNCTION:
594 case Token::LBRACE: 594 case Token::LBRACE:
595 UNREACHABLE(); // Always handled by the callers. 595 UNREACHABLE(); // Always handled by the callers.
596 case Token::CLASS: 596 case Token::CLASS:
597 ReportUnexpectedToken(Next()); 597 ReportUnexpectedToken(Next());
598 *ok = false; 598 *ok = false;
599 return Statement::Default(); 599 return Statement::Default();
600 600
601 case Token::THIS: 601 case Token::THIS:
602 if (!FLAG_strong_this) break;
603 // Fall through.
602 case Token::SUPER: 604 case Token::SUPER:
603 if (is_strong(language_mode()) && 605 if (is_strong(language_mode()) &&
604 i::IsConstructor(function_state_->kind())) { 606 i::IsConstructor(function_state_->kind())) {
605 bool is_this = peek() == Token::THIS; 607 bool is_this = peek() == Token::THIS;
606 Expression expr = Expression::Default(); 608 Expression expr = Expression::Default();
607 ExpressionClassifier classifier; 609 ExpressionClassifier classifier;
608 if (is_this) { 610 if (is_this) {
609 expr = ParseStrongInitializationExpression(&classifier, CHECK_OK); 611 expr = ParseStrongInitializationExpression(&classifier, CHECK_OK);
610 } else { 612 } else {
611 expr = ParseStrongSuperCallExpression(&classifier, CHECK_OK); 613 expr = ParseStrongSuperCallExpression(&classifier, CHECK_OK);
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
1184 1186
1185 DCHECK(!spread_pos.IsValid()); 1187 DCHECK(!spread_pos.IsValid());
1186 1188
1187 return Expression::Default(); 1189 return Expression::Default();
1188 } 1190 }
1189 1191
1190 #undef CHECK_OK 1192 #undef CHECK_OK
1191 1193
1192 1194
1193 } } // v8::internal 1195 } } // v8::internal
OLDNEW
« no previous file with comments | « src/preparser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698