| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 Isolate* isolate = Isolate::Current(); | 95 Isolate* isolate = Isolate::Current(); |
| 96 Library& lib = Library::Handle(isolate); | 96 Library& lib = Library::Handle(isolate); |
| 97 Class& cls = Class::Handle(isolate); | 97 Class& cls = Class::Handle(isolate); |
| 98 Function& func = Function::Handle(isolate); | 98 Function& func = Function::Handle(isolate); |
| 99 String& str = String::Handle(isolate); | 99 String& str = String::Handle(isolate); |
| 100 Error& error = Error::Handle(isolate); | 100 Error& error = Error::Handle(isolate); |
| 101 | 101 |
| 102 #define SETUP_FUNCTION(class_name, function_name, destination, fp) \ | 102 #define SETUP_FUNCTION(class_name, function_name, destination, fp) \ |
| 103 if (strcmp(#class_name, "::") == 0) { \ | 103 if (strcmp(#class_name, "::") == 0) { \ |
| 104 str = String::New(#function_name); \ | 104 str = String::New(#function_name); \ |
| 105 func = lib.LookupFunctionAllowPrivate(str, NULL); \ | 105 func = lib.LookupFunctionAllowPrivate(str); \ |
| 106 } else { \ | 106 } else { \ |
| 107 str = String::New(#class_name); \ | 107 str = String::New(#class_name); \ |
| 108 cls = lib.LookupClassAllowPrivate(str, NULL); \ | 108 cls = lib.LookupClassAllowPrivate(str); \ |
| 109 ASSERT(!cls.IsNull()); \ | 109 ASSERT(!cls.IsNull()); \ |
| 110 error = cls.EnsureIsFinalized(isolate); \ | 110 error = cls.EnsureIsFinalized(isolate); \ |
| 111 ASSERT(error.IsNull()); \ | 111 ASSERT(error.IsNull()); \ |
| 112 if (#function_name[0] == '.') { \ | 112 if (#function_name[0] == '.') { \ |
| 113 str = String::New(#class_name#function_name); \ | 113 str = String::New(#class_name#function_name); \ |
| 114 } else { \ | 114 } else { \ |
| 115 str = String::New(#function_name); \ | 115 str = String::New(#function_name); \ |
| 116 } \ | 116 } \ |
| 117 func = cls.LookupFunctionAllowPrivate(str); \ | 117 func = cls.LookupFunctionAllowPrivate(str); \ |
| 118 } \ | 118 } \ |
| (...skipping 45 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 |