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

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

Issue 11773040: Canonicalize away simple arithmetic equivalences. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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 | « no previous file | runtime/vm/intermediate_language.cc » ('j') | runtime/vm/intermediate_language.cc » ('J')
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 3606 matching lines...) Expand 10 before | Expand all | Expand 10 after
3617 3617
3618 virtual intptr_t DeoptimizationTarget() const { 3618 virtual intptr_t DeoptimizationTarget() const {
3619 // Direct access since this instruction cannot deoptimize, and the deopt-id 3619 // Direct access since this instruction cannot deoptimize, and the deopt-id
3620 // was inherited from another instruction that could deoptimize. 3620 // was inherited from another instruction that could deoptimize.
3621 return deopt_id_; 3621 return deopt_id_;
3622 } 3622 }
3623 3623
3624 DECLARE_INSTRUCTION(BinaryDoubleOp) 3624 DECLARE_INSTRUCTION(BinaryDoubleOp)
3625 virtual RawAbstractType* CompileType() const; 3625 virtual RawAbstractType* CompileType() const;
3626 3626
3627 virtual Definition* Canonicalize(FlowGraphOptimizer* optimizer);
3628
3627 private: 3629 private:
3628 const Token::Kind op_kind_; 3630 const Token::Kind op_kind_;
3629 3631
3630 DISALLOW_COPY_AND_ASSIGN(BinaryDoubleOpInstr); 3632 DISALLOW_COPY_AND_ASSIGN(BinaryDoubleOpInstr);
3631 }; 3633 };
3632 3634
3633 3635
3634 class BinaryMintOpInstr : public TemplateDefinition<2> { 3636 class BinaryMintOpInstr : public TemplateDefinition<2> {
3635 public: 3637 public:
3636 BinaryMintOpInstr(Token::Kind op_kind, 3638 BinaryMintOpInstr(Token::Kind op_kind,
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
3846 virtual intptr_t ResultCid() const; 3848 virtual intptr_t ResultCid() const;
3847 3849
3848 void set_overflow(bool overflow) { 3850 void set_overflow(bool overflow) {
3849 overflow_ = overflow; 3851 overflow_ = overflow;
3850 } 3852 }
3851 3853
3852 void PrintTo(BufferFormatter* f) const; 3854 void PrintTo(BufferFormatter* f) const;
3853 3855
3854 virtual void InferRange(); 3856 virtual void InferRange();
3855 3857
3858 virtual Definition* Canonicalize(FlowGraphOptimizer* optimizer);
3859
3856 private: 3860 private:
3857 const Token::Kind op_kind_; 3861 const Token::Kind op_kind_;
3858 InstanceCallInstr* instance_call_; 3862 InstanceCallInstr* instance_call_;
3859 bool overflow_; 3863 bool overflow_;
3860 3864
3861 DISALLOW_COPY_AND_ASSIGN(BinarySmiOpInstr); 3865 DISALLOW_COPY_AND_ASSIGN(BinarySmiOpInstr);
3862 }; 3866 };
3863 3867
3864 3868
3865 // Handles both Smi operations: BIT_OR and NEGATE. 3869 // Handles both Smi operations: BIT_OR and NEGATE.
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
4325 ForwardInstructionIterator* current_iterator_; 4329 ForwardInstructionIterator* current_iterator_;
4326 4330
4327 private: 4331 private:
4328 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 4332 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
4329 }; 4333 };
4330 4334
4331 4335
4332 } // namespace dart 4336 } // namespace dart
4333 4337
4334 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 4338 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/intermediate_language.cc » ('j') | runtime/vm/intermediate_language.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698