bugged
stringlengths
6
599k
fixed
stringlengths
10
599k
__index_level_0__
int64
0
1.13M
private String readNmtoken (boolean isName) throws SAXException, IOException { char c; if (USE_CHEATS) {loop: for (int i = readBufferPos; i < readBufferLength; i++) { c = readBuffer [i]; switch (c) { case '%': if (expandPE) break loop; // else fall through... // What may legitimately come AFTER a name/nmtoken? case '<': case '>': case '&': case ',': case '|': case '*': case '+': case '?': case ')': case '=': case '\'': case '"': case '[': case ' ': case '\t': case '\r': case '\n': case ';': case '/': int start = readBufferPos; if (i == start) error ("name expected", readBuffer [i], null); readBufferPos = i; return intern (readBuffer, start, i - start); default:// FIXME ... per IBM's OASIS test submission, these:// ? U+06dd // Combining U+309B //these switches are kind of ugly but at least we won't //have to go over the whole lits for each char if (isName && i == readBufferPos){ char c2 = (char) (c & 0x00f0); switch (c & 0xff00){ //starting with 01 case 0x0100: switch (c2){ case 0x0030: if (c == 0x0132 || c == 0x0133 || c == 0x013f) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x0040: if (c == 0x0140 || c == 0x0149) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x00c0: if (c == 0x01c4 || c == 0x01cc) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x00f0: if (c == 0x01f1 || c == 0x01f3) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x00b0: if (c == 0x01f1 || c == 0x01f3) error ("Not a name start character, U+" + Integer.toHexString (c)); break; default: if (c == 0x017f) error ("Not a name start character, U+" + Integer.toHexString (c)); } break; //starting with 11 case 0x1100: switch (c2){ case 0x0000: if (c == 0x1104 || c == 0x1108 || c == 0x110a || c == 0x110d) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x0030: if (c == 0x113b || c == 0x113f) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x0040: if (c == 0x1141 || c == 0x114d || c == 0x114f ) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x0050: if (c == 0x1151 || c == 0x1156) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x0060: if (c == 0x1162 || c == 0x1164 || c == 0x1166 || c == 0x116b || c == 0x116f) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x00b0: if (c == 0x11b6 || c == 0x11b9 || c == 0x11bb || c == 0x116f) error ("Not a name start character, U+" + Integer.toHexString (c)); break; default: if (c == 0x1174 || c == 0x119f || c == 0x11ac || c == 0x11c3 || c == 0x11f1) error ("Not a name start character, U+" + Integer.toHexString (c)); } break; default: if (c == 0x0e46 || c == 0x1011 || c == 0x212f || c == 0x0587 || c == 0x0230 ) error ("Not a name start character, U+" + Integer.toHexString (c)); } } // punt on exact tests from Appendix A; approximate // them using the Unicode ID start/part rules if (i == readBufferPos && isName) { if (!Character.isUnicodeIdentifierStart (c) && c != ':' && c != '_') error ("Not a name start character, U+" + Integer.toHexString (c)); } else if (!Character.isUnicodeIdentifierPart (c) && c != '-' && c != ':' && c != '_' && c != '.' && !isExtender (c)) error ("Not a name character, U+" + Integer.toHexString (c)); } } } nameBufferPos = 0; // Read the first character.loop: while (true) { c = readCh (); switch (c) { case '%': case '<': case '>': case '&': case ',': case '|': case '*': case '+': case '?': case ')': case '=': case '\'': case '"': case '[': case ' ': case '\t': case '\n': case '\r': case ';': case '/': unread (c); if (nameBufferPos == 0) { error ("name expected"); } // punt on exact tests from Appendix A, but approximate them if (isName && !Character.isUnicodeIdentifierStart ( nameBuffer [0]) && ":_".indexOf (nameBuffer [0]) == -1) error ("Not a name start character, U+" + Integer.toHexString (nameBuffer [0])); String s = intern (nameBuffer, 0, nameBufferPos); nameBufferPos = 0; return s; default: // punt on exact tests from Appendix A, but approximate them if ((nameBufferPos != 0 || !isName) && !Character.isUnicodeIdentifierPart (c) && ":-_.".indexOf (c) == -1 && !isExtender (c)) error ("Not a name character, U+" + Integer.toHexString (c)); if (nameBufferPos >= nameBuffer.length) nameBuffer = (char[]) extendArray (nameBuffer, nameBuffer.length, nameBufferPos); nameBuffer [nameBufferPos++] = c; } } }
private String readNmtoken (boolean isName) throws SAXException, IOException { char c; if (USE_CHEATS) {loop: for (int i = readBufferPos; i < readBufferLength; i++) { c = readBuffer [i]; switch (c) { case '%': if (expandPE) break loop; // else fall through... // What may legitimately come AFTER a name/nmtoken? case '<': case '>': case '&': case ',': case '|': case '*': case '+': case '?': case ')': case '=': case '\'': case '"': case '[': case ' ': case '\t': case '\r': case '\n': case ';': case '/': int start = readBufferPos; if (i == start) error ("name expected", readBuffer [i], null); readBufferPos = i; return intern (readBuffer, start, i - start); default:// FIXME ... per IBM's OASIS test submission, these:// ? U+06dd // Combining U+309B //these switches are kind of ugly but at least we won't //have to go over the whole lits for each char if (isName && i == readBufferPos){ char c2 = (char) (c & 0x00f0); switch (c & 0xff00){ //starting with 01 case 0x0100: switch (c2){ case 0x0030: if (c == 0x0132 || c == 0x0133 || c == 0x013f) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x0040: if (c == 0x0140 || c == 0x0149) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x00c0: if (c == 0x01c4 || c == 0x01cc) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x00f0: if (c == 0x01f1 || c == 0x01f3) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x00b0: if (c == 0x01f1 || c == 0x01f3) error ("Not a name start character, U+" + Integer.toHexString (c)); break; default: if (c == 0x017f) error ("Not a name start character, U+" + Integer.toHexString (c)); } break; //starting with 11 case 0x1100: switch (c2){ case 0x0000: if (c == 0x1104 || c == 0x1108 || c == 0x110a || c == 0x110d) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x0030: if (c == 0x113b || c == 0x113f) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x0040: if (c == 0x1141 || c == 0x114d || c == 0x114f ) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x0050: if (c == 0x1151 || c == 0x1156) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x0060: if (c == 0x1162 || c == 0x1164 || c == 0x1166 || c == 0x116b || c == 0x116f) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x00b0: if (c == 0x11b6 || c == 0x11b9 || c == 0x11bb || c == 0x116f) error ("Not a name start character, U+" + Integer.toHexString (c)); break; default: if (c == 0x1174 || c == 0x119f || c == 0x11ac || c == 0x11c3 || c == 0x11f1) error ("Not a name start character, U+" + Integer.toHexString (c)); } break; default: if (c == 0x0e46 || c == 0x1011 || c == 0x212f || c == 0x0587 || c == 0x0230 ) error ("Not a name start character, U+" + Integer.toHexString (c)); } } // punt on exact tests from Appendix A; approximate // them using the Unicode ID start/part rules if (i == readBufferPos && isName) { if (!Character.isUnicodeIdentifierStart (c) && c != ':' && c != '_') error ("Not a name start character, U+" + Integer.toHexString (c)); } else if (!Character.isUnicodeIdentifierPart (c) && c != '-' && c != ':' && c != '_' && c != '.' && !isExtender (c)) error ("Not a name character, U+" + Integer.toHexString (c)); } } } nameBufferPos = 0; // Read the first character.loop: while (true) { c = readCh (); switch (c) { case '%': case '<': case '>': case '&': case ',': case '|': case '*': case '+': case '?': case ')': case '=': case '\'': case '"': case '[': case ' ': case '\t': case '\n': case '\r': case ';': case '/': unread (c); if (nameBufferPos == 0) { error ("name expected"); } // punt on exact tests from Appendix A, but approximate them if (isName && !Character.isUnicodeIdentifierStart ( nameBuffer [0]) && ":_".indexOf (nameBuffer [0]) == -1) error ("Not a name start character, U+" + Integer.toHexString (nameBuffer [0])); String s = intern (nameBuffer, 0, nameBufferPos); nameBufferPos = 0; return s; default: // punt on exact tests from Appendix A, but approximate them if ((nameBufferPos != 0 || !isName) && !Character.isUnicodeIdentifierPart (c) && ":-_.".indexOf (c) == -1 && !isExtender (c)) error ("Not a name character, U+" + Integer.toHexString (c)); if (nameBufferPos >= nameBuffer.length) nameBuffer = (char[]) extendArray (nameBuffer, nameBuffer.length, nameBufferPos); nameBuffer [nameBufferPos++] = c; } } }
12,823
private String readNmtoken (boolean isName) throws SAXException, IOException { char c; if (USE_CHEATS) {loop: for (int i = readBufferPos; i < readBufferLength; i++) { c = readBuffer [i]; switch (c) { case '%': if (expandPE) break loop; // else fall through... // What may legitimately come AFTER a name/nmtoken? case '<': case '>': case '&': case ',': case '|': case '*': case '+': case '?': case ')': case '=': case '\'': case '"': case '[': case ' ': case '\t': case '\r': case '\n': case ';': case '/': int start = readBufferPos; if (i == start) error ("name expected", readBuffer [i], null); readBufferPos = i; return intern (readBuffer, start, i - start); default:// FIXME ... per IBM's OASIS test submission, these:// ? U+06dd // Combining U+309B //these switches are kind of ugly but at least we won't //have to go over the whole lits for each char if (isName && i == readBufferPos){ char c2 = (char) (c & 0x00f0); switch (c & 0xff00){ //starting with 01 case 0x0100: switch (c2){ case 0x0030: if (c == 0x0132 || c == 0x0133 || c == 0x013f) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x0040: if (c == 0x0140 || c == 0x0149) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x00c0: if (c == 0x01c4 || c == 0x01cc) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x00f0: if (c == 0x01f1 || c == 0x01f3) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x00b0: if (c == 0x01f1 || c == 0x01f3) error ("Not a name start character, U+" + Integer.toHexString (c)); break; default: if (c == 0x017f) error ("Not a name start character, U+" + Integer.toHexString (c)); } break; //starting with 11 case 0x1100: switch (c2){ case 0x0000: if (c == 0x1104 || c == 0x1108 || c == 0x110a || c == 0x110d) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x0030: if (c == 0x113b || c == 0x113f) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x0040: if (c == 0x1141 || c == 0x114d || c == 0x114f ) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x0050: if (c == 0x1151 || c == 0x1156) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x0060: if (c == 0x1162 || c == 0x1164 || c == 0x1166 || c == 0x116b || c == 0x116f) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x00b0: if (c == 0x11b6 || c == 0x11b9 || c == 0x11bb || c == 0x116f) error ("Not a name start character, U+" + Integer.toHexString (c)); break; default: if (c == 0x1174 || c == 0x119f || c == 0x11ac || c == 0x11c3 || c == 0x11f1) error ("Not a name start character, U+" + Integer.toHexString (c)); } break; default: if (c == 0x0e46 || c == 0x1011 || c == 0x212f || c == 0x0587 || c == 0x0230 ) error ("Not a name start character, U+" + Integer.toHexString (c)); } } // punt on exact tests from Appendix A; approximate // them using the Unicode ID start/part rules if (i == readBufferPos && isName) { if (!Character.isUnicodeIdentifierStart (c) && c != ':' && c != '_') error ("Not a name start character, U+" + Integer.toHexString (c)); } else if (!Character.isUnicodeIdentifierPart (c) && c != '-' && c != ':' && c != '_' && c != '.' && !isExtender (c)) error ("Not a name character, U+" + Integer.toHexString (c)); } } } nameBufferPos = 0; // Read the first character.loop: while (true) { c = readCh (); switch (c) { case '%': case '<': case '>': case '&': case ',': case '|': case '*': case '+': case '?': case ')': case '=': case '\'': case '"': case '[': case ' ': case '\t': case '\n': case '\r': case ';': case '/': unread (c); if (nameBufferPos == 0) { error ("name expected"); } // punt on exact tests from Appendix A, but approximate them if (isName && !Character.isUnicodeIdentifierStart ( nameBuffer [0]) && ":_".indexOf (nameBuffer [0]) == -1) error ("Not a name start character, U+" + Integer.toHexString (nameBuffer [0])); String s = intern (nameBuffer, 0, nameBufferPos); nameBufferPos = 0; return s; default: // punt on exact tests from Appendix A, but approximate them if ((nameBufferPos != 0 || !isName) && !Character.isUnicodeIdentifierPart (c) && ":-_.".indexOf (c) == -1 && !isExtender (c)) error ("Not a name character, U+" + Integer.toHexString (c)); if (nameBufferPos >= nameBuffer.length) nameBuffer = (char[]) extendArray (nameBuffer, nameBuffer.length, nameBufferPos); nameBuffer [nameBufferPos++] = c; } } }
private String readNmtoken (boolean isName) throws SAXException, IOException { char c; if (USE_CHEATS) {loop: for (int i = readBufferPos; i < readBufferLength; i++) { c = readBuffer [i]; switch (c) { case '%': if (expandPE) break loop; // else fall through... // What may legitimately come AFTER a name/nmtoken? case '<': case '>': case '&': case ',': case '|': case '*': case '+': case '?': case ')': case '=': case '\'': case '"': case '[': case ' ': case '\t': case '\r': case '\n': case ';': case '/': int start = readBufferPos; if (i == start) error ("name expected", readBuffer [i], null); readBufferPos = i; return intern (readBuffer, start, i - start); default:// FIXME ... per IBM's OASIS test submission, these:// ? U+06dd // Combining U+309B //these switches are kind of ugly but at least we won't //have to go over the whole lits for each char if (isName && i == readBufferPos){ char c2 = (char) (c & 0x00f0); switch (c & 0xff00){ //starting with 01 case 0x0100: switch (c2){ case 0x0030: if (c == 0x0132 || c == 0x0133 || c == 0x013f) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x0040: if (c == 0x0140 || c == 0x0149) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x00c0: if (c == 0x01c4 || c == 0x01cc) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x00f0: if (c == 0x01f1 || c == 0x01f3) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x00b0: if (c == 0x01f1 || c == 0x01f3) error ("Not a name start character, U+" + Integer.toHexString (c)); break; default: if (c == 0x017f) error ("Not a name start character, U+" + Integer.toHexString (c)); } break; //starting with 11 case 0x1100: switch (c2){ case 0x0000: if (c == 0x1104 || c == 0x1108 || c == 0x110a || c == 0x110d) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x0030: if (c == 0x113b || c == 0x113f) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x0040: if (c == 0x1141 || c == 0x114d || c == 0x114f ) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x0050: if (c == 0x1151 || c == 0x1156) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x0060: if (c == 0x1162 || c == 0x1164 || c == 0x1166 || c == 0x116b || c == 0x116f) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x00b0: if (c == 0x11b6 || c == 0x11b9 || c == 0x11bb || c == 0x116f) error ("Not a name start character, U+" + Integer.toHexString (c)); break; default: if (c == 0x1174 || c == 0x119f || c == 0x11ac || c == 0x11c3 || c == 0x11f1) error ("Not a name start character, U+" + Integer.toHexString (c)); } break; default: if (c == 0x0e46 || c == 0x1011 || c == 0x212f || c == 0x0587 || c == 0x0230 ) error ("Not a name start character, U+" + Integer.toHexString (c)); } } // punt on exact tests from Appendix A; approximate // them using the Unicode ID start/part rules if (i == readBufferPos && isName) { if (!Character.isUnicodeIdentifierStart (c) && c != ':' && c != '_') error ("Not a name start character, U+" + Integer.toHexString (c)); } else if (!Character.isUnicodeIdentifierPart (c) && c != '-' && c != ':' && c != '_' && c != '.' && !isExtender (c)) error ("Not a name character, U+" + Integer.toHexString (c)); } } } nameBufferPos = 0; // Read the first character.loop: while (true) { c = readCh (); switch (c) { case '%': case '<': case '>': case '&': case ',': case '|': case '*': case '+': case '?': case ')': case '=': case '\'': case '"': case '[': case ' ': case '\t': case '\n': case '\r': case ';': case '/': unread (c); if (nameBufferPos == 0) { error ("name expected"); } // punt on exact tests from Appendix A, but approximate them if (isName && !Character.isUnicodeIdentifierStart ( nameBuffer [0]) && ":_".indexOf (nameBuffer [0]) == -1) error ("Not a name start character, U+" + Integer.toHexString (nameBuffer [0])); String s = intern (nameBuffer, 0, nameBufferPos); nameBufferPos = 0; return s; default: // punt on exact tests from Appendix A, but approximate them if ((nameBufferPos != 0 || !isName) && !Character.isUnicodeIdentifierPart (c) && ":-_.".indexOf (c) == -1 && !isExtender (c)) error ("Not a name character, U+" + Integer.toHexString (c)); if (nameBufferPos >= nameBuffer.length) nameBuffer = (char[]) extendArray (nameBuffer, nameBuffer.length, nameBufferPos); nameBuffer [nameBufferPos++] = c; } } }
12,824
private String readNmtoken (boolean isName) throws SAXException, IOException { char c; if (USE_CHEATS) {loop: for (int i = readBufferPos; i < readBufferLength; i++) { c = readBuffer [i]; switch (c) { case '%': if (expandPE) break loop; // else fall through... // What may legitimately come AFTER a name/nmtoken? case '<': case '>': case '&': case ',': case '|': case '*': case '+': case '?': case ')': case '=': case '\'': case '"': case '[': case ' ': case '\t': case '\r': case '\n': case ';': case '/': int start = readBufferPos; if (i == start) error ("name expected", readBuffer [i], null); readBufferPos = i; return intern (readBuffer, start, i - start); default:// FIXME ... per IBM's OASIS test submission, these:// ? U+06dd // Combining U+309B //these switches are kind of ugly but at least we won't //have to go over the whole lits for each char if (isName && i == readBufferPos){ char c2 = (char) (c & 0x00f0); switch (c & 0xff00){ //starting with 01 case 0x0100: switch (c2){ case 0x0030: if (c == 0x0132 || c == 0x0133 || c == 0x013f) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x0040: if (c == 0x0140 || c == 0x0149) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x00c0: if (c == 0x01c4 || c == 0x01cc) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x00f0: if (c == 0x01f1 || c == 0x01f3) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x00b0: if (c == 0x01f1 || c == 0x01f3) error ("Not a name start character, U+" + Integer.toHexString (c)); break; default: if (c == 0x017f) error ("Not a name start character, U+" + Integer.toHexString (c)); } break; //starting with 11 case 0x1100: switch (c2){ case 0x0000: if (c == 0x1104 || c == 0x1108 || c == 0x110a || c == 0x110d) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x0030: if (c == 0x113b || c == 0x113f) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x0040: if (c == 0x1141 || c == 0x114d || c == 0x114f ) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x0050: if (c == 0x1151 || c == 0x1156) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x0060: if (c == 0x1162 || c == 0x1164 || c == 0x1166 || c == 0x116b || c == 0x116f) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x00b0: if (c == 0x11b6 || c == 0x11b9 || c == 0x11bb || c == 0x116f) error ("Not a name start character, U+" + Integer.toHexString (c)); break; default: if (c == 0x1174 || c == 0x119f || c == 0x11ac || c == 0x11c3 || c == 0x11f1) error ("Not a name start character, U+" + Integer.toHexString (c)); } break; default: if (c == 0x0e46 || c == 0x1011 || c == 0x212f || c == 0x0587 || c == 0x0230 ) error ("Not a name start character, U+" + Integer.toHexString (c)); } } // punt on exact tests from Appendix A; approximate // them using the Unicode ID start/part rules if (i == readBufferPos && isName) { if (!Character.isUnicodeIdentifierStart (c) && c != ':' && c != '_') error ("Not a name start character, U+" + Integer.toHexString (c)); } else if (!Character.isUnicodeIdentifierPart (c) && c != '-' && c != ':' && c != '_' && c != '.' && !isExtender (c)) error ("Not a name character, U+" + Integer.toHexString (c)); } } } nameBufferPos = 0; // Read the first character.loop: while (true) { c = readCh (); switch (c) { case '%': case '<': case '>': case '&': case ',': case '|': case '*': case '+': case '?': case ')': case '=': case '\'': case '"': case '[': case ' ': case '\t': case '\n': case '\r': case ';': case '/': unread (c); if (nameBufferPos == 0) { error ("name expected"); } // punt on exact tests from Appendix A, but approximate them if (isName && !Character.isUnicodeIdentifierStart ( nameBuffer [0]) && ":_".indexOf (nameBuffer [0]) == -1) error ("Not a name start character, U+" + Integer.toHexString (nameBuffer [0])); String s = intern (nameBuffer, 0, nameBufferPos); nameBufferPos = 0; return s; default: // punt on exact tests from Appendix A, but approximate them if ((nameBufferPos != 0 || !isName) && !Character.isUnicodeIdentifierPart (c) && ":-_.".indexOf (c) == -1 && !isExtender (c)) error ("Not a name character, U+" + Integer.toHexString (c)); if (nameBufferPos >= nameBuffer.length) nameBuffer = (char[]) extendArray (nameBuffer, nameBuffer.length, nameBufferPos); nameBuffer [nameBufferPos++] = c; } } }
private String readNmtoken (boolean isName) throws SAXException, IOException { char c; if (USE_CHEATS) {loop: for (int i = readBufferPos; i < readBufferLength; i++) { c = readBuffer [i]; switch (c) { case '%': if (expandPE) break loop; // else fall through... // What may legitimately come AFTER a name/nmtoken? case '<': case '>': case '&': case ',': case '|': case '*': case '+': case '?': case ')': case '=': case '\'': case '"': case '[': case ' ': case '\t': case '\r': case '\n': case ';': case '/': int start = readBufferPos; if (i == start) error ("name expected", readBuffer [i], null); readBufferPos = i; return intern (readBuffer, start, i - start); default:// FIXME ... per IBM's OASIS test submission, these:// ? U+06dd // Combining U+309B //these switches are kind of ugly but at least we won't //have to go over the whole lits for each char if (isName && i == readBufferPos){ char c2 = (char) (c & 0x00f0); switch (c & 0xff00){ //starting with 01 case 0x0100: switch (c2){ case 0x0030: if (c == 0x0132 || c == 0x0133 || c == 0x013f) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x0040: if (c == 0x0140 || c == 0x0149) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x00c0: if (c == 0x01c4 || c == 0x01cc) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x00f0: if (c == 0x01f1 || c == 0x01f3) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x00b0: if (c == 0x01f1 || c == 0x01f3) error ("Not a name start character, U+" + Integer.toHexString (c)); break; default: if (c == 0x017f) error ("Not a name start character, U+" + Integer.toHexString (c)); } break; //starting with 11 case 0x1100: switch (c2){ case 0x0000: if (c == 0x1104 || c == 0x1108 || c == 0x110a || c == 0x110d) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x0030: if (c == 0x113b || c == 0x113f) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x0040: if (c == 0x1141 || c == 0x114d || c == 0x114f ) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x0050: if (c == 0x1151 || c == 0x1156) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x0060: if (c == 0x1162 || c == 0x1164 || c == 0x1166 || c == 0x116b || c == 0x116f) error ("Not a name start character, U+" + Integer.toHexString (c)); break; case 0x00b0: if (c == 0x11b6 || c == 0x11b9 || c == 0x11bb || c == 0x116f) error ("Not a name start character, U+" + Integer.toHexString (c)); break; default: if (c == 0x1174 || c == 0x119f || c == 0x11ac || c == 0x11c3 || c == 0x11f1) error ("Not a name start character, U+" + Integer.toHexString (c)); } break; default: if (c == 0x0e46 || c == 0x1011 || c == 0x212f || c == 0x0587 || c == 0x0230 ) error ("Not a name start character, U+" + Integer.toHexString (c)); } } // punt on exact tests from Appendix A; approximate // them using the Unicode ID start/part rules if (i == readBufferPos && isName) { if (!Character.isUnicodeIdentifierStart (c) && c != ':' && c != '_') error ("Not a name start character, U+" + Integer.toHexString (c)); } else if (!Character.isUnicodeIdentifierPart (c) && c != '-' && c != ':' && c != '_' && c != '.' && !isExtender (c)) error ("Not a name character, U+" + Integer.toHexString (c)); } } } nameBufferPos = 0; // Read the first character.loop: while (true) { c = readCh (); switch (c) { case '%': case '<': case '>': case '&': case ',': case '|': case '*': case '+': case '?': case ')': case '=': case '\'': case '"': case '[': case ' ': case '\t': case '\n': case '\r': case ';': case '/': unread (c); if (nameBufferPos == 0) { error ("name expected"); } // punt on exact tests from Appendix A, but approximate them if (isName && !Character.isUnicodeIdentifierStart ( nameBuffer [0]) && ":_".indexOf (nameBuffer [0]) == -1) error ("Not a name start character, U+" + Integer.toHexString (nameBuffer [0])); String s = intern (nameBuffer, 0, nameBufferPos); nameBufferPos = 0; return s; default: // punt on exact tests from Appendix A, but approximate them if ((nameBufferPos != 0 || !isName) && !Character.isUnicodeIdentifierPart (c) && ":-_.".indexOf (c) == -1 && !isExtender (c)) error ("Not a name character, U+" + Integer.toHexString (c)); if (nameBufferPos >= nameBuffer.length) nameBuffer = (char[]) extendArray (nameBuffer, nameBuffer.length, nameBufferPos); } nameBuffer[nameBufferPos++] = c; } } }
12,825
private void require (String delim) throws SAXException, IOException { int length = delim.length (); char ch []; if (length < dataBuffer.length) { ch = dataBuffer; delim.getChars (0, length, ch, 0); } else ch = delim.toCharArray (); if (USE_CHEATS && length <= (readBufferLength - readBufferPos)) { int offset = readBufferPos; for (int i = 0; i < length; i++, offset++) if (ch [i] != readBuffer [offset]) error ("required string", null, delim); readBufferPos = offset; } else { for (int i = 0; i < length; i++) require (ch [i]); } }
private void require (String delim) throws SAXException, IOException { int length = delim.length (); char ch []; if (length < dataBuffer.length) { ch = dataBuffer; delim.getChars (0, length, ch, 0); } else ch = delim.toCharArray (); if (USE_CHEATS && length <= (readBufferLength - readBufferPos)) { int offset = readBufferPos; for (int i = 0; i < length; i++, offset++) if (ch [i] != readBuffer [offset]) error ("required string", null, delim); readBufferPos = offset; } else { for (int i = 0; i < length; i++) require (ch [i]); } }
12,826
private void require (String delim) throws SAXException, IOException { int length = delim.length (); char ch []; if (length < dataBuffer.length) { ch = dataBuffer; delim.getChars (0, length, ch, 0); } else ch = delim.toCharArray (); if (USE_CHEATS && length <= (readBufferLength - readBufferPos)) { int offset = readBufferPos; for (int i = 0; i < length; i++, offset++) if (ch [i] != readBuffer [offset]) error ("required string", null, delim); readBufferPos = offset; } else { for (int i = 0; i < length; i++) require (ch [i]); } }
private void require (String delim) throws SAXException, IOException { int length = delim.length (); char ch []; if (length < dataBuffer.length) { ch = dataBuffer; delim.getChars (0, length, ch, 0); } else ch = delim.toCharArray (); if (USE_CHEATS && length <= (readBufferLength - readBufferPos)) { int offset = readBufferPos; for (int i = 0; i < length; i++, offset++) if (ch [i] != readBuffer [offset]) error ("required string", null, delim); readBufferPos = offset; } else { for (int i = 0; i < length; i++) require (ch [i]); } }
12,827
private void require (String delim) throws SAXException, IOException { int length = delim.length (); char ch []; if (length < dataBuffer.length) { ch = dataBuffer; delim.getChars (0, length, ch, 0); } else ch = delim.toCharArray (); if (USE_CHEATS && length <= (readBufferLength - readBufferPos)) { int offset = readBufferPos; for (int i = 0; i < length; i++, offset++) if (ch [i] != readBuffer [offset]) error ("required string", null, delim); readBufferPos = offset; } else { for (int i = 0; i < length; i++) require (ch [i]); } }
private void require (String delim) throws SAXException, IOException { int length = delim.length (); char ch []; if (length < dataBuffer.length) { ch = dataBuffer; delim.getChars (0, length, ch, 0); } else ch = delim.toCharArray (); if (USE_CHEATS && length <= (readBufferLength - readBufferPos)) { int offset = readBufferPos; for (int i = 0; i < length; i++, offset++) { if (ch[i] != readBuffer[offset]) { error ("required string", null, delim); readBufferPos = offset; } else { for (int i = 0; i < length; i++) require (ch [i]); } }
12,828
private void require (String delim) throws SAXException, IOException { int length = delim.length (); char ch []; if (length < dataBuffer.length) { ch = dataBuffer; delim.getChars (0, length, ch, 0); } else ch = delim.toCharArray (); if (USE_CHEATS && length <= (readBufferLength - readBufferPos)) { int offset = readBufferPos; for (int i = 0; i < length; i++, offset++) if (ch [i] != readBuffer [offset]) error ("required string", null, delim); readBufferPos = offset; } else { for (int i = 0; i < length; i++) require (ch [i]); } }
private void require (String delim) throws SAXException, IOException { int length = delim.length (); char ch []; if (length < dataBuffer.length) { ch = dataBuffer; delim.getChars (0, length, ch, 0); } else ch = delim.toCharArray (); if (USE_CHEATS && length <= (readBufferLength - readBufferPos)) { int offset = readBufferPos; for (int i = 0; i < length; i++, offset++) if (ch [i] != readBuffer [offset]) error ("required string", null, delim); readBufferPos = offset; } else { for (int i = 0; i < length; i++) { require(ch[i]); } } }
12,829
private void setAttribute (String elName, String name, String type, String enumeration, String value, int valueType) throws Exception { Hashtable attlist; if (skippedPE) return; // Create a new hashtable if necessary. attlist = getElementAttributes (elName); if (attlist == null) attlist = new Hashtable (); // ignore multiple attribute declarations! if (attlist.get (name) != null) { // warn ... return; } else { Object attribute [] = new Object [5]; attribute [0] = type; attribute [1] = value; attribute [2] = new Integer (valueType); attribute [3] = enumeration; attribute [4] = null; attlist.put (name, attribute); // save; but don't overwrite any existing <!ELEMENT ...> setElement (elName, CONTENT_UNDECLARED, null, attlist); } }
private void setAttribute (String elName, String name, String type, String enumeration, String value, int valueType) throws Exception { HashMap attlist; if (skippedPE) return; // Create a new hashtable if necessary. attlist = getElementAttributes (elName); if (attlist == null) attlist = new Hashtable (); // ignore multiple attribute declarations! if (attlist.get (name) != null) { // warn ... return; } else { Object attribute [] = new Object [5]; attribute [0] = type; attribute [1] = value; attribute [2] = new Integer (valueType); attribute [3] = enumeration; attribute [4] = null; attlist.put (name, attribute); // save; but don't overwrite any existing <!ELEMENT ...> setElement (elName, CONTENT_UNDECLARED, null, attlist); } }
12,830
private void setAttribute (String elName, String name, String type, String enumeration, String value, int valueType) throws Exception { Hashtable attlist; if (skippedPE) return; // Create a new hashtable if necessary. attlist = getElementAttributes (elName); if (attlist == null) attlist = new Hashtable (); // ignore multiple attribute declarations! if (attlist.get (name) != null) { // warn ... return; } else { Object attribute [] = new Object [5]; attribute [0] = type; attribute [1] = value; attribute [2] = new Integer (valueType); attribute [3] = enumeration; attribute [4] = null; attlist.put (name, attribute); // save; but don't overwrite any existing <!ELEMENT ...> setElement (elName, CONTENT_UNDECLARED, null, attlist); } }
private void setAttribute (String elName, String name, String type, String enumeration, String value, int valueType) throws Exception { Hashtable attlist; if (skippedPE) return; // Create a new hashtable if necessary. attlist = getElementAttributes (elName); if (attlist == null) { attlist = new HashMap(); } // ignore multiple attribute declarations! if (attlist.get (name) != null) { // warn ... return; } else { Object attribute [] = new Object [5]; attribute [0] = type; attribute [1] = value; attribute [2] = new Integer (valueType); attribute [3] = enumeration; attribute [4] = null; attlist.put (name, attribute); // save; but don't overwrite any existing <!ELEMENT ...> setElement (elName, CONTENT_UNDECLARED, null, attlist); } }
12,831
private void setAttribute (String elName, String name, String type, String enumeration, String value, int valueType) throws Exception { Hashtable attlist; if (skippedPE) return; // Create a new hashtable if necessary. attlist = getElementAttributes (elName); if (attlist == null) attlist = new Hashtable (); // ignore multiple attribute declarations! if (attlist.get (name) != null) { // warn ... return; } else { Object attribute [] = new Object [5]; attribute [0] = type; attribute [1] = value; attribute [2] = new Integer (valueType); attribute [3] = enumeration; attribute [4] = null; attlist.put (name, attribute); // save; but don't overwrite any existing <!ELEMENT ...> setElement (elName, CONTENT_UNDECLARED, null, attlist); } }
private void setAttribute (String elName, String name, String type, String enumeration, String value, int valueType) throws Exception { Hashtable attlist; if (skippedPE) return; // Create a new hashtable if necessary. attlist = getElementAttributes (elName); if (attlist == null) attlist = new Hashtable (); // ignore multiple attribute declarations! if (attlist.get (name) != null) { // warn ... return; } else { Object attribute [] = new Object [5]; attribute [0] = type; attribute [1] = value; attribute [2] = new Integer (valueType); attribute [3] = enumeration; attribute [4] = null; attlist.put (name, attribute); // save; but don't overwrite any existing <!ELEMENT ...> setElement (elName, CONTENT_UNDECLARED, null, attlist); } }
12,832
private void setElement ( String name, int contentType, String contentModel, Hashtable attributes ) throws SAXException { if (skippedPE) return; Object element [] = (Object []) elementInfo.get (name); // first <!ELEMENT ...> or <!ATTLIST ...> for this type? if (element == null) { element = new Object [3]; element [0] = new Integer (contentType); element [1] = contentModel; element [2] = attributes; elementInfo.put (name, element); return; } // <!ELEMENT ...> declaration? if (contentType != CONTENT_UNDECLARED) { // ... following an associated <!ATTLIST ...> if (((Integer) element [0]).intValue () == CONTENT_UNDECLARED) { element [0] = new Integer (contentType); element [1] = contentModel; } else // VC: Unique Element Type Declaration handler.verror ("multiple declarations for element type: " + name); } // first <!ATTLIST ...>, before <!ELEMENT ...> ? else if (attributes != null) element [2] = attributes; }
private void setElement ( String name, int contentType, String contentModel, Hashtable attributes ) throws SAXException { if (skippedPE) return; Object element [] = (Object []) elementInfo.get (name); // first <!ELEMENT ...> or <!ATTLIST ...> for this type? if (element == null) { element = new Object [3]; element [0] = new Integer (contentType); element [1] = contentModel; element [2] = attributes; elementInfo.put (name, element); return; } // <!ELEMENT ...> declaration? if (contentType != CONTENT_UNDECLARED) { // ... following an associated <!ATTLIST ...> if (((Integer) element [0]).intValue () == CONTENT_UNDECLARED) { element [0] = new Integer (contentType); element [1] = contentModel; } else // VC: Unique Element Type Declaration handler.verror ("multiple declarations for element type: " + name); } // first <!ATTLIST ...>, before <!ELEMENT ...> ? else if (attributes != null) element [2] = attributes; }
12,833
private void setElement ( String name, int contentType, String contentModel, Hashtable attributes ) throws SAXException { if (skippedPE) return; Object element [] = (Object []) elementInfo.get (name); // first <!ELEMENT ...> or <!ATTLIST ...> for this type? if (element == null) { element = new Object [3]; element [0] = new Integer (contentType); element [1] = contentModel; element [2] = attributes; elementInfo.put (name, element); return; } // <!ELEMENT ...> declaration? if (contentType != CONTENT_UNDECLARED) { // ... following an associated <!ATTLIST ...> if (((Integer) element [0]).intValue () == CONTENT_UNDECLARED) { element [0] = new Integer (contentType); element [1] = contentModel; } else // VC: Unique Element Type Declaration handler.verror ("multiple declarations for element type: " + name); } // first <!ATTLIST ...>, before <!ELEMENT ...> ? else if (attributes != null) element [2] = attributes; }
private void setElement ( String name, int contentType, String contentModel, Hashtable attributes ) throws SAXException { if (skippedPE) return; ElementDecl element = (ElementDecl) elementInfo.get(name); // first <!ELEMENT ...> or <!ATTLIST ...> for this type? if (element == null) { element = new Object [3]; element [0] = new Integer (contentType); element [1] = contentModel; element [2] = attributes; elementInfo.put (name, element); return; } // <!ELEMENT ...> declaration? if (contentType != CONTENT_UNDECLARED) { // ... following an associated <!ATTLIST ...> if (((Integer) element [0]).intValue () == CONTENT_UNDECLARED) { element [0] = new Integer (contentType); element [1] = contentModel; } else // VC: Unique Element Type Declaration handler.verror ("multiple declarations for element type: " + name); } // first <!ATTLIST ...>, before <!ELEMENT ...> ? else if (attributes != null) element [2] = attributes; }
12,834
private void setElement ( String name, int contentType, String contentModel, Hashtable attributes ) throws SAXException { if (skippedPE) return; Object element [] = (Object []) elementInfo.get (name); // first <!ELEMENT ...> or <!ATTLIST ...> for this type? if (element == null) { element = new Object [3]; element [0] = new Integer (contentType); element [1] = contentModel; element [2] = attributes; elementInfo.put (name, element); return; } // <!ELEMENT ...> declaration? if (contentType != CONTENT_UNDECLARED) { // ... following an associated <!ATTLIST ...> if (((Integer) element [0]).intValue () == CONTENT_UNDECLARED) { element [0] = new Integer (contentType); element [1] = contentModel; } else // VC: Unique Element Type Declaration handler.verror ("multiple declarations for element type: " + name); } // first <!ATTLIST ...>, before <!ELEMENT ...> ? else if (attributes != null) element [2] = attributes; }
private void setElement ( String name, int contentType, String contentModel, Hashtable attributes ) throws SAXException { if (skippedPE) return; Object element [] = (Object []) elementInfo.get (name); // first <!ELEMENT ...> or <!ATTLIST ...> for this type? if (element == null) { element = new Object [3]; element [0] = new Integer (contentType); element [1] = contentModel; element [2] = attributes; elementInfo.put (name, element); return; } // <!ELEMENT ...> declaration? if (contentType != CONTENT_UNDECLARED) { // ... following an associated <!ATTLIST ...> if (((Integer) element [0]).intValue () == CONTENT_UNDECLARED) { element [0] = new Integer (contentType); element [1] = contentModel; } else // VC: Unique Element Type Declaration handler.verror ("multiple declarations for element type: " + name); } // first <!ATTLIST ...>, before <!ELEMENT ...> ? else if (attributes != null) element [2] = attributes; }
12,835
private void setElement ( String name, int contentType, String contentModel, Hashtable attributes ) throws SAXException { if (skippedPE) return; Object element [] = (Object []) elementInfo.get (name); // first <!ELEMENT ...> or <!ATTLIST ...> for this type? if (element == null) { element = new Object [3]; element [0] = new Integer (contentType); element [1] = contentModel; element [2] = attributes; elementInfo.put (name, element); return; } // <!ELEMENT ...> declaration? if (contentType != CONTENT_UNDECLARED) { // ... following an associated <!ATTLIST ...> if (((Integer) element [0]).intValue () == CONTENT_UNDECLARED) { element [0] = new Integer (contentType); element [1] = contentModel; } else // VC: Unique Element Type Declaration handler.verror ("multiple declarations for element type: " + name); } // first <!ATTLIST ...>, before <!ELEMENT ...> ? else if (attributes != null) element [2] = attributes; }
private void setElement ( String name, int contentType, String contentModel, Hashtable attributes ) throws SAXException { if (skippedPE) return; Object element [] = (Object []) elementInfo.get (name); // first <!ELEMENT ...> or <!ATTLIST ...> for this type? if (element == null) { element = new Object [3]; element [0] = new Integer (contentType); element [1] = contentModel; element [2] = attributes; elementInfo.put (name, element); return; } // <!ELEMENT ...> declaration? if (contentType != CONTENT_UNDECLARED) { // ... following an associated <!ATTLIST ...> if (((Integer) element [0]).intValue () == CONTENT_UNDECLARED) { element [0] = new Integer (contentType); element [1] = contentModel; } else // VC: Unique Element Type Declaration handler.verror ("multiple declarations for element type: " + name); } // first <!ATTLIST ...>, before <!ELEMENT ...> ? else if (attributes != null) element [2] = attributes; }
12,836
private void setElement ( String name, int contentType, String contentModel, Hashtable attributes ) throws SAXException { if (skippedPE) return; Object element [] = (Object []) elementInfo.get (name); // first <!ELEMENT ...> or <!ATTLIST ...> for this type? if (element == null) { element = new Object [3]; element [0] = new Integer (contentType); element [1] = contentModel; element [2] = attributes; elementInfo.put (name, element); return; } // <!ELEMENT ...> declaration? if (contentType != CONTENT_UNDECLARED) { // ... following an associated <!ATTLIST ...> if (((Integer) element [0]).intValue () == CONTENT_UNDECLARED) { element [0] = new Integer (contentType); element [1] = contentModel; } else // VC: Unique Element Type Declaration handler.verror ("multiple declarations for element type: " + name); } // first <!ATTLIST ...>, before <!ELEMENT ...> ? else if (attributes != null) element [2] = attributes; }
private void setElement ( String name, int contentType, String contentModel, Hashtable attributes ) throws SAXException { if (skippedPE) return; Object element [] = (Object []) elementInfo.get (name); // first <!ELEMENT ...> or <!ATTLIST ...> for this type? if (element == null) { element = new Object [3]; element [0] = new Integer (contentType); element [1] = contentModel; { element.attributes = attributes; } elementInfo.put (name, element); return; } // <!ELEMENT ...> declaration? if (contentType != CONTENT_UNDECLARED) { // ... following an associated <!ATTLIST ...> if (((Integer) element [0]).intValue () == CONTENT_UNDECLARED) { element [0] = new Integer (contentType); element [1] = contentModel; } else // VC: Unique Element Type Declaration handler.verror ("multiple declarations for element type: " + name); } // first <!ATTLIST ...>, before <!ELEMENT ...> ? else if (attributes != null) { element.attributes = attributes; } }
12,837
private void setExternalEntity (String eName, int eClass, String ids [], String nName) { if (entityInfo.get (eName) == null) { Object entity[] = new Object [5]; entity [0] = new Integer (eClass); entity [1] = ids;// FIXME: shrink!! [2] no longer used, [4] irrelevant given [0] entity [4] = nName; entityInfo.put (eName, entity); } }
private void setExternalEntity (String eName, int eClass, String ids [], String nName) { if (entityInfo.get (eName) == null) { Object entity[] = new Object [5]; entity [0] = new Integer (eClass); entity [1] = ids;// FIXME: shrink!! [2] no longer used, [4] irrelevant given [0] entity [4] = nName; entityInfo.put (eName, entity); } }
12,838
private void setExternalEntity (String eName, int eClass, String ids [], String nName) { if (entityInfo.get (eName) == null) { Object entity[] = new Object [5]; entity [0] = new Integer (eClass); entity [1] = ids;// FIXME: shrink!! [2] no longer used, [4] irrelevant given [0] entity [4] = nName; entityInfo.put (eName, entity); } }
private void setExternalEntity (String eName, int eClass, String ids [], String nName) { if (entityInfo.get (eName) == null) { Object entity[] = new Object [5]; entity [0] = new Integer (eClass); entity [1] = ids;// FIXME: shrink!! [2] no longer used, [4] irrelevant given [0] entity [4] = nName; entityInfo.put (eName, entity); } }
12,839
private void setInternalEntity (String eName, String value) throws SAXException { if (skippedPE) return; if (entityInfo.get (eName) == null) { Object entity[] = new Object [5]; entity [0] = new Integer (ENTITY_INTERNAL);// FIXME: shrink!! [2] useless entity [3] = value; entityInfo.put (eName, entity); } if (handler.getFeature (SAXDriver.FEATURE + "string-interning")) { if ("lt" == eName || "gt" == eName || "quot" == eName || "apos" == eName || "amp" == eName) return; } else { if ("lt".equals(eName) || "gt".equals(eName) || "quot".equals(eName) || "apos".equals(eName) || "amp".equals(eName)) return; } handler.getDeclHandler () .internalEntityDecl (eName, value); }
private void setInternalEntity (String eName, String value) throws SAXException { if (skippedPE) return; if (entityInfo.get (eName) == null) { Object entity[] = new Object [5]; entity [0] = new Integer (ENTITY_INTERNAL);// FIXME: shrink!! [2] useless entity [3] = value; entityInfo.put (eName, entity); } if (handler.getFeature (SAXDriver.FEATURE + "string-interning")) { if ("lt" == eName || "gt" == eName || "quot" == eName || "apos" == eName || "amp" == eName) return; } else { if ("lt".equals(eName) || "gt".equals(eName) || "quot".equals(eName) || "apos".equals(eName) || "amp".equals(eName)) return; } handler.getDeclHandler () .internalEntityDecl (eName, value); }
12,840
private void setInternalEntity (String eName, String value) throws SAXException { if (skippedPE) return; if (entityInfo.get (eName) == null) { Object entity[] = new Object [5]; entity [0] = new Integer (ENTITY_INTERNAL);// FIXME: shrink!! [2] useless entity [3] = value; entityInfo.put (eName, entity); } if (handler.getFeature (SAXDriver.FEATURE + "string-interning")) { if ("lt" == eName || "gt" == eName || "quot" == eName || "apos" == eName || "amp" == eName) return; } else { if ("lt".equals(eName) || "gt".equals(eName) || "quot".equals(eName) || "apos".equals(eName) || "amp".equals(eName)) return; } handler.getDeclHandler () .internalEntityDecl (eName, value); }
private void setInternalEntity (String eName, String value) throws SAXException { if (skippedPE) return; if (entityInfo.get (eName) == null) { Object entity[] = new Object [5]; entity [0] = new Integer (ENTITY_INTERNAL);// FIXME: shrink!! [2] useless entity [3] = value; entityInfo.put (eName, entity); } if (handler.stringInterning) { if ("lt" == eName || "gt" == eName || "quot" == eName || "apos" == eName || "amp" == eName) return; } else { if ("lt".equals(eName) || "gt".equals(eName) || "quot".equals(eName) || "apos".equals(eName) || "amp".equals(eName)) return; } handler.getDeclHandler () .internalEntityDecl (eName, value); }
12,841
private void setInternalEntity (String eName, String value) throws SAXException { if (skippedPE) return; if (entityInfo.get (eName) == null) { Object entity[] = new Object [5]; entity [0] = new Integer (ENTITY_INTERNAL);// FIXME: shrink!! [2] useless entity [3] = value; entityInfo.put (eName, entity); } if (handler.getFeature (SAXDriver.FEATURE + "string-interning")) { if ("lt" == eName || "gt" == eName || "quot" == eName || "apos" == eName || "amp" == eName) return; } else { if ("lt".equals(eName) || "gt".equals(eName) || "quot".equals(eName) || "apos".equals(eName) || "amp".equals(eName)) return; } handler.getDeclHandler () .internalEntityDecl (eName, value); }
private void setInternalEntity (String eName, String value) throws SAXException { if (skippedPE) return; if (entityInfo.get (eName) == null) { Object entity[] = new Object [5]; entity [0] = new Integer (ENTITY_INTERNAL);// FIXME: shrink!! [2] useless entity [3] = value; entityInfo.put (eName, entity); } if (handler.getFeature (SAXDriver.FEATURE + "string-interning")) { if ("lt" == eName || "gt" == eName || "quot" == eName || "apos" == eName || "amp" == eName) return; } } else { if ("lt".equals(eName) || "gt".equals(eName) || "quot".equals(eName) || "apos".equals(eName) || "amp".equals(eName)) return; } handler.getDeclHandler () .internalEntityDecl (eName, value); }
12,842
private void setInternalEntity (String eName, String value) throws SAXException { if (skippedPE) return; if (entityInfo.get (eName) == null) { Object entity[] = new Object [5]; entity [0] = new Integer (ENTITY_INTERNAL);// FIXME: shrink!! [2] useless entity [3] = value; entityInfo.put (eName, entity); } if (handler.getFeature (SAXDriver.FEATURE + "string-interning")) { if ("lt" == eName || "gt" == eName || "quot" == eName || "apos" == eName || "amp" == eName) return; } else { if ("lt".equals(eName) || "gt".equals(eName) || "quot".equals(eName) || "apos".equals(eName) || "amp".equals(eName)) return; } handler.getDeclHandler () .internalEntityDecl (eName, value); }
private void setInternalEntity (String eName, String value) throws SAXException { if (skippedPE) return; if (entityInfo.get (eName) == null) { Object entity[] = new Object [5]; entity [0] = new Integer (ENTITY_INTERNAL);// FIXME: shrink!! [2] useless entity [3] = value; entityInfo.put (eName, entity); } if (handler.getFeature (SAXDriver.FEATURE + "string-interning")) { if ("lt" == eName || "gt" == eName || "quot" == eName || "apos" == eName || "amp" == eName) return; } else { if ("lt".equals(eName) || "gt".equals(eName) || "quot".equals(eName) || "apos".equals(eName) || "amp".equals(eName)) return; } handler.getDeclHandler () .internalEntityDecl (eName, value); }
12,843
private void setNotation (String nname, String ids []) throws SAXException { if (skippedPE) return; handler.notationDecl (nname, ids); if (notationInfo.get (nname) == null) notationInfo.put (nname, nname); else // VC: Unique Notation Name handler.verror ("Duplicate notation name decl: " + nname); }
private void setNotation(String nname, ExternalIdentifiers ids) throws SAXException { if (skippedPE) return; handler.notationDecl (nname, ids); if (notationInfo.get (nname) == null) notationInfo.put (nname, nname); else // VC: Unique Notation Name handler.verror ("Duplicate notation name decl: " + nname); }
12,845
private void setNotation (String nname, String ids []) throws SAXException { if (skippedPE) return; handler.notationDecl (nname, ids); if (notationInfo.get (nname) == null) notationInfo.put (nname, nname); else // VC: Unique Notation Name handler.verror ("Duplicate notation name decl: " + nname); }
private void setNotation (String nname, String ids []) throws SAXException { if (skippedPE) return; handler.notationDecl (nname, ids); if (notationInfo.get (nname) == null) notationInfo.put (nname, nname); else // VC: Unique Notation Name handler.verror ("Duplicate notation name decl: " + nname); }
12,846
private void setNotation (String nname, String ids []) throws SAXException { if (skippedPE) return; handler.notationDecl (nname, ids); if (notationInfo.get (nname) == null) notationInfo.put (nname, nname); else // VC: Unique Notation Name handler.verror ("Duplicate notation name decl: " + nname); }
private void setNotation (String nname, String ids []) throws SAXException { if (skippedPE) return; handler.notationDecl (nname, ids); if (notationInfo.get (nname) == null) notationInfo.put (nname, nname); else // VC: Unique Notation Name handler.verror("Duplicate notation name decl: " + nname); } }
12,847
private void setupDecoding (String encodingName) throws SAXException, IOException { encodingName = encodingName.toUpperCase (); // ENCODING_EXTERNAL indicates an encoding that wasn't // autodetected ... we can use builtin decoders, or // ones from the JVM (InputStreamReader). // Otherwise we can only tweak what was autodetected, and // only for single byte (ASCII derived) builtin encodings. // ASCII-derived encodings if (encoding == ENCODING_UTF_8 || encoding == ENCODING_EXTERNAL) { if (encodingName.equals ("ISO-8859-1") || encodingName.equals ("8859_1") || encodingName.equals ("ISO8859_1") ) { encoding = ENCODING_ISO_8859_1; return; } else if (encodingName.equals ("US-ASCII") || encodingName.equals ("ASCII")) { encoding = ENCODING_ASCII; return; } else if (encodingName.equals ("UTF-8") || encodingName.equals ("UTF8")) { encoding = ENCODING_UTF_8; return; } else if (encoding != ENCODING_EXTERNAL) { // used to start with a new reader ... throw new UnsupportedEncodingException (encodingName); } // else fallthrough ... // it's ASCII-ish and something other than a builtin } // Unicode and such if (encoding == ENCODING_UCS_2_12 || encoding == ENCODING_UCS_2_21) { if (!(encodingName.equals ("ISO-10646-UCS-2") || encodingName.equals ("UTF-16") || encodingName.equals ("UTF-16BE") || encodingName.equals ("UTF-16LE"))) error ("unsupported Unicode encoding", encodingName, "UTF-16"); return; } // four byte encodings if (encoding == ENCODING_UCS_4_1234 || encoding == ENCODING_UCS_4_4321 || encoding == ENCODING_UCS_4_2143 || encoding == ENCODING_UCS_4_3412) { // Strictly: "UCS-4" == "UTF-32BE"; also, "UTF-32LE" exists if (!encodingName.equals ("ISO-10646-UCS-4")) error ("unsupported 32-bit encoding", encodingName, "ISO-10646-UCS-4"); return; } // assert encoding == ENCODING_EXTERNAL // if (encoding != ENCODING_EXTERNAL) // throw new RuntimeException ("encoding = " + encoding); if (encodingName.equals ("UTF-16BE")) { encoding = ENCODING_UCS_2_12; return; } if (encodingName.equals ("UTF-16LE")) { encoding = ENCODING_UCS_2_21; return; } // We couldn't use the builtin decoders at all. But we can try to // create a reader, since we haven't messed up buffering. Tweak // the encoding name if necessary. if (encodingName.equals ("UTF-16") || encodingName.equals ("ISO-10646-UCS-2")) encodingName = "Unicode"; // Ignoring all the EBCDIC aliases here reader = new InputStreamReader (is, encodingName); sourceType = INPUT_READER; }
private void setupDecoding (String encodingName) throws SAXException, IOException { encodingName = encodingName.toUpperCase (); // ENCODING_EXTERNAL indicates an encoding that wasn't // autodetected ... we can use builtin decoders, or // ones from the JVM (InputStreamReader). // Otherwise we can only tweak what was autodetected, and // only for single byte (ASCII derived) builtin encodings. // ASCII-derived encodings if (encoding == ENCODING_UTF_8 || encoding == ENCODING_EXTERNAL) { if (encodingName.equals ("ISO-8859-1") || encodingName.equals ("8859_1") || encodingName.equals ("ISO8859_1") ) { encoding = ENCODING_ISO_8859_1; return; } else if (encodingName.equals ("US-ASCII") || encodingName.equals ("ASCII")) { encoding = ENCODING_ASCII; return; } else if (encodingName.equals ("UTF-8") || encodingName.equals ("UTF8")) { encoding = ENCODING_UTF_8; return; } else if (encoding != ENCODING_EXTERNAL) { // used to start with a new reader ... throw new UnsupportedEncodingException (encodingName); } // else fallthrough ... // it's ASCII-ish and something other than a builtin } // Unicode and such if (encoding == ENCODING_UCS_2_12 || encoding == ENCODING_UCS_2_21) { if (!(encodingName.equals ("ISO-10646-UCS-2") || encodingName.equals ("UTF-16") || encodingName.equals ("UTF-16BE") || encodingName.equals ("UTF-16LE"))) error ("unsupported Unicode encoding", encodingName, "UTF-16"); return; } // four byte encodings if (encoding == ENCODING_UCS_4_1234 || encoding == ENCODING_UCS_4_4321 || encoding == ENCODING_UCS_4_2143 || encoding == ENCODING_UCS_4_3412) { // Strictly: "UCS-4" == "UTF-32BE"; also, "UTF-32LE" exists if (!encodingName.equals ("ISO-10646-UCS-4")) error ("unsupported 32-bit encoding", encodingName, "ISO-10646-UCS-4"); return; } // assert encoding == ENCODING_EXTERNAL // if (encoding != ENCODING_EXTERNAL) // throw new RuntimeException ("encoding = " + encoding); if (encodingName.equals ("UTF-16BE")) { encoding = ENCODING_UCS_2_12; return; } if (encodingName.equals ("UTF-16LE")) { encoding = ENCODING_UCS_2_21; return; } // We couldn't use the builtin decoders at all. But we can try to // create a reader, since we haven't messed up buffering. Tweak // the encoding name if necessary. if (encodingName.equals ("UTF-16") || encodingName.equals ("ISO-10646-UCS-2")) encodingName = "Unicode"; // Ignoring all the EBCDIC aliases here reader = new InputStreamReader (is, encodingName); sourceType = INPUT_READER; }
12,848
private void setupDecoding (String encodingName) throws SAXException, IOException { encodingName = encodingName.toUpperCase (); // ENCODING_EXTERNAL indicates an encoding that wasn't // autodetected ... we can use builtin decoders, or // ones from the JVM (InputStreamReader). // Otherwise we can only tweak what was autodetected, and // only for single byte (ASCII derived) builtin encodings. // ASCII-derived encodings if (encoding == ENCODING_UTF_8 || encoding == ENCODING_EXTERNAL) { if (encodingName.equals ("ISO-8859-1") || encodingName.equals ("8859_1") || encodingName.equals ("ISO8859_1") ) { encoding = ENCODING_ISO_8859_1; return; } else if (encodingName.equals ("US-ASCII") || encodingName.equals ("ASCII")) { encoding = ENCODING_ASCII; return; } else if (encodingName.equals ("UTF-8") || encodingName.equals ("UTF8")) { encoding = ENCODING_UTF_8; return; } else if (encoding != ENCODING_EXTERNAL) { // used to start with a new reader ... throw new UnsupportedEncodingException (encodingName); } // else fallthrough ... // it's ASCII-ish and something other than a builtin } // Unicode and such if (encoding == ENCODING_UCS_2_12 || encoding == ENCODING_UCS_2_21) { if (!(encodingName.equals ("ISO-10646-UCS-2") || encodingName.equals ("UTF-16") || encodingName.equals ("UTF-16BE") || encodingName.equals ("UTF-16LE"))) error ("unsupported Unicode encoding", encodingName, "UTF-16"); return; } // four byte encodings if (encoding == ENCODING_UCS_4_1234 || encoding == ENCODING_UCS_4_4321 || encoding == ENCODING_UCS_4_2143 || encoding == ENCODING_UCS_4_3412) { // Strictly: "UCS-4" == "UTF-32BE"; also, "UTF-32LE" exists if (!encodingName.equals ("ISO-10646-UCS-4")) error ("unsupported 32-bit encoding", encodingName, "ISO-10646-UCS-4"); return; } // assert encoding == ENCODING_EXTERNAL // if (encoding != ENCODING_EXTERNAL) // throw new RuntimeException ("encoding = " + encoding); if (encodingName.equals ("UTF-16BE")) { encoding = ENCODING_UCS_2_12; return; } if (encodingName.equals ("UTF-16LE")) { encoding = ENCODING_UCS_2_21; return; } // We couldn't use the builtin decoders at all. But we can try to // create a reader, since we haven't messed up buffering. Tweak // the encoding name if necessary. if (encodingName.equals ("UTF-16") || encodingName.equals ("ISO-10646-UCS-2")) encodingName = "Unicode"; // Ignoring all the EBCDIC aliases here reader = new InputStreamReader (is, encodingName); sourceType = INPUT_READER; }
private void setupDecoding (String encodingName) throws SAXException, IOException { encodingName = encodingName.toUpperCase (); // ENCODING_EXTERNAL indicates an encoding that wasn't // autodetected ... we can use builtin decoders, or // ones from the JVM (InputStreamReader). // Otherwise we can only tweak what was autodetected, and // only for single byte (ASCII derived) builtin encodings. // ASCII-derived encodings if (encoding == ENCODING_UTF_8 || encoding == ENCODING_EXTERNAL) { if (encodingName.equals ("ISO-8859-1") || encodingName.equals ("8859_1") || encodingName.equals ("ISO8859_1") ) { encoding = ENCODING_ISO_8859_1; return; } else if (encodingName.equals ("US-ASCII") || encodingName.equals ("ASCII")) { encoding = ENCODING_ASCII; return; } else if (encodingName.equals ("UTF-8") || encodingName.equals ("UTF8")) { encoding = ENCODING_UTF_8; return; } else if (encoding != ENCODING_EXTERNAL) { // used to start with a new reader ... throw new UnsupportedEncodingException (encodingName); } // else fallthrough ... // it's ASCII-ish and something other than a builtin } // Unicode and such if (encoding == ENCODING_UCS_2_12 || encoding == ENCODING_UCS_2_21) { if (!(encodingName.equals ("ISO-10646-UCS-2") || encodingName.equals ("UTF-16") || encodingName.equals ("UTF-16BE") || encodingName.equals ("UTF-16LE"))) error ("unsupported Unicode encoding", encodingName, "UTF-16"); return; } // four byte encodings if (encoding == ENCODING_UCS_4_1234 || encoding == ENCODING_UCS_4_4321 || encoding == ENCODING_UCS_4_2143 || encoding == ENCODING_UCS_4_3412) { // Strictly: "UCS-4" == "UTF-32BE"; also, "UTF-32LE" exists if (!encodingName.equals ("ISO-10646-UCS-4")) error ("unsupported 32-bit encoding", encodingName, "ISO-10646-UCS-4"); return; } // assert encoding == ENCODING_EXTERNAL // if (encoding != ENCODING_EXTERNAL) // throw new RuntimeException ("encoding = " + encoding); if (encodingName.equals ("UTF-16BE")) { encoding = ENCODING_UCS_2_12; return; } if (encodingName.equals ("UTF-16LE")) { encoding = ENCODING_UCS_2_21; return; } // We couldn't use the builtin decoders at all. But we can try to // create a reader, since we haven't messed up buffering. Tweak // the encoding name if necessary. if (encodingName.equals ("UTF-16") || encodingName.equals ("ISO-10646-UCS-2")) encodingName = "Unicode"; // Ignoring all the EBCDIC aliases here reader = new InputStreamReader (is, encodingName); sourceType = INPUT_READER; }
12,849
private void setupDecoding (String encodingName) throws SAXException, IOException { encodingName = encodingName.toUpperCase (); // ENCODING_EXTERNAL indicates an encoding that wasn't // autodetected ... we can use builtin decoders, or // ones from the JVM (InputStreamReader). // Otherwise we can only tweak what was autodetected, and // only for single byte (ASCII derived) builtin encodings. // ASCII-derived encodings if (encoding == ENCODING_UTF_8 || encoding == ENCODING_EXTERNAL) { if (encodingName.equals ("ISO-8859-1") || encodingName.equals ("8859_1") || encodingName.equals ("ISO8859_1") ) { encoding = ENCODING_ISO_8859_1; return; } else if (encodingName.equals ("US-ASCII") || encodingName.equals ("ASCII")) { encoding = ENCODING_ASCII; return; } else if (encodingName.equals ("UTF-8") || encodingName.equals ("UTF8")) { encoding = ENCODING_UTF_8; return; } else if (encoding != ENCODING_EXTERNAL) { // used to start with a new reader ... throw new UnsupportedEncodingException (encodingName); } // else fallthrough ... // it's ASCII-ish and something other than a builtin } // Unicode and such if (encoding == ENCODING_UCS_2_12 || encoding == ENCODING_UCS_2_21) { if (!(encodingName.equals ("ISO-10646-UCS-2") || encodingName.equals ("UTF-16") || encodingName.equals ("UTF-16BE") || encodingName.equals ("UTF-16LE"))) error ("unsupported Unicode encoding", encodingName, "UTF-16"); return; } // four byte encodings if (encoding == ENCODING_UCS_4_1234 || encoding == ENCODING_UCS_4_4321 || encoding == ENCODING_UCS_4_2143 || encoding == ENCODING_UCS_4_3412) { // Strictly: "UCS-4" == "UTF-32BE"; also, "UTF-32LE" exists if (!encodingName.equals ("ISO-10646-UCS-4")) error ("unsupported 32-bit encoding", encodingName, "ISO-10646-UCS-4"); return; } // assert encoding == ENCODING_EXTERNAL // if (encoding != ENCODING_EXTERNAL) // throw new RuntimeException ("encoding = " + encoding); if (encodingName.equals ("UTF-16BE")) { encoding = ENCODING_UCS_2_12; return; } if (encodingName.equals ("UTF-16LE")) { encoding = ENCODING_UCS_2_21; return; } // We couldn't use the builtin decoders at all. But we can try to // create a reader, since we haven't messed up buffering. Tweak // the encoding name if necessary. if (encodingName.equals ("UTF-16") || encodingName.equals ("ISO-10646-UCS-2")) encodingName = "Unicode"; // Ignoring all the EBCDIC aliases here reader = new InputStreamReader (is, encodingName); sourceType = INPUT_READER; }
private void setupDecoding (String encodingName) throws SAXException, IOException { encodingName = encodingName.toUpperCase (); // ENCODING_EXTERNAL indicates an encoding that wasn't // autodetected ... we can use builtin decoders, or // ones from the JVM (InputStreamReader). // Otherwise we can only tweak what was autodetected, and // only for single byte (ASCII derived) builtin encodings. // ASCII-derived encodings if (encoding == ENCODING_UTF_8 || encoding == ENCODING_EXTERNAL) { if (encodingName.equals ("ISO-8859-1") || encodingName.equals ("8859_1") || encodingName.equals ("ISO8859_1") ) { encoding = ENCODING_ISO_8859_1; return; } else if (encodingName.equals ("US-ASCII") || encodingName.equals ("ASCII")) { encoding = ENCODING_ASCII; return; } else if (encodingName.equals ("UTF-8") || encodingName.equals ("UTF8")) { encoding = ENCODING_UTF_8; return; } else if (encoding != ENCODING_EXTERNAL) { // used to start with a new reader ... throw new UnsupportedEncodingException (encodingName); } // else fallthrough ... // it's ASCII-ish and something other than a builtin } // Unicode and such if (encoding == ENCODING_UCS_2_12 || encoding == ENCODING_UCS_2_21) { if (!(encodingName.equals ("ISO-10646-UCS-2") || encodingName.equals ("UTF-16") || encodingName.equals ("UTF-16BE") || encodingName.equals ("UTF-16LE"))) error ("unsupported Unicode encoding", encodingName, "UTF-16"); return; } // four byte encodings if (encoding == ENCODING_UCS_4_1234 || encoding == ENCODING_UCS_4_4321 || encoding == ENCODING_UCS_4_2143 || encoding == ENCODING_UCS_4_3412) { // Strictly: "UCS-4" == "UTF-32BE"; also, "UTF-32LE" exists if (!encodingName.equals ("ISO-10646-UCS-4")) error ("unsupported 32-bit encoding", encodingName, "ISO-10646-UCS-4"); return; } // assert encoding == ENCODING_EXTERNAL // if (encoding != ENCODING_EXTERNAL) // throw new RuntimeException ("encoding = " + encoding); if (encodingName.equals ("UTF-16BE")) { encoding = ENCODING_UCS_2_12; return; } if (encodingName.equals ("UTF-16LE")) { encoding = ENCODING_UCS_2_21; return; } // We couldn't use the builtin decoders at all. But we can try to // create a reader, since we haven't messed up buffering. Tweak // the encoding name if necessary. if (encodingName.equals ("UTF-16") || encodingName.equals ("ISO-10646-UCS-2")) encodingName = "Unicode"; // Ignoring all the EBCDIC aliases here reader = new InputStreamReader (is, encodingName); sourceType = INPUT_READER; }
12,850
private static boolean tryEncoding ( byte sig[], byte b1, byte b2, byte b3, byte b4) { return (sig [0] == b1 && sig [1] == b2 && sig [2] == b3 && sig [3] == b4); }
private static boolean tryEncoding ( byte sig[], byte b1, byte b2, byte b3, byte b4) { return (sig [0] == b1 && sig [1] == b2 && sig [2] == b3 && sig [3] == b4); }
12,851
private String tryEncodingDecl (boolean ignoreEncoding) throws SAXException, IOException { // Read the XML/text declaration. if (tryRead ("<?xml")) { if (tryWhitespace ()) { if (inputStack.size () > 0) { return parseTextDecl (ignoreEncoding); } else { return parseXMLDecl (ignoreEncoding); } } else { // <?xml-stylesheet ...?> or similar unread ('l'); unread ('m'); unread ('x'); unread ('?'); unread ('<'); } } return null; }
private String tryEncodingDecl (boolean ignoreEncoding) throws SAXException, IOException { // Read the XML/text declaration. if (tryRead ("<?xml")) { if (tryWhitespace ()) { if (inputStack.size () > 0) { return parseTextDecl (ignoreEncoding); } else { return parseXMLDecl (ignoreEncoding); } } else { // <?xml-stylesheet ...?> or similar unread ('l'); unread ('m'); unread ('x'); unread ('?'); unread ('<'); } } return null; }
12,852
private String tryEncodingDecl (boolean ignoreEncoding) throws SAXException, IOException { // Read the XML/text declaration. if (tryRead ("<?xml")) { if (tryWhitespace ()) { if (inputStack.size () > 0) { return parseTextDecl (ignoreEncoding); } else { return parseXMLDecl (ignoreEncoding); } } else { // <?xml-stylesheet ...?> or similar unread ('l'); unread ('m'); unread ('x'); unread ('?'); unread ('<'); } } return null; }
private String tryEncodingDecl (boolean ignoreEncoding) throws SAXException, IOException { // Read the XML/text declaration. if (tryRead ("<?xml")) { if (tryWhitespace ()) { if (inputStack.size () > 0) { return parseTextDecl (ignoreEncoding); else { return parseXMLDecl (ignoreEncoding); } else { // <?xml-stylesheet ...?> or similar unread ('l'); unread ('m'); unread ('x'); unread ('?'); unread ('<'); } } return null; }
12,853
private void tryReadCharRef () throws SAXException, IOException { int value = 0; char c; if (tryRead ('x')) {loop1: while (true) { c = readCh (); int n; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': n = c - '0'; break; case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': n = (c - 'a') + 10; break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': n = (c - 'A') + 10; break; case ';': break loop1; default: error ("illegal character in character reference", c, null); break loop1; } value *= 16; value += n; } } else {loop2: while (true) { c = readCh (); switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': value *= 10; value += c - '0'; break; case ';': break loop2; default: error ("illegal character in character reference", c, null); break loop2; } } } // check for character refs being legal XML if ((value < 0x0020 && ! (value == '\n' || value == '\t' || value == '\r')) || (value >= 0xD800 && value <= 0xDFFF) || value == 0xFFFE || value == 0xFFFF || value > 0x0010ffff) error ("illegal XML character reference U+" + Integer.toHexString (value)); // Check for surrogates: 00000000 0000xxxx yyyyyyyy zzzzzzzz // (1101|10xx|xxyy|yyyy + 1101|11yy|zzzz|zzzz: if (value > 0x0010ffff) { // too big for surrogate error ("character reference " + value + " is too large for UTF-16", new Integer (value).toString (), null); } }
private void tryReadCharRef () throws SAXException, IOException { int value = 0; char c; if (tryRead ('x')) {loop1: while (true) { c = readCh (); int n; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': n = c - '0'; break; case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': n = (c - 'a') + 10; break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': n = (c - 'A') + 10; break; case ';': break loop1; default: error ("illegal character in character reference", c, null); break loop1; } value *= 16; value += n; } } else {loop2: while (true) { c = readCh (); switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': value *= 10; value += c - '0'; break; case ';': break loop2; default: error ("illegal character in character reference", c, null); break loop2; } } } // check for character refs being legal XML if ((value < 0x0020 && ! (value == '\n' || value == '\t' || value == '\r')) || (value >= 0xD800 && value <= 0xDFFF) || value == 0xFFFE || value == 0xFFFF || value > 0x0010ffff) error ("illegal XML character reference U+" + Integer.toHexString (value)); // Check for surrogates: 00000000 0000xxxx yyyyyyyy zzzzzzzz // (1101|10xx|xxyy|yyyy + 1101|11yy|zzzz|zzzz: if (value > 0x0010ffff) { // too big for surrogate error ("character reference " + value + " is too large for UTF-16", new Integer (value).toString (), null); } }
12,854
private void tryReadCharRef () throws SAXException, IOException { int value = 0; char c; if (tryRead ('x')) {loop1: while (true) { c = readCh (); int n; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': n = c - '0'; break; case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': n = (c - 'a') + 10; break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': n = (c - 'A') + 10; break; case ';': break loop1; default: error ("illegal character in character reference", c, null); break loop1; } value *= 16; value += n; } } else {loop2: while (true) { c = readCh (); switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': value *= 10; value += c - '0'; break; case ';': break loop2; default: error ("illegal character in character reference", c, null); break loop2; } } } // check for character refs being legal XML if ((value < 0x0020 && ! (value == '\n' || value == '\t' || value == '\r')) || (value >= 0xD800 && value <= 0xDFFF) || value == 0xFFFE || value == 0xFFFF || value > 0x0010ffff) error ("illegal XML character reference U+" + Integer.toHexString (value)); // Check for surrogates: 00000000 0000xxxx yyyyyyyy zzzzzzzz // (1101|10xx|xxyy|yyyy + 1101|11yy|zzzz|zzzz: if (value > 0x0010ffff) { // too big for surrogate error ("character reference " + value + " is too large for UTF-16", new Integer (value).toString (), null); } }
private void tryReadCharRef () throws SAXException, IOException { int value = 0; char c; if (tryRead ('x')) {loop1: while (true) { c = readCh (); int n; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': n = c - '0'; break; case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': n = (c - 'a') + 10; break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': n = (c - 'A') + 10; break; case ';': break loop1; default: error ("illegal character in character reference", c, null); break loop1; } value *= 16; value += n; } } else {loop2: while (true) { c = readCh (); switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': value *= 10; value += c - '0'; break; case ';': break loop2; default: error ("illegal character in character reference", c, null); break loop2; } } } // check for character refs being legal XML if ((value < 0x0020 && ! (value == '\n' || value == '\t' || value == '\r')) || (value >= 0xD800 && value <= 0xDFFF) || value == 0xFFFE || value == 0xFFFF || value > 0x0010ffff) error ("illegal XML character reference U+" + Integer.toHexString (value)); // Check for surrogates: 00000000 0000xxxx yyyyyyyy zzzzzzzz // (1101|10xx|xxyy|yyyy + 1101|11yy|zzzz|zzzz: if (value > 0x0010ffff) { // too big for surrogate error ("character reference " + value + " is too large for UTF-16", new Integer (value).toString (), null); } }
12,855
private void tryReadCharRef () throws SAXException, IOException { int value = 0; char c; if (tryRead ('x')) {loop1: while (true) { c = readCh (); int n; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': n = c - '0'; break; case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': n = (c - 'a') + 10; break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': n = (c - 'A') + 10; break; case ';': break loop1; default: error ("illegal character in character reference", c, null); break loop1; } value *= 16; value += n; } } else {loop2: while (true) { c = readCh (); switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': value *= 10; value += c - '0'; break; case ';': break loop2; default: error ("illegal character in character reference", c, null); break loop2; } } } // check for character refs being legal XML if ((value < 0x0020 && ! (value == '\n' || value == '\t' || value == '\r')) || (value >= 0xD800 && value <= 0xDFFF) || value == 0xFFFE || value == 0xFFFF || value > 0x0010ffff) error ("illegal XML character reference U+" + Integer.toHexString (value)); // Check for surrogates: 00000000 0000xxxx yyyyyyyy zzzzzzzz // (1101|10xx|xxyy|yyyy + 1101|11yy|zzzz|zzzz: if (value > 0x0010ffff) { // too big for surrogate error ("character reference " + value + " is too large for UTF-16", new Integer (value).toString (), null); } }
private void tryReadCharRef () throws SAXException, IOException { int value = 0; char c; if (tryRead ('x')) {loop1: while (true) { c = readCh (); int n; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': n = c - '0'; break; case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': n = (c - 'a') + 10; break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': n = (c - 'A') + 10; break; case ';': break loop1; default: error ("illegal character in character reference", c, null); break loop1; } value *= 16; value += n; } } } else {loop2: while (true) { c = readCh (); switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': value *= 10; value += c - '0'; break; case ';': break loop2; default: error ("illegal character in character reference", c, null); break loop2; } } } // check for character refs being legal XML if ((value < 0x0020 && ! (value == '\n' || value == '\t' || value == '\r')) || (value >= 0xD800 && value <= 0xDFFF) || value == 0xFFFE || value == 0xFFFF || value > 0x0010ffff) error ("illegal XML character reference U+" + Integer.toHexString (value)); // Check for surrogates: 00000000 0000xxxx yyyyyyyy zzzzzzzz // (1101|10xx|xxyy|yyyy + 1101|11yy|zzzz|zzzz: if (value > 0x0010ffff) { // too big for surrogate error ("character reference " + value + " is too large for UTF-16", new Integer (value).toString (), null); } }
12,856
private void tryReadCharRef () throws SAXException, IOException { int value = 0; char c; if (tryRead ('x')) {loop1: while (true) { c = readCh (); int n; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': n = c - '0'; break; case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': n = (c - 'a') + 10; break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': n = (c - 'A') + 10; break; case ';': break loop1; default: error ("illegal character in character reference", c, null); break loop1; } value *= 16; value += n; } } else {loop2: while (true) { c = readCh (); switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': value *= 10; value += c - '0'; break; case ';': break loop2; default: error ("illegal character in character reference", c, null); break loop2; } } } // check for character refs being legal XML if ((value < 0x0020 && ! (value == '\n' || value == '\t' || value == '\r')) || (value >= 0xD800 && value <= 0xDFFF) || value == 0xFFFE || value == 0xFFFF || value > 0x0010ffff) error ("illegal XML character reference U+" + Integer.toHexString (value)); // Check for surrogates: 00000000 0000xxxx yyyyyyyy zzzzzzzz // (1101|10xx|xxyy|yyyy + 1101|11yy|zzzz|zzzz: if (value > 0x0010ffff) { // too big for surrogate error ("character reference " + value + " is too large for UTF-16", new Integer (value).toString (), null); } }
private void tryReadCharRef () throws SAXException, IOException { int value = 0; char c; if (tryRead ('x')) {loop1: while (true) { c = readCh (); int n; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': n = c - '0'; break; case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': n = (c - 'a') + 10; break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': n = (c - 'A') + 10; break; case ';': break loop1; default: error ("illegal character in character reference", c, null); break loop1; } value *= 16; value += n; } } else {loop2: while (true) { c = readCh (); switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': value *= 10; value += c - '0'; break; case ';': break loop2; default: error ("illegal character in character reference", c, null); break loop2; } } } // check for character refs being legal XML if ((value < 0x0020 && ! (value == '\n' || value == '\t' || value == '\r')) || (value >= 0xD800 && value <= 0xDFFF) || value == 0xFFFE || value == 0xFFFF || value > 0x0010ffff) error ("illegal XML character reference U+" + Integer.toHexString (value)); // Check for surrogates: 00000000 0000xxxx yyyyyyyy zzzzzzzz // (1101|10xx|xxyy|yyyy + 1101|11yy|zzzz|zzzz: if (value > 0x0010ffff) { // too big for surrogate error ("character reference " + value + " is too large for UTF-16", new Integer (value).toString (), null); } }
12,857
private void tryReadCharRef () throws SAXException, IOException { int value = 0; char c; if (tryRead ('x')) {loop1: while (true) { c = readCh (); int n; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': n = c - '0'; break; case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': n = (c - 'a') + 10; break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': n = (c - 'A') + 10; break; case ';': break loop1; default: error ("illegal character in character reference", c, null); break loop1; } value *= 16; value += n; } } else {loop2: while (true) { c = readCh (); switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': value *= 10; value += c - '0'; break; case ';': break loop2; default: error ("illegal character in character reference", c, null); break loop2; } } } // check for character refs being legal XML if ((value < 0x0020 && ! (value == '\n' || value == '\t' || value == '\r')) || (value >= 0xD800 && value <= 0xDFFF) || value == 0xFFFE || value == 0xFFFF || value > 0x0010ffff) error ("illegal XML character reference U+" + Integer.toHexString (value)); // Check for surrogates: 00000000 0000xxxx yyyyyyyy zzzzzzzz // (1101|10xx|xxyy|yyyy + 1101|11yy|zzzz|zzzz: if (value > 0x0010ffff) { // too big for surrogate error ("character reference " + value + " is too large for UTF-16", new Integer (value).toString (), null); } }
private void tryReadCharRef () throws SAXException, IOException { int value = 0; char c; if (tryRead ('x')) {loop1: while (true) { c = readCh (); int n; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': n = c - '0'; break; case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': n = (c - 'a') + 10; break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': n = (c - 'A') + 10; break; case ';': break loop1; default: error ("illegal character in character reference", c, null); break loop1; } value *= 16; value += n; } } else {loop2: while (true) { c = readCh (); switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': value *= 10; value += c - '0'; break; case ';': break loop2; default: error ("illegal character in character reference", c, null); break loop2; } } } // check for character refs being legal XML if ((value < 0x0020 && ! (value == '\n' || value == '\t' || value == '\r')) || (value >= 0xD800 && value <= 0xDFFF) || value == 0xFFFE || value == 0xFFFF || value > 0x0010ffff) error ("illegal XML character reference U+" + Integer.toHexString (value)); // Check for surrogates: 00000000 0000xxxx yyyyyyyy zzzzzzzz // (1101|10xx|xxyy|yyyy + 1101|11yy|zzzz|zzzz: if (value > 0x0010ffff) { // too big for surrogate error ("character reference " + value + " is too large for UTF-16", new Integer (value).toString (), null); } }
12,858
private void tryReadCharRef () throws SAXException, IOException { int value = 0; char c; if (tryRead ('x')) {loop1: while (true) { c = readCh (); int n; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': n = c - '0'; break; case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': n = (c - 'a') + 10; break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': n = (c - 'A') + 10; break; case ';': break loop1; default: error ("illegal character in character reference", c, null); break loop1; } value *= 16; value += n; } } else {loop2: while (true) { c = readCh (); switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': value *= 10; value += c - '0'; break; case ';': break loop2; default: error ("illegal character in character reference", c, null); break loop2; } } } // check for character refs being legal XML if ((value < 0x0020 && ! (value == '\n' || value == '\t' || value == '\r')) || (value >= 0xD800 && value <= 0xDFFF) || value == 0xFFFE || value == 0xFFFF || value > 0x0010ffff) error ("illegal XML character reference U+" + Integer.toHexString (value)); // Check for surrogates: 00000000 0000xxxx yyyyyyyy zzzzzzzz // (1101|10xx|xxyy|yyyy + 1101|11yy|zzzz|zzzz: if (value > 0x0010ffff) { // too big for surrogate error ("character reference " + value + " is too large for UTF-16", new Integer (value).toString (), null); } }
private void tryReadCharRef () throws SAXException, IOException { int value = 0; char c; if (tryRead ('x')) {loop1: while (true) { c = readCh (); int n; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': n = c - '0'; break; case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': n = (c - 'a') + 10; break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': n = (c - 'A') + 10; break; case ';': break loop1; default: error ("illegal character in character reference", c, null); break loop1; } value *= 16; value += n; } } else {loop2: while (true) { c = readCh (); switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': value *= 10; value += c - '0'; break; case ';': break loop2; default: error ("illegal character in character reference", c, null); break loop2; } } } // check for character refs being legal XML if ((value < 0x0020 && ! (value == '\n' || value == '\t' || value == '\r')) || (value >= 0xD800 && value <= 0xDFFF) || value == 0xFFFE || value == 0xFFFF || value > 0x0010ffff) error ("illegal XML character reference U+" + Integer.toHexString (value)); // Check for surrogates: 00000000 0000xxxx yyyyyyyy zzzzzzzz // (1101|10xx|xxyy|yyyy + 1101|11yy|zzzz|zzzz: if (value > 0x0010ffff) { // too big for surrogate error ("character reference " + value + " is too large for UTF-16", new Integer (value).toString (), null); } }
12,859
public byte[] activate_object(Servant a_servant) throws ServantAlreadyActive, WrongPolicy { checkDiscarding(); required(ServantRetentionPolicyValue.RETAIN); required(IdAssignmentPolicyValue.SYSTEM_ID); AOM.Obj exists = aom.findServant(a_servant); if (exists != null) { if (exists.isDeactiveted()) { // If exists but deactivated, activate and return // the existing key. exists.setDeactivated(false); incarnate(exists, exists.key, a_servant, false); return exists.key; } else if (applies(IdUniquenessPolicyValue.UNIQUE_ID)) throw new ServantAlreadyActive(); // It multiple ids are allowed, exit block allowing repetetive // activations. } byte[] object_key = AOM.getFreeId(); ServantDelegateImpl delegate = new ServantDelegateImpl(a_servant, this, object_key); connectDelegate(object_key, delegate); return object_key; }
public byte[] activate_object(Servant a_servant) throws ServantAlreadyActive, WrongPolicy { checkDiscarding(); required(ServantRetentionPolicyValue.RETAIN); required(IdAssignmentPolicyValue.SYSTEM_ID); AOM.Obj exists = aom.findServant(a_servant); if (exists != null) { if (exists.isDeactiveted()) { // If exists but deactivated, activate and return // the existing key. exists.setDeactivated(false); incarnate(exists, exists.key, a_servant, false); return exists.key; } else if (applies(IdUniquenessPolicyValue.UNIQUE_ID)) throw new ServantAlreadyActive(); // It multiple ids are allowed, exit block allowing repetetive // activations. } byte[] object_key = AOM.getFreeId(); ServantDelegateImpl delegate = new ServantDelegateImpl(a_servant, this, object_key); connectDelegate(object_key, delegate); return object_key; }
12,860
public org.omg.CORBA.Object servant_to_reference(Servant the_Servant) throws ServantNotActive, WrongPolicy { required(ServantRetentionPolicyValue.RETAIN); AOM.Obj exists = null; if (!applies(IdUniquenessPolicyValue.MULTIPLE_ID)) exists = aom.findServant(the_Servant); if (exists != null) { if (exists.isDeactiveted()) { if (applies(ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION)) { checkDiscarding(); exists.setDeactivated(false); incarnate(exists, exists.key, the_Servant, false); } else throw new ServantNotActive(); } else return exists.object; } if (exists == null && applies(ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION) ) { checkDiscarding(); byte[] object_key = AOM.getFreeId(); ServantDelegateImpl delegate = new ServantDelegateImpl(the_Servant, this, object_key); connectDelegate(object_key, delegate); return delegate.object; } else throw new ServantNotActive(); }
public org.omg.CORBA.Object servant_to_reference(Servant the_Servant) throws ServantNotActive, WrongPolicy { required(ServantRetentionPolicyValue.RETAIN); AOM.Obj exists = null; if (!applies(IdUniquenessPolicyValue.MULTIPLE_ID)) exists = aom.findServant(the_Servant); if (exists != null) { if (exists.isDeactiveted()) { if (applies(ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION)) { checkDiscarding(); exists.setDeactivated(false); incarnate(exists, exists.key, the_Servant, false); } else throw new ServantNotActive(); } else return exists.object; } if (exists == null && applies(ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION) ) { checkDiscarding(); byte[] object_key = AOM.getFreeId(); ServantDelegateImpl delegate = new ServantDelegateImpl(the_Servant, this, object_key); connectDelegate(object_key, delegate); return delegate.object; } else throw new ServantNotActive(); }
12,862
AttributeNode(TemplateNode children, TemplateNode next, TemplateNode name, TemplateNode namespace, Node source) { super(children, next); this.name = name; this.namespace = namespace; this.source = source; }
AttributeNode(TemplateNode name, TemplateNode namespace, Node source) { super(children, next); this.name = name; this.namespace = namespace; this.source = source; }
12,863
AttributeNode(TemplateNode children, TemplateNode next, TemplateNode name, TemplateNode namespace, Node source) { super(children, next); this.name = name; this.namespace = namespace; this.source = source; }
AttributeNode(TemplateNode children, TemplateNode next, TemplateNode name, TemplateNode namespace, Node source) { this.name = name; this.namespace = namespace; this.source = source; }
12,864
TemplateNode clone(Stylesheet stylesheet) { return new AttributeNode((children == null) ? null : children.clone(stylesheet), (next == null) ? null : next.clone(stylesheet), name.clone(stylesheet), (namespace == null) ? null : namespace.clone(stylesheet), source); }
TemplateNode clone(Stylesheet stylesheet) { return new AttributeNode((children == null) ? null : children.clone(stylesheet), (next == null) ? null : next.clone(stylesheet), name.clone(stylesheet), (namespace == null) ? null : namespace.clone(stylesheet), source); }
12,865
public synchronized org.omg.CORBA.Object corbaloc(String corbaloc, OrbFunctional orb) throws BAD_PARAM { boolean corbaname; // The alternative addresses, if given. ArrayList alt_addr = new ArrayList(); // The version numbers with default values. int major = 1; int minor = 0; // The host address. String host; // The port. int port = DEFAULT_PORT; // The object key as string. String key; StringTokenizer st = new StringTokenizer(corbaloc, ":@/.,#", true); t = new String[st.countTokens()]; for (int i = 0; i < t.length; i++) { t[i] = st.nextToken(); } p = 0; if (t[p].startsWith(pxCORBANAME)) corbaname = true; else if (t[p].equalsIgnoreCase(pxCORBALOC)) corbaname = false; else if (t[p].equalsIgnoreCase(pxIOR)) { IOR ior = IOR.parse(corbaloc); return orb.ior_to_object(ior); } else throw new DATA_CONVERSION("Unsupported protocol: '" + t[p] + "'"); p++; if (!t[p++].equals(":")) throw new BAD_PARAM("Syntax (':' expected after name prefix)"); // Check for rir: if (t[p].equals(RIR)) { p++; if (!t[p++].equals(":")) throw new BAD_PARAM("':' expected after 'rir'"); key = readKey("/"); Object object; try { object = orb.resolve_initial_references(key); return corbaname ? resolve(object) : object; } catch (InvalidName e) { throw new BAD_PARAM("Unknown initial reference '" + key + "'"); } } else // Check for iiop. if (t[p].equals(IIOP) || t[p].equals(":")) { IOR ior = new IOR(); Addresses: do { // Read addresses. if (t[p].equals(":")) { p++; } else { p++; if (!t[p++].equals(":")) throw new BAD_PARAM("':' expected after 'iiop'"); // Check if version is present. if (t[p + 1].equals(".")) if (t[p + 3].equals("@")) { // Version info present. try { major = Integer.parseInt(t[p++]); } catch (NumberFormatException e) { throw new BAD_PARAM("Major version number '" + t[p - 1] + "'"); } p++; // '.' at this point. try { minor = Integer.parseInt(t[p++]); } catch (NumberFormatException e) { throw new BAD_PARAM("Major version number '" + t[p - 1] + "'"); } p++; // '@' at this point. } } ior.Internet.version = new Version(major, minor); // Then host data goes till '/' or ':'. StringBuffer bhost = new StringBuffer(corbaloc.length()); while (!t[p].equals(":") && !t[p].equals("/") && !t[p].equals(",")) bhost.append(t[p++]); host = bhost.toString(); ior.Internet.host = host; if (t[p].equals(":")) { // Port specified. p++; try { port = Integer.parseInt(t[p++]); } catch (NumberFormatException e) { throw new BAD_PARAM("Invalid port '" + t[p - 1] + "'"); } } ior.Internet.port = port; // Id is not listed. ior.Id = ""; if (t[p].equals(",")) p++; else break Addresses; } while (true); key = readKey("/"); ior.key = key.getBytes(); org.omg.CORBA.Object object = orb.ior_to_object(ior); return corbaname ? resolve(object) : object; } else throw new DATA_CONVERSION("Unsupported protocol '" + t[p] + "'"); }
public synchronized org.omg.CORBA.Object corbaloc(String corbaloc, OrbFunctional orb) throws BAD_PARAM { boolean corbaname; // The alternative addresses, if given. ArrayList alt_addr = new ArrayList(); // The version numbers with default values. int major = 1; int minor = 0; // The host address. String host; // The port. int port = DEFAULT_PORT; // The object key as string. String key; StringTokenizer st = new StringTokenizer(corbaloc, ":@/.,#", true); t = new String[st.countTokens()]; for (int i = 0; i < t.length; i++) { t[i] = st.nextToken(); } p = 0; if (t[p].startsWith(pxCORBANAME)) corbaname = true; else if (t[p].equalsIgnoreCase(pxCORBALOC)) corbaname = false; else if (t[p].equalsIgnoreCase(pxIOR)) { IOR ior = IOR.parse(corbaloc); return orb.ior_to_object(ior); } else throw new DATA_CONVERSION("Unsupported protocol: '" + t[p] + "'"); p++; if (!t[p++].equals(":")) throw new BAD_PARAM("Syntax (':' expected after name prefix)"); // Check for rir: if (t[p].equals(RIR)) { p++; if (!t[p++].equals(":")) throw new BAD_PARAM("':' expected after 'rir'"); key = readKey("/"); Object object; try { object = orb.resolve_initial_references(key); return corbaname ? resolve(object) : object; } catch (InvalidName e) { throw new BAD_PARAM("Unknown initial reference '" + key + "'"); } } else // Check for iiop. if (t[p].equals(IIOP) || t[p].equals(":")) { IOR ior = new IOR(); Addresses: do { // Read addresses. if (t[p].equals(":")) { p++; } else { p++; if (!t[p++].equals(":")) throw new BAD_PARAM("':' expected after 'iiop'"); // Check if version is present. if (t[p + 1].equals(".")) if (t[p + 3].equals("@")) { // Version info present. try { major = Integer.parseInt(t[p++]); } catch (NumberFormatException e) { throw new BAD_PARAM("Major version number '" + t[p - 1] + "'"); } p++; // '.' at this point. try { minor = Integer.parseInt(t[p++]); } catch (NumberFormatException e) { throw new BAD_PARAM("Major version number '" + t[p - 1] + "'"); } p++; // '@' at this point. } } ior.Internet.version = new Version(major, minor); // Then host data goes till '/' or ':'. StringBuffer bhost = new StringBuffer(corbaloc.length()); while (!t[p].equals(":") && !t[p].equals("/") && !t[p].equals(",")) bhost.append(t[p++]); host = bhost.toString(); ior.Internet.host = host; if (t[p].equals(":")) { // Port specified. p++; try { port = Integer.parseInt(t[p++]); } catch (NumberFormatException e) { throw new BAD_PARAM("Invalid port '" + t[p - 1] + "'"); } } ior.Internet.port = port; // Id is not listed. ior.Id = ""; if (t[p].equals(",")) p++; else break Addresses; } while (true); key = readKey("/"); ior.key = key.getBytes(); org.omg.CORBA.Object object = orb.ior_to_object(ior); return corbaname ? resolve(object) : object; } else throw new DATA_CONVERSION("Unsupported protocol '" + t[p] + "'"); }
12,867
public void addRow(Vector rowData) { dataVector.add(rowData); fireTableDataChanged(); }
public void addRow(Vector rowData) { dataVector.add(rowData); newRowsAdded(new TableModelEvent( this, dataVector.size(), dataVector.size(), -1, TableModelEvent.INSERT) ); }
12,868
public int getColumnCount() { return columnIdentifiers.size(); }
public int getColumnCount() { return (columnIdentifiers == null ? 0 : columnIdentifiers.size()); }
12,869
public String getColumnName(int column) { // Check for Column if (columnIdentifiers == null || column >= getColumnCount()) { return super.getColumnName(column); } // Return Column name return (String) columnIdentifiers.get(column); }
public String getColumnName(int column) { // Check for Column if (columnIdentifiers == null || column >= getColumnCount()) { return super.getColumnName(column); } // Return Column name return (String) columnIdentifiers.get(column); }
12,870
public String getColumnName(int column) { // Check for Column if (columnIdentifiers == null || column >= getColumnCount()) { return super.getColumnName(column); } // Return Column name return (String) columnIdentifiers.get(column); }
public String getColumnName(int column) { // Check for Column if (columnIdentifiers == null || column >= getColumnCount()) { return super.getColumnName(column); } // Return Column name } return result; }
12,871
public void insertRow(int row, Vector rowData) { dataVector.add(row, rowData); fireTableDataChanged(); }
public void insertRow(int row, Vector rowData) { dataVector.add(row, rowData); fireTableRowsInserted(row,row); }
12,872
public void moveRow(int startIndex, int endIndex, int toIndex) { for (int index = 0; index < (endIndex - startIndex); index++) { Vector vector = (Vector) dataVector.remove(startIndex); dataVector.add(toIndex, vector); } fireTableDataChanged(); }
public void moveRow(int startIndex, int endIndex, int toIndex) { for (int index = 0; index < (endIndex - startIndex); index++) { Vector vector = (Vector) dataVector.remove(startIndex); dataVector.add(toIndex, vector); } fireTableDataChanged(); }
12,873
public void removeRow(int row) { dataVector.remove(row); fireTableDataChanged(); }
public void removeRow(int row) { dataVector.remove(row); fireTableRowsDeleted(row,row); }
12,874
public void setColumnIdentifiers(Vector columnIdentifiers) { this.columnIdentifiers = columnIdentifiers; setColumnCount(columnIdentifiers.size()); }
public void setColumnIdentifiers(Vector columnIdentifiers) { this.columnIdentifiers = columnIdentifiers; setColumnCount((columnIdentifiers == null ? 0 : columnIdentifiers.size())); }
12,876
public void setRowCount(int rowCount) { dataVector.setSize(rowCount); fireTableDataChanged(); }
public void setRowCount(int rowCount) { dataVector.setSize(rowCount); fireTableRowsDeleted(rowCount,existingRowCount-1); } else { int rowsToAdd = rowCount - existingRowCount; for (int i = 0; i < rowsToAdd; i++) { Vector tmp = new Vector(); tmp.setSize(columnIdentifiers.size()); dataVector.add(tmp); } fireTableRowsInserted(existingRowCount,rowCount-1); } }
12,877
public void setValueAt(Object value, int row, int column) { ((Vector) dataVector.get(row)).set(column, value); fireTableDataChanged(); }
public void setValueAt(Object value, int row, int column) { ((Vector) dataVector.get(row)).set(column, value); fireTableCellUpdated(row,column); }
12,878
public final void visit_instanceof(VmConstClass classRef) { // Resolve the classRef classRef.resolve(loader); // Prepare final X86RegisterPool pool = eContext.getGPRPool(); final VmType<?> resolvedType = classRef.getResolvedVmClass(); if (resolvedType.isInterface() || resolvedType.isArray()) { // It is an interface, do it the hard way // Load reference final RefItem ref = vstack.popRef(); ref.load(eContext); final GPR refr = ref.getRegister(); // Allocate tmp registers final GPR classr = (GPR) L1AHelper.requestRegister(eContext, JvmType.REFERENCE, false); final GPR cntr = (GPR) L1AHelper.requestRegister(eContext, JvmType.INT, false); final GPR tmpr = (GPR) L1AHelper.requestRegister(eContext, JvmType.REFERENCE, false); final Label curInstrLabel = getCurInstrLabel(); /* Objectref is already on the stack */ writeResolveAndLoadClassToReg(classRef, classr); helper.writeClassInitialize(curInstrLabel, classr, resolvedType); final Label trueLabel = new Label(curInstrLabel + "io-true"); final Label endLabel = new Label(curInstrLabel + "io-end"); /* Is instanceof? */ instanceOf(refr, classr, tmpr, cntr, trueLabel, false); final IntItem result = (IntItem) L1AHelper.requestWordRegister(eContext, JvmType.INT, false); final GPR resultr = result.getRegister(); /* Not instanceof */ // TODO: use setcc instead of jumps os.writeXOR(resultr, resultr); os.writeJMP(endLabel); os.setObjectRef(trueLabel); os.writeMOV_Const(resultr, 1); // Push result os.setObjectRef(endLabel); ref.release(eContext); vstack.push(result); // Release pool.release(classr); pool.release(tmpr); pool.release(cntr); } else { // It is a class, do the fast way // Load reference final RefItem ref = vstack.popRef(); ref.load(eContext); final GPR refr = ref.getRegister(); // Allocate tmp registers final GPR tmpr = (GPR) L1AHelper.requestRegister(eContext, JvmType.REFERENCE, false); final IntItem result = (IntItem) L1AHelper.requestWordRegister( eContext, JvmType.INT, false); // Is instanceof instanceOfClass(refr, (VmClassType<?>) classRef.getResolvedVmClass(), tmpr, result.getRegister(), null, false); // Push result vstack.push(result); // Release ref.release(eContext); pool.release(tmpr); } }
public final void visit_instanceof(VmConstClass classRef) { // Resolve the classRef classRef.resolve(loader); // Prepare final X86RegisterPool pool = eContext.getGPRPool(); final VmType<?> resolvedType = classRef.getResolvedVmClass(); if (resolvedType.isInterface() || resolvedType.isArray()) { // It is an interface, do it the hard way // Load reference final RefItem ref = vstack.popRef(); ref.load(eContext); final GPR refr = ref.getRegister(); // Allocate tmp registers final GPR classr = (GPR) L1AHelper.requestRegister(eContext, JvmType.REFERENCE, false); final GPR cntr = (GPR) L1AHelper.requestRegister(eContext, JvmType.INT, false); final GPR tmpr = (GPR) L1AHelper.requestRegister(eContext, JvmType.REFERENCE, false); final Label curInstrLabel = getCurInstrLabel(); /* Objectref is already on the stack */ writeResolveAndLoadClassToReg(classRef, classr); helper.writeClassInitialize(curInstrLabel, classr, resolvedType); final Label trueLabel = new Label(curInstrLabel + "io-true"); final Label endLabel = new Label(curInstrLabel + "io-end"); /* Is instanceof? */ instanceOf(refr, classr, tmpr, cntr, trueLabel, false); final IntItem result = (IntItem) L1AHelper.requestWordRegister(eContext, JvmType.INT, true); final GPR resultr = result.getRegister(); /* Not instanceof */ // TODO: use setcc instead of jumps os.writeXOR(resultr, resultr); os.writeJMP(endLabel); os.setObjectRef(trueLabel); os.writeMOV_Const(resultr, 1); // Push result os.setObjectRef(endLabel); ref.release(eContext); vstack.push(result); // Release pool.release(classr); pool.release(tmpr); pool.release(cntr); } else { // It is a class, do the fast way // Load reference final RefItem ref = vstack.popRef(); ref.load(eContext); final GPR refr = ref.getRegister(); // Allocate tmp registers final GPR tmpr = (GPR) L1AHelper.requestRegister(eContext, JvmType.REFERENCE, false); final IntItem result = (IntItem) L1AHelper.requestWordRegister( eContext, JvmType.INT, true); // Is instanceof instanceOfClass(refr, (VmClassType<?>) classRef.getResolvedVmClass(), tmpr, result.getRegister(), null, false); // Push result vstack.push(result); // Release ref.release(eContext); pool.release(tmpr); } }
12,880
public final void writeClassInitialize(Label curInstrLabel, GPR classReg, VmType<?> cls) { if (!cls.isInitialized()) { // Test declaringClass.modifiers os.writeTEST(BITS32, classReg, entryPoints.getVmTypeState() .getOffset(), VmTypeState.ST_INITIALIZED); final Label afterInit = new Label(curInstrLabel + "$$after-classinit-ex"); os.writeJCC(afterInit, X86Constants.JNZ); if (os.isCode32()) { os.writePUSHA(); } else { os.writePUSH(X86Register.RAX); os.writePUSH(X86Register.RBX); os.writePUSH(X86Register.RCX); os.writePUSH(X86Register.RDX); os.writePUSH(X86Register.RSI); os.writePUSH(X86Register.R8); os.writePUSH(X86Register.R9); os.writePUSH(X86Register.R10); os.writePUSH(X86Register.R11); // R12 contains processor and is preserved os.writePUSH(X86Register.R13); os.writePUSH(X86Register.R14); os.writePUSH(X86Register.R15); } // Call cls.initialize os.writePUSH(classReg); invokeJavaMethod(entryPoints.getVmTypeInitialize()); if (os.isCode32()) { os.writePOPA(); } else { os.writePOP(X86Register.R15); os.writePOP(X86Register.R14); os.writePOP(X86Register.R13); // R12 contains processor and is preserved os.writePOP(X86Register.R11); os.writePOP(X86Register.R10); os.writePOP(X86Register.R9); os.writePOP(X86Register.R8); os.writePOP(X86Register.RSI); os.writePOP(X86Register.RDX); os.writePOP(X86Register.RCX); os.writePOP(X86Register.RBX); os.writePOP(X86Register.RAX); } // Set label os.setObjectRef(afterInit); } }
public final void writeClassInitialize(Label curInstrLabel, GPR classReg, VmType<?> cls) { if (!cls.isInitialized()) { // Test declaringClass.modifiers os.writeTEST(BITS32, classReg, entryPoints.getVmTypeState() .getOffset(), VmTypeState.ST_INITIALIZED); final Label afterInit = new Label(curInstrLabel + "$$after-classinit-ex"); os.writeJCC(afterInit, X86Constants.JNZ); if (os.isCode32()) { os.writePUSHA(); } else { os.writePUSH(X86Register.RAX); os.writePUSH(X86Register.RBX); os.writePUSH(X86Register.RCX); os.writePUSH(X86Register.RDX); os.writePUSH(X86Register.RSI); os.writePUSH(X86Register.R8); os.writePUSH(X86Register.R9); os.writePUSH(X86Register.R10); os.writePUSH(X86Register.R11); // R12 contains processor and is preserved os.writePUSH(X86Register.R13); os.writePUSH(X86Register.R14); os.writePUSH(X86Register.R15); } // Call cls.initialize os.writePUSH(classReg); invokeJavaMethod(entryPoints.getVmTypeInitialize()); if (os.isCode32()) { os.writePOPA(); } else { os.writePOP(X86Register.R15); os.writePOP(X86Register.R14); os.writePOP(X86Register.R13); // R12 contains processor and is preserved os.writePOP(X86Register.R11); os.writePOP(X86Register.R10); os.writePOP(X86Register.R9); os.writePOP(X86Register.R8); os.writePOP(X86Register.RSI); os.writePOP(X86Register.RDX); os.writePOP(X86Register.RCX); os.writePOP(X86Register.RBX); os.writePOP(X86Register.RAX); } // Set label os.setObjectRef(afterInit); } }
12,881
public final void writeClassInitialize(Label curInstrLabel, GPR classReg, VmType<?> cls) { if (!cls.isInitialized()) { // Test declaringClass.modifiers os.writeTEST(BITS32, classReg, entryPoints.getVmTypeState() .getOffset(), VmTypeState.ST_INITIALIZED); final Label afterInit = new Label(curInstrLabel + "$$after-classinit-ex"); os.writeJCC(afterInit, X86Constants.JNZ); if (os.isCode32()) { os.writePUSHA(); } else { os.writePUSH(X86Register.RAX); os.writePUSH(X86Register.RBX); os.writePUSH(X86Register.RCX); os.writePUSH(X86Register.RDX); os.writePUSH(X86Register.RSI); os.writePUSH(X86Register.R8); os.writePUSH(X86Register.R9); os.writePUSH(X86Register.R10); os.writePUSH(X86Register.R11); // R12 contains processor and is preserved os.writePUSH(X86Register.R13); os.writePUSH(X86Register.R14); os.writePUSH(X86Register.R15); } // Call cls.initialize os.writePUSH(classReg); invokeJavaMethod(entryPoints.getVmTypeInitialize()); if (os.isCode32()) { os.writePOPA(); } else { os.writePOP(X86Register.R15); os.writePOP(X86Register.R14); os.writePOP(X86Register.R13); // R12 contains processor and is preserved os.writePOP(X86Register.R11); os.writePOP(X86Register.R10); os.writePOP(X86Register.R9); os.writePOP(X86Register.R8); os.writePOP(X86Register.RSI); os.writePOP(X86Register.RDX); os.writePOP(X86Register.RCX); os.writePOP(X86Register.RBX); os.writePOP(X86Register.RAX); } // Set label os.setObjectRef(afterInit); } }
public final void writeClassInitialize(Label curInstrLabel, GPR classReg, VmType<?> cls) { if (!cls.isInitialized()) { // Test declaringClass.modifiers os.writeTEST(BITS32, classReg, entryPoints.getVmTypeState() .getOffset(), VmTypeState.ST_INITIALIZED); final Label afterInit = new Label(curInstrLabel + "$$after-classinit-ex"); os.writeJCC(afterInit, X86Constants.JNZ); if (os.isCode32()) { os.writePUSHA(); } else { os.writePUSH(X86Register.RAX); os.writePUSH(X86Register.RBX); os.writePUSH(X86Register.RCX); os.writePUSH(X86Register.RDX); os.writePUSH(X86Register.RSI); os.writePUSH(X86Register.R8); os.writePUSH(X86Register.R9); os.writePUSH(X86Register.R10); os.writePUSH(X86Register.R11); // R12 contains processor and is preserved os.writePUSH(X86Register.R13); os.writePUSH(X86Register.R14); os.writePUSH(X86Register.R15); } // Call cls.initialize os.writePUSH(classReg); invokeJavaMethod(entryPoints.getVmTypeInitialize()); if (os.isCode32()) { os.writePOPA(); } else { os.writePOP(X86Register.R15); os.writePOP(X86Register.R14); os.writePOP(X86Register.R13); // R12 contains processor and is preserved os.writePOP(X86Register.R11); os.writePOP(X86Register.R10); os.writePOP(X86Register.R9); os.writePOP(X86Register.R8); os.writePOP(X86Register.RSI); os.writePOP(X86Register.RDX); os.writePOP(X86Register.RCX); os.writePOP(X86Register.RBX); os.writePOP(X86Register.RAX); } // Set label os.setObjectRef(afterInit); } }
12,882
public final void writeGetStaticsEntry64(Label curInstrLabel, GPR64 dstReg, VmSharedStaticsEntry entry) { writeLoadSTATICS(curInstrLabel, "gs64", true); os .writeMOV(BITS64, dstReg, this.STATICS, getSharedStaticsOffset(entry)); }
public final void writeGetStaticsEntry64(Label curInstrLabel, GPR64 dstReg, VmSharedStaticsEntry entry) { writeLoadSTATICS(curInstrLabel, "gs64", true); os .writeMOV(BITS64, dstReg, this.STATICS, getSharedStaticsOffset(entry)); }
12,884
public final void writeGetStaticsEntry64(Label curInstrLabel, GPR64 dstReg, VmSharedStaticsEntry entry) { writeLoadSTATICS(curInstrLabel, "gs64", true); os .writeMOV(BITS64, dstReg, this.STATICS, getSharedStaticsOffset(entry)); }
public final void writeGetStaticsEntry64(Label curInstrLabel, GPR64 dstReg, VmSharedStaticsEntry entry) { writeLoadSTATICS(curInstrLabel, "gs64", true); os .writeMOV(BITS64, dstReg, this.STATICS, getSharedStaticsOffset(entry)); }
12,885
public final void writePutStaticsEntry64(Label curInstrLabel, GPR64 srcReg, VmSharedStaticsEntry entry) { writeLoadSTATICS(curInstrLabel, "ps64", true); os .writeMOV(BITS64, this.STATICS, getSharedStaticsOffset(entry), srcReg); }
public final void writePutStaticsEntry64(Label curInstrLabel, GPR64 srcReg, VmSharedStaticsEntry entry) { writeLoadSTATICS(curInstrLabel, "ps64", true); os .writeMOV(BITS64, this.STATICS, getSharedStaticsOffset(entry), srcReg); }
12,886
public final void writePutStaticsEntry64(Label curInstrLabel, GPR64 srcReg, VmSharedStaticsEntry entry) { writeLoadSTATICS(curInstrLabel, "ps64", true); os .writeMOV(BITS64, this.STATICS, getSharedStaticsOffset(entry), srcReg); }
public final void writePutStaticsEntry64(Label curInstrLabel, GPR64 srcReg, VmSharedStaticsEntry entry) { writeLoadSTATICS(curInstrLabel, "ps64", true); os .writeMOV(BITS64, this.STATICS, getSharedStaticsOffset(entry), srcReg); }
12,887
private final void dwreturn(int jvmType) { final DoubleWordItem val = (DoubleWordItem) vstack.pop(jvmType); // Return value must be in EAX:EDX if (!(val.uses(EAX) && val.uses(EDX))) { if (val.uses(EAX) || val.uses(EDX)) { val.push(eContext); } requestRegister(EAX, val); requestRegister(EDX, val); val.loadTo(eContext, EAX, EDX); } // Release val.release(eContext); // Do actual return visit_return(); }
private final void dwreturn(int jvmType) { final DoubleWordItem val = (DoubleWordItem) vstack.pop(jvmType); // Return value must be in EAX:EDX if (!(val.uses(EAX) && val.uses(EDX))) { if (val.uses(EAX) || val.uses(EDX)) { val.push(eContext); } requestRegister(EAX, val); requestRegister(EDX, val); val.loadTo(eContext, EAX, EDX); } // Release val.release(eContext); // Do actual return visit_return(); }
12,888
private final void ishift(int operation) { final IntItem shift = vstack.popInt(); final boolean isconst = shift.isConstant(); if (!isconst) { requestRegister(ECX, shift); shift.loadTo(eContext, ECX); } // Pop & load final IntItem val = vstack.popInt(); val.loadIf(eContext, ~Item.Kind.LOCAL); if (val.isLocal()) { final int fpOffset = val.getOffsetToFP(); if (isconst) { final int offset = shift.getValue(); os.writeShift(operation, FP, fpOffset, offset); } else { os.writeShift_CL(operation, FP, fpOffset); } } else { final Register valr = val.getRegister(); if (isconst) { final int offset = shift.getValue(); os.writeShift(operation, valr, offset); } else { os.writeShift_CL(operation, valr); } } // Release shift.release(eContext); // Push result vstack.push(val); }
private final void ishift(int operation) { final IntItem shift = vstack.popInt(); final boolean isconst = shift.isConstant(); if (!isconst) { L1AHelper.requestRegister(eContext, ECX, shift); shift.loadTo(eContext, ECX); } // Pop & load final IntItem val = vstack.popInt(); val.loadIf(eContext, ~Item.Kind.LOCAL); if (val.isLocal()) { final int fpOffset = val.getOffsetToFP(); if (isconst) { final int offset = shift.getValue(); os.writeShift(operation, FP, fpOffset, offset); } else { os.writeShift_CL(operation, FP, fpOffset); } } else { final Register valr = val.getRegister(); if (isconst) { final int offset = shift.getValue(); os.writeShift(operation, valr, offset); } else { os.writeShift_CL(operation, valr); } } // Release shift.release(eContext); // Push result vstack.push(val); }
12,889
public final void visit_anewarray(VmConstClass classRef) { // Claim EAX, we're going to use it later requestRegister(EAX); // Request tmp register final Register classr = requestRegister(JvmType.INT, false); // Pop final IntItem cnt = vstack.popInt(); // Load the count value cnt.load(eContext); final Register cntr = cnt.getRegister(); // Resolve the class writeResolveAndLoadClassToReg(classRef, classr); // Release EAX so it can be used by invokeJavaMethod releaseRegister(EAX); stackFrame.writePushMethodRef(); os.writePUSH(classr); /* Class */ os.writePUSH(cntr); /* Count */ invokeJavaMethod(context.getAnewarrayMethod()); /* Result is already push on the stack */ // Release cnt.release(eContext); releaseRegister(classr); }
public final void visit_anewarray(VmConstClass classRef) { // Claim EAX, we're going to use it later L1AHelper.requestRegister(eContext, EAX); // Request tmp register final Register classr = requestRegister(JvmType.INT, false); // Pop final IntItem cnt = vstack.popInt(); // Load the count value cnt.load(eContext); final Register cntr = cnt.getRegister(); // Resolve the class writeResolveAndLoadClassToReg(classRef, classr); // Release EAX so it can be used by invokeJavaMethod releaseRegister(EAX); stackFrame.writePushMethodRef(); os.writePUSH(classr); /* Class */ os.writePUSH(cntr); /* Count */ invokeJavaMethod(context.getAnewarrayMethod()); /* Result is already push on the stack */ // Release cnt.release(eContext); releaseRegister(classr); }
12,890
public final void visit_anewarray(VmConstClass classRef) { // Claim EAX, we're going to use it later requestRegister(EAX); // Request tmp register final Register classr = requestRegister(JvmType.INT, false); // Pop final IntItem cnt = vstack.popInt(); // Load the count value cnt.load(eContext); final Register cntr = cnt.getRegister(); // Resolve the class writeResolveAndLoadClassToReg(classRef, classr); // Release EAX so it can be used by invokeJavaMethod releaseRegister(EAX); stackFrame.writePushMethodRef(); os.writePUSH(classr); /* Class */ os.writePUSH(cntr); /* Count */ invokeJavaMethod(context.getAnewarrayMethod()); /* Result is already push on the stack */ // Release cnt.release(eContext); releaseRegister(classr); }
public final void visit_anewarray(VmConstClass classRef) { // Claim EAX, we're going to use it later requestRegister(EAX); // Request tmp register final Register classr = L1AHelper.requestRegister(eContext, JvmType.INT, false); // Pop final IntItem cnt = vstack.popInt(); // Load the count value cnt.load(eContext); final Register cntr = cnt.getRegister(); // Resolve the class writeResolveAndLoadClassToReg(classRef, classr); // Release EAX so it can be used by invokeJavaMethod releaseRegister(EAX); stackFrame.writePushMethodRef(); os.writePUSH(classr); /* Class */ os.writePUSH(cntr); /* Count */ invokeJavaMethod(context.getAnewarrayMethod()); /* Result is already push on the stack */ // Release cnt.release(eContext); releaseRegister(classr); }
12,891
public final void visit_anewarray(VmConstClass classRef) { // Claim EAX, we're going to use it later requestRegister(EAX); // Request tmp register final Register classr = requestRegister(JvmType.INT, false); // Pop final IntItem cnt = vstack.popInt(); // Load the count value cnt.load(eContext); final Register cntr = cnt.getRegister(); // Resolve the class writeResolveAndLoadClassToReg(classRef, classr); // Release EAX so it can be used by invokeJavaMethod releaseRegister(EAX); stackFrame.writePushMethodRef(); os.writePUSH(classr); /* Class */ os.writePUSH(cntr); /* Count */ invokeJavaMethod(context.getAnewarrayMethod()); /* Result is already push on the stack */ // Release cnt.release(eContext); releaseRegister(classr); }
public final void visit_anewarray(VmConstClass classRef) { // Claim EAX, we're going to use it later requestRegister(EAX); // Request tmp register final Register classr = requestRegister(JvmType.INT, false); // Pop final IntItem cnt = vstack.popInt(); // Load the count value cnt.load(eContext); final Register cntr = cnt.getRegister(); // Resolve the class writeResolveAndLoadClassToReg(classRef, classr); // Release EAX so it can be used by invokeJavaMethod L1AHelper.releaseRegister(eContext, EAX); stackFrame.writePushMethodRef(); os.writePUSH(classr); /* Class */ os.writePUSH(cntr); /* Count */ invokeJavaMethod(context.getAnewarrayMethod()); /* Result is already push on the stack */ // Release cnt.release(eContext); releaseRegister(classr); }
12,892
public final void visit_anewarray(VmConstClass classRef) { // Claim EAX, we're going to use it later requestRegister(EAX); // Request tmp register final Register classr = requestRegister(JvmType.INT, false); // Pop final IntItem cnt = vstack.popInt(); // Load the count value cnt.load(eContext); final Register cntr = cnt.getRegister(); // Resolve the class writeResolveAndLoadClassToReg(classRef, classr); // Release EAX so it can be used by invokeJavaMethod releaseRegister(EAX); stackFrame.writePushMethodRef(); os.writePUSH(classr); /* Class */ os.writePUSH(cntr); /* Count */ invokeJavaMethod(context.getAnewarrayMethod()); /* Result is already push on the stack */ // Release cnt.release(eContext); releaseRegister(classr); }
public final void visit_anewarray(VmConstClass classRef) { // Claim EAX, we're going to use it later requestRegister(EAX); // Request tmp register final Register classr = requestRegister(JvmType.INT, false); // Pop final IntItem cnt = vstack.popInt(); // Load the count value cnt.load(eContext); final Register cntr = cnt.getRegister(); // Resolve the class writeResolveAndLoadClassToReg(classRef, classr); // Release EAX so it can be used by invokeJavaMethod releaseRegister(EAX); stackFrame.writePushMethodRef(); os.writePUSH(classr); /* Class */ os.writePUSH(cntr); /* Count */ invokeJavaMethod(context.getAnewarrayMethod()); /* Result is already push on the stack */ // Release cnt.release(eContext); L1AHelper.releaseRegister(eContext, classr); }
12,893
public final void visit_arraylength() { final RefItem ref = vstack.popRef(); final IntItem result = (IntItem) requestWordRegister(JvmType.INT, false); // Load ref.load(eContext); final Register refr = ref.getRegister(); final Register resultr = result.getRegister(); // Get length os.writeMOV(INTSIZE, resultr, refr, arrayLengthOffset); // Release ref.release(eContext); // Push result vstack.push(result); }
public final void visit_arraylength() { final RefItem ref = vstack.popRef(); final IntItem result = (IntItem) L1AHelper.requestWordRegister( eContext, JvmType.INT, false); // Load ref.load(eContext); final Register refr = ref.getRegister(); final Register resultr = result.getRegister(); // Get length os.writeMOV(INTSIZE, resultr, refr, arrayLengthOffset); // Release ref.release(eContext); // Push result vstack.push(result); }
12,894
public final void visit_athrow() { final RefItem ref = vstack.popRef(); // Exception must be in EAX if (!ref.uses(EAX)) { requestRegister(EAX, ref); ref.loadTo(eContext, EAX); } // Jump helper.writeJumpTableCALL(X86JumpTable.VM_ATHROW_OFS); // Release ref.release(eContext); }
public final void visit_athrow() { final RefItem ref = vstack.popRef(); // Exception must be in EAX if (!ref.uses(EAX)) { L1AHelper.requestRegister(eContext, EAX, ref); ref.loadTo(eContext, EAX); } // Jump helper.writeJumpTableCALL(X86JumpTable.VM_ATHROW_OFS); // Release ref.release(eContext); }
12,895
public final void visit_checkcast(VmConstClass classRef) { // Pre-claim ECX requestRegister(ECX); requestRegister(EAX); // check that top item is a reference final RefItem ref = vstack.popRef(); // Load the ref ref.load(eContext); final Register refr = ref.getRegister(); final Register classr = EAX; final Register tmpr = requestRegister(JvmType.INT, false); // Resolve the class writeResolveAndLoadClassToReg(classRef, classr); final Label okLabel = new Label(this.curInstrLabel + "cc-ok"); /* Is objectref null? */ os.writeTEST(refr, refr); os.writeJCC(okLabel, X86Constants.JZ); /* Is instanceof? */ instanceOf(refr, classr, tmpr, okLabel, true); /* Not instanceof */ // Release temp registers here, so invokeJavaMethod can use it releaseRegister(ECX); releaseRegister(classr); releaseRegister(tmpr); // Call SoftByteCodes.systemException os.writePUSH(SoftByteCodes.EX_CLASSCAST); os.writePUSH(0); invokeJavaMethod(context.getSystemExceptionMethod()); final RefItem exi = vstack.popRef(); assertCondition(exi.uses(EAX), "item must be in eax"); exi.release(eContext); /* Exception in EAX, throw it */ helper.writeJumpTableCALL(X86JumpTable.VM_ATHROW_OFS); /* Normal exit */ os.setObjectRef(okLabel); // Leave ref on stack vstack.push(ref); }
public final void visit_checkcast(VmConstClass classRef) { // Pre-claim ECX requestRegister(ECX); requestRegister(EAX); // check that top item is a reference final RefItem ref = vstack.popRef(); // Load the ref ref.load(eContext); final Register refr = ref.getRegister(); final Register classr = EAX; final Register tmpr = requestRegister(JvmType.INT, false); // Resolve the class writeResolveAndLoadClassToReg(classRef, classr); final Label okLabel = new Label(this.curInstrLabel + "cc-ok"); /* Is objectref null? */ os.writeTEST(refr, refr); os.writeJCC(okLabel, X86Constants.JZ); /* Is instanceof? */ instanceOf(refr, classr, tmpr, okLabel, true); /* Not instanceof */ // Release temp registers here, so invokeJavaMethod can use it releaseRegister(ECX); releaseRegister(classr); releaseRegister(tmpr); // Call SoftByteCodes.systemException os.writePUSH(SoftByteCodes.EX_CLASSCAST); os.writePUSH(0); invokeJavaMethod(context.getSystemExceptionMethod()); final RefItem exi = vstack.popRef(); assertCondition(exi.uses(EAX), "item must be in eax"); exi.release(eContext); /* Exception in EAX, throw it */ helper.writeJumpTableCALL(X86JumpTable.VM_ATHROW_OFS); /* Normal exit */ os.setObjectRef(okLabel); // Leave ref on stack vstack.push(ref); }
12,896
public final void visit_checkcast(VmConstClass classRef) { // Pre-claim ECX requestRegister(ECX); requestRegister(EAX); // check that top item is a reference final RefItem ref = vstack.popRef(); // Load the ref ref.load(eContext); final Register refr = ref.getRegister(); final Register classr = EAX; final Register tmpr = requestRegister(JvmType.INT, false); // Resolve the class writeResolveAndLoadClassToReg(classRef, classr); final Label okLabel = new Label(this.curInstrLabel + "cc-ok"); /* Is objectref null? */ os.writeTEST(refr, refr); os.writeJCC(okLabel, X86Constants.JZ); /* Is instanceof? */ instanceOf(refr, classr, tmpr, okLabel, true); /* Not instanceof */ // Release temp registers here, so invokeJavaMethod can use it releaseRegister(ECX); releaseRegister(classr); releaseRegister(tmpr); // Call SoftByteCodes.systemException os.writePUSH(SoftByteCodes.EX_CLASSCAST); os.writePUSH(0); invokeJavaMethod(context.getSystemExceptionMethod()); final RefItem exi = vstack.popRef(); assertCondition(exi.uses(EAX), "item must be in eax"); exi.release(eContext); /* Exception in EAX, throw it */ helper.writeJumpTableCALL(X86JumpTable.VM_ATHROW_OFS); /* Normal exit */ os.setObjectRef(okLabel); // Leave ref on stack vstack.push(ref); }
public final void visit_checkcast(VmConstClass classRef) { // Pre-claim ECX requestRegister(ECX); requestRegister(EAX); // check that top item is a reference final RefItem ref = vstack.popRef(); // Load the ref ref.load(eContext); final Register refr = ref.getRegister(); final Register classr = EAX; final Register tmpr = L1AHelper.requestRegister(eContext, JvmType.INT, false); // Resolve the class writeResolveAndLoadClassToReg(classRef, classr); final Label okLabel = new Label(this.curInstrLabel + "cc-ok"); /* Is objectref null? */ os.writeTEST(refr, refr); os.writeJCC(okLabel, X86Constants.JZ); /* Is instanceof? */ instanceOf(refr, classr, tmpr, okLabel, true); /* Not instanceof */ // Release temp registers here, so invokeJavaMethod can use it releaseRegister(ECX); releaseRegister(classr); releaseRegister(tmpr); // Call SoftByteCodes.systemException os.writePUSH(SoftByteCodes.EX_CLASSCAST); os.writePUSH(0); invokeJavaMethod(context.getSystemExceptionMethod()); final RefItem exi = vstack.popRef(); assertCondition(exi.uses(EAX), "item must be in eax"); exi.release(eContext); /* Exception in EAX, throw it */ helper.writeJumpTableCALL(X86JumpTable.VM_ATHROW_OFS); /* Normal exit */ os.setObjectRef(okLabel); // Leave ref on stack vstack.push(ref); }
12,897
public final void visit_checkcast(VmConstClass classRef) { // Pre-claim ECX requestRegister(ECX); requestRegister(EAX); // check that top item is a reference final RefItem ref = vstack.popRef(); // Load the ref ref.load(eContext); final Register refr = ref.getRegister(); final Register classr = EAX; final Register tmpr = requestRegister(JvmType.INT, false); // Resolve the class writeResolveAndLoadClassToReg(classRef, classr); final Label okLabel = new Label(this.curInstrLabel + "cc-ok"); /* Is objectref null? */ os.writeTEST(refr, refr); os.writeJCC(okLabel, X86Constants.JZ); /* Is instanceof? */ instanceOf(refr, classr, tmpr, okLabel, true); /* Not instanceof */ // Release temp registers here, so invokeJavaMethod can use it releaseRegister(ECX); releaseRegister(classr); releaseRegister(tmpr); // Call SoftByteCodes.systemException os.writePUSH(SoftByteCodes.EX_CLASSCAST); os.writePUSH(0); invokeJavaMethod(context.getSystemExceptionMethod()); final RefItem exi = vstack.popRef(); assertCondition(exi.uses(EAX), "item must be in eax"); exi.release(eContext); /* Exception in EAX, throw it */ helper.writeJumpTableCALL(X86JumpTable.VM_ATHROW_OFS); /* Normal exit */ os.setObjectRef(okLabel); // Leave ref on stack vstack.push(ref); }
public final void visit_checkcast(VmConstClass classRef) { // Pre-claim ECX requestRegister(ECX); requestRegister(EAX); // check that top item is a reference final RefItem ref = vstack.popRef(); // Load the ref ref.load(eContext); final Register refr = ref.getRegister(); final Register classr = EAX; final Register tmpr = requestRegister(JvmType.INT, false); // Resolve the class writeResolveAndLoadClassToReg(classRef, classr); final Label okLabel = new Label(this.curInstrLabel + "cc-ok"); /* Is objectref null? */ os.writeTEST(refr, refr); os.writeJCC(okLabel, X86Constants.JZ); /* Is instanceof? */ instanceOf(refr, classr, tmpr, okLabel, true); /* Not instanceof */ // Release temp registers here, so invokeJavaMethod can use it releaseRegister(ECX); releaseRegister(classr); releaseRegister(tmpr); // Call SoftByteCodes.systemException os.writePUSH(SoftByteCodes.EX_CLASSCAST); os.writePUSH(0); invokeJavaMethod(context.getSystemExceptionMethod()); final RefItem exi = vstack.popRef(); assertCondition(exi.uses(EAX), "item must be in eax"); exi.release(eContext); /* Exception in EAX, throw it */ helper.writeJumpTableCALL(X86JumpTable.VM_ATHROW_OFS); /* Normal exit */ os.setObjectRef(okLabel); // Leave ref on stack vstack.push(ref); }
12,898
public final void visit_getfield(VmConstFieldRef fieldRef) { fieldRef.resolve(loader); final VmField field = fieldRef.getResolvedVmField(); if (field.isStatic()) { throw new IncompatibleClassChangeError( "getfield called on static field " + fieldRef.getName()); } final VmInstanceField inf = (VmInstanceField) field; final int fieldOffset = inf.getOffset(); final int type = JvmType.SignatureToType(fieldRef.getSignature()); final boolean isfloat = JvmType.isFloat(type); // Pop & load final RefItem ref = vstack.popRef(); ref.load(eContext); final Register refr = ref.getRegister(); // get field final Item result; if (!fieldRef.isWide()) { if (isfloat) { result = FloatItem.createFPUStack(); os.writeFLD32(refr, fieldOffset); vstack.fpuStack.push(result); } else { final WordItem iw = requestWordRegister(type, false); os.writeMOV(INTSIZE, iw.getRegister(), refr, fieldOffset); result = iw; } } else { if (isfloat) { result = DoubleItem.createFPUStack(); os.writeFLD64(refr, fieldOffset); vstack.fpuStack.push(result); } else { final DoubleWordItem idw = requestDoubleWordRegisters(type); final Register lsb = idw.getLsbRegister(); final Register msb = idw.getMsbRegister(); os.writeMOV(INTSIZE, lsb, refr, fieldOffset + LSB); os.writeMOV(INTSIZE, msb, refr, fieldOffset + MSB); result = idw; } } // Release ref.release(eContext); // Push result vstack.push(result); }
public final void visit_getfield(VmConstFieldRef fieldRef) { fieldRef.resolve(loader); final VmField field = fieldRef.getResolvedVmField(); if (field.isStatic()) { throw new IncompatibleClassChangeError( "getfield called on static field " + fieldRef.getName()); } final VmInstanceField inf = (VmInstanceField) field; final int fieldOffset = inf.getOffset(); final int type = JvmType.SignatureToType(fieldRef.getSignature()); final boolean isfloat = JvmType.isFloat(type); // Pop & load final RefItem ref = vstack.popRef(); ref.load(eContext); final Register refr = ref.getRegister(); // get field final Item result; if (!fieldRef.isWide()) { if (isfloat) { result = FloatItem.createFPUStack(); os.writeFLD32(refr, fieldOffset); vstack.fpuStack.push(result); } else { final WordItem iw = L1AHelper.requestWordRegister(eContext, type, false); os.writeMOV(INTSIZE, iw.getRegister(), refr, fieldOffset); result = iw; } } else { if (isfloat) { result = DoubleItem.createFPUStack(); os.writeFLD64(refr, fieldOffset); vstack.fpuStack.push(result); } else { final DoubleWordItem idw = requestDoubleWordRegisters(type); final Register lsb = idw.getLsbRegister(); final Register msb = idw.getMsbRegister(); os.writeMOV(INTSIZE, lsb, refr, fieldOffset + LSB); os.writeMOV(INTSIZE, msb, refr, fieldOffset + MSB); result = idw; } } // Release ref.release(eContext); // Push result vstack.push(result); }
12,899
public final void visit_getfield(VmConstFieldRef fieldRef) { fieldRef.resolve(loader); final VmField field = fieldRef.getResolvedVmField(); if (field.isStatic()) { throw new IncompatibleClassChangeError( "getfield called on static field " + fieldRef.getName()); } final VmInstanceField inf = (VmInstanceField) field; final int fieldOffset = inf.getOffset(); final int type = JvmType.SignatureToType(fieldRef.getSignature()); final boolean isfloat = JvmType.isFloat(type); // Pop & load final RefItem ref = vstack.popRef(); ref.load(eContext); final Register refr = ref.getRegister(); // get field final Item result; if (!fieldRef.isWide()) { if (isfloat) { result = FloatItem.createFPUStack(); os.writeFLD32(refr, fieldOffset); vstack.fpuStack.push(result); } else { final WordItem iw = requestWordRegister(type, false); os.writeMOV(INTSIZE, iw.getRegister(), refr, fieldOffset); result = iw; } } else { if (isfloat) { result = DoubleItem.createFPUStack(); os.writeFLD64(refr, fieldOffset); vstack.fpuStack.push(result); } else { final DoubleWordItem idw = requestDoubleWordRegisters(type); final Register lsb = idw.getLsbRegister(); final Register msb = idw.getMsbRegister(); os.writeMOV(INTSIZE, lsb, refr, fieldOffset + LSB); os.writeMOV(INTSIZE, msb, refr, fieldOffset + MSB); result = idw; } } // Release ref.release(eContext); // Push result vstack.push(result); }
public final void visit_getfield(VmConstFieldRef fieldRef) { fieldRef.resolve(loader); final VmField field = fieldRef.getResolvedVmField(); if (field.isStatic()) { throw new IncompatibleClassChangeError( "getfield called on static field " + fieldRef.getName()); } final VmInstanceField inf = (VmInstanceField) field; final int fieldOffset = inf.getOffset(); final int type = JvmType.SignatureToType(fieldRef.getSignature()); final boolean isfloat = JvmType.isFloat(type); // Pop & load final RefItem ref = vstack.popRef(); ref.load(eContext); final Register refr = ref.getRegister(); // get field final Item result; if (!fieldRef.isWide()) { if (isfloat) { result = FloatItem.createFPUStack(); os.writeFLD32(refr, fieldOffset); vstack.fpuStack.push(result); } else { final WordItem iw = requestWordRegister(type, false); os.writeMOV(INTSIZE, iw.getRegister(), refr, fieldOffset); result = iw; } } else { if (isfloat) { result = DoubleItem.createFPUStack(); os.writeFLD64(refr, fieldOffset); vstack.fpuStack.push(result); } else { final DoubleWordItem idw = L1AHelper .requestDoubleWordRegisters(eContext, type); final Register lsb = idw.getLsbRegister(); final Register msb = idw.getMsbRegister(); os.writeMOV(INTSIZE, lsb, refr, fieldOffset + LSB); os.writeMOV(INTSIZE, msb, refr, fieldOffset + MSB); result = idw; } } // Release ref.release(eContext); // Push result vstack.push(result); }
12,900
public final void visit_getstatic(VmConstFieldRef fieldRef) { fieldRef.resolve(loader); final int type = JvmType.SignatureToType(fieldRef.getSignature()); final VmStaticField sf = (VmStaticField) fieldRef.getResolvedVmField(); // Initialize if needed if (!sf.getDeclaringClass().isInitialized()) { final X86RegisterPool pool = eContext.getPool(); final Register tmp = requestRegister(JvmType.INT, false); writeInitializeClass(fieldRef, tmp); pool.release(tmp); } // Get static field object if (JvmType.isFloat(type)) { final boolean is32bit = !fieldRef.isWide(); helper.writeGetStaticsEntryToFPU(curInstrLabel, sf, is32bit); final Item result = FPUHelper.createFPUStack(type); vstack.fpuStack.push(result); vstack.push(result); } else if (!fieldRef.isWide()) { final WordItem result = requestWordRegister(type, false); final Register resultr = result.getRegister(); helper.writeGetStaticsEntry(curInstrLabel, resultr, sf); vstack.push(result); } else { final DoubleWordItem result = requestDoubleWordRegisters(type); final Register lsb = result.getLsbRegister(); final Register msb = result.getMsbRegister(); helper.writeGetStaticsEntry64(curInstrLabel, lsb, msb, sf); vstack.push(result); } }
public final void visit_getstatic(VmConstFieldRef fieldRef) { fieldRef.resolve(loader); final int type = JvmType.SignatureToType(fieldRef.getSignature()); final VmStaticField sf = (VmStaticField) fieldRef.getResolvedVmField(); // Initialize if needed if (!sf.getDeclaringClass().isInitialized()) { final X86RegisterPool pool = eContext.getPool(); final Register tmp = L1AHelper.requestRegister(eContext, JvmType.INT, false); writeInitializeClass(fieldRef, tmp); pool.release(tmp); } // Get static field object if (JvmType.isFloat(type)) { final boolean is32bit = !fieldRef.isWide(); helper.writeGetStaticsEntryToFPU(curInstrLabel, sf, is32bit); final Item result = FPUHelper.createFPUStack(type); vstack.fpuStack.push(result); vstack.push(result); } else if (!fieldRef.isWide()) { final WordItem result = requestWordRegister(type, false); final Register resultr = result.getRegister(); helper.writeGetStaticsEntry(curInstrLabel, resultr, sf); vstack.push(result); } else { final DoubleWordItem result = requestDoubleWordRegisters(type); final Register lsb = result.getLsbRegister(); final Register msb = result.getMsbRegister(); helper.writeGetStaticsEntry64(curInstrLabel, lsb, msb, sf); vstack.push(result); } }
12,901
public final void visit_getstatic(VmConstFieldRef fieldRef) { fieldRef.resolve(loader); final int type = JvmType.SignatureToType(fieldRef.getSignature()); final VmStaticField sf = (VmStaticField) fieldRef.getResolvedVmField(); // Initialize if needed if (!sf.getDeclaringClass().isInitialized()) { final X86RegisterPool pool = eContext.getPool(); final Register tmp = requestRegister(JvmType.INT, false); writeInitializeClass(fieldRef, tmp); pool.release(tmp); } // Get static field object if (JvmType.isFloat(type)) { final boolean is32bit = !fieldRef.isWide(); helper.writeGetStaticsEntryToFPU(curInstrLabel, sf, is32bit); final Item result = FPUHelper.createFPUStack(type); vstack.fpuStack.push(result); vstack.push(result); } else if (!fieldRef.isWide()) { final WordItem result = requestWordRegister(type, false); final Register resultr = result.getRegister(); helper.writeGetStaticsEntry(curInstrLabel, resultr, sf); vstack.push(result); } else { final DoubleWordItem result = requestDoubleWordRegisters(type); final Register lsb = result.getLsbRegister(); final Register msb = result.getMsbRegister(); helper.writeGetStaticsEntry64(curInstrLabel, lsb, msb, sf); vstack.push(result); } }
public final void visit_getstatic(VmConstFieldRef fieldRef) { fieldRef.resolve(loader); final int type = JvmType.SignatureToType(fieldRef.getSignature()); final VmStaticField sf = (VmStaticField) fieldRef.getResolvedVmField(); // Initialize if needed if (!sf.getDeclaringClass().isInitialized()) { final X86RegisterPool pool = eContext.getPool(); final Register tmp = requestRegister(JvmType.INT, false); writeInitializeClass(fieldRef, tmp); pool.release(tmp); } // Get static field object if (JvmType.isFloat(type)) { final boolean is32bit = !fieldRef.isWide(); helper.writeGetStaticsEntryToFPU(curInstrLabel, sf, is32bit); final Item result = FPUHelper.createFPUStack(type); vstack.fpuStack.push(result); vstack.push(result); } else if (!fieldRef.isWide()) { final WordItem result = L1AHelper.requestWordRegister(eContext, type, false); final Register resultr = result.getRegister(); helper.writeGetStaticsEntry(curInstrLabel, resultr, sf); vstack.push(result); } else { final DoubleWordItem result = requestDoubleWordRegisters(type); final Register lsb = result.getLsbRegister(); final Register msb = result.getMsbRegister(); helper.writeGetStaticsEntry64(curInstrLabel, lsb, msb, sf); vstack.push(result); } }
12,902
public final void visit_getstatic(VmConstFieldRef fieldRef) { fieldRef.resolve(loader); final int type = JvmType.SignatureToType(fieldRef.getSignature()); final VmStaticField sf = (VmStaticField) fieldRef.getResolvedVmField(); // Initialize if needed if (!sf.getDeclaringClass().isInitialized()) { final X86RegisterPool pool = eContext.getPool(); final Register tmp = requestRegister(JvmType.INT, false); writeInitializeClass(fieldRef, tmp); pool.release(tmp); } // Get static field object if (JvmType.isFloat(type)) { final boolean is32bit = !fieldRef.isWide(); helper.writeGetStaticsEntryToFPU(curInstrLabel, sf, is32bit); final Item result = FPUHelper.createFPUStack(type); vstack.fpuStack.push(result); vstack.push(result); } else if (!fieldRef.isWide()) { final WordItem result = requestWordRegister(type, false); final Register resultr = result.getRegister(); helper.writeGetStaticsEntry(curInstrLabel, resultr, sf); vstack.push(result); } else { final DoubleWordItem result = requestDoubleWordRegisters(type); final Register lsb = result.getLsbRegister(); final Register msb = result.getMsbRegister(); helper.writeGetStaticsEntry64(curInstrLabel, lsb, msb, sf); vstack.push(result); } }
public final void visit_getstatic(VmConstFieldRef fieldRef) { fieldRef.resolve(loader); final int type = JvmType.SignatureToType(fieldRef.getSignature()); final VmStaticField sf = (VmStaticField) fieldRef.getResolvedVmField(); // Initialize if needed if (!sf.getDeclaringClass().isInitialized()) { final X86RegisterPool pool = eContext.getPool(); final Register tmp = requestRegister(JvmType.INT, false); writeInitializeClass(fieldRef, tmp); pool.release(tmp); } // Get static field object if (JvmType.isFloat(type)) { final boolean is32bit = !fieldRef.isWide(); helper.writeGetStaticsEntryToFPU(curInstrLabel, sf, is32bit); final Item result = FPUHelper.createFPUStack(type); vstack.fpuStack.push(result); vstack.push(result); } else if (!fieldRef.isWide()) { final WordItem result = requestWordRegister(type, false); final Register resultr = result.getRegister(); helper.writeGetStaticsEntry(curInstrLabel, resultr, sf); vstack.push(result); } else { final DoubleWordItem result = L1AHelper.requestDoubleWordRegisters( eContext, type); final Register lsb = result.getLsbRegister(); final Register msb = result.getMsbRegister(); helper.writeGetStaticsEntry64(curInstrLabel, lsb, msb, sf); vstack.push(result); } }
12,903
public final void visit_i2l() { final IntItem v = vstack.popInt(); if (v.isConstant()) { vstack.push(LongItem.createConst(v.getValue())); } else { final X86RegisterPool pool = eContext.getPool(); requestRegister(EAX); requestRegister(EDX); v.loadTo(eContext, EAX); final LongItem result = LongItem.createReg(EAX, EDX); os.writeCDQ(); /* Sign extend EAX -> EDX:EAX */ pool.transferOwnerTo(EAX, result); pool.transferOwnerTo(EDX, result); // We do not release v, because its register (EAX) is re-used in // result // Push result vstack.push(result); } }
public final void visit_i2l() { final IntItem v = vstack.popInt(); if (v.isConstant()) { vstack.push(LongItem.createConst(v.getValue())); } else { final X86RegisterPool pool = eContext.getPool(); requestRegister(EAX); requestRegister(EDX); v.loadTo(eContext, EAX); final LongItem result = LongItem.createReg(EAX, EDX); os.writeCDQ(); /* Sign extend EAX -> EDX:EAX */ pool.transferOwnerTo(EAX, result); pool.transferOwnerTo(EDX, result); // We do not release v, because its register (EAX) is re-used in // result // Push result vstack.push(result); } }
12,904
public final void visit_idiv() { final X86RegisterPool pool = eContext.getPool(); // Pop the arguments of the vstack final IntItem v2 = vstack.popInt(); final IntItem v1 = vstack.popInt(); // We need v1 in EAX, so if that is not the case, // spill those item using EAX requestRegister(EAX, v1); // We need to use EDX, so spill those items using it. v1.spillIfUsing(eContext, EDX); v2.spillIfUsing(eContext, EDX); requestRegister(EDX); // Load v2, v1 into a register v2.load(eContext); v1.loadTo(eContext, Register.EAX); // EAX -> sign extend EDX:EAX os.writeCDQ(); // EAX = EDX:EAX / v2.reg os.writeIDIV_EAX(v2.getRegister()); // Free unused registers pool.release(Register.EDX); v2.release(eContext); // And push the result on the vstack. vstack.push(v1); }
public final void visit_idiv() { final X86RegisterPool pool = eContext.getPool(); // Pop the arguments of the vstack final IntItem v2 = vstack.popInt(); final IntItem v1 = vstack.popInt(); // We need v1 in EAX, so if that is not the case, // spill those item using EAX L1AHelper.requestRegister(eContext, EAX, v1); // We need to use EDX, so spill those items using it. v1.spillIfUsing(eContext, EDX); v2.spillIfUsing(eContext, EDX); requestRegister(EDX); // Load v2, v1 into a register v2.load(eContext); v1.loadTo(eContext, Register.EAX); // EAX -> sign extend EDX:EAX os.writeCDQ(); // EAX = EDX:EAX / v2.reg os.writeIDIV_EAX(v2.getRegister()); // Free unused registers pool.release(Register.EDX); v2.release(eContext); // And push the result on the vstack. vstack.push(v1); }
12,905
public final void visit_idiv() { final X86RegisterPool pool = eContext.getPool(); // Pop the arguments of the vstack final IntItem v2 = vstack.popInt(); final IntItem v1 = vstack.popInt(); // We need v1 in EAX, so if that is not the case, // spill those item using EAX requestRegister(EAX, v1); // We need to use EDX, so spill those items using it. v1.spillIfUsing(eContext, EDX); v2.spillIfUsing(eContext, EDX); requestRegister(EDX); // Load v2, v1 into a register v2.load(eContext); v1.loadTo(eContext, Register.EAX); // EAX -> sign extend EDX:EAX os.writeCDQ(); // EAX = EDX:EAX / v2.reg os.writeIDIV_EAX(v2.getRegister()); // Free unused registers pool.release(Register.EDX); v2.release(eContext); // And push the result on the vstack. vstack.push(v1); }
public final void visit_idiv() { final X86RegisterPool pool = eContext.getPool(); // Pop the arguments of the vstack final IntItem v2 = vstack.popInt(); final IntItem v1 = vstack.popInt(); // We need v1 in EAX, so if that is not the case, // spill those item using EAX requestRegister(EAX, v1); // We need to use EDX, so spill those items using it. v1.spillIfUsing(eContext, EDX); v2.spillIfUsing(eContext, EDX); L1AHelper.requestRegister(eContext, EDX); // Load v2, v1 into a register v2.load(eContext); v1.loadTo(eContext, Register.EAX); // EAX -> sign extend EDX:EAX os.writeCDQ(); // EAX = EDX:EAX / v2.reg os.writeIDIV_EAX(v2.getRegister()); // Free unused registers pool.release(Register.EDX); v2.release(eContext); // And push the result on the vstack. vstack.push(v1); }
12,906
private final void visit_if_icmp(int address, int jccOpcode) { IntItem v2 = vstack.popInt(); IntItem v1 = vstack.popInt(); // flush vstack before jumping vstack.push(eContext); //TODO: can be less restrictive: v1 must not be register if (prepareForOperation(v1, v2, (jccOpcode == X86Constants.JE) || (jccOpcode == X86Constants.JNE))) { // Swap final IntItem tmp = v2; v2 = v1; v1 = tmp; } Register r1 = v1.getRegister(); switch (v2.getKind()) { case Item.Kind.REGISTER: os.writeCMP(r1, v2.getRegister()); break; case Item.Kind.LOCAL: os.writeCMP(r1, FP, v2.getOffsetToFP()); break; case Item.Kind.CONSTANT: int c2 = v2.getValue(); os.writeCMP_Const(r1, c2); break; } v1.release(eContext); v2.release(eContext); os.writeJCC(helper.getInstrLabel(address), jccOpcode); }
private final void visit_if_icmp(int address, int jccOpcode) { IntItem v2 = vstack.popInt(); IntItem v1 = vstack.popInt(); // flush vstack before jumping vstack.push(eContext); //TODO: can be less restrictive: v1 must not be register if (prepareForOperation(v1, v2, (jccOpcode == X86Constants.JE) || (jccOpcode == X86Constants.JNE))) { // Swap final IntItem tmp = v2; v2 = v1; v1 = tmp; } Register r1 = v1.getRegister(); switch (v2.getKind()) { case Item.Kind.REGISTER: os.writeCMP(r1, v2.getRegister()); break; case Item.Kind.LOCAL: os.writeCMP(r1, FP, v2.getOffsetToFP()); break; case Item.Kind.CONSTANT: final int c2 = v2.getValue(); os.writeCMP_Const(r1, c2); break; } v1.release(eContext); v2.release(eContext); os.writeJCC(helper.getInstrLabel(address), jccOpcode); }
12,907
private void visit_ifxx(int type, int address, int jccOpcode) { //IMPROVE: Local case final WordItem val = (WordItem) vstack.pop(type); if ((type == JvmType.INT) && val.isConstant()) { final int ival = ((IntItem) val).getValue(); final boolean jump; switch (jccOpcode) { case X86Constants.JE: jump = (ival == 0); break; case X86Constants.JNE: jump = (ival != 0); break; case X86Constants.JL: jump = (ival < 0); break; case X86Constants.JGE: jump = (ival >= 0); break; case X86Constants.JG: jump = (ival > 0); break; case X86Constants.JLE: jump = (ival <= 0); break; default: throw new IllegalArgumentException("Unknown jccOpcode " + jccOpcode); } if (jump) { // flush vstack before jumping vstack.push(eContext); // Actual jump os.writeJCC(helper.getInstrLabel(address), jccOpcode); } } else { val.load(eContext); final Register valr = val.getRegister(); // flush vstack before jumping vstack.push(eContext); os.writeTEST(valr, valr); os.writeJCC(helper.getInstrLabel(address), jccOpcode); } // Release val.release(eContext); }
private void visit_ifxx(int type, int address, int jccOpcode) { //IMPROVE: Local case final WordItem val = (WordItem) vstack.pop(type); if ((type == JvmType.INT) && val.isConstant()) { final int ival = ((IntItem) val).getValue(); final boolean jump; switch (jccOpcode) { case X86Constants.JE: jump = (ival == 0); break; case X86Constants.JNE: jump = (ival != 0); break; case X86Constants.JL: jump = (ival < 0); break; case X86Constants.JGE: jump = (ival >= 0); break; case X86Constants.JG: jump = (ival > 0); break; case X86Constants.JLE: jump = (ival <= 0); break; default: throw new IllegalArgumentException("Unknown jccOpcode " + jccOpcode); } if (jump) { // flush vstack before jumping vstack.push(eContext); // Actual jump os.writeJMP(helper.getInstrLabel(address)); } } else { val.load(eContext); final Register valr = val.getRegister(); // flush vstack before jumping vstack.push(eContext); os.writeTEST(valr, valr); os.writeJMP(helper.getInstrLabel(address)); } // Release val.release(eContext); }
12,908
public final void visit_instanceof(VmConstClass classRef) { // Prepare final X86RegisterPool pool = eContext.getPool(); // Pre-claim ECX requestRegister(ECX); // Load reference final RefItem ref = vstack.popRef(); ref.load(eContext); final Register refr = ref.getRegister(); // Allocate tmp registers final Register classr = requestRegister(JvmType.INT, false); final Register tmpr = requestRegister(JvmType.INT, false); /* Objectref is already on the stack */ writeResolveAndLoadClassToReg(classRef, classr); final Label trueLabel = new Label(this.curInstrLabel + "io-true"); final Label endLabel = new Label(this.curInstrLabel + "io-end"); /* Is instanceof? */ instanceOf(refr, classr, tmpr, trueLabel, false); /* Not instanceof */ //TODO: use setcc instead of jumps os.writeXOR(refr, refr); os.writeJMP(endLabel); os.setObjectRef(trueLabel); os.writeMOV_Const(refr, 1); // Push result os.setObjectRef(endLabel); final IntItem result = IntItem.createReg(refr); pool.transferOwnerTo(refr, result); vstack.push(result); // Release pool.release(classr); pool.release(tmpr); pool.release(ECX); }
public final void visit_instanceof(VmConstClass classRef) { // Prepare final X86RegisterPool pool = eContext.getPool(); // Pre-claim ECX L1AHelper.requestRegister(eContext, ECX); // Load reference final RefItem ref = vstack.popRef(); ref.load(eContext); final Register refr = ref.getRegister(); // Allocate tmp registers final Register classr = requestRegister(JvmType.INT, false); final Register tmpr = requestRegister(JvmType.INT, false); /* Objectref is already on the stack */ writeResolveAndLoadClassToReg(classRef, classr); final Label trueLabel = new Label(this.curInstrLabel + "io-true"); final Label endLabel = new Label(this.curInstrLabel + "io-end"); /* Is instanceof? */ instanceOf(refr, classr, tmpr, trueLabel, false); /* Not instanceof */ //TODO: use setcc instead of jumps os.writeXOR(refr, refr); os.writeJMP(endLabel); os.setObjectRef(trueLabel); os.writeMOV_Const(refr, 1); // Push result os.setObjectRef(endLabel); final IntItem result = IntItem.createReg(refr); pool.transferOwnerTo(refr, result); vstack.push(result); // Release pool.release(classr); pool.release(tmpr); pool.release(ECX); }
12,909
public final void visit_instanceof(VmConstClass classRef) { // Prepare final X86RegisterPool pool = eContext.getPool(); // Pre-claim ECX requestRegister(ECX); // Load reference final RefItem ref = vstack.popRef(); ref.load(eContext); final Register refr = ref.getRegister(); // Allocate tmp registers final Register classr = requestRegister(JvmType.INT, false); final Register tmpr = requestRegister(JvmType.INT, false); /* Objectref is already on the stack */ writeResolveAndLoadClassToReg(classRef, classr); final Label trueLabel = new Label(this.curInstrLabel + "io-true"); final Label endLabel = new Label(this.curInstrLabel + "io-end"); /* Is instanceof? */ instanceOf(refr, classr, tmpr, trueLabel, false); /* Not instanceof */ //TODO: use setcc instead of jumps os.writeXOR(refr, refr); os.writeJMP(endLabel); os.setObjectRef(trueLabel); os.writeMOV_Const(refr, 1); // Push result os.setObjectRef(endLabel); final IntItem result = IntItem.createReg(refr); pool.transferOwnerTo(refr, result); vstack.push(result); // Release pool.release(classr); pool.release(tmpr); pool.release(ECX); }
public final void visit_instanceof(VmConstClass classRef) { // Prepare final X86RegisterPool pool = eContext.getPool(); // Pre-claim ECX requestRegister(ECX); // Load reference final RefItem ref = vstack.popRef(); ref.load(eContext); final Register refr = ref.getRegister(); // Allocate tmp registers final Register classr = requestRegister(JvmType.INT, false); final Register tmpr = requestRegister(JvmType.INT, false); /* Objectref is already on the stack */ writeResolveAndLoadClassToReg(classRef, classr); final Label trueLabel = new Label(this.curInstrLabel + "io-true"); final Label endLabel = new Label(this.curInstrLabel + "io-end"); /* Is instanceof? */ instanceOf(refr, classr, tmpr, trueLabel, false); /* Not instanceof */ //TODO: use setcc instead of jumps os.writeXOR(refr, refr); os.writeJMP(endLabel); os.setObjectRef(trueLabel); os.writeMOV_Const(refr, 1); // Push result os.setObjectRef(endLabel); final IntItem result = IntItem.createReg(refr); pool.transferOwnerTo(refr, result); vstack.push(result); // Release pool.release(classr); pool.release(tmpr); pool.release(ECX); }
12,910
public final void visit_invokevirtual(VmConstMethodRef methodRef) { //TODO: port to orp-style vstack.push(eContext); methodRef.resolve(loader); final VmMethod mts = methodRef.getResolvedVmMethod(); dropParameters(mts, true); if (mts.isStatic()) { throw new IncompatibleClassChangeError( "Static method in invokevirtual"); } final VmInstanceMethod method = (VmInstanceMethod) mts; final int tibIndex = method.getTibOffset(); final int argSlotCount = Signature.getArgSlotCount(methodRef .getSignature()); /* Get objectref -> S0 */ os.writeMOV(INTSIZE, S0, SP, argSlotCount * slotSize); /* Get VMT of objectef -> S0 */ os.writeMOV(INTSIZE, S0, S0, tibOffset); /* Get entry in VMT -> EAX */ os.writeMOV(INTSIZE, EAX, S0, arrayDataOffset + (tibIndex * slotSize)); /* Now invoke the method */ invokeJavaMethod(methodRef.getSignature()); // Result is already on the stack. }
public final void visit_invokevirtual(VmConstMethodRef methodRef) { //TODO: port to orp-style vstack.push(eContext); methodRef.resolve(loader); final VmMethod mts = methodRef.getResolvedVmMethod(); dropParameters(mts, true); if (mts.isStatic()) { throw new IncompatibleClassChangeError( "Static method in invokevirtual"); } final VmInstanceMethod method = (VmInstanceMethod) mts; final int tibIndex = method.getTibOffset(); final int argSlotCount = Signature.getArgSlotCount(methodRef .getSignature()); /* Get objectref -> S0 */ os.writeMOV(INTSIZE, S0, SP, argSlotCount * slotSize); /* Get VMT of objectef -> S0 */ os.writeMOV(INTSIZE, S0, S0, tibOffset); /* Get entry in VMT -> EAX */ os.writeMOV(INTSIZE, EAX, S0, arrayDataOffset + (tibIndex * slotSize)); /* Now invoke the method */ invokeJavaMethod(methodRef.getSignature()); // Result is already on the stack. }
12,911
public final void visit_invokevirtual(VmConstMethodRef methodRef) { //TODO: port to orp-style vstack.push(eContext); methodRef.resolve(loader); final VmMethod mts = methodRef.getResolvedVmMethod(); dropParameters(mts, true); if (mts.isStatic()) { throw new IncompatibleClassChangeError( "Static method in invokevirtual"); } final VmInstanceMethod method = (VmInstanceMethod) mts; final int tibIndex = method.getTibOffset(); final int argSlotCount = Signature.getArgSlotCount(methodRef .getSignature()); /* Get objectref -> S0 */ os.writeMOV(INTSIZE, S0, SP, argSlotCount * slotSize); /* Get VMT of objectef -> S0 */ os.writeMOV(INTSIZE, S0, S0, tibOffset); /* Get entry in VMT -> EAX */ os.writeMOV(INTSIZE, EAX, S0, arrayDataOffset + (tibIndex * slotSize)); /* Now invoke the method */ invokeJavaMethod(methodRef.getSignature()); // Result is already on the stack. }
public final void visit_invokevirtual(VmConstMethodRef methodRef) { //TODO: port to orp-style vstack.push(eContext); methodRef.resolve(loader); final VmMethod mts = methodRef.getResolvedVmMethod(); dropParameters(mts, true); if (mts.isStatic()) { throw new IncompatibleClassChangeError( "Static method in invokevirtual"); } final VmInstanceMethod method = (VmInstanceMethod) mts; final int tibIndex = method.getTibOffset(); final int argSlotCount = Signature.getArgSlotCount(methodRef .getSignature()); /* Get objectref -> S0 */ os.writeMOV(INTSIZE, S0, SP, argSlotCount * slotSize); /* Get VMT of objectef -> S0 */ os.writeMOV(INTSIZE, S0, S0, tibOffset); /* Get entry in VMT -> EAX */ os.writeMOV(INTSIZE, EAX, EAX, arrayDataOffset + (tibIndex * slotSize)); /* Now invoke the method */ invokeJavaMethod(methodRef.getSignature()); // Result is already on the stack. }
12,912
public final void visit_irem() { //TODO: port to orp-style vstack.push(eContext); IntItem v2 = vstack.popInt(); IntItem v1 = vstack.popInt(); v2.release1(eContext); v1.release1(eContext); vstack.push1(IntItem.createStack()); os.writePOP(S0); // Value2 os.writePOP(EAX); // Value1 os.writeCDQ(); os.writeIDIV_EAX(S0); // EAX = EDX:EAX / S0 os.writePUSH(EDX); // Remainder }
public final void visit_irem() { //TODO: port to orp-style vstack.push(eContext); IntItem v2 = vstack.popInt(); IntItem v1 = vstack.popInt(); v2.release1(eContext); v1.release1(eContext); vstack.push1(IntItem.createStack()); os.writePOP(S0); // Value2 os.writePOP(EAX); // Value1 os.writeCDQ(); os.writeIDIV_EAX(S0); // EAX = EDX:EAX / S0 os.writePUSH(EDX); // Remainder }
12,913
public final void visit_irem() { //TODO: port to orp-style vstack.push(eContext); IntItem v2 = vstack.popInt(); IntItem v1 = vstack.popInt(); v2.release1(eContext); v1.release1(eContext); vstack.push1(IntItem.createStack()); os.writePOP(S0); // Value2 os.writePOP(EAX); // Value1 os.writeCDQ(); os.writeIDIV_EAX(S0); // EAX = EDX:EAX / S0 os.writePUSH(EDX); // Remainder }
public final void visit_irem() { //TODO: port to orp-style vstack.push(eContext); IntItem v2 = vstack.popInt(); IntItem v1 = vstack.popInt(); v2.release1(eContext); v1.release1(eContext); vstack.push1(IntItem.createStack()); os.writePOP(S0); // Value2 os.writePOP(EAX); // Value1 os.writeCDQ(); os.writeIDIV_EAX(S0); // EAX = EDX:EAX / S0 os.writePUSH(EDX); // Remainder }
12,914
public final void visit_laload() { final IntItem idx = vstack.popInt(); final RefItem ref = vstack.popRef(); idx.load(eContext); ref.load(eContext); final Register idxr = idx.getRegister(); final Register refr = ref.getRegister(); checkBounds(refr, idxr); final DoubleWordItem result = requestDoubleWordRegisters(JvmType.LONG); os.writeLEA(refr, refr, idxr, 8, VmArray.DATA_OFFSET * 4); os.writeMOV(INTSIZE, result.getLsbRegister(), refr, 0); os.writeMOV(INTSIZE, result.getMsbRegister(), refr, 4); idx.release(eContext); ref.release(eContext); vstack.push(result); }
public final void visit_laload() { final IntItem idx = vstack.popInt(); final RefItem ref = vstack.popRef(); idx.load(eContext); ref.load(eContext); final Register idxr = idx.getRegister(); final Register refr = ref.getRegister(); checkBounds(refr, idxr); final DoubleWordItem result = requestDoubleWordRegisters(JvmType.LONG); os.writeLEA(refr, refr, idxr, 8, VmArray.DATA_OFFSET * 4); os.writeMOV(INTSIZE, result.getLsbRegister(), refr, 0); os.writeMOV(INTSIZE, result.getMsbRegister(), refr, 4); idx.release(eContext); ref.release(eContext); vstack.push(result); }
12,915
public final void visit_laload() { final IntItem idx = vstack.popInt(); final RefItem ref = vstack.popRef(); idx.load(eContext); ref.load(eContext); final Register idxr = idx.getRegister(); final Register refr = ref.getRegister(); checkBounds(refr, idxr); final DoubleWordItem result = requestDoubleWordRegisters(JvmType.LONG); os.writeLEA(refr, refr, idxr, 8, VmArray.DATA_OFFSET * 4); os.writeMOV(INTSIZE, result.getLsbRegister(), refr, 0); os.writeMOV(INTSIZE, result.getMsbRegister(), refr, 4); idx.release(eContext); ref.release(eContext); vstack.push(result); }
public final void visit_laload() { final IntItem idx = vstack.popInt(); final RefItem ref = vstack.popRef(); idx.load(eContext); ref.load(eContext); final Register idxr = idx.getRegister(); final Register refr = ref.getRegister(); checkBounds(refr, idxr); final DoubleWordItem result = requestDoubleWordRegisters(JvmType.LONG); os.writeLEA(refr, refr, idxr, 8, VmArray.DATA_OFFSET * 4); os.writeMOV(INTSIZE, result.getLsbRegister(), refr, 0); os.writeMOV(INTSIZE, result.getMsbRegister(), refr, 4); idx.release(eContext); ref.release(eContext); }
12,916
public final void visit_lcmp() { final LongItem v2 = vstack.popLong(); final LongItem v1 = vstack.popLong(); // Load v2.load(eContext); final Register v2_lsb = v2.getLsbRegister(); final Register v2_msb = v2.getMsbRegister(); v1.load(eContext); final Register v1_lsb = v1.getLsbRegister(); final Register v1_msb = v1.getMsbRegister(); // Claim result reg final IntItem result = (IntItem) requestWordRegister(JvmType.INT, false); final Register resr = result.getRegister(); final Label ltLabel = new Label(curInstrLabel + "lt"); final Label endLabel = new Label(curInstrLabel + "end"); // Calculate os.writeXOR(resr, resr); os.writeSUB(v1_lsb, v2_lsb); os.writeSBB(v1_msb, v2_msb); os.writeJCC(ltLabel, X86Constants.JL); // JL os.writeOR(v1_lsb, v1_msb); os.writeJCC(endLabel, X86Constants.JZ); // value1 == value2 /** GT */ os.writeINC(resr); os.writeJMP(endLabel); /** LT */ os.setObjectRef(ltLabel); os.writeDEC(resr); os.setObjectRef(endLabel); // Push vstack.push(result); // Release v1.release(eContext); v2.release(eContext); }
public final void visit_lcmp() { final LongItem v2 = vstack.popLong(); final LongItem v1 = vstack.popLong(); // Load v2.load(eContext); final Register v2_lsb = v2.getLsbRegister(); final Register v2_msb = v2.getMsbRegister(); v1.load(eContext); final Register v1_lsb = v1.getLsbRegister(); final Register v1_msb = v1.getMsbRegister(); // Claim result reg final IntItem result = (IntItem) L1AHelper.requestWordRegister( eContext, JvmType.INT, false); final Register resr = result.getRegister(); final Label ltLabel = new Label(curInstrLabel + "lt"); final Label endLabel = new Label(curInstrLabel + "end"); // Calculate os.writeXOR(resr, resr); os.writeSUB(v1_lsb, v2_lsb); os.writeSBB(v1_msb, v2_msb); os.writeJCC(ltLabel, X86Constants.JL); // JL os.writeOR(v1_lsb, v1_msb); os.writeJCC(endLabel, X86Constants.JZ); // value1 == value2 /** GT */ os.writeINC(resr); os.writeJMP(endLabel); /** LT */ os.setObjectRef(ltLabel); os.writeDEC(resr); os.setObjectRef(endLabel); // Push vstack.push(result); // Release v1.release(eContext); v2.release(eContext); }
12,917
public final void visit_lmul() { //TODO: port to orp-style vstack.push(eContext); final LongItem v2 = vstack.popLong(); final LongItem v1 = vstack.popLong(); v2.release1(eContext); v1.release1(eContext); writePOP64(Register.EBX, Register.ECX); // Value 2 final Register v2_lsb = Register.EBX; final Register v2_msb = Register.ECX; writePOP64(Register.ESI, Register.EDI); // Value 1 final Register v1_lsb = Register.ESI; final Register v1_msb = Register.EDI; final Label tmp1 = new Label(curInstrLabel + "$tmp1"); final Label tmp2 = new Label(curInstrLabel + "$tmp2"); os.writeMOV(INTSIZE, EAX, v1_msb); // hi2 os.writeOR(EAX, v2_msb); // hi1 | hi2 os.writeJCC(tmp1, X86Constants.JNZ); os.writeMOV(INTSIZE, EAX, v1_lsb); // lo2 os.writeMUL_EAX(v2_lsb); // lo1*lo2 os.writeJMP(tmp2); os.setObjectRef(tmp1); os.writeMOV(INTSIZE, EAX, v1_lsb); // lo2 os.writeMUL_EAX(v2_msb); // hi1*lo2 os.writeMOV(INTSIZE, v2_msb, EAX); os.writeMOV(INTSIZE, EAX, v1_msb); // hi2 os.writeMUL_EAX(v2_lsb); // hi2*lo1 os.writeADD(v2_msb, EAX); // hi2*lo1 + hi1*lo2 os.writeMOV(INTSIZE, EAX, v1_lsb); // lo2 os.writeMUL_EAX(v2_lsb); // lo1*lo2 os.writeADD(EDX, v2_msb); // hi2*lo1 + hi1*lo2 + // hi(lo1*lo2) os.setObjectRef(tmp2); // Reload the statics table, since it was destroyed here helper.writeLoadSTATICS(curInstrLabel, "lmul", false); // Push final LongItem result = (LongItem) requestDoubleWordRegisters( JvmType.LONG, EAX, EDX); vstack.push(result); }
public final void visit_lmul() { //TODO: port to orp-style vstack.push(eContext); final LongItem v2 = vstack.popLong(); final LongItem v1 = vstack.popLong(); v2.release1(eContext); v1.release1(eContext); writePOP64(Register.EBX, Register.ECX); // Value 2 final Register v2_lsb = Register.EBX; final Register v2_msb = Register.ECX; writePOP64(Register.ESI, Register.EDI); // Value 1 final Register v1_lsb = Register.ESI; final Register v1_msb = Register.EDI; final Label tmp1 = new Label(curInstrLabel + "$tmp1"); final Label tmp2 = new Label(curInstrLabel + "$tmp2"); os.writeMOV(INTSIZE, EAX, v1_msb); // hi2 os.writeOR(EAX, v2_msb); // hi1 | hi2 os.writeJCC(tmp1, X86Constants.JNZ); os.writeMOV(INTSIZE, EAX, v1_lsb); // lo2 os.writeMUL_EAX(v2_lsb); // lo1*lo2 os.writeJMP(tmp2); os.setObjectRef(tmp1); os.writeMOV(INTSIZE, EAX, v1_lsb); // lo2 os.writeMUL_EAX(v2_msb); // hi1*lo2 os.writeMOV(INTSIZE, v2_msb, EAX); os.writeMOV(INTSIZE, EAX, v1_msb); // hi2 os.writeMUL_EAX(v2_lsb); // hi2*lo1 os.writeADD(v2_msb, EAX); // hi2*lo1 + hi1*lo2 os.writeMOV(INTSIZE, EAX, v1_lsb); // lo2 os.writeMUL_EAX(v2_lsb); // lo1*lo2 os.writeADD(EDX, v2_msb); // hi2*lo1 + hi1*lo2 + // hi(lo1*lo2) os.setObjectRef(tmp2); // Reload the statics table, since it was destroyed here helper.writeLoadSTATICS(curInstrLabel, "lmul", false); // Push final LongItem result = (LongItem) requestDoubleWordRegisters( JvmType.LONG, EAX, EDX); vstack.push(result); }
12,918
public final void visit_lookupswitch(int defAddress, int[] matchValues, int[] addresses) { final int n = matchValues.length; //BootLog.debug("lookupswitch length=" + n); IntItem key = vstack.popInt(); key.load(eContext); Register r = key.getRegister(); // Conservative assumption, flush stack vstack.push(eContext); key.release(eContext); for (int i = 0; i < n; i++) { os.writeCMP_Const(r, matchValues[i]); os.writeJCC(helper.getInstrLabel(addresses[i]), X86Constants.JE); // JE } os.writeJMP(helper.getInstrLabel(defAddress)); }
public final void visit_lookupswitch(int defAddress, int[] matchValues, int[] addresses) { final int n = matchValues.length; //BootLog.debug("lookupswitch length=" + n); final IntItem key = vstack.popInt(); key.load(eContext); Register r = key.getRegister(); // Conservative assumption, flush stack vstack.push(eContext); key.release(eContext); for (int i = 0; i < n; i++) { os.writeCMP_Const(r, matchValues[i]); os.writeJCC(helper.getInstrLabel(addresses[i]), X86Constants.JE); // JE } os.writeJMP(helper.getInstrLabel(defAddress)); }
12,919
public final void visit_lookupswitch(int defAddress, int[] matchValues, int[] addresses) { final int n = matchValues.length; //BootLog.debug("lookupswitch length=" + n); IntItem key = vstack.popInt(); key.load(eContext); Register r = key.getRegister(); // Conservative assumption, flush stack vstack.push(eContext); key.release(eContext); for (int i = 0; i < n; i++) { os.writeCMP_Const(r, matchValues[i]); os.writeJCC(helper.getInstrLabel(addresses[i]), X86Constants.JE); // JE } os.writeJMP(helper.getInstrLabel(defAddress)); }
public final void visit_lookupswitch(int defAddress, int[] matchValues, int[] addresses) { final int n = matchValues.length; //BootLog.debug("lookupswitch length=" + n); IntItem key = vstack.popInt(); key.load(eContext); final Register keyr = key.getRegister(); // Conservative assumption, flush stack vstack.push(eContext); key.release(eContext); for (int i = 0; i < n; i++) { os.writeCMP_Const(r, matchValues[i]); os.writeJCC(helper.getInstrLabel(addresses[i]), X86Constants.JE); // JE } os.writeJMP(helper.getInstrLabel(defAddress)); }
12,920
public final void visit_lookupswitch(int defAddress, int[] matchValues, int[] addresses) { final int n = matchValues.length; //BootLog.debug("lookupswitch length=" + n); IntItem key = vstack.popInt(); key.load(eContext); Register r = key.getRegister(); // Conservative assumption, flush stack vstack.push(eContext); key.release(eContext); for (int i = 0; i < n; i++) { os.writeCMP_Const(r, matchValues[i]); os.writeJCC(helper.getInstrLabel(addresses[i]), X86Constants.JE); // JE } os.writeJMP(helper.getInstrLabel(defAddress)); }
public final void visit_lookupswitch(int defAddress, int[] matchValues, int[] addresses) { final int n = matchValues.length; //BootLog.debug("lookupswitch length=" + n); IntItem key = vstack.popInt(); key.load(eContext); Register r = key.getRegister(); // Conservative assumption, flush stack vstack.push(eContext); key.release(eContext); for (int i = 0; i < n; i++) { os.writeCMP_Const(keyr, matchValues[i]); os.writeJCC(helper.getInstrLabel(addresses[i]), X86Constants.JE); // JE } os.writeJMP(helper.getInstrLabel(defAddress)); }
12,921
public final void visit_lshl() { final IntItem v2 = vstack.popInt(); final LongItem v1 = vstack.popLong(); requestRegister(ECX, v2); v2.loadTo(eContext, ECX); v1.load(eContext); final Register v1_lsb = v1.getLsbRegister(); final Register v1_msb = v1.getMsbRegister(); os.writeAND(ECX, 63); os.writeCMP_Const(ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHLD_CL(v1_msb, v1_lsb); os.writeSHL_CL(v1_lsb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, v1_msb, v1_lsb); os.writeXOR(v1_lsb, v1_lsb); os.writeSHL_CL(v1_msb); os.setObjectRef(endLabel); // Release v2.release(eContext); vstack.push(v1); }
public final void visit_lshl() { final IntItem v2 = vstack.popInt(); final LongItem v1 = vstack.popLong(); L1AHelper.requestRegister(eContext, ECX, v2); v2.loadTo(eContext, ECX); v1.load(eContext); final Register v1_lsb = v1.getLsbRegister(); final Register v1_msb = v1.getMsbRegister(); os.writeAND(ECX, 63); os.writeCMP_Const(ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHLD_CL(v1_msb, v1_lsb); os.writeSHL_CL(v1_lsb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, v1_msb, v1_lsb); os.writeXOR(v1_lsb, v1_lsb); os.writeSHL_CL(v1_msb); os.setObjectRef(endLabel); // Release v2.release(eContext); vstack.push(v1); }
12,922
public final void visit_lshr() { final IntItem cnt = vstack.popInt(); final LongItem val = vstack.popLong(); final X86RegisterPool pool = eContext.getPool(); // Get cnt into ECX if (!cnt.uses(ECX)) { val.spillIfUsing(eContext, ECX); requestRegister(ECX, cnt); cnt.loadTo(eContext, ECX); } // Load val val.load(eContext); final Register lsb = val.getLsbRegister(); final Register msb = val.getMsbRegister(); // Calculate os.writeAND(ECX, 63); os.writeCMP_Const(ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHRD_CL(lsb, msb); os.writeSAR_CL(msb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, lsb, msb); os.writeSAR(msb, 31); os.writeSAR_CL(lsb); os.setObjectRef(endLabel); // Push final LongItem result = LongItem.createReg(lsb, msb); pool.transferOwnerTo(lsb, result); pool.transferOwnerTo(msb, result); vstack.push(result); // Release cnt.release(eContext); }
public final void visit_lshr() { final IntItem cnt = vstack.popInt(); final LongItem val = vstack.popLong(); final X86RegisterPool pool = eContext.getPool(); // Get cnt into ECX if (!cnt.uses(ECX)) { val.spillIfUsing(eContext, ECX); L1AHelper.requestRegister(eContext, ECX, cnt); cnt.loadTo(eContext, ECX); } // Load val val.load(eContext); final Register lsb = val.getLsbRegister(); final Register msb = val.getMsbRegister(); // Calculate os.writeAND(ECX, 63); os.writeCMP_Const(ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHRD_CL(lsb, msb); os.writeSAR_CL(msb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, lsb, msb); os.writeSAR(msb, 31); os.writeSAR_CL(lsb); os.setObjectRef(endLabel); // Push final LongItem result = LongItem.createReg(lsb, msb); pool.transferOwnerTo(lsb, result); pool.transferOwnerTo(msb, result); vstack.push(result); // Release cnt.release(eContext); }
12,923
public final void visit_lushr() { final IntItem cnt = vstack.popInt(); final LongItem val = vstack.popLong(); final X86RegisterPool pool = eContext.getPool(); // Get cnt into ECX if (!cnt.uses(ECX)) { val.spillIfUsing(eContext, ECX); requestRegister(ECX, cnt); cnt.loadTo(eContext, ECX); } // Load val val.load(eContext); final Register lsb = val.getLsbRegister(); final Register msb = val.getMsbRegister(); // Calculate os.writeAND(ECX, 63); os.writeCMP_Const(ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHRD_CL(lsb, msb); os.writeSHR_CL(msb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, lsb, msb); os.writeXOR(msb, msb); os.writeSHR_CL(lsb); os.setObjectRef(endLabel); // Push final LongItem result = LongItem.createReg(lsb, msb); pool.transferOwnerTo(lsb, result); pool.transferOwnerTo(msb, result); vstack.push(result); // Release cnt.release(eContext); }
public final void visit_lushr() { final IntItem cnt = vstack.popInt(); final LongItem val = vstack.popLong(); final X86RegisterPool pool = eContext.getPool(); // Get cnt into ECX if (!cnt.uses(ECX)) { val.spillIfUsing(eContext, ECX); L1AHelper.requestRegister(eContext, ECX, cnt); cnt.loadTo(eContext, ECX); } // Load val val.load(eContext); final Register lsb = val.getLsbRegister(); final Register msb = val.getMsbRegister(); // Calculate os.writeAND(ECX, 63); os.writeCMP_Const(ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHRD_CL(lsb, msb); os.writeSHR_CL(msb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, lsb, msb); os.writeXOR(msb, msb); os.writeSHR_CL(lsb); os.setObjectRef(endLabel); // Push final LongItem result = LongItem.createReg(lsb, msb); pool.transferOwnerTo(lsb, result); pool.transferOwnerTo(msb, result); vstack.push(result); // Release cnt.release(eContext); }
12,924
public final void visit_monitorenter() { vstack.push(eContext); RefItem v = vstack.popRef(); v.release1(eContext); // Objectref is already on the stack invokeJavaMethod(context.getMonitorEnterMethod()); }
public final void visit_monitorenter() { vstack.push(eContext); final RefItem v = vstack.popRef(); v.release1(eContext); // Objectref is already on the stack invokeJavaMethod(context.getMonitorEnterMethod()); }
12,925
public final void visit_monitorexit() { vstack.push(eContext); RefItem v = vstack.popRef(); v.release1(eContext); // Objectref is already on the stack invokeJavaMethod(context.getMonitorExitMethod()); }
public final void visit_monitorexit() { vstack.push(eContext); final RefItem v = vstack.popRef(); v.release1(eContext); // Objectref is already on the stack invokeJavaMethod(context.getMonitorExitMethod()); }
12,926
public final void visit_multianewarray(VmConstClass clazz, int dimensions) { // flush all vstack items to the stack // all registers are freed vstack.push(eContext); // Create the dimensions array os.writePUSH(10); /* type=int */ os.writePUSH(dimensions); /* elements */ invokeJavaMethod(context.getAllocPrimitiveArrayMethod()); final RefItem dims = vstack.popRef(); final Register dimsr = dims.getRegister(); // Dimension array is now in S1 // Pop all dimensions (note the reverse order that allocMultiArray // expects) for (int i = 0; i < dimensions; i++) { final int ofs = arrayDataOffset + (i * slotSize); final IntItem v = vstack.popInt(); v.release1(eContext); os.writePOP(dimsr, ofs); } // Allocate tmp register final Register classr = requestRegister(JvmType.REFERENCE, false); // Resolve the array class writeResolveAndLoadClassToReg(clazz, classr); // Release dims, because invokeJavaMethod needs EAX dims.release(eContext); // Now call the multianewarrayhelper os.writePUSH(classr); // array-class os.writePUSH(dimsr); // dimensions[] invokeJavaMethod(context.getAllocMultiArrayMethod()); // Result is now on the vstack // Release releaseRegister(classr); }
public final void visit_multianewarray(VmConstClass clazz, int dimensions) { // flush all vstack items to the stack // all registers are freed vstack.push(eContext); // Create the dimensions array os.writePUSH(10); /* type=int */ os.writePUSH(dimensions); /* elements */ invokeJavaMethod(context.getAllocPrimitiveArrayMethod()); final RefItem dims = vstack.popRef(); final Register dimsr = dims.getRegister(); // Dimension array is now in S1 // Pop all dimensions (note the reverse order that allocMultiArray // expects) for (int i = 0; i < dimensions; i++) { final int ofs = arrayDataOffset + (i * slotSize); final IntItem v = vstack.popInt(); v.release1(eContext); os.writePOP(dimsr, ofs); } // Allocate tmp register final Register classr = L1AHelper.requestRegister(eContext, JvmType.REFERENCE, false); // Resolve the array class writeResolveAndLoadClassToReg(clazz, classr); // Release dims, because invokeJavaMethod needs EAX dims.release(eContext); // Now call the multianewarrayhelper os.writePUSH(classr); // array-class os.writePUSH(dimsr); // dimensions[] invokeJavaMethod(context.getAllocMultiArrayMethod()); // Result is now on the vstack // Release releaseRegister(classr); }
12,927
public final void visit_multianewarray(VmConstClass clazz, int dimensions) { // flush all vstack items to the stack // all registers are freed vstack.push(eContext); // Create the dimensions array os.writePUSH(10); /* type=int */ os.writePUSH(dimensions); /* elements */ invokeJavaMethod(context.getAllocPrimitiveArrayMethod()); final RefItem dims = vstack.popRef(); final Register dimsr = dims.getRegister(); // Dimension array is now in S1 // Pop all dimensions (note the reverse order that allocMultiArray // expects) for (int i = 0; i < dimensions; i++) { final int ofs = arrayDataOffset + (i * slotSize); final IntItem v = vstack.popInt(); v.release1(eContext); os.writePOP(dimsr, ofs); } // Allocate tmp register final Register classr = requestRegister(JvmType.REFERENCE, false); // Resolve the array class writeResolveAndLoadClassToReg(clazz, classr); // Release dims, because invokeJavaMethod needs EAX dims.release(eContext); // Now call the multianewarrayhelper os.writePUSH(classr); // array-class os.writePUSH(dimsr); // dimensions[] invokeJavaMethod(context.getAllocMultiArrayMethod()); // Result is now on the vstack // Release releaseRegister(classr); }
public final void visit_multianewarray(VmConstClass clazz, int dimensions) { // flush all vstack items to the stack // all registers are freed vstack.push(eContext); // Create the dimensions array os.writePUSH(10); /* type=int */ os.writePUSH(dimensions); /* elements */ invokeJavaMethod(context.getAllocPrimitiveArrayMethod()); final RefItem dims = vstack.popRef(); final Register dimsr = dims.getRegister(); // Dimension array is now in S1 // Pop all dimensions (note the reverse order that allocMultiArray // expects) for (int i = 0; i < dimensions; i++) { final int ofs = arrayDataOffset + (i * slotSize); final IntItem v = vstack.popInt(); v.release1(eContext); os.writePOP(dimsr, ofs); } // Allocate tmp register final Register classr = requestRegister(JvmType.REFERENCE, false); // Resolve the array class writeResolveAndLoadClassToReg(clazz, classr); // Release dims, because invokeJavaMethod needs EAX dims.release(eContext); // Now call the multianewarrayhelper os.writePUSH(classr); // array-class os.writePUSH(dimsr); // dimensions[] invokeJavaMethod(context.getAllocMultiArrayMethod()); // Result is now on the vstack // Release L1AHelper.releaseRegister(eContext, classr); }
12,928