Add BytecodeOffset type
Categories
(Core :: JavaScript Engine, task, P3)
Tracking
()
People
(Reporter: arai, Assigned: arai)
References
(Blocks 1 open bug)
Details
Attachments
(4 files)
Currently an offset in bytecode is held by either JumpTarget
or raw ptrdiff_t
.
it's better having dedicated type for non-jump target offset.
this also helps bug 1536037 and bug 1464311, given they need to handle jump across BytecodeSection
s, and there offset is the pair of (BytecodeSection*, ptrdiff_t)
Assignee | ||
Comment 1•6 years ago
|
||
Assignee | ||
Comment 2•6 years ago
|
||
Depends on D32399
Assignee | ||
Comment 3•6 years ago
|
||
Previously the initial value of BytecodeSection.lastTarget_ is chosen to make
the following condition true:
lastTargetOffset() + ptrdiff_t(JSOP_JUMPTARGET_LENGTH) == -1
BytecodeOffset class introcuced in part 3 requires the offset value to be
either -1 (invalid) or non-negative, and that rule conflicts with above.
Changed the initial value of BytecodeSection.lastTarget_ to -1 and added
the check for that condition in BytecodeSection::lastOpcodeIsJumpTarget,
so that we don't use negative value in BytecodeOffset.
Depends on D32399
Assignee | ||
Comment 4•6 years ago
|
||
Previously the end of JumpList's link is marked by offset + delta == -1
,
BytecodeOffset class introcuced in part 3 requires the operands of -
operator
should be valid, and that rule conflicts with above.
Changed the end marker of JumpList to delta == 0
, that won't happen in other
case, because that points the same opcode.
Depends on D33052
Updated•6 years ago
|
Comment 6•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/9a79b6375011
https://hg.mozilla.org/mozilla-central/rev/735ff13f705c
https://hg.mozilla.org/mozilla-central/rev/7930774e0e96
https://hg.mozilla.org/mozilla-central/rev/4538486aaa02
Updated•6 years ago
|
Description
•