| 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 "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/globals.h" | 9 #include "src/globals.h" |
| 10 #include "src/runtime/runtime.h" | 10 #include "src/runtime/runtime.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 typedef double (*UnaryMathFunctionWithIsolate)(double x, Isolate* isolate); | 97 typedef double (*UnaryMathFunctionWithIsolate)(double x, Isolate* isolate); |
| 98 | 98 |
| 99 UnaryMathFunctionWithIsolate CreateSqrtFunction(Isolate* isolate); | 99 UnaryMathFunctionWithIsolate CreateSqrtFunction(Isolate* isolate); |
| 100 | 100 |
| 101 V8_EXPORT_PRIVATE double modulo(double x, double y); | 101 V8_EXPORT_PRIVATE double modulo(double x, double y); |
| 102 | 102 |
| 103 // Custom implementation of math functions. | 103 // Custom implementation of math functions. |
| 104 double fast_sqrt(double input, Isolate* isolate); | 104 double fast_sqrt(double input, Isolate* isolate); |
| 105 void lazily_initialize_fast_sqrt(Isolate* isolate); | 105 void lazily_initialize_fast_sqrt(Isolate* isolate); |
| 106 | 106 |
| 107 | |
| 108 class ElementsTransitionGenerator : public AllStatic { | |
| 109 public: | |
| 110 // If |mode| is set to DONT_TRACK_ALLOCATION_SITE, | |
| 111 // |allocation_memento_found| may be NULL. | |
| 112 static void GenerateMapChangeElementsTransition( | |
| 113 MacroAssembler* masm, | |
| 114 Register receiver, | |
| 115 Register key, | |
| 116 Register value, | |
| 117 Register target_map, | |
| 118 AllocationSiteMode mode, | |
| 119 Label* allocation_memento_found); | |
| 120 static void GenerateSmiToDouble( | |
| 121 MacroAssembler* masm, | |
| 122 Register receiver, | |
| 123 Register key, | |
| 124 Register value, | |
| 125 Register target_map, | |
| 126 AllocationSiteMode mode, | |
| 127 Label* fail); | |
| 128 static void GenerateDoubleToObject( | |
| 129 MacroAssembler* masm, | |
| 130 Register receiver, | |
| 131 Register key, | |
| 132 Register value, | |
| 133 Register target_map, | |
| 134 AllocationSiteMode mode, | |
| 135 Label* fail); | |
| 136 | |
| 137 private: | |
| 138 DISALLOW_COPY_AND_ASSIGN(ElementsTransitionGenerator); | |
| 139 }; | |
| 140 | |
| 141 static const int kNumberDictionaryProbes = 4; | |
| 142 | |
| 143 | |
| 144 class CodeAgingHelper { | 107 class CodeAgingHelper { |
| 145 public: | 108 public: |
| 146 explicit CodeAgingHelper(Isolate* isolate); | 109 explicit CodeAgingHelper(Isolate* isolate); |
| 147 | 110 |
| 148 uint32_t young_sequence_length() const { return young_sequence_.length(); } | 111 uint32_t young_sequence_length() const { return young_sequence_.length(); } |
| 149 bool IsYoung(byte* candidate) const { | 112 bool IsYoung(byte* candidate) const { |
| 150 return memcmp(candidate, | 113 return memcmp(candidate, |
| 151 young_sequence_.start(), | 114 young_sequence_.start(), |
| 152 young_sequence_.length()) == 0; | 115 young_sequence_.length()) == 0; |
| 153 } | 116 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 165 #ifdef V8_TARGET_ARCH_ARM64 | 128 #ifdef V8_TARGET_ARCH_ARM64 |
| 166 const EmbeddedVector<byte, kNoCodeAgeSequenceLength> old_sequence_; | 129 const EmbeddedVector<byte, kNoCodeAgeSequenceLength> old_sequence_; |
| 167 #endif | 130 #endif |
| 168 #endif | 131 #endif |
| 169 }; | 132 }; |
| 170 | 133 |
| 171 } // namespace internal | 134 } // namespace internal |
| 172 } // namespace v8 | 135 } // namespace v8 |
| 173 | 136 |
| 174 #endif // V8_CODEGEN_H_ | 137 #endif // V8_CODEGEN_H_ |
| OLD | NEW |