| 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 2381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2801 return kCosRuntimeEntry; | 2823 return kCosRuntimeEntry; |
| 2802 default: | 2824 default: |
| 2803 UNREACHABLE(); | 2825 UNREACHABLE(); |
| 2804 } | 2826 } |
| 2805 return kSinRuntimeEntry; | 2827 return kSinRuntimeEntry; |
| 2806 } | 2828 } |
| 2807 | 2829 |
| 2808 #undef __ | 2830 #undef __ |
| 2809 | 2831 |
| 2810 } // namespace dart | 2832 } // namespace dart |
| OLD | NEW |