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

Side by Side Diff: vm/intermediate_language.h

Issue 10824078: Add explicit PushArgument IL instructions to static calls. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
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
« no previous file with comments | « vm/il_printer.cc ('k') | vm/intermediate_language.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) 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 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 DISALLOW_COPY_AND_ASSIGN(RelationalOpComp); 688 DISALLOW_COPY_AND_ASSIGN(RelationalOpComp);
689 }; 689 };
690 690
691 691
692 class StaticCallComp : public Computation { 692 class StaticCallComp : public Computation {
693 public: 693 public:
694 StaticCallComp(intptr_t token_pos, 694 StaticCallComp(intptr_t token_pos,
695 intptr_t try_index, 695 intptr_t try_index,
696 const Function& function, 696 const Function& function,
697 const Array& argument_names, 697 const Array& argument_names,
698 ZoneGrowableArray<Value*>* arguments) 698 ZoneGrowableArray<PushArgumentInstr*>* arguments)
699 : token_pos_(token_pos), 699 : token_pos_(token_pos),
700 try_index_(try_index), 700 try_index_(try_index),
701 function_(function), 701 function_(function),
702 argument_names_(argument_names), 702 argument_names_(argument_names),
703 arguments_(arguments), 703 arguments_(arguments),
704 recognized_(MethodRecognizer::kUnknown) { 704 recognized_(MethodRecognizer::kUnknown) {
705 ASSERT(function.IsZoneHandle()); 705 ASSERT(function.IsZoneHandle());
706 ASSERT(argument_names.IsZoneHandle()); 706 ASSERT(argument_names.IsZoneHandle());
707 } 707 }
708 708
709 DECLARE_COMPUTATION(StaticCall) 709 DECLARE_COMPUTATION(StaticCall)
710 710
711 // Accessors forwarded to the AST node. 711 // Accessors forwarded to the AST node.
712 const Function& function() const { return function_; } 712 const Function& function() const { return function_; }
713 const Array& argument_names() const { return argument_names_; } 713 const Array& argument_names() const { return argument_names_; }
714 intptr_t token_pos() const { return token_pos_; } 714 intptr_t token_pos() const { return token_pos_; }
715 intptr_t try_index() const { return try_index_; } 715 intptr_t try_index() const { return try_index_; }
716 716
717 intptr_t ArgumentCount() const { return arguments_->length(); } 717 intptr_t ArgumentCount() const { return arguments_->length(); }
718 Value* ArgumentAt(intptr_t index) const { return (*arguments_)[index]; } 718 PushArgumentInstr* ArgumentAt(intptr_t index) const {
719 return (*arguments_)[index];
720 }
719 721
720 MethodRecognizer::Kind recognized() const { return recognized_; } 722 MethodRecognizer::Kind recognized() const { return recognized_; }
721 void set_recognized(MethodRecognizer::Kind kind) { recognized_ = kind; } 723 void set_recognized(MethodRecognizer::Kind kind) { recognized_ = kind; }
722 724
723 virtual intptr_t InputCount() const; 725 virtual intptr_t InputCount() const { return 0; }
724 virtual Value* InputAt(intptr_t i) const { return ArgumentAt(i); } 726 virtual Value* InputAt(intptr_t i) const {
725 virtual void SetInputAt(intptr_t i, Value* value) { 727 UNREACHABLE();
726 (*arguments_)[i] = value; 728 return NULL;
727 } 729 }
730 virtual void SetInputAt(intptr_t i, Value* value) { UNREACHABLE(); }
728 731
729 virtual void PrintOperandsTo(BufferFormatter* f) const; 732 virtual void PrintOperandsTo(BufferFormatter* f) const;
730 733
731 private: 734 private:
732 const intptr_t token_pos_; 735 const intptr_t token_pos_;
733 const intptr_t try_index_; 736 const intptr_t try_index_;
734 const Function& function_; 737 const Function& function_;
735 const Array& argument_names_; 738 const Array& argument_names_;
736 ZoneGrowableArray<Value*>* arguments_; 739 ZoneGrowableArray<PushArgumentInstr*>* arguments_;
737 MethodRecognizer::Kind recognized_; 740 MethodRecognizer::Kind recognized_;
738 741
739 DISALLOW_COPY_AND_ASSIGN(StaticCallComp); 742 DISALLOW_COPY_AND_ASSIGN(StaticCallComp);
740 }; 743 };
741 744
742 745
743 class LoadLocalComp : public TemplateComputation<0> { 746 class LoadLocalComp : public TemplateComputation<0> {
744 public: 747 public:
745 LoadLocalComp(const LocalVariable& local, intptr_t context_level) 748 LoadLocalComp(const LocalVariable& local, intptr_t context_level)
746 : local_(local), 749 : local_(local),
(...skipping 1864 matching lines...) Expand 10 before | Expand all | Expand 10 after
2611 const GrowableArray<BlockEntryInstr*>& block_order_; 2614 const GrowableArray<BlockEntryInstr*>& block_order_;
2612 2615
2613 private: 2616 private:
2614 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 2617 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
2615 }; 2618 };
2616 2619
2617 2620
2618 } // namespace dart 2621 } // namespace dart
2619 2622
2620 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 2623 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« no previous file with comments | « vm/il_printer.cc ('k') | vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698