| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
| 8 #include "vm/bit_vector.h" | 8 #include "vm/bit_vector.h" |
| 9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
| 10 #include "vm/flow_graph_allocator.h" | 10 #include "vm/flow_graph_allocator.h" |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 CompareNames(lib, #test_class_name, class_name)) { \ | 400 CompareNames(lib, #test_class_name, class_name)) { \ |
| 401 ASSERT(function.CheckSourceFingerprint(fp)); \ | 401 ASSERT(function.CheckSourceFingerprint(fp)); \ |
| 402 return true; \ | 402 return true; \ |
| 403 } | 403 } |
| 404 INLINE_WHITE_LIST(RECOGNIZE_FUNCTION) | 404 INLINE_WHITE_LIST(RECOGNIZE_FUNCTION) |
| 405 #undef RECOGNIZE_FUNCTION | 405 #undef RECOGNIZE_FUNCTION |
| 406 return false; | 406 return false; |
| 407 } | 407 } |
| 408 | 408 |
| 409 | 409 |
| 410 bool MethodRecognizer::PolymorphicTarget(const Function& function) { |
| 411 const Class& function_class = Class::Handle(function.Owner()); |
| 412 const Library& lib = Library::Handle(function_class.library()); |
| 413 if (!IsRecognizedLibrary(lib)) { |
| 414 return false; |
| 415 } |
| 416 |
| 417 const String& function_name = String::Handle(function.name()); |
| 418 const String& class_name = String::Handle(function_class.Name()); |
| 419 |
| 420 #define RECOGNIZE_FUNCTION(test_class_name, test_function_name, enum_name, fp) \ |
| 421 if (CompareNames(lib, #test_function_name, function_name) && \ |
| 422 CompareNames(lib, #test_class_name, class_name)) { \ |
| 423 ASSERT(function.CheckSourceFingerprint(fp)); \ |
| 424 return true; \ |
| 425 } |
| 426 POLYMORPHC_TARGET_LIST(RECOGNIZE_FUNCTION) |
| 427 #undef RECOGNIZE_FUNCTION |
| 428 return false; |
| 429 } |
| 430 |
| 431 |
| 410 const char* MethodRecognizer::KindToCString(Kind kind) { | 432 const char* MethodRecognizer::KindToCString(Kind kind) { |
| 411 #define KIND_TO_STRING(class_name, function_name, enum_name, fp) \ | 433 #define KIND_TO_STRING(class_name, function_name, enum_name, fp) \ |
| 412 if (kind == k##enum_name) return #enum_name; | 434 if (kind == k##enum_name) return #enum_name; |
| 413 RECOGNIZED_LIST(KIND_TO_STRING) | 435 RECOGNIZED_LIST(KIND_TO_STRING) |
| 414 #undef KIND_TO_STRING | 436 #undef KIND_TO_STRING |
| 415 return "?"; | 437 return "?"; |
| 416 } | 438 } |
| 417 | 439 |
| 418 | 440 |
| 419 void MethodRecognizer::InitializeState() { | 441 void MethodRecognizer::InitializeState() { |
| (...skipping 2351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2771 return kCosRuntimeEntry; | 2793 return kCosRuntimeEntry; |
| 2772 default: | 2794 default: |
| 2773 UNREACHABLE(); | 2795 UNREACHABLE(); |
| 2774 } | 2796 } |
| 2775 return kSinRuntimeEntry; | 2797 return kSinRuntimeEntry; |
| 2776 } | 2798 } |
| 2777 | 2799 |
| 2778 #undef __ | 2800 #undef __ |
| 2779 | 2801 |
| 2780 } // namespace dart | 2802 } // namespace dart |
| OLD | NEW |