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 4348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4359 const AbstractType& type, | 4359 const AbstractType& type, |
4360 intptr_t token_pos) | 4360 intptr_t token_pos) |
4361 : offset_in_bytes_(offset_in_bytes), | 4361 : offset_in_bytes_(offset_in_bytes), |
4362 type_(type), | 4362 type_(type), |
4363 result_cid_(kDynamicCid), | 4363 result_cid_(kDynamicCid), |
4364 immutable_(false), | 4364 immutable_(false), |
4365 recognized_kind_(MethodRecognizer::kUnknown), | 4365 recognized_kind_(MethodRecognizer::kUnknown), |
4366 field_(NULL), | 4366 field_(NULL), |
4367 token_pos_(token_pos) { | 4367 token_pos_(token_pos) { |
4368 ASSERT(offset_in_bytes >= 0); | 4368 ASSERT(offset_in_bytes >= 0); |
4369 ASSERT(type.IsZoneHandle()); // May be null if field is not an instance. | 4369 // May be null if field is not an instance. |
| 4370 ASSERT(type.IsZoneHandle() || type.IsReadOnlyHandle()); |
4370 SetInputAt(0, instance); | 4371 SetInputAt(0, instance); |
4371 } | 4372 } |
4372 | 4373 |
4373 LoadFieldInstr(Value* instance, | 4374 LoadFieldInstr(Value* instance, |
4374 const Field* field, | 4375 const Field* field, |
4375 const AbstractType& type, | 4376 const AbstractType& type, |
4376 intptr_t token_pos) | 4377 intptr_t token_pos) |
4377 : offset_in_bytes_(field->Offset()), | 4378 : offset_in_bytes_(field->Offset()), |
4378 type_(type), | 4379 type_(type), |
4379 result_cid_(kDynamicCid), | 4380 result_cid_(kDynamicCid), |
4380 immutable_(false), | 4381 immutable_(false), |
4381 recognized_kind_(MethodRecognizer::kUnknown), | 4382 recognized_kind_(MethodRecognizer::kUnknown), |
4382 field_(field), | 4383 field_(field), |
4383 token_pos_(token_pos) { | 4384 token_pos_(token_pos) { |
4384 ASSERT(field->IsZoneHandle()); | 4385 ASSERT(field->IsZoneHandle()); |
4385 ASSERT(type.IsZoneHandle()); // May be null if field is not an instance. | 4386 // May be null if field is not an instance. |
| 4387 ASSERT(type.IsZoneHandle() || type.IsReadOnlyHandle()); |
4386 SetInputAt(0, instance); | 4388 SetInputAt(0, instance); |
4387 } | 4389 } |
4388 | 4390 |
4389 void set_is_immutable(bool value) { immutable_ = value; } | 4391 void set_is_immutable(bool value) { immutable_ = value; } |
4390 | 4392 |
4391 Value* instance() const { return inputs_[0]; } | 4393 Value* instance() const { return inputs_[0]; } |
4392 intptr_t offset_in_bytes() const { return offset_in_bytes_; } | 4394 intptr_t offset_in_bytes() const { return offset_in_bytes_; } |
4393 const AbstractType& type() const { return type_; } | 4395 const AbstractType& type() const { return type_; } |
4394 void set_result_cid(intptr_t value) { result_cid_ = value; } | 4396 void set_result_cid(intptr_t value) { result_cid_ = value; } |
4395 intptr_t result_cid() const { return result_cid_; } | 4397 intptr_t result_cid() const { return result_cid_; } |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4450 class InstantiateTypeInstr : public TemplateDefinition<1, Throws> { | 4452 class InstantiateTypeInstr : public TemplateDefinition<1, Throws> { |
4451 public: | 4453 public: |
4452 InstantiateTypeInstr(intptr_t token_pos, | 4454 InstantiateTypeInstr(intptr_t token_pos, |
4453 const AbstractType& type, | 4455 const AbstractType& type, |
4454 const Class& instantiator_class, | 4456 const Class& instantiator_class, |
4455 Value* instantiator) | 4457 Value* instantiator) |
4456 : TemplateDefinition(Thread::Current()->GetNextDeoptId()), | 4458 : TemplateDefinition(Thread::Current()->GetNextDeoptId()), |
4457 token_pos_(token_pos), | 4459 token_pos_(token_pos), |
4458 type_(type), | 4460 type_(type), |
4459 instantiator_class_(instantiator_class) { | 4461 instantiator_class_(instantiator_class) { |
4460 ASSERT(type.IsZoneHandle()); | 4462 ASSERT(type.IsZoneHandle() || type.IsReadOnlyHandle()); |
4461 SetInputAt(0, instantiator); | 4463 SetInputAt(0, instantiator); |
4462 } | 4464 } |
4463 | 4465 |
4464 DECLARE_INSTRUCTION(InstantiateType) | 4466 DECLARE_INSTRUCTION(InstantiateType) |
4465 | 4467 |
4466 Value* instantiator() const { return inputs_[0]; } | 4468 Value* instantiator() const { return inputs_[0]; } |
4467 const AbstractType& type() const { return type_; | 4469 const AbstractType& type() const { return type_; |
4468 } | 4470 } |
4469 const Class& instantiator_class() const { return instantiator_class_; } | 4471 const Class& instantiator_class() const { return instantiator_class_; } |
4470 virtual intptr_t token_pos() const { return token_pos_; } | 4472 virtual intptr_t token_pos() const { return token_pos_; } |
(...skipping 3640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8111 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \ | 8113 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \ |
8112 UNIMPLEMENTED(); \ | 8114 UNIMPLEMENTED(); \ |
8113 return NULL; \ | 8115 return NULL; \ |
8114 } \ | 8116 } \ |
8115 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } | 8117 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } |
8116 | 8118 |
8117 | 8119 |
8118 } // namespace dart | 8120 } // namespace dart |
8119 | 8121 |
8120 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 8122 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
OLD | NEW |