Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 469 M(AllocateContext) \ | 469 M(AllocateContext) \ |
| 470 M(AllocateUninitializedContext) \ | 470 M(AllocateUninitializedContext) \ |
| 471 M(CloneContext) \ | 471 M(CloneContext) \ |
| 472 M(BinarySmiOp) \ | 472 M(BinarySmiOp) \ |
| 473 M(BinaryInt32Op) \ | 473 M(BinaryInt32Op) \ |
| 474 M(UnarySmiOp) \ | 474 M(UnarySmiOp) \ |
| 475 M(UnaryDoubleOp) \ | 475 M(UnaryDoubleOp) \ |
| 476 M(CheckStackOverflow) \ | 476 M(CheckStackOverflow) \ |
| 477 M(SmiToDouble) \ | 477 M(SmiToDouble) \ |
| 478 M(Int32ToDouble) \ | 478 M(Int32ToDouble) \ |
| 479 M(MintToDouble) \ | |
| 479 M(DoubleToInteger) \ | 480 M(DoubleToInteger) \ |
| 480 M(DoubleToSmi) \ | 481 M(DoubleToSmi) \ |
| 481 M(DoubleToDouble) \ | 482 M(DoubleToDouble) \ |
| 482 M(DoubleToFloat) \ | 483 M(DoubleToFloat) \ |
| 483 M(FloatToDouble) \ | 484 M(FloatToDouble) \ |
| 484 M(CheckClass) \ | 485 M(CheckClass) \ |
| 485 M(CheckClassId) \ | 486 M(CheckClassId) \ |
| 486 M(CheckSmi) \ | 487 M(CheckSmi) \ |
| 487 M(Constant) \ | 488 M(Constant) \ |
| 488 M(UnboxedConstant) \ | 489 M(UnboxedConstant) \ |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 897 friend class FlowGraphOptimizer; | 898 friend class FlowGraphOptimizer; |
| 898 friend class LoadIndexedInstr; | 899 friend class LoadIndexedInstr; |
| 899 friend class StoreIndexedInstr; | 900 friend class StoreIndexedInstr; |
| 900 friend class StoreInstanceFieldInstr; | 901 friend class StoreInstanceFieldInstr; |
| 901 friend class ComparisonInstr; | 902 friend class ComparisonInstr; |
| 902 friend class TargetEntryInstr; | 903 friend class TargetEntryInstr; |
| 903 friend class JoinEntryInstr; | 904 friend class JoinEntryInstr; |
| 904 friend class InstanceOfInstr; | 905 friend class InstanceOfInstr; |
| 905 friend class PolymorphicInstanceCallInstr; | 906 friend class PolymorphicInstanceCallInstr; |
| 906 friend class SmiToDoubleInstr; | 907 friend class SmiToDoubleInstr; |
| 908 friend class MintToDoubleInstr; | |
| 907 friend class DoubleToIntegerInstr; | 909 friend class DoubleToIntegerInstr; |
| 908 friend class BranchSimplifier; | 910 friend class BranchSimplifier; |
| 909 friend class BlockEntryInstr; | 911 friend class BlockEntryInstr; |
| 910 friend class RelationalOpInstr; | 912 friend class RelationalOpInstr; |
| 911 friend class EqualityCompareInstr; | 913 friend class EqualityCompareInstr; |
| 912 friend class TestCidsInstr; | 914 friend class TestCidsInstr; |
| 913 friend class BinaryUint32OpInstr; | 915 friend class BinaryUint32OpInstr; |
| 914 friend class UnaryUint32OpInstr; | 916 friend class UnaryUint32OpInstr; |
| 915 friend class ShiftUint32OpInstr; | 917 friend class ShiftUint32OpInstr; |
| 916 friend class UnboxIntNInstr; | 918 friend class UnboxIntNInstr; |
| (...skipping 6256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7173 Value* value() const { return inputs_[0]; } | 7175 Value* value() const { return inputs_[0]; } |
| 7174 virtual intptr_t token_pos() const { return token_pos_; } | 7176 virtual intptr_t token_pos() const { return token_pos_; } |
| 7175 | 7177 |
| 7176 DECLARE_INSTRUCTION(SmiToDouble) | 7178 DECLARE_INSTRUCTION(SmiToDouble) |
| 7177 virtual CompileType ComputeType() const; | 7179 virtual CompileType ComputeType() const; |
| 7178 | 7180 |
| 7179 virtual Representation representation() const { | 7181 virtual Representation representation() const { |
| 7180 return kUnboxedDouble; | 7182 return kUnboxedDouble; |
| 7181 } | 7183 } |
| 7182 | 7184 |
| 7183 virtual intptr_t ArgumentCount() const { return 1; } | 7185 virtual intptr_t ArgumentCount() const { return 1; } |
|
Florian Schneider
2014/09/17 11:15:32
Why is ArgumentCount 1? There should not be any pu
Cutch
2014/09/18 16:39:49
Fixed here.
| |
| 7184 | 7186 |
| 7185 virtual bool CanDeoptimize() const { return false; } | 7187 virtual bool CanDeoptimize() const { return false; } |
| 7186 | 7188 |
| 7187 virtual bool AllowsCSE() const { return true; } | 7189 virtual bool AllowsCSE() const { return true; } |
| 7188 virtual EffectSet Effects() const { return EffectSet::None(); } | 7190 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 7189 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 7191 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 7190 virtual bool AttributesEqual(Instruction* other) const { return true; } | 7192 virtual bool AttributesEqual(Instruction* other) const { return true; } |
| 7191 | 7193 |
| 7192 virtual bool MayThrow() const { return false; } | 7194 virtual bool MayThrow() const { return false; } |
| 7193 | 7195 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7225 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 7227 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 7226 virtual bool AttributesEqual(Instruction* other) const { return true; } | 7228 virtual bool AttributesEqual(Instruction* other) const { return true; } |
| 7227 | 7229 |
| 7228 virtual bool MayThrow() const { return false; } | 7230 virtual bool MayThrow() const { return false; } |
| 7229 | 7231 |
| 7230 private: | 7232 private: |
| 7231 DISALLOW_COPY_AND_ASSIGN(Int32ToDoubleInstr); | 7233 DISALLOW_COPY_AND_ASSIGN(Int32ToDoubleInstr); |
| 7232 }; | 7234 }; |
| 7233 | 7235 |
| 7234 | 7236 |
| 7237 class MintToDoubleInstr : public TemplateDefinition<1> { | |
| 7238 public: | |
| 7239 MintToDoubleInstr(Value* value, intptr_t deopt_id) | |
| 7240 : deopt_id_(deopt_id) { | |
| 7241 SetInputAt(0, value); | |
| 7242 } | |
| 7243 | |
| 7244 Value* value() const { return inputs_[0]; } | |
| 7245 | |
| 7246 DECLARE_INSTRUCTION(MintToDouble) | |
| 7247 virtual CompileType ComputeType() const; | |
| 7248 | |
| 7249 virtual Representation RequiredInputRepresentation(intptr_t index) const { | |
| 7250 ASSERT(index == 0); | |
| 7251 return kUnboxedMint; | |
| 7252 } | |
| 7253 | |
| 7254 virtual Representation representation() const { | |
| 7255 return kUnboxedDouble; | |
| 7256 } | |
| 7257 | |
| 7258 virtual intptr_t DeoptimizationTarget() const { | |
| 7259 // Direct access since this instruction cannot deoptimize, and the deopt-id | |
| 7260 // was inherited from another instruction that could deoptimize. | |
| 7261 return deopt_id_; | |
| 7262 } | |
| 7263 | |
| 7264 virtual intptr_t ArgumentCount() const { return 1; } | |
|
Florian Schneider
2014/09/17 11:15:32
Why is ArgumentCount 1? There should not be any pu
Cutch
2014/09/18 16:39:49
And here.
| |
| 7265 | |
| 7266 virtual bool CanDeoptimize() const { return false; } | |
| 7267 | |
| 7268 virtual bool AllowsCSE() const { return true; } | |
| 7269 virtual EffectSet Effects() const { return EffectSet::None(); } | |
| 7270 virtual EffectSet Dependencies() const { return EffectSet::None(); } | |
| 7271 virtual bool AttributesEqual(Instruction* other) const { return true; } | |
| 7272 | |
| 7273 virtual bool MayThrow() const { return false; } | |
| 7274 | |
| 7275 private: | |
| 7276 const intptr_t deopt_id_; | |
| 7277 | |
| 7278 DISALLOW_COPY_AND_ASSIGN(MintToDoubleInstr); | |
| 7279 }; | |
| 7280 | |
| 7281 | |
| 7235 class DoubleToIntegerInstr : public TemplateDefinition<1> { | 7282 class DoubleToIntegerInstr : public TemplateDefinition<1> { |
| 7236 public: | 7283 public: |
| 7237 DoubleToIntegerInstr(Value* value, InstanceCallInstr* instance_call) | 7284 DoubleToIntegerInstr(Value* value, InstanceCallInstr* instance_call) |
| 7238 : instance_call_(instance_call) { | 7285 : instance_call_(instance_call) { |
| 7239 SetInputAt(0, value); | 7286 SetInputAt(0, value); |
| 7240 deopt_id_ = instance_call->deopt_id(); | 7287 deopt_id_ = instance_call->deopt_id(); |
| 7241 } | 7288 } |
| 7242 | 7289 |
| 7243 Value* value() const { return inputs_[0]; } | 7290 Value* value() const { return inputs_[0]; } |
| 7244 InstanceCallInstr* instance_call() const { return instance_call_; } | 7291 InstanceCallInstr* instance_call() const { return instance_call_; } |
| (...skipping 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8453 Isolate* isolate, bool opt) const { \ | 8500 Isolate* isolate, bool opt) const { \ |
| 8454 UNIMPLEMENTED(); \ | 8501 UNIMPLEMENTED(); \ |
| 8455 return NULL; \ | 8502 return NULL; \ |
| 8456 } \ | 8503 } \ |
| 8457 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } | 8504 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } |
| 8458 | 8505 |
| 8459 | 8506 |
| 8460 } // namespace dart | 8507 } // namespace dart |
| 8461 | 8508 |
| 8462 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 8509 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |