| 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 25 matching lines...) Expand all Loading... |
| 36 class Range; | 36 class Range; |
| 37 class RangeAnalysis; | 37 class RangeAnalysis; |
| 38 class RangeBoundary; | 38 class RangeBoundary; |
| 39 class UnboxIntegerInstr; | 39 class UnboxIntegerInstr; |
| 40 | 40 |
| 41 // These token positions are used to classify instructions that can't be | 41 // These token positions are used to classify instructions that can't be |
| 42 // directly tied to an actual source position. | 42 // directly tied to an actual source position. |
| 43 #define CLASSIFYING_TOKEN_POSITIONS(V) \ | 43 #define CLASSIFYING_TOKEN_POSITIONS(V) \ |
| 44 V(Box, -2) \ | 44 V(Box, -2) \ |
| 45 V(ParallelMove, -3) \ | 45 V(ParallelMove, -3) \ |
| 46 V(TempMove, -4) | 46 V(TempMove, -4) \ |
| 47 V(Constant, -5) |
| 47 | 48 |
| 48 // COMPILE_ASSERT that all CLASSIFYING_TOKEN_POSITIONS are less than | 49 // COMPILE_ASSERT that all CLASSIFYING_TOKEN_POSITIONS are less than |
| 49 // Scanner::kNoSourcePos. | 50 // Scanner::kNoSourcePos. |
| 50 #define SANITY_CHECK_VALUES(name, value) \ | 51 #define SANITY_CHECK_VALUES(name, value) \ |
| 51 COMPILE_ASSERT(value < Scanner::kNoSourcePos); | 52 COMPILE_ASSERT(value < Scanner::kNoSourcePos); |
| 52 CLASSIFYING_TOKEN_POSITIONS(SANITY_CHECK_VALUES); | 53 CLASSIFYING_TOKEN_POSITIONS(SANITY_CHECK_VALUES); |
| 53 #undef SANITY_CHECK_VALUES | 54 #undef SANITY_CHECK_VALUES |
| 54 | 55 |
| 55 class ClassifyingTokenPositions : public AllStatic { | 56 class ClassifyingTokenPositions : public AllStatic { |
| 56 public: | 57 public: |
| (...skipping 2518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2575 Range* constraint_; | 2576 Range* constraint_; |
| 2576 TargetEntryInstr* target_; | 2577 TargetEntryInstr* target_; |
| 2577 | 2578 |
| 2578 DISALLOW_COPY_AND_ASSIGN(ConstraintInstr); | 2579 DISALLOW_COPY_AND_ASSIGN(ConstraintInstr); |
| 2579 }; | 2580 }; |
| 2580 | 2581 |
| 2581 | 2582 |
| 2582 class ConstantInstr : public TemplateDefinition<0, NoThrow, Pure> { | 2583 class ConstantInstr : public TemplateDefinition<0, NoThrow, Pure> { |
| 2583 public: | 2584 public: |
| 2584 ConstantInstr(const Object& value, | 2585 ConstantInstr(const Object& value, |
| 2585 intptr_t token_pos = Scanner::kNoSourcePos); | 2586 intptr_t token_pos = ClassifyingTokenPositions::kConstant); |
| 2586 | 2587 |
| 2587 DECLARE_INSTRUCTION(Constant) | 2588 DECLARE_INSTRUCTION(Constant) |
| 2588 virtual CompileType ComputeType() const; | 2589 virtual CompileType ComputeType() const; |
| 2589 | 2590 |
| 2590 virtual Definition* Canonicalize(FlowGraph* flow_graph); | 2591 virtual Definition* Canonicalize(FlowGraph* flow_graph); |
| 2591 | 2592 |
| 2592 const Object& value() const { return value_; } | 2593 const Object& value() const { return value_; } |
| 2593 | 2594 |
| 2594 virtual void PrintOperandsTo(BufferFormatter* f) const; | 2595 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 2595 | 2596 |
| 2596 virtual bool CanDeoptimize() const { return false; } | 2597 virtual bool CanDeoptimize() const { return false; } |
| 2597 | 2598 |
| 2598 virtual void InferRange(RangeAnalysis* analysis, Range* range); | 2599 virtual void InferRange(RangeAnalysis* analysis, Range* range); |
| 2599 | 2600 |
| 2600 virtual bool AttributesEqual(Instruction* other) const; | 2601 virtual bool AttributesEqual(Instruction* other) const; |
| 2601 | 2602 |
| 2603 virtual intptr_t token_pos() const { return token_pos_; } |
| 2604 |
| 2602 private: | 2605 private: |
| 2603 const Object& value_; | 2606 const Object& value_; |
| 2604 const intptr_t token_pos_; | 2607 const intptr_t token_pos_; |
| 2605 | 2608 |
| 2606 DISALLOW_COPY_AND_ASSIGN(ConstantInstr); | 2609 DISALLOW_COPY_AND_ASSIGN(ConstantInstr); |
| 2607 }; | 2610 }; |
| 2608 | 2611 |
| 2609 | 2612 |
| 2610 // Merged ConstantInstr -> UnboxedXXX into UnboxedConstantInstr. | 2613 // Merged ConstantInstr -> UnboxedXXX into UnboxedConstantInstr. |
| 2611 // TODO(srdjan): Implemented currently for doubles only, should implement | 2614 // TODO(srdjan): Implemented currently for doubles only, should implement |
| (...skipping 5584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8196 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \ | 8199 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \ |
| 8197 UNIMPLEMENTED(); \ | 8200 UNIMPLEMENTED(); \ |
| 8198 return NULL; \ | 8201 return NULL; \ |
| 8199 } \ | 8202 } \ |
| 8200 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } | 8203 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } |
| 8201 | 8204 |
| 8202 | 8205 |
| 8203 } // namespace dart | 8206 } // namespace dart |
| 8204 | 8207 |
| 8205 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 8208 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |