Request for reviews (M): 6873116: Modify reexecute implementation to use pcDesc to record the reexecute bit
Vladimir Kozlov
Vladimir.Kozlov at Sun.COM
Wed Aug 19 15:22:59 PDT 2009
Currently I am not sure that it is the only place where we need object values.
This is why I don't want to rush with this change.
Vladimir
changpeng fang - Sun Microsystems - Santa Clara United States wrote:
> On 08/19/09 15:09, Vladimir Kozlov wrote:
>> No. What Tom talks about is to do it only in
>> Deoptimization::fetch_unroll_info_helper().
>> In other cases we will generate just empty ObjectValue(id).
>>
> Yes, I saw that only use:
> GrowableArray<ScopeValue*>* objects = chunk->at(0)->scope()->objects();
>
> Can we do it in this way:
> GrowableArray<ScopeValue*>* objects =
> chunk->at(0)->scope()->decode_object_values();
> i.e. we only decode the object when necessary, and don't do it in the
> constructor?
> Maybe we need to remember the offset.
>
> Thanks,
>
> Changpeng
>
>
>> Vladimir
>>
>> changpeng fang - Sun Microsystems - Santa Clara United States wrote:
>>>
>>> Is this the approach to make it lazy? Thanks. -- Changpeng
>>>
>>>
>>> diff -r d0acbc302e14 src/share/vm/code/scopeDesc.cpp
>>> --- a/src/share/vm/code/scopeDesc.cpp Mon Aug 17 14:45:02 2009 -0700
>>> +++ b/src/share/vm/code/scopeDesc.cpp Wed Aug 19 14:49:27 2009 -0700
>>> @@ -90,16 +90,21 @@ GrowableArray<ScopeValue*>* ScopeDesc::d
>>>
>>> GrowableArray<ScopeValue*>* ScopeDesc::decode_object_values(int
>>> decode_offset) {
>>> if (decode_offset == DebugInformationRecorder::serialized_null)
>>> return NULL;
>>> - GrowableArray<ScopeValue*>* result = new
>>> GrowableArray<ScopeValue*>();
>>> - DebugInfoReadStream* stream = new DebugInfoReadStream(_code,
>>> decode_offset, result);
>>> - int length = stream->read_int();
>>> - for (int index = 0; index < length; index++) {
>>> - // Objects values are pushed to 'result' array during read so that
>>> - // object's fields could reference it (OBJECT_ID_CODE).
>>> - (void)ScopeValue::read_from(stream);
>>> +#ifdef COMPILER2
>>> + if (DoEscapeAnalysis && EliminateAllocations) {
>>> + GrowableArray<ScopeValue*>* result = new
>>> GrowableArray<ScopeValue*>();
>>> + DebugInfoReadStream* stream = new DebugInfoReadStream(_code,
>>> decode_offset, result);
>>> + int length = stream->read_int();
>>> + for (int index = 0; index < length; index++) {
>>> + // Objects values are pushed to 'result' array during read so
>>> that
>>> + // object's fields could reference it (OBJECT_ID_CODE).
>>> + (void)ScopeValue::read_from(stream);
>>> + }
>>> + assert(result->length() == length, "inconsistent debug
>>> information");
>>> + return result;
>>> }
>>> - assert(result->length() == length, "inconsistent debug information");
>>> - return result;
>>> +#endif
>>> + return NULL;
>>> }
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>> Tom Rodriguez wrote:
>>>>> By the way, does anyone know why the objects for EA are decoded
>>>>> eagerly instead of being decoded lazily like all the other debug
>>>>> info? That seems like unneeded overhead for most uses of ScopeDesc
>>>>> for stack walking.
>>>>
>>>> Do you mean the call to decode_object_values()?
>>>> It is done only for top frame.
>>>> But you are right that we may need to call it only when we
>>>> need to decode narrow oop. I will look on it.
>>>>
>>>> Vladimir
>>>>
>>>>>
>>>>> tom
>>>>>
>>>
>
More information about the hotspot-compiler-dev
mailing list