| 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 V(_ImmutableList, get:length, ImmutableArrayLength, 578762861) \ | 176 V(_ImmutableList, get:length, ImmutableArrayLength, 578762861) \ |
| 177 V(_TypedList, get:length, TypedDataLength, 26646119) \ | 177 V(_TypedList, get:length, TypedDataLength, 26646119) \ |
| 178 V(_GrowableList, get:length, GrowableArrayLength, 1654255033) \ | 178 V(_GrowableList, get:length, GrowableArrayLength, 1654255033) \ |
| 179 V(_StringBase, get:length, StringBaseLength, 1483549854) \ | 179 V(_StringBase, get:length, StringBaseLength, 1483549854) \ |
| 180 V(ListIterator, moveNext, ListIteratorMoveNext, 2062984847) \ | 180 V(ListIterator, moveNext, ListIteratorMoveNext, 2062984847) \ |
| 181 V(_GrowableList, get:iterator, GrowableArrayIterator, 1155241039) \ | 181 V(_GrowableList, get:iterator, GrowableArrayIterator, 1155241039) \ |
| 182 V(_GrowableList, forEach, GrowableArrayForEach, 195359970) \ | 182 V(_GrowableList, forEach, GrowableArrayForEach, 195359970) \ |
| 183 | 183 |
| 184 // A list of core functions that internally dispatch based on received id. | 184 // A list of core functions that internally dispatch based on received id. |
| 185 #define POLYMORPHIC_TARGET_LIST(V) \ | 185 #define POLYMORPHIC_TARGET_LIST(V) \ |
| 186 V(_StringBase, [], StringBaseCharAt, 585372763) \ |
| 187 V(_StringBase, codeUnitAt, StringBaseCodeUnitAt, 1958436584) \ |
| 186 V(_TypedList, _getInt8, ByteArrayBaseGetInt8, 272598802) \ | 188 V(_TypedList, _getInt8, ByteArrayBaseGetInt8, 272598802) \ |
| 187 V(_TypedList, _getUint8, ByteArrayBaseGetUint8, 831354841) \ | 189 V(_TypedList, _getUint8, ByteArrayBaseGetUint8, 831354841) \ |
| 188 V(_TypedList, _getInt16, ByteArrayBaseGetInt16, 1832126257) \ | 190 V(_TypedList, _getInt16, ByteArrayBaseGetInt16, 1832126257) \ |
| 189 V(_TypedList, _getUint16, ByteArrayBaseGetUint16, 1762714698) \ | 191 V(_TypedList, _getUint16, ByteArrayBaseGetUint16, 1762714698) \ |
| 190 V(_TypedList, _getInt32, ByteArrayBaseGetInt32, 48785449) \ | 192 V(_TypedList, _getInt32, ByteArrayBaseGetInt32, 48785449) \ |
| 191 V(_TypedList, _getUint32, ByteArrayBaseGetUint32, 1392579206) \ | 193 V(_TypedList, _getUint32, ByteArrayBaseGetUint32, 1392579206) \ |
| 192 V(_TypedList, _getFloat32, ByteArrayBaseGetFloat32, 185163470) \ | 194 V(_TypedList, _getFloat32, ByteArrayBaseGetFloat32, 185163470) \ |
| 193 V(_TypedList, _getFloat64, ByteArrayBaseGetFloat64, 1356392173) \ | 195 V(_TypedList, _getFloat64, ByteArrayBaseGetFloat64, 1356392173) \ |
| 194 V(_TypedList, _getFloat32x4, ByteArrayBaseGetFloat32x4, 1239681356) \ | 196 V(_TypedList, _getFloat32x4, ByteArrayBaseGetFloat32x4, 1239681356) \ |
| 195 V(_TypedList, _getInt32x4, ByteArrayBaseGetInt32x4, 163795162) \ | 197 V(_TypedList, _getInt32x4, ByteArrayBaseGetInt32x4, 163795162) \ |
| (...skipping 3495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3691 const intptr_t class_id_; | 3693 const intptr_t class_id_; |
| 3692 | 3694 |
| 3693 DISALLOW_COPY_AND_ASSIGN(LoadIndexedInstr); | 3695 DISALLOW_COPY_AND_ASSIGN(LoadIndexedInstr); |
| 3694 }; | 3696 }; |
| 3695 | 3697 |
| 3696 | 3698 |
| 3697 class StringFromCharCodeInstr : public TemplateDefinition<1> { | 3699 class StringFromCharCodeInstr : public TemplateDefinition<1> { |
| 3698 public: | 3700 public: |
| 3699 StringFromCharCodeInstr(Value* char_code, intptr_t cid) : cid_(cid) { | 3701 StringFromCharCodeInstr(Value* char_code, intptr_t cid) : cid_(cid) { |
| 3700 ASSERT(char_code != NULL); | 3702 ASSERT(char_code != NULL); |
| 3701 ASSERT(char_code->definition()->IsLoadIndexed() && | 3703 ASSERT(char_code->definition()->IsLoadIndexed()); |
| 3702 (char_code->definition()->AsLoadIndexed()->class_id() == | |
| 3703 kOneByteStringCid)); | |
| 3704 SetInputAt(0, char_code); | 3704 SetInputAt(0, char_code); |
| 3705 } | 3705 } |
| 3706 | 3706 |
| 3707 DECLARE_INSTRUCTION(StringFromCharCode) | 3707 DECLARE_INSTRUCTION(StringFromCharCode) |
| 3708 virtual CompileType ComputeType() const; | 3708 virtual CompileType ComputeType() const; |
| 3709 | 3709 |
| 3710 Value* char_code() const { return inputs_[0]; } | 3710 Value* char_code() const { return inputs_[0]; } |
| 3711 | 3711 |
| 3712 virtual bool CanDeoptimize() const { return false; } | 3712 virtual bool CanDeoptimize() const { return false; } |
| 3713 | 3713 |
| (...skipping 3382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7096 ForwardInstructionIterator* current_iterator_; | 7096 ForwardInstructionIterator* current_iterator_; |
| 7097 | 7097 |
| 7098 private: | 7098 private: |
| 7099 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 7099 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 7100 }; | 7100 }; |
| 7101 | 7101 |
| 7102 | 7102 |
| 7103 } // namespace dart | 7103 } // namespace dart |
| 7104 | 7104 |
| 7105 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 7105 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |