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 | 4 |
5 #ifndef VM_FLOW_GRAPH_COMPILER_X64_H_ | 5 #ifndef VM_FLOW_GRAPH_COMPILER_X64_H_ |
6 #define VM_FLOW_GRAPH_COMPILER_X64_H_ | 6 #define VM_FLOW_GRAPH_COMPILER_X64_H_ |
7 | 7 |
8 #ifndef VM_FLOW_GRAPH_COMPILER_H_ | 8 #ifndef VM_FLOW_GRAPH_COMPILER_H_ |
9 #error Include flow_graph_compiler.h instead of flow_graph_compiler_x64.h. | 9 #error Include flow_graph_compiler.h instead of flow_graph_compiler_x64.h. |
10 #endif | 10 #endif |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 const Array& arguments_descriptor, | 71 const Array& arguments_descriptor, |
72 intptr_t argument_count); | 72 intptr_t argument_count); |
73 | 73 |
74 // Infrastructure copied from class CodeGenerator. | 74 // Infrastructure copied from class CodeGenerator. |
75 void GenerateCall(intptr_t token_index, | 75 void GenerateCall(intptr_t token_index, |
76 intptr_t try_index, | 76 intptr_t try_index, |
77 const ExternalLabel* label, | 77 const ExternalLabel* label, |
78 PcDescriptors::Kind kind); | 78 PcDescriptors::Kind kind); |
79 | 79 |
80 // Type checking helper methods. | 80 // Type checking helper methods. |
81 void CheckClassIds(const GrowableArray<intptr_t>& class_ids, | 81 virtual void CheckClassIds(Register class_id_reg, |
82 Label* is_instance_lbl, | 82 const GrowableArray<intptr_t>& class_ids, |
83 Label* is_not_instance_lbl); | 83 Label* is_instance_lbl, |
| 84 Label* is_not_instance_lbl); |
| 85 |
84 RawSubtypeTestCache* GenerateInlineInstanceof(intptr_t cid, | 86 RawSubtypeTestCache* GenerateInlineInstanceof(intptr_t cid, |
85 intptr_t token_index, | 87 intptr_t token_index, |
86 const AbstractType& type, | 88 const AbstractType& type, |
87 Label* is_instance, | 89 Label* is_instance_lbl, |
88 Label* is_not_instance); | 90 Label* is_not_instance_lbl); |
89 | 91 |
90 RawSubtypeTestCache* GenerateInstantiatedTypeWithArgumentsTest( | 92 RawSubtypeTestCache* GenerateInstantiatedTypeWithArgumentsTest( |
91 intptr_t cid, | 93 intptr_t cid, |
92 intptr_t token_index, | 94 intptr_t token_index, |
93 const AbstractType& dst_type, | 95 const AbstractType& dst_type, |
94 Label* is_instance_lbl, | 96 Label* is_instance_lbl, |
95 Label* is_not_instance_lbl); | 97 Label* is_not_instance_lbl); |
96 | 98 |
97 void GenerateInstantiatedTypeNoArgumentsTest(intptr_t cid, | 99 void GenerateInstantiatedTypeNoArgumentsTest(intptr_t cid, |
98 intptr_t token_index, | 100 intptr_t token_index, |
99 const AbstractType& dst_type, | 101 const AbstractType& dst_type, |
100 Label* is_instance_lbl, | 102 Label* is_instance_lbl, |
101 Label* is_not_instance_lbl); | 103 Label* is_not_instance_lbl); |
102 | 104 |
103 RawSubtypeTestCache* GenerateUninstantiatedTypeTest( | 105 RawSubtypeTestCache* GenerateUninstantiatedTypeTest( |
104 const AbstractType& dst_type, | |
105 intptr_t cid, | 106 intptr_t cid, |
106 intptr_t token_index, | 107 intptr_t token_index, |
| 108 const AbstractType& dst_type, |
107 Label* is_instance_lbl, | 109 Label* is_instance_lbl, |
108 Label* is_not_instance_label); | 110 Label* is_not_instance_label); |
109 | 111 |
110 RawSubtypeTestCache* GenerateSubtype1TestCacheLookup( | 112 RawSubtypeTestCache* GenerateSubtype1TestCacheLookup( |
111 intptr_t cid, | 113 intptr_t cid, |
112 intptr_t token_index, | 114 intptr_t token_index, |
113 const Class& type_class, | 115 const Class& type_class, |
114 Label* is_instance_lbl, | 116 Label* is_instance_lbl, |
115 Label* is_not_instance_lbl); | 117 Label* is_not_instance_lbl); |
116 | 118 |
117 void GenerateAssertAssignable(intptr_t cid, | 119 void GenerateAssertAssignable(intptr_t cid, |
118 intptr_t token_index, | 120 intptr_t token_index, |
119 intptr_t try_index, | 121 intptr_t try_index, |
120 const AbstractType& dst_type, | 122 const AbstractType& dst_type, |
121 const String& dst_name); | 123 const String& dst_name); |
122 | 124 |
123 void GenerateInstanceOf(intptr_t cid, | 125 void GenerateInstanceOf(intptr_t cid, |
124 intptr_t token_index, | 126 intptr_t token_index, |
125 intptr_t try_index, | 127 intptr_t try_index, |
126 const AbstractType& type, | 128 const AbstractType& type, |
127 bool negate_result); | 129 bool negate_result); |
128 | 130 |
| 131 enum TypeTestStubKind { |
| 132 kTestTypeOneArg, |
| 133 kTestTypeTwoArgs, |
| 134 kTestTypeThreeArgs, |
| 135 }; |
| 136 |
| 137 RawSubtypeTestCache* GenerateCallSubtypeTestStub(TypeTestStubKind test_kind, |
| 138 Register instance_reg, |
| 139 Register type_arguments_reg, |
| 140 Register temp_reg, |
| 141 Label* is_instance_lbl, |
| 142 Label* is_not_instance_lbl); |
| 143 |
| 144 void GenerateBoolToJump(Register bool_reg, Label* is_true, Label* is_false); |
| 145 |
129 void CopyParameters(); | 146 void CopyParameters(); |
130 | 147 |
131 virtual void GenerateInlinedGetter(intptr_t offset); | 148 virtual void GenerateInlinedGetter(intptr_t offset); |
132 virtual void GenerateInlinedSetter(intptr_t offset); | 149 virtual void GenerateInlinedSetter(intptr_t offset); |
133 | 150 |
134 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler); | 151 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler); |
135 }; | 152 }; |
136 | 153 |
137 } // namespace dart | 154 } // namespace dart |
138 | 155 |
139 #endif // VM_FLOW_GRAPH_COMPILER_X64_H_ | 156 #endif // VM_FLOW_GRAPH_COMPILER_X64_H_ |
OLD | NEW |