OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 #include "vm/intermediate_language.h" | 5 #include "vm/intermediate_language.h" |
6 | 6 |
7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
8 #include "vm/dart_entry.h" | 8 #include "vm/dart_entry.h" |
9 #include "vm/flow_graph_allocator.h" | 9 #include "vm/flow_graph_allocator.h" |
10 #include "vm/flow_graph_builder.h" | 10 #include "vm/flow_graph_builder.h" |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 const Library& math_lib = Library::Handle(Library::MathLibrary()); | 234 const Library& math_lib = Library::Handle(Library::MathLibrary()); |
235 const Class& function_class = Class::Handle(function.Owner()); | 235 const Class& function_class = Class::Handle(function.Owner()); |
236 if ((function_class.library() != core_lib.raw()) && | 236 if ((function_class.library() != core_lib.raw()) && |
237 (function_class.library() != math_lib.raw())) { | 237 (function_class.library() != math_lib.raw())) { |
238 return kUnknown; | 238 return kUnknown; |
239 } | 239 } |
240 const Library& lib = Library::Handle(function_class.library()); | 240 const Library& lib = Library::Handle(function_class.library()); |
241 const String& function_name = String::Handle(function.name()); | 241 const String& function_name = String::Handle(function.name()); |
242 const String& class_name = String::Handle(function_class.Name()); | 242 const String& class_name = String::Handle(function_class.Name()); |
243 | 243 |
244 #define RECOGNIZE_FUNCTION(test_class_name, test_function_name, enum_name) \ | 244 #define RECOGNIZE_FUNCTION(test_class_name, test_function_name, enum_name, fp) \ |
245 if (CompareNames(lib, #test_function_name, function_name) && \ | 245 if (CompareNames(lib, #test_function_name, function_name) && \ |
246 CompareNames(lib, #test_class_name, class_name)) { \ | 246 CompareNames(lib, #test_class_name, class_name)) { \ |
| 247 ASSERT(function.CheckSourceFingerprint(fp)); \ |
247 return k##enum_name; \ | 248 return k##enum_name; \ |
248 } | 249 } |
249 RECOGNIZED_LIST(RECOGNIZE_FUNCTION) | 250 RECOGNIZED_LIST(RECOGNIZE_FUNCTION) |
250 #undef RECOGNIZE_FUNCTION | 251 #undef RECOGNIZE_FUNCTION |
251 return kUnknown; | 252 return kUnknown; |
252 } | 253 } |
253 | 254 |
254 | 255 |
255 const char* MethodRecognizer::KindToCString(Kind kind) { | 256 const char* MethodRecognizer::KindToCString(Kind kind) { |
256 #define KIND_TO_STRING(class_name, function_name, enum_name) \ | 257 #define KIND_TO_STRING(class_name, function_name, enum_name, fp) \ |
257 if (kind == k##enum_name) return #enum_name; | 258 if (kind == k##enum_name) return #enum_name; |
258 RECOGNIZED_LIST(KIND_TO_STRING) | 259 RECOGNIZED_LIST(KIND_TO_STRING) |
259 #undef KIND_TO_STRING | 260 #undef KIND_TO_STRING |
260 return "?"; | 261 return "?"; |
261 } | 262 } |
262 | 263 |
263 | 264 |
264 // ==== Support for visiting flow graphs. | 265 // ==== Support for visiting flow graphs. |
265 #define DEFINE_ACCEPT(ShortName) \ | 266 #define DEFINE_ACCEPT(ShortName) \ |
266 void ShortName##Instr::Accept(FlowGraphVisitor* visitor) { \ | 267 void ShortName##Instr::Accept(FlowGraphVisitor* visitor) { \ |
(...skipping 2386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2653 return Array::length_offset(); | 2654 return Array::length_offset(); |
2654 default: | 2655 default: |
2655 UNREACHABLE(); | 2656 UNREACHABLE(); |
2656 return -1; | 2657 return -1; |
2657 } | 2658 } |
2658 } | 2659 } |
2659 | 2660 |
2660 #undef __ | 2661 #undef __ |
2661 | 2662 |
2662 } // namespace dart | 2663 } // namespace dart |
OLD | NEW |