Util::maskFromIndex checks

0 views
Skip to first unread message

Sam Harwell

unread,
Apr 25, 2011, 1:46:21 PM4/25/11
to asmji...@googlegroups.com
Hi Petr,

I identified the following code segments which may be incorrect/unintended
uses of Util::maskFromIndex:

1. In EInstruction::prepare, the following line:

vdata->prefRegisterMask |= Util::maskFromIndex(var->regMask);

I believe this should be simply:

vdata->prefRegisterMask |= var->regMask;

2. In EVariableHint::translate, the following line:

cc.allocVar(_vdata, _hintValue, VARIABLE_ALLOC_READWRITE);

The _hintValue is passed as a mask, but according to CompilerCore::alloc it
is an index.

3. In FunctionPrototype::_setCallingConvention, there are dozens of explicit
bit shifts that could be replaced by calls to Util::maskFromIndex.

Thank you,
Sam Harwell

Petr Kobalíček

unread,
Apr 27, 2011, 7:28:44 AM4/27/11
to asmji...@googlegroups.com
Hi Sam,

sorry for long delay, I'm going to look at these issues.

#1: is definitelly bug

#2: I think that _hintValue should be already mask, but I need to check it

#3: They could be replaced

Thanks for viewing the code!

Best regards
Petr Kobalicek

Reply all
Reply to author
Forward
0 new messages