Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 756 } | 756 } |
| 757 | 757 |
| 758 | 758 |
| 759 Address TranscendentalCache::cache_array_address() { | 759 Address TranscendentalCache::cache_array_address() { |
| 760 return reinterpret_cast<Address>(caches_); | 760 return reinterpret_cast<Address>(caches_); |
| 761 } | 761 } |
| 762 | 762 |
| 763 | 763 |
| 764 double TranscendentalCache::SubCache::Calculate(double input) { | 764 double TranscendentalCache::SubCache::Calculate(double input) { |
| 765 switch (type_) { | 765 switch (type_) { |
| 766 case ACOS: | |
| 767 return acos(input); | |
| 768 case ASIN: | |
| 769 return asin(input); | |
| 770 case ATAN: | |
| 771 return atan(input); | |
| 772 case COS: | |
| 773 return fast_cos(input); | |
| 774 case EXP: | 766 case EXP: |
|
Jakob Kummerow
2013/12/04 10:21:06
You can delete EXP while you are at it. AFAICS it
| |
| 775 return exp(input); | 767 return exp(input); |
| 776 case LOG: | 768 case LOG: |
| 777 return fast_log(input); | 769 return log(input); |
| 778 case SIN: | |
| 779 return fast_sin(input); | |
| 780 case TAN: | |
| 781 return fast_tan(input); | |
| 782 default: | 770 default: |
| 783 return 0.0; // Never happens. | 771 return 0.0; // Never happens. |
| 784 } | 772 } |
| 785 } | 773 } |
| 786 | 774 |
| 787 | 775 |
| 788 MaybeObject* TranscendentalCache::SubCache::Get(double input) { | 776 MaybeObject* TranscendentalCache::SubCache::Get(double input) { |
| 789 Converter c; | 777 Converter c; |
| 790 c.dbl = input; | 778 c.dbl = input; |
| 791 int hash = Hash(c); | 779 int hash = Hash(c); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 871 #ifdef DEBUG | 859 #ifdef DEBUG |
| 872 Isolate* isolate = Isolate::Current(); | 860 Isolate* isolate = Isolate::Current(); |
| 873 isolate->heap()->disallow_allocation_failure_ = old_state_; | 861 isolate->heap()->disallow_allocation_failure_ = old_state_; |
| 874 #endif | 862 #endif |
| 875 } | 863 } |
| 876 | 864 |
| 877 | 865 |
| 878 } } // namespace v8::internal | 866 } } // namespace v8::internal |
| 879 | 867 |
| 880 #endif // V8_HEAP_INL_H_ | 868 #endif // V8_HEAP_INL_H_ |
| OLD | NEW |