| 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 #ifndef VM_INTRINSIFIER_H_ | 6 #ifndef VM_INTRINSIFIER_H_ |
| 7 #define VM_INTRINSIFIER_H_ | 7 #define VM_INTRINSIFIER_H_ |
| 8 | 8 |
| 9 #include "vm/allocation.h" | 9 #include "vm/allocation.h" |
| 10 | 10 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 V(StringBase, charCodeAt, String_charCodeAt) \ | 78 V(StringBase, charCodeAt, String_charCodeAt) \ |
| 79 V(StringBase, hashCode, String_hashCode) \ | 79 V(StringBase, hashCode, String_hashCode) \ |
| 80 V(StringBase, isEmpty, String_isEmpty) \ | 80 V(StringBase, isEmpty, String_isEmpty) \ |
| 81 V(_ByteArrayBase, get:length, ByteArrayBase_getLength) \ | 81 V(_ByteArrayBase, get:length, ByteArrayBase_getLength) \ |
| 82 V(_Int8Array, [], Int8Array_getIndexed) \ | 82 V(_Int8Array, [], Int8Array_getIndexed) \ |
| 83 V(_Uint8Array, [], Uint8Array_getIndexed) \ | 83 V(_Uint8Array, [], Uint8Array_getIndexed) \ |
| 84 V(_Int16Array, [], Int16Array_getIndexed) \ | 84 V(_Int16Array, [], Int16Array_getIndexed) \ |
| 85 V(_Uint16Array, [], Uint16Array_getIndexed) \ | 85 V(_Uint16Array, [], Uint16Array_getIndexed) \ |
| 86 V(_Int32Array, [], Int32Array_getIndexed) \ | 86 V(_Int32Array, [], Int32Array_getIndexed) \ |
| 87 V(_Uint32Array, [], Uint32Array_getIndexed) \ | 87 V(_Uint32Array, [], Uint32Array_getIndexed) \ |
| 88 V(_Float32Array, [], Float32Array_getIndexed) \ |
| 89 V(_Float32Array, []=, Float32Array_setIndexed) \ |
| 88 | 90 |
| 89 // Forward declarations. | 91 // Forward declarations. |
| 90 class Assembler; | 92 class Assembler; |
| 91 class Function; | 93 class Function; |
| 92 | 94 |
| 93 class Intrinsifier : public AllStatic { | 95 class Intrinsifier : public AllStatic { |
| 94 public: | 96 public: |
| 95 // Try to intrinsify 'function'. Returns true if the function intrinsified | 97 // Try to intrinsify 'function'. Returns true if the function intrinsified |
| 96 // completely and the code does not need to be generated (i.e., no slow | 98 // completely and the code does not need to be generated (i.e., no slow |
| 97 // path possible). | 99 // path possible). |
| 98 static bool Intrinsify(const Function& function, Assembler* assembler); | 100 static bool Intrinsify(const Function& function, Assembler* assembler); |
| 99 static bool CanIntrinsify(const Function& function); | 101 static bool CanIntrinsify(const Function& function); |
| 100 | 102 |
| 101 private: | 103 private: |
| 102 #define DECLARE_FUNCTION(test_class_name, test_function_name, destination) \ | 104 #define DECLARE_FUNCTION(test_class_name, test_function_name, destination) \ |
| 103 static bool destination(Assembler* assembler); | 105 static bool destination(Assembler* assembler); |
| 104 | 106 |
| 105 INTRINSIC_LIST(DECLARE_FUNCTION) | 107 INTRINSIC_LIST(DECLARE_FUNCTION) |
| 106 #undef DECLARE_FUNCTION | 108 #undef DECLARE_FUNCTION |
| 107 }; | 109 }; |
| 108 | 110 |
| 109 } // namespace dart | 111 } // namespace dart |
| 110 | 112 |
| 111 #endif // VM_INTRINSIFIER_H_ | 113 #endif // VM_INTRINSIFIER_H_ |
| OLD | NEW |