summaryrefslogtreecommitdiff
path: root/deps/v8/test/cctest/test-transitions.h
blob: 08c5d2cab2455334948d8b464070fab1d41d2c31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// 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_

#include "src/transitions.h"

namespace v8 {
namespace internal {

class TestTransitionsAccessor : public TransitionsAccessor {
 public:
  TestTransitionsAccessor(Isolate* isolate, Map* map,
                          DisallowHeapAllocation* no_gc)
      : TransitionsAccessor(isolate, map, no_gc) {}
  TestTransitionsAccessor(Isolate* isolate, Handle<Map> map)
      : TransitionsAccessor(isolate, map) {}

  // Expose internals for tests.
  bool IsWeakRefEncoding() { return encoding() == kWeakRef; }

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

}  // namespace internal
}  // namespace v8

#endif  // V8_TEST_CCTEST_TEST_TRANSITIONS_H_