Index: src/compiler.h |
diff --git a/src/compiler.h b/src/compiler.h |
index f53feb954a49c53016d0eece13f3425b117b1619..779acbc35166df282b87bf8023e18e2e3256a2c7 100644 |
--- a/src/compiler.h |
+++ b/src/compiler.h |
@@ -57,7 +57,7 @@ struct OffsetRange { |
// is constructed based on the resources available at compile-time. |
class CompilationInfo { |
public: |
- CompilationInfo(Handle<JSFunction> closure, Zone* zone); |
+ CompilationInfo(Handle<JSFunction> closure, Zone* zone, Zone* phase_zone); |
virtual ~CompilationInfo(); |
Isolate* isolate() { |
@@ -65,6 +65,7 @@ class CompilationInfo { |
return isolate_; |
} |
Zone* zone() { return zone_; } |
+ Zone* phase_zone() { return phase_zone_; } |
bool is_lazy() const { return IsLazy::decode(flags_); } |
bool is_eval() const { return IsEval::decode(flags_); } |
bool is_global() const { return IsGlobal::decode(flags_); } |
@@ -300,9 +301,16 @@ class CompilationInfo { |
} |
protected: |
- CompilationInfo(Handle<Script> script, Zone* zone); |
- CompilationInfo(Handle<SharedFunctionInfo> shared_info, Zone* zone); |
- CompilationInfo(HydrogenCodeStub* stub, Isolate* isolate, Zone* zone); |
+ CompilationInfo(Handle<Script> script, |
+ Zone* zone, |
+ Zone* phase_zone); |
+ CompilationInfo(Handle<SharedFunctionInfo> shared_info, |
+ Zone* zone, |
+ Zone* phase_zone); |
+ CompilationInfo(HydrogenCodeStub* stub, |
+ Isolate* isolate, |
+ Zone* zone, |
+ Zone* phase_zone); |
private: |
Isolate* isolate_; |
@@ -320,7 +328,7 @@ class CompilationInfo { |
DEPENDENT_MAP_ABORT |
}; |
- void Initialize(Isolate* isolate, Mode mode, Zone* zone); |
+ void Initialize(Isolate* isolate, Mode mode, Zone* zone, Zone* phase_zone); |
void SetMode(Mode mode) { |
ASSERT(V8::UseCrankshaft()); |
@@ -394,6 +402,9 @@ class CompilationInfo { |
// The zone from which the compilation pipeline working on this |
// CompilationInfo allocates. |
Zone* zone_; |
+ // The phase zone where allocations local to a specific phase are |
+ // performed; be aware that this zone is cleared after each phase |
+ Zone* phase_zone_; |
DeferredHandles* deferred_handles_; |
@@ -428,21 +439,25 @@ class CompilationInfo { |
class CompilationInfoWithZone: public CompilationInfo { |
public: |
explicit CompilationInfoWithZone(Handle<Script> script) |
- : CompilationInfo(script, &zone_), |
+ : CompilationInfo(script, &zone_, &phase_zone_), |
zone_(script->GetIsolate()), |
- zone_scope_(&zone_, DELETE_ON_EXIT) {} |
+ zone_scope_(&zone_, DELETE_ON_EXIT), |
+ phase_zone_(script->GetIsolate()) {} |
explicit CompilationInfoWithZone(Handle<SharedFunctionInfo> shared_info) |
- : CompilationInfo(shared_info, &zone_), |
+ : CompilationInfo(shared_info, &zone_, &phase_zone_), |
zone_(shared_info->GetIsolate()), |
- zone_scope_(&zone_, DELETE_ON_EXIT) {} |
+ zone_scope_(&zone_, DELETE_ON_EXIT), |
+ phase_zone_(shared_info->GetIsolate()) {} |
explicit CompilationInfoWithZone(Handle<JSFunction> closure) |
- : CompilationInfo(closure, &zone_), |
+ : CompilationInfo(closure, &zone_, &phase_zone_), |
zone_(closure->GetIsolate()), |
- zone_scope_(&zone_, DELETE_ON_EXIT) {} |
+ zone_scope_(&zone_, DELETE_ON_EXIT), |
+ phase_zone_(closure->GetIsolate()) {} |
CompilationInfoWithZone(HydrogenCodeStub* stub, Isolate* isolate) |
- : CompilationInfo(stub, isolate, &zone_), |
+ : CompilationInfo(stub, isolate, &zone_, &phase_zone_), |
zone_(isolate), |
- zone_scope_(&zone_, DELETE_ON_EXIT) {} |
+ zone_scope_(&zone_, DELETE_ON_EXIT), |
+ phase_zone_(isolate) {} |
// Virtual destructor because a CompilationInfoWithZone has to exit the |
// zone scope and get rid of dependent maps even when the destructor is |
@@ -454,6 +469,7 @@ class CompilationInfoWithZone: public CompilationInfo { |
private: |
Zone zone_; |
ZoneScope zone_scope_; |
+ Zone phase_zone_; |
}; |