Line data Source code
1 : // Copyright 2015 the V8 project authors. All rights reserved.
2 : // Use of this source code is governed by a BSD-style license that can be
3 : // found in the LICENSE file.
4 :
5 : #ifndef V8_UNICODE_CACHE_INL_H_
6 : #define V8_UNICODE_CACHE_INL_H_
7 :
8 : #include "src/unicode-inl.h"
9 : #include "src/unicode-cache.h"
10 :
11 : namespace v8 {
12 : namespace internal {
13 :
14 : bool UnicodeCache::IsIdentifierStart(unibrow::uchar c) {
15 280436380 : return kIsIdentifierStart.get(c);
16 : }
17 :
18 :
19 : bool UnicodeCache::IsIdentifierPart(unibrow::uchar c) {
20 322312 : return kIsIdentifierPart.get(c);
21 : }
22 :
23 :
24 : bool UnicodeCache::IsLineTerminator(unibrow::uchar c) {
25 713945385 : return kIsLineTerminator.get(c);
26 : }
27 :
28 :
29 330377835 : bool UnicodeCache::IsLineTerminatorSequence(unibrow::uchar c,
30 : unibrow::uchar next) {
31 330377835 : if (!IsLineTerminator(c)) return false;
32 14804472 : if (c == 0x000d && next == 0x000a) return false; // CR with following LF.
33 14804458 : return true;
34 : }
35 :
36 :
37 : bool UnicodeCache::IsWhiteSpace(unibrow::uchar c) {
38 4144317 : return kIsWhiteSpace.get(c);
39 : }
40 :
41 :
42 : bool UnicodeCache::IsWhiteSpaceOrLineTerminator(unibrow::uchar c) {
43 12651812 : return kIsWhiteSpaceOrLineTerminator.get(c);
44 : }
45 :
46 : } // namespace internal
47 : } // namespace v8
48 :
49 : #endif // V8_UNICODE_CACHE_INL_H_
|