755790f46f
Review URL: https://chromiumcodereview.appspot.com//10440099 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8174 260f80e4-7a28-3924-810f-c04153c831b5
40 lines
1.0 KiB
C++
40 lines
1.0 KiB
C++
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
#ifndef VM_FLOW_GRAPH_OPTIMIZER_H_
|
|
#define VM_FLOW_GRAPH_OPTIMIZER_H_
|
|
|
|
#include "vm/intermediate_language.h"
|
|
|
|
namespace dart {
|
|
|
|
template <typename T> class GrowableArray;
|
|
|
|
class FlowGraphOptimizer : public FlowGraphVisitor {
|
|
public:
|
|
explicit FlowGraphOptimizer(const GrowableArray<BlockEntryInstr*>& blocks)
|
|
: FlowGraphVisitor(blocks) {}
|
|
virtual ~FlowGraphOptimizer() {}
|
|
|
|
void ApplyICData();
|
|
|
|
virtual void VisitInstanceCall(InstanceCallComp* comp);
|
|
|
|
virtual void VisitDo(DoInstr* instr);
|
|
virtual void VisitBind(BindInstr* instr);
|
|
|
|
private:
|
|
void VisitBlocks();
|
|
|
|
void TryReplaceWithBinaryOp(InstanceCallComp* comp, Token::Kind op_kind);
|
|
void TryReplaceWithUnaryOp(InstanceCallComp* comp, Token::Kind op_kind);
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(FlowGraphOptimizer);
|
|
};
|
|
|
|
} // namespace dart
|
|
|
|
#endif // VM_FLOW_GRAPH_OPTIMIZER_H_
|