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

Side by Side Diff: src/parsing/parser-base.h

Issue 1969203004: Add UseCounter for decimal with leading zero. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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
« no previous file with comments | « src/parsing/parser.cc ('k') | src/parsing/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 #ifndef V8_PARSING_PARSER_BASE_H 5 #ifndef V8_PARSING_PARSER_BASE_H
6 #define V8_PARSING_PARSER_BASE_H 6 #define V8_PARSING_PARSER_BASE_H
7 7
8 #include "src/ast/scopes.h" 8 #include "src/ast/scopes.h"
9 #include "src/bailout-reason.h" 9 #include "src/bailout-reason.h"
10 #include "src/hashmap.h" 10 #include "src/hashmap.h"
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 void CheckOctalLiteral(int beg_pos, int end_pos, 611 void CheckOctalLiteral(int beg_pos, int end_pos,
612 MessageTemplate::Template message, bool* ok) { 612 MessageTemplate::Template message, bool* ok) {
613 Scanner::Location octal = scanner()->octal_position(); 613 Scanner::Location octal = scanner()->octal_position();
614 if (octal.IsValid() && beg_pos <= octal.beg_pos && 614 if (octal.IsValid() && beg_pos <= octal.beg_pos &&
615 octal.end_pos <= end_pos) { 615 octal.end_pos <= end_pos) {
616 ReportMessageAt(octal, message); 616 ReportMessageAt(octal, message);
617 scanner()->clear_octal_position(); 617 scanner()->clear_octal_position();
618 *ok = false; 618 *ok = false;
619 } 619 }
620 } 620 }
621 // for now, this check just collects statistics.
622 void CheckDecimalLiteralWithLeadingZero(int* use_counts, int beg_pos,
623 int end_pos) {
624 Scanner::Location token_location =
625 scanner()->decimal_with_leading_zero_position();
626 if (token_location.IsValid() && beg_pos <= token_location.beg_pos &&
627 token_location.end_pos <= end_pos) {
628 scanner()->clear_decimal_with_leading_zero_position();
629 if (use_counts != nullptr)
630 ++use_counts[v8::Isolate::kDecimalWithLeadingZeroInStrictMode];
631 }
632 }
621 633
622 inline void CheckStrictOctalLiteral(int beg_pos, int end_pos, bool* ok) { 634 inline void CheckStrictOctalLiteral(int beg_pos, int end_pos, bool* ok) {
623 CheckOctalLiteral(beg_pos, end_pos, MessageTemplate::kStrictOctalLiteral, 635 CheckOctalLiteral(beg_pos, end_pos, MessageTemplate::kStrictOctalLiteral,
624 ok); 636 ok);
625 } 637 }
626 638
627 inline void CheckTemplateOctalLiteral(int beg_pos, int end_pos, bool* ok) { 639 inline void CheckTemplateOctalLiteral(int beg_pos, int end_pos, bool* ok) {
628 CheckOctalLiteral(beg_pos, end_pos, MessageTemplate::kTemplateOctalLiteral, 640 CheckOctalLiteral(beg_pos, end_pos, MessageTemplate::kTemplateOctalLiteral,
629 ok); 641 ok);
630 } 642 }
(...skipping 2680 matching lines...) Expand 10 before | Expand all | Expand 10 after
3311 has_seen_constructor_ = true; 3323 has_seen_constructor_ = true;
3312 return; 3324 return;
3313 } 3325 }
3314 } 3326 }
3315 3327
3316 3328
3317 } // namespace internal 3329 } // namespace internal
3318 } // namespace v8 3330 } // namespace v8
3319 3331
3320 #endif // V8_PARSING_PARSER_BASE_H 3332 #endif // V8_PARSING_PARSER_BASE_H
OLDNEW
« no previous file with comments | « src/parsing/parser.cc ('k') | src/parsing/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698