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

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

Issue 105143011: Optimize one byte string comparisons. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years 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/flow_graph_type_propagator.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 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 M(UnboxFloat32x4) \ 662 M(UnboxFloat32x4) \
663 M(BoxInt32x4) \ 663 M(BoxInt32x4) \
664 M(UnboxInt32x4) \ 664 M(UnboxInt32x4) \
665 M(UnboxInteger) \ 665 M(UnboxInteger) \
666 M(BoxInteger) \ 666 M(BoxInteger) \
667 M(BinaryMintOp) \ 667 M(BinaryMintOp) \
668 M(ShiftMintOp) \ 668 M(ShiftMintOp) \
669 M(UnaryMintOp) \ 669 M(UnaryMintOp) \
670 M(CheckArrayBound) \ 670 M(CheckArrayBound) \
671 M(Constraint) \ 671 M(Constraint) \
672 M(StringToCharCode) \
672 M(StringFromCharCode) \ 673 M(StringFromCharCode) \
673 M(StringInterpolate) \ 674 M(StringInterpolate) \
674 M(InvokeMathCFunction) \ 675 M(InvokeMathCFunction) \
675 M(MergedMath) \ 676 M(MergedMath) \
676 M(GuardField) \ 677 M(GuardField) \
677 M(IfThenElse) \ 678 M(IfThenElse) \
678 M(BinaryFloat32x4Op) \ 679 M(BinaryFloat32x4Op) \
679 M(Simd32x4Shuffle) \ 680 M(Simd32x4Shuffle) \
680 M(Simd32x4ShuffleMix) \ 681 M(Simd32x4ShuffleMix) \
681 M(Simd32x4GetSignMask) \ 682 M(Simd32x4GetSignMask) \
(...skipping 3008 matching lines...) Expand 10 before | Expand all | Expand 10 after
3690 3691
3691 virtual bool MayThrow() const { return false; } 3692 virtual bool MayThrow() const { return false; }
3692 3693
3693 private: 3694 private:
3694 const intptr_t cid_; 3695 const intptr_t cid_;
3695 3696
3696 DISALLOW_COPY_AND_ASSIGN(StringFromCharCodeInstr); 3697 DISALLOW_COPY_AND_ASSIGN(StringFromCharCodeInstr);
3697 }; 3698 };
3698 3699
3699 3700
3701 class StringToCharCodeInstr : public TemplateDefinition<1> {
3702 public:
3703 StringToCharCodeInstr(Value* str, intptr_t cid) : cid_(cid) {
3704 ASSERT(str != NULL);
3705 SetInputAt(0, str);
3706 }
3707
3708 DECLARE_INSTRUCTION(StringToCharCode)
3709 virtual CompileType ComputeType() const;
3710
3711 Value* str() const { return inputs_[0]; }
3712
3713 virtual bool CanDeoptimize() const { return false; }
3714
3715 virtual bool AllowsCSE() const { return true; }
3716 virtual EffectSet Effects() const { return EffectSet::None(); }
3717 virtual EffectSet Dependencies() const { return EffectSet::None(); }
3718 virtual bool AttributesEqual(Instruction* other) const {
3719 return other->AsStringToCharCode()->cid_ == cid_;
3720 }
3721
3722 virtual bool MayThrow() const { return false; }
3723
3724 private:
3725 const intptr_t cid_;
3726
3727 DISALLOW_COPY_AND_ASSIGN(StringToCharCodeInstr);
3728 };
3729
3730
3700 class StringInterpolateInstr : public TemplateDefinition<1> { 3731 class StringInterpolateInstr : public TemplateDefinition<1> {
3701 public: 3732 public:
3702 StringInterpolateInstr(Value* value, intptr_t token_pos) 3733 StringInterpolateInstr(Value* value, intptr_t token_pos)
3703 : token_pos_(token_pos), function_(Function::Handle()) { 3734 : token_pos_(token_pos), function_(Function::Handle()) {
3704 SetInputAt(0, value); 3735 SetInputAt(0, value);
3705 } 3736 }
3706 3737
3707 Value* value() const { return inputs_[0]; } 3738 Value* value() const { return inputs_[0]; }
3708 intptr_t token_pos() const { return token_pos_; } 3739 intptr_t token_pos() const { return token_pos_; }
3709 3740
(...skipping 3344 matching lines...) Expand 10 before | Expand all | Expand 10 after
7054 ForwardInstructionIterator* current_iterator_; 7085 ForwardInstructionIterator* current_iterator_;
7055 7086
7056 private: 7087 private:
7057 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 7088 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
7058 }; 7089 };
7059 7090
7060 7091
7061 } // namespace dart 7092 } // namespace dart
7062 7093
7063 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 7094 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_type_propagator.cc ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698