Skip to content

Conversation

@jackhorton
Copy link
Contributor

No description provided.

@jackhorton jackhorton changed the base branch from master to release/1.7 November 9, 2017 18:12
@obastemur
Copy link
Collaborator

Can we have a test case for this?

@jackhorton
Copy link
Contributor Author

Test cases for localeCompare are a known issue -- I was planning on adding them in a future revision to our existing Intl.Collator tests

@obastemur
Copy link
Collaborator

If that’s planned already, this PR looks like a good opportunity to add one. Besides, if we could open an issue on Github, individuals could contribute test cases.

@jackhorton
Copy link
Contributor Author

I can make a github issue for it, but I believe the intl tests have changed format a bit between release/1.7 and current master.

@dilijev
Copy link
Contributor

dilijev commented Nov 10, 2017

the intl tests have changed format a bit between release/1.7 and current master

Unfortunately this is a reality we have to deal with, and is not a reason to skip adding tests.

Copy link
Contributor

@dilijev dilijev left a comment

Choose a reason for hiding this comment

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

LGTM

{
IntlEngineInterfaceExtensionObject* intlExtensionObject = static_cast<IntlEngineInterfaceExtensionObject*>(nativeEngineInterfaceObj->GetEngineExtension(EngineInterfaceExtensionKind_Intl));
IntlEngineInterfaceExtensionObject* intlExtensionObject = static_cast<IntlEngineInterfaceExtensionObject*>(
nativeEngineInterfaceObj->GetEngineExtension(EngineInterfaceExtensionKind_Intl));
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this just breaking the line?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I felt it was too long.

CallInfo toPass(callInfo.Flags, 7);
return intlExtensionObject->EntryIntl_CompareString(function, toPass, undefined, pThis, pThat, undefined, undefined, undefined, undefined);
return CALL_ENTRYPOINT(scriptContext->GetThreadContext(), intlExtensionObject->EntryIntl_CompareString, function, toPass,
undefined, pThis, pThat, undefined, undefined, undefined, undefined);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: have the params to intlExtensionObject->EntryIntl_CompareString all together on the second line.

Copy link
Contributor

@dilijev dilijev Nov 10, 2017

Choose a reason for hiding this comment

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

@rajatd Does CALL_ENTRYPOINT need to be wrapped in implicit call like the uses in JavascriptOperators.cpp (like CallGetter)?

Pattern:

...
return threadContext->ExecuteImplicitCall(function, ImplicitCall_Accessor, [=]() -> Js::Var
{
...
Var result = CALL_ENTRYPOINT(...)
result = CrossSite::MarshalVar(requestContext, result);
return result;
});

/cc @akroshg

Copy link
Contributor

Choose a reason for hiding this comment

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

@jackhorton I think some carefully-designed tests with a loop and -mic:1 might reveal JIT-related failures.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dilijev I am not sure what careful design would need to go in here to execute anything like that. Also, keep in mind that Intl is not enabled in xplat CI (or else we would have seen this, most likely, from the single test we have that calls .localeCompare), so tests stressing it wont reveal much for now (this bug is xplat-only because CALL_ENTRYPOINT is only "needed" on xplat, modulo your concern about implicit calls.

return intlExtensionObject->EntryIntl_CompareString(function, toPass, undefined, pThis, pThat, undefined, undefined, undefined, undefined);
ThreadContext *threadContext = scriptContext->GetThreadContext();
return threadContext->ExecuteImplicitCall(function, ImplicitCall_Accessor,
[scriptContext, threadContext, intlExtensionObject, function, toPass, undefined, pThis, pThat]() -> Var
Copy link
Contributor

@dilijev dilijev Nov 11, 2017

Choose a reason for hiding this comment

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

Quick note that you're capturing all of these variables by copy. Consider whether capture-by-reference would be better for any of these. Also, unless you feel that it's important to limit or enumerate the list of captures, you can capture everything (that is actually used) with [=] (copy) or [&] (reference).

Copy link
Contributor

Choose a reason for hiding this comment

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

Also looks like you don't need scriptContext at all.

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 didn't want to capture the pointers by reference, and i think most/all of these are pointers. With that being said, I didnt want to capture everything by copy since I didn't necessarily know which copy constructors would run as a result. You're right that I don't need scriptContext anymore, i did before.

@jackhorton
Copy link
Contributor Author

Superseded by #4217

@jackhorton jackhorton closed this Nov 13, 2017
chakrabot pushed a commit that referenced this pull request Nov 14, 2017
Merge pull request #4217 from jackhorton:fix-mergeback-break

This pull supersedes #4187
chakrabot pushed a commit that referenced this pull request Nov 14, 2017
Merge pull request #4217 from jackhorton:fix-mergeback-break

This pull supersedes #4187
@jackhorton jackhorton deleted the intl-call-entrypoint branch November 16, 2017 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants