| Index: src/compiler.h
|
| diff --git a/src/compiler.h b/src/compiler.h
|
| index f53feb954a49c53016d0eece13f3425b117b1619..161f40458c99638d74b9d5e7ae3470f7c87e1a94 100644
|
| --- a/src/compiler.h
|
| +++ b/src/compiler.h
|
| @@ -239,16 +239,17 @@ class CompilationInfo {
|
| deferred_handles_ = deferred_handles;
|
| }
|
|
|
| - ZoneList<Handle<Map> >* dependent_maps(DependentCode::DependencyGroup group) {
|
| - if (dependent_maps_[group] == NULL) {
|
| - dependent_maps_[group] = new(zone_) ZoneList<Handle<Map> >(2, zone_);
|
| + ZoneList<Handle<HeapObject> >* dependencies(
|
| + DependentCode::DependencyGroup group) {
|
| + if (dependencies_[group] == NULL) {
|
| + dependencies_[group] = new(zone_) ZoneList<Handle<HeapObject> >(2, zone_);
|
| }
|
| - return dependent_maps_[group];
|
| + return dependencies_[group];
|
| }
|
|
|
| - void CommitDependentMaps(Handle<Code> code);
|
| + void CommitDependencies(Handle<Code> code);
|
|
|
| - void RollbackDependentMaps();
|
| + void RollbackDependencies();
|
|
|
| void SaveHandles() {
|
| SaveHandle(&closure_);
|
| @@ -291,18 +292,22 @@ class CompilationInfo {
|
| return object_wrapper_;
|
| }
|
|
|
| - void AbortDueToDependentMap() {
|
| - mode_ = DEPENDENT_MAP_ABORT;
|
| + void AbortDueToDependencyChange() {
|
| + mode_ = DEPENDENCY_CHANGE_ABORT;
|
| }
|
|
|
| - bool HasAbortedDueToDependentMap() {
|
| - return mode_ == DEPENDENT_MAP_ABORT;
|
| + bool HasAbortedDueToDependencyChange() {
|
| + return mode_ == DEPENDENCY_CHANGE_ABORT;
|
| }
|
|
|
| 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);
|
| + CompilationInfo(Handle<SharedFunctionInfo> shared_info,
|
| + Zone* zone);
|
| + CompilationInfo(HydrogenCodeStub* stub,
|
| + Isolate* isolate,
|
| + Zone* zone);
|
|
|
| private:
|
| Isolate* isolate_;
|
| @@ -317,7 +322,7 @@ class CompilationInfo {
|
| OPTIMIZE,
|
| NONOPT,
|
| STUB,
|
| - DEPENDENT_MAP_ABORT
|
| + DEPENDENCY_CHANGE_ABORT
|
| };
|
|
|
| void Initialize(Isolate* isolate, Mode mode, Zone* zone);
|
| @@ -397,7 +402,7 @@ class CompilationInfo {
|
|
|
| DeferredHandles* deferred_handles_;
|
|
|
| - ZoneList<Handle<Map> >* dependent_maps_[DependentCode::kGroupCount];
|
| + ZoneList<Handle<HeapObject> >* dependencies_[DependentCode::kGroupCount];
|
|
|
| template<typename T>
|
| void SaveHandle(Handle<T> *object) {
|
| @@ -429,31 +434,26 @@ class CompilationInfoWithZone: public CompilationInfo {
|
| public:
|
| explicit CompilationInfoWithZone(Handle<Script> script)
|
| : CompilationInfo(script, &zone_),
|
| - zone_(script->GetIsolate()),
|
| - zone_scope_(&zone_, DELETE_ON_EXIT) {}
|
| + zone_(script->GetIsolate()) {}
|
| explicit CompilationInfoWithZone(Handle<SharedFunctionInfo> shared_info)
|
| : CompilationInfo(shared_info, &zone_),
|
| - zone_(shared_info->GetIsolate()),
|
| - zone_scope_(&zone_, DELETE_ON_EXIT) {}
|
| + zone_(shared_info->GetIsolate()) {}
|
| explicit CompilationInfoWithZone(Handle<JSFunction> closure)
|
| : CompilationInfo(closure, &zone_),
|
| - zone_(closure->GetIsolate()),
|
| - zone_scope_(&zone_, DELETE_ON_EXIT) {}
|
| + zone_(closure->GetIsolate()) {}
|
| CompilationInfoWithZone(HydrogenCodeStub* stub, Isolate* isolate)
|
| : CompilationInfo(stub, isolate, &zone_),
|
| - zone_(isolate),
|
| - zone_scope_(&zone_, DELETE_ON_EXIT) {}
|
| + zone_(isolate) {}
|
|
|
| // Virtual destructor because a CompilationInfoWithZone has to exit the
|
| // zone scope and get rid of dependent maps even when the destructor is
|
| // called when cast as a CompilationInfo.
|
| virtual ~CompilationInfoWithZone() {
|
| - RollbackDependentMaps();
|
| + RollbackDependencies();
|
| }
|
|
|
| private:
|
| Zone zone_;
|
| - ZoneScope zone_scope_;
|
| };
|
|
|
|
|
| @@ -617,6 +617,30 @@ class Compiler : public AllStatic {
|
| };
|
|
|
|
|
| +class CompilationPhase BASE_EMBEDDED {
|
| + public:
|
| + CompilationPhase(const char* name, CompilationInfo* info);
|
| + ~CompilationPhase();
|
| +
|
| + protected:
|
| + bool ShouldProduceTraceOutput() const;
|
| +
|
| + const char* name() const { return name_; }
|
| + CompilationInfo* info() const { return info_; }
|
| + Isolate* isolate() const { return info()->isolate(); }
|
| + Zone* zone() { return &zone_; }
|
| +
|
| + private:
|
| + const char* name_;
|
| + CompilationInfo* info_;
|
| + Zone zone_;
|
| + unsigned info_zone_start_allocation_size_;
|
| + int64_t start_ticks_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(CompilationPhase);
|
| +};
|
| +
|
| +
|
| } } // namespace v8::internal
|
|
|
| #endif // V8_COMPILER_H_
|
|
|