94cf4347e4
Since we have an uninitialized TransitionArray that we want to insert an element (map1), we can't guarantee that said element would exist at the point of the search. Then, we search for an element guaranteed not to be (map2) and we check that we did not find it. If we have a data race, this would also trigger it. Bug: v8:7790 Change-Id: Ib90044d7c0901d599aed041f608f2c0bce506d67 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2319995 Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org> Reviewed-by: Nico Hartmann <nicohartmann@chromium.org> Cr-Commit-Position: refs/heads/master@{#69099}
36 lines
1.1 KiB
C++
36 lines
1.1 KiB
C++
// 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:
|
|
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 IsUninitializedEncoding() { return encoding() == kUninitialized; }
|
|
bool IsWeakRefEncoding() { return encoding() == kWeakRef; }
|
|
|
|
bool IsFullTransitionArrayEncoding() {
|
|
return encoding() == kFullTransitionArray;
|
|
}
|
|
|
|
int Capacity() { return TransitionsAccessor::Capacity(); }
|
|
};
|
|
|
|
} // namespace internal
|
|
} // namespace v8
|
|
|
|
#endif // V8_TEST_CCTEST_TEST_TRANSITIONS_H_
|