deps: V8: cherry-pick 0dd2318b5237 · nodejs/node@881fe78 · GitHub
Skip to content

Commit 881fe78

Browse files
Erik Corrytargos
authored andcommitted
deps: V8: cherry-pick 0dd2318b5237
Original commit message: [regexp] Remove DeferredAction class. We can just chain up the traces and use the regular ActionNodes that we already have to represent the deferred actions. Also simplifies the ActionNodes a little. No functional change intended. Reduce the size of the Trace from 128->120 bytes. This is a stack allocated struct so to avoid stack overflows after adding the next_ field I am reducing it back down to 120 bytes by rearranging and shrinking fields. Change-Id: I6dca9946e035e9b22798e160b8fadaeca61f4955 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6512931 Reviewed-by: Patrick Thier <pthier@chromium.org> Commit-Queue: Erik Corry <erikcorry@chromium.org> Cr-Commit-Position: refs/heads/main@{#100092} Refs: v8/v8@0dd2318 PR-URL: #60732 Fixes: #60030 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
1 parent 457c33e commit 881fe78

6 files changed

Lines changed: 190 additions & 206 deletions

File tree

common.gypi

Lines changed: 1 addition & 1 deletion

deps/v8/src/regexp/regexp-compiler-tonode.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,9 +1248,9 @@ RegExpNode* RegExpCapture::ToNode(RegExpTree* body, int index,
12481248
int start_reg = RegExpCapture::StartRegister(index);
12491249
int end_reg = RegExpCapture::EndRegister(index);
12501250
if (compiler->read_backward()) std::swap(start_reg, end_reg);
1251-
RegExpNode* store_end = ActionNode::StorePosition(end_reg, true, on_success);
1251+
RegExpNode* store_end = ActionNode::ClearPosition(end_reg, on_success);
12521252
RegExpNode* body_node = body->ToNode(compiler, store_end);
1253-
return ActionNode::StorePosition(start_reg, true, body_node);
1253+
return ActionNode::ClearPosition(start_reg, body_node);
12541254
}
12551255

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

deps/v8/src/regexp/regexp-compiler.cc

Lines changed: 57 additions & 93 deletions

0 commit comments

Comments
 (0)