Mercurial > hg > truffle
comparison src/share/vm/code/debugInfo.cpp @ 19598:15ef24874df7
Add assertion to ObjectValue conversion
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Wed, 25 Feb 2015 19:13:16 -0800 |
parents | 52b4284cb496 |
children |
comparison
equal
deleted
inserted
replaced
19597:dcfdd60edaf1 | 19598:15ef24874df7 |
---|---|
50 ScopeValue* DebugInfoReadStream::read_object_value() { | 50 ScopeValue* DebugInfoReadStream::read_object_value() { |
51 int id = read_int(); | 51 int id = read_int(); |
52 #ifdef ASSERT | 52 #ifdef ASSERT |
53 assert(_obj_pool != NULL, "object pool does not exist"); | 53 assert(_obj_pool != NULL, "object pool does not exist"); |
54 for (int i = _obj_pool->length() - 1; i >= 0; i--) { | 54 for (int i = _obj_pool->length() - 1; i >= 0; i--) { |
55 assert(((ObjectValue*) _obj_pool->at(i))->id() != id, "should not be read twice"); | 55 assert(_obj_pool->at(i)->as_ObjectValue()->id() != id, "should not be read twice"); |
56 } | 56 } |
57 #endif | 57 #endif |
58 ObjectValue* result = new ObjectValue(id); | 58 ObjectValue* result = new ObjectValue(id); |
59 // Cache the object since an object field could reference it. | 59 // Cache the object since an object field could reference it. |
60 _obj_pool->push(result); | 60 _obj_pool->push(result); |
64 | 64 |
65 ScopeValue* DebugInfoReadStream::get_cached_object() { | 65 ScopeValue* DebugInfoReadStream::get_cached_object() { |
66 int id = read_int(); | 66 int id = read_int(); |
67 assert(_obj_pool != NULL, "object pool does not exist"); | 67 assert(_obj_pool != NULL, "object pool does not exist"); |
68 for (int i = _obj_pool->length() - 1; i >= 0; i--) { | 68 for (int i = _obj_pool->length() - 1; i >= 0; i--) { |
69 ObjectValue* ov = (ObjectValue*) _obj_pool->at(i); | 69 ObjectValue* ov = _obj_pool->at(i)->as_ObjectValue(); |
70 if (ov->id() == id) { | 70 if (ov->id() == id) { |
71 return ov; | 71 return ov; |
72 } | 72 } |
73 } | 73 } |
74 ShouldNotReachHere(); | 74 ShouldNotReachHere(); |