229d793602
Previously we tried to rely on the assumption that all variables would be boxed - so the machinery for setting correct catch-entry state only supported tagged values and constants. However this both leads to worse code and is not entirely correct assumption. This also: - renames various confusingly named classes: we move away from talking about "catch entry state" to "catch entry moves" - because we only record a subset of moves that needs to be performed and that does not describe the whole state; - refactors a bunch of associated code to be more readable and maintainable; - adds documentation about catch implementation in optimized code to runtime/docs/compiler; Fixes https://github.com/flutter/flutter/issues/21685. Change-Id: I03ae361a1bb7710acbd9f661ae014e663a163c59 Reviewed-on: https://dart-review.googlesource.com/74860 Commit-Queue: Vyacheslav Egorov <vegorov@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com> Reviewed-by: Alexander Markov <alexmarkov@google.com>
48 lines
1.2 KiB
C++
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 DedupCatchEntryMovesMaps();
|
|
#endif
|
|
static void DedupCodeSourceMaps();
|
|
static void DedupLists();
|
|
static void DedupInstructions();
|
|
};
|
|
|
|
} // namespace dart
|
|
|
|
#endif // RUNTIME_VM_PROGRAM_VISITOR_H_
|