| 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 static bool InJumpToExceptionHandlerStub(uword pc); | 138 static bool InJumpToExceptionHandlerStub(uword pc); |
| 139 | 139 |
| 140 // Returns NULL if no stub found. | 140 // Returns NULL if no stub found. |
| 141 static const char* NameOfStub(uword entry_point); | 141 static const char* NameOfStub(uword entry_point); |
| 142 | 142 |
| 143 // Define the shared stub code accessors. | 143 // Define the shared stub code accessors. |
| 144 #define STUB_CODE_ACCESSOR(name) \ | 144 #define STUB_CODE_ACCESSOR(name) \ |
| 145 static StubEntry* name##_entry() { \ | 145 static StubEntry* name##_entry() { \ |
| 146 return name##_entry_; \ | 146 return name##_entry_; \ |
| 147 } \ | 147 } \ |
| 148 static RawCode* name##Code() { \ |
| 149 return name##_entry()->code(); \ |
| 150 } \ |
| 148 static const ExternalLabel& name##Label() { \ | 151 static const ExternalLabel& name##Label() { \ |
| 149 return name##_entry()->label(); \ | 152 return name##_entry()->label(); \ |
| 150 } \ | 153 } \ |
| 151 static uword name##EntryPoint() { \ | 154 static uword name##EntryPoint() { \ |
| 152 return name##_entry()->EntryPoint(); \ | 155 return name##_entry()->EntryPoint(); \ |
| 153 } \ | 156 } \ |
| 154 static intptr_t name##Size() { \ | 157 static intptr_t name##Size() { \ |
| 155 return name##_entry()->Size(); \ | 158 return name##_entry()->Size(); \ |
| 156 } | 159 } |
| 157 VM_STUB_CODE_LIST(STUB_CODE_ACCESSOR); | 160 VM_STUB_CODE_LIST(STUB_CODE_ACCESSOR); |
| 158 #undef STUB_CODE_ACCESSOR | 161 #undef STUB_CODE_ACCESSOR |
| 159 | 162 |
| 160 // Define the per-isolate stub code accessors. | 163 // Define the per-isolate stub code accessors. |
| 161 #define STUB_CODE_ACCESSOR(name) \ | 164 #define STUB_CODE_ACCESSOR(name) \ |
| 162 StubEntry* name##_entry() { \ | 165 StubEntry* name##_entry() { \ |
| 163 return name##_entry_; \ | 166 return name##_entry_; \ |
| 164 } \ | 167 } \ |
| 168 RawCode* name##Code() { \ |
| 169 return name##_entry()->code(); \ |
| 170 } \ |
| 165 const ExternalLabel& name##Label() { \ | 171 const ExternalLabel& name##Label() { \ |
| 166 return name##_entry()->label(); \ | 172 return name##_entry()->label(); \ |
| 167 } \ | 173 } \ |
| 168 uword name##EntryPoint() { \ | 174 uword name##EntryPoint() { \ |
| 169 return name##_entry()->EntryPoint(); \ | 175 return name##_entry()->EntryPoint(); \ |
| 170 } \ | 176 } \ |
| 171 intptr_t name##Size() { \ | 177 intptr_t name##Size() { \ |
| 172 return name##_entry()->Size(); \ | 178 return name##_entry()->Size(); \ |
| 173 } | 179 } |
| 174 STUB_CODE_LIST(STUB_CODE_ACCESSOR); | 180 STUB_CODE_LIST(STUB_CODE_ACCESSOR); |
| 175 #undef STUB_CODE_ACCESSOR | 181 #undef STUB_CODE_ACCESSOR |
| 176 | 182 |
| 177 static RawCode* GetAllocationStubForClass(const Class& cls); | 183 static RawCode* GetAllocationStubForClass(const Class& cls); |
| 178 RawCode* GetAllocateArrayStub(); | 184 RawCode* GetAllocateArrayStub(); |
| 179 | 185 |
| 180 uword UnoptimizedStaticCallEntryPoint(intptr_t num_args_tested); | 186 uword UnoptimizedStaticCallEntryPoint(intptr_t num_args_tested); |
| 187 RawCode* UnoptimizedStaticCallCode(intptr_t num_args_tested); |
| 181 | 188 |
| 182 static const intptr_t kNoInstantiator = 0; | 189 static const intptr_t kNoInstantiator = 0; |
| 183 | 190 |
| 184 static void EmitMegamorphicLookup( | 191 static void EmitMegamorphicLookup( |
| 185 Assembler*, Register recv, Register cache, Register target); | 192 Assembler*, Register recv, Register cache, Register target); |
| 186 | 193 |
| 187 private: | 194 private: |
| 188 void GenerateBootstrapStubsFor(Isolate* isolate); | 195 void GenerateBootstrapStubsFor(Isolate* isolate); |
| 189 void GenerateStubsFor(Isolate* isolate); | 196 void GenerateStubsFor(Isolate* isolate); |
| 190 | 197 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 Assembler* assembler, | 247 Assembler* assembler, |
| 241 const Register left, | 248 const Register left, |
| 242 const Register right, | 249 const Register right, |
| 243 const Register temp1 = kNoRegister, | 250 const Register temp1 = kNoRegister, |
| 244 const Register temp2 = kNoRegister); | 251 const Register temp2 = kNoRegister); |
| 245 }; | 252 }; |
| 246 | 253 |
| 247 } // namespace dart | 254 } // namespace dart |
| 248 | 255 |
| 249 #endif // VM_STUB_CODE_H_ | 256 #endif // VM_STUB_CODE_H_ |
| OLD | NEW |