Skip to content

Remove completion value. #888

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

Merged
merged 1 commit into from
Feb 17, 2016
Merged

Remove completion value. #888

merged 1 commit into from
Feb 17, 2016

Conversation

zherczeg
Copy link
Member

Remove ecma_completion_value_t, and an extra bit to ecma_value_t to represent errors. From the long list of completion types only normal and error remained.

@LaszloLango LaszloLango added enhancement An improvement performance Affects performance binary size Affects binary size labels Feb 16, 2016
@bzsolt
Copy link
Member

bzsolt commented Feb 16, 2016

RPi2 performance measurements
master 977bfa5

                     Benchmark |              Perf<br>(+ is better)
                    3d-cube.js |  2.686s ->   2.644s :  +1.564%  (+-0.589%) : [+]
        access-binary-trees.js |  1.422s ->   1.408s :  +0.985%  (+-1.705%) : [≈]
            access-fannkuch.js |  8.026s ->   7.954s :  +0.897%  (+-1.187%) : [≈]
               access-nbody.js |  3.158s ->   3.098s :  +1.900%  (+-1.001%) : [+]
   bitops-3bit-bits-in-byte.js |  1.784s ->   1.758s :  +1.457%  (+-0.809%) : [+]
        bitops-bits-in-byte.js |  2.748s ->   2.718s :  +1.092%  (+-1.029%) : [+]
         bitops-bitwise-and.js |  3.788s ->   3.718s :  +1.848%  (+-1.067%) : [+]
      controlflow-recursive.js |  0.946s ->   0.896s :  +5.285%  (+-1.642%) : [+]
                 crypto-aes.js |  4.640s ->   4.658s :  -0.388%  (+-0.965%) : [≈]
                 crypto-md5.js | 21.582s ->  21.884s :  -1.399%  (+-0.493%) : [-]
                crypto-sha1.js |  9.764s ->   9.872s :  -1.106%  (+-0.367%) : [-]
          date-format-tofte.js |  2.198s ->   2.186s :  +0.546%  (+-1.142%) : [≈]
          date-format-xparb.js |  1.074s ->   1.066s :  +0.745%  (+-1.480%) : [≈]
                math-cordic.js |  3.098s ->   2.994s :  +3.357%  (+-0.464%) : [+]
          math-partial-sums.js |  1.698s ->   1.680s :  +1.060%  (+-0.537%) : [+]
         math-spectral-norm.js |  1.536s ->   1.506s :  +1.953%  (+-1.028%) : [+]
               string-fasta.js |  4.556s ->   4.462s :  +2.063%  (+-0.444%) : [+]
               Geometric mean: |                Speed up: 1.298% (+-0.252%) : [+]

@LaszloLango LaszloLango force-pushed the remove_completion_value branch from f702614 to 444e3a2 Compare February 16, 2016 14:11
bool __attr_pure___ __attr_always_inline___
ecma_is_value_error (ecma_value_t value) /**< ecma value */
{
return (value & (1 << ECMA_VALUE_ERROR_POS)) != 0;
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 should be return (value & (1ull << ECMA_VALUE_ERROR_POS)) != 0; like in other places in our code.

@LaszloLango LaszloLango force-pushed the remove_completion_value branch from 6420631 to bba2fee Compare February 17, 2016 10:21
@LaszloLango
Copy link
Contributor

Patch is updated and rebased to master.

* Check if the value is false.
*
* Warning:
* value must be boolean
Copy link
Member

Choose a reason for hiding this comment

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

Why this warning? If value is not a boolean, does it cause any trouble (assertion, etc.)? I get from the code that the function will simply return false, wont it?

Copy link
Contributor

Choose a reason for hiding this comment

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

To tell the truth I just copied&pasted the description from above (see: ecma_is_value_true). We can remove that warning message, it looks useless to me too.

@akosthekiss
Copy link
Member

Made my observations above. (Those idiomatically used empty string error messages smell bad. However, it might need all-over-the-code changes to remove them properly, e.g., with functions that don't even expect a string, if they are not used whatsoever.) The rest is OK, as far as I can tell.

@LaszloLango
Copy link
Contributor

@akiss77, maintaining and improving the error messages would be great and we need to do that. Do you mind if I raise an issue for that and do it in a separate PR?

@akosthekiss
Copy link
Member

@LaszloLango, the patch is good with me as it is. And we don't necessarily have to come up with fancy error messages if we don't want to. But then we should declare that and then we can remove the string argument of those ecma_raise_* functions. The use of "" is what's bugging me.

@galpeter
Copy link
Contributor

lgtm

@zherczeg
Copy link
Member Author

I think we can improve error messages in a follow-up patch, this patch focuses on removing the completion value and already big enough.

@LaszloLango LaszloLango force-pushed the remove_completion_value branch from 9e4b36a to 786dc32 Compare February 17, 2016 13:50
Remove ecma_completion_value_t, and add an extra bit to
ecma_value_t to represent errors. From the long list of
completion types only normal and error remained.

JerryScript-DCO-1.0-Signed-off-by: László Langó [email protected]
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
binary size Affects binary size enhancement An improvement performance Affects performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants