3407 {
3408 RegExpMacroAssembler* assembler =
compiler->macro_assembler();
3410 if (limit_result ==
DONE)
return;
3412
3414
3415 switch (action_type_) {
3417 Trace::DeferredCapture new_capture(data_.u_position_register.reg,
3418 data_.u_position_register.is_capture,
3419 trace);
3420 Trace new_trace = *trace;
3421 new_trace.add_action(&new_capture);
3423 break;
3424 }
3426 Trace::DeferredIncrementRegister new_increment(
3427 data_.u_increment_register.reg);
3428 Trace new_trace = *trace;
3429 new_trace.add_action(&new_increment);
3431 break;
3432 }
3434 Trace::DeferredSetRegister new_set(data_.u_store_register.reg,
3435 data_.u_store_register.value);
3436 Trace new_trace = *trace;
3437 new_trace.add_action(&new_set);
3439 break;
3440 }
3442 Trace::DeferredClearCaptures new_capture(
Interval(
3443 data_.u_clear_captures.range_from, data_.u_clear_captures.range_to));
3444 Trace new_trace = *trace;
3445 new_trace.add_action(&new_capture);
3447 break;
3448 }
3450 if (!trace->is_trivial()) {
3452 } else {
3453 assembler->WriteCurrentPositionToRegister(
3454 data_.u_submatch.current_position_register, 0);
3455 assembler->WriteStackPointerToRegister(
3456 data_.u_submatch.stack_pointer_register);
3458 }
3459 break;
3461 intptr_t start_pos_reg = data_.u_empty_match_check.start_register;
3462 intptr_t stored_pos = 0;
3463 intptr_t rep_reg = data_.u_empty_match_check.repetition_register;
3465 bool know_dist = trace->GetStoredPosition(start_pos_reg, &stored_pos);
3466 if (know_dist && !has_minimum && stored_pos == trace->cp_offset()) {
3467
3468
3469 assembler->GoTo(trace->backtrack());
3470 } else if (know_dist && stored_pos < trace->cp_offset()) {
3471
3472
3474 } else if (!trace->is_trivial()) {
3476 } else {
3477 BlockLabel skip_empty_check;
3478
3479
3480 if (has_minimum) {
3481 intptr_t limit = data_.u_empty_match_check.repetition_limit;
3482 assembler->IfRegisterLT(rep_reg, limit, &skip_empty_check);
3483 }
3484
3485
3486 assembler->IfRegisterEqPos(data_.u_empty_match_check.start_register,
3487 trace->backtrack());
3488 assembler->BindBlock(&skip_empty_check);
3490 }
3491 break;
3492 }
3494 if (!trace->is_trivial()) {
3496 return;
3497 }
3498 assembler->ReadCurrentPositionFromRegister(
3499 data_.u_submatch.current_position_register);
3500 assembler->ReadStackPointerFromRegister(
3501 data_.u_submatch.stack_pointer_register);
3505 return;
3506 }
3507 intptr_t clear_registers_from = data_.u_submatch.clear_register_from;
3508 BlockLabel clear_registers_backtrack;
3509 Trace new_trace = *trace;
3510 new_trace.set_backtrack(&clear_registers_backtrack);
3512
3513 assembler->BindBlock(&clear_registers_backtrack);
3514 intptr_t clear_registers_to =
3516 assembler->ClearRegisters(clear_registers_from, clear_registers_to);
3517
3518 ASSERT(trace->backtrack() ==
nullptr);
3519 assembler->Backtrack();
3520 return;
3521 }
3522 default:
3524 }
3525}
intptr_t clear_register_count
static constexpr intptr_t kNoRegister
virtual void Emit(RegExpCompiler *compiler, Trace *trace)=0
LimitResult LimitVersions(RegExpCompiler *compiler, Trace *trace)