summaryrefslogtreecommitdiffstats
path: root/js/src/regexp/regexp-macro-assembler-tracer.h
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2020-11-04 19:46:11 -0500
committerMatt A. Tobin <email@mattatobin.com>2020-11-04 20:27:57 -0500
commit78b3a722b4b91c2482fed60d7e970a3f57645456 (patch)
tree717c2e8f2e1a110295f525e9cca666469dbe8049 /js/src/regexp/regexp-macro-assembler-tracer.h
parent2e07199197e94ed02926c77bd3bd10d187b352b0 (diff)
downloadUXP-78b3a722b4b91c2482fed60d7e970a3f57645456.tar
UXP-78b3a722b4b91c2482fed60d7e970a3f57645456.tar.gz
UXP-78b3a722b4b91c2482fed60d7e970a3f57645456.tar.lz
UXP-78b3a722b4b91c2482fed60d7e970a3f57645456.tar.xz
UXP-78b3a722b4b91c2482fed60d7e970a3f57645456.zip
Issue #1677 - Part 1: Import new V8 regexp code with Mozilla's header modifications
Diffstat (limited to 'js/src/regexp/regexp-macro-assembler-tracer.h')
-rw-r--r--js/src/regexp/regexp-macro-assembler-tracer.h81
1 files changed, 81 insertions, 0 deletions
diff --git a/js/src/regexp/regexp-macro-assembler-tracer.h b/js/src/regexp/regexp-macro-assembler-tracer.h
new file mode 100644
index 000000000..938f84796
--- /dev/null
+++ b/js/src/regexp/regexp-macro-assembler-tracer.h
@@ -0,0 +1,81 @@
+// Copyright 2008 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef V8_REGEXP_REGEXP_MACRO_ASSEMBLER_TRACER_H_
+#define V8_REGEXP_REGEXP_MACRO_ASSEMBLER_TRACER_H_
+
+#include "regexp/regexp-macro-assembler.h"
+
+namespace v8 {
+namespace internal {
+
+// Decorator on a RegExpMacroAssembler that write all calls.
+class RegExpMacroAssemblerTracer: public RegExpMacroAssembler {
+ public:
+ RegExpMacroAssemblerTracer(Isolate* isolate, RegExpMacroAssembler* assembler);
+ ~RegExpMacroAssemblerTracer() override;
+ void AbortedCodeGeneration() override;
+ int stack_limit_slack() override { return assembler_->stack_limit_slack(); }
+ bool CanReadUnaligned() override { return assembler_->CanReadUnaligned(); }
+ void AdvanceCurrentPosition(int by) override; // Signed cp change.
+ void AdvanceRegister(int reg, int by) override; // r[reg] += by.
+ void Backtrack() override;
+ void Bind(Label* label) override;
+ void CheckCharacter(unsigned c, Label* on_equal) override;
+ void CheckCharacterAfterAnd(unsigned c, unsigned and_with,
+ Label* on_equal) override;
+ void CheckCharacterGT(uc16 limit, Label* on_greater) override;
+ void CheckCharacterLT(uc16 limit, Label* on_less) override;
+ void CheckGreedyLoop(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 CheckNotBackReference(int start_reg, bool read_backward,
+ Label* on_no_match) override;
+ void CheckNotBackReferenceIgnoreCase(int start_reg, bool read_backward,
+ bool unicode,
+ Label* on_no_match) override;
+ void CheckNotCharacter(unsigned c, Label* on_not_equal) override;
+ void CheckNotCharacterAfterAnd(unsigned c, unsigned and_with,
+ Label* on_not_equal) override;
+ void CheckNotCharacterAfterMinusAnd(uc16 c, uc16 minus, uc16 and_with,
+ Label* on_not_equal) override;
+ void CheckCharacterInRange(uc16 from, uc16 to, Label* on_in_range) override;
+ void CheckCharacterNotInRange(uc16 from, uc16 to,
+ Label* on_not_in_range) override;
+ void CheckBitInTable(Handle<ByteArray> table, Label* on_bit_set) override;
+ void CheckPosition(int cp_offset, Label* on_outside_input) override;
+ bool CheckSpecialCharacterClass(uc16 type, Label* on_no_match) override;
+ void Fail() override;
+ Handle<HeapObject> GetCode(Handle<String> source) override;
+ void GoTo(Label* label) override;
+ void IfRegisterGE(int reg, int comparand, Label* if_ge) override;
+ void IfRegisterLT(int reg, int comparand, Label* if_lt) override;
+ void IfRegisterEqPos(int reg, Label* if_eq) override;
+ IrregexpImplementation Implementation() override;
+ void LoadCurrentCharacterImpl(int cp_offset, Label* on_end_of_input,
+ bool check_bounds, int characters,
+ int eats_at_least) override;
+ void PopCurrentPosition() override;
+ void PopRegister(int register_index) override;
+ void PushBacktrack(Label* label) override;
+ void PushCurrentPosition() override;
+ void PushRegister(int register_index,
+ StackCheckFlag check_stack_limit) override;
+ void ReadCurrentPositionFromRegister(int reg) override;
+ void ReadStackPointerFromRegister(int reg) override;
+ void SetCurrentPositionFromEnd(int by) override;
+ void SetRegister(int register_index, int to) override;
+ bool Succeed() override;
+ void WriteCurrentPositionToRegister(int reg, int cp_offset) override;
+ void ClearRegisters(int reg_from, int reg_to) override;
+ void WriteStackPointerToRegister(int reg) override;
+
+ private:
+ RegExpMacroAssembler* assembler_;
+};
+
+} // namespace internal
+} // namespace v8
+
+#endif // V8_REGEXP_REGEXP_MACRO_ASSEMBLER_TRACER_H_