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

Unified Diff: runtime/vm/intermediate_language.h

Issue 163683006: Simplify generated code for object allocation with type arguments. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: addressed comments Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.h
===================================================================
--- runtime/vm/intermediate_language.h (revision 32653)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -638,8 +638,6 @@
M(LoadClassId) \
M(InstantiateType) \
M(InstantiateTypeArguments) \
- M(ExtractConstructorTypeArguments) \
- M(ExtractConstructorInstantiator) \
M(AllocateContext) \
M(CloneContext) \
M(BinarySmiOp) \
@@ -3939,7 +3937,7 @@
closure_function_(Function::ZoneHandle()),
context_field_(Field::ZoneHandle()) {
// Either no arguments or one type-argument and one instantiator.
- ASSERT(arguments->is_empty() || (arguments->length() == 2));
+ ASSERT(arguments->is_empty() || (arguments->length() == 1));
}
DECLARE_INSTRUCTION(AllocateObject)
@@ -4388,6 +4386,8 @@
virtual bool MayThrow() const { return true; }
+ virtual Definition* Canonicalize(FlowGraph* flow_graph);
+
private:
const intptr_t token_pos_;
const TypeArguments& type_arguments_;
@@ -4397,78 +4397,6 @@
};
-class ExtractConstructorTypeArgumentsInstr : public TemplateDefinition<1> {
- public:
- ExtractConstructorTypeArgumentsInstr(
- intptr_t token_pos,
- const TypeArguments& type_arguments,
- const Class& instantiator_class,
- Value* instantiator)
- : token_pos_(token_pos),
- type_arguments_(type_arguments),
- instantiator_class_(instantiator_class) {
- SetInputAt(0, instantiator);
- }
-
- DECLARE_INSTRUCTION(ExtractConstructorTypeArguments)
-
- Value* instantiator() const { return inputs_[0]; }
- const TypeArguments& type_arguments() const {
- return type_arguments_;
- }
- const Class& instantiator_class() const { return instantiator_class_; }
- intptr_t token_pos() const { return token_pos_; }
-
- virtual void PrintOperandsTo(BufferFormatter* f) const;
-
- virtual bool CanDeoptimize() const { return false; }
-
- virtual EffectSet Effects() const { return EffectSet::None(); }
-
- virtual bool MayThrow() const { return false; }
-
- private:
- const intptr_t token_pos_;
- const TypeArguments& type_arguments_;
- const Class& instantiator_class_;
-
- DISALLOW_COPY_AND_ASSIGN(ExtractConstructorTypeArgumentsInstr);
-};
-
-
-class ExtractConstructorInstantiatorInstr : public TemplateDefinition<1> {
- public:
- ExtractConstructorInstantiatorInstr(ConstructorCallNode* ast_node,
- const Class& instantiator_class,
- Value* instantiator)
- : ast_node_(*ast_node), instantiator_class_(instantiator_class) {
- SetInputAt(0, instantiator);
- }
-
- DECLARE_INSTRUCTION(ExtractConstructorInstantiator)
-
- Value* instantiator() const { return inputs_[0]; }
- const TypeArguments& type_arguments() const {
- return ast_node_.type_arguments();
- }
- const Function& constructor() const { return ast_node_.constructor(); }
- const Class& instantiator_class() const { return instantiator_class_; }
- intptr_t token_pos() const { return ast_node_.token_pos(); }
-
- virtual bool CanDeoptimize() const { return false; }
-
- virtual EffectSet Effects() const { return EffectSet::None(); }
-
- virtual bool MayThrow() const { return false; }
-
- private:
- const ConstructorCallNode& ast_node_;
- const Class& instantiator_class_;
-
- DISALLOW_COPY_AND_ASSIGN(ExtractConstructorInstantiatorInstr);
-};
-
-
class AllocateContextInstr : public TemplateDefinition<0> {
public:
AllocateContextInstr(intptr_t token_pos,
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698