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/scanner.cc

Issue 1365803004: [presubmit] Fix whitespace/semicolon linter violations. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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/runtime/runtime-date.cc ('k') | test/cctest/cctest.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 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 "src/scanner.h" 7 #include "src/scanner.h"
8 8
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 1561 matching lines...) Expand 10 before | Expand all | Expand 10 after
1572 pos++; 1572 pos++;
1573 } 1573 }
1574 return !invalid_last_digit; 1574 return !invalid_last_digit;
1575 } 1575 }
1576 1576
1577 1577
1578 uint32_t DuplicateFinder::Hash(Vector<const uint8_t> key, bool is_one_byte) { 1578 uint32_t DuplicateFinder::Hash(Vector<const uint8_t> key, bool is_one_byte) {
1579 // Primitive hash function, almost identical to the one used 1579 // Primitive hash function, almost identical to the one used
1580 // for strings (except that it's seeded by the length and representation). 1580 // for strings (except that it's seeded by the length and representation).
1581 int length = key.length(); 1581 int length = key.length();
1582 uint32_t hash = (length << 1) | (is_one_byte ? 1 : 0) ; 1582 uint32_t hash = (length << 1) | (is_one_byte ? 1 : 0);
1583 for (int i = 0; i < length; i++) { 1583 for (int i = 0; i < length; i++) {
1584 uint32_t c = key[i]; 1584 uint32_t c = key[i];
1585 hash = (hash + c) * 1025; 1585 hash = (hash + c) * 1025;
1586 hash ^= (hash >> 6); 1586 hash ^= (hash >> 6);
1587 } 1587 }
1588 return hash; 1588 return hash;
1589 } 1589 }
1590 1590
1591 1591
1592 bool DuplicateFinder::Match(void* first, void* second) { 1592 bool DuplicateFinder::Match(void* first, void* second) {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
1633 backing_store_.Add(static_cast<uint8_t>((one_byte_length >> 7) | 0x80u)); 1633 backing_store_.Add(static_cast<uint8_t>((one_byte_length >> 7) | 0x80u));
1634 } 1634 }
1635 backing_store_.Add(static_cast<uint8_t>(one_byte_length & 0x7f)); 1635 backing_store_.Add(static_cast<uint8_t>(one_byte_length & 0x7f));
1636 1636
1637 backing_store_.AddBlock(bytes); 1637 backing_store_.AddBlock(bytes);
1638 return backing_store_.EndSequence().start(); 1638 return backing_store_.EndSequence().start();
1639 } 1639 }
1640 1640
1641 } // namespace internal 1641 } // namespace internal
1642 } // namespace v8 1642 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime-date.cc ('k') | test/cctest/cctest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698