Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Side by Side Diff: runtime/vm/intermediate_language.h

Issue 18801007: Support type parameters and classes as expression in the vm. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 M(BooleanNegate) \ 547 M(BooleanNegate) \
548 M(InstanceOf) \ 548 M(InstanceOf) \
549 M(CreateArray) \ 549 M(CreateArray) \
550 M(CreateClosure) \ 550 M(CreateClosure) \
551 M(AllocateObject) \ 551 M(AllocateObject) \
552 M(AllocateObjectWithBoundsCheck) \ 552 M(AllocateObjectWithBoundsCheck) \
553 M(LoadField) \ 553 M(LoadField) \
554 M(StoreVMField) \ 554 M(StoreVMField) \
555 M(LoadUntagged) \ 555 M(LoadUntagged) \
556 M(LoadClassId) \ 556 M(LoadClassId) \
557 M(InstantiateType) \
557 M(InstantiateTypeArguments) \ 558 M(InstantiateTypeArguments) \
558 M(ExtractConstructorTypeArguments) \ 559 M(ExtractConstructorTypeArguments) \
559 M(ExtractConstructorInstantiator) \ 560 M(ExtractConstructorInstantiator) \
560 M(AllocateContext) \ 561 M(AllocateContext) \
561 M(ChainContext) \ 562 M(ChainContext) \
562 M(CloneContext) \ 563 M(CloneContext) \
563 M(CatchEntry) \ 564 M(CatchEntry) \
564 M(BinarySmiOp) \ 565 M(BinarySmiOp) \
565 M(UnarySmiOp) \ 566 M(UnarySmiOp) \
566 M(CheckStackOverflow) \ 567 M(CheckStackOverflow) \
(...skipping 3489 matching lines...) Expand 10 before | Expand all | Expand 10 after
4056 virtual bool MayThrow() const { return false; } 4057 virtual bool MayThrow() const { return false; }
4057 4058
4058 private: 4059 private:
4059 const intptr_t offset_in_bytes_; 4060 const intptr_t offset_in_bytes_;
4060 const AbstractType& type_; 4061 const AbstractType& type_;
4061 4062
4062 DISALLOW_COPY_AND_ASSIGN(StoreVMFieldInstr); 4063 DISALLOW_COPY_AND_ASSIGN(StoreVMFieldInstr);
4063 }; 4064 };
4064 4065
4065 4066
4067 class InstantiateTypeInstr : public TemplateDefinition<1> {
4068 public:
4069 InstantiateTypeInstr(intptr_t token_pos,
4070 const AbstractType& type,
4071 const Class& instantiator_class,
4072 Value* instantiator)
4073 : token_pos_(token_pos),
4074 type_(type),
4075 instantiator_class_(instantiator_class) {
4076 ASSERT(type.IsZoneHandle());
4077 SetInputAt(0, instantiator);
4078 }
4079
4080 DECLARE_INSTRUCTION(InstantiateType)
4081
4082 Value* instantiator() const { return inputs_[0]; }
4083 const AbstractType& type() const { return type_;
4084 }
4085 const Class& instantiator_class() const { return instantiator_class_; }
4086 intptr_t token_pos() const { return token_pos_; }
4087
4088 virtual void PrintOperandsTo(BufferFormatter* f) const;
4089
4090 virtual bool CanDeoptimize() const { return true; }
4091
4092 virtual EffectSet Effects() const { return EffectSet::None(); }
4093
4094 virtual bool MayThrow() const { return true; }
4095
4096 private:
4097 const intptr_t token_pos_;
4098 const AbstractType& type_;
4099 const Class& instantiator_class_;
4100
4101 DISALLOW_COPY_AND_ASSIGN(InstantiateTypeInstr);
4102 };
4103
4104
4066 class InstantiateTypeArgumentsInstr : public TemplateDefinition<1> { 4105 class InstantiateTypeArgumentsInstr : public TemplateDefinition<1> {
4067 public: 4106 public:
4068 InstantiateTypeArgumentsInstr(intptr_t token_pos, 4107 InstantiateTypeArgumentsInstr(intptr_t token_pos,
4069 const AbstractTypeArguments& type_arguments, 4108 const AbstractTypeArguments& type_arguments,
4070 const Class& instantiator_class, 4109 const Class& instantiator_class,
4071 Value* instantiator) 4110 Value* instantiator)
4072 : token_pos_(token_pos), 4111 : token_pos_(token_pos),
4073 type_arguments_(type_arguments), 4112 type_arguments_(type_arguments),
4074 instantiator_class_(instantiator_class) { 4113 instantiator_class_(instantiator_class) {
4075 ASSERT(type_arguments.IsZoneHandle()); 4114 ASSERT(type_arguments.IsZoneHandle());
(...skipping 2398 matching lines...) Expand 10 before | Expand all | Expand 10 after
6474 ForwardInstructionIterator* current_iterator_; 6513 ForwardInstructionIterator* current_iterator_;
6475 6514
6476 private: 6515 private:
6477 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 6516 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
6478 }; 6517 };
6479 6518
6480 6519
6481 } // namespace dart 6520 } // namespace dart
6482 6521
6483 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 6522 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698