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 8170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8181 Definition* result) const; | 8181 Definition* result) const; |
8182 | 8182 |
8183 void PrintTo(BufferFormatter* f) const; | 8183 void PrintTo(BufferFormatter* f) const; |
8184 const char* ToCString() const; | 8184 const char* ToCString() const; |
8185 | 8185 |
8186 // Deep copy an environment. The 'length' parameter may be less than the | 8186 // Deep copy an environment. The 'length' parameter may be less than the |
8187 // environment's length in order to drop values (e.g., passed arguments) | 8187 // environment's length in order to drop values (e.g., passed arguments) |
8188 // from the copy. | 8188 // from the copy. |
8189 Environment* DeepCopy(Zone* zone, intptr_t length) const; | 8189 Environment* DeepCopy(Zone* zone, intptr_t length) const; |
8190 | 8190 |
8191 #if defined(TARGET_ARCH_DBC) | |
8192 // Return/ReturnTOS instruction drops incoming arguments so | |
8193 // we have to drop outgoing arguments from the innermost environment. | |
8194 // On all other architectures caller drops outgoing arguments itself | |
8195 // hence the difference. | |
8196 // Note: this method can only be used at the code generation stage because | |
8197 // it mutates environment in unsafe way (e.g. does not update def-use | |
8198 // chains). | |
8199 void DropArguments(intptr_t argc) { | |
Florian Schneider
2016/05/19 13:21:40
Maybe put only a declaration here, and put the def
Vyacheslav Egorov (Google)
2016/05/19 15:19:40
Done.
| |
8200 #if defined(DEBUG) | |
8201 // Check that we are in the backend - register allocation has been run. | |
8202 ASSERT(locations_ != NULL); | |
8203 | |
8204 // Check that we are only dropping PushArgument instructions from the | |
8205 // environment. | |
8206 ASSERT(argc <= values_.length()); | |
8207 for (intptr_t i = 0; i < argc; i++) { | |
8208 ASSERT(values_[values_.length() - i - 1]->definition()->IsPushArgument()); | |
8209 } | |
8210 #endif | |
8211 values_.TruncateTo(values_.length() - argc); | |
8212 } | |
8213 #endif | |
8214 | |
8191 private: | 8215 private: |
8192 friend class ShallowIterator; | 8216 friend class ShallowIterator; |
8193 | 8217 |
8194 Environment(intptr_t length, | 8218 Environment(intptr_t length, |
8195 intptr_t fixed_parameter_count, | 8219 intptr_t fixed_parameter_count, |
8196 intptr_t deopt_id, | 8220 intptr_t deopt_id, |
8197 const ParsedFunction& parsed_function, | 8221 const ParsedFunction& parsed_function, |
8198 Environment* outer) | 8222 Environment* outer) |
8199 : values_(length), | 8223 : values_(length), |
8200 locations_(NULL), | 8224 locations_(NULL), |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8255 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \ | 8279 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \ |
8256 UNIMPLEMENTED(); \ | 8280 UNIMPLEMENTED(); \ |
8257 return NULL; \ | 8281 return NULL; \ |
8258 } \ | 8282 } \ |
8259 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } | 8283 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } |
8260 | 8284 |
8261 | 8285 |
8262 } // namespace dart | 8286 } // namespace dart |
8263 | 8287 |
8264 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 8288 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
OLD | NEW |