Why use operator-- not operator& in TemporaryRegisterScopeBase::Inlucde

181 views
Skip to first unread message

Yahan Lu

unread,
Sep 27, 2024, 7:38:44 AM9/27/24
to v8-dev
```
void Include(const RegList list) {
DCHECK((list - kAllocatableGeneralRegisters).is_empty());
available_ = available_ | list;
}
```

In my  understand that temp reg should are taken out of the allocatable register set.

Leszek Swirski

unread,
Sep 27, 2024, 7:41:46 AM9/27/24
to v8-...@googlegroups.com
This is a DCHECK that is verifying that we are only including allocatable registers in the temporary register scope, since we only want to use temporaries that maglev's register allocator chose for us, and this only uses allocatable registers. The per-architecture scratch registers are not allowed to be used here, because various macro assembler functions assume that they have free reign over scratch registers.

--
--
v8-dev mailing list
v8-...@googlegroups.com
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-dev+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/v8-dev/ae36c383-6405-4b13-bfc3-333f03d3dbb1n%40googlegroups.com.

LuYahan

unread,
Sep 27, 2024, 7:57:54 AM9/27/24
to v8-...@googlegroups.com
Is it possible  that I include a temp register but it already be allocated ?

在 2024年9月27日,19:41,Leszek Swirski <les...@chromium.org> 写道:


You received this message because you are subscribed to a topic in the Google Groups "v8-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/v8-dev/2Gom5Qrxdks/unsubscribe.
To unsubscribe from this group and all its topics, send an email to v8-dev+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/v8-dev/CAGRskv_fYSHtscs_djvXVq-BShtp%2BEh_vwNbmjk29DxTqFahZw%40mail.gmail.com.

Leszek Swirski

unread,
Sep 27, 2024, 8:00:33 AM9/27/24
to v8-...@googlegroups.com
You can include any allocatable register you want into the temporary set, it's just up to you to make sure that the resulting code is correct under the assumption that maglev's register allocator allocated registers as the surrounding code has specified.

Reply all
Reply to author
Forward
0 new messages