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

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

Issue 14846022: Use the constant pool for all constants, not just null. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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 | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/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) 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"
11 #include "vm/handles_impl.h" 11 #include "vm/handles_impl.h"
12 #include "vm/locations.h" 12 #include "vm/locations.h"
13 #include "vm/object.h" 13 #include "vm/object.h"
14 14
15 namespace dart { 15 namespace dart {
16 16
17 class BitVector; 17 class BitVector;
18 class BlockEntryInstr; 18 class BlockEntryInstr;
19 class BufferFormatter; 19 class BufferFormatter;
20 class CatchBlockEntryInstr; 20 class CatchBlockEntryInstr;
21 class ComparisonInstr; 21 class ComparisonInstr;
22 class ControlInstruction; 22 class ControlInstruction;
23 class Definition; 23 class Definition;
24 class Environment; 24 class Environment;
25 class FlowGraph;
25 class FlowGraphCompiler; 26 class FlowGraphCompiler;
26 class FlowGraphOptimizer;
27 class FlowGraphVisitor; 27 class FlowGraphVisitor;
28 class Instruction; 28 class Instruction;
29 class LocalVariable; 29 class LocalVariable;
30 class ParsedFunction; 30 class ParsedFunction;
31 class Range; 31 class Range;
32 32
33 33
34 // TODO(srdjan): Unify with INTRINSIC_LIST. 34 // TODO(srdjan): Unify with INTRINSIC_LIST.
35 // (class-name, function-name, recognized enum, fingerprint). 35 // (class-name, function-name, recognized enum, fingerprint).
36 // See intrinsifier for fingerprint computation. 36 // See intrinsifier for fingerprint computation.
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 // that input operands conversions inserted for this instruction can jump 759 // that input operands conversions inserted for this instruction can jump
760 // to. 760 // to.
761 virtual intptr_t DeoptimizationTarget() const { 761 virtual intptr_t DeoptimizationTarget() const {
762 UNREACHABLE(); 762 UNREACHABLE();
763 return Isolate::kNoDeoptId; 763 return Isolate::kNoDeoptId;
764 } 764 }
765 765
766 // Returns a replacement for the instruction or NULL if the instruction can 766 // Returns a replacement for the instruction or NULL if the instruction can
767 // be eliminated. By default returns the this instruction which means no 767 // be eliminated. By default returns the this instruction which means no
768 // change. 768 // change.
769 virtual Instruction* Canonicalize(FlowGraphOptimizer* optimizer); 769 virtual Instruction* Canonicalize(FlowGraph* flow_graph);
770 770
771 // Insert this instruction before 'next' after use lists are computed. 771 // Insert this instruction before 'next' after use lists are computed.
772 // Instructions cannot be inserted before a block entry or any other 772 // Instructions cannot be inserted before a block entry or any other
773 // instruction without a previous instruction. 773 // instruction without a previous instruction.
774 void InsertBefore(Instruction* next) { InsertAfter(next->previous()); } 774 void InsertBefore(Instruction* next) { InsertAfter(next->previous()); }
775 775
776 // Insert this instruction after 'prev' after use lists are computed. 776 // Insert this instruction after 'prev' after use lists are computed.
777 void InsertAfter(Instruction* prev); 777 void InsertAfter(Instruction* prev);
778 778
779 // Returns true if CSE and LICM are allowed for this instruction. 779 // Returns true if CSE and LICM are allowed for this instruction.
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after
1544 // - unknown sentinel 1544 // - unknown sentinel
1545 Object& constant_value() const { return constant_value_; } 1545 Object& constant_value() const { return constant_value_; }
1546 1546
1547 virtual void InferRange(); 1547 virtual void InferRange();
1548 1548
1549 Range* range() const { return range_; } 1549 Range* range() const { return range_; }
1550 1550
1551 // Definitions can be canonicalized only into definitions to ensure 1551 // Definitions can be canonicalized only into definitions to ensure
1552 // this check statically we override base Canonicalize with a Canonicalize 1552 // this check statically we override base Canonicalize with a Canonicalize
1553 // returning Definition (return type is covariant). 1553 // returning Definition (return type is covariant).
1554 virtual Definition* Canonicalize(FlowGraphOptimizer* optimizer); 1554 virtual Definition* Canonicalize(FlowGraph* flow_graph);
1555 1555
1556 static const intptr_t kReplacementMarker = -2; 1556 static const intptr_t kReplacementMarker = -2;
1557 1557
1558 Definition* Replacement() { 1558 Definition* Replacement() {
1559 if (ssa_temp_index_ == kReplacementMarker) { 1559 if (ssa_temp_index_ == kReplacementMarker) {
1560 return reinterpret_cast<Definition*>(temp_index_); 1560 return reinterpret_cast<Definition*>(temp_index_);
1561 } 1561 }
1562 return this; 1562 return this;
1563 } 1563 }
1564 1564
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
1956 virtual Representation RequiredInputRepresentation(intptr_t i) const; 1956 virtual Representation RequiredInputRepresentation(intptr_t i) const;
1957 1957
1958 // A misleadingly named function for use in template functions that also 1958 // A misleadingly named function for use in template functions that also
1959 // replace definitions. In this case, leave the branch intact and replace 1959 // replace definitions. In this case, leave the branch intact and replace
1960 // its comparison with another comparison that has been removed from the 1960 // its comparison with another comparison that has been removed from the
1961 // graph but still has uses properly linked into their definition's use 1961 // graph but still has uses properly linked into their definition's use
1962 // list. 1962 // list.
1963 void ReplaceWith(ComparisonInstr* other, 1963 void ReplaceWith(ComparisonInstr* other,
1964 ForwardInstructionIterator* ignored); 1964 ForwardInstructionIterator* ignored);
1965 1965
1966 virtual Instruction* Canonicalize(FlowGraphOptimizer* optimizer); 1966 virtual Instruction* Canonicalize(FlowGraph* flow_graph);
1967 1967
1968 virtual void PrintTo(BufferFormatter* f) const; 1968 virtual void PrintTo(BufferFormatter* f) const;
1969 1969
1970 // Set compile type constrained by the comparison of this branch. 1970 // Set compile type constrained by the comparison of this branch.
1971 // FlowGraphPropagator propagates it downwards into either true or false 1971 // FlowGraphPropagator propagates it downwards into either true or false
1972 // successor. 1972 // successor.
1973 void set_constrained_type(ConstrainedCompileType* type) { 1973 void set_constrained_type(ConstrainedCompileType* type) {
1974 constrained_type_ = type; 1974 constrained_type_ = type;
1975 } 1975 }
1976 1976
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
2299 2299
2300 2300
2301 class ConstantInstr : public TemplateDefinition<0> { 2301 class ConstantInstr : public TemplateDefinition<0> {
2302 public: 2302 public:
2303 explicit ConstantInstr(const Object& value) 2303 explicit ConstantInstr(const Object& value)
2304 : value_(value) { } 2304 : value_(value) { }
2305 2305
2306 DECLARE_INSTRUCTION(Constant) 2306 DECLARE_INSTRUCTION(Constant)
2307 virtual CompileType ComputeType() const; 2307 virtual CompileType ComputeType() const;
2308 2308
2309 virtual Definition* Canonicalize(FlowGraphOptimizer* optimizer); 2309 virtual Definition* Canonicalize(FlowGraph* flow_graph);
2310 2310
2311 const Object& value() const { return value_; } 2311 const Object& value() const { return value_; }
2312 2312
2313 virtual void PrintOperandsTo(BufferFormatter* f) const; 2313 virtual void PrintOperandsTo(BufferFormatter* f) const;
2314 2314
2315 virtual bool CanDeoptimize() const { return false; } 2315 virtual bool CanDeoptimize() const { return false; }
2316 2316
2317 virtual void InferRange(); 2317 virtual void InferRange();
2318 2318
2319 virtual bool AllowsCSE() const { return true; } 2319 virtual bool AllowsCSE() const { return true; }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
2358 const AbstractType& dst_type() const { return dst_type_; } 2358 const AbstractType& dst_type() const { return dst_type_; }
2359 void set_dst_type(const AbstractType& dst_type) { 2359 void set_dst_type(const AbstractType& dst_type) {
2360 dst_type_ = dst_type.raw(); 2360 dst_type_ = dst_type.raw();
2361 } 2361 }
2362 const String& dst_name() const { return dst_name_; } 2362 const String& dst_name() const { return dst_name_; }
2363 2363
2364 virtual void PrintOperandsTo(BufferFormatter* f) const; 2364 virtual void PrintOperandsTo(BufferFormatter* f) const;
2365 2365
2366 virtual bool CanDeoptimize() const { return true; } 2366 virtual bool CanDeoptimize() const { return true; }
2367 2367
2368 virtual Definition* Canonicalize(FlowGraphOptimizer* optimizer); 2368 virtual Definition* Canonicalize(FlowGraph* flow_graph);
2369 2369
2370 virtual bool AllowsCSE() const { return true; } 2370 virtual bool AllowsCSE() const { return true; }
2371 virtual EffectSet Effects() const { return EffectSet::None(); } 2371 virtual EffectSet Effects() const { return EffectSet::None(); }
2372 virtual EffectSet Dependencies() const { return EffectSet::None(); } 2372 virtual EffectSet Dependencies() const { return EffectSet::None(); }
2373 virtual bool AttributesEqual(Instruction* other) const; 2373 virtual bool AttributesEqual(Instruction* other) const;
2374 2374
2375 private: 2375 private:
2376 const intptr_t token_pos_; 2376 const intptr_t token_pos_;
2377 AbstractType& dst_type_; 2377 AbstractType& dst_type_;
2378 const String& dst_name_; 2378 const String& dst_name_;
(...skipping 12 matching lines...) Expand all
2391 DECLARE_INSTRUCTION(AssertBoolean) 2391 DECLARE_INSTRUCTION(AssertBoolean)
2392 virtual CompileType ComputeType() const; 2392 virtual CompileType ComputeType() const;
2393 2393
2394 intptr_t token_pos() const { return token_pos_; } 2394 intptr_t token_pos() const { return token_pos_; }
2395 Value* value() const { return inputs_[0]; } 2395 Value* value() const { return inputs_[0]; }
2396 2396
2397 virtual void PrintOperandsTo(BufferFormatter* f) const; 2397 virtual void PrintOperandsTo(BufferFormatter* f) const;
2398 2398
2399 virtual bool CanDeoptimize() const { return true; } 2399 virtual bool CanDeoptimize() const { return true; }
2400 2400
2401 virtual Definition* Canonicalize(FlowGraphOptimizer* optimizer); 2401 virtual Definition* Canonicalize(FlowGraph* flow_graph);
2402 2402
2403 virtual bool AllowsCSE() const { return true; } 2403 virtual bool AllowsCSE() const { return true; }
2404 virtual EffectSet Effects() const { return EffectSet::None(); } 2404 virtual EffectSet Effects() const { return EffectSet::None(); }
2405 virtual EffectSet Dependencies() const { return EffectSet::None(); } 2405 virtual EffectSet Dependencies() const { return EffectSet::None(); }
2406 virtual bool AttributesEqual(Instruction* other) const { return true; } 2406 virtual bool AttributesEqual(Instruction* other) const { return true; }
2407 2407
2408 private: 2408 private:
2409 const intptr_t token_pos_; 2409 const intptr_t token_pos_;
2410 2410
2411 DISALLOW_COPY_AND_ASSIGN(AssertBooleanInstr); 2411 DISALLOW_COPY_AND_ASSIGN(AssertBooleanInstr);
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
2700 2700
2701 virtual void PrintOperandsTo(BufferFormatter* f) const; 2701 virtual void PrintOperandsTo(BufferFormatter* f) const;
2702 2702
2703 virtual bool CanBeDeoptimizationTarget() const { 2703 virtual bool CanBeDeoptimizationTarget() const {
2704 // StrictCompare can be merged into Branch and thus needs an environment. 2704 // StrictCompare can be merged into Branch and thus needs an environment.
2705 return true; 2705 return true;
2706 } 2706 }
2707 2707
2708 virtual bool CanDeoptimize() const { return false; } 2708 virtual bool CanDeoptimize() const { return false; }
2709 2709
2710 virtual Definition* Canonicalize(FlowGraphOptimizer* optimizer); 2710 virtual Definition* Canonicalize(FlowGraph* flow_graph);
2711 2711
2712 virtual void EmitBranchCode(FlowGraphCompiler* compiler, 2712 virtual void EmitBranchCode(FlowGraphCompiler* compiler,
2713 BranchInstr* branch); 2713 BranchInstr* branch);
2714 2714
2715 bool needs_number_check() const { return needs_number_check_; } 2715 bool needs_number_check() const { return needs_number_check_; }
2716 void set_needs_number_check(bool value) { needs_number_check_ = value; } 2716 void set_needs_number_check(bool value) { needs_number_check_ = value; }
2717 void set_kind(Token::Kind value) { kind_ = value; } 2717 void set_kind(Token::Kind value) { kind_ = value; }
2718 2718
2719 virtual bool AllowsCSE() const { return true; } 2719 virtual bool AllowsCSE() const { return true; }
2720 virtual EffectSet Effects() const { return EffectSet::None(); } 2720 virtual EffectSet Effects() const { return EffectSet::None(); }
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
3157 Value* value() const { return inputs_[0]; } 3157 Value* value() const { return inputs_[0]; }
3158 3158
3159 const Field& field() const { return field_; } 3159 const Field& field() const { return field_; }
3160 3160
3161 DECLARE_INSTRUCTION(GuardField) 3161 DECLARE_INSTRUCTION(GuardField)
3162 3162
3163 virtual intptr_t ArgumentCount() const { return 0; } 3163 virtual intptr_t ArgumentCount() const { return 0; }
3164 3164
3165 virtual bool CanDeoptimize() const { return true; } 3165 virtual bool CanDeoptimize() const { return true; }
3166 3166
3167 virtual Instruction* Canonicalize(FlowGraphOptimizer* optimizer); 3167 virtual Instruction* Canonicalize(FlowGraph* flow_graph);
3168 3168
3169 virtual void PrintOperandsTo(BufferFormatter* f) const; 3169 virtual void PrintOperandsTo(BufferFormatter* f) const;
3170 3170
3171 virtual bool AllowsCSE() const { return true; } 3171 virtual bool AllowsCSE() const { return true; }
3172 virtual EffectSet Effects() const { return EffectSet::None(); } 3172 virtual EffectSet Effects() const { return EffectSet::None(); }
3173 virtual EffectSet Dependencies() const { return EffectSet::None(); } 3173 virtual EffectSet Dependencies() const { return EffectSet::None(); }
3174 virtual bool AttributesEqual(Instruction* other) const; 3174 virtual bool AttributesEqual(Instruction* other) const;
3175 3175
3176 private: 3176 private:
3177 const Field& field_; 3177 const Field& field_;
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
3705 virtual CompileType ComputeType() const; 3705 virtual CompileType ComputeType() const;
3706 3706
3707 virtual void PrintOperandsTo(BufferFormatter* f) const; 3707 virtual void PrintOperandsTo(BufferFormatter* f) const;
3708 3708
3709 virtual bool CanDeoptimize() const { return false; } 3709 virtual bool CanDeoptimize() const { return false; }
3710 3710
3711 virtual void InferRange(); 3711 virtual void InferRange();
3712 3712
3713 bool IsImmutableLengthLoad() const; 3713 bool IsImmutableLengthLoad() const;
3714 3714
3715 virtual Definition* Canonicalize(FlowGraphOptimizer* optimizer); 3715 virtual Definition* Canonicalize(FlowGraph* flow_graph);
3716 3716
3717 static MethodRecognizer::Kind RecognizedKindFromArrayCid(intptr_t cid); 3717 static MethodRecognizer::Kind RecognizedKindFromArrayCid(intptr_t cid);
3718 3718
3719 static bool IsFixedLengthArrayCid(intptr_t cid); 3719 static bool IsFixedLengthArrayCid(intptr_t cid);
3720 3720
3721 virtual bool AllowsCSE() const { return immutable_; } 3721 virtual bool AllowsCSE() const { return immutable_; }
3722 virtual EffectSet Effects() const { return EffectSet::None(); } 3722 virtual EffectSet Effects() const { return EffectSet::None(); }
3723 virtual EffectSet Dependencies() const; 3723 virtual EffectSet Dependencies() const;
3724 virtual bool AttributesEqual(Instruction* other) const; 3724 virtual bool AttributesEqual(Instruction* other) const;
3725 3725
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
3988 3988
3989 Value* left() const { return inputs_[0]; } 3989 Value* left() const { return inputs_[0]; }
3990 Value* right() const { return inputs_[1]; } 3990 Value* right() const { return inputs_[1]; }
3991 3991
3992 DECLARE_INSTRUCTION(CheckEitherNonSmi) 3992 DECLARE_INSTRUCTION(CheckEitherNonSmi)
3993 3993
3994 virtual intptr_t ArgumentCount() const { return 0; } 3994 virtual intptr_t ArgumentCount() const { return 0; }
3995 3995
3996 virtual bool CanDeoptimize() const { return true; } 3996 virtual bool CanDeoptimize() const { return true; }
3997 3997
3998 virtual Instruction* Canonicalize(FlowGraphOptimizer* optimizer); 3998 virtual Instruction* Canonicalize(FlowGraph* flow_graph);
3999 3999
4000 virtual bool AllowsCSE() const { return true; } 4000 virtual bool AllowsCSE() const { return true; }
4001 virtual EffectSet Effects() const { return EffectSet::None(); } 4001 virtual EffectSet Effects() const { return EffectSet::None(); }
4002 virtual EffectSet Dependencies() const { return EffectSet::None(); } 4002 virtual EffectSet Dependencies() const { return EffectSet::None(); }
4003 virtual bool AttributesEqual(Instruction* other) const { return true; } 4003 virtual bool AttributesEqual(Instruction* other) const { return true; }
4004 4004
4005 private: 4005 private:
4006 DISALLOW_COPY_AND_ASSIGN(CheckEitherNonSmiInstr); 4006 DISALLOW_COPY_AND_ASSIGN(CheckEitherNonSmiInstr);
4007 }; 4007 };
4008 4008
(...skipping 14 matching lines...) Expand all
4023 virtual Representation RequiredInputRepresentation(intptr_t idx) const { 4023 virtual Representation RequiredInputRepresentation(intptr_t idx) const {
4024 ASSERT(idx == 0); 4024 ASSERT(idx == 0);
4025 return kUnboxedDouble; 4025 return kUnboxedDouble;
4026 } 4026 }
4027 4027
4028 virtual bool AllowsCSE() const { return true; } 4028 virtual bool AllowsCSE() const { return true; }
4029 virtual EffectSet Effects() const { return EffectSet::None(); } 4029 virtual EffectSet Effects() const { return EffectSet::None(); }
4030 virtual EffectSet Dependencies() const { return EffectSet::None(); } 4030 virtual EffectSet Dependencies() const { return EffectSet::None(); }
4031 virtual bool AttributesEqual(Instruction* other) const { return true; } 4031 virtual bool AttributesEqual(Instruction* other) const { return true; }
4032 4032
4033 Definition* Canonicalize(FlowGraphOptimizer* optimizer); 4033 Definition* Canonicalize(FlowGraph* flow_graph);
4034 4034
4035 private: 4035 private:
4036 DISALLOW_COPY_AND_ASSIGN(BoxDoubleInstr); 4036 DISALLOW_COPY_AND_ASSIGN(BoxDoubleInstr);
4037 }; 4037 };
4038 4038
4039 4039
4040 class BoxFloat32x4Instr : public TemplateDefinition<1> { 4040 class BoxFloat32x4Instr : public TemplateDefinition<1> {
4041 public: 4041 public:
4042 explicit BoxFloat32x4Instr(Value* value) { 4042 explicit BoxFloat32x4Instr(Value* value) {
4043 SetInputAt(0, value); 4043 SetInputAt(0, value);
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
4140 } 4140 }
4141 4141
4142 DECLARE_INSTRUCTION(UnboxDouble) 4142 DECLARE_INSTRUCTION(UnboxDouble)
4143 virtual CompileType ComputeType() const; 4143 virtual CompileType ComputeType() const;
4144 4144
4145 virtual bool AllowsCSE() const { return true; } 4145 virtual bool AllowsCSE() const { return true; }
4146 virtual EffectSet Effects() const { return EffectSet::None(); } 4146 virtual EffectSet Effects() const { return EffectSet::None(); }
4147 virtual EffectSet Dependencies() const { return EffectSet::None(); } 4147 virtual EffectSet Dependencies() const { return EffectSet::None(); }
4148 virtual bool AttributesEqual(Instruction* other) const { return true; } 4148 virtual bool AttributesEqual(Instruction* other) const { return true; }
4149 4149
4150 Definition* Canonicalize(FlowGraphOptimizer* optimizer); 4150 Definition* Canonicalize(FlowGraph* flow_graph);
4151 4151
4152 private: 4152 private:
4153 DISALLOW_COPY_AND_ASSIGN(UnboxDoubleInstr); 4153 DISALLOW_COPY_AND_ASSIGN(UnboxDoubleInstr);
4154 }; 4154 };
4155 4155
4156 4156
4157 class UnboxFloat32x4Instr : public TemplateDefinition<1> { 4157 class UnboxFloat32x4Instr : public TemplateDefinition<1> {
4158 public: 4158 public:
4159 UnboxFloat32x4Instr(Value* value, intptr_t deopt_id) { 4159 UnboxFloat32x4Instr(Value* value, intptr_t deopt_id) {
4160 SetInputAt(0, value); 4160 SetInputAt(0, value);
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
4317 4317
4318 virtual intptr_t DeoptimizationTarget() const { 4318 virtual intptr_t DeoptimizationTarget() const {
4319 // Direct access since this instruction cannot deoptimize, and the deopt-id 4319 // Direct access since this instruction cannot deoptimize, and the deopt-id
4320 // was inherited from another instruction that could deoptimize. 4320 // was inherited from another instruction that could deoptimize.
4321 return deopt_id_; 4321 return deopt_id_;
4322 } 4322 }
4323 4323
4324 DECLARE_INSTRUCTION(BinaryDoubleOp) 4324 DECLARE_INSTRUCTION(BinaryDoubleOp)
4325 virtual CompileType ComputeType() const; 4325 virtual CompileType ComputeType() const;
4326 4326
4327 virtual Definition* Canonicalize(FlowGraphOptimizer* optimizer); 4327 virtual Definition* Canonicalize(FlowGraph* flow_graph);
4328 4328
4329 virtual bool AllowsCSE() const { return true; } 4329 virtual bool AllowsCSE() const { return true; }
4330 virtual EffectSet Effects() const { return EffectSet::None(); } 4330 virtual EffectSet Effects() const { return EffectSet::None(); }
4331 virtual EffectSet Dependencies() const { return EffectSet::None(); } 4331 virtual EffectSet Dependencies() const { return EffectSet::None(); }
4332 virtual bool AttributesEqual(Instruction* other) const { 4332 virtual bool AttributesEqual(Instruction* other) const {
4333 return op_kind() == other->AsBinaryDoubleOp()->op_kind(); 4333 return op_kind() == other->AsBinaryDoubleOp()->op_kind();
4334 } 4334 }
4335 4335
4336 private: 4336 private:
4337 const Token::Kind op_kind_; 4337 const Token::Kind op_kind_;
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after
5004 ASSERT((idx == 0) || (idx == 1)); 5004 ASSERT((idx == 0) || (idx == 1));
5005 return kUnboxedMint; 5005 return kUnboxedMint;
5006 } 5006 }
5007 5007
5008 virtual intptr_t DeoptimizationTarget() const { 5008 virtual intptr_t DeoptimizationTarget() const {
5009 // Direct access since this instruction cannot deoptimize, and the deopt-id 5009 // Direct access since this instruction cannot deoptimize, and the deopt-id
5010 // was inherited from another instruction that could deoptimize. 5010 // was inherited from another instruction that could deoptimize.
5011 return deopt_id_; 5011 return deopt_id_;
5012 } 5012 }
5013 5013
5014 virtual Definition* Canonicalize(FlowGraphOptimizer* optimizer); 5014 virtual Definition* Canonicalize(FlowGraph* flow_graph);
5015 5015
5016 DECLARE_INSTRUCTION(BinaryMintOp) 5016 DECLARE_INSTRUCTION(BinaryMintOp)
5017 virtual CompileType ComputeType() const; 5017 virtual CompileType ComputeType() const;
5018 5018
5019 virtual bool AllowsCSE() const { return true; } 5019 virtual bool AllowsCSE() const { return true; }
5020 virtual EffectSet Effects() const { return EffectSet::None(); } 5020 virtual EffectSet Effects() const { return EffectSet::None(); }
5021 virtual EffectSet Dependencies() const { return EffectSet::None(); } 5021 virtual EffectSet Dependencies() const { return EffectSet::None(); }
5022 virtual bool AttributesEqual(Instruction* other) const { 5022 virtual bool AttributesEqual(Instruction* other) const {
5023 ASSERT(other->IsBinaryMintOp()); 5023 ASSERT(other->IsBinaryMintOp());
5024 return op_kind() == other->AsBinaryMintOp()->op_kind(); 5024 return op_kind() == other->AsBinaryMintOp()->op_kind();
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
5176 5176
5177 virtual bool AllowsCSE() const { return true; } 5177 virtual bool AllowsCSE() const { return true; }
5178 virtual EffectSet Effects() const { return EffectSet::None(); } 5178 virtual EffectSet Effects() const { return EffectSet::None(); }
5179 virtual EffectSet Dependencies() const { return EffectSet::None(); } 5179 virtual EffectSet Dependencies() const { return EffectSet::None(); }
5180 virtual bool AttributesEqual(Instruction* other) const; 5180 virtual bool AttributesEqual(Instruction* other) const;
5181 5181
5182 void PrintTo(BufferFormatter* f) const; 5182 void PrintTo(BufferFormatter* f) const;
5183 5183
5184 virtual void InferRange(); 5184 virtual void InferRange();
5185 5185
5186 virtual Definition* Canonicalize(FlowGraphOptimizer* optimizer); 5186 virtual Definition* Canonicalize(FlowGraph* flow_graph);
5187 5187
5188 // Returns true if right is a non-zero Smi constant which absolute value is 5188 // Returns true if right is a non-zero Smi constant which absolute value is
5189 // a power of two. 5189 // a power of two.
5190 bool RightIsPowerOfTwoConstant() const; 5190 bool RightIsPowerOfTwoConstant() const;
5191 5191
5192 private: 5192 private:
5193 const Token::Kind op_kind_; 5193 const Token::Kind op_kind_;
5194 InstanceCallInstr* instance_call_; 5194 InstanceCallInstr* instance_call_;
5195 bool overflow_; 5195 bool overflow_;
5196 bool is_truncating_; 5196 bool is_truncating_;
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
5465 DECLARE_INSTRUCTION(CheckClass) 5465 DECLARE_INSTRUCTION(CheckClass)
5466 5466
5467 virtual intptr_t ArgumentCount() const { return 0; } 5467 virtual intptr_t ArgumentCount() const { return 0; }
5468 5468
5469 virtual bool CanDeoptimize() const { return true; } 5469 virtual bool CanDeoptimize() const { return true; }
5470 5470
5471 Value* value() const { return inputs_[0]; } 5471 Value* value() const { return inputs_[0]; }
5472 5472
5473 const ICData& unary_checks() const { return unary_checks_; } 5473 const ICData& unary_checks() const { return unary_checks_; }
5474 5474
5475 virtual Instruction* Canonicalize(FlowGraphOptimizer* optimizer); 5475 virtual Instruction* Canonicalize(FlowGraph* flow_graph);
5476 5476
5477 virtual void PrintOperandsTo(BufferFormatter* f) const; 5477 virtual void PrintOperandsTo(BufferFormatter* f) const;
5478 5478
5479 void set_null_check(bool flag) { null_check_ = flag; } 5479 void set_null_check(bool flag) { null_check_ = flag; }
5480 5480
5481 bool null_check() const { return null_check_; } 5481 bool null_check() const { return null_check_; }
5482 5482
5483 virtual bool AllowsCSE() const { return true; } 5483 virtual bool AllowsCSE() const { return true; }
5484 virtual EffectSet Effects() const { return EffectSet::None(); } 5484 virtual EffectSet Effects() const { return EffectSet::None(); }
5485 virtual EffectSet Dependencies() const; 5485 virtual EffectSet Dependencies() const;
(...skipping 17 matching lines...) Expand all
5503 } 5503 }
5504 5504
5505 Value* value() const { return inputs_[0]; } 5505 Value* value() const { return inputs_[0]; }
5506 5506
5507 DECLARE_INSTRUCTION(CheckSmi) 5507 DECLARE_INSTRUCTION(CheckSmi)
5508 5508
5509 virtual intptr_t ArgumentCount() const { return 0; } 5509 virtual intptr_t ArgumentCount() const { return 0; }
5510 5510
5511 virtual bool CanDeoptimize() const { return true; } 5511 virtual bool CanDeoptimize() const { return true; }
5512 5512
5513 virtual Instruction* Canonicalize(FlowGraphOptimizer* optimizer); 5513 virtual Instruction* Canonicalize(FlowGraph* flow_graph);
5514 5514
5515 virtual bool AllowsCSE() const { return true; } 5515 virtual bool AllowsCSE() const { return true; }
5516 virtual EffectSet Effects() const { return EffectSet::None(); } 5516 virtual EffectSet Effects() const { return EffectSet::None(); }
5517 virtual EffectSet Dependencies() const { return EffectSet::None(); } 5517 virtual EffectSet Dependencies() const { return EffectSet::None(); }
5518 virtual bool AttributesEqual(Instruction* other) const { return true; } 5518 virtual bool AttributesEqual(Instruction* other) const { return true; }
5519 5519
5520 private: 5520 private:
5521 DISALLOW_COPY_AND_ASSIGN(CheckSmiInstr); 5521 DISALLOW_COPY_AND_ASSIGN(CheckSmiInstr);
5522 }; 5522 };
5523 5523
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
5781 ForwardInstructionIterator* current_iterator_; 5781 ForwardInstructionIterator* current_iterator_;
5782 5782
5783 private: 5783 private:
5784 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 5784 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
5785 }; 5785 };
5786 5786
5787 5787
5788 } // namespace dart 5788 } // namespace dart
5789 5789
5790 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 5790 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698