Skip to content

Commit a1401e3

Browse files
liamappelbecommit-bot@chromium.org
authored andcommitted
[vm] Roll back part of 2nd simarm_x64 CL that slowed benchmarks
Rolls back part of https://dart-review.googlesource.com/c/sdk/+/104286 which caused many benchmark runtime regressions such as: https://golem.corp.goog/Benchmark?team=dart-vm&benchmark=DeltaBlue#targets%3Ddart%3BmachineTypes%3Dlinux-x64%3Bcpus%3DIntel%20Core%20i5 Culprit was ClassTable::StateOffsetFor(intptr_t cid), so this CL rolls back just that function to its old state. Bug: #36839 Bug: #37221 Change-Id: I6c369537d0fdaa8609dcd1f57efbaf518b8bf66c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105550 Commit-Queue: Liam Appelbe <[email protected]> Reviewed-by: Liam Appelbe <[email protected]>
1 parent 7ecd81b commit a1401e3

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

runtime/vm/compiler/runtime_api.cc

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -458,10 +458,7 @@ word Context::variable_offset(word n) {
458458
return clazz##_elements_start_offset + index * clazz##_element_size; \
459459
}
460460

461-
#define DEFINE_ARRAY_STRUCTFIELD(clazz, name, element_offset, field_offset) \
462-
word clazz::name(intptr_t index) { \
463-
return element_offset(index) + field_offset; \
464-
}
461+
#define DEFINE_ARRAY_STRUCTFIELD(clazz, name, element_offset, field_offset)
465462

466463
#define DEFINE_SIZEOF(clazz, name, what) \
467464
word clazz::name() { return clazz##_##name; }
@@ -556,6 +553,22 @@ bool CanLoadFromThread(const dart::Object& object,
556553
return false;
557554
}
558555

556+
#if !defined(PRODUCT)
557+
word ClassTable::StateOffsetFor(intptr_t cid) {
558+
return dart::ClassTable::StateOffsetFor(cid);
559+
}
560+
561+
word ClassTable::NewSpaceCounterOffsetFor(intptr_t index) {
562+
return ClassOffsetFor(index) +
563+
ClassHeapStats::allocated_since_gc_new_space_offset();
564+
}
565+
566+
word ClassTable::NewSpaceSizeOffsetFor(intptr_t index) {
567+
return ClassOffsetFor(index) +
568+
ClassHeapStats::allocated_size_since_gc_new_space_offset();
569+
}
570+
#endif // !defined(PRODUCT)
571+
559572
static_assert(
560573
kSmiBits <= dart::kSmiBits,
561574
"Expected that size of Smi on HOST is at least as large as on target.");

0 commit comments

Comments
 (0)