Skip to content

Conversation

pleath
Copy link
Contributor

@pleath pleath commented Jul 14, 2016

Restructure the FunctionBody hierarchy so that FunctionInfo is a standalone proxy from which FunctionProxy does not inherit, and FunctionProxy is the basis for all the representations of user functions (FunctionBody, etc.). FunctionInfo still points to the FunctionProxy that implements the function, and FunctionProxy points to FunctionInfo. Do this to facilitate re-deferral and to maximize the memory benefit.

@@ -583,7 +583,7 @@ namespace Js
bool IsPolymorphicCallSite(const ProfileId profiledCallSiteId) const;
// This function walks all the chained jittimedata and returns the one which match the functionInfo.
// This can return null, if the functionInfo doesn't match.
const FunctionCodeGenJitTimeData *GetJitTimeDataFromFunctionInfo(FunctionInfo *polyFunctionInfo) const;
const FunctionCodeGenJitTimeData *GetJitTimeDataFromFunctionInfo(FunctionInfo *polyFunctioInfoy) const;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nay i say, nay

@ianwjhalliday
Copy link
Collaborator

Looks good to me other than a couple minor questions.

@pleath pleath force-pushed the functioninfo branch 2 times, most recently from 629a1e1 to b84eb2b Compare July 20, 2016 00:24
@digitalinfinity
Copy link
Contributor

    // WriteBarrier-TODO: Fix this? This is used only by proxies to keep the deserialized version around

Does this comment (around what this field is used for) need to be updated?


Refers to: lib/Runtime/Base/FunctionInfo.h:116 in b84eb2b. [](commit_id = b84eb2b, deletion_comment = False)

inline void FunctionProxy::SetLocalFunctionId(LocalFunctionId functionId)
{
Assert(GetFunctionInfo());
Assert(GetFunctionInfo()->GetFunctionProxy() == this);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these asserts be moved to GetFunctionInfo itself? Also was curious why this particular assert wasn't there in GetLocalFunctionId (another reason I suggested centralizing the asserts)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are cases where it’s awkward to assert in GetFunctionInfo() because we’re in the midst of swapping the functionBodyImpl. I suppose we could have a GetFunctionInfoUnchecked() for those.

--Paul

From: Hitesh Kanwathirtha [mailto:[email protected]]
Sent: Thursday, July 21, 2016 11:04 AM
To: Microsoft/ChakraCore [email protected]
Cc: Paul Leathers [email protected]; Author [email protected]
Subject: Re: [Microsoft/ChakraCore] Restructure FunctionBody hierarchy for re-deferral (#1278)

In lib/Runtime/Base/FunctionBody.hhttps://github.com//pull/1278#discussion_r71755941:

@@ -1348,16 +1393,180 @@ namespace Js

     ScriptFunctionType * AllocDeferredPrototypeType();

 };
  • inline Js::LocalFunctionId FunctionProxy::GetLocalFunctionId() const
  • {
  •    Assert(GetFunctionInfo());
    
  •    return GetFunctionInfo()->GetLocalFunctionId();
    
  • }
  • inline void FunctionProxy::SetLocalFunctionId(LocalFunctionId functionId)
  • {
  •    Assert(GetFunctionInfo());
    
  •    Assert(GetFunctionInfo()->GetFunctionProxy() == this);
    

Can these asserts be moved to GetFunctionInfo itself? Also was curious why this particular assert wasn't there in GetLocalFunctionId (another reason I suggested centralizing the asserts)


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://github.com//pull/1278/files/b84eb2bf59a60a0647d0efcece9bc741d4855b53#r71755941, or mute the threadhttps://github.com/notifications/unsubscribe-auth/APF8RLQXTH-jjUOD-IA2WsNpgLf4uipiks5qX7SOgaJpZM4JM3EN.

@pleath pleath force-pushed the functioninfo branch 2 times, most recently from f071999 to 746941b Compare August 10, 2016 23:48
@dilijev
Copy link
Contributor

dilijev commented Aug 24, 2016

@pleath any update on this PR?

@pleath
Copy link
Contributor Author

pleath commented Aug 24, 2016

Not today. I’ll be bringing it up to date soon.

-- Paul

From: Doug Ilijev [mailto:[email protected]]
Sent: Wednesday, August 24, 2016 3:49 PM
To: Microsoft/ChakraCore [email protected]
Cc: Paul Leathers [email protected]; Mention [email protected]
Subject: Re: [Microsoft/ChakraCore] Restructure FunctionBody hierarchy for re-deferral (#1278)

@pleathhttps://github.com/pleath any update on this PR?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com//pull/1278#issuecomment-242232456, or mute the threadhttps://github.com/notifications/unsubscribe-auth/APF8RL_zP7eLndAhvTHsABtR4-KKcnP9ks5qjMpWgaJpZM4JM3EN.

…dalone proxy from which FunctionProxy does not inherit, and FunctionProxy is the basis for all the representations of user functions (FunctionBody, etc.). FunctionInfo still points to the FunctionProxy that implements the function, and FunctionProxy points to FunctionInfo. Do this to facilitate re-deferral and to maximize the memory benefit.
@pleath
Copy link
Contributor Author

pleath commented Oct 22, 2016

Fully synched.

@dilijev
Copy link
Contributor

dilijev commented Oct 25, 2016

Does #1585 depend on this PR or are they independent changes?

@pleath
Copy link
Contributor Author

pleath commented Nov 8, 2016

Subsumed by #1585.

@pleath pleath closed this Nov 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants