15 :
HPhase(
"H_Environment liveness analysis", graph),
16 block_count_(graph->blocks()->length()),
17 maximum_environment_size_(graph->maximum_environment_size()),
18 live_at_block_start_(block_count_, zone()),
19 first_simulate_(block_count_, zone()),
20 first_simulate_invalid_for_index_(block_count_, zone()),
21 markers_(maximum_environment_size_, zone()),
22 collect_markers_(
true),
24 went_live_since_last_simulate_(maximum_environment_size_, zone()) {
37 int index, HSimulate* simulate) {
38 int operand_index = simulate->ToOperandIndex(index);
39 if (operand_index == -1) {
40 simulate->AddAssignedValue(index,
graph()->GetConstantUndefined());
42 simulate->SetOperandAt(operand_index,
graph()->GetConstantUndefined());
51 for (HSuccessorIterator it(block->end()); !it.Done(); it.Advance()) {
52 HBasicBlock* successor = it.Current();
53 int successor_id = successor->block_id();
55 if (live_in_successor->
Equals(*live))
continue;
56 for (
int i = 0;
i < live->
length(); ++
i) {
58 if (live_in_successor->
Contains(
i))
continue;
63 if (simulate ==
NULL)
continue;
64 DCHECK(VerifyClosures(simulate->closure(),
65 block->last_environment()->closure()));
73 HEnvironmentMarker* marker) {
75 HSimulate* simulate = marker->next_simulate();
76 if (simulate !=
NULL) {
77 DCHECK(VerifyClosures(simulate->closure(), marker->closure()));
88 for (HSuccessorIterator it(block->end()); !it.Done(); it.Advance()) {
98 case HValue::kEnvironmentMarker: {
99 HEnvironmentMarker* marker = HEnvironmentMarker::cast(instr);
100 int index = marker->index();
109 if (marker->kind() == HEnvironmentMarker::LOOKUP) {
112 DCHECK(marker->kind() == HEnvironmentMarker::BIND);
122 case HValue::kLeaveInlined:
133 case HValue::kEnterInlined: {
139 HEnterInlined* enter = HEnterInlined::cast(instr);
141 for (
int i = 0;
i < enter->return_targets()->length(); ++
i) {
142 int return_id = enter->return_targets()->at(
i)->block_id();
148 case HValue::kSimulate:
171 for (
int block_id =
block_count_ - 1; block_id >= 0; --block_id) {
175 worklist.
Remove(block_id);
178 HBasicBlock* block =
graph()->blocks()->at(block_id);
182 instr = instr->previous()) {
193 for (
int i = 0;
i < block->predecessors()->length(); ++
i) {
194 worklist.
Add(block->predecessors()->at(
i)->block_id());
196 if (block->IsInlineReturnTarget()) {
197 worklist.
Add(block->inlined_entry_block()->block_id());
209 for (
int block_id =
block_count_ - 1; block_id >= 0; --block_id) {
210 HBasicBlock* block =
graph()->blocks()->at(block_id);
223 bool HEnvironmentLivenessAnalysisPhase::VerifyClosures(
227 return a.is_identical_to(b);
bool Contains(int i) const
void Union(const BitVector &other)
bool Equals(const BitVector &other)
BitVector went_live_since_last_simulate_
void UpdateLivenessAtInstruction(HInstruction *instr, BitVector *live)
ZoneList< BitVector * > first_simulate_invalid_for_index_
ZoneList< BitVector * > live_at_block_start_
void UpdateLivenessAtBlockEnd(HBasicBlock *block, BitVector *live)
HEnvironmentLivenessAnalysisPhase(HGraph *graph)
ZoneList< HEnvironmentMarker * > markers_
int maximum_environment_size_
void ZapEnvironmentSlotsInSuccessors(HBasicBlock *block, BitVector *live)
HSimulate * last_simulate_
ZoneList< HSimulate * > first_simulate_
void ZapEnvironmentSlotsForInstruction(HEnvironmentMarker *marker)
void ZapEnvironmentSlot(int index, HSimulate *simulate)
HInstruction * next() const
virtual Opcode opcode() const =0
void Add(const T &element, AllocationPolicy allocator=AllocationPolicy())
void Set(int index, const T &element)
enable harmony numeric enable harmony object literal extensions true
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL
#define DCHECK(condition)
Debugger support for the V8 JavaScript engine.