[ VM / Service ] Remove ReceivePort debugging information in product

builds.

Change-Id: Ie054fa03b3c8d6dc849c9e369b5b4ec48a4b3d2d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170402
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
Ben Konyi 2020-11-06 19:23:23 +00:00 committed by commit-bot@chromium.org
parent d2775733a6
commit 996626c089
5 changed files with 25 additions and 9 deletions

View file

@ -2559,7 +2559,7 @@ static constexpr dart::compiler::target::word OneByteString_InstanceSize = 12;
static constexpr dart::compiler::target::word PatchClass_InstanceSize = 24;
static constexpr dart::compiler::target::word PcDescriptors_HeaderSize = 8;
static constexpr dart::compiler::target::word Pointer_InstanceSize = 12;
static constexpr dart::compiler::target::word ReceivePort_InstanceSize = 20;
static constexpr dart::compiler::target::word ReceivePort_InstanceSize = 12;
static constexpr dart::compiler::target::word RedirectionData_InstanceSize = 16;
static constexpr dart::compiler::target::word RegExp_InstanceSize = 60;
static constexpr dart::compiler::target::word Script_InstanceSize = 56;
@ -3073,7 +3073,7 @@ static constexpr dart::compiler::target::word OneByteString_InstanceSize = 16;
static constexpr dart::compiler::target::word PatchClass_InstanceSize = 48;
static constexpr dart::compiler::target::word PcDescriptors_HeaderSize = 16;
static constexpr dart::compiler::target::word Pointer_InstanceSize = 24;
static constexpr dart::compiler::target::word ReceivePort_InstanceSize = 40;
static constexpr dart::compiler::target::word ReceivePort_InstanceSize = 24;
static constexpr dart::compiler::target::word RedirectionData_InstanceSize = 32;
static constexpr dart::compiler::target::word RegExp_InstanceSize = 120;
static constexpr dart::compiler::target::word Script_InstanceSize = 96;
@ -3578,7 +3578,7 @@ static constexpr dart::compiler::target::word OneByteString_InstanceSize = 12;
static constexpr dart::compiler::target::word PatchClass_InstanceSize = 24;
static constexpr dart::compiler::target::word PcDescriptors_HeaderSize = 8;
static constexpr dart::compiler::target::word Pointer_InstanceSize = 12;
static constexpr dart::compiler::target::word ReceivePort_InstanceSize = 20;
static constexpr dart::compiler::target::word ReceivePort_InstanceSize = 12;
static constexpr dart::compiler::target::word RedirectionData_InstanceSize = 16;
static constexpr dart::compiler::target::word RegExp_InstanceSize = 60;
static constexpr dart::compiler::target::word Script_InstanceSize = 56;
@ -4093,7 +4093,7 @@ static constexpr dart::compiler::target::word OneByteString_InstanceSize = 16;
static constexpr dart::compiler::target::word PatchClass_InstanceSize = 48;
static constexpr dart::compiler::target::word PcDescriptors_HeaderSize = 16;
static constexpr dart::compiler::target::word Pointer_InstanceSize = 24;
static constexpr dart::compiler::target::word ReceivePort_InstanceSize = 40;
static constexpr dart::compiler::target::word ReceivePort_InstanceSize = 24;
static constexpr dart::compiler::target::word RedirectionData_InstanceSize = 32;
static constexpr dart::compiler::target::word RegExp_InstanceSize = 120;
static constexpr dart::compiler::target::word Script_InstanceSize = 96;
@ -6377,7 +6377,7 @@ static constexpr dart::compiler::target::word AOT_OneByteString_InstanceSize =
static constexpr dart::compiler::target::word AOT_PatchClass_InstanceSize = 20;
static constexpr dart::compiler::target::word AOT_PcDescriptors_HeaderSize = 8;
static constexpr dart::compiler::target::word AOT_Pointer_InstanceSize = 12;
static constexpr dart::compiler::target::word AOT_ReceivePort_InstanceSize = 20;
static constexpr dart::compiler::target::word AOT_ReceivePort_InstanceSize = 12;
static constexpr dart::compiler::target::word AOT_RedirectionData_InstanceSize =
16;
static constexpr dart::compiler::target::word AOT_RegExp_InstanceSize = 60;
@ -6944,7 +6944,7 @@ static constexpr dart::compiler::target::word AOT_OneByteString_InstanceSize =
static constexpr dart::compiler::target::word AOT_PatchClass_InstanceSize = 40;
static constexpr dart::compiler::target::word AOT_PcDescriptors_HeaderSize = 16;
static constexpr dart::compiler::target::word AOT_Pointer_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_ReceivePort_InstanceSize = 40;
static constexpr dart::compiler::target::word AOT_ReceivePort_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_RedirectionData_InstanceSize =
32;
static constexpr dart::compiler::target::word AOT_RegExp_InstanceSize = 120;
@ -7515,7 +7515,7 @@ static constexpr dart::compiler::target::word AOT_OneByteString_InstanceSize =
static constexpr dart::compiler::target::word AOT_PatchClass_InstanceSize = 40;
static constexpr dart::compiler::target::word AOT_PcDescriptors_HeaderSize = 16;
static constexpr dart::compiler::target::word AOT_Pointer_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_ReceivePort_InstanceSize = 40;
static constexpr dart::compiler::target::word AOT_ReceivePort_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_RedirectionData_InstanceSize =
32;
static constexpr dart::compiler::target::word AOT_RegExp_InstanceSize = 120;

View file

@ -23821,8 +23821,10 @@ ReceivePortPtr ReceivePort::New(Dart_Port id,
Zone* zone = thread->zone();
const SendPort& send_port =
SendPort::Handle(zone, SendPort::New(id, thread->isolate()->origin_id()));
#if !defined(PRODUCT)
const StackTrace& allocation_location_ =
HasStack() ? GetCurrentStackTrace(0) : StackTrace::Handle();
#endif // !defined(PRODUCT)
ReceivePort& result = ReceivePort::Handle(zone);
{
@ -23831,9 +23833,11 @@ ReceivePortPtr ReceivePort::New(Dart_Port id,
NoSafepointScope no_safepoint;
result ^= raw;
result.StorePointer(&result.raw_ptr()->send_port_, send_port.raw());
#if !defined(PRODUCT)
result.StorePointer(&result.raw_ptr()->debug_name_, debug_name.raw());
result.StorePointer(&result.raw_ptr()->allocation_location_,
allocation_location_.raw());
#endif // !defined(PRODUCT)
}
if (is_control_port) {
PortMap::SetPortState(id, PortMap::kControlPort);

View file

@ -10559,11 +10559,13 @@ class ReceivePort : public Instance {
InstancePtr handler() const { return raw_ptr()->handler_; }
void set_handler(const Instance& value) const;
#if !defined(PRODUCT)
StackTracePtr allocation_location() const {
return raw_ptr()->allocation_location_;
}
StringPtr debug_name() const { return raw_ptr()->debug_name_; }
#endif
static intptr_t InstanceSize() {
return RoundedAllocationSize(sizeof(ReceivePortLayout));

View file

@ -2726,9 +2726,13 @@ class ReceivePortLayout : public InstanceLayout {
VISIT_FROM(ObjectPtr, send_port_)
SendPortPtr send_port_;
InstancePtr handler_;
#if !defined(PRODUCT)
StringPtr debug_name_;
StackTracePtr allocation_location_;
VISIT_TO(ObjectPtr, allocation_location_)
#else
VISIT_TO(ObjectPtr, handler_);
#endif // !defined(PRODUCT)
};
class TransferableTypedDataLayout : public InstanceLayout {

View file

@ -171,8 +171,6 @@ namespace dart {
F(ExternalTypedData, length_) \
F(ReceivePort, send_port_) \
F(ReceivePort, handler_) \
F(ReceivePort, debug_name_) \
F(ReceivePort, allocation_location_) \
F(StackTrace, async_link_) \
F(StackTrace, code_array_) \
F(StackTrace, pc_offset_array_) \
@ -211,6 +209,10 @@ namespace dart {
F(Field, type_test_cache_) \
F(WeakSerializationReference, target_)
#define NON_PRODUCT_CLASSES_AND_FIELDS(F) \
F(ReceivePort, debug_name_) \
F(ReceivePort, allocation_location_)
OffsetsTable::OffsetsTable(Zone* zone) : cached_offsets_(zone) {
for (intptr_t i = 0; offsets_table[i].class_id != -1; ++i) {
OffsetsTableEntry entry = offsets_table[i];
@ -230,6 +232,10 @@ const char* OffsetsTable::FieldNameForOffset(intptr_t class_id,
// clang-format off
OffsetsTable::OffsetsTableEntry OffsetsTable::offsets_table[] = {
COMMON_CLASSES_AND_FIELDS(DEFINE_OFFSETS_TABLE_ENTRY)
#if !defined(PRODUCT)
NON_PRODUCT_CLASSES_AND_FIELDS(DEFINE_OFFSETS_TABLE_ENTRY)
#endif
#if defined(DART_PRECOMPILED_RUNTIME)
AOT_CLASSES_AND_FIELDS(DEFINE_OFFSETS_TABLE_ENTRY)
#else