You'd have to check HasFunctionName first, but otherwise yes, I believe this has the same semantics.
On Mon, Nov 26, 2018 at 4:16 PM 박한범 <[email protected]> wrote: > hello, Leszek Swirski! thanks for answer. > I want to record the name of the function being called through > v8::internal::Execution::Call. so, I saw this codes. > and you right at all. > > but if want to change this codes, there are already good examples. > refer here : > https://chromium.googlesource.com/v8/v8.git/+/master/src/objects/shared-function-info-inl.h#603 > Method "SharedFunctionInfo::inferred_name()" seems to have been created > with the same intent with SharedFunctionInfo::Name(). > just targeting different target. > > so, I think methods A can be change same way of methods B. > like this. > > > String* SharedFunctionInfo::Name() const { > Object* value = name_or_scope_info(); > if (value->IsScopeInfo()) { > ScopeInfo scope_info = ScopeInfo::cast(value); > if (scope_info->HasSharedFunctionName() && > scope_info->HasFunctionName()) { > return String::cast(scope_info->FunctionName()); > } > } else if (value != kNoSharedNameSentinel) { > return String::cast(value); > } > > return GetReadOnlyRoots().empty_string(); > } > > > How do you think? > best regards. > > > > > 2018년 11월 26일 월요일 오후 5시 30분 37초 UTC+9, Leszek Swirski 님의 말: >> >> That's a reasonable point, but SFI::HasSharedName also checks for >> the kNoSharedNameSentinel, which ScopeInfo::HasFunctionName does not. There >> is a ScopeInfo::HasSharedFunctionName, but that one in turn does not first >> check for ScopeInfo::HasFunctionName(). Possibly we could >> add ScopeInfo::HasFunctionName() to ScopeInfo::HasSharedFunctionName and >> then remove this check. >> >> Is there any reason you are looking at this code in particular? >> >> On Sun, Nov 25, 2018 at 3:06 AM 박한범 <[email protected]> wrote: >> >>> You can find the code here: >>> >>> >>> https://chromium.googlesource.com/v8/v8.git/+/master/src/objects/shared-function-info-inl.h >>> line 102 >>> line 110 >>> >>> -- >>> -- >>> v8-dev mailing list >>> [email protected] >>> http://groups.google.com/group/v8-dev >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "v8-dev" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- > -- > v8-dev mailing list > [email protected] > http://groups.google.com/group/v8-dev > --- > You received this message because you are subscribed to the Google Groups > "v8-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev --- You received this message because you are subscribed to the Google Groups "v8-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
