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

Side by Side Diff: src/hydrogen-escape-analysis.h

Issue 1405363003: Move Hydrogen and Lithium to src/crankshaft/ (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebased Created 5 years, 2 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
« no previous file with comments | « src/hydrogen-environment-liveness.cc ('k') | src/hydrogen-escape-analysis.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef V8_HYDROGEN_ESCAPE_ANALYSIS_H_
6 #define V8_HYDROGEN_ESCAPE_ANALYSIS_H_
7
8 #include "src/allocation.h"
9 #include "src/hydrogen.h"
10
11 namespace v8 {
12 namespace internal {
13
14
15 class HEscapeAnalysisPhase : public HPhase {
16 public:
17 explicit HEscapeAnalysisPhase(HGraph* graph)
18 : HPhase("H_Escape analysis", graph),
19 captured_(0, zone()),
20 number_of_objects_(0),
21 number_of_values_(0),
22 cumulative_values_(0),
23 block_states_(graph->blocks()->length(), zone()) { }
24
25 void Run();
26
27 private:
28 void CollectCapturedValues();
29 bool HasNoEscapingUses(HValue* value, int size);
30 void PerformScalarReplacement();
31 void AnalyzeDataFlow(HInstruction* instr);
32
33 HCapturedObject* NewState(HInstruction* prev);
34 HCapturedObject* NewStateForAllocation(HInstruction* prev);
35 HCapturedObject* NewStateForLoopHeader(HInstruction* prev, HCapturedObject*);
36 HCapturedObject* NewStateCopy(HInstruction* prev, HCapturedObject* state);
37
38 HPhi* NewPhiAndInsert(HBasicBlock* block, HValue* incoming_value, int index);
39
40 HValue* NewMapCheckAndInsert(HCapturedObject* state, HCheckMaps* mapcheck);
41
42 HValue* NewLoadReplacement(HLoadNamedField* load, HValue* load_value);
43
44 HCapturedObject* StateAt(HBasicBlock* block) {
45 return block_states_.at(block->block_id());
46 }
47
48 void SetStateAt(HBasicBlock* block, HCapturedObject* state) {
49 block_states_.Set(block->block_id(), state);
50 }
51
52 // List of allocations captured during collection phase.
53 ZoneList<HInstruction*> captured_;
54
55 // Number of captured objects on which scalar replacement was done.
56 int number_of_objects_;
57
58 // Number of scalar values tracked during scalar replacement phase.
59 int number_of_values_;
60 int cumulative_values_;
61
62 // Map of block IDs to the data-flow state at block entry during the
63 // scalar replacement phase.
64 ZoneList<HCapturedObject*> block_states_;
65 };
66
67
68 } // namespace internal
69 } // namespace v8
70
71 #endif // V8_HYDROGEN_ESCAPE_ANALYSIS_H_
OLDNEW
« no previous file with comments | « src/hydrogen-environment-liveness.cc ('k') | src/hydrogen-escape-analysis.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698