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

Side by Side Diff: src/scanner.cc

Issue 1149643003: Version 4.3.61.23 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@4.3
Patch Set: Created 5 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/scanner.h ('k') | test/mjsunit/regress/regress-smi-scanning.js » ('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 // Features shared by parsing and pre-parsing scanners. 5 // Features shared by parsing and pre-parsing scanners.
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 10
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after
1000 while (IsDecimalDigit(c0_)) { 1000 while (IsDecimalDigit(c0_)) {
1001 value = 10 * value + (c0_ - '0'); 1001 value = 10 * value + (c0_ - '0');
1002 1002
1003 uc32 first_char = c0_; 1003 uc32 first_char = c0_;
1004 Advance<false, false>(); 1004 Advance<false, false>();
1005 AddLiteralChar(first_char); 1005 AddLiteralChar(first_char);
1006 } 1006 }
1007 1007
1008 if (next_.literal_chars->one_byte_literal().length() <= 10 && 1008 if (next_.literal_chars->one_byte_literal().length() <= 10 &&
1009 value <= Smi::kMaxValue && c0_ != '.' && c0_ != 'e' && c0_ != 'E') { 1009 value <= Smi::kMaxValue && c0_ != '.' && c0_ != 'e' && c0_ != 'E') {
1010 smi_value_ = static_cast<int>(value); 1010 next_.smi_value_ = static_cast<int>(value);
1011 literal.Complete(); 1011 literal.Complete();
1012 HandleLeadSurrogate(); 1012 HandleLeadSurrogate();
1013 1013
1014 return Token::SMI; 1014 return Token::SMI;
1015 } 1015 }
1016 HandleLeadSurrogate(); 1016 HandleLeadSurrogate();
1017 } 1017 }
1018 1018
1019 ScanDecimalDigits(); // optional 1019 ScanDecimalDigits(); // optional
1020 if (c0_ == '.') { 1020 if (c0_ == '.') {
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
1560 } 1560 }
1561 backing_store_.Add(static_cast<uint8_t>((one_byte_length >> 7) | 0x80u)); 1561 backing_store_.Add(static_cast<uint8_t>((one_byte_length >> 7) | 0x80u));
1562 } 1562 }
1563 backing_store_.Add(static_cast<uint8_t>(one_byte_length & 0x7f)); 1563 backing_store_.Add(static_cast<uint8_t>(one_byte_length & 0x7f));
1564 1564
1565 backing_store_.AddBlock(bytes); 1565 backing_store_.AddBlock(bytes);
1566 return backing_store_.EndSequence().start(); 1566 return backing_store_.EndSequence().start();
1567 } 1567 }
1568 1568
1569 } } // namespace v8::internal 1569 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/scanner.h ('k') | test/mjsunit/regress/regress-smi-scanning.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698