// Copyright 2016 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.
bool StackLimiter::IsOverflowed() { if (V8_LIKELY(budget_ > 0)) returnfalse; // This can be a little slow so we don't do it until the soft budget has been // exhausted. return StackLimitCheck{Isolate::Current()}.HasOverflowed();
}
ClassSetExpression::ClassSetExpression(OperationType op, bool is_negated, bool may_contain_strings,
ZoneList<Tree*>* operands)
: operation_(op),
is_negated_(is_negated),
may_contain_strings_(may_contain_strings),
operands_(operands) {
DCHECK_NOT_NULL(operands); if (is_negated) {
DCHECK(!may_contain_strings_); // We don't know anything about max matches for negated classes. // As there are no strings involved, assume that we can match a unicode // character (2 code points).
max_match_ = 2;
} else {
max_match_ = 0; for (auto operand : *operands) {
max_match_ = std::max(max_match_, operand->max_match());
}
}
}
ClassRanges::ClassRanges(Zone* zone, ZoneList<CharacterRange>* ranges,
ClassRanges::ClassRangesFlags class_ranges_flags)
: set_(ranges), class_ranges_flags_(class_ranges_flags) { // Convert the empty set of ranges to the negated Everything() range. if (ranges->is_empty()) {
ranges->Add(CharacterRange::Everything(), zone);
class_ranges_flags_ ^= NEGATED;
} if (!is_negated() && !is_certainly_two_code_points() &&
no_case_folding_needed()) { // Perhaps we can detect that it is always two code points. bool found_basic_plane = false; for (int i = 0; i < ranges->length(); i++) { if (ranges->at(i).from() < 0x10000) {
found_basic_plane = true; break;
}
} if (!found_basic_plane) {
class_ranges_flags_ |= IS_CERTAINLY_TWO_CODE_POINTS;
}
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.