OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_CODEGEN_H_ | 5 #ifndef V8_CODEGEN_H_ |
6 #define V8_CODEGEN_H_ | 6 #define V8_CODEGEN_H_ |
7 | 7 |
8 #include "code-stubs.h" | 8 #include "code-stubs.h" |
9 #include "runtime.h" | 9 #include "runtime.h" |
10 | 10 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 | 92 |
93 // Results of the library implementation of transcendental functions may differ | 93 // Results of the library implementation of transcendental functions may differ |
94 // from the one we use in our generated code. Therefore we use the same | 94 // from the one we use in our generated code. Therefore we use the same |
95 // generated code both in runtime and compiled code. | 95 // generated code both in runtime and compiled code. |
96 typedef double (*UnaryMathFunction)(double x); | 96 typedef double (*UnaryMathFunction)(double x); |
97 | 97 |
98 UnaryMathFunction CreateExpFunction(); | 98 UnaryMathFunction CreateExpFunction(); |
99 UnaryMathFunction CreateSqrtFunction(); | 99 UnaryMathFunction CreateSqrtFunction(); |
100 | 100 |
101 | 101 |
| 102 double modulo(double x, double y); |
| 103 |
| 104 // Custom implementation of math functions. |
| 105 double fast_exp(double input); |
| 106 double fast_sqrt(double input); |
| 107 #ifdef _WIN64 |
| 108 void init_modulo_function(); |
| 109 #endif |
| 110 void lazily_initialize_fast_exp(); |
| 111 void init_fast_sqrt_function(); |
| 112 |
| 113 |
102 class ElementsTransitionGenerator : public AllStatic { | 114 class ElementsTransitionGenerator : public AllStatic { |
103 public: | 115 public: |
104 // If |mode| is set to DONT_TRACK_ALLOCATION_SITE, | 116 // If |mode| is set to DONT_TRACK_ALLOCATION_SITE, |
105 // |allocation_memento_found| may be NULL. | 117 // |allocation_memento_found| may be NULL. |
106 static void GenerateMapChangeElementsTransition(MacroAssembler* masm, | 118 static void GenerateMapChangeElementsTransition(MacroAssembler* masm, |
107 AllocationSiteMode mode, | 119 AllocationSiteMode mode, |
108 Label* allocation_memento_found); | 120 Label* allocation_memento_found); |
109 static void GenerateSmiToDouble(MacroAssembler* masm, | 121 static void GenerateSmiToDouble(MacroAssembler* masm, |
110 AllocationSiteMode mode, | 122 AllocationSiteMode mode, |
111 Label* fail); | 123 Label* fail); |
112 static void GenerateDoubleToObject(MacroAssembler* masm, | 124 static void GenerateDoubleToObject(MacroAssembler* masm, |
113 AllocationSiteMode mode, | 125 AllocationSiteMode mode, |
114 Label* fail); | 126 Label* fail); |
115 | 127 |
116 private: | 128 private: |
117 DISALLOW_COPY_AND_ASSIGN(ElementsTransitionGenerator); | 129 DISALLOW_COPY_AND_ASSIGN(ElementsTransitionGenerator); |
118 }; | 130 }; |
119 | 131 |
120 static const int kNumberDictionaryProbes = 4; | 132 static const int kNumberDictionaryProbes = 4; |
121 | 133 |
122 | 134 |
123 } } // namespace v8::internal | 135 } } // namespace v8::internal |
124 | 136 |
125 #endif // V8_CODEGEN_H_ | 137 #endif // V8_CODEGEN_H_ |
OLD | NEW |