| 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 RUNTIME_VM_RUNTIME_ENTRY_H_ | 5 #ifndef RUNTIME_VM_RUNTIME_ENTRY_H_ |
| 6 #define RUNTIME_VM_RUNTIME_ENTRY_H_ | 6 #define RUNTIME_VM_RUNTIME_ENTRY_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "vm/flags.h" | 9 #include "vm/flags.h" |
| 10 #include "vm/native_arguments.h" | 10 #include "vm/native_arguments.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 const bool is_leaf_; | 73 const bool is_leaf_; |
| 74 const bool is_float_; | 74 const bool is_float_; |
| 75 const RuntimeEntry* next_; | 75 const RuntimeEntry* next_; |
| 76 | 76 |
| 77 DISALLOW_COPY_AND_ASSIGN(RuntimeEntry); | 77 DISALLOW_COPY_AND_ASSIGN(RuntimeEntry); |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 #ifndef PRODUCT | 80 #ifndef PRODUCT |
| 81 #define TRACE_RUNTIME_CALL(format, name) \ | 81 #define TRACE_RUNTIME_CALL(format, name) \ |
| 82 if (FLAG_trace_runtime_calls) { \ | 82 if (FLAG_trace_runtime_calls) { \ |
| 83 OS::Print("Runtime call: " format "\n", name); \ | 83 THR_Print("Runtime call: " format "\n", name); \ |
| 84 } | 84 } |
| 85 #else | 85 #else |
| 86 #define TRACE_RUNTIME_CALL(format, name) \ | 86 #define TRACE_RUNTIME_CALL(format, name) \ |
| 87 do { \ | 87 do { \ |
| 88 } while (0) | 88 } while (0) |
| 89 #endif | 89 #endif |
| 90 | 90 |
| 91 // Helper macros for declaring and defining runtime entries. | 91 // Helper macros for declaring and defining runtime entries. |
| 92 | 92 |
| 93 #define DEFINE_RUNTIME_ENTRY(name, argument_count) \ | 93 #define DEFINE_RUNTIME_ENTRY(name, argument_count) \ |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 #define DECLARE_LEAF_RUNTIME_ENTRY(type, name, ...) \ | 139 #define DECLARE_LEAF_RUNTIME_ENTRY(type, name, ...) \ |
| 140 extern const RuntimeEntry k##name##RuntimeEntry; \ | 140 extern const RuntimeEntry k##name##RuntimeEntry; \ |
| 141 extern "C" type DLRT_##name(__VA_ARGS__); | 141 extern "C" type DLRT_##name(__VA_ARGS__); |
| 142 | 142 |
| 143 | 143 |
| 144 // Declare all runtime functions here. | 144 // Declare all runtime functions here. |
| 145 RUNTIME_ENTRY_LIST(DECLARE_RUNTIME_ENTRY) | 145 RUNTIME_ENTRY_LIST(DECLARE_RUNTIME_ENTRY) |
| 146 LEAF_RUNTIME_ENTRY_LIST(DECLARE_LEAF_RUNTIME_ENTRY) | 146 LEAF_RUNTIME_ENTRY_LIST(DECLARE_LEAF_RUNTIME_ENTRY) |
| 147 | 147 |
| 148 | 148 |
| 149 // Declare all runtime functions here. | |
| 150 RUNTIME_ENTRY_LIST(DECLARE_RUNTIME_ENTRY) | |
| 151 LEAF_RUNTIME_ENTRY_LIST(DECLARE_LEAF_RUNTIME_ENTRY) | |
| 152 | |
| 153 | |
| 154 uword RuntimeEntry::AddressFromId(RuntimeFunctionId id) { | 149 uword RuntimeEntry::AddressFromId(RuntimeFunctionId id) { |
| 155 switch (id) { | 150 switch (id) { |
| 156 #define DEFINE_RUNTIME_CASE(name) \ | 151 #define DEFINE_RUNTIME_CASE(name) \ |
| 157 case k##name##Id: \ | 152 case k##name##Id: \ |
| 158 return k##name##RuntimeEntry.GetEntryPoint(); | 153 return k##name##RuntimeEntry.GetEntryPoint(); |
| 159 RUNTIME_ENTRY_LIST(DEFINE_RUNTIME_CASE) | 154 RUNTIME_ENTRY_LIST(DEFINE_RUNTIME_CASE) |
| 160 #undef DEFINE_RUNTIME_CASE | 155 #undef DEFINE_RUNTIME_CASE |
| 161 | 156 |
| 162 #define DEFINE_LEAF_RUNTIME_CASE(type, name, ...) \ | 157 #define DEFINE_LEAF_RUNTIME_CASE(type, name, ...) \ |
| 163 case k##name##Id: \ | 158 case k##name##Id: \ |
| (...skipping 13 matching lines...) Expand all Loading... |
| 177 RUNTIME_ENTRY_LIST(CHECK_RUNTIME_ADDRESS) | 172 RUNTIME_ENTRY_LIST(CHECK_RUNTIME_ADDRESS) |
| 178 #undef CHECK_RUNTIME_ADDRESS | 173 #undef CHECK_RUNTIME_ADDRESS |
| 179 | 174 |
| 180 #define CHECK_LEAF_RUNTIME_ADDRESS(type, name, ...) \ | 175 #define CHECK_LEAF_RUNTIME_ADDRESS(type, name, ...) \ |
| 181 if (address == k##name##RuntimeEntry.GetEntryPoint()) return k##name##Id; | 176 if (address == k##name##RuntimeEntry.GetEntryPoint()) return k##name##Id; |
| 182 LEAF_RUNTIME_ENTRY_LIST(CHECK_LEAF_RUNTIME_ADDRESS) | 177 LEAF_RUNTIME_ENTRY_LIST(CHECK_LEAF_RUNTIME_ADDRESS) |
| 183 #undef CHECK_LEAF_RUNTIME_ADDRESS | 178 #undef CHECK_LEAF_RUNTIME_ADDRESS |
| 184 return kNoRuntimeFunctionId; | 179 return kNoRuntimeFunctionId; |
| 185 } | 180 } |
| 186 | 181 |
| 182 const char* DeoptReasonToCString(ICData::DeoptReasonId deopt_reason); |
| 183 |
| 184 void DeoptimizeAt(const Code& optimized_code, StackFrame* frame); |
| 185 void DeoptimizeFunctionsOnStack(); |
| 186 |
| 187 double DartModulo(double a, double b); |
| 188 |
| 187 } // namespace dart | 189 } // namespace dart |
| 188 | 190 |
| 189 #endif // RUNTIME_VM_RUNTIME_ENTRY_H_ | 191 #endif // RUNTIME_VM_RUNTIME_ENTRY_H_ |
| OLD | NEW |