OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef VM_STUB_CODE_H_ | 5 #ifndef VM_STUB_CODE_H_ |
6 #define VM_STUB_CODE_H_ | 6 #define VM_STUB_CODE_H_ |
7 | 7 |
8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
10 | 10 |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 static uword name##EntryPoint() { \ | 149 static uword name##EntryPoint() { \ |
150 return name##_entry()->EntryPoint(); \ | 150 return name##_entry()->EntryPoint(); \ |
151 } \ | 151 } \ |
152 static intptr_t name##Size() { \ | 152 static intptr_t name##Size() { \ |
153 return name##_entry()->Size(); \ | 153 return name##_entry()->Size(); \ |
154 } | 154 } |
155 STUB_CODE_LIST(STUB_CODE_ACCESSOR); | 155 STUB_CODE_LIST(STUB_CODE_ACCESSOR); |
156 #undef STUB_CODE_ACCESSOR | 156 #undef STUB_CODE_ACCESSOR |
157 | 157 |
158 static RawCode* GetAllocationStubForClass(const Class& cls); | 158 static RawCode* GetAllocationStubForClass(const Class& cls); |
159 static RawCode* GetAllocationStubForClosure(const Function& func); | |
160 | 159 |
161 static const intptr_t kNoInstantiator = 0; | 160 static const intptr_t kNoInstantiator = 0; |
162 | 161 |
163 private: | 162 private: |
164 friend class MegamorphicCacheTable; | 163 friend class MegamorphicCacheTable; |
165 | 164 |
166 static const intptr_t kStubCodeSize = 4 * KB; | 165 static const intptr_t kStubCodeSize = 4 * KB; |
167 | 166 |
168 #define STUB_CODE_GENERATE(name) \ | 167 #define STUB_CODE_GENERATE(name) \ |
169 static void Generate##name##Stub(Assembler* assembler); | 168 static void Generate##name##Stub(Assembler* assembler); |
(...skipping 15 matching lines...) Expand all Loading... |
185 void* dummy_; | 184 void* dummy_; |
186 | 185 |
187 // Generate the stub and finalize the generated code into the stub | 186 // Generate the stub and finalize the generated code into the stub |
188 // code executable area. | 187 // code executable area. |
189 static RawCode* Generate(const char* name, | 188 static RawCode* Generate(const char* name, |
190 void (*GenerateStub)(Assembler* assembler)); | 189 void (*GenerateStub)(Assembler* assembler)); |
191 | 190 |
192 static void GenerateMegamorphicMissStub(Assembler* assembler); | 191 static void GenerateMegamorphicMissStub(Assembler* assembler); |
193 static void GenerateAllocationStubForClass(Assembler* assembler, | 192 static void GenerateAllocationStubForClass(Assembler* assembler, |
194 const Class& cls); | 193 const Class& cls); |
195 static void GenerateAllocationStubForClosure(Assembler* assembler, | |
196 const Function& func); | |
197 static void GenerateNArgsCheckInlineCacheStub( | 194 static void GenerateNArgsCheckInlineCacheStub( |
198 Assembler* assembler, | 195 Assembler* assembler, |
199 intptr_t num_args, | 196 intptr_t num_args, |
200 const RuntimeEntry& handle_ic_miss); | 197 const RuntimeEntry& handle_ic_miss); |
201 static void GenerateUsageCounterIncrement(Assembler* assembler, | 198 static void GenerateUsageCounterIncrement(Assembler* assembler, |
202 Register temp_reg); | 199 Register temp_reg); |
203 static void GenerateOptimizedUsageCounterIncrement(Assembler* assembler); | 200 static void GenerateOptimizedUsageCounterIncrement(Assembler* assembler); |
204 | 201 |
205 static void GenerateIdenticalWithNumberCheckStub( | 202 static void GenerateIdenticalWithNumberCheckStub( |
206 Assembler* assembler, | 203 Assembler* assembler, |
207 const Register left, | 204 const Register left, |
208 const Register right, | 205 const Register right, |
209 const Register temp1 = kNoRegister, | 206 const Register temp1 = kNoRegister, |
210 const Register temp2 = kNoRegister); | 207 const Register temp2 = kNoRegister); |
211 }; | 208 }; |
212 | 209 |
213 } // namespace dart | 210 } // namespace dart |
214 | 211 |
215 #endif // VM_STUB_CODE_H_ | 212 #endif // VM_STUB_CODE_H_ |
OLD | NEW |