| 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 RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_ | 5 #ifndef RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_ |
| 6 #define RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_ | 6 #define RUNTIME_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 2516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2527 | 2527 |
| 2528 DISALLOW_COPY_AND_ASSIGN(UnboxedConstantInstr); | 2528 DISALLOW_COPY_AND_ASSIGN(UnboxedConstantInstr); |
| 2529 }; | 2529 }; |
| 2530 | 2530 |
| 2531 | 2531 |
| 2532 class AssertAssignableInstr : public TemplateDefinition<2, Throws, Pure> { | 2532 class AssertAssignableInstr : public TemplateDefinition<2, Throws, Pure> { |
| 2533 public: | 2533 public: |
| 2534 AssertAssignableInstr(TokenPosition token_pos, | 2534 AssertAssignableInstr(TokenPosition token_pos, |
| 2535 Value* value, | 2535 Value* value, |
| 2536 Value* instantiator_type_arguments, | 2536 Value* instantiator_type_arguments, |
| 2537 Value* function_type_arguments, |
| 2537 const AbstractType& dst_type, | 2538 const AbstractType& dst_type, |
| 2538 const String& dst_name, | 2539 const String& dst_name, |
| 2539 intptr_t deopt_id) | 2540 intptr_t deopt_id) |
| 2540 : TemplateDefinition(deopt_id), | 2541 : TemplateDefinition(deopt_id), |
| 2541 token_pos_(token_pos), | 2542 token_pos_(token_pos), |
| 2542 dst_type_(AbstractType::ZoneHandle(dst_type.raw())), | 2543 dst_type_(AbstractType::ZoneHandle(dst_type.raw())), |
| 2543 dst_name_(dst_name) { | 2544 dst_name_(dst_name) { |
| 2544 ASSERT(!dst_type.IsNull()); | 2545 ASSERT(!dst_type.IsNull()); |
| 2545 ASSERT(!dst_type.IsTypeRef()); | 2546 ASSERT(!dst_type.IsTypeRef()); |
| 2546 ASSERT(!dst_name.IsNull()); | 2547 ASSERT(!dst_name.IsNull()); |
| 2547 SetInputAt(0, value); | 2548 SetInputAt(0, value); |
| 2548 SetInputAt(1, instantiator_type_arguments); | 2549 SetInputAt(1, instantiator_type_arguments); |
| 2550 ASSERT(function_type_arguments == NULL); // TODO(regis): Implement. |
| 2549 } | 2551 } |
| 2550 | 2552 |
| 2551 DECLARE_INSTRUCTION(AssertAssignable) | 2553 DECLARE_INSTRUCTION(AssertAssignable) |
| 2552 virtual CompileType ComputeType() const; | 2554 virtual CompileType ComputeType() const; |
| 2553 virtual bool RecomputeType(); | 2555 virtual bool RecomputeType(); |
| 2554 | 2556 |
| 2555 Value* value() const { return inputs_[0]; } | 2557 Value* value() const { return inputs_[0]; } |
| 2556 Value* instantiator_type_arguments() const { return inputs_[1]; } | 2558 Value* instantiator_type_arguments() const { return inputs_[1]; } |
| 2557 | 2559 |
| 2558 virtual TokenPosition token_pos() const { return token_pos_; } | 2560 virtual TokenPosition token_pos() const { return token_pos_; } |
| (...skipping 1395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3954 private: | 3956 private: |
| 3955 DISALLOW_COPY_AND_ASSIGN(BooleanNegateInstr); | 3957 DISALLOW_COPY_AND_ASSIGN(BooleanNegateInstr); |
| 3956 }; | 3958 }; |
| 3957 | 3959 |
| 3958 | 3960 |
| 3959 class InstanceOfInstr : public TemplateDefinition<2, Throws> { | 3961 class InstanceOfInstr : public TemplateDefinition<2, Throws> { |
| 3960 public: | 3962 public: |
| 3961 InstanceOfInstr(TokenPosition token_pos, | 3963 InstanceOfInstr(TokenPosition token_pos, |
| 3962 Value* value, | 3964 Value* value, |
| 3963 Value* instantiator_type_arguments, | 3965 Value* instantiator_type_arguments, |
| 3966 Value* function_type_arguments, |
| 3964 const AbstractType& type, | 3967 const AbstractType& type, |
| 3965 intptr_t deopt_id) | 3968 intptr_t deopt_id) |
| 3966 : TemplateDefinition(deopt_id), token_pos_(token_pos), type_(type) { | 3969 : TemplateDefinition(deopt_id), token_pos_(token_pos), type_(type) { |
| 3967 ASSERT(!type.IsNull()); | 3970 ASSERT(!type.IsNull()); |
| 3968 SetInputAt(0, value); | 3971 SetInputAt(0, value); |
| 3969 SetInputAt(1, instantiator_type_arguments); | 3972 SetInputAt(1, instantiator_type_arguments); |
| 3973 ASSERT(function_type_arguments == NULL); // TODO(regis): Implement. |
| 3970 } | 3974 } |
| 3971 | 3975 |
| 3972 DECLARE_INSTRUCTION(InstanceOf) | 3976 DECLARE_INSTRUCTION(InstanceOf) |
| 3973 virtual CompileType ComputeType() const; | 3977 virtual CompileType ComputeType() const; |
| 3974 | 3978 |
| 3975 Value* value() const { return inputs_[0]; } | 3979 Value* value() const { return inputs_[0]; } |
| 3976 Value* instantiator_type_arguments() const { return inputs_[1]; } | 3980 Value* instantiator_type_arguments() const { return inputs_[1]; } |
| 3977 | 3981 |
| 3978 const AbstractType& type() const { return type_; } | 3982 const AbstractType& type() const { return type_; } |
| 3979 virtual TokenPosition token_pos() const { return token_pos_; } | 3983 virtual TokenPosition token_pos() const { return token_pos_; } |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4378 const TokenPosition token_pos_; | 4382 const TokenPosition token_pos_; |
| 4379 | 4383 |
| 4380 DISALLOW_COPY_AND_ASSIGN(LoadFieldInstr); | 4384 DISALLOW_COPY_AND_ASSIGN(LoadFieldInstr); |
| 4381 }; | 4385 }; |
| 4382 | 4386 |
| 4383 | 4387 |
| 4384 class InstantiateTypeInstr : public TemplateDefinition<1, Throws> { | 4388 class InstantiateTypeInstr : public TemplateDefinition<1, Throws> { |
| 4385 public: | 4389 public: |
| 4386 InstantiateTypeInstr(TokenPosition token_pos, | 4390 InstantiateTypeInstr(TokenPosition token_pos, |
| 4387 const AbstractType& type, | 4391 const AbstractType& type, |
| 4388 const Class& instantiator_class, | 4392 Value* instantiator_type_arguments, |
| 4389 Value* instantiator) | 4393 Value* function_type_arguments) |
| 4390 : TemplateDefinition(Thread::Current()->GetNextDeoptId()), | 4394 : TemplateDefinition(Thread::Current()->GetNextDeoptId()), |
| 4391 token_pos_(token_pos), | 4395 token_pos_(token_pos), |
| 4392 type_(type), | 4396 type_(type) { |
| 4393 instantiator_class_(instantiator_class) { | |
| 4394 ASSERT(type.IsZoneHandle() || type.IsReadOnlyHandle()); | 4397 ASSERT(type.IsZoneHandle() || type.IsReadOnlyHandle()); |
| 4395 SetInputAt(0, instantiator); | 4398 ASSERT(function_type_arguments == NULL); // TODO(regis): Implement. |
| 4399 SetInputAt(0, instantiator_type_arguments); |
| 4396 } | 4400 } |
| 4397 | 4401 |
| 4398 DECLARE_INSTRUCTION(InstantiateType) | 4402 DECLARE_INSTRUCTION(InstantiateType) |
| 4399 | 4403 |
| 4400 Value* instantiator() const { return inputs_[0]; } | 4404 Value* instantiator_type_arguments() const { return inputs_[0]; } |
| 4401 const AbstractType& type() const { return type_; } | 4405 const AbstractType& type() const { return type_; } |
| 4402 const Class& instantiator_class() const { return instantiator_class_; } | |
| 4403 virtual TokenPosition token_pos() const { return token_pos_; } | 4406 virtual TokenPosition token_pos() const { return token_pos_; } |
| 4404 | 4407 |
| 4405 virtual bool CanDeoptimize() const { return true; } | 4408 virtual bool CanDeoptimize() const { return true; } |
| 4406 | 4409 |
| 4407 virtual EffectSet Effects() const { return EffectSet::None(); } | 4410 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 4408 | 4411 |
| 4409 PRINT_OPERANDS_TO_SUPPORT | 4412 PRINT_OPERANDS_TO_SUPPORT |
| 4410 | 4413 |
| 4411 private: | 4414 private: |
| 4412 const TokenPosition token_pos_; | 4415 const TokenPosition token_pos_; |
| 4413 const AbstractType& type_; | 4416 const AbstractType& type_; |
| 4414 const Class& instantiator_class_; | |
| 4415 | 4417 |
| 4416 DISALLOW_COPY_AND_ASSIGN(InstantiateTypeInstr); | 4418 DISALLOW_COPY_AND_ASSIGN(InstantiateTypeInstr); |
| 4417 }; | 4419 }; |
| 4418 | 4420 |
| 4419 | 4421 |
| 4420 class InstantiateTypeArgumentsInstr : public TemplateDefinition<1, Throws> { | 4422 class InstantiateTypeArgumentsInstr : public TemplateDefinition<1, Throws> { |
| 4421 public: | 4423 public: |
| 4422 InstantiateTypeArgumentsInstr(TokenPosition token_pos, | 4424 InstantiateTypeArgumentsInstr(TokenPosition token_pos, |
| 4423 const TypeArguments& type_arguments, | 4425 const TypeArguments& type_arguments, |
| 4424 const Class& instantiator_class, | 4426 const Class& instantiator_class, |
| 4425 Value* instantiator) | 4427 Value* instantiator_type_arguments, |
| 4428 Value* function_type_arguments) |
| 4426 : TemplateDefinition(Thread::Current()->GetNextDeoptId()), | 4429 : TemplateDefinition(Thread::Current()->GetNextDeoptId()), |
| 4427 token_pos_(token_pos), | 4430 token_pos_(token_pos), |
| 4428 type_arguments_(type_arguments), | 4431 type_arguments_(type_arguments), |
| 4429 instantiator_class_(instantiator_class) { | 4432 instantiator_class_(instantiator_class) { |
| 4430 ASSERT(type_arguments.IsZoneHandle()); | 4433 ASSERT(type_arguments.IsZoneHandle()); |
| 4431 SetInputAt(0, instantiator); | 4434 ASSERT(function_type_arguments == NULL); // TODO(regis): Implement. |
| 4435 SetInputAt(0, instantiator_type_arguments); |
| 4432 } | 4436 } |
| 4433 | 4437 |
| 4434 DECLARE_INSTRUCTION(InstantiateTypeArguments) | 4438 DECLARE_INSTRUCTION(InstantiateTypeArguments) |
| 4435 | 4439 |
| 4436 Value* instantiator() const { return inputs_[0]; } | 4440 Value* instantiator_type_arguments() const { return inputs_[0]; } |
| 4437 const TypeArguments& type_arguments() const { return type_arguments_; } | 4441 const TypeArguments& type_arguments() const { return type_arguments_; } |
| 4438 const Class& instantiator_class() const { return instantiator_class_; } | 4442 const Class& instantiator_class() const { return instantiator_class_; } |
| 4439 virtual TokenPosition token_pos() const { return token_pos_; } | 4443 virtual TokenPosition token_pos() const { return token_pos_; } |
| 4440 | 4444 |
| 4441 virtual bool CanDeoptimize() const { return true; } | 4445 virtual bool CanDeoptimize() const { return true; } |
| 4442 | 4446 |
| 4443 virtual EffectSet Effects() const { return EffectSet::None(); } | 4447 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 4444 | 4448 |
| 4445 virtual Definition* Canonicalize(FlowGraph* flow_graph); | 4449 virtual Definition* Canonicalize(FlowGraph* flow_graph); |
| 4446 | 4450 |
| (...skipping 3596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8043 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \ | 8047 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \ |
| 8044 UNIMPLEMENTED(); \ | 8048 UNIMPLEMENTED(); \ |
| 8045 return NULL; \ | 8049 return NULL; \ |
| 8046 } \ | 8050 } \ |
| 8047 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } | 8051 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } |
| 8048 | 8052 |
| 8049 | 8053 |
| 8050 } // namespace dart | 8054 } // namespace dart |
| 8051 | 8055 |
| 8052 #endif // RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_ | 8056 #endif // RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |