mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 10:44:56 +00:00
Bug 1534840 part 0 - Clarify table case generation in CodeGenerator::visitOutOfLineSwitch. r=sstangl
Differential Revision: https://phabricator.services.mozilla.com/D26520 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
3897073a3f
commit
50c7913e7f
@ -12067,20 +12067,21 @@ void CodeGenerator::visitOutOfLineSwitch(
|
||||
MOZ_CRASH();
|
||||
#else
|
||||
masm.haltingAlign(sizeof(void*));
|
||||
// Bind the address of the jump table and reserve the space for code
|
||||
// pointers to jump in the newly generated code.
|
||||
masm.bind(jumpTable->start());
|
||||
masm.addCodeLabel(*jumpTable->start());
|
||||
for (size_t i = 0, e = labels.length(); i < e; i++) {
|
||||
jumpTable->addTableEntry(masm);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Add table entries if the table is inlined.
|
||||
for (size_t i = 0, e = labels.length(); i < e; i++) {
|
||||
jumpTable->addTableEntry(masm);
|
||||
}
|
||||
|
||||
// Register all reserved pointers of the jump table to target labels. The
|
||||
// entries of the jump table need to be absolute addresses and thus must be
|
||||
// patched after codegen is finished.
|
||||
auto& codeLabels = jumpTable->codeLabels();
|
||||
for (size_t i = 0, e = codeLabels.length(); i < e; i++) {
|
||||
// The entries of the jump table need to be absolute addresses and thus
|
||||
// must be patched after codegen is finished.
|
||||
auto& cl = codeLabels[i];
|
||||
cl.target()->bind(labels[i].offset());
|
||||
masm.addCodeLabel(cl);
|
||||
|
Loading…
Reference in New Issue
Block a user