v8/src/unicode-cache-inl.h
mstarzinger 4e39437a02 Separate UnicodeCache out into an own file.
This make inclusion of unicode-inl.h in object.h absolete. Now most
compilation units don't require that header. It also breaks a cycle
within declarations of the scanner.h header.

This tries to remove includes of "-inl.h" headers from normal ".h"
headers, thereby reducing the chance of any cyclic dependencies and
decreasing the average size of our compilation units.

Note that this change still leaves 3 violations of that rule in the
code, checked with the "tools/check-inline-includes.sh" tool.

R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/1287893006

Cr-Commit-Position: refs/heads/master@{#30268}
2015-08-20 11:47:09 +00:00

50 lines
1.1 KiB
C++

// Copyright 2015 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_UNICODE_CACHE_INL_H_
#define V8_UNICODE_CACHE_INL_H_
#include "src/unicode-inl.h"
#include "src/unicode-cache.h"
namespace v8 {
namespace internal {
bool UnicodeCache::IsIdentifierStart(unibrow::uchar c) {
return kIsIdentifierStart.get(c);
}
bool UnicodeCache::IsIdentifierPart(unibrow::uchar c) {
return kIsIdentifierPart.get(c);
}
bool UnicodeCache::IsLineTerminator(unibrow::uchar c) {
return kIsLineTerminator.get(c);
}
bool UnicodeCache::IsLineTerminatorSequence(unibrow::uchar c,
unibrow::uchar next) {
if (!IsLineTerminator(c)) return false;
if (c == 0x000d && next == 0x000a) return false; // CR with following LF.
return true;
}
bool UnicodeCache::IsWhiteSpace(unibrow::uchar c) {
return kIsWhiteSpace.get(c);
}
bool UnicodeCache::IsWhiteSpaceOrLineTerminator(unibrow::uchar c) {
return kIsWhiteSpaceOrLineTerminator.get(c);
}
} // namespace internal
} // namespace v8
#endif // V8_UNICODE_CACHE_INL_H_