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/assembler.h" | 7 #include "vm/assembler.h" |
8 #include "vm/compiler.h" | 8 #include "vm/compiler.h" |
9 #include "vm/cpu.h" | 9 #include "vm/cpu.h" |
10 #include "vm/flags.h" | 10 #include "vm/flags.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 OS::PrintErr("%s\n", error.ToErrorCString()); \ | 81 OS::PrintErr("%s\n", error.ToErrorCString()); \ |
82 } \ | 82 } \ |
83 ASSERT(error.IsNull()); \ | 83 ASSERT(error.IsNull()); \ |
84 if (#function_name[0] == '.') { \ | 84 if (#function_name[0] == '.') { \ |
85 str = String::New(#class_name #function_name); \ | 85 str = String::New(#class_name #function_name); \ |
86 } else { \ | 86 } else { \ |
87 str = String::New(#function_name); \ | 87 str = String::New(#function_name); \ |
88 } \ | 88 } \ |
89 func = cls.LookupFunctionAllowPrivate(str); \ | 89 func = cls.LookupFunctionAllowPrivate(str); \ |
90 } \ | 90 } \ |
91 ASSERT(!func.IsNull()); \ | 91 if (func.IsNull()) { \ |
| 92 FATAL2("Intrinsifier failed to find method %s in class %s\n", \ |
| 93 #function_name, #class_name); \ |
| 94 } \ |
92 func.set_is_intrinsic(true); | 95 func.set_is_intrinsic(true); |
93 | 96 |
94 // Set up all core lib functions that can be intrinsified. | 97 // Set up all core lib functions that can be intrinsified. |
95 lib = Library::CoreLibrary(); | 98 lib = Library::CoreLibrary(); |
96 ASSERT(!lib.IsNull()); | 99 ASSERT(!lib.IsNull()); |
97 CORE_LIB_INTRINSIC_LIST(SETUP_FUNCTION); | 100 CORE_LIB_INTRINSIC_LIST(SETUP_FUNCTION); |
98 CORE_INTEGER_LIB_INTRINSIC_LIST(SETUP_FUNCTION); | 101 CORE_INTEGER_LIB_INTRINSIC_LIST(SETUP_FUNCTION); |
99 GRAPH_CORE_INTRINSICS_LIST(SETUP_FUNCTION); | 102 GRAPH_CORE_INTRINSICS_LIST(SETUP_FUNCTION); |
100 | 103 |
101 // Set up all math lib functions that can be intrinsified. | 104 // Set up all math lib functions that can be intrinsified. |
(...skipping 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1128 void Intrinsifier::RegExp_ExecuteMatch(Assembler* assembler) { | 1131 void Intrinsifier::RegExp_ExecuteMatch(Assembler* assembler) { |
1129 IntrinsifyRegExpExecuteMatch(assembler, /*sticky=*/false); | 1132 IntrinsifyRegExpExecuteMatch(assembler, /*sticky=*/false); |
1130 } | 1133 } |
1131 | 1134 |
1132 void Intrinsifier::RegExp_ExecuteMatchSticky(Assembler* assembler) { | 1135 void Intrinsifier::RegExp_ExecuteMatchSticky(Assembler* assembler) { |
1133 IntrinsifyRegExpExecuteMatch(assembler, /*sticky=*/true); | 1136 IntrinsifyRegExpExecuteMatch(assembler, /*sticky=*/true); |
1134 } | 1137 } |
1135 #endif // !defined(TARGET_ARCH_DBC) | 1138 #endif // !defined(TARGET_ARCH_DBC) |
1136 | 1139 |
1137 } // namespace dart | 1140 } // namespace dart |
OLD | NEW |