Commit d67e1d4f authored by sanjoy@chromium.org's avatar sanjoy@chromium.org

AssemblerBase does not need remember a Zone. Fix this.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10546095

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11765 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 09179b31
......@@ -291,7 +291,7 @@ static const int kMinimalBufferSize = 4*KB;
Assembler::Assembler(Isolate* arg_isolate, void* buffer, int buffer_size)
: AssemblerBase(arg_isolate, arg_isolate->zone()),
: AssemblerBase(arg_isolate),
positions_recorder_(this),
emit_debug_code_(FLAG_debug_code) {
if (buffer == NULL) {
......
......@@ -106,10 +106,9 @@ const char* const RelocInfo::kFillerCommentString = "DEOPTIMIZATION PADDING";
// -----------------------------------------------------------------------------
// Implementation of AssemblerBase
AssemblerBase::AssemblerBase(Isolate* isolate, Zone* zone)
AssemblerBase::AssemblerBase(Isolate* isolate)
: isolate_(isolate),
jit_cookie_(0),
zone_(zone) {
jit_cookie_(0) {
if (FLAG_mask_constants_with_cookie && isolate != NULL) {
jit_cookie_ = V8::RandomPrivate(isolate);
}
......
......@@ -57,7 +57,7 @@ const unsigned kNoASTId = -1;
class AssemblerBase: public Malloced {
public:
AssemblerBase(Isolate* isolate, Zone* zone);
explicit AssemblerBase(Isolate* isolate);
Isolate* isolate() const { return isolate_; }
int jit_cookie() { return jit_cookie_; }
......@@ -66,12 +66,9 @@ class AssemblerBase: public Malloced {
// cross-snapshotting.
static void QuietNaN(HeapObject* nan) { }
Zone* zone() const { return zone_; }
private:
Isolate* isolate_;
int jit_cookie_;
Zone* zone_;
};
......
......@@ -313,7 +313,7 @@ static void InitCoverageLog();
#endif
Assembler::Assembler(Isolate* arg_isolate, void* buffer, int buffer_size)
: AssemblerBase(arg_isolate, arg_isolate->zone()),
: AssemblerBase(arg_isolate),
positions_recorder_(this),
emit_debug_code_(FLAG_debug_code) {
if (buffer == NULL) {
......
......@@ -128,20 +128,19 @@ Safepoint SafepointTableBuilder::DefineSafepoint(
Safepoint::DeoptMode deopt_mode) {
ASSERT(arguments >= 0);
DeoptimizationInfo info;
Zone* zone = assembler->zone();
info.pc = assembler->pc_offset();
info.arguments = arguments;
info.has_doubles = (kind & Safepoint::kWithDoubles);
deoptimization_info_.Add(info, zone);
deopt_index_list_.Add(Safepoint::kNoDeoptimizationIndex, zone);
deoptimization_info_.Add(info, zone_);
deopt_index_list_.Add(Safepoint::kNoDeoptimizationIndex, zone_);
if (deopt_mode == Safepoint::kNoLazyDeopt) {
last_lazy_safepoint_ = deopt_index_list_.length();
}
indexes_.Add(new(zone) ZoneList<int>(8, zone), zone);
indexes_.Add(new(zone_) ZoneList<int>(8, zone_), zone_);
registers_.Add((kind & Safepoint::kWithRegisters)
? new(zone) ZoneList<int>(4, zone)
? new(zone_) ZoneList<int>(4, zone_)
: NULL,
zone);
zone_);
return Safepoint(indexes_.last(), registers_.last());
}
......@@ -162,7 +161,6 @@ void SafepointTableBuilder::Emit(Assembler* assembler, int bits_per_entry) {
// For lazy deoptimization we need space to patch a call after every call.
// Ensure there is always space for such patching, even if the code ends
// in a call.
Zone* zone = assembler->zone();
int target_offset = assembler->pc_offset() + Deoptimizer::patch_size();
while (assembler->pc_offset() < target_offset) {
assembler->nop();
......@@ -193,12 +191,12 @@ void SafepointTableBuilder::Emit(Assembler* assembler, int bits_per_entry) {
}
// Emit table of bitmaps.
ZoneList<uint8_t> bits(bytes_per_entry, zone);
ZoneList<uint8_t> bits(bytes_per_entry, zone_);
for (int i = 0; i < length; i++) {
ZoneList<int>* indexes = indexes_[i];
ZoneList<int>* registers = registers_[i];
bits.Clear();
bits.AddBlock(0, bytes_per_entry, zone);
bits.AddBlock(0, bytes_per_entry, zone_);
// Run through the registers (if any).
ASSERT(IsAligned(kNumSafepointRegisters, kBitsPerByte));
......
......@@ -345,7 +345,7 @@ static void InitCoverageLog();
#endif
Assembler::Assembler(Isolate* arg_isolate, void* buffer, int buffer_size)
: AssemblerBase(arg_isolate, arg_isolate->zone()),
: AssemblerBase(arg_isolate),
code_targets_(100),
positions_recorder_(this),
emit_debug_code_(FLAG_debug_code) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment