| 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 #include "vm/symbols.h" | 9 #include "vm/symbols.h" |
| 10 | 10 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 const Function& function, | 62 const Function& function, |
| 63 const char* function_class_name, | 63 const char* function_class_name, |
| 64 const char* function_name, | 64 const char* function_name, |
| 65 const char* test_class_name, | 65 const char* test_class_name, |
| 66 const char* test_function_name) { | 66 const char* test_function_name) { |
| 67 // If test_function_name starts with a '.' we use that to indicate | 67 // If test_function_name starts with a '.' we use that to indicate |
| 68 // that it is a named constructor in the class. Therefore, if | 68 // that it is a named constructor in the class. Therefore, if |
| 69 // the class matches and the rest of the method name starting with | 69 // the class matches and the rest of the method name starting with |
| 70 // the dot matches, we have found a match. | 70 // the dot matches, we have found a match. |
| 71 // We do not store the entire factory constructor name with the class | 71 // We do not store the entire factory constructor name with the class |
| 72 // (e.g: _GrowableObjectArray.withData) because the actual function name | 72 // (e.g: _GrowableList.withData) because the actual function name |
| 73 // that we see here includes the private key. | 73 // that we see here includes the private key. |
| 74 if (test_function_name[0] == '.') { | 74 if (test_function_name[0] == '.') { |
| 75 function_name = strstr(function_name, "."); | 75 function_name = strstr(function_name, "."); |
| 76 if (function_name == NULL) { | 76 if (function_name == NULL) { |
| 77 return false; | 77 return false; |
| 78 } | 78 } |
| 79 } | 79 } |
| 80 return CompareNames(lib, test_class_name, function_class_name) && | 80 return CompareNames(lib, test_class_name, function_class_name) && |
| 81 CompareNames(lib, test_function_name, function_name); | 81 CompareNames(lib, test_function_name, function_name); |
| 82 } | 82 } |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 } | 164 } |
| 165 } else if (lib.raw() == Library::TypedDataLibrary()) { | 165 } else if (lib.raw() == Library::TypedDataLibrary()) { |
| 166 TYPED_DATA_LIB_INTRINSIC_LIST(FIND_INTRINSICS); | 166 TYPED_DATA_LIB_INTRINSIC_LIST(FIND_INTRINSICS); |
| 167 } else if (lib.raw() == Library::MathLibrary()) { | 167 } else if (lib.raw() == Library::MathLibrary()) { |
| 168 MATH_LIB_INTRINSIC_LIST(FIND_INTRINSICS); | 168 MATH_LIB_INTRINSIC_LIST(FIND_INTRINSICS); |
| 169 } | 169 } |
| 170 #undef FIND_INTRINSICS | 170 #undef FIND_INTRINSICS |
| 171 } | 171 } |
| 172 | 172 |
| 173 } // namespace dart | 173 } // namespace dart |
| OLD | NEW |