d31e83b909
If we inline something inside a loop which might throw, the throwing blocks are currently spliced in the middle of the loop. This CL moves those blocks to the very end. This improves a number of typed data benchmarks in dart-aot mode by 5-10%. Issue https://github.com/dart-lang/sdk/issues/31954 Change-Id: I5dc86291240d8dac61798ff873ffa7205edc0007 Reviewed-on: https://dart-review.googlesource.com/c/85263 Commit-Queue: Martin Kustermann <kustermann@google.com> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
33 lines
839 B
C++
33 lines
839 B
C++
// Copyright (c) 2013, 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 RUNTIME_VM_COMPILER_BACKEND_BLOCK_SCHEDULER_H_
|
|
#define RUNTIME_VM_COMPILER_BACKEND_BLOCK_SCHEDULER_H_
|
|
|
|
#include "vm/allocation.h"
|
|
|
|
namespace dart {
|
|
|
|
class FlowGraph;
|
|
|
|
class BlockScheduler : public ValueObject {
|
|
public:
|
|
explicit BlockScheduler(FlowGraph* flow_graph) : flow_graph_(flow_graph) {}
|
|
|
|
FlowGraph* flow_graph() const { return flow_graph_; }
|
|
|
|
void AssignEdgeWeights() const;
|
|
void ReorderBlocks() const;
|
|
|
|
private:
|
|
void ReorderBlocksAOT() const;
|
|
void ReorderBlocksJIT() const;
|
|
|
|
FlowGraph* const flow_graph_;
|
|
};
|
|
|
|
} // namespace dart
|
|
|
|
#endif // RUNTIME_VM_COMPILER_BACKEND_BLOCK_SCHEDULER_H_
|