diff --git a/js/src/irregexp/imported/regexp-compiler-tonode.cc b/js/src/irregexp/imported/regexp-compiler-tonode.cc --- a/js/src/irregexp/imported/regexp-compiler-tonode.cc +++ b/js/src/irregexp/imported/regexp-compiler-tonode.cc @@ -128,11 +128,12 @@ } UnicodeRangeSplitter::UnicodeRangeSplitter(ZoneList* base) { // The unicode range splitter categorizes given character ranges into: // - Code points from the BMP representable by one code unit. - // - Code points outside the BMP that need to be split into surrogate pairs. + // - Code points outside the BMP that need to be split into + // surrogate pairs. // - Lone lead surrogates. // - Lone trail surrogates. // Lone surrogates are valid code points, even though no actual characters. // They require special matching to make sure we do not split surrogate pairs. diff --git a/js/src/irregexp/imported/regexp-compiler.cc b/js/src/irregexp/imported/regexp-compiler.cc --- a/js/src/irregexp/imported/regexp-compiler.cc +++ b/js/src/irregexp/imported/regexp-compiler.cc @@ -110,12 +110,12 @@ // on a work list for later generation and instead generate a jump. The // destination of the jump is resolved later when the code is generated. // // Actual regular expression code generation. // -// Code generation is actually more complicated than the above. In order -// to improve the efficiency of the generated code some optimizations are +// Code generation is actually more complicated than the above. In order to +// improve the efficiency of the generated code some optimizations are // performed // // * Choice nodes have 1-character lookahead. // A choice node looks at the following character and eliminates some of // the choices immediately based on that character. This is not yet diff --git a/js/src/irregexp/imported/regexp-macro-assembler.h b/js/src/irregexp/imported/regexp-macro-assembler.h --- a/js/src/irregexp/imported/regexp-macro-assembler.h +++ b/js/src/irregexp/imported/regexp-macro-assembler.h @@ -327,12 +327,13 @@ static Address GrowStack(Isolate* isolate); // Called from generated code. static int CheckStackGuardState(Isolate* isolate, int start_index, RegExp::CallOrigin call_origin, - Address* return_address, Code re_code, - Address* subject, const byte** input_start, + Address* return_address, + InstructionStream re_code, Address* subject, + const byte** input_start, const byte** input_end); static Address word_character_map_address() { return reinterpret_cast
(&word_character_map[0]); } diff --git a/js/src/irregexp/imported/regexp-macro-assembler.cc b/js/src/irregexp/imported/regexp-macro-assembler.cc --- a/js/src/irregexp/imported/regexp-macro-assembler.cc +++ b/js/src/irregexp/imported/regexp-macro-assembler.cc @@ -275,16 +275,16 @@ // This method may only be called after an interrupt. // static int NativeRegExpMacroAssembler::CheckStackGuardState( Isolate* isolate, int start_index, RegExp::CallOrigin call_origin, - Address* return_address, Code re_code, Address* subject, + Address* return_address, InstructionStream re_code, Address* subject, const byte** input_start, const byte** input_end) { DisallowGarbageCollection no_gc; Address old_pc = PointerAuthentication::AuthenticatePC(return_address, 0); - DCHECK_LE(re_code.raw_instruction_start(), old_pc); - DCHECK_LE(old_pc, re_code.raw_instruction_end()); + DCHECK_LE(re_code.instruction_start(), old_pc); + DCHECK_LE(old_pc, re_code.instruction_end()); StackLimitCheck check(isolate); bool js_has_overflowed = check.JsHasOverflowed(); if (call_origin == RegExp::CallOrigin::kFromJs) { @@ -307,11 +307,11 @@ } DCHECK(call_origin == RegExp::CallOrigin::kFromRuntime); // Prepare for possible GC. HandleScope handles(isolate); - Handle code_handle(re_code, isolate); + Handle code_handle(re_code, isolate); Handle subject_handle(String::cast(Object(*subject)), isolate); bool is_one_byte = String::IsOneByteRepresentationUnderneath(*subject_handle); int return_value = 0; { @@ -423,11 +423,11 @@ int start_offset, const byte* input_start, const byte* input_end, int* output, int output_size, Isolate* isolate, JSRegExp regexp) { RegExpStackScope stack_scope(isolate); bool is_one_byte = String::IsOneByteRepresentationUnderneath(input); - CodeT code = CodeT::cast(regexp.code(is_one_byte)); + Code code = Code::cast(regexp.code(is_one_byte)); RegExp::CallOrigin call_origin = RegExp::CallOrigin::kFromRuntime; using RegexpMatcherSig = // NOLINTNEXTLINE(readability/casting) int(Address input_string, int start_offset, const byte* input_start, diff --git a/js/src/irregexp/imported/regexp-parser.cc b/js/src/irregexp/imported/regexp-parser.cc --- a/js/src/irregexp/imported/regexp-parser.cc +++ b/js/src/irregexp/imported/regexp-parser.cc @@ -10,10 +10,11 @@ #ifdef V8_INTL_SUPPORT #include "unicode/uniset.h" #include "unicode/unistr.h" #include "unicode/usetiter.h" +#include "unicode/utf16.h" // For U16_NEXT #endif // V8_INTL_SUPPORT namespace v8 { namespace internal { @@ -2747,10 +2748,11 @@ may_contain_strings |= MayContainStrings(last_type, operand); // Add the range we started building as operand and reset the current // range. if (!ranges->is_empty() || !strings->empty()) { if (needs_case_folding) { + CharacterRange::Canonicalize(ranges); CharacterRange::AddUnicodeCaseEquivalents(ranges, zone()); } may_contain_strings |= !strings->empty(); operands->Add( zone()->template New(ranges, strings), @@ -2768,10 +2770,11 @@ } // Add the range we started building as operand. if (!ranges->is_empty() || !strings->empty()) { if (needs_case_folding) { + CharacterRange::Canonicalize(ranges); CharacterRange::AddUnicodeCaseEquivalents(ranges, zone()); } may_contain_strings |= !strings->empty(); operands->Add(zone()->template New(ranges, strings), zone()); diff --git a/js/src/irregexp/moz.yaml b/js/src/irregexp/moz.yaml --- a/js/src/irregexp/moz.yaml +++ b/js/src/irregexp/moz.yaml @@ -7,12 +7,12 @@ origin: name: irregexp description: A fast regular expression engine from V8 url: https://v8.dev - release: b51e75a608217811a8488cd0e5c2dd1d222fc6b6 - revision: b51e75a608217811a8488cd0e5c2dd1d222fc6b6 + release: e33c3a09b31af5b69286f904a378fcbfb36a726d (Thu Feb 02 16:37:59 2023). + revision: e33c3a09b31af5b69286f904a378fcbfb36a726d license: BSD-3-Clause license-file: LICENSE.v8 vendoring: