Commit 42a7c0be authored by Igor Sheludko's avatar Igor Sheludko Committed by Commit Bot

[runtime] Introduce Load/StoreHandler heap objects.

They will eventually be used instead of Tuple3/FixedArray by the IC system.

Bug: v8:5561, v8:7159
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I39faad1b2dc10ce7d42cb7477ea87b64d1e0b44c
Reviewed-on: https://chromium-review.googlesource.com/806178
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49908}
parent c436429c
......@@ -763,6 +763,8 @@ action("postmortem-metadata") {
"src/objects-inl.h",
"src/objects/code-inl.h",
"src/objects/code.h",
"src/objects/data-handler.h",
"src/objects/data-handler-inl.h",
"src/objects/fixed-array-inl.h",
"src/objects/fixed-array.h",
"src/objects/js-array-inl.h",
......
......@@ -9084,9 +9084,9 @@ class Internals {
static const int kFirstNonstringType = 0x80;
static const int kOddballType = 0x83;
static const int kForeignType = 0x87;
static const int kJSSpecialApiObjectType = 0xbc;
static const int kJSApiObjectType = 0xc0;
static const int kJSObjectType = 0xc1;
static const int kJSSpecialApiObjectType = 0xbe;
static const int kJSApiObjectType = 0xc2;
static const int kJSObjectType = 0xc3;
static const int kUndefinedOddballKind = 5;
static const int kNullOddballKind = 3;
......
......@@ -17,6 +17,7 @@
#include "src/globals.h"
#include "src/heap/heap.h"
#include "src/machine-type.h"
#include "src/objects/data-handler.h"
#include "src/runtime/runtime.h"
#include "src/zone/zone-containers.h"
......
......@@ -309,6 +309,8 @@ Type::bitset BitsetType::Lub(i::Map* map) {
case PROTOTYPE_INFO_TYPE:
case TUPLE2_TYPE:
case TUPLE3_TYPE:
case LOAD_HANDLER_TYPE:
case STORE_HANDLER_TYPE:
case CONTEXT_EXTENSION_TYPE:
case ASYNC_GENERATOR_REQUEST_TYPE:
case CODE_DATA_CONTAINER_TYPE:
......
......@@ -3677,6 +3677,8 @@ Handle<Object> TranslatedState::MaterializeCapturedObjectAt(
case PROTOTYPE_INFO_TYPE:
case TUPLE2_TYPE:
case TUPLE3_TYPE:
case LOAD_HANDLER_TYPE:
case STORE_HANDLER_TYPE:
case ASYNC_GENERATOR_REQUEST_TYPE:
case WASM_MODULE_TYPE:
case WASM_INSTANCE_TYPE:
......
......@@ -29,6 +29,14 @@ ROOT_LIST(ROOT_ACCESSOR)
STRUCT_LIST(STRUCT_MAP_ACCESSOR)
#undef STRUCT_MAP_ACCESSOR
#define DATA_HANDLER_MAP_ACCESSOR(NAME, Name, Size, name) \
Handle<Map> Factory::name##_map() { \
return Handle<Map>(bit_cast<Map**>( \
&isolate()->heap()->roots_[Heap::k##Name##Size##MapRootIndex])); \
}
DATA_HANDLER_LIST(DATA_HANDLER_MAP_ACCESSOR)
#undef DATA_HANDLER_MAP_ACCESSOR
#define STRING_ACCESSOR(name, str) \
Handle<String> Factory::name() { \
return Handle<String>(bit_cast<String**>( \
......
......@@ -2766,6 +2766,27 @@ Handle<Map> Factory::ObjectLiteralMapFromCache(Handle<Context> native_context,
return map;
}
Handle<LoadHandler> Factory::NewLoadHandler(int data_count) {
Handle<Map> map;
if (data_count == 1) {
map = load_handler1_map();
} else {
DCHECK_EQ(2, data_count);
map = load_handler2_map();
}
return New<LoadHandler>(map, OLD_SPACE);
}
Handle<StoreHandler> Factory::NewStoreHandler(int data_count) {
Handle<Map> map;
if (data_count == 1) {
map = store_handler1_map();
} else {
DCHECK_EQ(2, data_count);
map = store_handler2_map();
}
return New<StoreHandler>(map, OLD_SPACE);
}
void Factory::SetRegExpAtomData(Handle<JSRegExp> regexp,
JSRegExp::Type type,
......
......@@ -7,8 +7,10 @@
#include "src/feedback-vector.h"
#include "src/globals.h"
#include "src/ic/handler-configuration.h"
#include "src/isolate.h"
#include "src/messages.h"
#include "src/objects/data-handler.h"
#include "src/objects/descriptor-array.h"
#include "src/objects/dictionary.h"
#include "src/objects/js-array.h"
......@@ -735,6 +737,11 @@ class V8_EXPORT_PRIVATE Factory final {
STRUCT_LIST(STRUCT_MAP_ACCESSOR)
#undef STRUCT_MAP_ACCESSOR
#define DATA_HANDLER_MAP_ACCESSOR(NAME, Name, Size, name) \
inline Handle<Map> name##_map();
DATA_HANDLER_LIST(DATA_HANDLER_MAP_ACCESSOR)
#undef DATA_HANDLER_MAP_ACCESSOR
#define STRING_ACCESSOR(name, str) inline Handle<String> name();
INTERNALIZED_STRING_LIST(STRING_ACCESSOR)
#undef STRING_ACCESSOR
......@@ -806,6 +813,9 @@ class V8_EXPORT_PRIVATE Factory final {
Handle<Map> ObjectLiteralMapFromCache(Handle<Context> native_context,
int number_of_properties);
Handle<LoadHandler> NewLoadHandler(int data_count);
Handle<StoreHandler> NewStoreHandler(int data_count);
Handle<RegExpMatchInfo> NewRegExpMatchInfo();
// Creates a new FixedArray that holds the data associated with the
......
......@@ -52,6 +52,13 @@ ROOT_LIST(ROOT_ACCESSOR)
STRUCT_LIST(STRUCT_MAP_ACCESSOR)
#undef STRUCT_MAP_ACCESSOR
#define DATA_HANDLER_MAP_ACCESSOR(NAME, Name, Size, name) \
Map* Heap::name##_map() { \
return Map::cast(roots_[k##Name##Size##MapRootIndex]); \
}
DATA_HANDLER_LIST(DATA_HANDLER_MAP_ACCESSOR)
#undef DATA_HANDLER_MAP_ACCESSOR
#define STRING_ACCESSOR(name, str) \
String* Heap::name() { return String::cast(roots_[k##name##RootIndex]); }
INTERNALIZED_STRING_LIST(STRING_ACCESSOR)
......
......@@ -46,7 +46,7 @@
#include "src/heap/stress-marking-observer.h"
#include "src/heap/sweeper.h"
#include "src/interpreter/interpreter.h"
#include "src/objects/object-macros.h"
#include "src/objects/data-handler.h"
#include "src/objects/shared-function-info.h"
#include "src/regexp/jsregexp.h"
#include "src/runtime-profiler.h"
......@@ -61,6 +61,9 @@
#include "src/v8.h"
#include "src/vm-state-inl.h"
// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"
namespace v8 {
namespace internal {
......
......@@ -561,42 +561,48 @@ class HistogramInfo : public NumberAndSizeInfo {
class Heap {
public:
// Declare all the root indices. This defines the root list order.
// clang-format off
enum RootListIndex {
#define ROOT_INDEX_DECLARATION(type, name, camel_name) k##camel_name##RootIndex,
STRONG_ROOT_LIST(ROOT_INDEX_DECLARATION)
#undef ROOT_INDEX_DECLARATION
#define STRING_INDEX_DECLARATION(name, str) k##name##RootIndex,
INTERNALIZED_STRING_LIST(STRING_INDEX_DECLARATION)
#undef STRING_DECLARATION
#define SYMBOL_INDEX_DECLARATION(name) k##name##RootIndex,
PRIVATE_SYMBOL_LIST(SYMBOL_INDEX_DECLARATION)
#undef SYMBOL_INDEX_DECLARATION
#define SYMBOL_INDEX_DECLARATION(name, description) k##name##RootIndex,
PUBLIC_SYMBOL_LIST(SYMBOL_INDEX_DECLARATION)
WELL_KNOWN_SYMBOL_LIST(SYMBOL_INDEX_DECLARATION)
#undef SYMBOL_INDEX_DECLARATION
#define ACCESSOR_INDEX_DECLARATION(accessor_name, AccessorName) \
k##AccessorName##AccessorRootIndex,
ACCESSOR_INFO_LIST(ACCESSOR_INDEX_DECLARATION)
#undef ACCESSOR_INDEX_DECLARATION
// Utility type maps
#define DECLARE_STRUCT_MAP(NAME, Name, name) k##Name##MapRootIndex,
STRUCT_LIST(DECLARE_STRUCT_MAP)
#undef DECLARE_STRUCT_MAP
kStringTableRootIndex,
#define ROOT_INDEX_DECLARATION(type, name, camel_name) k##camel_name##RootIndex,
SMI_ROOT_LIST(ROOT_INDEX_DECLARATION)
#undef ROOT_INDEX_DECLARATION
kRootListLength,
#define DECL(type, name, camel_name) k##camel_name##RootIndex,
STRONG_ROOT_LIST(DECL)
#undef DECL
#define DECL(name, str) k##name##RootIndex,
INTERNALIZED_STRING_LIST(DECL)
#undef DECL
#define DECL(name) k##name##RootIndex,
PRIVATE_SYMBOL_LIST(DECL)
#undef DECL
#define DECL(name, description) k##name##RootIndex,
PUBLIC_SYMBOL_LIST(DECL)
WELL_KNOWN_SYMBOL_LIST(DECL)
#undef DECL
#define DECL(accessor_name, AccessorName) k##AccessorName##AccessorRootIndex,
ACCESSOR_INFO_LIST(DECL)
#undef DECL
#define DECL(NAME, Name, name) k##Name##MapRootIndex,
STRUCT_LIST(DECL)
#undef DECL
#define DECL(NAME, Name, Size, name) k##Name##Size##MapRootIndex,
DATA_HANDLER_LIST(DECL)
#undef DECL
kStringTableRootIndex,
#define DECL(type, name, camel_name) k##camel_name##RootIndex,
SMI_ROOT_LIST(DECL)
#undef DECL
kRootListLength,
kStrongRootListLength = kStringTableRootIndex,
kSmiRootsStart = kStringTableRootIndex + 1
};
// clang-format on
enum FindMementoMode { kForRuntime, kForGC };
......@@ -1047,6 +1053,11 @@ class Heap {
STRUCT_LIST(STRUCT_MAP_ACCESSOR)
#undef STRUCT_MAP_ACCESSOR
#define DATA_HANDLER_MAP_ACCESSOR(NAME, Name, Size, name) \
inline Map* name##_map();
DATA_HANDLER_LIST(DATA_HANDLER_MAP_ACCESSOR)
#undef DATA_HANDLER_MAP_ACCESSOR
#define STRING_ACCESSOR(name, str) inline String* name();
INTERNALIZED_STRING_LIST(STRING_ACCESSOR)
#undef STRING_ACCESSOR
......
......@@ -17,6 +17,7 @@
#include "src/lookup-cache.h"
#include "src/objects-inl.h"
#include "src/objects/arguments.h"
#include "src/objects/data-handler.h"
#include "src/objects/debug-objects.h"
#include "src/objects/descriptor-array.h"
#include "src/objects/dictionary.h"
......@@ -69,6 +70,11 @@ const Heap::StructTable Heap::struct_table[] = {
{NAME##_TYPE, Name::kSize, k##Name##MapRootIndex},
STRUCT_LIST(STRUCT_TABLE_ELEMENT)
#undef STRUCT_TABLE_ELEMENT
#define DATA_HANDLER_ELEMENT(NAME, Name, Size, name) \
{NAME##_TYPE, Name::kSizeWithData##Size, k##Name##Size##MapRootIndex},
DATA_HANDLER_LIST(DATA_HANDLER_ELEMENT)
#undef DATA_HANDLER_ELEMENT
};
namespace {
......
......@@ -9,10 +9,17 @@
#include "src/field-index-inl.h"
#include "src/objects-inl.h"
#include "src/objects/data-handler-inl.h"
// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"
namespace v8 {
namespace internal {
TYPE_CHECKER(LoadHandler, LOAD_HANDLER_TYPE)
CAST_ACCESSOR(LoadHandler)
// Decodes kind from Smi-handler.
LoadHandler::Kind LoadHandler::GetHandlerKind(Smi* smi_handler) {
return KindBits::decode(smi_handler->value());
......@@ -125,6 +132,9 @@ Handle<Smi> LoadHandler::LoadIndexedString(Isolate* isolate,
return handle(Smi::FromInt(config), isolate);
}
TYPE_CHECKER(StoreHandler, STORE_HANDLER_TYPE)
CAST_ACCESSOR(StoreHandler)
Handle<Smi> StoreHandler::StoreGlobalProxy(Isolate* isolate) {
int config = KindBits::encode(kGlobalProxy);
return handle(Smi::FromInt(config), isolate);
......@@ -251,4 +261,6 @@ bool StoreHandler::IsHandler(Object* maybe_handler) {
} // namespace internal
} // namespace v8
#include "src/objects/object-macros-undef.h"
#endif // V8_IC_HANDLER_CONFIGURATION_INL_H_
......@@ -9,14 +9,25 @@
#include "src/field-index.h"
#include "src/globals.h"
#include "src/objects.h"
#include "src/objects/data-handler.h"
#include "src/utils.h"
// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"
namespace v8 {
namespace internal {
// A set of bit fields representing Smi handlers for loads.
class LoadHandler {
// A set of bit fields representing Smi handlers for loads and a HeapObject
// that represents load handlers that can't be encoded in a Smi.
// TODO(ishell): move to load-handler.h
class LoadHandler final : public DataHandler {
public:
DECL_CAST(LoadHandler)
DECL_PRINTER(LoadHandler)
DECL_VERIFIER(LoadHandler)
enum Kind {
kElement,
kIndexedString,
......@@ -190,9 +201,16 @@ class LoadHandler {
Handle<Smi> smi_handler);
};
// A set of bit fields representing Smi handlers for stores.
class StoreHandler {
// A set of bit fields representing Smi handlers for stores and a HeapObject
// that represents store handlers that can't be encoded in a Smi.
// TODO(ishell): move to store-handler.h
class StoreHandler final : public DataHandler {
public:
DECL_CAST(StoreHandler)
DECL_PRINTER(StoreHandler)
DECL_VERIFIER(StoreHandler)
enum Kind {
kElement,
kField,
......@@ -342,4 +360,6 @@ class StoreHandler {
} // namespace internal
} // namespace v8
#include "src/objects/object-macros-undef.h"
#endif // V8_IC_HANDLER_CONFIGURATION_H_
......@@ -564,6 +564,9 @@ ReturnType BodyDescriptorApply(InstanceType type, T1 p1, T2 p2, T3 p3) {
} else {
return Op::template apply<StructBodyDescriptor>(p1, p2, p3);
}
case LOAD_HANDLER_TYPE:
case STORE_HANDLER_TYPE:
return Op::template apply<StructBodyDescriptor>(p1, p2, p3);
default:
PrintF("Unknown type: %d\n", type);
UNREACHABLE();
......
......@@ -14,6 +14,7 @@
#include "src/macro-assembler.h"
#include "src/objects-inl.h"
#include "src/objects/bigint.h"
#include "src/objects/data-handler-inl.h"
#include "src/objects/debug-objects-inl.h"
#include "src/objects/literal-objects.h"
#include "src/objects/module.h"
......@@ -252,6 +253,14 @@ void HeapObject::HeapObjectVerify() {
STRUCT_LIST(MAKE_STRUCT_CASE)
#undef MAKE_STRUCT_CASE
case LOAD_HANDLER_TYPE:
LoadHandler::cast(this)->LoadHandlerVerify();
break;
case STORE_HANDLER_TYPE:
StoreHandler::cast(this)->StoreHandlerVerify();
break;
default:
UNREACHABLE();
break;
......@@ -1303,7 +1312,7 @@ void PrototypeInfo::PrototypeInfoVerify() {
} else {
CHECK(prototype_users()->IsSmi());
}
CHECK(validity_cell()->IsCell() || validity_cell()->IsSmi());
CHECK(validity_cell()->IsSmi() || validity_cell()->IsCell());
}
void Tuple2::Tuple2Verify() {
......@@ -1325,6 +1334,27 @@ void Tuple3::Tuple3Verify() {
VerifyObjectField(kValue3Offset);
}
void DataHandler::DataHandlerVerify() {
CHECK(IsDataHandler());
CHECK_IMPLIES(!smi_handler()->IsSmi(),
smi_handler()->IsCode() && IsStoreHandler());
CHECK(validity_cell()->IsSmi() || validity_cell()->IsCell());
VerifyObjectField(kData1Offset);
if (map()->instance_size() >= kSizeWithData2) {
VerifyObjectField(kData2Offset);
}
}
void LoadHandler::LoadHandlerVerify() {
DataHandler::DataHandlerVerify();
// TODO(ishell): check handler integrity
}
void StoreHandler::StoreHandlerVerify() {
DataHandler::DataHandlerVerify();
// TODO(ishell): check handler integrity
}
void ContextExtension::ContextExtensionVerify() {
CHECK(IsContextExtension());
VerifyObjectField(kScopeInfoOffset);
......
......@@ -34,6 +34,7 @@
#include "src/objects.h"
#include "src/objects/arguments-inl.h"
#include "src/objects/bigint.h"
#include "src/objects/data-handler-inl.h"
#include "src/objects/fixed-array-inl.h"
#include "src/objects/hash-table-inl.h"
#include "src/objects/hash-table.h"
......
......@@ -241,6 +241,14 @@ void HeapObject::HeapObjectPrint(std::ostream& os) { // NOLINT
STRUCT_LIST(MAKE_STRUCT_CASE)
#undef MAKE_STRUCT_CASE
case LOAD_HANDLER_TYPE:
LoadHandler::cast(this)->LoadHandlerPrint(os);
break;
case STORE_HANDLER_TYPE:
StoreHandler::cast(this)->StoreHandlerPrint(os);
break;
default:
os << "UNKNOWN TYPE " << map()->instance_type();
UNREACHABLE();
......@@ -1439,6 +1447,30 @@ void Tuple3::Tuple3Print(std::ostream& os) { // NOLINT
os << "\n";
}
void LoadHandler::LoadHandlerPrint(std::ostream& os) { // NOLINT
HeapObject::PrintHeader(os, "LoadHandler");
// TODO(ishell): implement printing based on handler kind
os << "\n - handler: " << Brief(smi_handler());
os << "\n - validity_cell: " << Brief(validity_cell());
os << "\n - data1: " << Brief(data1());
if (map()->instance_size() >= kSizeWithData2) {
os << "\n - data2: " << Brief(data2());
}
os << "\n";
}
void StoreHandler::StoreHandlerPrint(std::ostream& os) { // NOLINT
HeapObject::PrintHeader(os, "StoreHandler");
// TODO(ishell): implement printing based on handler kind
os << "\n - handler: " << Brief(smi_handler());
os << "\n - validity_cell: " << Brief(validity_cell());
os << "\n - data1: " << Brief(data1());
if (map()->instance_size() >= kSizeWithData2) {
os << "\n - data2: " << Brief(data2());
}
os << "\n";
}
void ContextExtension::ContextExtensionPrint(std::ostream& os) { // NOLINT
HeapObject::PrintHeader(os, "ContextExtension");
os << "\n - scope_info: " << Brief(scope_info());
......
......@@ -3284,7 +3284,10 @@ VisitorId Map::GetVisitorId(Map* map) {
if (instance_type == ALLOCATION_SITE_TYPE) {
return kVisitAllocationSite;
}
return kVisitStruct;
case LOAD_HANDLER_TYPE:
case STORE_HANDLER_TYPE:
return kVisitStruct;
default:
......
......@@ -370,6 +370,8 @@ const int kStubMinorKeyBits = kSmiValueSize - kStubMajorKeyBits - 1;
V(MODULE_TYPE) \
V(MODULE_INFO_ENTRY_TYPE) \
V(ASYNC_GENERATOR_REQUEST_TYPE) \
V(LOAD_HANDLER_TYPE) \
V(STORE_HANDLER_TYPE) \
V(FIXED_ARRAY_TYPE) \
V(HASH_TABLE_TYPE) \
V(DESCRIPTOR_ARRAY_TYPE) \
......@@ -555,6 +557,12 @@ const int kStubMinorKeyBits = kSmiValueSize - kStubMajorKeyBits - 1;
V(MODULE_INFO_ENTRY, ModuleInfoEntry, module_info_entry) \
V(ASYNC_GENERATOR_REQUEST, AsyncGeneratorRequest, async_generator_request)
#define DATA_HANDLER_LIST(V) \
V(LOAD_HANDLER, LoadHandler, 1, load_handler1) \
V(LOAD_HANDLER, LoadHandler, 2, load_handler2) \
V(STORE_HANDLER, StoreHandler, 1, store_handler1) \
V(STORE_HANDLER, StoreHandler, 2, store_handler2)
// We use the full 16 bits of the instance_type field to encode heap object
// instance types. All the high-order bits (bit 7-15) are cleared if the object
// is a string, and contain set bits if it is not a string.
......@@ -725,6 +733,8 @@ enum InstanceType : uint16_t {
MODULE_TYPE,
MODULE_INFO_ENTRY_TYPE,
ASYNC_GENERATOR_REQUEST_TYPE,
LOAD_HANDLER_TYPE,
STORE_HANDLER_TYPE,
FIXED_ARRAY_TYPE, // FIRST_FIXED_ARRAY_TYPE
HASH_TABLE_TYPE,
DESCRIPTOR_ARRAY_TYPE,
......@@ -945,6 +955,7 @@ template <class C> inline bool Is(Object* obj);
V(Constructor) \
V(Context) \
V(CoverageInfo) \
V(DataHandler) \
V(DeoptimizationData) \
V(DependentCode) \
V(DescriptorArray) \
......@@ -1013,6 +1024,7 @@ template <class C> inline bool Is(Object* obj);
V(JSWeakCollection) \
V(JSWeakMap) \
V(JSWeakSet) \
V(LoadHandler) \
V(Map) \
V(MapCache) \
V(ModuleInfo) \
......@@ -1044,6 +1056,7 @@ template <class C> inline bool Is(Object* obj);
V(SmallOrderedHashMap) \
V(SmallOrderedHashSet) \
V(SourcePositionTableWithFrameCache) \
V(StoreHandler) \
V(String) \
V(StringSet) \
V(StringTable) \
......
// 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_DATA_HANDLER_INL_H_
#define V8_DATA_HANDLER_INL_H_
#include "src/objects/data-handler.h"
// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"
namespace v8 {
namespace internal {
bool HeapObject::IsDataHandler() const {
return IsLoadHandler() || IsStoreHandler();
}
CAST_ACCESSOR(DataHandler)
ACCESSORS(DataHandler, smi_handler, Object, kSmiHandlerOffset)
ACCESSORS(DataHandler, validity_cell, Object, kValidityCellOffset)
ACCESSORS(DataHandler, data1, Object, kData1Offset)
ACCESSORS_CHECKED(DataHandler, data2, Object, kData2Offset,
map()->instance_size() >= kSizeWithData2)
} // namespace internal
} // namespace v8
#include "src/objects/object-macros-undef.h"
#endif // V8_DATA_HANDLER_INL_H_
// 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_DATA_HANDLER_H_
#define V8_DATA_HANDLER_H_
#include "src/objects.h"
// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"
namespace v8 {
namespace internal {
// DataHandler is a base class for load and store handlers that can't be
// encoded in one Smi. Kind of a handler can be deduced from instance type.
class DataHandler : public Struct {
public:
// [smi_handler]: A Smi which encodes a handler or Code object (we still
// use code handlers for accessing lexical environment variables, but soon
// only smi handlers will remain). See LoadHandler and StoreHandler for
// details about encoding.
DECL_ACCESSORS(smi_handler, Object)
// [validity_cell]: A validity Cell that guards prototype chain modifications.
DECL_ACCESSORS(validity_cell, Object)
// [data1,2]: These are optional general-purpose fields whose content and
// presence depends on the handler kind.
DECL_ACCESSORS(data1, Object)
DECL_ACCESSORS(data2, Object)
// Layout description.
#define DATA_HANDLER_FIELDS(V) \
V(kSmiHandlerOffset, kPointerSize) \
V(kValidityCellOffset, kPointerSize) \
V(kData1Offset, kPointerSize) \
V(kSizeWithData1, 0) \
V(kData2Offset, kPointerSize) \
V(kSizeWithData2, 0)
DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize, DATA_HANDLER_FIELDS)
#undef DATA_HANDLER_FIELDS
DECL_CAST(DataHandler)
DECL_VERIFIER(DataHandler)
};
} // namespace internal
} // namespace v8
#include "src/objects/object-macros-undef.h"
#endif // V8_DATA_HANDLER_H_
......@@ -1907,6 +1907,9 @@ const char* V8HeapExplorer::GetStrongGcSubrootName(Object* object) {
#define STRUCT_MAP_NAME(NAME, Name, name) NAME_ENTRY(name##_map)
STRUCT_LIST(STRUCT_MAP_NAME)
#undef STRUCT_MAP_NAME
#define DATA_HANDLER_MAP_NAME(NAME, Name, Size, name) NAME_ENTRY(name##_map)
DATA_HANDLER_LIST(DATA_HANDLER_MAP_NAME)
#undef DATA_HANDLER_MAP_NAME
#define STRING_NAME(name, str) NAME_ENTRY(name)
INTERNALIZED_STRING_LIST(STRING_NAME)
#undef STRING_NAME
......
......@@ -1162,6 +1162,8 @@
'objects/code.h',
'objects/compilation-cache.h',
'objects/compilation-cache-inl.h',
'objects/data-handler.h',
'objects/data-handler-inl.h',
'objects/debug-objects-inl.h',
'objects/debug-objects.cc',
'objects/debug-objects.h',
......
This diff is collapsed.
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