comparison src/share/vm/code/debugInfo.cpp @ 44:52fed2ec0afb

6667620: (Escape Analysis) fix deoptimization for scalar replaced objects Summary: Deoptimization code for reallocation and relocking scalar replaced objects has to be fixed. Reviewed-by: rasbold, never
author kvn
date Tue, 11 Mar 2008 11:25:13 -0700
parents a61af66fc99e
children d1605aabd0a1
comparison
equal deleted inserted replaced
43:d821d920b465 44:52fed2ec0afb
45 for (int i = _obj_pool->length() - 1; i >= 0; i--) { 45 for (int i = _obj_pool->length() - 1; i >= 0; i--) {
46 assert(((ObjectValue*) _obj_pool->at(i))->id() != id, "should not be read twice"); 46 assert(((ObjectValue*) _obj_pool->at(i))->id() != id, "should not be read twice");
47 } 47 }
48 #endif 48 #endif
49 ObjectValue* result = new ObjectValue(id); 49 ObjectValue* result = new ObjectValue(id);
50 _obj_pool->append(result); 50 // Cache the object since an object field could reference it.
51 _obj_pool->push(result);
51 result->read_object(this); 52 result->read_object(this);
52 return result; 53 return result;
53 } 54 }
54 55
55 ScopeValue* DebugInfoReadStream::get_cached_object() { 56 ScopeValue* DebugInfoReadStream::get_cached_object() {
56 int id = read_int(); 57 int id = read_int();
57 assert(_obj_pool != NULL, "object pool does not exist"); 58 assert(_obj_pool != NULL, "object pool does not exist");
58 for (int i = _obj_pool->length() - 1; i >= 0; i--) { 59 for (int i = _obj_pool->length() - 1; i >= 0; i--) {
59 ObjectValue* sv = (ObjectValue*) _obj_pool->at(i); 60 ObjectValue* ov = (ObjectValue*) _obj_pool->at(i);
60 if (sv->id() == id) { 61 if (ov->id() == id) {
61 return sv; 62 return ov;
62 } 63 }
63 } 64 }
64 ShouldNotReachHere(); 65 ShouldNotReachHere();
65 return NULL; 66 return NULL;
66 } 67 }