feat: 增加 CreateRegExp 字节码,正则字面量每次执行创建新对象
This commit is contained in:
@@ -18,7 +18,11 @@ impl Compiler {
|
||||
}
|
||||
|
||||
pub(in crate::counter) fn count_regexp_literal(&self, ctx: &mut CompileCtx) {
|
||||
ctx.alloc_reg();
|
||||
ctx.alloc_reg(); // pattern reg (LOAD_CONST)
|
||||
ctx.projected_pc += 1;
|
||||
ctx.alloc_reg(); // flags reg (LOAD_CONST)
|
||||
ctx.projected_pc += 1;
|
||||
ctx.alloc_reg(); // result reg (CREATE_REGEXP)
|
||||
ctx.projected_pc += 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user