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

Unified Diff: runtime/vm/regexp_assembler.h

Issue 837503002: Replace the use of local variables for irregexp registers by a typed array. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 months 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
« no previous file with comments | « runtime/vm/regexp.cc ('k') | runtime/vm/regexp_assembler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/regexp_assembler.h
diff --git a/runtime/vm/regexp_assembler.h b/runtime/vm/regexp_assembler.h
index 4a4696c40454accbd3e53f93c6e1211e3e26fd18..12edecbb468180d7e869e4e8b301b20dc30cd63b 100644
--- a/runtime/vm/regexp_assembler.h
+++ b/runtime/vm/regexp_assembler.h
@@ -338,6 +338,10 @@ class IRRegExpMacroAssembler : public RegExpMacroAssembler {
// graph construction.
void GenerateBacktrackBlock();
+ // Allocate the actual registers array once its size is known. Must be done
+ // after graph construction.
+ void FinalizeRegistersArray();
+
private:
// Generate the contents of preset blocks. The entry block is the entry point
// of the generated code.
@@ -424,7 +428,11 @@ class IRRegExpMacroAssembler : public RegExpMacroAssembler {
ConstantInstr* WordCharacterMapConstant() const;
ComparisonInstr* Comparison(ComparisonKind kind,
- Definition* lhs, Definition* rhs);
+ PushArgumentInstr* lhs,
+ PushArgumentInstr* rhs);
+ ComparisonInstr* Comparison(ComparisonKind kind,
+ Definition* lhs,
+ Definition* rhs);
InstanceCallInstr* InstanceCall(const InstanceCallDescriptor& desc,
PushArgumentInstr* arg1) const;
@@ -463,6 +471,13 @@ class IRRegExpMacroAssembler : public RegExpMacroAssembler {
PushArgumentInstr* PushArgument(Value* value);
PushArgumentInstr* PushLocal(LocalVariable* local);
+ PushArgumentInstr* PushRegisterIndex(intptr_t reg);
+ Value* LoadRegister(intptr_t reg);
+ void StoreRegister(intptr_t reg, intptr_t value);
+ void StoreRegister(PushArgumentInstr* registers,
+ PushArgumentInstr* index,
+ PushArgumentInstr* value);
+
// Load a number of characters at the given offset from the
// current position, into the current-character register.
void LoadCurrentCharacterUnchecked(intptr_t cp_offset,
@@ -609,11 +624,13 @@ class IRRegExpMacroAssembler : public RegExpMacroAssembler {
LocalVariable* result_;
// Stored positions containing group bounds. Generated as needed.
- const intptr_t position_registers_count_;
- GrowableArray<LocalVariable*> position_registers_;
+ LocalVariable* registers_;
+ intptr_t registers_count_;
+ const intptr_t saved_registers_count_;
- // The actual array object used as the stack.
+ // The actual array objects used for the stack and registers.
GrowableObjectArray& stack_array_;
+ TypedData& registers_array_;
IdAllocator block_id_;
IdAllocator temp_id_;
« no previous file with comments | « runtime/vm/regexp.cc ('k') | runtime/vm/regexp_assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698