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

Unified Diff: src/assembler.h

Issue 11416133: Moved buffer handling to AssemblerBase. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased Created 8 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
« no previous file with comments | « src/arm/assembler-arm.cc ('k') | src/assembler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/assembler.h
diff --git a/src/assembler.h b/src/assembler.h
index 037799d6062ba434bcef8993071ea0ea937ca285..26864c75494ccc06b76503482da4b9212ed6aa66 100644
--- a/src/assembler.h
+++ b/src/assembler.h
@@ -56,7 +56,8 @@ struct StatsCounter;
class AssemblerBase: public Malloced {
public:
- explicit AssemblerBase(Isolate* isolate);
+ AssemblerBase(Isolate* isolate, void* buffer, int buffer_size);
+ virtual ~AssemblerBase();
Isolate* isolate() const { return isolate_; }
int jit_cookie() const { return jit_cookie_; }
@@ -71,6 +72,20 @@ class AssemblerBase: public Malloced {
// cross-snapshotting.
static void QuietNaN(HeapObject* nan) { }
+ int pc_offset() const { return static_cast<int>(pc_ - buffer_); }
+
+ static const int kMinimalBufferSize = 4*KB;
+
+ protected:
+ // The buffer into which code and relocation info are generated. It could
+ // either be owned by the assembler or be provided externally.
+ byte* buffer_;
+ int buffer_size_;
+ bool own_buffer_;
+
+ // The program counter, which points into the buffer above and moves forward.
+ byte* pc_;
+
private:
Isolate* isolate_;
int jit_cookie_;
« no previous file with comments | « src/arm/assembler-arm.cc ('k') | src/assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698