mirror of https://github.com/aamine/cbc
* net/loveruby/cflat/sysdep/x86/CodeGenerator.java: refactoring: rename method: doesIndirectAccess -> shouldUsePLT.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4299 1b9489fe-b721-0410-924e-b54b9192deb8
This commit is contained in:
parent
eedb1294e3
commit
9ada80d267
|
@ -1,3 +1,8 @@
|
||||||
|
Sun Jun 21 19:15:19 2009 Minero Aoki <aamine@loveruby.net>
|
||||||
|
|
||||||
|
* net/loveruby/cflat/sysdep/x86/CodeGenerator.java: refactoring:
|
||||||
|
rename method: doesIndirectAccess -> shouldUsePLT.
|
||||||
|
|
||||||
Sun Jun 21 17:14:56 2009 Minero Aoki <aamine@loveruby.net>
|
Sun Jun 21 17:14:56 2009 Minero Aoki <aamine@loveruby.net>
|
||||||
|
|
||||||
* net/loveruby/cflat/sysdep/x86/CodeGenerator.java: assign address
|
* net/loveruby/cflat/sysdep/x86/CodeGenerator.java: assign address
|
||||||
|
|
|
@ -118,16 +118,13 @@ public class CodeGenerator implements net.loveruby.cflat.sysdep.CodeGenerator,
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Symbol sym = globalSymbol(func.symbolString());
|
Symbol sym = globalSymbol(func.symbolString());
|
||||||
return doesIndirectAccess(func) ? PLTSymbol(sym) : sym;
|
return shouldUsePLT(func) ? PLTSymbol(sym) : sym;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// #@@}
|
// #@@}
|
||||||
|
|
||||||
// condition to use indirect access (using PLT to call, GOT to refer).
|
// #@@range/shouldUsePLT{
|
||||||
// In PIC, we do use indirect access for all global variables.
|
private boolean shouldUsePLT(Entity ent) {
|
||||||
// In PIE, we do use direct access for file-local reference.
|
|
||||||
// #@@range/doesIndirectAccess{
|
|
||||||
private boolean doesIndirectAccess(Entity ent) {
|
|
||||||
return options.isPositionIndependent() && !optimizeGvarAccess(ent);
|
return options.isPositionIndependent() && !optimizeGvarAccess(ent);
|
||||||
}
|
}
|
||||||
// #@@}
|
// #@@}
|
||||||
|
|
Loading…
Reference in New Issue