equal
deleted
inserted
replaced
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 } |