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_; |