• Iain Ireland's avatar
    [regexp] Upstream small changes · a2b17a72
    Iain Ireland authored
    This is a grab-bag of small compatibility fixes to make it easier to
    import irregexp into SpiderMonkey. For changes where the commit
    message was longer than the change itself, it didn't seem worth
    opening a separate review.
    
    [regexp] Use uc16 in FilterOneByte
    
    SpiderMonkey uses char16_t instead of uint16_t for its two-byte
    strings. (This matches ICU. It looks like V8 considered making the
    same change, but decided against it: see
    https://bugs.chromium.org/p/v8/issues/detail?id=6487.) Fortunately,
    irregexp is careful about only using uc16, so SpiderMonkey can just
    define uc16 = char16_t and *almost* everything works out. This patch
    fixes the single place in irregexp where that is not true.
    
    [regexp] Remove unreachable return
    
    The return statement at the end of
    RegExpParser::ParseClassCharacterEscape is unreachable, because every
    branch of the switch returns. This triggered static analysis errors in
    SpiderMonkey.
    
    [regexp] Remove trivial assertion
    
    The assertion in BytecodeSequenceNode::ArgumentMapping cannot fail,
    because size_t is an unsigned type. This triggered static analysis
    warnings in SpiderMonkey.
    
    [regexp] Make RegExpStack constructor public
    
    In V8, the RegExpStack's private constructor is called from Isolate,
    which is a friend class. In SpiderMonkey, we use a wrapper around new
    to control where memory is allocated, so we need the RegExpStack
    constructor to be visible outside of Isolate.
    
    [regexp] Refactor Isolate::IncreaseTotalRegexpCodeGenerated
    
    The call-site of Isolate::IncreaseTotalRegexpCodeGenerated is the only
    place inside irregexp where HeapObject::Size is called. SpiderMonkey's
    heap-allocated objects live in arenas, and don't have a standardized
    way of finding the size. In this particular case it would be safe to
    hardcode a size of 0, but leaving HeapObject::Size undefined will
    ensure that SpiderMonkey doesn't silently do the wrong thing if
    somebody in V8 adds a new, more meaningful call to HeapObject::Size.
    
    R=jgruber@chromium.org
    
    Bug: v8:10303
    Change-Id: I5b81e1a261fec8c85a63f71f34cd12d68f638334
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2090191
    Commit-Queue: Jakob Gruber <jgruber@chromium.org>
    Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#66676}
    a2b17a72
Name
Last commit
Last update
..
arm Loading commit data...
arm64 Loading commit data...
ia32 Loading commit data...
mips Loading commit data...
mips64 Loading commit data...
ppc Loading commit data...
s390 Loading commit data...
x64 Loading commit data...
OWNERS Loading commit data...
gen-regexp-special-case.cc Loading commit data...
property-sequences.cc Loading commit data...
property-sequences.h Loading commit data...
regexp-ast.cc Loading commit data...
regexp-ast.h Loading commit data...
regexp-bytecode-generator-inl.h Loading commit data...
regexp-bytecode-generator.cc Loading commit data...
regexp-bytecode-generator.h Loading commit data...
regexp-bytecode-peephole.cc Loading commit data...
regexp-bytecode-peephole.h Loading commit data...
regexp-bytecodes.cc Loading commit data...
regexp-bytecodes.h Loading commit data...
regexp-compiler-tonode.cc Loading commit data...
regexp-compiler.cc Loading commit data...
regexp-compiler.h Loading commit data...
regexp-dotprinter.cc Loading commit data...
regexp-dotprinter.h Loading commit data...
regexp-interpreter.cc Loading commit data...
regexp-interpreter.h Loading commit data...
regexp-macro-assembler-arch.h Loading commit data...
regexp-macro-assembler-tracer.cc Loading commit data...
regexp-macro-assembler-tracer.h Loading commit data...
regexp-macro-assembler.cc Loading commit data...
regexp-macro-assembler.h Loading commit data...
regexp-nodes.h Loading commit data...
regexp-parser.cc Loading commit data...
regexp-parser.h Loading commit data...
regexp-stack.cc Loading commit data...
regexp-stack.h Loading commit data...
regexp-utils.cc Loading commit data...
regexp-utils.h Loading commit data...
regexp.cc Loading commit data...
regexp.h Loading commit data...
special-case.h Loading commit data...