| 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 // Class for intrinsifying functions. | 4 // Class for intrinsifying functions. |
| 5 | 5 |
| 6 #include "vm/intrinsifier.h" | 6 #include "vm/intrinsifier.h" |
| 7 #include "vm/flags.h" | 7 #include "vm/flags.h" |
| 8 #include "vm/object.h" | 8 #include "vm/object.h" |
| 9 | 9 |
| 10 namespace dart { | 10 namespace dart { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 return true; \ | 87 return true; \ |
| 88 } \ | 88 } \ |
| 89 | 89 |
| 90 INTRINSIC_LIST(FIND_INTRINSICS); | 90 INTRINSIC_LIST(FIND_INTRINSICS); |
| 91 #undef FIND_INTRINSICS | 91 #undef FIND_INTRINSICS |
| 92 function.set_intrinsic_kind(Function::kIsNotIntrinsic); | 92 function.set_intrinsic_kind(Function::kIsNotIntrinsic); |
| 93 return false; | 93 return false; |
| 94 } | 94 } |
| 95 | 95 |
| 96 | 96 |
| 97 static bool CheckFingerprint(const Function& function, intptr_t fp) { | |
| 98 /*if (function.SourceFingerprint() != fp) { | |
| 99 OS::Print("FP mismatch while intrinsifying %s:" | |
| 100 " expecting %"Pd" found %d\n", | |
| 101 function.ToFullyQualifiedCString(), | |
| 102 fp, | |
| 103 function.SourceFingerprint()); | |
| 104 return true; | |
| 105 } */ | |
| 106 return true; | |
| 107 } | |
| 108 | |
| 109 | |
| 110 bool Intrinsifier::Intrinsify(const Function& function, Assembler* assembler) { | 97 bool Intrinsifier::Intrinsify(const Function& function, Assembler* assembler) { |
| 111 if (!CanIntrinsify(function)) return false; | 98 if (!CanIntrinsify(function)) return false; |
| 112 const char* function_name = String::Handle(function.name()).ToCString(); | 99 const char* function_name = String::Handle(function.name()).ToCString(); |
| 113 const Class& function_class = Class::Handle(function.Owner()); | 100 const Class& function_class = Class::Handle(function.Owner()); |
| 114 const char* class_name = String::Handle(function_class.Name()).ToCString(); | 101 const char* class_name = String::Handle(function_class.Name()).ToCString(); |
| 115 #define FIND_INTRINSICS(test_class_name, test_function_name, destination, fp) \ | 102 #define FIND_INTRINSICS(test_class_name, test_function_name, destination, fp) \ |
| 116 if (TestFunction(function, \ | 103 if (TestFunction(function, \ |
| 117 class_name, function_name, \ | 104 class_name, function_name, \ |
| 118 #test_class_name, #test_function_name)) { \ | 105 #test_class_name, #test_function_name)) { \ |
| 119 ASSERT(CheckFingerprint(function, fp)); \ | 106 ASSERT(function.CheckSourceFingerprint(fp)); \ |
| 120 return destination(assembler); \ | 107 return destination(assembler); \ |
| 121 } \ | 108 } \ |
| 122 | 109 |
| 123 INTRINSIC_LIST(FIND_INTRINSICS); | 110 INTRINSIC_LIST(FIND_INTRINSICS); |
| 124 #undef FIND_INTRINSICS | 111 #undef FIND_INTRINSICS |
| 125 return false; | 112 return false; |
| 126 } | 113 } |
| 127 | 114 |
| 128 } // namespace dart | 115 } // namespace dart |
| OLD | NEW |