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

Fixes #5201: Implemented StringTemplate Caching based on location in source Code. #5727

Merged
merged 1 commit into from
Sep 26, 2018

Conversation

sharmasuraj0123
Copy link
Contributor

@sharmasuraj0123 sharmasuraj0123 commented Sep 24, 2018

Changed the earlier implementation of caching the StringTemplates based
on Raw String Literals to their location in the source code.

Old Behavior:

function getCallsite(c) { return c; }
function getFooCallsite() { return getCallsite`foo`; } 
print(getFooCallsite() === getFooCallsite()); // true
print(getCallsite`foo` === getCallsite`foo`); // true
print(getCallsite`foo` === eval('getCallsite`foo`')); // true

New Behavior:

function getCallsite(c) { return c; }
function getFooCallsite() { return getCallsite`foo`; } 
print(getFooCallsite() === getFooCallsite()); // true
print(getCallsite`foo` === getCallsite`foo`); // false
print(getCallsite`foo` === eval('getCallsite`foo`')); // false

Deleted the added mapping that would compare and ensure that the two callsite objects are equal based on their raw String literals.
Now it store every diferent pnode object it comes accross and assigns it a register.

Fixes #5201

Changed the earlier implementation of caching the StringTemplates based
on Raw String Literals to their location in the source code.
@sharmasuraj0123 sharmasuraj0123 changed the title Implemented StringTemplate Caching based on location in source Code. #5201: plemented StringTemplate Caching based on location in source Code. Sep 24, 2018
@dilijev
Copy link
Contributor

dilijev commented Sep 24, 2018

Make sure you put Fixes #.... in your PR title and/or description to automatically close your PR when it is merged: https://help.github.com/articles/closing-issues-using-keywords/

@sharmasuraj0123 sharmasuraj0123 changed the title #5201: plemented StringTemplate Caching based on location in source Code. Fixes #5201: Implemented StringTemplate Caching based on location in source Code. Sep 24, 2018
Copy link
Contributor

@boingoing boingoing left a comment

Choose a reason for hiding this comment

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

Looks good to me

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

@chakrabot chakrabot merged commit f8023f7 into chakra-core:master Sep 26, 2018
chakrabot pushed a commit that referenced this pull request Sep 26, 2018
…e Caching based on location in source Code.

Merge pull request #5727 from sharmasuraj0123:StringTemplateCaching

Changed the earlier implementation of caching the StringTemplates based
on Raw String Literals to their location in the source code.

Old Behavior:

```js
function getCallsite(c) { return c; }
function getFooCallsite() { return getCallsite`foo`; }
print(getFooCallsite() === getFooCallsite()); // true
print(getCallsite`foo` === getCallsite`foo`); // true
print(getCallsite`foo` === eval('getCallsite`foo`')); // true
```

New Behavior:

```js
function getCallsite(c) { return c; }
function getFooCallsite() { return getCallsite`foo`; }
print(getFooCallsite() === getFooCallsite()); // true
print(getCallsite`foo` === getCallsite`foo`); // false
print(getCallsite`foo` === eval('getCallsite`foo`')); // false
```

Deleted the added mapping that would compare and ensure that the two callsite objects are equal based on their raw String literals.
Now it store every diferent pnode object it comes accross and assigns it a register.

Fixes #5201
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.

4 participants