dart-sdk/runtime/vm/program_visitor.h
Ryan Macnak 344a9d546b [vm] Deduplicate catch entry state maps.
Flutter gallery ARM32:
TypedData          74349 ->    22701 (-69.5%)
Total snapshot  10741228 -> 10689108 (-0.49%)

Bug: https://github.com/dart-lang/sdk/issues/31302
Change-Id: I759147e4a9cd532eb338d96558a423e675358790
Reviewed-on: https://dart-review.googlesource.com/20562
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2017-11-14 23:06:05 +00:00

48 lines
1.2 KiB
C++

// Copyright (c) 2015, 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_PROGRAM_VISITOR_H_
#define RUNTIME_VM_PROGRAM_VISITOR_H_
#include "vm/allocation.h"
namespace dart {
class Function;
class Class;
template <typename T>
class Visitor : public ValueObject {
public:
virtual ~Visitor() {}
virtual void Visit(const T& obj) = 0;
};
typedef Visitor<Function> FunctionVisitor;
typedef Visitor<Class> ClassVisitor;
class ProgramVisitor : public AllStatic {
public:
static void VisitFunctions(FunctionVisitor* visitor);
static void VisitClasses(ClassVisitor* visitor);
static void Dedup();
private:
static void ShareMegamorphicBuckets();
static void DedupStackMaps();
static void DedupPcDescriptors();
NOT_IN_PRECOMPILED(static void DedupDeoptEntries());
#if defined(DART_PRECOMPILER)
static void DedupCatchEntryStateMaps();
#endif
static void DedupCodeSourceMaps();
static void DedupLists();
static void DedupInstructions();
};
} // namespace dart
#endif // RUNTIME_VM_PROGRAM_VISITOR_H_