Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 | 4 |
| 5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ | 5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ |
| 6 #define VM_INTERMEDIATE_LANGUAGE_H_ | 6 #define VM_INTERMEDIATE_LANGUAGE_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "vm/ast.h" | 9 #include "vm/ast.h" |
| 10 #include "vm/growable_array.h" | 10 #include "vm/growable_array.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 170 | 170 |
| 171 // A list of core function that should always be inlined. | 171 // A list of core function that should always be inlined. |
| 172 #define INLINE_WHITE_LIST(V) \ | 172 #define INLINE_WHITE_LIST(V) \ |
| 173 V(_List, get:length, ObjectArrayLength, 215153395) \ | 173 V(_List, get:length, ObjectArrayLength, 215153395) \ |
| 174 V(_ImmutableList, get:length, ImmutableArrayLength, 578733070) \ | 174 V(_ImmutableList, get:length, ImmutableArrayLength, 578733070) \ |
| 175 V(_TypedList, get:length, TypedDataLength, 26616328) \ | 175 V(_TypedList, get:length, TypedDataLength, 26616328) \ |
| 176 V(_GrowableList, get:length, GrowableArrayLength, 1654225242) \ | 176 V(_GrowableList, get:length, GrowableArrayLength, 1654225242) \ |
| 177 V(_StringBase, get:length, StringBaseLength, 1483520063) \ | 177 V(_StringBase, get:length, StringBaseLength, 1483520063) \ |
| 178 V(ListIterator, moveNext, ListIteratorMoveNext, 90930587) \ | 178 V(ListIterator, moveNext, ListIteratorMoveNext, 90930587) \ |
| 179 V(_GrowableList, get:iterator, GrowableArrayIterator, 1305127405) \ | 179 V(_GrowableList, get:iterator, GrowableArrayIterator, 1305127405) \ |
| 180 V(_GrowableList, forEach, GrowableArrayForEach, 1675430533) | 180 V(_GrowableList, forEach, GrowableArrayForEach, 1675430533) \ |
| 181 | 181 |
| 182 // A list of core functions that internally dispatch based on received id. | |
| 183 #define POLYMORPHC_TARGET_LIST(V) \ | |
|
Cutch
2013/10/22 03:46:16
These methods internally dispatch on the receiver
| |
| 184 V(_TypedList, _getInt8, ByteArrayBaseGetInt8, 272598802) \ | |
| 185 V(_TypedList, _getUint8, ByteArrayBaseGetUint8, 831354841) \ | |
| 186 V(_TypedList, _getInt16, ByteArrayBaseGetInt16, 1832126257) \ | |
| 187 V(_TypedList, _getUint16, ByteArrayBaseGetUint16, 1762714698) \ | |
| 188 V(_TypedList, _getInt32, ByteArrayBaseGetInt32, 48785449) \ | |
| 189 V(_TypedList, _getUint32, ByteArrayBaseGetUint32, 1392579206) \ | |
| 190 V(_TypedList, _getFloat32, ByteArrayBaseGetFloat32, 185163470) \ | |
| 191 V(_TypedList, _getFloat64, ByteArrayBaseGetFloat64, 1356392173) \ | |
| 192 V(_TypedList, _getFloat32x4, ByteArrayBaseGetFloat32x4, 1239681356) \ | |
| 182 | 193 |
| 183 // Class that recognizes the name and owner of a function and returns the | 194 // Class that recognizes the name and owner of a function and returns the |
| 184 // corresponding enum. See RECOGNIZED_LIST above for list of recognizable | 195 // corresponding enum. See RECOGNIZED_LIST above for list of recognizable |
| 185 // functions. | 196 // functions. |
| 186 class MethodRecognizer : public AllStatic { | 197 class MethodRecognizer : public AllStatic { |
| 187 public: | 198 public: |
| 188 enum Kind { | 199 enum Kind { |
| 189 kUnknown, | 200 kUnknown, |
| 190 #define DEFINE_ENUM_LIST(class_name, function_name, enum_name, fp) k##enum_name, | 201 #define DEFINE_ENUM_LIST(class_name, function_name, enum_name, fp) k##enum_name, |
| 191 RECOGNIZED_LIST(DEFINE_ENUM_LIST) | 202 RECOGNIZED_LIST(DEFINE_ENUM_LIST) |
| 192 #undef DEFINE_ENUM_LIST | 203 #undef DEFINE_ENUM_LIST |
| 193 }; | 204 }; |
| 194 | 205 |
| 195 static Kind RecognizeKind(const Function& function); | 206 static Kind RecognizeKind(const Function& function); |
| 196 static bool AlwaysInline(const Function& function); | 207 static bool AlwaysInline(const Function& function); |
| 208 static bool PolymorphicTarget(const Function& function); | |
|
Cutch
2013/10/22 03:46:16
Returns true if the target is in the above POLYMOR
| |
| 197 static const char* KindToCString(Kind kind); | 209 static const char* KindToCString(Kind kind); |
| 198 static void InitializeState(); | 210 static void InitializeState(); |
| 199 }; | 211 }; |
| 200 | 212 |
| 201 | 213 |
| 202 // CompileType describes type of the value produced by the definition. | 214 // CompileType describes type of the value produced by the definition. |
| 203 // | 215 // |
| 204 // It captures the following properties: | 216 // It captures the following properties: |
| 205 // - whether value can potentially be null or it is definitely not null; | 217 // - whether value can potentially be null or it is definitely not null; |
| 206 // - concrete class id of the value or kDynamicCid if unknown statically; | 218 // - concrete class id of the value or kDynamicCid if unknown statically; |
| (...skipping 6649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6856 ForwardInstructionIterator* current_iterator_; | 6868 ForwardInstructionIterator* current_iterator_; |
| 6857 | 6869 |
| 6858 private: | 6870 private: |
| 6859 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 6871 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 6860 }; | 6872 }; |
| 6861 | 6873 |
| 6862 | 6874 |
| 6863 } // namespace dart | 6875 } // namespace dart |
| 6864 | 6876 |
| 6865 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 6877 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |