Mercurial > hg > graal-jvmci-8
comparison src/share/vm/c1x/c1x_VmIds.cpp @ 1432:b61a43cd1255
sourcecode formatting
author | Lukas Stadler <lukas.stadler@oracle.com> |
---|---|
date | Wed, 01 Sep 2010 17:13:38 -0700 |
parents | 695451afc619 |
children | efba53f86c4f |
comparison
equal
deleted
inserted
replaced
1431:c01535d7fcc6 | 1432:b61a43cd1255 |
---|---|
31 GrowableArray<jobject>* VmIds::_localHandles = NULL; | 31 GrowableArray<jobject>* VmIds::_localHandles = NULL; |
32 | 32 |
33 void VmIds::initializeObjects() { | 33 void VmIds::initializeObjects() { |
34 if (_stubs == NULL) { | 34 if (_stubs == NULL) { |
35 assert(_localHandles == NULL, "inconsistent state"); | 35 assert(_localHandles == NULL, "inconsistent state"); |
36 _stubs = new(ResourceObj::C_HEAP) GrowableArray<address>(64, true); | 36 _stubs = new (ResourceObj::C_HEAP) GrowableArray<address> (64, true); |
37 _localHandles = new(ResourceObj::C_HEAP) GrowableArray<jobject>(64, true); | 37 _localHandles = new (ResourceObj::C_HEAP) GrowableArray<jobject> (64, true); |
38 } | 38 } |
39 assert(_localHandles->length() == 0, "invalid state"); | 39 assert(_localHandles->length() == 0, "invalid state"); |
40 } | 40 } |
41 | 41 |
42 void VmIds::cleanupLocalObjects() { | 42 void VmIds::cleanupLocalObjects() { |
43 for (int i=0; i<_localHandles->length(); i++) { | 43 for (int i = 0; i < _localHandles->length(); i++) { |
44 JNIHandles::destroy_global(_localHandles->at(i)); | 44 JNIHandles::destroy_global(_localHandles->at(i)); |
45 } | 45 } |
46 _localHandles->clear(); | 46 _localHandles->clear(); |
47 } | 47 } |
48 | 48 |
52 } | 52 } |
53 | 53 |
54 jlong VmIds::add(Handle obj, CompilerObjectType type) { | 54 jlong VmIds::add(Handle obj, CompilerObjectType type) { |
55 assert(!obj.is_null(), "cannot add NULL handle"); | 55 assert(!obj.is_null(), "cannot add NULL handle"); |
56 int idx = -1; | 56 int idx = -1; |
57 for (int i=0; i<_localHandles->length(); i++) | 57 for (int i = 0; i < _localHandles->length(); i++) |
58 if (JNIHandles::resolve_non_null(_localHandles->at(i)) == obj()) { | 58 if (JNIHandles::resolve_non_null(_localHandles->at(i)) == obj()) { |
59 idx = i; | 59 idx = i; |
60 break; | 60 break; |
61 } | 61 } |
62 if (idx = -1) { | 62 if (idx = -1) { |