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

Side by Side Diff: src/parsing/preparser.cc

Issue 1708193003: Reduce the memory footprint of expression classifiers (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Improve expression classifier accumulate Created 4 years, 7 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
« src/parsing/parser-base.h ('K') | « src/parsing/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 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 // Identifier ':' Statement 622 // Identifier ':' Statement
623 623
624 switch (peek()) { 624 switch (peek()) {
625 case Token::FUNCTION: 625 case Token::FUNCTION:
626 case Token::LBRACE: 626 case Token::LBRACE:
627 UNREACHABLE(); // Always handled by the callers. 627 UNREACHABLE(); // Always handled by the callers.
628 case Token::CLASS: 628 case Token::CLASS:
629 ReportUnexpectedToken(Next()); 629 ReportUnexpectedToken(Next());
630 *ok = false; 630 *ok = false;
631 return Statement::Default(); 631 return Statement::Default();
632
adamk 2016/06/06 20:51:02 Looks like you've got a spurious whitespace change
nickie 2016/06/08 11:38:46 Reverting it.
633 default: 632 default:
634 break; 633 break;
635 } 634 }
636 635
637 bool starts_with_identifier = peek_any_identifier(); 636 bool starts_with_identifier = peek_any_identifier();
638 ExpressionClassifier classifier(this); 637 ExpressionClassifier classifier(this);
639 Expression expr = ParseExpression(true, &classifier, CHECK_OK); 638 Expression expr = ParseExpression(true, &classifier, CHECK_OK);
640 ValidateExpression(&classifier, CHECK_OK); 639 ValidateExpression(&classifier, CHECK_OK);
641 640
642 // Even if the expression starts with an identifier, it is not necessarily an 641 // Even if the expression starts with an identifier, it is not necessarily an
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
1307 if (!*ok) return; 1306 if (!*ok) return;
1308 1307
1309 body->Add(PreParserStatement::ExpressionStatement(return_value), zone()); 1308 body->Add(PreParserStatement::ExpressionStatement(return_value), zone());
1310 } 1309 }
1311 1310
1312 #undef CHECK_OK 1311 #undef CHECK_OK
1313 1312
1314 1313
1315 } // namespace internal 1314 } // namespace internal
1316 } // namespace v8 1315 } // namespace v8
OLDNEW
« src/parsing/parser-base.h ('K') | « src/parsing/preparser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698