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

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

Issue 562203005: Inline toDouble calls on mints (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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_type_propagator.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"
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
901 friend class FlowGraphOptimizer; 902 friend class FlowGraphOptimizer;
902 friend class LoadIndexedInstr; 903 friend class LoadIndexedInstr;
903 friend class StoreIndexedInstr; 904 friend class StoreIndexedInstr;
904 friend class StoreInstanceFieldInstr; 905 friend class StoreInstanceFieldInstr;
905 friend class ComparisonInstr; 906 friend class ComparisonInstr;
906 friend class TargetEntryInstr; 907 friend class TargetEntryInstr;
907 friend class JoinEntryInstr; 908 friend class JoinEntryInstr;
908 friend class InstanceOfInstr; 909 friend class InstanceOfInstr;
909 friend class PolymorphicInstanceCallInstr; 910 friend class PolymorphicInstanceCallInstr;
910 friend class SmiToDoubleInstr; 911 friend class SmiToDoubleInstr;
912 friend class MintToDoubleInstr;
911 friend class DoubleToIntegerInstr; 913 friend class DoubleToIntegerInstr;
912 friend class BranchSimplifier; 914 friend class BranchSimplifier;
913 friend class BlockEntryInstr; 915 friend class BlockEntryInstr;
914 friend class RelationalOpInstr; 916 friend class RelationalOpInstr;
915 friend class EqualityCompareInstr; 917 friend class EqualityCompareInstr;
916 friend class TestCidsInstr; 918 friend class TestCidsInstr;
917 friend class UnboxIntNInstr; 919 friend class UnboxIntNInstr;
918 friend class UnboxInt32Instr; 920 friend class UnboxInt32Instr;
919 friend class UnboxUint32Instr; 921 friend class UnboxUint32Instr;
920 friend class UnboxedIntConverterInstr; 922 friend class UnboxedIntConverterInstr;
(...skipping 6295 matching lines...) Expand 10 before | Expand all | Expand 10 after
7216 Value* value() const { return inputs_[0]; } 7218 Value* value() const { return inputs_[0]; }
7217 virtual intptr_t token_pos() const { return token_pos_; } 7219 virtual intptr_t token_pos() const { return token_pos_; }
7218 7220
7219 DECLARE_INSTRUCTION(SmiToDouble) 7221 DECLARE_INSTRUCTION(SmiToDouble)
7220 virtual CompileType ComputeType() const; 7222 virtual CompileType ComputeType() const;
7221 7223
7222 virtual Representation representation() const { 7224 virtual Representation representation() const {
7223 return kUnboxedDouble; 7225 return kUnboxedDouble;
7224 } 7226 }
7225 7227
7226 virtual intptr_t ArgumentCount() const { return 1; }
7227
7228 virtual bool CanDeoptimize() const { return false; } 7228 virtual bool CanDeoptimize() const { return false; }
7229 7229
7230 virtual bool AllowsCSE() const { return true; } 7230 virtual bool AllowsCSE() const { return true; }
7231 virtual EffectSet Effects() const { return EffectSet::None(); } 7231 virtual EffectSet Effects() const { return EffectSet::None(); }
7232 virtual EffectSet Dependencies() const { return EffectSet::None(); } 7232 virtual EffectSet Dependencies() const { return EffectSet::None(); }
7233 virtual bool AttributesEqual(Instruction* other) const { return true; } 7233 virtual bool AttributesEqual(Instruction* other) const { return true; }
7234 7234
7235 virtual bool MayThrow() const { return false; } 7235 virtual bool MayThrow() const { return false; }
7236 7236
7237 private: 7237 private:
(...skipping 30 matching lines...) Expand all
7268 virtual EffectSet Dependencies() const { return EffectSet::None(); } 7268 virtual EffectSet Dependencies() const { return EffectSet::None(); }
7269 virtual bool AttributesEqual(Instruction* other) const { return true; } 7269 virtual bool AttributesEqual(Instruction* other) const { return true; }
7270 7270
7271 virtual bool MayThrow() const { return false; } 7271 virtual bool MayThrow() const { return false; }
7272 7272
7273 private: 7273 private:
7274 DISALLOW_COPY_AND_ASSIGN(Int32ToDoubleInstr); 7274 DISALLOW_COPY_AND_ASSIGN(Int32ToDoubleInstr);
7275 }; 7275 };
7276 7276
7277 7277
7278 class MintToDoubleInstr : public TemplateDefinition<1> {
7279 public:
7280 MintToDoubleInstr(Value* value, intptr_t deopt_id)
7281 : deopt_id_(deopt_id) {
7282 SetInputAt(0, value);
7283 }
7284
7285 Value* value() const { return inputs_[0]; }
7286
7287 DECLARE_INSTRUCTION(MintToDouble)
7288 virtual CompileType ComputeType() const;
7289
7290 virtual Representation RequiredInputRepresentation(intptr_t index) const {
7291 ASSERT(index == 0);
7292 return kUnboxedMint;
7293 }
7294
7295 virtual Representation representation() const {
7296 return kUnboxedDouble;
7297 }
7298
7299 virtual intptr_t DeoptimizationTarget() const {
7300 // Direct access since this instruction cannot deoptimize, and the deopt-id
7301 // was inherited from another instruction that could deoptimize.
7302 return deopt_id_;
7303 }
7304
7305 virtual bool CanDeoptimize() const { return false; }
7306
7307 virtual bool AllowsCSE() const { return true; }
7308 virtual EffectSet Effects() const { return EffectSet::None(); }
7309 virtual EffectSet Dependencies() const { return EffectSet::None(); }
7310 virtual bool AttributesEqual(Instruction* other) const { return true; }
7311
7312 virtual bool MayThrow() const { return false; }
7313
7314 private:
7315 const intptr_t deopt_id_;
7316
7317 DISALLOW_COPY_AND_ASSIGN(MintToDoubleInstr);
7318 };
7319
7320
7278 class DoubleToIntegerInstr : public TemplateDefinition<1> { 7321 class DoubleToIntegerInstr : public TemplateDefinition<1> {
7279 public: 7322 public:
7280 DoubleToIntegerInstr(Value* value, InstanceCallInstr* instance_call) 7323 DoubleToIntegerInstr(Value* value, InstanceCallInstr* instance_call)
7281 : instance_call_(instance_call) { 7324 : instance_call_(instance_call) {
7282 SetInputAt(0, value); 7325 SetInputAt(0, value);
7283 deopt_id_ = instance_call->deopt_id(); 7326 deopt_id_ = instance_call->deopt_id();
7284 } 7327 }
7285 7328
7286 Value* value() const { return inputs_[0]; } 7329 Value* value() const { return inputs_[0]; }
7287 InstanceCallInstr* instance_call() const { return instance_call_; } 7330 InstanceCallInstr* instance_call() const { return instance_call_; }
(...skipping 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after
8319 Isolate* isolate, bool opt) const { \ 8362 Isolate* isolate, bool opt) const { \
8320 UNIMPLEMENTED(); \ 8363 UNIMPLEMENTED(); \
8321 return NULL; \ 8364 return NULL; \
8322 } \ 8365 } \
8323 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } 8366 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); }
8324 8367
8325 8368
8326 } // namespace dart 8369 } // namespace dart
8327 8370
8328 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 8371 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_type_propagator.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698