Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.33',
'v8_embedder_string': '-node.37',

##### V8 defaults for Node.js #####

Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/regexp/arm/regexp-macro-assembler-arm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ void RegExpMacroAssemblerARM::CheckCharacterLT(base::uc16 limit,
BranchOrBacktrack(lt, on_less);
}

void RegExpMacroAssemblerARM::CheckGreedyLoop(Label* on_equal) {
void RegExpMacroAssemblerARM::CheckFixedLengthLoop(Label* on_equal) {
__ ldr(r0, MemOperand(backtrack_stackpointer(), 0));
__ cmp(current_input_offset(), r0);
__ add(backtrack_stackpointer(), backtrack_stackpointer(),
Expand Down
4 changes: 2 additions & 2 deletions deps/v8/src/regexp/arm/regexp-macro-assembler-arm.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ class V8_EXPORT_PRIVATE RegExpMacroAssemblerARM
Label* on_equal) override;
void CheckCharacterGT(base::uc16 limit, Label* on_greater) override;
void CheckCharacterLT(base::uc16 limit, Label* on_less) override;
// A "greedy loop" is a loop that is both greedy and with a simple
// A "fixed length loop" is a loop that is both greedy and with a simple
// body. It has a particularly simple implementation.
void CheckGreedyLoop(Label* on_tos_equals_current_position) override;
void CheckFixedLengthLoop(Label* on_tos_equals_current_position) override;
void CheckNotAtStart(int cp_offset, Label* on_not_at_start) override;
void CheckNotBackReference(int start_reg, bool read_backward,
Label* on_no_match) override;
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/regexp/arm64/regexp-macro-assembler-arm64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ void RegExpMacroAssemblerARM64::CheckCharacters(
}
}

void RegExpMacroAssemblerARM64::CheckGreedyLoop(Label* on_equal) {
void RegExpMacroAssemblerARM64::CheckFixedLengthLoop(Label* on_equal) {
__ Ldr(w10, MemOperand(backtrack_stackpointer()));
__ Cmp(current_input_offset(), w10);
__ Cset(x11, eq);
Expand Down
4 changes: 2 additions & 2 deletions deps/v8/src/regexp/arm64/regexp-macro-assembler-arm64.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ class V8_EXPORT_PRIVATE RegExpMacroAssemblerARM64
void CheckCharacterLT(base::uc16 limit, Label* on_less) override;
void CheckCharacters(base::Vector<const base::uc16> str, int cp_offset,
Label* on_failure, bool check_end_of_string);
// A "greedy loop" is a loop that is both greedy and with a simple
// A "fixed length loop" is a loop that is both greedy and with a simple
// body. It has a particularly simple implementation.
void CheckGreedyLoop(Label* on_tos_equals_current_position) override;
void CheckFixedLengthLoop(Label* on_tos_equals_current_position) override;
void CheckNotAtStart(int cp_offset, Label* on_not_at_start) override;
void CheckNotBackReference(int start_reg, bool read_backward,
Label* on_no_match) override;
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/regexp/ia32/regexp-macro-assembler-ia32.cc
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ void RegExpMacroAssemblerIA32::CheckCharacterLT(base::uc16 limit,
BranchOrBacktrack(less, on_less);
}

void RegExpMacroAssemblerIA32::CheckGreedyLoop(Label* on_equal) {
void RegExpMacroAssemblerIA32::CheckFixedLengthLoop(Label* on_equal) {
Label fallthrough;
__ cmp(edi, Operand(backtrack_stackpointer(), 0));
__ j(not_equal, &fallthrough);
Expand Down
4 changes: 2 additions & 2 deletions deps/v8/src/regexp/ia32/regexp-macro-assembler-ia32.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ class V8_EXPORT_PRIVATE RegExpMacroAssemblerIA32
Label* on_equal) override;
void CheckCharacterGT(base::uc16 limit, Label* on_greater) override;
void CheckCharacterLT(base::uc16 limit, Label* on_less) override;
// A "greedy loop" is a loop that is both greedy and with a simple
// A "fixed length loop" is a loop that is both greedy and with a simple
// body. It has a particularly simple implementation.
void CheckGreedyLoop(Label* on_tos_equals_current_position) override;
void CheckFixedLengthLoop(Label* on_tos_equals_current_position) override;
void CheckNotAtStart(int cp_offset, Label* on_not_at_start) override;
void CheckNotBackReference(int start_reg, bool read_backward,
Label* on_no_match) override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ void RegExpMacroAssemblerLOONG64::CheckCharacterLT(base::uc16 limit,
BranchOrBacktrack(on_less, lt, current_character(), Operand(limit));
}

void RegExpMacroAssemblerLOONG64::CheckGreedyLoop(Label* on_equal) {
void RegExpMacroAssemblerLOONG64::CheckFixedLengthLoop(Label* on_equal) {
Label backtrack_non_equal;
__ Ld_w(a0, MemOperand(backtrack_stackpointer(), 0));
__ Branch(&backtrack_non_equal, ne, current_input_offset(), Operand(a0));
Expand Down
4 changes: 2 additions & 2 deletions deps/v8/src/regexp/loong64/regexp-macro-assembler-loong64.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ class V8_EXPORT_PRIVATE RegExpMacroAssemblerLOONG64
Label* on_equal) override;
void CheckCharacterGT(base::uc16 limit, Label* on_greater) override;
void CheckCharacterLT(base::uc16 limit, Label* on_less) override;
// A "greedy loop" is a loop that is both greedy and with a simple
// A "fixed length loop" is a loop that is both greedy and with a simple
// body. It has a particularly simple implementation.
void CheckGreedyLoop(Label* on_tos_equals_current_position) override;
void CheckFixedLengthLoop(Label* on_tos_equals_current_position) override;
void CheckNotAtStart(int cp_offset, Label* on_not_at_start) override;
void CheckNotBackReference(int start_reg, bool read_backward,
Label* on_no_match) override;
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/regexp/mips64/regexp-macro-assembler-mips64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ void RegExpMacroAssemblerMIPS::CheckCharacterLT(base::uc16 limit,
BranchOrBacktrack(on_less, lt, current_character(), Operand(limit));
}

void RegExpMacroAssemblerMIPS::CheckGreedyLoop(Label* on_equal) {
void RegExpMacroAssemblerMIPS::CheckFixedLengthLoop(Label* on_equal) {
Label backtrack_non_equal;
__ Lw(a0, MemOperand(backtrack_stackpointer(), 0));
__ Branch(&backtrack_non_equal, ne, current_input_offset(), Operand(a0));
Expand Down
4 changes: 2 additions & 2 deletions deps/v8/src/regexp/mips64/regexp-macro-assembler-mips64.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ class V8_EXPORT_PRIVATE RegExpMacroAssemblerMIPS
Label* on_equal) override;
void CheckCharacterGT(base::uc16 limit, Label* on_greater) override;
void CheckCharacterLT(base::uc16 limit, Label* on_less) override;
// A "greedy loop" is a loop that is both greedy and with a simple
// A "fixed length loop" is a loop that is both greedy and with a simple
// body. It has a particularly simple implementation.
void CheckGreedyLoop(Label* on_tos_equals_current_position) override;
void CheckFixedLengthLoop(Label* on_tos_equals_current_position) override;
void CheckNotAtStart(int cp_offset, Label* on_not_at_start) override;
void CheckNotBackReference(int start_reg, bool read_backward,
Label* on_no_match) override;
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/regexp/ppc/regexp-macro-assembler-ppc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ void RegExpMacroAssemblerPPC::CheckCharacterLT(base::uc16 limit,
BranchOrBacktrack(lt, on_less);
}

void RegExpMacroAssemblerPPC::CheckGreedyLoop(Label* on_equal) {
void RegExpMacroAssemblerPPC::CheckFixedLengthLoop(Label* on_equal) {
Label backtrack_non_equal;
__ LoadU64(r3, MemOperand(backtrack_stackpointer(), 0));
__ CmpS64(current_input_offset(), r3);
Expand Down
4 changes: 2 additions & 2 deletions deps/v8/src/regexp/ppc/regexp-macro-assembler-ppc.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ class V8_EXPORT_PRIVATE RegExpMacroAssemblerPPC
void CheckCharacterGT(base::uc16 limit, Label* on_greater) override;
void CheckCharacterLT(base::uc16 limit, Label* on_less) override;

// A "greedy loop" is a loop that is both greedy and with a simple
// A "fixed length loop" is a loop that is both greedy and with a simple
// body. It has a particularly simple implementation.
void CheckGreedyLoop(Label* on_tos_equals_current_position) override;
void CheckFixedLengthLoop(Label* on_tos_equals_current_position) override;
void CheckNotAtStart(int cp_offset, Label* on_not_at_start) override;
void CheckNotBackReference(int start_reg, bool read_backward,
Label* on_no_match) override;
Expand Down
4 changes: 2 additions & 2 deletions deps/v8/src/regexp/regexp-bytecode-generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,9 @@ void RegExpBytecodeGenerator::AdvanceCurrentPosition(int by) {
advance_current_end_ = pc_;
}

void RegExpBytecodeGenerator::CheckGreedyLoop(
void RegExpBytecodeGenerator::CheckFixedLengthLoop(
Label* on_tos_equals_current_position) {
Emit(BC_CHECK_GREEDY, 0);
Emit(BC_CHECK_FIXED_LENGTH, 0);
EmitOrLink(on_tos_equals_current_position);
}

Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/regexp/regexp-bytecode-generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class V8_EXPORT_PRIVATE RegExpBytecodeGenerator : public RegExpMacroAssembler {
Label* on_equal) override;
void CheckCharacterGT(base::uc16 limit, Label* on_greater) override;
void CheckCharacterLT(base::uc16 limit, Label* on_less) override;
void CheckGreedyLoop(Label* on_tos_equals_current_position) override;
void CheckFixedLengthLoop(Label* on_tos_equals_current_position) override;
void CheckAtStart(int cp_offset, Label* on_at_start) override;
void CheckNotAtStart(int cp_offset, Label* on_not_at_start) override;
void CheckNotCharacter(unsigned c, Label* on_not_equal) override;
Expand Down
68 changes: 34 additions & 34 deletions deps/v8/src/regexp/regexp-bytecodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static_assert(1 << BYTECODE_SHIFT > BYTECODE_MASK);
/* 0x00 - 0x07: 0x10 (fixed) Bytecode */ \
/* 0x08 - 0x1F: 0x00 (unused) Padding */ \
/* 0x20 - 0x3F: Address of bytecode to jump to */ \
V(GOTO, 16, 8) /* bc8 pad24 addr32 */ \
V(GOTO, 16, 8) /* bc8 pad24 addr32 */ \
/* Check if offset is in range and load character at given offset. */ \
/* Bit Layout: */ \
/* 0x00 - 0x07: 0x11 (fixed) Bytecode */ \
Expand All @@ -64,22 +64,22 @@ static_assert(1 << BYTECODE_SHIFT > BYTECODE_MASK);
/* Bit Layout: */ \
/* 0x00 - 0x07: 0x12 (fixed) Bytecode */ \
/* 0x08 - 0x1F: Offset from current position */ \
V(LOAD_CURRENT_CHAR_UNCHECKED, 18, 4) /* bc8 offset24 */ \
V(LOAD_2_CURRENT_CHARS, 19, 8) /* bc8 offset24 addr32 */ \
V(LOAD_2_CURRENT_CHARS_UNCHECKED, 20, 4) /* bc8 offset24 */ \
V(LOAD_4_CURRENT_CHARS, 21, 8) /* bc8 offset24 addr32 */ \
V(LOAD_4_CURRENT_CHARS_UNCHECKED, 22, 4) /* bc8 offset24 */ \
V(CHECK_4_CHARS, 23, 12) /* bc8 pad24 uint32 addr32 */ \
V(LOAD_CURRENT_CHAR_UNCHECKED, 18, 4) /* bc8 offset24 */ \
V(LOAD_2_CURRENT_CHARS, 19, 8) /* bc8 offset24 addr32 */ \
V(LOAD_2_CURRENT_CHARS_UNCHECKED, 20, 4) /* bc8 offset24 */ \
V(LOAD_4_CURRENT_CHARS, 21, 8) /* bc8 offset24 addr32 */ \
V(LOAD_4_CURRENT_CHARS_UNCHECKED, 22, 4) /* bc8 offset24 */ \
V(CHECK_4_CHARS, 23, 12) /* bc8 pad24 uint32 addr32 */ \
/* Check if current character is equal to a given character */ \
/* Bit Layout: */ \
/* 0x00 - 0x07: 0x19 (fixed) Bytecode */ \
/* 0x08 - 0x0F: 0x00 (unused) Padding */ \
/* 0x10 - 0x1F: Character to check */ \
/* 0x20 - 0x3F: Address of bytecode when matched */ \
V(CHECK_CHAR, 24, 8) /* bc8 pad8 uint16 addr32 */ \
V(CHECK_NOT_4_CHARS, 25, 12) /* bc8 pad24 uint32 addr32 */ \
V(CHECK_NOT_CHAR, 26, 8) /* bc8 pad8 uint16 addr32 */ \
V(AND_CHECK_4_CHARS, 27, 16) /* bc8 pad24 uint32 uint32 addr32 */ \
V(CHECK_CHAR, 24, 8) /* bc8 pad8 uint16 addr32 */ \
V(CHECK_NOT_4_CHARS, 25, 12) /* bc8 pad24 uint32 addr32 */ \
V(CHECK_NOT_CHAR, 26, 8) /* bc8 pad8 uint16 addr32 */ \
V(AND_CHECK_4_CHARS, 27, 16) /* bc8 pad24 uint32 uint32 addr32 */ \
/* Checks if the current character combined with mask (bitwise and) */ \
/* matches a character (e.g. used when two characters in a disjunction */ \
/* differ by only a single bit */ \
Expand All @@ -89,55 +89,55 @@ static_assert(1 << BYTECODE_SHIFT > BYTECODE_MASK);
/* 0x10 - 0x1F: Character to match against (after mask aplied) */ \
/* 0x20 - 0x3F: Bitmask bitwise and combined with current character */ \
/* 0x40 - 0x5F: Address of bytecode when matched */ \
V(AND_CHECK_CHAR, 28, 12) /* bc8 pad8 uint16 uint32 addr32 */ \
V(AND_CHECK_NOT_4_CHARS, 29, 16) /* bc8 pad24 uint32 uint32 addr32 */ \
V(AND_CHECK_NOT_CHAR, 30, 12) /* bc8 pad8 uint16 uint32 addr32 */ \
V(AND_CHECK_CHAR, 28, 12) /* bc8 pad8 uint16 uint32 addr32 */ \
V(AND_CHECK_NOT_4_CHARS, 29, 16) /* bc8 pad24 uint32 uint32 addr32 */ \
V(AND_CHECK_NOT_CHAR, 30, 12) /* bc8 pad8 uint16 uint32 addr32 */ \
V(MINUS_AND_CHECK_NOT_CHAR, 31, \
12) /* bc8 pad8 base::uc16 base::uc16 base::uc16 addr32 */ \
V(CHECK_CHAR_IN_RANGE, 32, 12) /* bc8 pad24 base::uc16 base::uc16 addr32 */ \
12) /* bc8 pad8 base::uc16 base::uc16 base::uc16 addr32 */ \
V(CHECK_CHAR_IN_RANGE, 32, 12) /* bc8 pad24 base::uc16 base::uc16 addr32 */ \
V(CHECK_CHAR_NOT_IN_RANGE, 33, \
12) /* bc8 pad24 base::uc16 base::uc16 addr32 */ \
12) /* bc8 pad24 base::uc16 base::uc16 addr32 */ \
/* Checks if the current character matches any of the characters encoded */ \
/* in a bit table. Similar to/inspired by boyer moore string search */ \
/* Bit Layout: */ \
/* 0x00 - 0x07: 0x22 (fixed) Bytecode */ \
/* 0x08 - 0x1F: 0x00 (unused) Padding */ \
/* 0x20 - 0x3F: Address of bytecode when bit is set */ \
/* 0x40 - 0xBF: Bit table */ \
V(CHECK_BIT_IN_TABLE, 34, 24) /* bc8 pad24 addr32 bits128 */ \
V(CHECK_LT, 35, 8) /* bc8 pad8 base::uc16 addr32 */ \
V(CHECK_GT, 36, 8) /* bc8 pad8 base::uc16 addr32 */ \
V(CHECK_NOT_BACK_REF, 37, 8) /* bc8 reg_idx24 addr32 */ \
V(CHECK_NOT_BACK_REF_NO_CASE, 38, 8) /* bc8 reg_idx24 addr32 */ \
V(CHECK_BIT_IN_TABLE, 34, 24) /* bc8 pad24 addr32 bits128 */ \
V(CHECK_LT, 35, 8) /* bc8 pad8 base::uc16 addr32 */ \
V(CHECK_GT, 36, 8) /* bc8 pad8 base::uc16 addr32 */ \
V(CHECK_NOT_BACK_REF, 37, 8) /* bc8 reg_idx24 addr32 */ \
V(CHECK_NOT_BACK_REF_NO_CASE, 38, 8) /* bc8 reg_idx24 addr32 */ \
V(CHECK_NOT_BACK_REF_NO_CASE_UNICODE, 39, 8) \
V(CHECK_NOT_BACK_REF_BACKWARD, 40, 8) /* bc8 reg_idx24 addr32 */ \
V(CHECK_NOT_BACK_REF_NO_CASE_BACKWARD, 41, 8) /* bc8 reg_idx24 addr32 */ \
V(CHECK_NOT_BACK_REF_BACKWARD, 40, 8) /* bc8 reg_idx24 addr32 */ \
V(CHECK_NOT_BACK_REF_NO_CASE_BACKWARD, 41, 8) /* bc8 reg_idx24 addr32 */ \
V(CHECK_NOT_BACK_REF_NO_CASE_UNICODE_BACKWARD, 42, 8) \
V(CHECK_NOT_REGS_EQUAL, 43, 12) /* bc8 regidx24 reg_idx32 addr32 */ \
V(CHECK_REGISTER_LT, 44, 12) /* bc8 reg_idx24 value32 addr32 */ \
V(CHECK_REGISTER_GE, 45, 12) /* bc8 reg_idx24 value32 addr32 */ \
V(CHECK_REGISTER_EQ_POS, 46, 8) /* bc8 reg_idx24 addr32 */ \
V(CHECK_AT_START, 47, 8) /* bc8 pad24 addr32 */ \
V(CHECK_NOT_AT_START, 48, 8) /* bc8 offset24 addr32 */ \
V(CHECK_NOT_REGS_EQUAL, 43, 12) /* bc8 regidx24 reg_idx32 addr32 */ \
V(CHECK_REGISTER_LT, 44, 12) /* bc8 reg_idx24 value32 addr32 */ \
V(CHECK_REGISTER_GE, 45, 12) /* bc8 reg_idx24 value32 addr32 */ \
V(CHECK_REGISTER_EQ_POS, 46, 8) /* bc8 reg_idx24 addr32 */ \
V(CHECK_AT_START, 47, 8) /* bc8 pad24 addr32 */ \
V(CHECK_NOT_AT_START, 48, 8) /* bc8 offset24 addr32 */ \
/* Checks if the current position matches top of backtrack stack */ \
/* Bit Layout: */ \
/* 0x00 - 0x07: 0x31 (fixed) Bytecode */ \
/* 0x08 - 0x1F: 0x00 (unused) Padding */ \
/* 0x20 - 0x3F: Address of bytecode when current matches tos */ \
V(CHECK_GREEDY, 49, 8) /* bc8 pad24 addr32 */ \
V(CHECK_FIXED_LENGTH, 49, 8) /* bc8 pad24 addr32 */ \
/* Advance character pointer by given offset and jump to another bytecode.*/ \
/* Bit Layout: */ \
/* 0x00 - 0x07: 0x32 (fixed) Bytecode */ \
/* 0x08 - 0x1F: Number of characters to advance */ \
/* 0x20 - 0x3F: Address of bytecode to jump to */ \
V(ADVANCE_CP_AND_GOTO, 50, 8) /* bc8 offset24 addr32 */ \
V(SET_CURRENT_POSITION_FROM_END, 51, 4) /* bc8 idx24 */ \
V(ADVANCE_CP_AND_GOTO, 50, 8) /* bc8 offset24 addr32 */ \
V(SET_CURRENT_POSITION_FROM_END, 51, 4) /* bc8 idx24 */ \
/* Checks if current position + given offset is in range. */ \
/* Bit Layout: */ \
/* 0x00 - 0x07: 0x34 (fixed) Bytecode */ \
/* 0x08 - 0x1F: Offset from current position */ \
/* 0x20 - 0x3F: Address of bytecode when position is out of range */ \
V(CHECK_CURRENT_POSITION, 52, 8) /* bc8 idx24 addr32 */ \
V(CHECK_CURRENT_POSITION, 52, 8) /* bc8 idx24 addr32 */ \
/* Combination of: */ \
/* LOAD_CURRENT_CHAR, CHECK_BIT_IN_TABLE and ADVANCE_CP_AND_GOTO */ \
/* Emitted by RegExpBytecodePeepholeOptimization. */ \
Expand Down
6 changes: 3 additions & 3 deletions deps/v8/src/regexp/regexp-compiler-tonode.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1248,9 +1248,9 @@ RegExpNode* RegExpCapture::ToNode(RegExpTree* body, int index,
int start_reg = RegExpCapture::StartRegister(index);
int end_reg = RegExpCapture::EndRegister(index);
if (compiler->read_backward()) std::swap(start_reg, end_reg);
RegExpNode* store_end = ActionNode::StorePosition(end_reg, true, on_success);
RegExpNode* store_end = ActionNode::ClearPosition(end_reg, on_success);
RegExpNode* body_node = body->ToNode(compiler, store_end);
return ActionNode::StorePosition(start_reg, true, body_node);
return ActionNode::ClearPosition(start_reg, body_node);
}

namespace {
Expand Down Expand Up @@ -2039,7 +2039,7 @@ RegExpNode* RegExpQuantifier::ToNode(int min, int max, bool is_greedy,
if (body_can_be_empty) {
// If the body can be empty we need to store the start position
// so we can bail out if it was empty.
body_node = ActionNode::StorePosition(body_start_reg, false, body_node);
body_node = ActionNode::RestorePosition(body_start_reg, body_node);
}
if (needs_capture_clearing) {
// Before entering the body of this loop we need to clear captures.
Expand Down
Loading
Loading