2017-12-07 12:26:02 +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_VECTOR_SLOT_PAIR_H_
|
|
|
|
#define V8_VECTOR_SLOT_PAIR_H_
|
|
|
|
|
|
|
|
#include "src/globals.h"
|
|
|
|
#include "src/handles.h"
|
|
|
|
#include "src/utils.h"
|
|
|
|
|
|
|
|
namespace v8 {
|
|
|
|
namespace internal {
|
|
|
|
|
|
|
|
class FeedbackVector;
|
|
|
|
|
|
|
|
// Defines a pair of {FeedbackVector} and {FeedbackSlot}, which
|
|
|
|
// is used to access the type feedback for a certain {Node}.
|
|
|
|
class V8_EXPORT_PRIVATE VectorSlotPair {
|
|
|
|
public:
|
|
|
|
VectorSlotPair();
|
2018-09-10 08:44:50 +00:00
|
|
|
VectorSlotPair(Handle<FeedbackVector> vector, FeedbackSlot slot,
|
|
|
|
InlineCacheState ic_state)
|
|
|
|
: vector_(vector), slot_(slot), ic_state_(ic_state) {}
|
2017-12-07 12:26:02 +00:00
|
|
|
|
|
|
|
bool IsValid() const { return !vector_.is_null() && !slot_.IsInvalid(); }
|
|
|
|
|
|
|
|
Handle<FeedbackVector> vector() const { return vector_; }
|
|
|
|
FeedbackSlot slot() const { return slot_; }
|
2018-09-10 08:44:50 +00:00
|
|
|
InlineCacheState ic_state() const { return ic_state_; }
|
2017-12-07 12:26:02 +00:00
|
|
|
|
|
|
|
int index() const;
|
|
|
|
|
|
|
|
private:
|
2017-12-18 11:36:47 +00:00
|
|
|
Handle<FeedbackVector> vector_;
|
|
|
|
FeedbackSlot slot_;
|
2018-09-10 08:44:50 +00:00
|
|
|
InlineCacheState ic_state_ = UNINITIALIZED;
|
2017-12-07 12:26:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
bool operator==(VectorSlotPair const&, VectorSlotPair const&);
|
|
|
|
bool operator!=(VectorSlotPair const&, VectorSlotPair const&);
|
|
|
|
|
2018-09-19 12:24:12 +00:00
|
|
|
V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os,
|
|
|
|
VectorSlotPair const&);
|
2017-12-08 14:36:38 +00:00
|
|
|
|
2017-12-07 12:26:02 +00:00
|
|
|
size_t hash_value(VectorSlotPair const&);
|
|
|
|
|
|
|
|
} // namespace internal
|
|
|
|
} // namespace v8
|
|
|
|
|
|
|
|
#endif // V8_VECTOR_SLOT_PAIR_H_
|