Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1063)

Unified Diff: src/regexp-macro-assembler-ia32.h

Issue 12807: * Fixes and tweaks to regexp-ia32. (Closed)
Patch Set: Created 12 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/regexp-macro-assembler-ia32.h
diff --git a/src/regexp-macro-assembler-ia32.h b/src/regexp-macro-assembler-ia32.h
index de653d57044ef83441fa48f7943ca2733d5d2015..44dd941f955486d36c93bb1cd4e8a1cde0689fd5 100644
--- a/src/regexp-macro-assembler-ia32.h
+++ b/src/regexp-macro-assembler-ia32.h
@@ -88,6 +88,19 @@ class RegExpMacroAssemblerIA32: public RegExpMacroAssembler {
virtual void WriteCurrentPositionToRegister(int reg);
virtual void WriteStackPointerToRegister(int reg);
+ template <typename T>
+ static inline bool Execute(Code* code,
+ T** input,
+ int start_offset,
+ int end_offset,
+ int* output,
+ bool at_start) {
+ typedef bool (*matcher)(T**, int, int, int*, int);
+ matcher matcher_func = FUNCTION_CAST<matcher>(code->entry());
+ int at_start_val = at_start ? 1 : 0;
+ return matcher_func(input, start_offset, end_offset, output, at_start_val);
+ }
+
private:
// Offsets from ebp of arguments to function.
static const int kBackup_ebx = sizeof(uint32_t);
@@ -98,6 +111,7 @@ class RegExpMacroAssemblerIA32: public RegExpMacroAssembler {
static const int kInputStartOffset = kInputBuffer + sizeof(uint32_t);
static const int kInputEndOffset = kInputStartOffset + sizeof(uint32_t);
static const int kRegisterOutput = kInputEndOffset + sizeof(uint32_t);
+ static const int kAtStart = kRegisterOutput + sizeof(uint32_t);
// Initial size of code buffer.
static const size_t kRegExpCodeSize = 1024;
@@ -114,10 +128,6 @@ class RegExpMacroAssemblerIA32: public RegExpMacroAssembler {
// Byte size of chars in the string to match (decided by the Mode argument)
size_t char_size();
- // Records that a register is used. At the end, we need the number of
- // registers used.
- void RecordRegister(int register_index);
-
// Equivalent to a conditional branch to the label, unless the label
// is NULL, in which case it is a conditional Backtrack.
void BranchOrBacktrack(Condition condition, Label* to);

Powered by Google App Engine
This is Rietveld 408576698