2017-07-28 07:01:59 +00:00
|
|
|
// 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/objects/transitions.h"
|
|
|
|
|
|
|
|
namespace v8 {
|
|
|
|
namespace internal {
|
|
|
|
|
|
|
|
class TestTransitionsAccessor : public TransitionsAccessor {
|
|
|
|
public:
|
2022-02-14 09:17:28 +00:00
|
|
|
TestTransitionsAccessor(Isolate* isolate, Map map)
|
2022-02-11 16:41:49 +00:00
|
|
|
: TransitionsAccessor(isolate, map) {}
|
2022-02-14 09:17:28 +00:00
|
|
|
TestTransitionsAccessor(Isolate* isolate, Handle<Map> map)
|
|
|
|
: TransitionsAccessor(isolate, *map) {}
|
2017-07-28 07:01:59 +00:00
|
|
|
|
|
|
|
// Expose internals for tests.
|
2020-07-28 12:18:24 +00:00
|
|
|
bool IsUninitializedEncoding() { return encoding() == kUninitialized; }
|
2018-04-05 15:40:15 +00:00
|
|
|
bool IsWeakRefEncoding() { return encoding() == kWeakRef; }
|
2017-07-28 07:01:59 +00:00
|
|
|
|
|
|
|
bool IsFullTransitionArrayEncoding() {
|
|
|
|
return encoding() == kFullTransitionArray;
|
|
|
|
}
|
2020-07-23 14:24:42 +00:00
|
|
|
|
|
|
|
int Capacity() { return TransitionsAccessor::Capacity(); }
|
2020-10-16 12:31:57 +00:00
|
|
|
|
|
|
|
TransitionArray transitions() { return TransitionsAccessor::transitions(); }
|
2017-07-28 07:01:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace internal
|
|
|
|
} // namespace v8
|
|
|
|
|
|
|
|
#endif // V8_TEST_CCTEST_TEST_TRANSITIONS_H_
|