| 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/assembler.h" | 6 #include "vm/assembler.h" |
| 7 #include "vm/compiler.h" | 7 #include "vm/compiler.h" |
| 8 #include "vm/flags.h" | 8 #include "vm/flags.h" |
| 9 #include "vm/flow_graph.h" | 9 #include "vm/flow_graph.h" |
| 10 #include "vm/flow_graph_compiler.h" | 10 #include "vm/flow_graph_compiler.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 if (#function_name[0] == '.') { \ | 61 if (#function_name[0] == '.') { \ |
| 62 str = String::New(#class_name#function_name); \ | 62 str = String::New(#class_name#function_name); \ |
| 63 } else { \ | 63 } else { \ |
| 64 str = String::New(#function_name); \ | 64 str = String::New(#function_name); \ |
| 65 } \ | 65 } \ |
| 66 func = cls.LookupFunctionAllowPrivate(str); \ | 66 func = cls.LookupFunctionAllowPrivate(str); \ |
| 67 } \ | 67 } \ |
| 68 ASSERT(!func.IsNull()); \ | 68 ASSERT(!func.IsNull()); \ |
| 69 func.set_is_intrinsic(true); | 69 func.set_is_intrinsic(true); |
| 70 | 70 |
| 71 // Set up all core lib functions that can be intrisified. | 71 // Set up all core lib functions that can be intrinsified. |
| 72 lib = Library::CoreLibrary(); | 72 lib = Library::CoreLibrary(); |
| 73 ASSERT(!lib.IsNull()); | 73 ASSERT(!lib.IsNull()); |
| 74 CORE_LIB_INTRINSIC_LIST(SETUP_FUNCTION); | 74 CORE_LIB_INTRINSIC_LIST(SETUP_FUNCTION); |
| 75 CORE_INTEGER_LIB_INTRINSIC_LIST(SETUP_FUNCTION); | 75 CORE_INTEGER_LIB_INTRINSIC_LIST(SETUP_FUNCTION); |
| 76 GRAPH_CORE_INTRINSICS_LIST(SETUP_FUNCTION); | 76 GRAPH_CORE_INTRINSICS_LIST(SETUP_FUNCTION); |
| 77 | 77 |
| 78 // Set up all math lib functions that can be intrisified. | 78 // Set up all math lib functions that can be intrinsified. |
| 79 lib = Library::MathLibrary(); | 79 lib = Library::MathLibrary(); |
| 80 ASSERT(!lib.IsNull()); | 80 ASSERT(!lib.IsNull()); |
| 81 MATH_LIB_INTRINSIC_LIST(SETUP_FUNCTION); | 81 MATH_LIB_INTRINSIC_LIST(SETUP_FUNCTION); |
| 82 | 82 |
| 83 // Set up all dart:typed_data lib functions that can be intrisified. | 83 // Set up all dart:typed_data lib functions that can be intrinsified. |
| 84 lib = Library::TypedDataLibrary(); | 84 lib = Library::TypedDataLibrary(); |
| 85 ASSERT(!lib.IsNull()); | 85 ASSERT(!lib.IsNull()); |
| 86 TYPED_DATA_LIB_INTRINSIC_LIST(SETUP_FUNCTION); | 86 TYPED_DATA_LIB_INTRINSIC_LIST(SETUP_FUNCTION); |
| 87 GRAPH_TYPED_DATA_INTRINSICS_LIST(SETUP_FUNCTION); | 87 GRAPH_TYPED_DATA_INTRINSICS_LIST(SETUP_FUNCTION); |
| 88 | 88 |
| 89 // Setup all dart:developer lib functions that can be intrinsified. | 89 // Setup all dart:developer lib functions that can be intrinsified. |
| 90 lib = Library::DeveloperLibrary(); | 90 lib = Library::DeveloperLibrary(); |
| 91 ASSERT(!lib.IsNull()); | 91 ASSERT(!lib.IsNull()); |
| 92 DEVELOPER_LIB_INTRINSIC_LIST(SETUP_FUNCTION); | 92 DEVELOPER_LIB_INTRINSIC_LIST(SETUP_FUNCTION); |
| 93 | 93 |
| (...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 881 new UnaryDoubleOpInstr(Token::kNEGATE, | 881 new UnaryDoubleOpInstr(Token::kNEGATE, |
| 882 new Value(unboxed_value), | 882 new Value(unboxed_value), |
| 883 Thread::kNoDeoptId)); | 883 Thread::kNoDeoptId)); |
| 884 Definition* result = builder.AddDefinition( | 884 Definition* result = builder.AddDefinition( |
| 885 BoxInstr::Create(kUnboxedDouble, new Value(unboxed_result))); | 885 BoxInstr::Create(kUnboxedDouble, new Value(unboxed_result))); |
| 886 builder.AddIntrinsicReturn(new Value(result)); | 886 builder.AddIntrinsicReturn(new Value(result)); |
| 887 return true; | 887 return true; |
| 888 } | 888 } |
| 889 | 889 |
| 890 } // namespace dart | 890 } // namespace dart |
| OLD | NEW |