< prev index next >
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ObjectSynchronizer.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 2001, 2014, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 106,122 ****
return (index > 0 || block.freeNext() != null);
}
public Object next() {
Address addr;
! if (index > 0) {
! addr = blockAddr.addOffsetTo(index*objectMonitorTypeSize);
! } else {
blockAddr = block.freeNext();
index = blockSize - 1;
- addr = blockAddr.addOffsetTo(index*objectMonitorTypeSize);
}
index --;
return new ObjectMonitor(addr);
}
public void remove() {
--- 106,125 ----
return (index > 0 || block.freeNext() != null);
}
public Object next() {
Address addr;
! if (index == 0) {
! // advance to next block
blockAddr = block.freeNext();
+ if (blockAddr == null) {
+ throw new NoSuchElementException();
+ }
+ block = new ObjectMonitor(blockAddr);
index = blockSize - 1;
}
+ addr = blockAddr.addOffsetTo(index*objectMonitorTypeSize);
index --;
return new ObjectMonitor(addr);
}
public void remove() {
< prev index next >