mirror of
https://github.com/dart-lang/sdk
synced 2024-09-15 21:50:11 +00:00
[gardening] Fix transitive object copy of closure support in compressed mode
The allocation routine for allocating context objects (used for copying closures) has to use uncompressed mode - since [Context] objects aren't compressed yet. This is a follow-up to https://dart-review.googlesource.com/c/sdk/+/209110 TEST=Fixes closure tests in vm/dart_2/isolates/fast_object_copy2_test/<num> in compressed mode. Change-Id: I3a16701fe662ff7ea501a238653c7efb376cda55 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212465 Reviewed-by: Tess Strickland <sstrickl@google.com> Commit-Queue: Martin Kustermann <kustermann@google.com>
This commit is contained in:
parent
e9b56794fc
commit
ecbc4ee2d4
|
@ -245,7 +245,9 @@ void SetNewSpaceTaggingWord(ObjectPtr to, classid_t cid, uint32_t size) {
|
|||
DART_FORCE_INLINE
|
||||
ObjectPtr AllocateObject(intptr_t cid, intptr_t size) {
|
||||
#if defined(DART_COMPRESSED_POINTERS)
|
||||
const bool compressed = true;
|
||||
// TODO(rmacnak): Can be changed unconditionally to `true` once Contexts
|
||||
// are compressed.
|
||||
const bool compressed = cid != kContextCid;
|
||||
#else
|
||||
const bool compressed = false;
|
||||
#endif
|
||||
|
@ -1161,8 +1163,9 @@ class ObjectCopy : public Base {
|
|||
|
||||
UntagContext(to)->num_variables_ = UntagContext(from)->num_variables_;
|
||||
|
||||
Base::ForwardCompressedPointer(from, to,
|
||||
OFFSET_OF(UntaggedContext, parent_));
|
||||
// TODO(rmacnak): Should use ForwardCompressedPointer once contexts are
|
||||
// compressed.
|
||||
Base::ForwardPointer(from, to, OFFSET_OF(UntaggedContext, parent_));
|
||||
Base::ForwardContextPointers(
|
||||
length, from, to, Context::variable_offset(0),
|
||||
Context::variable_offset(0) + kWordSize * length);
|
||||
|
|
Loading…
Reference in a new issue