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 { ...@@ -63,7 +63,7 @@ class LoadHandler final : public DataHandler {
DoAccessCheckOnLookupStartObjectBits::Next<bool, 1>; 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. // Index of a value entry in the descriptor array.
...@@ -183,6 +183,10 @@ class LoadHandler final : public DataHandler { ...@@ -183,6 +183,10 @@ class LoadHandler final : public DataHandler {
// Decodes the KeyedAccessLoadMode from a {handler}. // Decodes the KeyedAccessLoadMode from a {handler}.
static KeyedAccessLoadMode GetKeyedAccessLoadMode(MaybeObject 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); OBJECT_CONSTRUCTORS(LoadHandler, DataHandler);
}; };
...@@ -197,7 +201,6 @@ class StoreHandler final : public DataHandler { ...@@ -197,7 +201,6 @@ class StoreHandler final : public DataHandler {
DECL_VERIFIER(StoreHandler) DECL_VERIFIER(StoreHandler)
enum Kind { enum Kind {
kElement,
kField, kField,
kConstField, kConstField,
kAccessor, kAccessor,
...@@ -224,28 +227,20 @@ class StoreHandler final : public DataHandler { ...@@ -224,28 +227,20 @@ class StoreHandler final : public DataHandler {
using LookupOnLookupStartObjectBits = using LookupOnLookupStartObjectBits =
DoAccessCheckOnLookupStartObjectBits::Next<bool, 1>; DoAccessCheckOnLookupStartObjectBits::Next<bool, 1>;
// Applicable to kField, kTransitionToField and kTransitionToConstant // Applicable to kField, kAccessor and kNativeDataProperty.
// kinds.
// Index of a value entry in the descriptor array. // Index of a value entry in the descriptor array.
using DescriptorBits = using DescriptorBits =
LookupOnLookupStartObjectBits::Next<unsigned, kDescriptorIndexBitCount>; LookupOnLookupStartObjectBits::Next<unsigned, kDescriptorIndexBitCount>;
// //
// Encodes the bits when StoreSlow contains KeyedAccessStoreMode. // Encoding when KindBits contains kStoreSlow.
// //
using KeyedAccessStoreModeBits = using KeyedAccessStoreModeBits =
DescriptorBits::Next<KeyedAccessStoreMode, 2>; LookupOnLookupStartObjectBits::Next<KeyedAccessStoreMode, 2>;
//
// Encoding when KindBits contains kTransitionToConstant.
//
// Make sure we don't overflow the smi.
STATIC_ASSERT(DescriptorBits::kLastUsedBit < kSmiValueSize);
// //
// Encoding when KindBits contains kField or kTransitionToField. // Encoding when KindBits contains kField.
// //
using IsInobjectBits = DescriptorBits::Next<bool, 1>; using IsInobjectBits = DescriptorBits::Next<bool, 1>;
using RepresentationBits = IsInobjectBits::Next<Representation::Kind, 3>; using RepresentationBits = IsInobjectBits::Next<Representation::Kind, 3>;
...@@ -313,6 +308,10 @@ class StoreHandler final : public DataHandler { ...@@ -313,6 +308,10 @@ class StoreHandler final : public DataHandler {
// Decodes the KeyedAccessStoreMode from a {handler}. // Decodes the KeyedAccessStoreMode from a {handler}.
static KeyedAccessStoreMode GetKeyedAccessStoreMode(MaybeObject handler); static KeyedAccessStoreMode GetKeyedAccessStoreMode(MaybeObject handler);
#if defined(OBJECT_PRINT)
static void PrintHandler(Object handler, std::ostream& os);
#endif // defined(OBJECT_PRINT)
private: private:
static inline Handle<Smi> StoreField(Isolate* isolate, Kind kind, static inline Handle<Smi> StoreField(Isolate* isolate, Kind kind,
int descriptor, FieldIndex field_index, int descriptor, FieldIndex field_index,
......
...@@ -115,6 +115,13 @@ const char* ElementsKindToString(ElementsKind kind) { ...@@ -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] = { const ElementsKind kFastElementsKindSequence[kFastElementsKindCount] = {
PACKED_SMI_ELEMENTS, // 0 PACKED_SMI_ELEMENTS, // 0
HOLEY_SMI_ELEMENTS, // 1 HOLEY_SMI_ELEMENTS, // 1
......
...@@ -371,6 +371,8 @@ inline CompactElementsKind ToCompactElementsKind(ElementsKind kind) { ...@@ -371,6 +371,8 @@ inline CompactElementsKind ToCompactElementsKind(ElementsKind kind) {
return CompactElementsKind::NON_COMPACT_ELEMENTS_KIND; return CompactElementsKind::NON_COMPACT_ELEMENTS_KIND;
} }
const char* CompactElementsKindToString(CompactElementsKind kind);
} // namespace internal } // namespace internal
} // namespace v8 } // 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