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

Side by Side Diff: src/scanner.cc

Issue 1114073003: Fix smi scanning (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
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 988 matching lines...) Expand 10 before | Expand all | Expand 10 after
999 while (IsDecimalDigit(c0_)) { 999 while (IsDecimalDigit(c0_)) {
1000 value = 10 * value + (c0_ - '0'); 1000 value = 10 * value + (c0_ - '0');
1001 1001
1002 uc32 first_char = c0_; 1002 uc32 first_char = c0_;
1003 Advance<false, false>(); 1003 Advance<false, false>();
1004 AddLiteralChar(first_char); 1004 AddLiteralChar(first_char);
1005 } 1005 }
1006 1006
1007 if (next_.literal_chars->one_byte_literal().length() <= 10 && 1007 if (next_.literal_chars->one_byte_literal().length() <= 10 &&
1008 value <= Smi::kMaxValue && c0_ != '.' && c0_ != 'e' && c0_ != 'E') { 1008 value <= Smi::kMaxValue && c0_ != '.' && c0_ != 'e' && c0_ != 'E') {
1009 smi_value_ = static_cast<int>(value); 1009 next_.smi_value_ = static_cast<int>(value);
1010 literal.Complete(); 1010 literal.Complete();
1011 HandleLeadSurrogate(); 1011 HandleLeadSurrogate();
1012 1012
1013 return Token::SMI; 1013 return Token::SMI;
1014 } 1014 }
1015 HandleLeadSurrogate(); 1015 HandleLeadSurrogate();
1016 } 1016 }
1017 1017
1018 ScanDecimalDigits(); // optional 1018 ScanDecimalDigits(); // optional
1019 if (c0_ == '.') { 1019 if (c0_ == '.') {
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
1559 } 1559 }
1560 backing_store_.Add(static_cast<uint8_t>((one_byte_length >> 7) | 0x80u)); 1560 backing_store_.Add(static_cast<uint8_t>((one_byte_length >> 7) | 0x80u));
1561 } 1561 }
1562 backing_store_.Add(static_cast<uint8_t>(one_byte_length & 0x7f)); 1562 backing_store_.Add(static_cast<uint8_t>(one_byte_length & 0x7f));
1563 1563
1564 backing_store_.AddBlock(bytes); 1564 backing_store_.AddBlock(bytes);
1565 return backing_store_.EndSequence().start(); 1565 return backing_store_.EndSequence().start();
1566 } 1566 }
1567 1567
1568 } } // namespace v8::internal 1568 } } // 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