bugged
stringlengths 6
599k
| fixed
stringlengths 10
599k
| __index_level_0__
int64 0
1.13M
|
|---|---|---|
protected ImageReaderWriterSpi() { }
|
public ImageReaderWriterSpi() { }
| 11,353
|
public static AlgorithmParameterGenerator getInstance(String algorithm) throws NoSuchAlgorithmException { Provider[] p = Security.getProviders(); for (int i = 0; i < p.length; i++) { String classname = p[i].getProperty("AlgorithmParameterGenerator." + algorithm); if (classname != null) return getInstance(classname, algorithm, p[i]); } throw new NoSuchAlgorithmException(algorithm); }
|
public static AlgorithmParameterGenerator getInstance(String algorithm) throws NoSuchAlgorithmException { Provider[] p = Security.getProviders(); for (int i = 0; i < p.length; i++) { String classname = p[i].getProperty("AlgorithmParameterGenerator." + algorithm); if (classname != null) return getInstance(classname, algorithm, p[i]); } throw new NoSuchAlgorithmException(algorithm); }
| 11,354
|
protected Tag(String id) { this.id = id; }
|
protected Tag(String id) { name = id; flags = 0; }
| 11,356
|
public UnknownTag(String id) { super(id); }
|
public UnknownTag(String name) { super(id); }
| 11,357
|
public UnknownTag(String id) { super(id); }
|
public UnknownTag(String id) { super(name); }
| 11,358
|
private int findClosestTick(int value) { int min = slider.getMinimum(); int max = slider.getMaximum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); // The default value to return is value + minor or // value + major. // Initializing at min - value leaves us with a default // return value of min, which always has tick marks // (if ticks are painted). int minor = min - value; int major = min - value; // If there are no major tick marks or minor tick marks // e.g. snap is set to true but no ticks are set, then // we can just return the value. if (majorSpace <= 0 && minorSpace <= 0) return value; // First check the major ticks. if (majorSpace > 0) { int lowerBound = (value - min) / majorSpace; int majLower = majorSpace * lowerBound + min; int majHigher = majorSpace * (lowerBound + 1) + min; if (majHigher <= max && majHigher - value <= value - majLower) major = majHigher - value; else major = majLower - value; } if (minorSpace > 0) { int lowerBound = value / minorSpace; int minLower = minorSpace * lowerBound; int minHigher = minorSpace * (lowerBound + 1); if (minHigher <= max && minHigher - value <= value - minLower) minor = minHigher - value; else minor = minLower - value; } // Give preference to minor ticks if (Math.abs(minor) > Math.abs(major)) return value + major; else return value + minor; }
|
int findClosestTick(int value) { int min = slider.getMinimum(); int max = slider.getMaximum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); // The default value to return is value + minor or // value + major. // Initializing at min - value leaves us with a default // return value of min, which always has tick marks // (if ticks are painted). int minor = min - value; int major = min - value; // If there are no major tick marks or minor tick marks // e.g. snap is set to true but no ticks are set, then // we can just return the value. if (majorSpace <= 0 && minorSpace <= 0) return value; // First check the major ticks. if (majorSpace > 0) { int lowerBound = (value - min) / majorSpace; int majLower = majorSpace * lowerBound + min; int majHigher = majorSpace * (lowerBound + 1) + min; if (majHigher <= max && majHigher - value <= value - majLower) major = majHigher - value; else major = majLower - value; } if (minorSpace > 0) { int lowerBound = value / minorSpace; int minLower = minorSpace * lowerBound; int minHigher = minorSpace * (lowerBound + 1); if (minHigher <= max && minHigher - value <= value - minLower) minor = minHigher - value; else minor = minLower - value; } // Give preference to minor ticks if (Math.abs(minor) > Math.abs(major)) return value + major; else return value + minor; }
| 11,360
|
public boolean isShowing() { boolean retVal = false; if (SwingButtonPeer.this.awtComponent != null) retVal = SwingButtonPeer.this.awtComponent.isShowing(); return retVal; }
|
public boolean isShowing() { boolean retVal = false; if (SwingButtonPeer.this.awtComponent != null) retVal = SwingButtonPeer.this.awtComponent.isShowing(); return retVal; }
| 11,361
|
public SwingButtonPeer(Button theButton) { SwingButton button = new SwingButton(); button.setText(theButton.getLabel()); button.addActionListener(new SwingButtonListener()); init(theButton, button); }
|
public SwingButtonPeer(Button theButton) { SwingButton button = new SwingButton(theButton); button.setText(theButton.getLabel()); button.addActionListener(new SwingButtonListener()); init(theButton, button); }
| 11,362
|
protected synchronized void computeTime() { int millisInDay = 0; int era = fields[ERA]; int year = fields[YEAR]; int month = fields[MONTH]; int day = fields[DAY_OF_MONTH]; int minute = fields[MINUTE]; int second = fields[SECOND]; int millis = fields[MILLISECOND]; int[] month_days = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; int[] dayCount = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; int hour = 0; if (! isLenient()) nonLeniencyCheck(); if (! isSet[MONTH]) { // 5: YEAR + DAY_OF_WEEK + WEEK_OF_YEAR if (isSet[DAY_OF_WEEK] || isSet[WEEK_OF_YEAR]) { int first = getFirstDayOfMonth(year, 0); int offs; if ((8 - first) >= getMinimalDaysInFirstWeek()) // start counting on first week offs = 1; else offs = 1 + (8 - first); month = 0; day = offs + 7 * (fields[WEEK_OF_YEAR] - 1); day += fields[DAY_OF_WEEK] - first; } else { // 4: YEAR + DAY_OF_YEAR month = 0; day = fields[DAY_OF_YEAR]; } } else { if (isSet[DAY_OF_WEEK]) { int first = getFirstDayOfMonth(year, month); // 3: YEAR + MONTH + DAY_OF_WEEK_IN_MONTH + DAY_OF_WEEK if (isSet[DAY_OF_WEEK_IN_MONTH]) { int offs = fields[DAY_OF_WEEK] - first; if (offs < 0) offs += 7; day = 1 + 7 * (fields[DAY_OF_WEEK_IN_MONTH] - 1); day += offs; } else { // 2: YEAR + MONTH + WEEK_OF_MONTH + DAY_OF_WEEK day = 1 + 7 * (fields[WEEK_OF_MONTH] - 1); day += fields[DAY_OF_WEEK] - first; } } // 1: YEAR + MONTH + DAY_OF_MONTH } if (era == BC && year > 0) year = 1 - year; // rest of code assumes day/month/year set // should negative BC years be AD? // get the hour (but no check for validity) if (isSet[HOUR_OF_DAY]) hour = fields[HOUR_OF_DAY]; else if (isSet[HOUR]) { hour = fields[HOUR]; if (isSet[AM_PM] && fields[AM_PM] == PM) if (hour != 12) /* not Noon */ hour += 12; /* Fix the problem of the status of 12:00 AM (midnight). */ if (isSet[AM_PM] && fields[AM_PM] == AM && hour == 12) hour = 0; } // Read the era,year,month,day fields and convert as appropriate. // Calculate number of milliseconds into the day // This takes care of both h, m, s, ms over/underflows. long allMillis = (((hour * 60L) + minute) * 60L + second) * 1000L + millis; day += allMillis / (24 * 60 * 60 * 1000L); millisInDay = (int) (allMillis % (24 * 60 * 60 * 1000L)); if (month < 0) { year += (int) month / 12; month = month % 12; if (month < 0) { month += 12; year--; } } if (month > 11) { year += (month / 12); month = month % 12; } month_days[1] = isLeapYear(year) ? 29 : 28; while (day <= 0) { if (month == 0) { year--; month_days[1] = isLeapYear(year) ? 29 : 28; } month = (month + 11) % 12; day += month_days[month]; } while (day > month_days[month]) { day -= (month_days[month]); month = (month + 1) % 12; if (month == 0) { year++; month_days[1] = isLeapYear(year) ? 29 : 28; } } // ok, by here we have valid day,month,year,era and millisinday int dayOfYear = dayCount[month] + day - 1; // (day starts on 1) if (isLeapYear(year) && month > 1) dayOfYear++; int relativeDay = (year - 1) * 365 + ((year - 1) >> 2) + dayOfYear - EPOCH_DAYS; // gregorian days from 1 to epoch. int gregFactor = (int) Math.floor((double) (year - 1) / 400.) - (int) Math.floor((double) (year - 1) / 100.); if ((relativeDay + gregFactor) * 60L * 60L * 24L * 1000L >= gregorianCutover) relativeDay += gregFactor; else relativeDay -= 2; time = relativeDay * (24 * 60 * 60 * 1000L) + millisInDay; // the epoch was a Thursday. int weekday = (int) (relativeDay + THURSDAY) % 7; if (weekday <= 0) weekday += 7; fields[DAY_OF_WEEK] = weekday; TimeZone zone = getTimeZone(); int rawOffset = zone.getRawOffset(); int dstOffset = zone.getOffset((year < 1) ? BC : AD, (year < 1) ? 1 - year : year, month, day, weekday, millisInDay) - zone.getRawOffset(); time -= (rawOffset + dstOffset); isTimeSet = true; }
|
protected synchronized void computeTime() { int millisInDay = 0; int era = fields[ERA]; int year = fields[YEAR]; int month = fields[MONTH]; int day = fields[DAY_OF_MONTH]; int minute = fields[MINUTE]; int second = fields[SECOND]; int millis = fields[MILLISECOND]; int[] month_days = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; int[] dayCount = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; int hour = 0; if (! isLenient()) nonLeniencyCheck(); if (! isSet[MONTH]) { // 5: YEAR + DAY_OF_WEEK + WEEK_OF_YEAR if (isSet[DAY_OF_WEEK] || isSet[WEEK_OF_YEAR]) { int first = getFirstDayOfMonth(year, 0); int offs; if ((8 - first) >= getMinimalDaysInFirstWeek()) // start counting on first week offs = 1; else offs = 1 + (8 - first); month = 0; day = offs + 7 * (fields[WEEK_OF_YEAR] - 1); day += fields[DAY_OF_WEEK] - first; } else { // 4: YEAR + DAY_OF_YEAR month = 0; day = fields[DAY_OF_YEAR]; } } else { if (isSet[DAY_OF_WEEK]) { int first = getFirstDayOfMonth(year, month); // 3: YEAR + MONTH + DAY_OF_WEEK_IN_MONTH + DAY_OF_WEEK if (isSet[DAY_OF_WEEK_IN_MONTH]) { int offs = fields[DAY_OF_WEEK] - first; if (offs < 0) offs += 7; day = 1 + 7 * (fields[DAY_OF_WEEK_IN_MONTH] - 1); day += offs; } else { // 2: YEAR + MONTH + WEEK_OF_MONTH + DAY_OF_WEEK day = 1 + 7 * (fields[WEEK_OF_MONTH] - 1); day += fields[DAY_OF_WEEK] - first; } } // 1: YEAR + MONTH + DAY_OF_MONTH } if (era == BC && year > 0) year = 1 - year; // rest of code assumes day/month/year set // should negative BC years be AD? // get the hour (but no check for validity) if (isSet[HOUR_OF_DAY]) hour = fields[HOUR_OF_DAY]; else if (isSet[HOUR]) { hour = fields[HOUR]; if (isSet[AM_PM] && fields[AM_PM] == PM) if (hour != 12) /* not Noon */ hour += 12; /* Fix the problem of the status of 12:00 AM (midnight). */ if (isSet[AM_PM] && fields[AM_PM] == AM && hour == 12) hour = 0; } // Read the era,year,month,day fields and convert as appropriate. // Calculate number of milliseconds into the day // This takes care of both h, m, s, ms over/underflows. long allMillis = (((hour * 60L) + minute) * 60L + second) * 1000L + millis; day += allMillis / (24 * 60 * 60 * 1000L); millisInDay = (int) (allMillis % (24 * 60 * 60 * 1000L)); if (month < 0) { year += (int) month / 12; month = month % 12; if (month < 0) { month += 12; year--; } } if (month > 11) { year += (month / 12); month = month % 12; } month_days[1] = isLeapYear(year) ? 29 : 28; while (day <= 0) { if (month == 0) { year--; month_days[1] = isLeapYear(year) ? 29 : 28; } month = (month + 11) % 12; day += month_days[month]; } while (day > month_days[month]) { day -= (month_days[month]); month = (month + 1) % 12; if (month == 0) { year++; month_days[1] = isLeapYear(year) ? 29 : 28; } } // ok, by here we have valid day,month,year,era and millisinday int dayOfYear = dayCount[month] + day - 1; // (day starts on 1) if (isLeapYear(year) && month > 1) dayOfYear++; int relativeDay = (year - 1) * 365 + ((year - 1) >> 2) + dayOfYear - EPOCH_DAYS; // gregorian days from 1 to epoch. int gregFactor = (int) Math.floor((double) (year - 1) / 400.) - (int) Math.floor((double) (year - 1) / 100.); if ((relativeDay + gregFactor) * 60L * 60L * 24L * 1000L >= gregorianCutover) relativeDay += gregFactor; else relativeDay -= 2; time = relativeDay * (24 * 60 * 60 * 1000L) + millisInDay; // the epoch was a Thursday. int weekday = (int) (relativeDay + THURSDAY) % 7; if (weekday <= 0) weekday += 7; fields[DAY_OF_WEEK] = weekday; TimeZone zone = getTimeZone(); int rawOffset = zone.getRawOffset(); int dstOffset = zone.getOffset((year < 1) ? BC : AD, (year < 1) ? 1 - year : year, month, day, weekday, millisInDay) - zone.getRawOffset(); time -= (rawOffset + dstOffset); isTimeSet = true; }
| 11,363
|
protected synchronized void computeTime() { int millisInDay = 0; int era = fields[ERA]; int year = fields[YEAR]; int month = fields[MONTH]; int day = fields[DAY_OF_MONTH]; int minute = fields[MINUTE]; int second = fields[SECOND]; int millis = fields[MILLISECOND]; int[] month_days = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; int[] dayCount = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; int hour = 0; if (! isLenient()) nonLeniencyCheck(); if (! isSet[MONTH]) { // 5: YEAR + DAY_OF_WEEK + WEEK_OF_YEAR if (isSet[DAY_OF_WEEK] || isSet[WEEK_OF_YEAR]) { int first = getFirstDayOfMonth(year, 0); int offs; if ((8 - first) >= getMinimalDaysInFirstWeek()) // start counting on first week offs = 1; else offs = 1 + (8 - first); month = 0; day = offs + 7 * (fields[WEEK_OF_YEAR] - 1); day += fields[DAY_OF_WEEK] - first; } else { // 4: YEAR + DAY_OF_YEAR month = 0; day = fields[DAY_OF_YEAR]; } } else { if (isSet[DAY_OF_WEEK]) { int first = getFirstDayOfMonth(year, month); // 3: YEAR + MONTH + DAY_OF_WEEK_IN_MONTH + DAY_OF_WEEK if (isSet[DAY_OF_WEEK_IN_MONTH]) { int offs = fields[DAY_OF_WEEK] - first; if (offs < 0) offs += 7; day = 1 + 7 * (fields[DAY_OF_WEEK_IN_MONTH] - 1); day += offs; } else { // 2: YEAR + MONTH + WEEK_OF_MONTH + DAY_OF_WEEK day = 1 + 7 * (fields[WEEK_OF_MONTH] - 1); day += fields[DAY_OF_WEEK] - first; } } // 1: YEAR + MONTH + DAY_OF_MONTH } if (era == BC && year > 0) year = 1 - year; // rest of code assumes day/month/year set // should negative BC years be AD? // get the hour (but no check for validity) if (isSet[HOUR_OF_DAY]) hour = fields[HOUR_OF_DAY]; else if (isSet[HOUR]) { hour = fields[HOUR]; if (isSet[AM_PM] && fields[AM_PM] == PM) if (hour != 12) /* not Noon */ hour += 12; /* Fix the problem of the status of 12:00 AM (midnight). */ if (isSet[AM_PM] && fields[AM_PM] == AM && hour == 12) hour = 0; } // Read the era,year,month,day fields and convert as appropriate. // Calculate number of milliseconds into the day // This takes care of both h, m, s, ms over/underflows. long allMillis = (((hour * 60L) + minute) * 60L + second) * 1000L + millis; day += allMillis / (24 * 60 * 60 * 1000L); millisInDay = (int) (allMillis % (24 * 60 * 60 * 1000L)); if (month < 0) { year += (int) month / 12; month = month % 12; if (month < 0) { month += 12; year--; } } if (month > 11) { year += (month / 12); month = month % 12; } month_days[1] = isLeapYear(year) ? 29 : 28; while (day <= 0) { if (month == 0) { year--; month_days[1] = isLeapYear(year) ? 29 : 28; } month = (month + 11) % 12; day += month_days[month]; } while (day > month_days[month]) { day -= (month_days[month]); month = (month + 1) % 12; if (month == 0) { year++; month_days[1] = isLeapYear(year) ? 29 : 28; } } // ok, by here we have valid day,month,year,era and millisinday int dayOfYear = dayCount[month] + day - 1; // (day starts on 1) if (isLeapYear(year) && month > 1) dayOfYear++; int relativeDay = (year - 1) * 365 + ((year - 1) >> 2) + dayOfYear - EPOCH_DAYS; // gregorian days from 1 to epoch. int gregFactor = (int) Math.floor((double) (year - 1) / 400.) - (int) Math.floor((double) (year - 1) / 100.); if ((relativeDay + gregFactor) * 60L * 60L * 24L * 1000L >= gregorianCutover) relativeDay += gregFactor; else relativeDay -= 2; time = relativeDay * (24 * 60 * 60 * 1000L) + millisInDay; // the epoch was a Thursday. int weekday = (int) (relativeDay + THURSDAY) % 7; if (weekday <= 0) weekday += 7; fields[DAY_OF_WEEK] = weekday; TimeZone zone = getTimeZone(); int rawOffset = zone.getRawOffset(); int dstOffset = zone.getOffset((year < 1) ? BC : AD, (year < 1) ? 1 - year : year, month, day, weekday, millisInDay) - zone.getRawOffset(); time -= (rawOffset + dstOffset); isTimeSet = true; }
|
protected synchronized void computeTime() { int millisInDay = 0; int era = fields[ERA]; int year = fields[YEAR]; int month = fields[MONTH]; int day = fields[DAY_OF_MONTH]; int minute = fields[MINUTE]; int second = fields[SECOND]; int millis = fields[MILLISECOND]; int[] month_days = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; int[] dayCount = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; int hour = 0; if (! isLenient()) nonLeniencyCheck(); if (! isSet[MONTH]) { // 5: YEAR + DAY_OF_WEEK + WEEK_OF_YEAR if (isSet[DAY_OF_WEEK] || isSet[WEEK_OF_YEAR]) { int first = getFirstDayOfMonth(year, 0); int offs; if ((8 - first) >= getMinimalDaysInFirstWeek()) // start counting on first week offs = 1; else offs = 1 + (8 - first); month = 0; day = offs + 7 * (fields[WEEK_OF_YEAR] - 1); day += fields[DAY_OF_WEEK] - first; } else { // 4: YEAR + DAY_OF_YEAR month = 0; day = fields[DAY_OF_YEAR]; } } else { if (isSet[DAY_OF_WEEK]) { int first = getFirstDayOfMonth(year, month); // 3: YEAR + MONTH + DAY_OF_WEEK_IN_MONTH + DAY_OF_WEEK if (isSet[DAY_OF_WEEK_IN_MONTH]) { int offs = fields[DAY_OF_WEEK] - first; if (offs < 0) offs += 7; day = 1 + 7 * (fields[DAY_OF_WEEK_IN_MONTH] - 1); day += offs; } else { // 2: YEAR + MONTH + WEEK_OF_MONTH + DAY_OF_WEEK day = 1 + 7 * (fields[WEEK_OF_MONTH] - 1); day += fields[DAY_OF_WEEK] - first; } } // 1: YEAR + MONTH + DAY_OF_MONTH } if (era == BC && year > 0) year = 1 - year; // rest of code assumes day/month/year set // should negative BC years be AD? // get the hour (but no check for validity) if (isSet[HOUR_OF_DAY]) hour = fields[HOUR_OF_DAY]; else if (isSet[HOUR]) { hour = fields[HOUR]; if (fields[AM_PM] == PM) if (hour != 12) /* not Noon */ hour += 12; /* Fix the problem of the status of 12:00 AM (midnight). */ if (isSet[AM_PM] && fields[AM_PM] == AM && hour == 12) hour = 0; } // Read the era,year,month,day fields and convert as appropriate. // Calculate number of milliseconds into the day // This takes care of both h, m, s, ms over/underflows. long allMillis = (((hour * 60L) + minute) * 60L + second) * 1000L + millis; day += allMillis / (24 * 60 * 60 * 1000L); millisInDay = (int) (allMillis % (24 * 60 * 60 * 1000L)); if (month < 0) { year += (int) month / 12; month = month % 12; if (month < 0) { month += 12; year--; } } if (month > 11) { year += (month / 12); month = month % 12; } month_days[1] = isLeapYear(year) ? 29 : 28; while (day <= 0) { if (month == 0) { year--; month_days[1] = isLeapYear(year) ? 29 : 28; } month = (month + 11) % 12; day += month_days[month]; } while (day > month_days[month]) { day -= (month_days[month]); month = (month + 1) % 12; if (month == 0) { year++; month_days[1] = isLeapYear(year) ? 29 : 28; } } // ok, by here we have valid day,month,year,era and millisinday int dayOfYear = dayCount[month] + day - 1; // (day starts on 1) if (isLeapYear(year) && month > 1) dayOfYear++; int relativeDay = (year - 1) * 365 + ((year - 1) >> 2) + dayOfYear - EPOCH_DAYS; // gregorian days from 1 to epoch. int gregFactor = (int) Math.floor((double) (year - 1) / 400.) - (int) Math.floor((double) (year - 1) / 100.); if ((relativeDay + gregFactor) * 60L * 60L * 24L * 1000L >= gregorianCutover) relativeDay += gregFactor; else relativeDay -= 2; time = relativeDay * (24 * 60 * 60 * 1000L) + millisInDay; // the epoch was a Thursday. int weekday = (int) (relativeDay + THURSDAY) % 7; if (weekday <= 0) weekday += 7; fields[DAY_OF_WEEK] = weekday; TimeZone zone = getTimeZone(); int rawOffset = zone.getRawOffset(); int dstOffset = zone.getOffset((year < 1) ? BC : AD, (year < 1) ? 1 - year : year, month, day, weekday, millisInDay) - zone.getRawOffset(); time -= (rawOffset + dstOffset); isTimeSet = true; }
| 11,364
|
protected synchronized void computeTime() { int millisInDay = 0; int era = fields[ERA]; int year = fields[YEAR]; int month = fields[MONTH]; int day = fields[DAY_OF_MONTH]; int minute = fields[MINUTE]; int second = fields[SECOND]; int millis = fields[MILLISECOND]; int[] month_days = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; int[] dayCount = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; int hour = 0; if (! isLenient()) nonLeniencyCheck(); if (! isSet[MONTH]) { // 5: YEAR + DAY_OF_WEEK + WEEK_OF_YEAR if (isSet[DAY_OF_WEEK] || isSet[WEEK_OF_YEAR]) { int first = getFirstDayOfMonth(year, 0); int offs; if ((8 - first) >= getMinimalDaysInFirstWeek()) // start counting on first week offs = 1; else offs = 1 + (8 - first); month = 0; day = offs + 7 * (fields[WEEK_OF_YEAR] - 1); day += fields[DAY_OF_WEEK] - first; } else { // 4: YEAR + DAY_OF_YEAR month = 0; day = fields[DAY_OF_YEAR]; } } else { if (isSet[DAY_OF_WEEK]) { int first = getFirstDayOfMonth(year, month); // 3: YEAR + MONTH + DAY_OF_WEEK_IN_MONTH + DAY_OF_WEEK if (isSet[DAY_OF_WEEK_IN_MONTH]) { int offs = fields[DAY_OF_WEEK] - first; if (offs < 0) offs += 7; day = 1 + 7 * (fields[DAY_OF_WEEK_IN_MONTH] - 1); day += offs; } else { // 2: YEAR + MONTH + WEEK_OF_MONTH + DAY_OF_WEEK day = 1 + 7 * (fields[WEEK_OF_MONTH] - 1); day += fields[DAY_OF_WEEK] - first; } } // 1: YEAR + MONTH + DAY_OF_MONTH } if (era == BC && year > 0) year = 1 - year; // rest of code assumes day/month/year set // should negative BC years be AD? // get the hour (but no check for validity) if (isSet[HOUR_OF_DAY]) hour = fields[HOUR_OF_DAY]; else if (isSet[HOUR]) { hour = fields[HOUR]; if (isSet[AM_PM] && fields[AM_PM] == PM) if (hour != 12) /* not Noon */ hour += 12; /* Fix the problem of the status of 12:00 AM (midnight). */ if (isSet[AM_PM] && fields[AM_PM] == AM && hour == 12) hour = 0; } // Read the era,year,month,day fields and convert as appropriate. // Calculate number of milliseconds into the day // This takes care of both h, m, s, ms over/underflows. long allMillis = (((hour * 60L) + minute) * 60L + second) * 1000L + millis; day += allMillis / (24 * 60 * 60 * 1000L); millisInDay = (int) (allMillis % (24 * 60 * 60 * 1000L)); if (month < 0) { year += (int) month / 12; month = month % 12; if (month < 0) { month += 12; year--; } } if (month > 11) { year += (month / 12); month = month % 12; } month_days[1] = isLeapYear(year) ? 29 : 28; while (day <= 0) { if (month == 0) { year--; month_days[1] = isLeapYear(year) ? 29 : 28; } month = (month + 11) % 12; day += month_days[month]; } while (day > month_days[month]) { day -= (month_days[month]); month = (month + 1) % 12; if (month == 0) { year++; month_days[1] = isLeapYear(year) ? 29 : 28; } } // ok, by here we have valid day,month,year,era and millisinday int dayOfYear = dayCount[month] + day - 1; // (day starts on 1) if (isLeapYear(year) && month > 1) dayOfYear++; int relativeDay = (year - 1) * 365 + ((year - 1) >> 2) + dayOfYear - EPOCH_DAYS; // gregorian days from 1 to epoch. int gregFactor = (int) Math.floor((double) (year - 1) / 400.) - (int) Math.floor((double) (year - 1) / 100.); if ((relativeDay + gregFactor) * 60L * 60L * 24L * 1000L >= gregorianCutover) relativeDay += gregFactor; else relativeDay -= 2; time = relativeDay * (24 * 60 * 60 * 1000L) + millisInDay; // the epoch was a Thursday. int weekday = (int) (relativeDay + THURSDAY) % 7; if (weekday <= 0) weekday += 7; fields[DAY_OF_WEEK] = weekday; TimeZone zone = getTimeZone(); int rawOffset = zone.getRawOffset(); int dstOffset = zone.getOffset((year < 1) ? BC : AD, (year < 1) ? 1 - year : year, month, day, weekday, millisInDay) - zone.getRawOffset(); time -= (rawOffset + dstOffset); isTimeSet = true; }
|
protected synchronized void computeTime() { int millisInDay = 0; int era = fields[ERA]; int year = fields[YEAR]; int month = fields[MONTH]; int day = fields[DAY_OF_MONTH]; int minute = fields[MINUTE]; int second = fields[SECOND]; int millis = fields[MILLISECOND]; int[] month_days = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; int[] dayCount = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; int hour = 0; if (! isLenient()) nonLeniencyCheck(); if (! isSet[MONTH]) { // 5: YEAR + DAY_OF_WEEK + WEEK_OF_YEAR if (isSet[DAY_OF_WEEK] || isSet[WEEK_OF_YEAR]) { int first = getFirstDayOfMonth(year, 0); int offs; if ((8 - first) >= getMinimalDaysInFirstWeek()) // start counting on first week offs = 1; else offs = 1 + (8 - first); month = 0; day = offs + 7 * (fields[WEEK_OF_YEAR] - 1); day += fields[DAY_OF_WEEK] - first; } else { // 4: YEAR + DAY_OF_YEAR month = 0; day = fields[DAY_OF_YEAR]; } } else { if (isSet[DAY_OF_WEEK]) { int first = getFirstDayOfMonth(year, month); // 3: YEAR + MONTH + DAY_OF_WEEK_IN_MONTH + DAY_OF_WEEK if (isSet[DAY_OF_WEEK_IN_MONTH]) { int offs = fields[DAY_OF_WEEK] - first; if (offs < 0) offs += 7; day = 1 + 7 * (fields[DAY_OF_WEEK_IN_MONTH] - 1); day += offs; } else { // 2: YEAR + MONTH + WEEK_OF_MONTH + DAY_OF_WEEK day = 1 + 7 * (fields[WEEK_OF_MONTH] - 1); day += fields[DAY_OF_WEEK] - first; } } // 1: YEAR + MONTH + DAY_OF_MONTH } if (era == BC && year > 0) year = 1 - year; // rest of code assumes day/month/year set // should negative BC years be AD? // get the hour (but no check for validity) if (isSet[HOUR_OF_DAY]) hour = fields[HOUR_OF_DAY]; else if (isSet[HOUR]) { hour = fields[HOUR]; if (isSet[AM_PM] && fields[AM_PM] == PM) if (hour != 12) /* not Noon */ hour += 12; /* Fix the problem of the status of 12:00 AM (midnight). */ if (fields[AM_PM] == AM && hour == 12) hour = 0; } // Read the era,year,month,day fields and convert as appropriate. // Calculate number of milliseconds into the day // This takes care of both h, m, s, ms over/underflows. long allMillis = (((hour * 60L) + minute) * 60L + second) * 1000L + millis; day += allMillis / (24 * 60 * 60 * 1000L); millisInDay = (int) (allMillis % (24 * 60 * 60 * 1000L)); if (month < 0) { year += (int) month / 12; month = month % 12; if (month < 0) { month += 12; year--; } } if (month > 11) { year += (month / 12); month = month % 12; } month_days[1] = isLeapYear(year) ? 29 : 28; while (day <= 0) { if (month == 0) { year--; month_days[1] = isLeapYear(year) ? 29 : 28; } month = (month + 11) % 12; day += month_days[month]; } while (day > month_days[month]) { day -= (month_days[month]); month = (month + 1) % 12; if (month == 0) { year++; month_days[1] = isLeapYear(year) ? 29 : 28; } } // ok, by here we have valid day,month,year,era and millisinday int dayOfYear = dayCount[month] + day - 1; // (day starts on 1) if (isLeapYear(year) && month > 1) dayOfYear++; int relativeDay = (year - 1) * 365 + ((year - 1) >> 2) + dayOfYear - EPOCH_DAYS; // gregorian days from 1 to epoch. int gregFactor = (int) Math.floor((double) (year - 1) / 400.) - (int) Math.floor((double) (year - 1) / 100.); if ((relativeDay + gregFactor) * 60L * 60L * 24L * 1000L >= gregorianCutover) relativeDay += gregFactor; else relativeDay -= 2; time = relativeDay * (24 * 60 * 60 * 1000L) + millisInDay; // the epoch was a Thursday. int weekday = (int) (relativeDay + THURSDAY) % 7; if (weekday <= 0) weekday += 7; fields[DAY_OF_WEEK] = weekday; TimeZone zone = getTimeZone(); int rawOffset = zone.getRawOffset(); int dstOffset = zone.getOffset((year < 1) ? BC : AD, (year < 1) ? 1 - year : year, month, day, weekday, millisInDay) - zone.getRawOffset(); time -= (rawOffset + dstOffset); isTimeSet = true; }
| 11,365
|
protected synchronized void computeTime() { int millisInDay = 0; int era = fields[ERA]; int year = fields[YEAR]; int month = fields[MONTH]; int day = fields[DAY_OF_MONTH]; int minute = fields[MINUTE]; int second = fields[SECOND]; int millis = fields[MILLISECOND]; int[] month_days = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; int[] dayCount = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; int hour = 0; if (! isLenient()) nonLeniencyCheck(); if (! isSet[MONTH]) { // 5: YEAR + DAY_OF_WEEK + WEEK_OF_YEAR if (isSet[DAY_OF_WEEK] || isSet[WEEK_OF_YEAR]) { int first = getFirstDayOfMonth(year, 0); int offs; if ((8 - first) >= getMinimalDaysInFirstWeek()) // start counting on first week offs = 1; else offs = 1 + (8 - first); month = 0; day = offs + 7 * (fields[WEEK_OF_YEAR] - 1); day += fields[DAY_OF_WEEK] - first; } else { // 4: YEAR + DAY_OF_YEAR month = 0; day = fields[DAY_OF_YEAR]; } } else { if (isSet[DAY_OF_WEEK]) { int first = getFirstDayOfMonth(year, month); // 3: YEAR + MONTH + DAY_OF_WEEK_IN_MONTH + DAY_OF_WEEK if (isSet[DAY_OF_WEEK_IN_MONTH]) { int offs = fields[DAY_OF_WEEK] - first; if (offs < 0) offs += 7; day = 1 + 7 * (fields[DAY_OF_WEEK_IN_MONTH] - 1); day += offs; } else { // 2: YEAR + MONTH + WEEK_OF_MONTH + DAY_OF_WEEK day = 1 + 7 * (fields[WEEK_OF_MONTH] - 1); day += fields[DAY_OF_WEEK] - first; } } // 1: YEAR + MONTH + DAY_OF_MONTH } if (era == BC && year > 0) year = 1 - year; // rest of code assumes day/month/year set // should negative BC years be AD? // get the hour (but no check for validity) if (isSet[HOUR_OF_DAY]) hour = fields[HOUR_OF_DAY]; else if (isSet[HOUR]) { hour = fields[HOUR]; if (isSet[AM_PM] && fields[AM_PM] == PM) if (hour != 12) /* not Noon */ hour += 12; /* Fix the problem of the status of 12:00 AM (midnight). */ if (isSet[AM_PM] && fields[AM_PM] == AM && hour == 12) hour = 0; } // Read the era,year,month,day fields and convert as appropriate. // Calculate number of milliseconds into the day // This takes care of both h, m, s, ms over/underflows. long allMillis = (((hour * 60L) + minute) * 60L + second) * 1000L + millis; day += allMillis / (24 * 60 * 60 * 1000L); millisInDay = (int) (allMillis % (24 * 60 * 60 * 1000L)); if (month < 0) { year += (int) month / 12; month = month % 12; if (month < 0) { month += 12; year--; } } if (month > 11) { year += (month / 12); month = month % 12; } month_days[1] = isLeapYear(year) ? 29 : 28; while (day <= 0) { if (month == 0) { year--; month_days[1] = isLeapYear(year) ? 29 : 28; } month = (month + 11) % 12; day += month_days[month]; } while (day > month_days[month]) { day -= (month_days[month]); month = (month + 1) % 12; if (month == 0) { year++; month_days[1] = isLeapYear(year) ? 29 : 28; } } // ok, by here we have valid day,month,year,era and millisinday int dayOfYear = dayCount[month] + day - 1; // (day starts on 1) if (isLeapYear(year) && month > 1) dayOfYear++; int relativeDay = (year - 1) * 365 + ((year - 1) >> 2) + dayOfYear - EPOCH_DAYS; // gregorian days from 1 to epoch. int gregFactor = (int) Math.floor((double) (year - 1) / 400.) - (int) Math.floor((double) (year - 1) / 100.); if ((relativeDay + gregFactor) * 60L * 60L * 24L * 1000L >= gregorianCutover) relativeDay += gregFactor; else relativeDay -= 2; time = relativeDay * (24 * 60 * 60 * 1000L) + millisInDay; // the epoch was a Thursday. int weekday = (int) (relativeDay + THURSDAY) % 7; if (weekday <= 0) weekday += 7; fields[DAY_OF_WEEK] = weekday; TimeZone zone = getTimeZone(); int rawOffset = zone.getRawOffset(); int dstOffset = zone.getOffset((year < 1) ? BC : AD, (year < 1) ? 1 - year : year, month, day, weekday, millisInDay) - zone.getRawOffset(); time -= (rawOffset + dstOffset); isTimeSet = true; }
|
protected synchronized void computeTime() { int millisInDay = 0; int era = fields[ERA]; int year = fields[YEAR]; int month = fields[MONTH]; int day = fields[DAY_OF_MONTH]; int minute = fields[MINUTE]; int second = fields[SECOND]; int millis = fields[MILLISECOND]; int[] month_days = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; int[] dayCount = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; int hour = 0; if (! isLenient()) nonLeniencyCheck(); if (! isSet[MONTH]) { // 5: YEAR + DAY_OF_WEEK + WEEK_OF_YEAR if (isSet[DAY_OF_WEEK] || isSet[WEEK_OF_YEAR]) { int first = getFirstDayOfMonth(year, 0); int offs; if ((8 - first) >= getMinimalDaysInFirstWeek()) // start counting on first week offs = 1; else offs = 1 + (8 - first); month = 0; day = offs + 7 * (fields[WEEK_OF_YEAR] - 1); day += fields[DAY_OF_WEEK] - first; } else { // 4: YEAR + DAY_OF_YEAR month = 0; day = fields[DAY_OF_YEAR]; } } else { if (isSet[DAY_OF_WEEK]) { int first = getFirstDayOfMonth(year, month); // 3: YEAR + MONTH + DAY_OF_WEEK_IN_MONTH + DAY_OF_WEEK if (isSet[DAY_OF_WEEK_IN_MONTH]) { int offs = fields[DAY_OF_WEEK] - first; if (offs < 0) offs += 7; day = 1 + 7 * (fields[DAY_OF_WEEK_IN_MONTH] - 1); day += offs; } else { // 2: YEAR + MONTH + WEEK_OF_MONTH + DAY_OF_WEEK day = 1 + 7 * (fields[WEEK_OF_MONTH] - 1); day += fields[DAY_OF_WEEK] - first; } } // 1: YEAR + MONTH + DAY_OF_MONTH } if (era == BC && year > 0) year = 1 - year; // rest of code assumes day/month/year set // should negative BC years be AD? // get the hour (but no check for validity) if (isSet[HOUR_OF_DAY]) hour = fields[HOUR_OF_DAY]; else if (isSet[HOUR]) { hour = fields[HOUR]; if (isSet[AM_PM] && fields[AM_PM] == PM) if (hour != 12) /* not Noon */ hour += 12; /* Fix the problem of the status of 12:00 AM (midnight). */ if (isSet[AM_PM] && fields[AM_PM] == AM && hour == 12) hour = 0; } // Read the era,year,month,day fields and convert as appropriate. // Calculate number of milliseconds into the day // This takes care of both h, m, s, ms over/underflows. long allMillis = (((hour * 60L) + minute) * 60L + second) * 1000L + millis; day += allMillis / (24 * 60 * 60 * 1000L); millisInDay = (int) (allMillis % (24 * 60 * 60 * 1000L)); if (month < 0) { year += (int) month / 12; month = month % 12; if (month < 0) { month += 12; year--; } } if (month > 11) { year += (month / 12); month = month % 12; } month_days[1] = isLeapYear(year) ? 29 : 28; while (day <= 0) { if (month == 0) { year--; month_days[1] = isLeapYear(year) ? 29 : 28; } month = (month + 11) % 12; day += month_days[month]; } while (day > month_days[month]) { day -= (month_days[month]); month = (month + 1) % 12; if (month == 0) { year++; month_days[1] = isLeapYear(year) ? 29 : 28; } } // ok, by here we have valid day,month,year,era and millisinday int dayOfYear = dayCount[month] + day - 1; // (day starts on 1) if (isLeapYear(year) && month > 1) dayOfYear++; int relativeDay = (year - 1) * 365 + ((year - 1) >> 2) + dayOfYear - EPOCH_DAYS; // gregorian days from 1 to epoch. int gregFactor = (int) Math.floor((double) (year - 1) / 400.) - (int) Math.floor((double) (year - 1) / 100.); if ((relativeDay + gregFactor) * 60L * 60L * 24L * 1000L >= gregorianCutover) relativeDay += gregFactor; else relativeDay -= 2; time = relativeDay * (24 * 60 * 60 * 1000L) + millisInDay; // the epoch was a Thursday. int weekday = (int) (relativeDay + THURSDAY) % 7; if (weekday <= 0) weekday += 7; fields[DAY_OF_WEEK] = weekday; TimeZone zone = getTimeZone(); int rawOffset = zone.getRawOffset(); int dstOffset = zone.getOffset((year < 1) ? BC : AD, (year < 1) ? 1 - year : year, month, day, weekday, millisInDay) - zone.getRawOffset(); time -= (rawOffset + dstOffset); isTimeSet = true; }
| 11,366
|
protected Calendar(TimeZone zone, Locale locale) { this.zone = zone; lenient = true; String[] days = { "", "sun", "mon", "tue", "wed", "thu", "fri", "sat" }; ResourceBundle rb = getBundle(locale); String min = (String) rb.getObject("minNumberOfDaysInFirstWeek"); String first = (String) rb.getObject("firstDayOfWeek"); try { if (min != null) minimalDaysInFirstWeek = Integer.parseInt(min); } catch (NumberFormatException ex) { minimalDaysInFirstWeek = 1; } firstDayOfWeek = 1; if (first != null) for (int i = 0; i < 8; i++) if (days[i].equals(first)) firstDayOfWeek = i; clear(); }
|
protected Calendar() { this.zone = zone; lenient = true; String[] days = { "", "sun", "mon", "tue", "wed", "thu", "fri", "sat" }; ResourceBundle rb = getBundle(locale); String min = (String) rb.getObject("minNumberOfDaysInFirstWeek"); String first = (String) rb.getObject("firstDayOfWeek"); try { if (min != null) minimalDaysInFirstWeek = Integer.parseInt(min); } catch (NumberFormatException ex) { minimalDaysInFirstWeek = 1; } firstDayOfWeek = 1; if (first != null) for (int i = 0; i < 8; i++) if (days[i].equals(first)) firstDayOfWeek = i; clear(); }
| 11,367
|
protected Calendar(TimeZone zone, Locale locale) { this.zone = zone; lenient = true; String[] days = { "", "sun", "mon", "tue", "wed", "thu", "fri", "sat" }; ResourceBundle rb = getBundle(locale); String min = (String) rb.getObject("minNumberOfDaysInFirstWeek"); String first = (String) rb.getObject("firstDayOfWeek"); try { if (min != null) minimalDaysInFirstWeek = Integer.parseInt(min); } catch (NumberFormatException ex) { minimalDaysInFirstWeek = 1; } firstDayOfWeek = 1; if (first != null) for (int i = 0; i < 8; i++) if (days[i].equals(first)) firstDayOfWeek = i; clear(); }
|
protected Calendar(TimeZone zone, Locale locale) { this.zone = zone; lenient = true; String[] days = { "", "sun", "mon", "tue", "wed", "thu", "fri", "sat" }; ResourceBundle rb = getBundle(locale); String min = (String) rb.getObject("minNumberOfDaysInFirstWeek"); String first = (String) rb.getObject("firstDayOfWeek"); try { if (min != null) minimalDaysInFirstWeek = Integer.parseInt(min); } catch (NumberFormatException ex) { minimalDaysInFirstWeek = 1; } firstDayOfWeek = 1; if (first != null) for (int i = 0; i < 8; i++) if (days[i].equals(first)) firstDayOfWeek = i; clear(); }
| 11,368
|
public void refresh(){ super.refresh(); try{ final PluginManager mgr = InitialNaming.lookup(PluginManager.NAME); final PluginDescriptor descr = mgr.getRegistry().getPluginDescriptor(name); if (descr != null) { addStringln("Name:"); addStringln("\t"+descr.getId()); addStringln("Provider:"); addStringln("\t"+descr.getProviderName()); addStringln("State :"); try { if (descr.getPlugin().isActive()) { addStringln("\tactive"); } else { addStringln("\tinactive"); } } catch (PluginException PE){ System.err.println(PE); } addStringln("Prerequisites:"); PluginPrerequisite[] allPreqs = descr.getPrerequisites(); PluginPrerequisite current; for (int i =0 ; i<allPreqs.length; i++){ current = allPreqs[i]; addStringln("\t"+current.getPluginId()+"\t\t"+current.getPluginVersion()); } } else { isvalid = false; } } catch (NameNotFoundException N){ System.err.println(N); } }
|
public void refresh(){ super.refresh(); try{ final PluginManager mgr = InitialNaming.lookup(PluginManager.NAME); final PluginDescriptor descr = mgr.getRegistry().getPluginDescriptor(name); if (descr != null) { addStringln("Name:"); addStringln("\t"+descr.getId()); addStringln("Provider:"); addStringln("\t"+descr.getProviderName()); addStringln("State :"); try { if (descr.getPlugin().isActive()) { addStringln("\tactive"); } else { addStringln("\tinactive"); } } catch (PluginException PE){ System.err.println(PE); } */ addStringln("\tunknown"); addStringln("Prerequisites:"); PluginPrerequisite[] allPreqs = descr.getPrerequisites(); PluginPrerequisite current; for (int i =0 ; i<allPreqs.length; i++){ current = allPreqs[i]; addStringln("\t"+current.getPluginId()+"\t\t"+current.getPluginVersion()); } } else { isvalid = false; } } catch (NameNotFoundException N){ System.err.println(N); } }
| 11,369
|
public FloatSeqHolder(float[] initial_value) { value = initial_value; typecode.setLength(value.length); }
|
public FloatSeqHolder() { value = initial_value; typecode.setLength(value.length); }
| 11,370
|
public FloatSeqHolder(float[] initial_value) { value = initial_value; typecode.setLength(value.length); }
|
public FloatSeqHolder(float[] initial_value) { value = initial_value; typecode.setLength(value.length); }
| 11,371
|
public int getTimezoneOffset() { Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(time); return (cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET)) / (60 * 1000); }
|
public int getTimezoneOffset() { Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(time); return - (cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET)) / (60 * 1000); }
| 11,372
|
private void readObject(java.io.ObjectInputStream input) throws java.io.IOException, ClassNotFoundException { input.defaultReadObject(); time = input.readLong(); }
|
private void readObject(java.io.ObjectInputStream input) throws java.io.IOException, ClassNotFoundException { input.defaultReadObject(); time = input.readLong(); }
| 11,373
|
private void writeObject(java.io.ObjectOutputStream output) throws java.io.IOException { output.defaultWriteObject(); output.writeLong(time); }
|
private void writeObject(java.io.ObjectOutputStream output) throws java.io.IOException { output.defaultWriteObject(); output.writeLong(time); }
| 11,374
|
public final String getDisplayName(boolean dst, int style) { return (getDisplayName(dst, style, Locale.getDefault())); }
|
public final String getDisplayName() { return (getDisplayName(dst, style, Locale.getDefault())); }
| 11,375
|
public final String getDisplayName(boolean dst, int style) { return (getDisplayName(dst, style, Locale.getDefault())); }
|
public final String getDisplayName(boolean dst, int style) { return (getDisplayName(false, LONG, Locale.getDefault())); }
| 11,376
|
public ReaderDelegate(XMLStreamReader reader) { parent = reader; }
|
public ReaderDelegate() { parent = reader; }
| 11,377
|
public ReaderDelegate(XMLStreamReader reader) { parent = reader; }
|
public ReaderDelegate(XMLStreamReader reader) { }
| 11,378
|
public String getAttributeName(int index) { if (parent != null) return parent.getAttributeName(index); return null; }
|
public QName getAttributeName(int index) { if (parent != null) return parent.getAttributeName(index); return null; }
| 11,379
|
public String getAttributeValue(int index) { if (parent != null) return parent.getAttributeValue(index); return null; }
|
public String getAttributeValue(String namespaceUri, String localName) { if (parent != null) return parent.getAttributeValue(index); return null; }
| 11,380
|
public String getAttributeValue(int index) { if (parent != null) return parent.getAttributeValue(index); return null; }
|
public String getAttributeValue(int index) { if (parent != null) return parent.getAttributeValue(namespaceUri, localName); return null; }
| 11,381
|
public String getNamespaceURI() { if (parent != null) return parent.getNamespaceURI(); return null; }
|
public String getNamespaceURI(String prefix) { if (parent != null) return parent.getNamespaceURI(); return null; }
| 11,382
|
public String getNamespaceURI() { if (parent != null) return parent.getNamespaceURI(); return null; }
|
public String getNamespaceURI() { if (parent != null) return parent.getNamespaceURI(prefix); return null; }
| 11,383
|
public char[] getTextCharacters() { if (parent != null) return parent.getTextCharacters(); return null; }
|
public int getTextCharacters(int sourceStart, char[] target, int targetStart, int length) throws XMLStreamException { if (parent != null) return parent.getTextCharacters(); return null; }
| 11,384
|
public char[] getTextCharacters() { if (parent != null) return parent.getTextCharacters(); return null; }
|
public char[] getTextCharacters() { if (parent != null) return parent.getTextCharacters(); return null; }
| 11,385
|
public CRLFInputStream(InputStream in) { super(in); }
|
public CRLFInputStream(InputStream in) { super(in.markSupported() ? in : new BufferedInputStream(in)); }
| 11,386
|
public int read() throws IOException { int c; if (buf != -1) { c = buf; buf = -1; return c; } else { c = super.read(); if (c == CR) { buf = super.read(); if (buf == LF) { c = buf; buf = -1; } } } return c; }
|
public int read() throws IOException { int c; if (buf != -1) { c = buf; buf = -1; return c; } else { c = super.read(); if (c == CR) { buf = super.read(); if (buf == LF) { c = buf; buf = -1; } } } return c; }
| 11,387
|
public int read() throws IOException { int c; if (buf != -1) { c = buf; buf = -1; return c; } else { c = super.read(); if (c == CR) { buf = super.read(); if (buf == LF) { c = buf; buf = -1; } } } return c; }
|
public int read() throws IOException { int c; if (buf != -1) { c = buf; buf = -1; return c; } else { c = super.read(); if (c == CR) { buf = super.read(); if (buf == LF) { c = buf; buf = -1; } } } return c; }
| 11,388
|
public int read() throws IOException { int c; if (buf != -1) { c = buf; buf = -1; return c; } else { c = super.read(); if (c == CR) { buf = super.read(); if (buf == LF) { c = buf; buf = -1; } } } return c; }
|
public int read() throws IOException { int c; if (buf != -1) { c = buf; buf = -1; return c; } else { c = super.read(); if (c == CR) { buf = super.read(); if (buf == LF) { c = buf; buf = -1; } } } return c; }
| 11,389
|
protected Inet6Address(byte[] addr, String host) { super(addr, host); this.ipaddress = addr; }
|
protected Inet6Address(byte[] addr, String host) { super(addr, host); this.ipaddress = addr; }
| 11,393
|
public boolean equals(Object obj) { if (obj == null || !(obj instanceof Inet6Address)) return false; Inet6Address tmp = (Inet6Address) obj; return super.equals(tmp) && this.ipaddress == tmp.ipaddress; }
|
public boolean equals(Object obj) { if (obj == null || !(obj instanceof Inet6Address)) return false; Inet6Address tmp = (Inet6Address) obj; return super.equals(tmp) && this.ipaddress == tmp.ipaddress; }
| 11,394
|
public boolean isAnyLocalAddress() { byte[] anylocal = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; return ipaddress == anylocal; }
|
public boolean isAnyLocalAddress() { byte[] anylocal = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; return Arrays.equals(ipaddress, anylocal); }
| 11,395
|
public boolean isLoopbackAddress() { byte[] loopback = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }; return ipaddress == loopback; }
|
public boolean isLoopbackAddress() { byte[] loopback = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }; return Arrays.equals(ipaddress, loopback); }
| 11,396
|
protected void installDefaults(JLabel c) { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); c.setForeground(defaults.getColor("Label.foreground")); c.setBackground(defaults.getColor("Label.background")); c.setFont(defaults.getFont("Label.font")); c.setBorder(defaults.getBorder("Label.border")); //XXX: There are properties we don't use called disabledForeground //and disabledShadow. }
|
protected void installDefaults(JLabel c) { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); c.setForeground(defaults.getColor("Label.foreground")); c.setBackground(defaults.getColor("Label.background")); c.setFont(defaults.getFont("Label.font")); //XXX: There are properties we don't use called disabledForeground //and disabledShadow. }
| 11,397
|
protected void uninstallDefaults(JLabel c) { c.setForeground(null); c.setBackground(null); c.setFont(null); c.setBorder(null); }
|
protected void uninstallDefaults(JLabel c) { c.setForeground(null); c.setBackground(null); c.setFont(null); }
| 11,398
|
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis) { int daysInMonth = getDaysInMonth(month, year); if (day < 1 || day > daysInMonth) throw new IllegalArgumentException("day out of range"); if (dayOfWeek < Calendar.SUNDAY || dayOfWeek > Calendar.SATURDAY) throw new IllegalArgumentException("dayOfWeek out of range"); if (month < Calendar.JANUARY || month > Calendar.DECEMBER) throw new IllegalArgumentException("month out of range:" + month); // This method is called by Calendar, so we mustn't use that class. int daylightSavings = 0; if (useDaylight && era == GregorianCalendar.AD && year >= startYear) { // This does only work for Gregorian calendars :-( // This is mainly because setStartYear doesn't take an era. boolean afterStart = ! isBefore(year, month, day, dayOfWeek, millis, startMode, startMonth, startDay, startDayOfWeek, startTime); boolean beforeEnd = isBefore(year, month, day, dayOfWeek, millis, endMode, endMonth, endDay, endDayOfWeek, endTime); if (startMonth < endMonth) // use daylight savings, if the date is after the start of // savings, and before the end of savings. daylightSavings = afterStart && beforeEnd ? dstSavings : 0; else // use daylight savings, if the date is before the end of // savings, or after the start of savings. daylightSavings = beforeEnd || afterStart ? dstSavings : 0; } return rawOffset + daylightSavings; }
|
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis) { int daysInMonth = getDaysInMonth(month, year); if (day < 1 || day > daysInMonth) throw new IllegalArgumentException("day out of range"); if (dayOfWeek < Calendar.SUNDAY || dayOfWeek > Calendar.SATURDAY) throw new IllegalArgumentException("dayOfWeek out of range"); if (month < Calendar.JANUARY || month > Calendar.DECEMBER) throw new IllegalArgumentException("month out of range:" + month); // This method is called by Calendar, so we mustn't use that class. int daylightSavings = 0; if (useDaylight && era == GregorianCalendar.AD && year >= startYear) { // This does only work for Gregorian calendars :-( // This is mainly because setStartYear doesn't take an era. boolean afterStart = ! isBefore(year, month, day, dayOfWeek, millis, startMode, startMonth, startDay, startDayOfWeek, startTime); boolean beforeEnd = isBefore(year, month, day, dayOfWeek, millis + dstSavings, endMode, endMonth, endDay, endDayOfWeek, endTime); if (startMonth < endMonth) // use daylight savings, if the date is after the start of // savings, and before the end of savings. daylightSavings = afterStart && beforeEnd ? dstSavings : 0; else // use daylight savings, if the date is before the end of // savings, or after the start of savings. daylightSavings = beforeEnd || afterStart ? dstSavings : 0; } return rawOffset + daylightSavings; }
| 11,400
|
public int read(byte[] data, int offset, int length) throws IOException { if (this.readDataFromBlock) { int remain = this.blockDataBytes - this.blockDataPosition; if (remain == 0) { readNextBlock(); remain = this.blockDataBytes - this.blockDataPosition; } length = Math.min(length, remain); System.arraycopy(this.blockData, this.blockDataPosition, data, offset, length); this.blockDataPosition += length; return length; } else return this.realInputStream.read(data, offset, length); }
|
public int read() throws IOException { if (this.readDataFromBlock) { int remain = this.blockDataBytes - this.blockDataPosition; if (remain == 0) { readNextBlock(); remain = this.blockDataBytes - this.blockDataPosition; } length = Math.min(length, remain); System.arraycopy(this.blockData, this.blockDataPosition, data, offset, length); this.blockDataPosition += length; return length; } else return this.realInputStream.read(data, offset, length); }
| 11,401
|
public int read(byte[] data, int offset, int length) throws IOException { if (this.readDataFromBlock) { int remain = this.blockDataBytes - this.blockDataPosition; if (remain == 0) { readNextBlock(); remain = this.blockDataBytes - this.blockDataPosition; } length = Math.min(length, remain); System.arraycopy(this.blockData, this.blockDataPosition, data, offset, length); this.blockDataPosition += length; return length; } else return this.realInputStream.read(data, offset, length); }
|
public int read(byte[] data, int offset, int length) throws IOException { if (this.readDataFromBlock) { int remain = this.blockDataBytes - this.blockDataPosition; if (remain == 0) { readNextBlock(); remain = this.blockDataBytes - this.blockDataPosition; } length = Math.min(length, remain); System.arraycopy(this.blockData, this.blockDataPosition, data, offset, length); this.blockDataPosition += length; return length; } else return this.realInputStream.read(data, offset, length); }
| 11,402
|
public int read(byte[] data, int offset, int length) throws IOException { if (this.readDataFromBlock) { int remain = this.blockDataBytes - this.blockDataPosition; if (remain == 0) { readNextBlock(); remain = this.blockDataBytes - this.blockDataPosition; } length = Math.min(length, remain); System.arraycopy(this.blockData, this.blockDataPosition, data, offset, length); this.blockDataPosition += length; return length; } else return this.realInputStream.read(data, offset, length); }
|
public int read(byte[] data, int offset, int length) throws IOException { if (this.readDataFromBlock) { int remain = this.blockDataBytes - this.blockDataPosition; if (remain == 0) { readNextBlock(); remain = this.blockDataBytes - this.blockDataPosition; } length = Math.min(length, remain); System.arraycopy(this.blockData, this.blockDataPosition, data, offset, length); this.blockDataPosition += length; return length; } else return this.realInputStream.read(); }
| 11,403
|
public void write(byte[] b, int off, int len) throws IOException { if (writeDataAsBlocks) { if (len < 0) throw new IndexOutOfBoundsException(); if (blockDataCount + len < BUFFER_SIZE) { System.arraycopy(b, off, blockData, blockDataCount, len); blockDataCount += len; } else { drain(); writeBlockDataHeader(len); realOutput.write(b, off, len); } } else realOutput.write(b, off, len); }
|
public void write (int data) throws IOException { if (writeDataAsBlocks) { if (len < 0) throw new IndexOutOfBoundsException(); if (blockDataCount + len < BUFFER_SIZE) { System.arraycopy(b, off, blockData, blockDataCount, len); blockDataCount += len; } else { drain(); writeBlockDataHeader(len); realOutput.write(b, off, len); } } else realOutput.write(b, off, len); }
| 11,404
|
public void write(byte[] b, int off, int len) throws IOException { if (writeDataAsBlocks) { if (len < 0) throw new IndexOutOfBoundsException(); if (blockDataCount + len < BUFFER_SIZE) { System.arraycopy(b, off, blockData, blockDataCount, len); blockDataCount += len; } else { drain(); writeBlockDataHeader(len); realOutput.write(b, off, len); } } else realOutput.write(b, off, len); }
|
public void write(byte[] b, int off, int len) throws IOException { if (writeDataAsBlocks) { if (len < 0) throw new IndexOutOfBoundsException(); if (blockDataCount + len < BUFFER_SIZE) { System.arraycopy(b, off, blockData, blockDataCount, len); blockDataCount += len; } else { drain(); writeBlockDataHeader(len); realOutput.write(b, off, len); } } else realOutput.write(b, off, len); }
| 11,405
|
public void write(byte[] b, int off, int len) throws IOException { if (writeDataAsBlocks) { if (len < 0) throw new IndexOutOfBoundsException(); if (blockDataCount + len < BUFFER_SIZE) { System.arraycopy(b, off, blockData, blockDataCount, len); blockDataCount += len; } else { drain(); writeBlockDataHeader(len); realOutput.write(b, off, len); } } else realOutput.write(b, off, len); }
|
public void write(byte[] b, int off, int len) throws IOException { if (writeDataAsBlocks) { if (len < 0) throw new IndexOutOfBoundsException(); if (blockDataCount + len < BUFFER_SIZE) { System.arraycopy(b, off, blockData, blockDataCount, len); blockDataCount += len; } else { drain(); writeBlockDataHeader(len); realOutput.write(b, off, len); } } else realOutput.write(b, off, len); }
| 11,406
|
public void write(byte[] b, int off, int len) throws IOException { if (writeDataAsBlocks) { if (len < 0) throw new IndexOutOfBoundsException(); if (blockDataCount + len < BUFFER_SIZE) { System.arraycopy(b, off, blockData, blockDataCount, len); blockDataCount += len; } else { drain(); writeBlockDataHeader(len); realOutput.write(b, off, len); } } else realOutput.write(b, off, len); }
|
public void write(byte[] b, int off, int len) throws IOException { if (writeDataAsBlocks) { if (len < 0) throw new IndexOutOfBoundsException(); if (blockDataCount + len < BUFFER_SIZE) { System.arraycopy(b, off, blockData, blockDataCount, len); blockDataCount += len; } else { drain(); writeBlockDataHeader(len); realOutput.write(data); } } else realOutput.write(data); }
| 11,407
|
public boolean isShowing() { boolean retVal = false; if (SwingTextFieldPeer.this.awtComponent != null) retVal = SwingTextFieldPeer.this.awtComponent.isShowing(); return retVal; }
|
public boolean isShowing() { boolean retVal = false; if (SwingTextFieldPeer.this.awtComponent != null) retVal = SwingTextFieldPeer.this.awtComponent.isShowing(); return retVal; }
| 11,408
|
public SwingTextFieldPeer(TextField textField) { SwingTextField swingTextField = new SwingTextField(); swingTextField.setText(textField.getText()); init(textField, swingTextField); }
|
public SwingTextFieldPeer(TextField textField) { SwingTextField swingTextField = new SwingTextField(textField); swingTextField.setText(textField.getText()); init(textField, swingTextField); }
| 11,409
|
public void select(int startPos, int endPos) { // TODO: Must be implemented. }
|
public void select(int start_pos, int endPos) { // TODO: Must be implemented. }
| 11,410
|
private void paintOceanButtonBorder(Component c, Graphics g, int x, int y, int w, int h) { ButtonModel bmodel = null; if (c instanceof AbstractButton) bmodel = ((AbstractButton) c).getModel(); Color darkShadow = MetalLookAndFeel.getControlDarkShadow(); Color shadow = MetalLookAndFeel.getControlShadow(); Color light = MetalLookAndFeel.getControlHighlight(); Color middle = MetalLookAndFeel.getControl(); if (c.isEnabled()) { // Paint the pressed border if the button is pressed, or if // the button is the default button. In the OceanTheme, the default // button has the same border as a pressed button. if (bmodel.isPressed() || ((c instanceof JButton) && ((JButton) c).isDefaultButton())) { // Draw fat border. g.setColor(darkShadow); g.drawRect(x, y, w - 1, h - 1); g.drawRect(x + 1, y + 1, w - 3, h - 3); } else if (bmodel.isRollover()) { g.setColor(shadow); g.drawRect(x, y, w - 1, h - 1); g.drawRect(x + 2, y + 2, w - 5, h - 5); g.setColor(darkShadow); g.drawRect(x + 1, y + 1, w - 3, h - 3); } else { g.setColor(darkShadow); g.drawRect(x, y, w - 1, h - 1); } } else { // draw disabled border g.setColor(MetalLookAndFeel.getInactiveControlTextColor()); g.drawRect(x, y, w - 2, h - 2); } }
|
private void paintOceanButtonBorder(Component c, Graphics g, int x, int y, int w, int h) { ButtonModel bmodel = null; if (c instanceof AbstractButton) bmodel = ((AbstractButton) c).getModel(); Color darkShadow = MetalLookAndFeel.getControlDarkShadow(); Color shadow = MetalLookAndFeel.getControlShadow(); Color light = MetalLookAndFeel.getControlHighlight(); Color middle = MetalLookAndFeel.getControl(); if (c.isEnabled()) { // Paint the pressed border if the button is pressed, or if // the button is the default button. In the OceanTheme, the default // button has the same border as a pressed button. if (bmodel.isPressed() || ((c instanceof JButton) && ((JButton) c).isDefaultButton())) { // Draw fat border. g.setColor(darkShadow); g.drawRect(x, y, w - 1, h - 1); g.drawRect(x + 1, y + 1, w - 3, h - 3); } else if (bmodel.isRollover() && !(c.getParent() instanceof JToolBar)) { g.setColor(shadow); g.drawRect(x, y, w - 1, h - 1); g.drawRect(x + 2, y + 2, w - 5, h - 5); g.setColor(darkShadow); g.drawRect(x + 1, y + 1, w - 3, h - 3); } else { g.setColor(darkShadow); g.drawRect(x, y, w - 1, h - 1); } } else { // draw disabled border g.setColor(MetalLookAndFeel.getInactiveControlTextColor()); g.drawRect(x, y, w - 2, h - 2); } }
| 11,411
|
public EtchedBorder() { }
|
public EtchedBorder() { }
| 11,413
|
public void emitMagic(EmitterContext ec, VmMethod method, boolean isstatic) { //final int type = getClass(method); final int mcode = getMethodCode(method); final VirtualStack vstack = ec.getVStack(); final X86Assembler os = ec.getStream(); final ItemFactory ifac = ec.getItemFactory(); final X86RegisterPool pool = ec.getGPRPool(); final X86CompilerContext context = ec.getContext(); final X86CompilerHelper helper = ec.getHelper(); final int slotSize = os.isCode32() ? 4 : 8; switch (mcode) { case mADD: { // addr + ofs if (Vm.VerifyAssertions) Vm._assert(!isstatic); final WordItem ofs = (WordItem) vstack.pop(); final RefItem addr = vstack.popRef(); ofs.load(ec); addr.load(ec); GPR ofsr = ofs.getRegister(); final GPR addrr = addr.getRegister(); if (ofsr.getSize() != addrr.getSize()) { // Sign-extend offset final GPR64 ofsr64 = (GPR64)pool.getRegisterInSameGroup(ofsr, JvmType.REFERENCE); os.writeMOVSXD(ofsr64, (GPR32)ofsr); ofsr = ofsr64; } os.writeADD(addrr, ofsr); ofs.release(ec); vstack.push(addr); } break; case mAND: { // addr & ofs if (Vm.VerifyAssertions) Vm._assert(!isstatic); final WordItem ofs = (WordItem) vstack.pop(); final RefItem addr = vstack.popRef(); ofs.load(ec); addr.load(ec); GPR ofsr = ofs.getRegister(); final GPR addrr = addr.getRegister(); if (ofsr.getSize() != addrr.getSize()) { // Sign-extend offset final GPR64 ofsr64 = (GPR64)pool.getRegisterInSameGroup(ofsr, JvmType.REFERENCE); os.writeMOVSXD(ofsr64, (GPR32)ofsr); ofsr = ofsr64; } os.writeAND(addrr, ofsr); ofs.release(ec); vstack.push(addr); } break; case mOR: { // addr | ofs if (Vm.VerifyAssertions) Vm._assert(!isstatic); final WordItem ofs = (WordItem) vstack.pop(); final RefItem addr = vstack.popRef(); ofs.load(ec); addr.load(ec); GPR ofsr = ofs.getRegister(); final GPR addrr = addr.getRegister(); if (ofsr.getSize() != addrr.getSize()) { // Sign-extend offset final GPR64 ofsr64 = (GPR64)pool.getRegisterInSameGroup(ofsr, JvmType.REFERENCE); os.writeMOVSXD(ofsr64, (GPR32)ofsr); ofsr = ofsr64; } os.writeOR(addrr, ofsr); ofs.release(ec); vstack.push(addr); } break; case mSUB: { // addr - ofs if (Vm.VerifyAssertions) Vm._assert(!isstatic); final WordItem ofs = (WordItem) vstack.pop(); final RefItem addr = vstack.popRef(); ofs.load(ec); addr.load(ec); GPR ofsr = ofs.getRegister(); final GPR addrr = addr.getRegister(); if (ofsr.getSize() != addrr.getSize()) { // Sign-extend offset final GPR64 ofsr64 = (GPR64)pool.getRegisterInSameGroup(ofsr, JvmType.REFERENCE); os.writeMOVSXD(ofsr64, (GPR32)ofsr); ofsr = ofsr64; } os.writeSUB(addrr, ofsr); ofs.release(ec); vstack.push(addr); } break; case mXOR: { // addr ^ ofs if (Vm.VerifyAssertions) Vm._assert(!isstatic); final WordItem ofs = (WordItem) vstack.pop(); final RefItem addr = vstack.popRef(); ofs.load(ec); addr.load(ec); GPR ofsr = ofs.getRegister(); final GPR addrr = addr.getRegister(); if (ofsr.getSize() != addrr.getSize()) { // Sign-extend offset final GPR64 ofsr64 = (GPR64)pool.getRegisterInSameGroup(ofsr, JvmType.REFERENCE); os.writeMOVSXD(ofsr64, (GPR32)ofsr); ofsr = ofsr64; } os.writeXOR(addrr, ofsr); ofs.release(ec); vstack.push(addr); } break; case mNOT: { // !addr if (Vm.VerifyAssertions) Vm._assert(!isstatic); final RefItem addr = vstack.popRef(); addr.load(ec); os.writeNOT(addr.getRegister()); vstack.push(addr); } break; case mTOINT: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final WordItem addr = vstack.popRef(); addr.load(ec); X86Register r = addr.getRegister(); if (os.isCode64()) { r = pool.getRegisterInSameGroup(r, JvmType.INT); // We just take the lower 32-bit, so no actual mov's needed. } addr.release(ec); L1AHelper.requestRegister(ec, r); final IntItem result = (IntItem) ifac.createReg(ec, JvmType.INT, r); pool.transferOwnerTo(r, result); vstack.push(result); } break; case mTOWORD: case mTOADDRESS: case mTOOFFSET: case mTOOBJECT: case mTOOBJECTREFERENCE: case mTOEXTENT: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final WordItem addr = vstack.popRef(); vstack.push(addr); } break; case mTOLONG: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final WordItem addr = vstack.popRef(); addr.load(ec); final X86Register.GPR r = addr.getRegister(); addr.release(ec); L1AHelper.requestRegister(ec, r); final LongItem result; if (os.isCode32()) { final X86Register.GPR msb = (X86Register.GPR)L1AHelper.requestRegister(ec, JvmType.INT, false); result = (LongItem) ifac.createReg(ec, JvmType.LONG, r, msb); os.writeXOR(msb, msb); pool.transferOwnerTo(msb, result); } else { result = (LongItem) ifac.createReg(ec, JvmType.LONG, (GPR64)r); } pool.transferOwnerTo(r, result); vstack.push(result); } break; case mMAX: { if (Vm.VerifyAssertions) Vm._assert(isstatic); final RefItem result = (RefItem) L1AHelper.requestWordRegister(ec, JvmType.REFERENCE, false); final GPR r = result.getRegister(); os.writeMOV_Const(r, -1); vstack.push(result); } break; case mONE: { if (Vm.VerifyAssertions) Vm._assert(isstatic); final RefItem result = (RefItem) L1AHelper.requestWordRegister(ec, JvmType.REFERENCE, false); final GPR r = result.getRegister(); os.writeMOV_Const(r, 1); vstack.push(result); } break; case mZERO: { if (Vm.VerifyAssertions) Vm._assert(isstatic); final RefItem result = ifac.createAConst(ec, null); vstack.push(result); } break; case mISMAX: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final WordItem addr = vstack.popRef(); addr.load(ec); final IntItem result = (IntItem)L1AHelper.requestWordRegister(ec, JvmType.INT, true); final GPR addrr = addr.getRegister(); final GPR resultr = result.getRegister(); os.writeXOR(resultr, resultr); os.writeCMP_Const(addrr, -1); os.writeSETCC(resultr, X86Constants.JE); addr.release(ec); vstack.push(result); } break; case mISZERO: { // Just convert to int if (Vm.VerifyAssertions) Vm._assert(!isstatic); final WordItem addr = vstack.popRef(); addr.load(ec); final IntItem result = (IntItem)L1AHelper.requestWordRegister(ec, JvmType.INT, true); final GPR addrr = addr.getRegister(); final GPR resultr = result.getRegister(); os.writeXOR(resultr, resultr); os.writeTEST(addrr, addrr); os.writeSETCC(resultr, X86Constants.JZ); addr.release(ec); vstack.push(result); } break; case mEQUALS: case mEQ: case mNE: case mLT: case mLE: case mGE: case mGT: case mSLT: case mSLE: case mSGE: case mSGT: { // addr .. other if (Vm.VerifyAssertions) Vm._assert(!isstatic); final RefItem other = vstack.popRef(); final RefItem addr = vstack.popRef(); other.load(ec); addr.load(ec); final IntItem result = (IntItem)L1AHelper.requestWordRegister(ec, JvmType.INT, true); final GPR resultr = result.getRegister(); os.writeXOR(resultr, resultr); os.writeCMP(addr.getRegister(), other.getRegister()); os.writeSETCC(resultr, methodToCC(mcode)); other.release(ec); addr.release(ec); vstack.push(result); } break; case mFROMINT: case mFROMINTSIGNEXTEND: case mFROMINTZEROEXTEND: { if (Vm.VerifyAssertions) Vm._assert(isstatic); final WordItem addr = vstack.popInt(); addr.load(ec); GPR r = addr.getRegister(); if (os.isCode64()) { final GPR64 newR = (GPR64)pool.getRegisterInSameGroup(r, JvmType.REFERENCE); if (mcode == mFROMINTZEROEXTEND) { // Moving the register to itself in 32-bit mode, will // zero extend the top 32-bits. os.writeMOV(BITS32, r, r); } else { // Sign extend os.writeMOVSXD(newR, (GPR32)r); } r = newR; } addr.release(ec); vstack.push(L1AHelper.requestWordRegister(ec, JvmType.REFERENCE, r)); } break; case mFROMADDRESS: case mFROMOBJECT: { if (Vm.VerifyAssertions) Vm._assert(isstatic); final RefItem obj = vstack.popRef(); // Do nothing vstack.push(obj); } break; case mFROMLONG: { if (Vm.VerifyAssertions) Vm._assert(isstatic); final LongItem addr = vstack.popLong(); addr.load(ec); final X86Register r; if (os.isCode32()) { r = addr.getLsbRegister(ec); } else { r = addr.getRegister(ec); } addr.release(ec); vstack.push(L1AHelper.requestWordRegister(ec, JvmType.REFERENCE, r)); } break; case mLSH: case mRSHA: case mRSHL: { // addr shift cnt if (Vm.VerifyAssertions) Vm._assert(!isstatic); final IntItem cnt = vstack.popInt(); final RefItem addr = vstack.popRef(); if (!cnt.isConstant()) { L1AHelper.requestRegister(ec, X86Register.ECX); cnt.loadTo(ec, X86Register.ECX); } addr.load(ec); final int shift = methodToShift(mcode); if (cnt.isConstant()) { os.writeShift(shift, addr.getRegister(), cnt.getValue()); } else { os.writeShift_CL(shift, addr.getRegister()); } cnt.release(ec); vstack.push(addr); } break; case mLOADBYTE: case mLOADCHAR: case mLOADSHORT: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final RefItem addr = vstack.popRef(); addr.loadToBITS8GPR(ec); final GPR r = addr.getRegister(); final WordItem result = L1AHelper.requestWordRegister(ec, methodToType(mcode), true); final GPR resultr = result.getRegister(); if (mcode == mLOADCHAR) { os.writeMOVZX(resultr, r, 0, methodToSize(mcode)); } else { os.writeMOVSX(resultr, r, 0, methodToSize(mcode)); } addr.release(ec); vstack.push(result); } break; case mLOADINT: case mLOADFLOAT: case mLOADADDRESS: case mLOADOBJECTREFERENCE: case mLOADWORD: case mPREPAREINT: case mPREPAREADDRESS: case mPREPAREOBJECTREFERENCE: case mPREPAREWORD: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final RefItem addr = vstack.popRef(); addr.load(ec); final GPR r = addr.getRegister(); final WordItem result = L1AHelper.requestWordRegister(ec, methodToType(mcode), false); final GPR resultr = result.getRegister(); os.writeMOV(resultr.getSize(), resultr, r, 0); addr.release(ec); vstack.push(result); } break; case mLOADLONG: case mLOADDOUBLE: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final RefItem addr = vstack.popRef(); addr.load(ec); final X86Register.GPR r = addr.getRegister(); if (os.isCode32()) { final X86Register.GPR msb = (X86Register.GPR)L1AHelper.requestRegister(ec, JvmType.INT, false); addr.release(ec); L1AHelper.releaseRegister(ec, msb); os.writeMOV(X86CompilerConstants.INTSIZE, msb, r, X86CompilerConstants.MSB); os.writeMOV(X86CompilerConstants.INTSIZE, r, r, X86CompilerConstants.LSB); vstack.push(L1AHelper.requestDoubleWordRegisters(ec, methodToType(mcode), r, msb)); } else { final DoubleWordItem result = L1AHelper.requestDoubleWordRegisters(ec, methodToType(mcode)); os.writeMOV(BITS64, result.getRegister(ec), r, 0); addr.release(ec); vstack.push(result); } } break; case mLOADBYTE_OFS: case mLOADCHAR_OFS: case mLOADSHORT_OFS: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final RefItem ofs = vstack.popRef(); final RefItem addr = vstack.popRef(); ofs.load(ec); addr.load(ec); final GPR ofsr = ofs.getRegister(); final GPR r = addr.getRegister(); os.writeLEA(r, r, ofsr, 1, 0); final WordItem result = L1AHelper.requestWordRegister(ec, methodToType(mcode), true); final GPR resultr = result.getRegister(); if (mcode == mLOADCHAR_OFS) { os.writeMOVZX(resultr, r, 0, methodToSize(mcode)); } else { os.writeMOVSX(resultr, r, 0, methodToSize(mcode)); } ofs.release(ec); addr.release(ec); vstack.push(result); } break; case mLOADINT_OFS: case mLOADFLOAT_OFS: case mLOADADDRESS_OFS: case mLOADOBJECTREFERENCE_OFS: case mLOADWORD_OFS: case mPREPAREINT_OFS: case mPREPAREADDRESS_OFS: case mPREPAREOBJECTREFERENCE_OFS: case mPREPAREWORD_OFS: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final RefItem ofs = vstack.popRef(); final RefItem addr = vstack.popRef(); ofs.load(ec); addr.load(ec); final GPR ofsr = ofs.getRegister(); final GPR r = addr.getRegister(); final WordItem result = L1AHelper.requestWordRegister(ec, methodToType(mcode), false); final GPR resultr = result.getRegister(); os.writeMOV(resultr.getSize(), resultr, r, ofsr, 1, 0); ofs.release(ec); addr.release(ec); vstack.push(result); } break; case mLOADLONG_OFS: case mLOADDOUBLE_OFS: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final RefItem ofs = vstack.popRef(); final RefItem addr = vstack.popRef(); ofs.load(ec); addr.load(ec); final GPR ofsr = ofs.getRegister(); final GPR r = addr.getRegister(); if (os.isCode32()) { final GPR msb = (GPR)L1AHelper.requestRegister(ec, JvmType.INT, false); os.writeMOV(X86CompilerConstants.INTSIZE, msb, r, ofsr, 1, X86CompilerConstants.MSB); os.writeMOV(X86CompilerConstants.INTSIZE, r, r, ofsr, 1, X86CompilerConstants.LSB); ofs.release(ec); addr.release(ec); L1AHelper.releaseRegister(ec, msb); vstack.push(L1AHelper.requestDoubleWordRegisters(ec, methodToType(mcode), r, msb)); } else { final DoubleWordItem result = L1AHelper.requestDoubleWordRegisters(ec, methodToType(mcode)); os.writeMOV(BITS64, result.getRegister(ec), r, ofsr, 1, 0); addr.release(ec); ofs.release(ec); vstack.push(result); } } break; case mSTOREBYTE: case mSTORECHAR: case mSTORESHORT: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final IntItem val = vstack.popInt(); final RefItem addr = vstack.popRef(); val.loadToBITS8GPR(ec); addr.load(ec); final GPR r = addr.getRegister(); final GPR valr = val.getRegister(); os.writeMOV(methodToSize(mcode), r, 0, valr); val.release(ec); addr.release(ec); } break; case mSTOREINT: case mSTOREFLOAT: case mSTOREADDRESS: case mSTOREOBJECTREFERENCE: case mSTOREWORD: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final WordItem val = (WordItem)vstack.pop(); final RefItem addr = vstack.popRef(); val.load(ec); addr.load(ec); final GPR r = addr.getRegister(); final GPR valr = val.getRegister(); os.writeMOV(valr.getSize(), r, 0, valr); val.release(ec); addr.release(ec); } break; case mSTORELONG: case mSTOREDOUBLE: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final DoubleWordItem val = (DoubleWordItem)vstack.pop(); final RefItem addr = vstack.popRef(); val.load(ec); addr.load(ec); final GPR r = addr.getRegister(); if (os.isCode32()) { final GPR lsb = val.getLsbRegister(ec); final GPR msb = val.getMsbRegister(ec); os.writeMOV(X86CompilerConstants.INTSIZE, r, X86CompilerConstants.LSB, lsb); os.writeMOV(X86CompilerConstants.INTSIZE, r, X86CompilerConstants.MSB, msb); } else { final GPR64 valr = val.getRegister(ec); os.writeMOV(BITS64, r, 0, valr); } val.release(ec); addr.release(ec); } break; case mSTOREBYTE_OFS: case mSTORECHAR_OFS: case mSTORESHORT_OFS: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final RefItem ofs = vstack.popRef(); final IntItem val = vstack.popInt(); final RefItem addr = vstack.popRef(); ofs.load(ec); val.loadToBITS8GPR(ec); addr.load(ec); final GPR r = addr.getRegister(); final GPR ofsr = ofs.getRegister(); final GPR valr = val.getRegister(); os.writeMOV(methodToSize(mcode), r, ofsr, 1, 0, valr); ofs.release(ec); val.release(ec); addr.release(ec); } break; case mSTOREINT_OFS: case mSTOREFLOAT_OFS: case mSTOREADDRESS_OFS: case mSTOREOBJECTREFERENCE_OFS: case mSTOREWORD_OFS: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final RefItem ofs = vstack.popRef(); final WordItem val = (WordItem)vstack.pop(); final RefItem addr = vstack.popRef(); ofs.load(ec); val.load(ec); addr.load(ec); final GPR r = addr.getRegister(); final GPR ofsr = ofs.getRegister(); final GPR valr = val.getRegister(); os.writeMOV(valr.getSize(), r, ofsr, 1, 0, valr); ofs.release(ec); val.release(ec); addr.release(ec); } break; case mSTORELONG_OFS: case mSTOREDOUBLE_OFS: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final RefItem ofs = vstack.popRef(); final DoubleWordItem val = (DoubleWordItem)vstack.pop(); final RefItem addr = vstack.popRef(); ofs.load(ec); val.load(ec); addr.load(ec); final GPR r = addr.getRegister(); final GPR ofsr = ofs.getRegister(); if (os.isCode32()) { final GPR lsb = val.getLsbRegister(ec); final GPR msb = val.getMsbRegister(ec); os.writeMOV(X86CompilerConstants.INTSIZE, r, ofsr, 1, X86CompilerConstants.LSB, lsb); os.writeMOV(X86CompilerConstants.INTSIZE, r, ofsr, 1, X86CompilerConstants.MSB, msb); } else { final GPR64 valr = val.getRegister(ec); os.writeMOV(BITS64, r, ofsr, 1, 0, valr); } ofs.release(ec); val.release(ec); addr.release(ec); } break; case mATTEMPTINT: case mATTEMPTADDRESS: case mATTEMPTOBJECTREFERENCE: case mATTEMPTWORD: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final WordItem val = (WordItem)vstack.pop(); final WordItem old = (WordItem)vstack.pop(); final RefItem addr = vstack.popRef(); final X86Register.GPR aax; if ((mcode == mATTEMPTINT) || os.isCode32()) { aax = X86Register.EAX; } else { aax = X86Register.RAX; } if (!old.uses(aax)) { L1AHelper.requestRegister(ec, aax, old); val.load(ec); old.loadTo(ec, aax); } else { val.load(ec); } addr.load(ec); final IntItem result = (IntItem)L1AHelper.requestWordRegister(ec, JvmType.INT, true); final GPR resultr = result.getRegister(); final GPR r = addr.getRegister(); final GPR valr = val.getRegister(); os.writeCMPXCHG_EAX(r, 0, valr, true); os.writeSETCC(resultr, X86Constants.JZ); os.writeAND(resultr, 0xFF); val.release(ec); old.release(ec); addr.release(ec); vstack.push(L1AHelper.requestWordRegister(ec, JvmType.INT, resultr)); } break; case mATTEMPTINT_OFS: case mATTEMPTADDRESS_OFS: case mATTEMPTOBJECTREFERENCE_OFS: case mATTEMPTWORD_OFS: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final RefItem ofs = vstack.popRef(); final WordItem val = (WordItem)vstack.pop(); final WordItem old = (WordItem)vstack.pop(); final RefItem addr = vstack.popRef(); final X86Register.GPR aax; if ((mcode == mATTEMPTINT) || os.isCode32()) { aax = X86Register.EAX; } else { aax = X86Register.RAX; } if (!old.uses(aax)) { L1AHelper.requestRegister(ec, aax, old); ofs.load(ec); val.load(ec); old.loadTo(ec, aax); } else { ofs.load(ec); val.load(ec); } addr.load(ec); final IntItem result = (IntItem)L1AHelper.requestWordRegister(ec, JvmType.INT, true); final GPR resultr = result.getRegister(); final GPR r = addr.getRegister(); final GPR valr = val.getRegister(); final GPR ofsr = ofs.getRegister(); os.writeLEA(r, r, ofsr, 1, 0); os.writeCMPXCHG_EAX(r, 0, valr, true); os.writeSETCC(resultr, X86Constants.JZ); os.writeAND(resultr, 0xFF); ofs.release(ec); val.release(ec); old.release(ec); addr.release(ec); vstack.push(L1AHelper.requestWordRegister(ec, JvmType.INT, resultr)); } break; case mGETOBJECTTYPE: { if (Vm.VerifyAssertions) Vm._assert(isstatic); final RefItem obj = vstack.popRef(); obj.load(ec); final GPR r = obj.getRegister(); // Get TIB os.writeMOV(helper.ADDRSIZE, r, r, ObjectLayout.TIB_SLOT * slotSize); // Get VmType os.writeMOV(helper.ADDRSIZE, r, r, (TIBLayout.VMTYPE_INDEX + VmArray.DATA_OFFSET) * slotSize); vstack.push(obj); } break; case mGETTIB: { if (Vm.VerifyAssertions) Vm._assert(isstatic); final RefItem obj = vstack.popRef(); obj.load(ec); final GPR r = obj.getRegister(); // Get TIB os.writeMOV(helper.ADDRSIZE, r, r, ObjectLayout.TIB_SLOT * slotSize); vstack.push(obj); } break; case mGETOBJECTFLAGS: { if (Vm.VerifyAssertions) Vm._assert(isstatic); final RefItem obj = vstack.popRef(); obj.load(ec); final GPR r = obj.getRegister(); // Get flags os.writeMOV(helper.ADDRSIZE, r, r, ObjectLayout.FLAGS_SLOT * slotSize); obj.release(ec); vstack.push(L1AHelper.requestWordRegister(ec, JvmType.REFERENCE, r)); } break; case mSETOBJECTFLAGS: { if (Vm.VerifyAssertions) Vm._assert(isstatic); final RefItem flags = vstack.popRef(); final RefItem obj = vstack.popRef(); flags.load(ec); obj.load(ec); final GPR flagsr = flags.getRegister(); final GPR r = obj.getRegister(); // Set flags os.writeMOV(helper.ADDRSIZE, r, ObjectLayout.FLAGS_SLOT * slotSize, flagsr); flags.release(ec); obj.release(ec); } break; case mGETARRAYDATA: { if (Vm.VerifyAssertions) Vm._assert(isstatic); final RefItem obj = vstack.popRef(); obj.load(ec); final GPR r = obj.getRegister(); os.writeADD(r, VmArray.DATA_OFFSET * slotSize); vstack.push(obj); } break; case mGETOBJECTCOLOR: { if (Vm.VerifyAssertions) Vm._assert(isstatic); final RefItem obj = vstack.popRef(); obj.load(ec); final GPR r = obj.getRegister(); final IntItem result = (IntItem)L1AHelper.requestWordRegister(ec, JvmType.INT, false); final GPR resultr = result.getRegister(); // Get flags os.writeMOV(BITS32, resultr, r, ObjectLayout.FLAGS_SLOT * slotSize); os.writeAND(resultr, ObjectFlags.GC_COLOUR_MASK); obj.release(ec); vstack.push(result); } break; case mISFINALIZED: { if (Vm.VerifyAssertions) Vm._assert(isstatic); final RefItem obj = vstack.popRef(); obj.load(ec); final GPR r = obj.getRegister(); final IntItem result = (IntItem)L1AHelper.requestWordRegister(ec, JvmType.INT, false); final GPR resultr = result.getRegister(); // Get flags os.writeMOV(BITS32, resultr, r, ObjectLayout.FLAGS_SLOT * slotSize); os.writeAND(resultr, ObjectFlags.STATUS_FINALIZED); obj.release(ec); vstack.push(result); } break; case mATOMICADD: case mATOMICAND: case mATOMICOR: case mATOMICSUB: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final RefItem value = vstack.popRef(); final RefItem addr = vstack.popRef(); value.load(ec); addr.load(ec); final X86Register.GPR valuer = (X86Register.GPR)value.getRegister(); final X86Register.GPR r = (X86Register.GPR)addr.getRegister(); os.writePrefix(X86Constants.LOCK_PREFIX); os.writeArithOp(methodCodeToOperation(mcode), r, 0, valuer); value.release(ec); addr.release(ec); } break; case mGETCURRENTFRAME: { if (Vm.VerifyAssertions) Vm._assert(isstatic); final WordItem result = L1AHelper.requestWordRegister(ec, JvmType.REFERENCE, false); final GPR r = result.getRegister(); os.writeMOV(helper.ADDRSIZE, r, helper.BP); vstack.push(result); } break; case mGETTIMESTAMP: { if (Vm.VerifyAssertions) Vm._assert(isstatic); if (os.isCode32()) { final DoubleWordItem result = L1AHelper.requestDoubleWordRegisters(ec, JvmType.LONG, X86Register.EAX, X86Register.EDX); os.writeRDTSC(); vstack.push(result); } else { final DoubleWordItem result = L1AHelper.requestDoubleWordRegister(ec, JvmType.LONG, X86Register.RAX); L1AHelper.requestRegister(ec, X86Register.RDX); os.writeRDTSC(); // Move MSB to upper 32-bit of RDX os.writeSHL(X86Register.RDX, 32); // RAX is zero extended by RDTSC, so an OR of RAX,RDX will combine // the upper 32-bits of RDX and the lower 32-bits of RAX. os.writeOR(X86Register.RAX, X86Register.RDX); // Now free RDX L1AHelper.releaseRegister(ec, X86Register.RDX); vstack.push(result); } } break; case mINTBITSTOFLOAT: case mFLOATTORAWINTBITS: { if (Vm.VerifyAssertions) Vm._assert(isstatic); final WordItem v = (WordItem)vstack.pop(); v.load(ec); final X86Register.GPR r = v.getRegister(); v.release(ec); final int resultType = (mcode == mINTBITSTOFLOAT) ? JvmType.FLOAT : JvmType.INT; vstack.push(L1AHelper.requestWordRegister(ec, resultType, r)); } break; case mLONGBITSTODOUBLE: case mDOUBLETORAWLONGBITS: { if (Vm.VerifyAssertions) Vm._assert(isstatic); final DoubleWordItem v = (DoubleWordItem)vstack.pop(); v.load(ec); final int resultType = (mcode == mLONGBITSTODOUBLE) ? JvmType.DOUBLE : JvmType.LONG; if (os.isCode32()) { final X86Register.GPR lsb = v.getLsbRegister(ec); final X86Register.GPR msb = v.getMsbRegister(ec); v.release(ec); vstack.push(L1AHelper.requestDoubleWordRegisters(ec, resultType, lsb, msb)); } else { final GPR64 vreg = v.getRegister(ec); v.release(ec); vstack.push(L1AHelper.requestDoubleWordRegister(ec, resultType, vreg)); } } break; case mBREAKPOINT: { if (Vm.VerifyAssertions) Vm._assert(isstatic); os.writeINT(3); } break; default: throw new InternalError("Unknown method code for method " + method); } }
|
public void emitMagic(EmitterContext ec, VmMethod method, boolean isstatic) { //final int type = getClass(method); final int mcode = getMethodCode(method); final VirtualStack vstack = ec.getVStack(); final X86Assembler os = ec.getStream(); final ItemFactory ifac = ec.getItemFactory(); final X86RegisterPool pool = ec.getGPRPool(); final X86CompilerContext context = ec.getContext(); final X86CompilerHelper helper = ec.getHelper(); final int slotSize = os.isCode32() ? 4 : 8; switch (mcode) { case mADD: { // addr + ofs if (Vm.VerifyAssertions) Vm._assert(!isstatic); final WordItem ofs = (WordItem) vstack.pop(); final RefItem addr = vstack.popRef(); ofs.load(ec); addr.load(ec); GPR ofsr = ofs.getRegister(); final GPR addrr = addr.getRegister(); if (ofsr.getSize() != addrr.getSize()) { // Sign-extend offset final GPR64 ofsr64 = (GPR64)pool.getRegisterInSameGroup(ofsr, JvmType.REFERENCE); os.writeMOVSXD(ofsr64, (GPR32)ofsr); ofsr = ofsr64; } os.writeADD(addrr, ofsr); ofs.release(ec); vstack.push(addr); } break; case mAND: { // addr & ofs if (Vm.VerifyAssertions) Vm._assert(!isstatic); final WordItem ofs = (WordItem) vstack.pop(); final RefItem addr = vstack.popRef(); ofs.load(ec); addr.load(ec); GPR ofsr = ofs.getRegister(); final GPR addrr = addr.getRegister(); if (ofsr.getSize() != addrr.getSize()) { // Sign-extend offset final GPR64 ofsr64 = (GPR64)pool.getRegisterInSameGroup(ofsr, JvmType.REFERENCE); os.writeMOVSXD(ofsr64, (GPR32)ofsr); ofsr = ofsr64; } os.writeAND(addrr, ofsr); ofs.release(ec); vstack.push(addr); } break; case mOR: { // addr | ofs if (Vm.VerifyAssertions) Vm._assert(!isstatic); final WordItem ofs = (WordItem) vstack.pop(); final RefItem addr = vstack.popRef(); ofs.load(ec); addr.load(ec); GPR ofsr = ofs.getRegister(); final GPR addrr = addr.getRegister(); if (ofsr.getSize() != addrr.getSize()) { // Sign-extend offset final GPR64 ofsr64 = (GPR64)pool.getRegisterInSameGroup(ofsr, JvmType.REFERENCE); os.writeMOVSXD(ofsr64, (GPR32)ofsr); ofsr = ofsr64; } os.writeOR(addrr, ofsr); ofs.release(ec); vstack.push(addr); } break; case mSUB: { // addr - ofs if (Vm.VerifyAssertions) Vm._assert(!isstatic); final WordItem ofs = (WordItem) vstack.pop(); final RefItem addr = vstack.popRef(); ofs.load(ec); addr.load(ec); GPR ofsr = ofs.getRegister(); final GPR addrr = addr.getRegister(); if (ofsr.getSize() != addrr.getSize()) { // Sign-extend offset final GPR64 ofsr64 = (GPR64)pool.getRegisterInSameGroup(ofsr, JvmType.REFERENCE); os.writeMOVSXD(ofsr64, (GPR32)ofsr); ofsr = ofsr64; } os.writeSUB(addrr, ofsr); ofs.release(ec); vstack.push(addr); } break; case mXOR: { // addr ^ ofs if (Vm.VerifyAssertions) Vm._assert(!isstatic); final WordItem ofs = (WordItem) vstack.pop(); final RefItem addr = vstack.popRef(); ofs.load(ec); addr.load(ec); GPR ofsr = ofs.getRegister(); final GPR addrr = addr.getRegister(); if (ofsr.getSize() != addrr.getSize()) { // Sign-extend offset final GPR64 ofsr64 = (GPR64)pool.getRegisterInSameGroup(ofsr, JvmType.REFERENCE); os.writeMOVSXD(ofsr64, (GPR32)ofsr); ofsr = ofsr64; } os.writeXOR(addrr, ofsr); ofs.release(ec); vstack.push(addr); } break; case mNOT: { // !addr if (Vm.VerifyAssertions) Vm._assert(!isstatic); final RefItem addr = vstack.popRef(); addr.load(ec); os.writeNOT(addr.getRegister()); vstack.push(addr); } break; case mTOINT: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final WordItem addr = vstack.popRef(); addr.load(ec); X86Register r = addr.getRegister(); if (os.isCode64()) { r = pool.getRegisterInSameGroup(r, JvmType.INT); // We just take the lower 32-bit, so no actual mov's needed. } addr.release(ec); L1AHelper.requestRegister(ec, r); final IntItem result = (IntItem) ifac.createReg(ec, JvmType.INT, r); pool.transferOwnerTo(r, result); vstack.push(result); } break; case mTOWORD: case mTOADDRESS: case mTOOFFSET: case mTOOBJECT: case mTOOBJECTREFERENCE: case mTOEXTENT: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final WordItem addr = vstack.popRef(); vstack.push(addr); } break; case mTOLONG: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final WordItem addr = vstack.popRef(); addr.load(ec); final X86Register.GPR r = addr.getRegister(); addr.release(ec); L1AHelper.requestRegister(ec, r); final LongItem result; if (os.isCode32()) { final X86Register.GPR msb = (X86Register.GPR)L1AHelper.requestRegister(ec, JvmType.INT, false); result = (LongItem) ifac.createReg(ec, JvmType.LONG, r, msb); os.writeXOR(msb, msb); pool.transferOwnerTo(msb, result); } else { result = (LongItem) ifac.createReg(ec, JvmType.LONG, (GPR64)r); } pool.transferOwnerTo(r, result); vstack.push(result); } break; case mMAX: { if (Vm.VerifyAssertions) Vm._assert(isstatic); final RefItem result = (RefItem) L1AHelper.requestWordRegister(ec, JvmType.REFERENCE, false); final GPR r = result.getRegister(); os.writeMOV_Const(r, -1); vstack.push(result); } break; case mONE: { if (Vm.VerifyAssertions) Vm._assert(isstatic); final RefItem result = (RefItem) L1AHelper.requestWordRegister(ec, JvmType.REFERENCE, false); final GPR r = result.getRegister(); os.writeMOV_Const(r, 1); vstack.push(result); } break; case mZERO: { if (Vm.VerifyAssertions) Vm._assert(isstatic); final RefItem result = ifac.createAConst(ec, null); vstack.push(result); } break; case mISMAX: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final WordItem addr = vstack.popRef(); addr.load(ec); final IntItem result = (IntItem)L1AHelper.requestWordRegister(ec, JvmType.INT, true); final GPR addrr = addr.getRegister(); final GPR resultr = result.getRegister(); os.writeXOR(resultr, resultr); os.writeCMP_Const(addrr, -1); os.writeSETCC(resultr, X86Constants.JE); addr.release(ec); vstack.push(result); } break; case mISZERO: { // Just convert to int if (Vm.VerifyAssertions) Vm._assert(!isstatic); final WordItem addr = vstack.popRef(); addr.load(ec); final IntItem result = (IntItem)L1AHelper.requestWordRegister(ec, JvmType.INT, true); final GPR addrr = addr.getRegister(); final GPR resultr = result.getRegister(); os.writeXOR(resultr, resultr); os.writeTEST(addrr, addrr); os.writeSETCC(resultr, X86Constants.JZ); addr.release(ec); vstack.push(result); } break; case mEQUALS: case mEQ: case mNE: case mLT: case mLE: case mGE: case mGT: case mSLT: case mSLE: case mSGE: case mSGT: { // addr .. other if (Vm.VerifyAssertions) Vm._assert(!isstatic); final RefItem other = vstack.popRef(); final RefItem addr = vstack.popRef(); other.load(ec); addr.load(ec); final IntItem result = (IntItem)L1AHelper.requestWordRegister(ec, JvmType.INT, true); final GPR resultr = result.getRegister(); os.writeXOR(resultr, resultr); os.writeCMP(addr.getRegister(), other.getRegister()); os.writeSETCC(resultr, methodToCC(mcode)); other.release(ec); addr.release(ec); vstack.push(result); } break; case mFROMINT: case mFROMINTSIGNEXTEND: case mFROMINTZEROEXTEND: { if (Vm.VerifyAssertions) Vm._assert(isstatic); final WordItem addr = vstack.popInt(); addr.load(ec); GPR r = addr.getRegister(); if (os.isCode64()) { final GPR64 newR = (GPR64)pool.getRegisterInSameGroup(r, JvmType.REFERENCE); if (mcode == mFROMINTZEROEXTEND) { // Moving the register to itself in 32-bit mode, will // zero extend the top 32-bits. os.writeMOV(BITS32, r, r); } else { // Sign extend os.writeMOVSXD(newR, (GPR32)r); } r = newR; } addr.release(ec); vstack.push(L1AHelper.requestWordRegister(ec, JvmType.REFERENCE, r)); } break; case mFROMADDRESS: case mFROMOBJECT: { if (Vm.VerifyAssertions) Vm._assert(isstatic); final RefItem obj = vstack.popRef(); // Do nothing vstack.push(obj); } break; case mFROMLONG: { if (Vm.VerifyAssertions) Vm._assert(isstatic); final LongItem addr = vstack.popLong(); addr.load(ec); final X86Register r; if (os.isCode32()) { r = addr.getLsbRegister(ec); } else { r = addr.getRegister(ec); } addr.release(ec); vstack.push(L1AHelper.requestWordRegister(ec, JvmType.REFERENCE, r)); } break; case mLSH: case mRSHA: case mRSHL: { // addr shift cnt if (Vm.VerifyAssertions) Vm._assert(!isstatic); final IntItem cnt = vstack.popInt(); final RefItem addr = vstack.popRef(); if (!cnt.isConstant()) { L1AHelper.requestRegister(ec, X86Register.ECX); cnt.loadTo(ec, X86Register.ECX); } addr.load(ec); final int shift = methodToShift(mcode); if (cnt.isConstant()) { os.writeShift(shift, addr.getRegister(), cnt.getValue()); } else { os.writeShift_CL(shift, addr.getRegister()); } cnt.release(ec); vstack.push(addr); } break; case mLOADBYTE: case mLOADCHAR: case mLOADSHORT: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final RefItem addr = vstack.popRef(); addr.loadToBITS8GPR(ec); final GPR r = addr.getRegister(); final WordItem result = L1AHelper.requestWordRegister(ec, methodToType(mcode), true); final GPR resultr = result.getRegister(); if (mcode == mLOADCHAR) { os.writeMOVZX(resultr, r, 0, methodToSize(mcode)); } else { os.writeMOVSX(resultr, r, 0, methodToSize(mcode)); } addr.release(ec); vstack.push(result); } break; case mLOADINT: case mLOADFLOAT: case mLOADADDRESS: case mLOADOBJECTREFERENCE: case mLOADWORD: case mPREPAREINT: case mPREPAREADDRESS: case mPREPAREOBJECTREFERENCE: case mPREPAREWORD: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final RefItem addr = vstack.popRef(); addr.load(ec); final GPR r = addr.getRegister(); final WordItem result = L1AHelper.requestWordRegister(ec, methodToType(mcode), false); final GPR resultr = result.getRegister(); os.writeMOV(resultr.getSize(), resultr, r, 0); addr.release(ec); vstack.push(result); } break; case mLOADLONG: case mLOADDOUBLE: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final RefItem addr = vstack.popRef(); addr.load(ec); final X86Register.GPR r = addr.getRegister(); if (os.isCode32()) { final X86Register.GPR msb = (X86Register.GPR)L1AHelper.requestRegister(ec, JvmType.INT, false); addr.release(ec); L1AHelper.releaseRegister(ec, msb); os.writeMOV(X86CompilerConstants.INTSIZE, msb, r, X86CompilerConstants.MSB); os.writeMOV(X86CompilerConstants.INTSIZE, r, r, X86CompilerConstants.LSB); vstack.push(L1AHelper.requestDoubleWordRegisters(ec, methodToType(mcode), r, msb)); } else { final DoubleWordItem result = L1AHelper.requestDoubleWordRegisters(ec, methodToType(mcode)); os.writeMOV(BITS64, result.getRegister(ec), r, 0); addr.release(ec); vstack.push(result); } } break; case mLOADBYTE_OFS: case mLOADCHAR_OFS: case mLOADSHORT_OFS: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final RefItem ofs = vstack.popRef(); final RefItem addr = vstack.popRef(); ofs.load(ec); addr.load(ec); final GPR ofsr = ofs.getRegister(); final GPR r = addr.getRegister(); os.writeLEA(r, r, ofsr, 1, 0); final WordItem result = L1AHelper.requestWordRegister(ec, methodToType(mcode), true); final GPR resultr = result.getRegister(); if (mcode == mLOADCHAR_OFS) { os.writeMOVZX(resultr, r, 0, methodToSize(mcode)); } else { os.writeMOVSX(resultr, r, 0, methodToSize(mcode)); } ofs.release(ec); addr.release(ec); vstack.push(result); } break; case mLOADINT_OFS: case mLOADFLOAT_OFS: case mLOADADDRESS_OFS: case mLOADOBJECTREFERENCE_OFS: case mLOADWORD_OFS: case mPREPAREINT_OFS: case mPREPAREADDRESS_OFS: case mPREPAREOBJECTREFERENCE_OFS: case mPREPAREWORD_OFS: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final RefItem ofs = vstack.popRef(); final RefItem addr = vstack.popRef(); ofs.load(ec); addr.load(ec); final GPR ofsr = ofs.getRegister(); final GPR r = addr.getRegister(); final WordItem result = L1AHelper.requestWordRegister(ec, methodToType(mcode), false); final GPR resultr = result.getRegister(); os.writeMOV(resultr.getSize(), resultr, r, ofsr, 1, 0); ofs.release(ec); addr.release(ec); vstack.push(result); } break; case mLOADLONG_OFS: case mLOADDOUBLE_OFS: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final RefItem ofs = vstack.popRef(); final RefItem addr = vstack.popRef(); ofs.load(ec); addr.load(ec); final GPR ofsr = ofs.getRegister(); final GPR r = addr.getRegister(); if (os.isCode32()) { final GPR msb = (GPR)L1AHelper.requestRegister(ec, JvmType.INT, false); os.writeMOV(X86CompilerConstants.INTSIZE, msb, r, ofsr, 1, X86CompilerConstants.MSB); os.writeMOV(X86CompilerConstants.INTSIZE, r, r, ofsr, 1, X86CompilerConstants.LSB); ofs.release(ec); addr.release(ec); L1AHelper.releaseRegister(ec, msb); vstack.push(L1AHelper.requestDoubleWordRegisters(ec, methodToType(mcode), r, msb)); } else { final DoubleWordItem result = L1AHelper.requestDoubleWordRegisters(ec, methodToType(mcode)); os.writeMOV(BITS64, result.getRegister(ec), r, ofsr, 1, 0); addr.release(ec); ofs.release(ec); vstack.push(result); } } break; case mSTOREBYTE: case mSTORECHAR: case mSTORESHORT: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final IntItem val = vstack.popInt(); final RefItem addr = vstack.popRef(); val.loadToBITS8GPR(ec); addr.load(ec); final GPR r = addr.getRegister(); final GPR valr = val.getRegister(); os.writeMOV(methodToSize(mcode), r, 0, valr); val.release(ec); addr.release(ec); } break; case mSTOREINT: case mSTOREFLOAT: case mSTOREADDRESS: case mSTOREOBJECTREFERENCE: case mSTOREWORD: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final WordItem val = (WordItem)vstack.pop(); final RefItem addr = vstack.popRef(); val.load(ec); addr.load(ec); final GPR r = addr.getRegister(); final GPR valr = val.getRegister(); os.writeMOV(valr.getSize(), r, 0, valr); val.release(ec); addr.release(ec); } break; case mSTORELONG: case mSTOREDOUBLE: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final DoubleWordItem val = (DoubleWordItem)vstack.pop(); final RefItem addr = vstack.popRef(); val.load(ec); addr.load(ec); final GPR r = addr.getRegister(); if (os.isCode32()) { final GPR lsb = val.getLsbRegister(ec); final GPR msb = val.getMsbRegister(ec); os.writeMOV(X86CompilerConstants.INTSIZE, r, X86CompilerConstants.LSB, lsb); os.writeMOV(X86CompilerConstants.INTSIZE, r, X86CompilerConstants.MSB, msb); } else { final GPR64 valr = val.getRegister(ec); os.writeMOV(BITS64, r, 0, valr); } val.release(ec); addr.release(ec); } break; case mSTOREBYTE_OFS: case mSTORECHAR_OFS: case mSTORESHORT_OFS: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final RefItem ofs = vstack.popRef(); final IntItem val = vstack.popInt(); final RefItem addr = vstack.popRef(); ofs.load(ec); val.loadToBITS8GPR(ec); addr.load(ec); final GPR r = addr.getRegister(); final GPR ofsr = ofs.getRegister(); final GPR valr = val.getRegister(); os.writeMOV(methodToSize(mcode), r, ofsr, 1, 0, valr); ofs.release(ec); val.release(ec); addr.release(ec); } break; case mSTOREINT_OFS: case mSTOREFLOAT_OFS: case mSTOREADDRESS_OFS: case mSTOREOBJECTREFERENCE_OFS: case mSTOREWORD_OFS: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final RefItem ofs = vstack.popRef(); final WordItem val = (WordItem)vstack.pop(); final RefItem addr = vstack.popRef(); ofs.load(ec); val.load(ec); addr.load(ec); final GPR r = addr.getRegister(); final GPR ofsr = ofs.getRegister(); final GPR valr = val.getRegister(); os.writeMOV(valr.getSize(), r, ofsr, 1, 0, valr); ofs.release(ec); val.release(ec); addr.release(ec); } break; case mSTORELONG_OFS: case mSTOREDOUBLE_OFS: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final RefItem ofs = vstack.popRef(); final DoubleWordItem val = (DoubleWordItem)vstack.pop(); final RefItem addr = vstack.popRef(); ofs.load(ec); val.load(ec); addr.load(ec); final GPR r = addr.getRegister(); final GPR ofsr = ofs.getRegister(); if (os.isCode32()) { final GPR lsb = val.getLsbRegister(ec); final GPR msb = val.getMsbRegister(ec); os.writeMOV(X86CompilerConstants.INTSIZE, r, ofsr, 1, X86CompilerConstants.LSB, lsb); os.writeMOV(X86CompilerConstants.INTSIZE, r, ofsr, 1, X86CompilerConstants.MSB, msb); } else { final GPR64 valr = val.getRegister(ec); os.writeMOV(BITS64, r, ofsr, 1, 0, valr); } ofs.release(ec); val.release(ec); addr.release(ec); } break; case mATTEMPTINT: case mATTEMPTADDRESS: case mATTEMPTOBJECTREFERENCE: case mATTEMPTWORD: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final WordItem val = (WordItem)vstack.pop(); final WordItem old = (WordItem)vstack.pop(); final RefItem addr = vstack.popRef(); final X86Register.GPR aax; if ((mcode == mATTEMPTINT) || os.isCode32()) { aax = X86Register.EAX; } else { aax = X86Register.RAX; } if (!old.uses(aax)) { L1AHelper.requestRegister(ec, aax, old); val.load(ec); old.loadTo(ec, aax); } else { val.load(ec); } addr.load(ec); final IntItem result = (IntItem)L1AHelper.requestWordRegister(ec, JvmType.INT, true); final GPR resultr = result.getRegister(); final GPR r = addr.getRegister(); final GPR valr = val.getRegister(); os.writeCMPXCHG_EAX(r, 0, valr, true); os.writeSETCC(resultr, X86Constants.JZ); os.writeAND(resultr, 0xFF); val.release(ec); old.release(ec); addr.release(ec); vstack.push(L1AHelper.requestWordRegister(ec, JvmType.INT, resultr)); } break; case mATTEMPTINT_OFS: case mATTEMPTADDRESS_OFS: case mATTEMPTOBJECTREFERENCE_OFS: case mATTEMPTWORD_OFS: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final RefItem ofs = vstack.popRef(); final WordItem val = (WordItem)vstack.pop(); final WordItem old = (WordItem)vstack.pop(); final RefItem addr = vstack.popRef(); final X86Register.GPR aax; if ((mcode == mATTEMPTINT) || os.isCode32()) { aax = X86Register.EAX; } else { aax = X86Register.RAX; } if (!old.uses(aax)) { L1AHelper.requestRegister(ec, aax, old); ofs.load(ec); val.load(ec); old.loadTo(ec, aax); } else { ofs.load(ec); val.load(ec); } addr.load(ec); final IntItem result = (IntItem)L1AHelper.requestWordRegister(ec, JvmType.INT, true); final GPR resultr = result.getRegister(); final GPR r = addr.getRegister(); final GPR valr = val.getRegister(); final GPR ofsr = ofs.getRegister(); os.writeLEA(r, r, ofsr, 1, 0); os.writeCMPXCHG_EAX(r, 0, valr, true); os.writeSETCC(resultr, X86Constants.JZ); os.writeAND(resultr, 0xFF); ofs.release(ec); val.release(ec); old.release(ec); addr.release(ec); vstack.push(L1AHelper.requestWordRegister(ec, JvmType.INT, resultr)); } break; case mGETOBJECTTYPE: { if (Vm.VerifyAssertions) Vm._assert(isstatic); final RefItem obj = vstack.popRef(); obj.load(ec); final GPR r = obj.getRegister(); // Get TIB os.writeMOV(helper.ADDRSIZE, r, r, ObjectLayout.TIB_SLOT * slotSize); // Get VmType os.writeMOV(helper.ADDRSIZE, r, r, (TIBLayout.VMTYPE_INDEX + VmArray.DATA_OFFSET) * slotSize); vstack.push(obj); } break; case mGETTIB: { if (Vm.VerifyAssertions) Vm._assert(isstatic); final RefItem obj = vstack.popRef(); obj.load(ec); final GPR r = obj.getRegister(); // Get TIB os.writeMOV(helper.ADDRSIZE, r, r, ObjectLayout.TIB_SLOT * slotSize); vstack.push(obj); } break; case mGETOBJECTFLAGS: { if (Vm.VerifyAssertions) Vm._assert(isstatic); final RefItem obj = vstack.popRef(); obj.load(ec); final GPR r = obj.getRegister(); // Get flags os.writeMOV(helper.ADDRSIZE, r, r, ObjectLayout.FLAGS_SLOT * slotSize); obj.release(ec); vstack.push(L1AHelper.requestWordRegister(ec, JvmType.REFERENCE, r)); } break; case mSETOBJECTFLAGS: { if (Vm.VerifyAssertions) Vm._assert(isstatic); final RefItem flags = vstack.popRef(); final RefItem obj = vstack.popRef(); flags.load(ec); obj.load(ec); final GPR flagsr = flags.getRegister(); final GPR r = obj.getRegister(); // Set flags os.writeMOV(helper.ADDRSIZE, r, ObjectLayout.FLAGS_SLOT * slotSize, flagsr); flags.release(ec); obj.release(ec); } break; case mGETARRAYDATA: { if (Vm.VerifyAssertions) Vm._assert(isstatic); final RefItem obj = vstack.popRef(); obj.load(ec); final GPR r = obj.getRegister(); os.writeADD(r, VmArray.DATA_OFFSET * slotSize); vstack.push(obj); } break; case mGETOBJECTCOLOR: { if (Vm.VerifyAssertions) Vm._assert(isstatic); final RefItem obj = vstack.popRef(); obj.load(ec); final GPR r = obj.getRegister(); final IntItem result = (IntItem)L1AHelper.requestWordRegister(ec, JvmType.INT, false); final GPR resultr = result.getRegister(); // Get flags os.writeMOV(BITS32, resultr, r, ObjectLayout.FLAGS_SLOT * slotSize); os.writeAND(resultr, ObjectFlags.GC_COLOUR_MASK); obj.release(ec); vstack.push(result); } break; case mISFINALIZED: { if (Vm.VerifyAssertions) Vm._assert(isstatic); final RefItem obj = vstack.popRef(); obj.load(ec); final GPR r = obj.getRegister(); final IntItem result = (IntItem)L1AHelper.requestWordRegister(ec, JvmType.INT, false); final GPR resultr = result.getRegister(); // Get flags os.writeMOV(BITS32, resultr, r, ObjectLayout.FLAGS_SLOT * slotSize); os.writeAND(resultr, ObjectFlags.STATUS_FINALIZED); obj.release(ec); vstack.push(result); } break; case mATOMICADD: case mATOMICAND: case mATOMICOR: case mATOMICSUB: { if (Vm.VerifyAssertions) Vm._assert(!isstatic); final RefItem value = vstack.popRef(); final RefItem addr = vstack.popRef(); value.load(ec); addr.load(ec); final X86Register.GPR valuer = (X86Register.GPR)value.getRegister(); final X86Register.GPR r = (X86Register.GPR)addr.getRegister(); os.writePrefix(X86Constants.LOCK_PREFIX); os.writeArithOp(methodCodeToOperation(mcode), r, 0, valuer); value.release(ec); addr.release(ec); } break; case mGETCURRENTFRAME: { if (Vm.VerifyAssertions) Vm._assert(isstatic); final WordItem result = L1AHelper.requestWordRegister(ec, JvmType.REFERENCE, false); final GPR r = result.getRegister(); os.writeMOV(helper.ADDRSIZE, r, helper.BP); vstack.push(result); } break; case mGETTIMESTAMP: { if (Vm.VerifyAssertions) Vm._assert(isstatic); if (os.isCode32()) { final DoubleWordItem result = L1AHelper.requestDoubleWordRegisters(ec, JvmType.LONG, X86Register.EAX, X86Register.EDX); os.writeRDTSC(); vstack.push(result); } else { final DoubleWordItem result = L1AHelper.requestDoubleWordRegister(ec, JvmType.LONG, X86Register.RAX); L1AHelper.requestRegister(ec, X86Register.RDX); os.writeRDTSC(); // Move MSB to upper 32-bit of RDX os.writeSHL(X86Register.RDX, 32); // RAX is zero extended by RDTSC, so an OR of RAX,RDX will combine // the upper 32-bits of RDX and the lower 32-bits of RAX. os.writeOR(X86Register.RAX, X86Register.RDX); // Now free RDX L1AHelper.releaseRegister(ec, X86Register.RDX); vstack.push(result); } } break; case mINTBITSTOFLOAT: case mFLOATTORAWINTBITS: { if (Vm.VerifyAssertions) Vm._assert(isstatic); final WordItem v = (WordItem)vstack.pop(); v.load(ec); final X86Register.GPR r = v.getRegister(); v.release(ec); final int resultType = (mcode == mINTBITSTOFLOAT) ? JvmType.FLOAT : JvmType.INT; vstack.push(L1AHelper.requestWordRegister(ec, resultType, r)); } break; case mLONGBITSTODOUBLE: case mDOUBLETORAWLONGBITS: { if (Vm.VerifyAssertions) Vm._assert(isstatic); final DoubleWordItem v = (DoubleWordItem)vstack.pop(); v.load(ec); final int resultType = (mcode == mLONGBITSTODOUBLE) ? JvmType.DOUBLE : JvmType.LONG; if (os.isCode32()) { final X86Register.GPR lsb = v.getLsbRegister(ec); final X86Register.GPR msb = v.getMsbRegister(ec); v.release(ec); vstack.push(L1AHelper.requestDoubleWordRegisters(ec, resultType, lsb, msb)); } else { final GPR64 vreg = v.getRegister(ec); v.release(ec); vstack.push(L1AHelper.requestDoubleWordRegister(ec, resultType, vreg)); } } break; case mBREAKPOINT: { if (Vm.VerifyAssertions) Vm._assert(isstatic); os.writeINT(3); } break; default: throw new InternalError("Unknown method code for method " + method); } }
| 11,414
|
public BorderUIResource(Border delegate) { this.delegate = delegate; }
|
public BorderUIResource(Border delegate) { this.delegate = delegate; }
| 11,416
|
public static Border createBevelBorder( int type, Color highlightOuter, Color highlightInner, Color shadowOuter, Color shadowInner) { /* Create a beveled border of the specified type, using the specified colors for the inner and outer highlight and shadow areas. Parameters: type - an int specifying either BevelBorder.LOWERED or BevelBorder.LOWEREDhighlightOuter - a Color object for the outer edge of the highlight areahighlightInner - a Color object for the inner edge of the highlight areashadowOuter - a Color object for the outer edge of the shadow areashadowInner - a Color object for the inner edge of the shadow areaReturns: the Border object createEtchedBorder */ return null; }
|
public static Border createBevelBorder( int type, Color highlightOuter, Color highlightInner, Color shadowOuter, Color shadowInner) { /* Create a beveled border of the specified type, using the specified colors for the inner and outer highlight and shadow areas. Parameters: type - an int specifying either BevelBorder.LOWERED or BevelBorder.LOWEREDhighlightOuter - a Color object for the outer edge of the highlight areahighlightInner - a Color object for the inner edge of the highlight areashadowOuter - a Color object for the outer edge of the shadow areashadowInner - a Color object for the inner edge of the shadow areaReturns: the Border object createEtchedBorder */ return null; }
| 11,417
|
TemplateNode clone(Stylesheet stylesheet) { TemplateNode ret = new CommentNode(); if (children != null) { ret.children = children.clone(stylesheet); } if (next != null) { ret.next = next.clone(stylesheet); } return ret; }
|
TemplateNode clone(Stylesheet stylesheet) TemplateNode ret = new CommentNode(); if (children != null) ret.children = children.clone(stylesheet); } if (next != null) ret.next = next.clone(stylesheet); } return ret; }
| 11,418
|
TemplateNode clone(Stylesheet stylesheet) { TemplateNode ret = new CommentNode(); if (children != null) { ret.children = children.clone(stylesheet); } if (next != null) { ret.next = next.clone(stylesheet); } return ret; }
|
TemplateNode clone(Stylesheet stylesheet) { TemplateNode ret = new CommentNode(); if (children != null) { ret.children = children.clone(stylesheet); if (next != null) { ret.next = next.clone(stylesheet); return ret;
| 11,419
|
void doApply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException { String value = ""; Document doc = (parent instanceof Document) ? (Document) parent : parent.getOwnerDocument(); if (children != null) { // Create a document fragment to hold the text DocumentFragment fragment = doc.createDocumentFragment(); // Apply children to the fragment children.apply(stylesheet, mode, context, pos, len, fragment, null); // Use XPath string-value of fragment value = Expr.stringValue(fragment); } Comment comment = doc.createComment(value); // Insert into result tree if (nextSibling != null) { parent.insertBefore(comment, nextSibling); } else { parent.appendChild(comment); } if (next != null) { next.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } }
|
void doApply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException String value = ""; Document doc = (parent instanceof Document) ? (Document) parent : parent.getOwnerDocument(); if (children != null) // Create a document fragment to hold the text DocumentFragment fragment = doc.createDocumentFragment(); // Apply children to the fragment children.apply(stylesheet, mode, context, pos, len, fragment, null); // Use XPath string-value of fragment value = Expr.stringValue(fragment); } Comment comment = doc.createComment(value); // Insert into result tree if (nextSibling != null) parent.insertBefore(comment, nextSibling); } else parent.appendChild(comment); } if (next != null) next.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } }
| 11,420
|
void doApply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException { String value = ""; Document doc = (parent instanceof Document) ? (Document) parent : parent.getOwnerDocument(); if (children != null) { // Create a document fragment to hold the text DocumentFragment fragment = doc.createDocumentFragment(); // Apply children to the fragment children.apply(stylesheet, mode, context, pos, len, fragment, null); // Use XPath string-value of fragment value = Expr.stringValue(fragment); } Comment comment = doc.createComment(value); // Insert into result tree if (nextSibling != null) { parent.insertBefore(comment, nextSibling); } else { parent.appendChild(comment); } if (next != null) { next.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } }
|
void doApply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException { String value = ""; Document doc = (parent instanceof Document) ? (Document) parent : parent.getOwnerDocument(); if (children != null) { // Create a document fragment to hold the text DocumentFragment fragment = doc.createDocumentFragment(); // Apply children to the fragment children.apply(stylesheet, mode, context, pos, len, fragment, null); // Use XPath string-value of fragment value = Expr.stringValue(fragment); Comment comment = doc.createComment(value); // Insert into result tree if (nextSibling != null) { parent.insertBefore(comment, nextSibling); else { parent.appendChild(comment); if (next != null) { next.apply(stylesheet, mode, context, pos, len, parent, nextSibling);
| 11,421
|
public String toString() { StringBuffer buf = new StringBuffer(getClass().getName()); buf.append('['); buf.append(']'); return buf.toString(); }
|
public String toString() { StringBuffer buf = new StringBuffer(getClass().getName()); buf.append('['); buf.append(']'); return buf.toString(); }
| 11,422
|
public WrongAdapter(String why) { super(why); }
|
public WrongAdapter() { super(why); }
| 11,424
|
public WrongAdapter(String why) { super(why); }
|
public WrongAdapter(String why) { }
| 11,425
|
protected Item cloneConstant() { return createConst(getValue()); }
|
protected DoubleWordItem cloneConstant() { return createConst(getValue()); }
| 11,426
|
protected abstract Item cloneConstant();
|
protected abstract DoubleWordItem cloneConstant();
| 11,427
|
protected Inet4Address(byte[] addr, String host) { super(addr, host); }
|
protected Inet4Address(byte[] addr, String host) { super(addr, host); }
| 11,428
|
public boolean equals(Object obj) { if (obj == null || !(obj instanceof InetAddress)) return false; byte[] addr1 = addr; byte[] addr2 = ((InetAddress) obj).addr; if (addr1.length != addr2.length) return false; for (int i = addr1.length; --i >= 0;) if (addr1[i] != addr2[i]) return false; return true; }
|
public boolean equals(Object obj) { if (obj == null || !(obj instanceof InetAddress)) return false; byte[] addr1 = addr; byte[] addr2 = ((InetAddress) obj).addr; if (addr1.length != addr2.length) return false; for (int i = addr1.length; --i >= 0;) if (addr1[i] != addr2[i]) return false; return true; }
| 11,429
|
public boolean isAnyLocalAddress() { return (addr[0] == 0) && (addr[1] == 0) && (addr[2] == 0) && (addr[3] == 0); }
|
public boolean isAnyLocalAddress() { return (addr[0] == 0) && (addr[1] == 0) && (addr[2] == 0) && (addr[3] == 0); }
| 11,430
|
private Object writeReplace() throws ObjectStreamException { return new InetAddress(addr, hostName); }
|
private Object writeReplace() throws ObjectStreamException { return new InetAddress(addr, hostName); }
| 11,431
|
public Dimension getPreferredScrollableViewportSize() { return null; }
|
public Dimension getPreferredScrollableViewportSize() { return getPreferredSize(); }
| 11,435
|
public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction) { return 1; }
|
public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction) { if (orientation == VERTICAL) return visibleRect.height * direction; else return visibleRect.width * direction; }
| 11,436
|
public static String encode(String s) { try { return encode(s, "UTF-8"); } catch (UnsupportedEncodingException uee) { // Should never happen since UTF-8 should always be supported return s; } }
|
public static String encode(String s) { try { return encode(s, System.getProperty("file.encoding", "8859_1")); } catch (UnsupportedEncodingException uee) { // Should never happen since UTF-8 should always be supported return s; } }
| 11,440
|
public abstract void addChangeListener(ChangeListener listener);
|
void addChangeListener(ChangeListener listener);
| 11,441
|
public abstract void removeChangeListener(ChangeListener listener);
|
void removeChangeListener(ChangeListener listener);
| 11,442
|
protected void addImpl(Component comp, Object constraints, int index) { synchronized (getTreeLock ()) { if (index > ncomponents || (index < 0 && index != -1) || comp instanceof Window || (comp instanceof Container && ((Container) comp).isAncestorOf(this))) throw new IllegalArgumentException(); // Reparent component, and make sure component is instantiated if // we are. if (comp.parent != null) comp.parent.remove(comp); comp.parent = this; if (peer != null) { // Notify the component that it has a new parent. comp.addNotify(); if (comp.isLightweight ()) { enableEvents (comp.eventMask); if (!isLightweight ()) enableEvents (AWTEvent.PAINT_EVENT_MASK); } } // Invalidate the layout of the added component and its ancestors. comp.invalidate(); if (component == null) component = new Component[4]; // FIXME, better initial size? // This isn't the most efficient implementation. We could do less // copying when growing the array. It probably doesn't matter. if (ncomponents >= component.length) { int nl = component.length * 2; Component[] c = new Component[nl]; System.arraycopy(component, 0, c, 0, ncomponents); component = c; } if (index == -1) component[ncomponents++] = comp; else { System.arraycopy(component, index, component, index + 1, ncomponents - index); component[index] = comp; ++ncomponents; } // Notify the layout manager. if (layoutMgr != null) { if (layoutMgr instanceof LayoutManager2) { LayoutManager2 lm2 = (LayoutManager2) layoutMgr; lm2.addLayoutComponent(comp, constraints); } else if (constraints instanceof String) layoutMgr.addLayoutComponent((String) constraints, comp); else layoutMgr.addLayoutComponent(null, comp); } if (isShowing ()) { // Post event to notify of adding the component. ContainerEvent ce = new ContainerEvent(this, ContainerEvent.COMPONENT_ADDED, comp); getToolkit().getSystemEventQueue().postEvent(ce); // Repaint this container. repaint(); } } }
|
protected void addImpl(Component comp, Object constraints, int index) { synchronized (getTreeLock ()) { if (index > ncomponents || (index < 0 && index != -1) || comp instanceof Window || (comp instanceof Container && ((Container) comp).isAncestorOf(this))) throw new IllegalArgumentException(); // Reparent component, and make sure component is instantiated if // we are. if (comp.parent != null) comp.parent.remove(comp); comp.parent = this; if (peer != null) { // Notify the component that it has a new parent. comp.addNotify(); if (comp.isLightweight ()) { enableEvents (comp.eventMask); if (!isLightweight ()) enableEvents (AWTEvent.PAINT_EVENT_MASK); } } // Invalidate the layout of the added component and its ancestors. comp.invalidate(); if (component == null) component = new Component[4]; // FIXME, better initial size? // This isn't the most efficient implementation. We could do less // copying when growing the array. It probably doesn't matter. if (ncomponents >= component.length) { int nl = component.length * 2; Component[] c = new Component[nl]; System.arraycopy(component, 0, c, 0, ncomponents); component = c; } if (index == -1) component[ncomponents++] = comp; else { System.arraycopy(component, index, component, index + 1, ncomponents - index); component[index] = comp; ++ncomponents; } // Notify the layout manager. if (layoutMgr != null) { if (layoutMgr instanceof LayoutManager2) { LayoutManager2 lm2 = (LayoutManager2) layoutMgr; lm2.addLayoutComponent(comp, constraints); } else if (constraints instanceof String) layoutMgr.addLayoutComponent((String) constraints, comp); else layoutMgr.addLayoutComponent(null, comp); } if (isShowing ()) { // Post event to notify of adding the component. ContainerEvent ce = new ContainerEvent(this, ContainerEvent.COMPONENT_ADDED, comp); getToolkit().getSystemEventQueue().postEvent(ce); // Repaint this container. repaint(); } } }
| 11,443
|
protected void addImpl(Component comp, Object constraints, int index) { synchronized (getTreeLock ()) { if (index > ncomponents || (index < 0 && index != -1) || comp instanceof Window || (comp instanceof Container && ((Container) comp).isAncestorOf(this))) throw new IllegalArgumentException(); // Reparent component, and make sure component is instantiated if // we are. if (comp.parent != null) comp.parent.remove(comp); comp.parent = this; if (peer != null) { // Notify the component that it has a new parent. comp.addNotify(); if (comp.isLightweight ()) { enableEvents (comp.eventMask); if (!isLightweight ()) enableEvents (AWTEvent.PAINT_EVENT_MASK); } } // Invalidate the layout of the added component and its ancestors. comp.invalidate(); if (component == null) component = new Component[4]; // FIXME, better initial size? // This isn't the most efficient implementation. We could do less // copying when growing the array. It probably doesn't matter. if (ncomponents >= component.length) { int nl = component.length * 2; Component[] c = new Component[nl]; System.arraycopy(component, 0, c, 0, ncomponents); component = c; } if (index == -1) component[ncomponents++] = comp; else { System.arraycopy(component, index, component, index + 1, ncomponents - index); component[index] = comp; ++ncomponents; } // Notify the layout manager. if (layoutMgr != null) { if (layoutMgr instanceof LayoutManager2) { LayoutManager2 lm2 = (LayoutManager2) layoutMgr; lm2.addLayoutComponent(comp, constraints); } else if (constraints instanceof String) layoutMgr.addLayoutComponent((String) constraints, comp); else layoutMgr.addLayoutComponent(null, comp); } if (isShowing ()) { // Post event to notify of adding the component. ContainerEvent ce = new ContainerEvent(this, ContainerEvent.COMPONENT_ADDED, comp); getToolkit().getSystemEventQueue().postEvent(ce); // Repaint this container. repaint(); } } }
|
protected void addImpl(Component comp, Object constraints, int index) { synchronized (getTreeLock ()) { if (index > ncomponents || (index < 0 && index != -1) || comp instanceof Window || (comp instanceof Container && ((Container) comp).isAncestorOf(this))) throw new IllegalArgumentException(); // Reparent component, and make sure component is instantiated if // we are. if (comp.parent != null) comp.parent.remove(comp); comp.parent = this; if (peer != null) { // Notify the component that it has a new parent. comp.addNotify(); if (comp.isLightweight ()) { enableEvents (comp.eventMask); if (!isLightweight ()) enableEvents (AWTEvent.PAINT_EVENT_MASK); } } // Invalidate the layout of the added component and its ancestors. comp.invalidate(); if (component == null) component = new Component[4]; // FIXME, better initial size? // This isn't the most efficient implementation. We could do less // copying when growing the array. It probably doesn't matter. if (ncomponents >= component.length) { int nl = component.length * 2; Component[] c = new Component[nl]; System.arraycopy(component, 0, c, 0, ncomponents); component = c; } if (index == -1) component[ncomponents++] = comp; else { System.arraycopy(component, index, component, index + 1, ncomponents - index); component[index] = comp; ++ncomponents; } // Notify the layout manager. if (layoutMgr != null) { if (layoutMgr instanceof LayoutManager2) { LayoutManager2 lm2 = (LayoutManager2) layoutMgr; lm2.addLayoutComponent(comp, constraints); } else if (constraints instanceof String) layoutMgr.addLayoutComponent((String) constraints, comp); else layoutMgr.addLayoutComponent(null, comp); } if (isShowing ()) { // Post event to notify of adding the component. ContainerEvent ce = new ContainerEvent(this, ContainerEvent.COMPONENT_ADDED, comp); ContainerListener[] listeners = getContainerListeners(); for (int i = 0; i < listeners.length; i++) listeners[i].componentAdded(ce); // Repaint this container. repaint(); } } }
| 11,444
|
protected void addImpl(Component comp, Object constraints, int index) { synchronized (getTreeLock ()) { if (index > ncomponents || (index < 0 && index != -1) || comp instanceof Window || (comp instanceof Container && ((Container) comp).isAncestorOf(this))) throw new IllegalArgumentException(); // Reparent component, and make sure component is instantiated if // we are. if (comp.parent != null) comp.parent.remove(comp); comp.parent = this; if (peer != null) { // Notify the component that it has a new parent. comp.addNotify(); if (comp.isLightweight ()) { enableEvents (comp.eventMask); if (!isLightweight ()) enableEvents (AWTEvent.PAINT_EVENT_MASK); } } // Invalidate the layout of the added component and its ancestors. comp.invalidate(); if (component == null) component = new Component[4]; // FIXME, better initial size? // This isn't the most efficient implementation. We could do less // copying when growing the array. It probably doesn't matter. if (ncomponents >= component.length) { int nl = component.length * 2; Component[] c = new Component[nl]; System.arraycopy(component, 0, c, 0, ncomponents); component = c; } if (index == -1) component[ncomponents++] = comp; else { System.arraycopy(component, index, component, index + 1, ncomponents - index); component[index] = comp; ++ncomponents; } // Notify the layout manager. if (layoutMgr != null) { if (layoutMgr instanceof LayoutManager2) { LayoutManager2 lm2 = (LayoutManager2) layoutMgr; lm2.addLayoutComponent(comp, constraints); } else if (constraints instanceof String) layoutMgr.addLayoutComponent((String) constraints, comp); else layoutMgr.addLayoutComponent(null, comp); } if (isShowing ()) { // Post event to notify of adding the component. ContainerEvent ce = new ContainerEvent(this, ContainerEvent.COMPONENT_ADDED, comp); getToolkit().getSystemEventQueue().postEvent(ce); // Repaint this container. repaint(); } } }
|
protected void addImpl(Component comp, Object constraints, int index) { synchronized (getTreeLock ()) { if (index > ncomponents || (index < 0 && index != -1) || comp instanceof Window || (comp instanceof Container && ((Container) comp).isAncestorOf(this))) throw new IllegalArgumentException(); // Reparent component, and make sure component is instantiated if // we are. if (comp.parent != null) comp.parent.remove(comp); comp.parent = this; if (peer != null) { // Notify the component that it has a new parent. comp.addNotify(); if (comp.isLightweight ()) { enableEvents (comp.eventMask); if (!isLightweight ()) enableEvents (AWTEvent.PAINT_EVENT_MASK); } } // Invalidate the layout of the added component and its ancestors. comp.invalidate(); if (component == null) component = new Component[4]; // FIXME, better initial size? // This isn't the most efficient implementation. We could do less // copying when growing the array. It probably doesn't matter. if (ncomponents >= component.length) { int nl = component.length * 2; Component[] c = new Component[nl]; System.arraycopy(component, 0, c, 0, ncomponents); component = c; } if (index == -1) component[ncomponents++] = comp; else { System.arraycopy(component, index, component, index + 1, ncomponents - index); component[index] = comp; ++ncomponents; } // Notify the layout manager. if (layoutMgr != null) { if (layoutMgr instanceof LayoutManager2) { LayoutManager2 lm2 = (LayoutManager2) layoutMgr; lm2.addLayoutComponent(comp, constraints); } else if (constraints instanceof String) layoutMgr.addLayoutComponent((String) constraints, comp); else layoutMgr.addLayoutComponent(null, comp); } if (isShowing ()) { // Post event to notify of adding the component. ContainerEvent ce = new ContainerEvent(this, ContainerEvent.COMPONENT_ADDED, comp); getToolkit().getSystemEventQueue().postEvent(ce); // Repaint this container. repaint(); } } }
| 11,445
|
JOptionPane() { this("mess"); }
|
JOptionPane() { this("mess"); }
| 11,446
|
public AccessibleContext getAccessibleContext() { return null; }
|
public AccessibleContext getAccessibleContext() { if (accessibleContext == null) accessibleContext = new AccessibleJOptionPane(); return accessibleContext; }
| 11,447
|
public Object getValue() { return val; }
|
public Object getValue() { return value; }
| 11,448
|
public void setValue(Object v) { val = v; }
|
public void setValue(Object v) { val = v; }
| 11,449
|
public static int showConfirmDialog(JFrame frame, String yes, String no, int bla) { return 0; }
|
public static int showConfirmDialog(JFrame frame, String yes, String no, int bla) { return 0; }
| 11,450
|
public static String showInputDialog(JFrame frame, String msg, String title, int opt_type, int msg_type, Icon icon, Object[] opts, Object init) { return (String) DoShowOptionDialog(frame, msg, title, opt_type, msg_type, icon, opts, init); }
|
public static String showInputDialog(JFrame frame, String msg, String title, int opt_type, int msg_type, Icon icon, Object[] opts, Object init) { return (String) DoShowOptionDialog(frame, msg, title, opt_type, msg_type, icon, opts, init); }
| 11,451
|
public static void showMessageDialog(Component frame, String msg, String title, int bla) { DoShowOptionDialog(frame, msg, title, bla, 0, null, null, null); }
|
public static void showMessageDialog(Component frame, String msg, String title, int bla) { DoShowOptionDialog(frame, msg, title, bla, 0, null, null, null); }
| 11,452
|
public static int showOptionDialog(Component frame, String msg, String title, int opt_type, int msg_type, Icon icon, Object[] opts, Object init) { Integer a = (Integer) DoShowOptionDialog(frame, msg, title, opt_type, msg_type, icon, opts, init); if (a == null) return -1; return a.intValue(); }
|
public static int showOptionDialog(Component frame, String msg, String title, int opt_type, int msg_type, Icon icon, Object[] opts, Object init) { Integer a = (Integer) DoShowOptionDialog(frame, msg, title, opt_type, msg_type, icon, opts, init); if (a == null) return -1; return a.intValue(); }
| 11,453
|
public void updateUI() { setUI((OptionPaneUI)UIManager.getUI(this)); }
|
public void updateUI() { setUI((OptionPaneUI)UIManager.getUI(this)); }
| 11,454
|
public static void main(String[] args) { int port = PORT; String iorf = null; try { Functional_ORB.setPort(PORT); // Create and initialize the ORB final Functional_ORB orb = new Functional_ORB(); Functional_ORB.setPort(Functional_ORB.DEFAULT_INITIAL_PORT); // Create the servant and register it with the ORB NamingContextExt namer = new Ext(new TransientContext()); orb.connect(namer, getDefaultKey()); if (args.length > 1) for (int i = 0; i < args.length - 1; i++) { if (args [ i ].endsWith("ORBInitialPort")) port = Integer.parseInt(args [ i + 1 ]); if (args [ i ].equals("-ior")) iorf = args [ i + 1 ]; } orb.setPort(port); // Storing the IOR reference. String ior = orb.object_to_string(namer); if (iorf != null) { FileOutputStream f = new FileOutputStream(iorf); PrintStream p = new PrintStream(f); p.print(ior); p.close(); } System.out.println("GNU Classpath, transient naming service. " + "Copyright (C) 2005 Free Software Foundation\n" + "This tool comes with ABSOLUTELY NO WARRANTY. " + "This is free software, and you are\nwelcome to " + "redistribute it under conditions, defined in " + "GNU Classpath license.\n\n" + ior ); new Thread() { public void run() { // wait for invocations from clients orb.run(); } }.start(); } catch (Exception e) { System.err.println("ERROR: " + e); e.printStackTrace(System.out); } }
|
public static void main(String[] args) { int port = PORT; String iorf = null; try { // Create and initialize the ORB final Functional_ORB orb = new Functional_ORB(); Functional_ORB.setPort(Functional_ORB.DEFAULT_INITIAL_PORT); // Create the servant and register it with the ORB NamingContextExt namer = new Ext(new TransientContext()); orb.connect(namer, getDefaultKey()); if (args.length > 1) for (int i = 0; i < args.length - 1; i++) { if (args [ i ].endsWith("ORBInitialPort")) port = Integer.parseInt(args [ i + 1 ]); if (args [ i ].equals("-ior")) iorf = args [ i + 1 ]; } orb.setPort(port); // Storing the IOR reference. String ior = orb.object_to_string(namer); if (iorf != null) { FileOutputStream f = new FileOutputStream(iorf); PrintStream p = new PrintStream(f); p.print(ior); p.close(); } System.out.println("GNU Classpath, transient naming service. " + "Copyright (C) 2005 Free Software Foundation\n" + "This tool comes with ABSOLUTELY NO WARRANTY. " + "This is free software, and you are\nwelcome to " + "redistribute it under conditions, defined in " + "GNU Classpath license.\n\n" + ior ); new Thread() { public void run() { // wait for invocations from clients orb.run(); } }.start(); } catch (Exception e) { System.err.println("ERROR: " + e); e.printStackTrace(System.out); } }
| 11,455
|
public static void main(String[] args) { int port = PORT; String iorf = null; try { Functional_ORB.setPort(PORT); // Create and initialize the ORB final Functional_ORB orb = new Functional_ORB(); Functional_ORB.setPort(Functional_ORB.DEFAULT_INITIAL_PORT); // Create the servant and register it with the ORB NamingContextExt namer = new Ext(new TransientContext()); orb.connect(namer, getDefaultKey()); if (args.length > 1) for (int i = 0; i < args.length - 1; i++) { if (args [ i ].endsWith("ORBInitialPort")) port = Integer.parseInt(args [ i + 1 ]); if (args [ i ].equals("-ior")) iorf = args [ i + 1 ]; } orb.setPort(port); // Storing the IOR reference. String ior = orb.object_to_string(namer); if (iorf != null) { FileOutputStream f = new FileOutputStream(iorf); PrintStream p = new PrintStream(f); p.print(ior); p.close(); } System.out.println("GNU Classpath, transient naming service. " + "Copyright (C) 2005 Free Software Foundation\n" + "This tool comes with ABSOLUTELY NO WARRANTY. " + "This is free software, and you are\nwelcome to " + "redistribute it under conditions, defined in " + "GNU Classpath license.\n\n" + ior ); new Thread() { public void run() { // wait for invocations from clients orb.run(); } }.start(); } catch (Exception e) { System.err.println("ERROR: " + e); e.printStackTrace(System.out); } }
|
public static void main(String[] args) { int port = PORT; String iorf = null; try { Functional_ORB.setPort(PORT); // Create and initialize the ORB final Functional_ORB orb = new Functional_ORB(); Functional_ORB.setPort(Functional_ORB.DEFAULT_INITIAL_PORT); // Create the servant and register it with the ORB NamingContextExt namer = new Ext(new TransientContext()); orb.connect(namer, getDefaultKey()); if (args.length > 1) for (int i = 0; i < args.length - 1; i++) { if (args [ i ].endsWith("ORBInitialPort")) port = Integer.parseInt(args [ i + 1 ]); if (args [ i ].equals("-ior")) iorf = args [ i + 1 ]; } orb.setPort(port); // Storing the IOR reference. String ior = orb.object_to_string(namer); if (iorf != null) { FileOutputStream f = new FileOutputStream(iorf); PrintStream p = new PrintStream(f); p.print(ior); p.close(); } System.out.println("GNU Classpath, transient naming service. " + "Copyright (C) 2005 Free Software Foundation\n" + "This tool comes with ABSOLUTELY NO WARRANTY. " + "This is free software, and you are\nwelcome to " + "redistribute it under conditions, defined in " + "GNU Classpath license.\n\n" + ior ); new Thread() { public void run() { // wait for invocations from clients orb.run(); } }.start(); } catch (Exception e) { System.err.println("ERROR: " + e); e.printStackTrace(System.out); } }
| 11,456
|
public static void main(String[] args) { int port = PORT; String iorf = null; try { Functional_ORB.setPort(PORT); // Create and initialize the ORB final Functional_ORB orb = new Functional_ORB(); Functional_ORB.setPort(Functional_ORB.DEFAULT_INITIAL_PORT); // Create the servant and register it with the ORB NamingContextExt namer = new Ext(new TransientContext()); orb.connect(namer, getDefaultKey()); if (args.length > 1) for (int i = 0; i < args.length - 1; i++) { if (args [ i ].endsWith("ORBInitialPort")) port = Integer.parseInt(args [ i + 1 ]); if (args [ i ].equals("-ior")) iorf = args [ i + 1 ]; } orb.setPort(port); // Storing the IOR reference. String ior = orb.object_to_string(namer); if (iorf != null) { FileOutputStream f = new FileOutputStream(iorf); PrintStream p = new PrintStream(f); p.print(ior); p.close(); } System.out.println("GNU Classpath, transient naming service. " + "Copyright (C) 2005 Free Software Foundation\n" + "This tool comes with ABSOLUTELY NO WARRANTY. " + "This is free software, and you are\nwelcome to " + "redistribute it under conditions, defined in " + "GNU Classpath license.\n\n" + ior ); new Thread() { public void run() { // wait for invocations from clients orb.run(); } }.start(); } catch (Exception e) { System.err.println("ERROR: " + e); e.printStackTrace(System.out); } }
|
public static void main(String[] args) { int port = PORT; String iorf = null; try { Functional_ORB.setPort(PORT); // Create and initialize the ORB final Functional_ORB orb = new Functional_ORB(); Functional_ORB.setPort(Functional_ORB.DEFAULT_INITIAL_PORT); // Create the servant and register it with the ORB NamingContextExt namer = new Ext(new TransientContext()); orb.connect(namer, getDefaultKey()); if (args.length > 1) for (int i = 0; i < args.length - 1; i++) { if (args [ i ].endsWith("ORBInitialPort")) port = Integer.parseInt(args [ i + 1 ]); if (args [ i ].equals("-ior")) iorf = args [ i + 1 ]; } Functional_ORB.setPort(port); NamingContextExt namer = new Ext(new TransientContext()); orb.connect(namer, getDefaultKey()); // Storing the IOR reference. String ior = orb.object_to_string(namer); if (iorf != null) { FileOutputStream f = new FileOutputStream(iorf); PrintStream p = new PrintStream(f); p.print(ior); p.close(); } System.out.println("GNU Classpath, transient naming service. " + "Copyright (C) 2005 Free Software Foundation\n" + "This tool comes with ABSOLUTELY NO WARRANTY. " + "This is free software, and you are\nwelcome to " + "redistribute it under conditions, defined in " + "GNU Classpath license.\n\n" + ior ); new Thread() { public void run() { // wait for invocations from clients orb.run(); } }.start(); } catch (Exception e) { System.err.println("ERROR: " + e); e.printStackTrace(System.out); } }
| 11,457
|
EventDispatchThread(EventQueue queue) { super(); setName("AWT-EventQueue-" + ++dispatchThreadNum); this.queue = queue; setPriority(NORM_PRIORITY + 1); }
|
EventDispatchThread(EventQueue queue) { super(); setName("AWT-EventQueue-" + ++dispatchThreadNum); this.queue = queue; int priority = DEFAULT_PRIORITY; try { String priorityString = System.getProperty("gnu.awt.dispatchthread.priority"); if (priorityString != null) { priority = Integer.parseInt(priorityString); } } catch (NumberFormatException ex) { } setPriority(priority); }
| 11,459
|
public final byte[] sign() throws SignatureException { if (state == SIGN) { state = UNINITIALIZED; return engineSign(); } else throw new SignatureException(); }
|
public final byte[] sign() throws SignatureException { if (state == SIGN) { state = UNINITIALIZED; return engineSign(); } else throw new SignatureException(); }
| 11,460
|
public final byte[] sign() throws SignatureException { if (state == SIGN) { state = UNINITIALIZED; return engineSign(); } else throw new SignatureException(); }
|
public final byte[] sign() throws SignatureException { if (state == SIGN) { state = UNINITIALIZED; return engineSign(); else throw new SignatureException();
| 11,461
|
public final boolean verify(byte[]signature) throws SignatureException { if (state == VERIFY) { state = UNINITIALIZED; return engineVerify(signature); } else throw new SignatureException(); }
|
public final boolean verify(byte[]signature) throws SignatureException { if (state == VERIFY) { state = UNINITIALIZED; return engineVerify(signature); } else throw new SignatureException(); }
| 11,462
|
public final boolean verify(byte[]signature) throws SignatureException { if (state == VERIFY) { state = UNINITIALIZED; return engineVerify(signature); } else throw new SignatureException(); }
|
public final boolean verify(byte[]signature) throws SignatureException { if (state == VERIFY) { state = UNINITIALIZED; return engineVerify(signature); else throw new SignatureException();
| 11,463
|
public void read(long fileOffset, byte[] dest, int off, int len) throws IOException { if(len+off>getLength()) throw new IOException("Can't read past the file!"); long blockSize = iNode.getExt2FileSystem().getBlockSize(); long bytesRead=0; while( bytesRead < len ) { long blockNr = (fileOffset+bytesRead) / blockSize; long blockOffset = (fileOffset+bytesRead) % blockSize; long copyLength = Math.min(len-bytesRead, blockSize - blockOffset); System.arraycopy( iNode.getDataBlock(blockNr), (int)blockOffset, dest, off+(int)bytesRead, (int)copyLength); bytesRead += copyLength; } }
|
public void read(long fileOffset, byte[] dest, int off, int len) throws IOException { if(len+off>getLength()) throw new IOException("Can't read past the file!"); long blockSize = iNode.getExt2FileSystem().getBlockSize(); long bytesRead=0; while( bytesRead < len ) { long blockNr = (fileOffset+bytesRead) / blockSize; long blockOffset = (fileOffset+bytesRead) % blockSize; long copyLength = Math.min(len-bytesRead, blockSize - blockOffset); System.arraycopy( iNode.getDataBlock(blockNr), (int)blockOffset, dest, off+(int)bytesRead, (int)copyLength); bytesRead += copyLength; } }
| 11,464
|
public void write(long fileOffset, byte[] src, int off, int len) throws IOException { //throw new IOException("EXT2 implementation is currently readonly"); if(fileOffset > getLength()) throw new IOException("Can't write beyond the end of the file! (fileOffset: "+ fileOffset+", getLength()"+getLength()); if(off+len>src.length) throw new IOException("src is shorter than what you want to write"); log.debug("write(fileOffset="+fileOffset+", src, off, len="+len+")"); final long blockSize = iNode.getExt2FileSystem().getBlockSize(); long blocksAllocated = iNode.getAllocatedBlockCount(); long bytesWritten=0; while( bytesWritten < len ) { long blockIndex = (fileOffset+bytesWritten) / blockSize; long blockOffset = (fileOffset+bytesWritten) % blockSize; long copyLength = Math.min(len-bytesWritten, blockSize - blockOffset); //If only a part of the block is written, then read the block //and update its contents with the data in src. If the whole block //is overwritten, then skip reading it. byte[] dest; if( !( (blockOffset==0)&&(copyLength==blockSize) ) && (blockIndex < blocksAllocated)) dest = iNode.getDataBlock(blockIndex); else dest = new byte[(int)blockSize]; System.arraycopy( src, (int)(off+bytesWritten), dest, (int)blockOffset, (int)copyLength); //allocate a new block if needed if(blockIndex >= blocksAllocated) { try{ iNode.allocateDataBlock(blockIndex); }catch(FileSystemException fe) { throw new IOException("Internal filesystem exception",fe); } blocksAllocated++; } //write the block iNode.writeDataBlock(blockIndex, dest); bytesWritten += copyLength; } iNode.setSize( fileOffset+len ); iNode.setMtime(System.currentTimeMillis()/1000); }
|
public void write(long fileOffset, byte[] src, int off, int len) throws IOException { //throw new IOException("EXT2 implementation is currently readonly"); if(fileOffset > getLength()) throw new IOException("Can't write beyond the end of the file! (fileOffset: "+ fileOffset+", getLength()"+getLength()); if(off+len>src.length) throw new IOException("src is shorter than what you want to write"); log.debug("write(fileOffset="+fileOffset+", src, off, len="+len+")"); final long blockSize = iNode.getExt2FileSystem().getBlockSize(); long blocksAllocated = iNode.getAllocatedBlockCount(); long bytesWritten=0; while( bytesWritten < len ) { long blockIndex = (fileOffset+bytesWritten) / blockSize; long blockOffset = (fileOffset+bytesWritten) % blockSize; long copyLength = Math.min(len-bytesWritten, blockSize - blockOffset); //If only a part of the block is written, then read the block //and update its contents with the data in src. If the whole block //is overwritten, then skip reading it. byte[] dest; if( !( (blockOffset==0)&&(copyLength==blockSize) ) && (blockIndex < blocksAllocated)) dest = iNode.getDataBlock(blockIndex); else dest = new byte[(int)blockSize]; System.arraycopy( src, (int)(off+bytesWritten), dest, (int)blockOffset, (int)copyLength); //allocate a new block if needed if(blockIndex >= blocksAllocated) { try{ iNode.allocateDataBlock(blockIndex); }catch(FileSystemException fe) { throw new IOException("Internal filesystem exception",fe); } blocksAllocated++; } //write the block iNode.writeDataBlock(blockIndex, dest); bytesWritten += copyLength; } iNode.setSize( fileOffset+len ); iNode.setMtime(System.currentTimeMillis()/1000); }
| 11,465
|
public void write(long fileOffset, byte[] src, int off, int len) throws IOException { //throw new IOException("EXT2 implementation is currently readonly"); if(fileOffset > getLength()) throw new IOException("Can't write beyond the end of the file! (fileOffset: "+ fileOffset+", getLength()"+getLength()); if(off+len>src.length) throw new IOException("src is shorter than what you want to write"); log.debug("write(fileOffset="+fileOffset+", src, off, len="+len+")"); final long blockSize = iNode.getExt2FileSystem().getBlockSize(); long blocksAllocated = iNode.getAllocatedBlockCount(); long bytesWritten=0; while( bytesWritten < len ) { long blockIndex = (fileOffset+bytesWritten) / blockSize; long blockOffset = (fileOffset+bytesWritten) % blockSize; long copyLength = Math.min(len-bytesWritten, blockSize - blockOffset); //If only a part of the block is written, then read the block //and update its contents with the data in src. If the whole block //is overwritten, then skip reading it. byte[] dest; if( !( (blockOffset==0)&&(copyLength==blockSize) ) && (blockIndex < blocksAllocated)) dest = iNode.getDataBlock(blockIndex); else dest = new byte[(int)blockSize]; System.arraycopy( src, (int)(off+bytesWritten), dest, (int)blockOffset, (int)copyLength); //allocate a new block if needed if(blockIndex >= blocksAllocated) { try{ iNode.allocateDataBlock(blockIndex); }catch(FileSystemException fe) { throw new IOException("Internal filesystem exception",fe); } blocksAllocated++; } //write the block iNode.writeDataBlock(blockIndex, dest); bytesWritten += copyLength; } iNode.setSize( fileOffset+len ); iNode.setMtime(System.currentTimeMillis()/1000); }
|
public void write(long fileOffset, byte[] src, int off, int len) throws IOException { //throw new IOException("EXT2 implementation is currently readonly"); if(fileOffset > getLength()) throw new IOException("Can't write beyond the end of the file! (fileOffset: "+ fileOffset+", getLength()"+getLength()); if(off+len>src.length) throw new IOException("src is shorter than what you want to write"); log.debug("write(fileOffset="+fileOffset+", src, off, len="+len+")"); final long blockSize = iNode.getExt2FileSystem().getBlockSize(); long blocksAllocated = iNode.getAllocatedBlockCount(); long bytesWritten=0; while( bytesWritten < len ) { long blockIndex = (fileOffset+bytesWritten) / blockSize; long blockOffset = (fileOffset+bytesWritten) % blockSize; long copyLength = Math.min(len-bytesWritten, blockSize - blockOffset); //If only a part of the block is written, then read the block //and update its contents with the data in src. If the whole block //is overwritten, then skip reading it. byte[] dest; if( !( (blockOffset==0)&&(copyLength==blockSize) ) && (blockIndex < blocksAllocated)) dest = iNode.getDataBlock(blockIndex); else dest = new byte[(int)blockSize]; System.arraycopy( src, (int)(off+bytesWritten), dest, (int)blockOffset, (int)copyLength); //allocate a new block if needed if(blockIndex >= blocksAllocated) { try{ iNode.allocateDataBlock(blockIndex); }catch(FileSystemException fe) { throw new IOException("Internal filesystem exception",fe); } blocksAllocated++; } //write the block iNode.writeDataBlock(blockIndex, dest); bytesWritten += copyLength; } iNode.setSize( fileOffset+len ); iNode.setMtime(System.currentTimeMillis()/1000); }
| 11,466
|
public void write(long fileOffset, byte[] src, int off, int len) throws IOException { //throw new IOException("EXT2 implementation is currently readonly"); if(fileOffset > getLength()) throw new IOException("Can't write beyond the end of the file! (fileOffset: "+ fileOffset+", getLength()"+getLength()); if(off+len>src.length) throw new IOException("src is shorter than what you want to write"); log.debug("write(fileOffset="+fileOffset+", src, off, len="+len+")"); final long blockSize = iNode.getExt2FileSystem().getBlockSize(); long blocksAllocated = iNode.getAllocatedBlockCount(); long bytesWritten=0; while( bytesWritten < len ) { long blockIndex = (fileOffset+bytesWritten) / blockSize; long blockOffset = (fileOffset+bytesWritten) % blockSize; long copyLength = Math.min(len-bytesWritten, blockSize - blockOffset); //If only a part of the block is written, then read the block //and update its contents with the data in src. If the whole block //is overwritten, then skip reading it. byte[] dest; if( !( (blockOffset==0)&&(copyLength==blockSize) ) && (blockIndex < blocksAllocated)) dest = iNode.getDataBlock(blockIndex); else dest = new byte[(int)blockSize]; System.arraycopy( src, (int)(off+bytesWritten), dest, (int)blockOffset, (int)copyLength); //allocate a new block if needed if(blockIndex >= blocksAllocated) { try{ iNode.allocateDataBlock(blockIndex); }catch(FileSystemException fe) { throw new IOException("Internal filesystem exception",fe); } blocksAllocated++; } //write the block iNode.writeDataBlock(blockIndex, dest); bytesWritten += copyLength; } iNode.setSize( fileOffset+len ); iNode.setMtime(System.currentTimeMillis()/1000); }
|
public void write(long fileOffset, byte[] src, int off, int len) throws IOException { //throw new IOException("EXT2 implementation is currently readonly"); if(fileOffset > getLength()) throw new IOException("Can't write beyond the end of the file! (fileOffset: "+ fileOffset+", getLength()"+getLength()); if(off+len>src.length) throw new IOException("src is shorter than what you want to write"); log.debug("write(fileOffset="+fileOffset+", src, off, len="+len+")"); final long blockSize = iNode.getExt2FileSystem().getBlockSize(); long blocksAllocated = iNode.getAllocatedBlockCount(); long bytesWritten=0; while( bytesWritten < len ) { long blockIndex = (fileOffset+bytesWritten) / blockSize; long blockOffset = (fileOffset+bytesWritten) % blockSize; long copyLength = Math.min(len-bytesWritten, blockSize - blockOffset); //If only a part of the block is written, then read the block //and update its contents with the data in src. If the whole block //is overwritten, then skip reading it. byte[] dest; if( !( (blockOffset==0)&&(copyLength==blockSize) ) && (blockIndex < blocksAllocated)) dest = iNode.getDataBlock(blockIndex); else dest = new byte[(int)blockSize]; System.arraycopy( src, (int)(off+bytesWritten), dest, (int)blockOffset, (int)copyLength); //allocate a new block if needed if(blockIndex >= blocksAllocated) { try{ iNode.allocateDataBlock(blockIndex); }catch(FileSystemException fe) { throw new IOException("Internal filesystem exception",fe); } blocksAllocated++; } //write the block iNode.writeDataBlock(blockIndex, dest); bytesWritten += copyLength; } iNode.setSize( fileOffset+len ); iNode.setMtime(System.currentTimeMillis()/1000); }
| 11,467
|
public void write(long fileOffset, byte[] src, int off, int len) throws IOException { //throw new IOException("EXT2 implementation is currently readonly"); if(fileOffset > getLength()) throw new IOException("Can't write beyond the end of the file! (fileOffset: "+ fileOffset+", getLength()"+getLength()); if(off+len>src.length) throw new IOException("src is shorter than what you want to write"); log.debug("write(fileOffset="+fileOffset+", src, off, len="+len+")"); final long blockSize = iNode.getExt2FileSystem().getBlockSize(); long blocksAllocated = iNode.getAllocatedBlockCount(); long bytesWritten=0; while( bytesWritten < len ) { long blockIndex = (fileOffset+bytesWritten) / blockSize; long blockOffset = (fileOffset+bytesWritten) % blockSize; long copyLength = Math.min(len-bytesWritten, blockSize - blockOffset); //If only a part of the block is written, then read the block //and update its contents with the data in src. If the whole block //is overwritten, then skip reading it. byte[] dest; if( !( (blockOffset==0)&&(copyLength==blockSize) ) && (blockIndex < blocksAllocated)) dest = iNode.getDataBlock(blockIndex); else dest = new byte[(int)blockSize]; System.arraycopy( src, (int)(off+bytesWritten), dest, (int)blockOffset, (int)copyLength); //allocate a new block if needed if(blockIndex >= blocksAllocated) { try{ iNode.allocateDataBlock(blockIndex); }catch(FileSystemException fe) { throw new IOException("Internal filesystem exception",fe); } blocksAllocated++; } //write the block iNode.writeDataBlock(blockIndex, dest); bytesWritten += copyLength; } iNode.setSize( fileOffset+len ); iNode.setMtime(System.currentTimeMillis()/1000); }
|
public void write(long fileOffset, byte[] src, int off, int len) throws IOException { //throw new IOException("EXT2 implementation is currently readonly"); if(fileOffset > getLength()) throw new IOException("Can't write beyond the end of the file! (fileOffset: "+ fileOffset+", getLength()"+getLength()); if(off+len>src.length) throw new IOException("src is shorter than what you want to write"); log.debug("write(fileOffset="+fileOffset+", src, off, len="+len+")"); final long blockSize = iNode.getExt2FileSystem().getBlockSize(); long blocksAllocated = iNode.getAllocatedBlockCount(); long bytesWritten=0; while( bytesWritten < len ) { long blockIndex = (fileOffset+bytesWritten) / blockSize; long blockOffset = (fileOffset+bytesWritten) % blockSize; long copyLength = Math.min(len-bytesWritten, blockSize - blockOffset); //If only a part of the block is written, then read the block //and update its contents with the data in src. If the whole block //is overwritten, then skip reading it. byte[] dest; if( !( (blockOffset==0)&&(copyLength==blockSize) ) && (blockIndex < blocksAllocated)) dest = iNode.getDataBlock(blockIndex); else dest = new byte[(int)blockSize]; System.arraycopy( src, (int)(off+bytesWritten), dest, (int)blockOffset, (int)copyLength); //allocate a new block if needed if(blockIndex >= blocksAllocated) { try{ iNode.allocateDataBlock(blockIndex); }catch(FileSystemException fe) { throw new IOException("Internal filesystem exception",fe); } iNode.writeDataBlock(blockIndex, dest); bytesWritten += copyLength; } //write the block iNode.writeDataBlock(blockIndex, dest); bytesWritten += copyLength; } iNode.setSize( fileOffset+len ); iNode.setMtime(System.currentTimeMillis()/1000); }
| 11,468
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.