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

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

Issue 10995: * Remove an unused layer of abstraction by not having both a macro assembler ... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
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-irregexp.h
===================================================================
--- src/regexp-macro-assembler-irregexp.h (revision 862)
+++ src/regexp-macro-assembler-irregexp.h (working copy)
@@ -33,9 +33,20 @@
class RegExpMacroAssemblerIrregexp: public RegExpMacroAssembler {
public:
- explicit RegExpMacroAssemblerIrregexp(IrregexpAssembler* assembler)
- : assembler_(assembler) {
- }
+ // Create an assembler. Instructions and relocation information are emitted
+ // into a buffer, with the instructions starting from the beginning and the
+ // relocation information starting from the end of the buffer. See CodeDesc
+ // for a detailed comment on the layout (globals.h).
+ //
+ // If the provided buffer is NULL, the assembler allocates and grows its own
+ // buffer, and buffer_size determines the initial buffer size. The buffer is
+ // owned by the assembler and deallocated upon destruction of the assembler.
+ //
+ // If the provided buffer is not NULL, the assembler uses the provided buffer
+ // for code generation and assumes its size to be buffer_size. If the buffer
+ // is too small, a fatal error occurs. No deallocation of the buffer is done
+ // upon destruction of the assembler.
+ explicit RegExpMacroAssemblerIrregexp(Vector<byte>);
virtual ~RegExpMacroAssemblerIrregexp();
virtual void Bind(Label* label);
virtual void EmitOrLink(Label* label);
@@ -88,7 +99,25 @@
virtual IrregexpImplementation Implementation();
virtual Handle<Object> GetCode();
private:
- IrregexpAssembler* assembler_;
+ void Expand();
+ // Code and bitmap emission.
+ inline void Emit32(uint32_t x);
+ inline void Emit16(uint32_t x);
+ inline void Emit(uint32_t x);
+ // Bytecode buffer.
+ int length();
+ void Copy(Address a);
+
+
+
+ // The buffer into which code and relocation info are generated.
+ Vector<byte> buffer_;
+ // The program counter.
+ int pc_;
+ // True if the assembler owns the buffer, false if buffer is external.
+ bool own_buffer_;
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(RegExpMacroAssemblerIrregexp);
};
} } // namespace v8::internal
« src/jsregexp.cc ('K') | « src/jsregexp.cc ('k') | src/regexp-macro-assembler-irregexp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698