Commit 01a8acb6 authored by Marja Hölttä's avatar Marja Hölttä Committed by Commit Bot

[ic] Add functions for printing out handlers

Incl. random handler-related cleanups.

Change-Id: I0a80e515c44aaf57a1834ee8ffa9cd47a31ea7be
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2398518
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70155}
parent df0ea973
This diff is collapsed.
......@@ -63,7 +63,7 @@ class LoadHandler final : public DataHandler {
DoAccessCheckOnLookupStartObjectBits::Next<bool, 1>;
//
// Encoding when KindBits contains kForConstants.
// Encoding when KindBits contains kAccessor or kNativeDataProperty.
//
// Index of a value entry in the descriptor array.
......@@ -183,6 +183,10 @@ class LoadHandler final : public DataHandler {
// Decodes the KeyedAccessLoadMode from a {handler}.
static KeyedAccessLoadMode GetKeyedAccessLoadMode(MaybeObject handler);
#if defined(OBJECT_PRINT)
static void PrintHandler(Object handler, std::ostream& os);
#endif // defined(OBJECT_PRINT)
OBJECT_CONSTRUCTORS(LoadHandler, DataHandler);
};
......@@ -197,7 +201,6 @@ class StoreHandler final : public DataHandler {
DECL_VERIFIER(StoreHandler)
enum Kind {
kElement,
kField,
kConstField,
kAccessor,
......@@ -224,28 +227,20 @@ class StoreHandler final : public DataHandler {
using LookupOnLookupStartObjectBits =
DoAccessCheckOnLookupStartObjectBits::Next<bool, 1>;
// Applicable to kField, kTransitionToField and kTransitionToConstant
// kinds.
// Applicable to kField, kAccessor and kNativeDataProperty.
// Index of a value entry in the descriptor array.
using DescriptorBits =
LookupOnLookupStartObjectBits::Next<unsigned, kDescriptorIndexBitCount>;
//
// Encodes the bits when StoreSlow contains KeyedAccessStoreMode.
// Encoding when KindBits contains kStoreSlow.
//
using KeyedAccessStoreModeBits =
DescriptorBits::Next<KeyedAccessStoreMode, 2>;
//
// Encoding when KindBits contains kTransitionToConstant.
//
// Make sure we don't overflow the smi.
STATIC_ASSERT(DescriptorBits::kLastUsedBit < kSmiValueSize);
LookupOnLookupStartObjectBits::Next<KeyedAccessStoreMode, 2>;
//
// Encoding when KindBits contains kField or kTransitionToField.
// Encoding when KindBits contains kField.
//
using IsInobjectBits = DescriptorBits::Next<bool, 1>;
using RepresentationBits = IsInobjectBits::Next<Representation::Kind, 3>;
......@@ -313,6 +308,10 @@ class StoreHandler final : public DataHandler {
// Decodes the KeyedAccessStoreMode from a {handler}.
static KeyedAccessStoreMode GetKeyedAccessStoreMode(MaybeObject handler);
#if defined(OBJECT_PRINT)
static void PrintHandler(Object handler, std::ostream& os);
#endif // defined(OBJECT_PRINT)
private:
static inline Handle<Smi> StoreField(Isolate* isolate, Kind kind,
int descriptor, FieldIndex field_index,
......
......@@ -115,6 +115,13 @@ const char* ElementsKindToString(ElementsKind kind) {
}
}
const char* CompactElementsKindToString(CompactElementsKind kind) {
if (kind == CompactElementsKind::NON_COMPACT_ELEMENTS_KIND) {
return "NON_COMPACT_ELEMENTS_KIND";
}
return ElementsKindToString(static_cast<ElementsKind>(kind));
}
const ElementsKind kFastElementsKindSequence[kFastElementsKindCount] = {
PACKED_SMI_ELEMENTS, // 0
HOLEY_SMI_ELEMENTS, // 1
......
......@@ -371,6 +371,8 @@ inline CompactElementsKind ToCompactElementsKind(ElementsKind kind) {
return CompactElementsKind::NON_COMPACT_ELEMENTS_KIND;
}
const char* CompactElementsKindToString(CompactElementsKind kind);
} // namespace internal
} // namespace v8
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment