test-transitions.h 1.06 KB
Newer Older
1 2 3 4 5 6 7
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef V8_TEST_CCTEST_TEST_TRANSITIONS_H_
#define V8_TEST_CCTEST_TEST_TRANSITIONS_H_

8
#include "src/objects/transitions.h"
9 10 11 12 13 14

namespace v8 {
namespace internal {

class TestTransitionsAccessor : public TransitionsAccessor {
 public:
15
  TestTransitionsAccessor(Isolate* isolate, Map map,
16 17 18 19
                          DisallowHeapAllocation* no_gc)
      : TransitionsAccessor(isolate, map, no_gc) {}
  TestTransitionsAccessor(Isolate* isolate, Handle<Map> map)
      : TransitionsAccessor(isolate, map) {}
20 21

  // Expose internals for tests.
22
  bool IsUninitializedEncoding() { return encoding() == kUninitialized; }
23
  bool IsWeakRefEncoding() { return encoding() == kWeakRef; }
24 25 26 27

  bool IsFullTransitionArrayEncoding() {
    return encoding() == kFullTransitionArray;
  }
28 29

  int Capacity() { return TransitionsAccessor::Capacity(); }
30 31 32 33 34 35
};

}  // namespace internal
}  // namespace v8

#endif  // V8_TEST_CCTEST_TEST_TRANSITIONS_H_