Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move dynamic interpreter thunk generation OOP #1707

Merged
merged 2 commits into from
Oct 18, 2016

Conversation

MikeHolman
Copy link
Contributor

No description provided.


if (!emitBufferManager->ProtectBufferWithExecuteReadWriteForInterpreter(allocation))
{
Js::Throw::JITOperationFailed(GetLastError());
Copy link
Contributor

Choose a reason for hiding this comment

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

Js::Throw::JITOperationFailed(GetLastError()); [](start = 12, length = 46)

don't need this. VirtualProtectEx call failure has been checked right after the call. if it's not system call failure, there's fail fast, also the last error will be meaningless

Copy link
Contributor Author

Choose a reason for hiding this comment

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

true, then I guess we should be able to assert that this call succeeds?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this call should never never return false, if we reach here and get a false return, I think it means we missed a path that we should fail fast. you can double check with Satheesh


In reply to: 82306816 [](ancestors = 82306816)

@leirocks
Copy link
Contributor

leirocks commented Oct 6, 2016

    HeapDeleteArray(sizeInBytes, writeBuffer);

can you fix the memory leak here, I missed this in my change
or, maybe we can use stack memory instead? at this point the stack usage should be very low for OOP JIT and background JIT, right?
otherwise maybe we can use stack to repeatedly do the copying (like 1KB by 1KB)


Refers to: lib/Common/Memory/MemUtils.cpp:45 in 2863255. [](commit_id = 2863255, deletion_comment = False)

@MikeHolman MikeHolman force-pushed the oopite branch 4 times, most recently from 542f0e6 to 9adef24 Compare October 7, 2016 01:34
Js::Throw::FatalInternalError();
}
}
if (byteCount % 2 != 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

if (byteCount % 2 != 0) [](start = 11, length = 24)

you might want to move this before the for loop to avoid out of bounds write.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i changed this to use different algorithm instead that doesn't need to use heap.

Js::Throw::JITOperationFailed(GetLastError());
}

success = emitBufferManager->CommitReadWriteBufferForInterpreter(allocation, remoteBuffer, bufferSize);
Copy link
Contributor

Choose a reason for hiding this comment

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

CommitReadWriteBufferForInterpreter [](start = 37, length = 35)

you might want to add JITOperationFailed in the false path for this API. It will return false, when the protection is unsuccessful - which can happen with the CFG around -

@satheeshravi
Copy link
Contributor

Looks good, otherwise.

@satheeshravi
Copy link
Contributor

:shipit:

@chakrabot chakrabot merged commit 5e5099f into chakra-core:master Oct 18, 2016
chakrabot pushed a commit that referenced this pull request Oct 18, 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