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

Side by Side Diff: src/hydrogen.h

Issue 17657004: Refactor Hydrogen GVN into an HPhase and use the phase zone. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/hydrogen.cc » ('j') | src/hydrogen-gvn.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 HEnvironment* start_environment() const { return start_environment_; } 277 HEnvironment* start_environment() const { return start_environment_; }
278 278
279 void FinalizeUniqueValueIds(); 279 void FinalizeUniqueValueIds();
280 void InitializeInferredTypes(); 280 void InitializeInferredTypes();
281 void InsertTypeConversions(); 281 void InsertTypeConversions();
282 void MergeRemovableSimulates(); 282 void MergeRemovableSimulates();
283 void InsertRepresentationChanges(); 283 void InsertRepresentationChanges();
284 void MarkDeoptimizeOnUndefined(); 284 void MarkDeoptimizeOnUndefined();
285 void ComputeMinusZeroChecks(); 285 void ComputeMinusZeroChecks();
286 void ComputeSafeUint32Operations(); 286 void ComputeSafeUint32Operations();
287 void GlobalValueNumbering();
288 bool ProcessArgumentsObject(); 287 bool ProcessArgumentsObject();
289 void EliminateRedundantPhis(); 288 void EliminateRedundantPhis();
290 void Canonicalize(); 289 void Canonicalize();
291 void OrderBlocks(); 290 void OrderBlocks();
292 void AssignDominators(); 291 void AssignDominators();
293 void SetupInformativeDefinitions(); 292 void SetupInformativeDefinitions();
294 void EliminateRedundantBoundsChecks(); 293 void EliminateRedundantBoundsChecks();
295 void DehoistSimpleArrayIndexComputations(); 294 void DehoistSimpleArrayIndexComputations();
296 void RestoreActualValues(); 295 void RestoreActualValues();
297 void DeadCodeElimination(const char *phase_name); 296 void DeadCodeElimination(const char *phase_name);
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 if (uint32_instructions_ == NULL) { 420 if (uint32_instructions_ == NULL) {
422 uint32_instructions_ = new(zone()) ZoneList<HInstruction*>(4, zone()); 421 uint32_instructions_ = new(zone()) ZoneList<HInstruction*>(4, zone());
423 } 422 }
424 uint32_instructions_->Add(instr, zone()); 423 uint32_instructions_->Add(instr, zone());
425 } 424 }
426 425
427 private: 426 private:
428 HConstant* GetConstant(SetOncePointer<HConstant>* pointer, 427 HConstant* GetConstant(SetOncePointer<HConstant>* pointer,
429 int32_t integer_value); 428 int32_t integer_value);
430 429
430 template<typename Phase>
431 void Run() { Phase phase(this, info()->phase_zone()); phase.Run(); }
danno 2013/06/25 15:20:54 Isn't this from another CL?
Benedikt Meurer 2013/06/27 08:20:04 Done.
431 void MarkLive(HValue* ref, HValue* instr, ZoneList<HValue*>* worklist); 432 void MarkLive(HValue* ref, HValue* instr, ZoneList<HValue*>* worklist);
432 void MarkLiveInstructions(); 433 void MarkLiveInstructions();
433 void RemoveDeadInstructions(); 434 void RemoveDeadInstructions();
434 void MarkAsDeoptimizingRecursively(HBasicBlock* block); 435 void MarkAsDeoptimizingRecursively(HBasicBlock* block);
435 void NullifyUnreachableInstructions(); 436 void NullifyUnreachableInstructions();
436 void InsertTypeConversions(HInstruction* instr); 437 void InsertTypeConversions(HInstruction* instr);
437 void PropagateMinusZeroChecks(HValue* value, BitVector* visited); 438 void PropagateMinusZeroChecks(HValue* value, BitVector* visited);
438 void RecursivelyMarkPhiDeoptimizeOnUndefined(HPhi* phi); 439 void RecursivelyMarkPhiDeoptimizeOnUndefined(HPhi* phi);
439 void InsertRepresentationChangeForUse(HValue* value, 440 void InsertRepresentationChangeForUse(HValue* value,
440 HValue* use_value, 441 HValue* use_value,
(...skipping 1509 matching lines...) Expand 10 before | Expand all | Expand 10 after
1950 int64_t optimize_graph_; 1951 int64_t optimize_graph_;
1951 int64_t generate_code_; 1952 int64_t generate_code_;
1952 unsigned total_size_; 1953 unsigned total_size_;
1953 int64_t full_code_gen_; 1954 int64_t full_code_gen_;
1954 double source_size_; 1955 double source_size_;
1955 }; 1956 };
1956 1957
1957 1958
1958 class HPhase : public CompilationPhase { 1959 class HPhase : public CompilationPhase {
1959 public: 1960 public:
1961 // TODO(bmeurer) Remove this constructor once all
1962 // Hydrogen phases have been migrated
1960 HPhase(const char* name, HGraph* graph) 1963 HPhase(const char* name, HGraph* graph)
1961 : CompilationPhase(name, graph->isolate(), graph->zone()), 1964 : CompilationPhase(name, graph->isolate(), graph->zone()),
1962 graph_(graph) { } 1965 graph_(graph) { }
1966 HPhase(const char* name, HGraph* graph, Zone* zone);
danno 2013/06/25 15:20:54 again, why do you need to pass the zone in? Either
Benedikt Meurer 2013/06/27 08:20:04 Done.
1963 ~HPhase(); 1967 ~HPhase();
1964 1968
1969 protected:
1970 HGraph* graph() const { return graph_; }
1971
1965 private: 1972 private:
1966 HGraph* graph_; 1973 HGraph* graph_;
1974 unsigned graph_zone_start_allocation_size_;
1967 1975
1968 DISALLOW_COPY_AND_ASSIGN(HPhase); 1976 DISALLOW_COPY_AND_ASSIGN(HPhase);
1969 }; 1977 };
1970 1978
1971 1979
1972 class HTracer: public Malloced { 1980 class HTracer: public Malloced {
1973 public: 1981 public:
1974 explicit HTracer(int isolate_id) 1982 explicit HTracer(int isolate_id)
1975 : trace_(&string_allocator_), indent_(0) { 1983 : trace_(&string_allocator_), indent_(0) {
1976 OS::SNPrintF(filename_, 1984 OS::SNPrintF(filename_,
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
2047 EmbeddedVector<char, 64> filename_; 2055 EmbeddedVector<char, 64> filename_;
2048 HeapStringAllocator string_allocator_; 2056 HeapStringAllocator string_allocator_;
2049 StringStream trace_; 2057 StringStream trace_;
2050 int indent_; 2058 int indent_;
2051 }; 2059 };
2052 2060
2053 2061
2054 } } // namespace v8::internal 2062 } } // namespace v8::internal
2055 2063
2056 #endif // V8_HYDROGEN_H_ 2064 #endif // V8_HYDROGEN_H_
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen.cc » ('j') | src/hydrogen-gvn.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698