summaryrefslogtreecommitdiffstats
path: root/js/src/regexp/regexp-compiler.h
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2020-11-09 20:37:05 -0500
committerMatt A. Tobin <email@mattatobin.com>2020-11-09 20:37:05 -0500
commit51468e998c8e7191ddecacec3944c806b29dd590 (patch)
treec713f075c54781868ec119ea5c5f3c9369af3576 /js/src/regexp/regexp-compiler.h
parent77746f1d900a35eceb23bd760983e95de7b4a547 (diff)
downloadUXP-51468e998c8e7191ddecacec3944c806b29dd590.tar
UXP-51468e998c8e7191ddecacec3944c806b29dd590.tar.gz
UXP-51468e998c8e7191ddecacec3944c806b29dd590.tar.lz
UXP-51468e998c8e7191ddecacec3944c806b29dd590.tar.xz
UXP-51468e998c8e7191ddecacec3944c806b29dd590.zip
Issue #1677 - Part 5: "Simplify" regexp re-import process (and re-import from later revision)
I am going on record to say Mozilla are utter fucking assholes for pulling this as part of their progression.
Diffstat (limited to 'js/src/regexp/regexp-compiler.h')
-rw-r--r--js/src/regexp/regexp-compiler.h16
1 files changed, 6 insertions, 10 deletions
diff --git a/js/src/regexp/regexp-compiler.h b/js/src/regexp/regexp-compiler.h
index 192b3284d..1954f1a4c 100644
--- a/js/src/regexp/regexp-compiler.h
+++ b/js/src/regexp/regexp-compiler.h
@@ -422,10 +422,7 @@ struct PreloadState {
// Analysis performs assertion propagation and computes eats_at_least_ values.
// See the comments on AssertionPropagator and EatsAtLeastPropagator for more
// details.
-//
-// This method returns nullptr on success or a null-terminated failure message
-// on failure.
-const char* AnalyzeRegExp(Isolate* isolate, bool is_one_byte, RegExpNode* node);
+RegExpError AnalyzeRegExp(Isolate* isolate, bool is_one_byte, RegExpNode* node);
class FrequencyCollator {
public:
@@ -502,18 +499,17 @@ class RegExpCompiler {
}
struct CompilationResult final {
- explicit CompilationResult(const char* error_message)
- : error_message(error_message) {}
+ explicit CompilationResult(RegExpError err) : error(err) {}
CompilationResult(Object code, int registers)
: code(code), num_registers(registers) {}
static CompilationResult RegExpTooBig() {
- return CompilationResult("RegExp too big");
+ return CompilationResult(RegExpError::kTooLarge);
}
- bool Succeeded() const { return error_message == nullptr; }
+ bool Succeeded() const { return error == RegExpError::kNone; }
- const char* const error_message = nullptr;
+ const RegExpError error = RegExpError::kNone;
Object code;
int num_registers = 0;
};
@@ -575,7 +571,7 @@ class RegExpCompiler {
int next_register_;
int unicode_lookaround_stack_register_;
int unicode_lookaround_position_register_;
- std::vector<RegExpNode*>* work_list_;
+ ZoneVector<RegExpNode*>* work_list_;
int recursion_depth_;
RegExpMacroAssembler* macro_assembler_;
bool one_byte_;