mirror of
https://github.com/dart-lang/sdk
synced 2024-09-15 22:31:50 +00:00
699f84f941
This is the first step to adding Thread Local Allocation Buffers to the VM. In this step, the mutator alone allocates to the new space, but keeps track of the start and end of the space. This is akin to a single large TLAB. As a result, the generated code and the dbc simulator changed how they allocate objects into the new space as well. R=rmacnak@google.com Review-Url: https://codereview.chromium.org/2980033002 .
39 lines
1.1 KiB
C++
39 lines
1.1 KiB
C++
// Copyright (c) 2014, 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.
|
|
|
|
#include "vm/scavenger.h"
|
|
#include "platform/assert.h"
|
|
#include "vm/unit_test.h"
|
|
#include "vm/visitor.h"
|
|
|
|
namespace dart {
|
|
|
|
// Expects to visit no objects (since the space should be empty).
|
|
class FailingObjectVisitor : public ObjectVisitor {
|
|
public:
|
|
FailingObjectVisitor() {}
|
|
virtual void VisitObject(RawObject* obj) { EXPECT(false); }
|
|
};
|
|
|
|
// Expects to visit no objects (since the space should be empty).
|
|
class FailingObjectPointerVisitor : public ObjectPointerVisitor {
|
|
public:
|
|
FailingObjectPointerVisitor() : ObjectPointerVisitor(NULL) {}
|
|
virtual void VisitPointers(RawObject** first, RawObject** last) {
|
|
EXPECT(false);
|
|
}
|
|
};
|
|
|
|
// Expects to visit no objects (since the space should be empty).
|
|
class FailingFindObjectVisitor : public FindObjectVisitor {
|
|
public:
|
|
FailingFindObjectVisitor() {}
|
|
virtual bool FindObject(RawObject* obj) const {
|
|
EXPECT(false);
|
|
return false;
|
|
}
|
|
};
|
|
|
|
} // namespace dart
|