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

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

Issue 10876052: If a PolymorphicInstanceCall has a single target, .. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 701 matching lines...) Expand 10 before | Expand all | Expand 10 after
712 ZoneGrowableArray<PushArgumentInstr*>* const arguments_; 712 ZoneGrowableArray<PushArgumentInstr*>* const arguments_;
713 const Array& argument_names_; 713 const Array& argument_names_;
714 const intptr_t checked_argument_count_; 714 const intptr_t checked_argument_count_;
715 715
716 DISALLOW_COPY_AND_ASSIGN(InstanceCallComp); 716 DISALLOW_COPY_AND_ASSIGN(InstanceCallComp);
717 }; 717 };
718 718
719 719
720 class PolymorphicInstanceCallComp : public TemplateComputation<0> { 720 class PolymorphicInstanceCallComp : public TemplateComputation<0> {
721 public: 721 public:
722 explicit PolymorphicInstanceCallComp(InstanceCallComp* comp) 722 explicit PolymorphicInstanceCallComp(InstanceCallComp* comp, bool with_checks)
723 : instance_call_(comp) { 723 : instance_call_(comp), with_checks_(with_checks) {
724 ASSERT(instance_call_ != NULL); 724 ASSERT(instance_call_ != NULL);
725 } 725 }
726 726
727 InstanceCallComp* instance_call() const { return instance_call_; } 727 InstanceCallComp* instance_call() const { return instance_call_; }
728 bool with_checks() const { return with_checks_; }
728 729
729 void PrintTo(BufferFormatter* f) const; 730 void PrintTo(BufferFormatter* f) const;
730 731
731 virtual intptr_t ArgumentCount() const { 732 virtual intptr_t ArgumentCount() const {
732 return instance_call()->ArgumentCount(); 733 return instance_call()->ArgumentCount();
733 } 734 }
734 735
735 DECLARE_CALL_COMPUTATION(PolymorphicInstanceCall) 736 DECLARE_CALL_COMPUTATION(PolymorphicInstanceCall)
736 737
737 virtual bool CanDeoptimize() const { return true; } 738 virtual bool CanDeoptimize() const { return true; }
738 739
739 private: 740 private:
740 InstanceCallComp* instance_call_; 741 InstanceCallComp* instance_call_;
742 const bool with_checks_;
741 743
742 DISALLOW_COPY_AND_ASSIGN(PolymorphicInstanceCallComp); 744 DISALLOW_COPY_AND_ASSIGN(PolymorphicInstanceCallComp);
743 }; 745 };
744 746
745 747
746 class ComparisonComp : public TemplateComputation<2> { 748 class ComparisonComp : public TemplateComputation<2> {
747 public: 749 public:
748 ComparisonComp(Token::Kind kind, Value* left, Value* right) : kind_(kind) { 750 ComparisonComp(Token::Kind kind, Value* left, Value* right) : kind_(kind) {
749 ASSERT(left != NULL); 751 ASSERT(left != NULL);
750 ASSERT(right != NULL); 752 ASSERT(right != NULL);
(...skipping 2382 matching lines...) Expand 10 before | Expand all | Expand 10 after
3133 ForwardInstructionIterator* current_iterator_; 3135 ForwardInstructionIterator* current_iterator_;
3134 3136
3135 private: 3137 private:
3136 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 3138 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
3137 }; 3139 };
3138 3140
3139 3141
3140 } // namespace dart 3142 } // namespace dart
3141 3143
3142 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 3144 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698