0cc70c4a7c
In addition, this removes support for seeding the VM isolate snapshot with Instructions and referencing those Instructions in the isolate snapshot. This was leftover from an earlier experiment to share Instructions between a Core-JIT snapshot and App-JIT snapshots. Removing this reclaims the sign bit on Instruction offsets. Add missing cases to TypeTestingStubFinder::StubNameFromAddresss. Change-Id: Ie87216b4e284db1dc3eddb12f38ddbe8a841d312 Reviewed-on: https://dart-review.googlesource.com/50620 Commit-Queue: Ryan Macnak <rmacnak@google.com> Reviewed-by: Alexander Markov <alexmarkov@google.com>
56 lines
1.4 KiB
C++
56 lines
1.4 KiB
C++
// Copyright (c) 2017, 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_GC_COMPACTOR_H_
|
|
#define RUNTIME_VM_GC_COMPACTOR_H_
|
|
|
|
#include "vm/allocation.h"
|
|
#include "vm/dart_api_state.h"
|
|
#include "vm/globals.h"
|
|
#include "vm/visitor.h"
|
|
|
|
namespace dart {
|
|
|
|
// Forward declarations.
|
|
class FreeList;
|
|
class Heap;
|
|
class HeapPage;
|
|
class RawObject;
|
|
|
|
// Implements a sliding compactor.
|
|
class GCCompactor : public ValueObject,
|
|
public HandleVisitor,
|
|
public ObjectPointerVisitor {
|
|
public:
|
|
GCCompactor(Thread* thread, Heap* heap)
|
|
: HandleVisitor(thread),
|
|
ObjectPointerVisitor(thread->isolate()),
|
|
heap_(heap) {}
|
|
~GCCompactor() {}
|
|
|
|
void Compact(HeapPage* pages, FreeList* freelist, Mutex* mutex);
|
|
|
|
private:
|
|
void SetupImagePageBoundaries();
|
|
void ForwardStackPointers();
|
|
void ForwardPointer(RawObject** ptr);
|
|
void VisitPointers(RawObject** first, RawObject** last);
|
|
void VisitHandle(uword addr);
|
|
|
|
Heap* heap_;
|
|
|
|
struct ImagePageRange {
|
|
uword base;
|
|
uword size;
|
|
};
|
|
// There are up to 6 images to consider:
|
|
// {instructions, data} x {vm isolate, current isolate, shared}
|
|
static const intptr_t kMaxImagePages = 6;
|
|
ImagePageRange image_page_ranges_[kMaxImagePages];
|
|
};
|
|
|
|
} // namespace dart
|
|
|
|
#endif // RUNTIME_VM_GC_COMPACTOR_H_
|