private void generateVTables(JClassType x, List<JsStatement> globalStmts) {
boolean isString = (x == program.getTypeJavaLangString());
for (JMethod method : x.getMethods()) {
SourceInfo sourceInfo = method.getSourceInfo();
if (method.needsVtable() && !method.isAbstract()) {
JsNameRef lhs = polymorphicNames.get(method).makeRef(sourceInfo);
lhs.setQualifier(globalTemp.makeRef(sourceInfo));
JsExpression rhs;
if (isString && "toString".equals(method.getName())) {
// special-case String.toString: alias to the native JS toString()
rhs = createNativeToStringRef(globalTemp.makeRef(sourceInfo));