OLD | NEW |
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_FLOW_GRAPH_COMPILER_H_ | 5 #ifndef VM_FLOW_GRAPH_COMPILER_H_ |
6 #define VM_FLOW_GRAPH_COMPILER_H_ | 6 #define VM_FLOW_GRAPH_COMPILER_H_ |
7 | 7 |
8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
10 #include "vm/code_descriptors.h" | 10 #include "vm/code_descriptors.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 | 74 |
75 RawDeoptInfo* CreateDeoptInfo(FlowGraphCompiler* compiler, | 75 RawDeoptInfo* CreateDeoptInfo(FlowGraphCompiler* compiler, |
76 DeoptInfoBuilder* builder); | 76 DeoptInfoBuilder* builder); |
77 | 77 |
78 void AllocateIncomingParametersRecursive(Environment* env, | 78 void AllocateIncomingParametersRecursive(Environment* env, |
79 intptr_t* stack_height); | 79 intptr_t* stack_height); |
80 | 80 |
81 // No code needs to be generated. | 81 // No code needs to be generated. |
82 virtual void GenerateCode(FlowGraphCompiler* compiler, intptr_t stub_ix) {} | 82 virtual void GenerateCode(FlowGraphCompiler* compiler, intptr_t stub_ix) {} |
83 | 83 |
84 // Builds deopt-after continuation point. | |
85 virtual void BuildReturnAddress(DeoptInfoBuilder* builder, | |
86 const Function& function, | |
87 intptr_t slot_ix); | |
88 | |
89 intptr_t pc_offset() const { return pc_offset_; } | 84 intptr_t pc_offset() const { return pc_offset_; } |
90 void set_pc_offset(intptr_t offset) { pc_offset_ = offset; } | 85 void set_pc_offset(intptr_t offset) { pc_offset_ = offset; } |
91 | 86 |
92 intptr_t deopt_id() const { return deopt_id_; } | 87 intptr_t deopt_id() const { return deopt_id_; } |
93 | 88 |
94 DeoptReasonId reason() const { return reason_; } | 89 DeoptReasonId reason() const { return reason_; } |
95 | 90 |
96 const Environment* deoptimization_env() const { return deoptimization_env_; } | 91 const Environment* deoptimization_env() const { return deoptimization_env_; } |
97 void set_deoptimization_env(Environment* env) { deoptimization_env_ = env; } | 92 void set_deoptimization_env(Environment* env) { deoptimization_env_ = env; } |
98 | 93 |
(...skipping 13 matching lines...) Expand all Loading... |
112 DeoptReasonId reason) | 107 DeoptReasonId reason) |
113 : CompilerDeoptInfo(deopt_id, reason), entry_label_() { | 108 : CompilerDeoptInfo(deopt_id, reason), entry_label_() { |
114 ASSERT(reason != kDeoptAtCall); | 109 ASSERT(reason != kDeoptAtCall); |
115 } | 110 } |
116 | 111 |
117 Label* entry_label() { return &entry_label_; } | 112 Label* entry_label() { return &entry_label_; } |
118 | 113 |
119 // Implementation is in architecture specific file. | 114 // Implementation is in architecture specific file. |
120 virtual void GenerateCode(FlowGraphCompiler* compiler, intptr_t stub_ix); | 115 virtual void GenerateCode(FlowGraphCompiler* compiler, intptr_t stub_ix); |
121 | 116 |
122 // Builds deopt-before continuation point. | |
123 virtual void BuildReturnAddress(DeoptInfoBuilder* builder, | |
124 const Function& function, | |
125 intptr_t slot_ix); | |
126 | |
127 private: | 117 private: |
128 Label entry_label_; | 118 Label entry_label_; |
129 | 119 |
130 DISALLOW_COPY_AND_ASSIGN(CompilerDeoptInfoWithStub); | 120 DISALLOW_COPY_AND_ASSIGN(CompilerDeoptInfoWithStub); |
131 }; | 121 }; |
132 | 122 |
133 | 123 |
134 class SlowPathCode : public ZoneAllocated { | 124 class SlowPathCode : public ZoneAllocated { |
135 public: | 125 public: |
136 SlowPathCode() : entry_label_(), exit_label_() { } | 126 SlowPathCode() : entry_label_(), exit_label_() { } |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 // that should be used when deoptimizing we store it in this variable. | 537 // that should be used when deoptimizing we store it in this variable. |
548 // In future AddDeoptStub should be moved out of the instruction template. | 538 // In future AddDeoptStub should be moved out of the instruction template. |
549 Environment* pending_deoptimization_env_; | 539 Environment* pending_deoptimization_env_; |
550 | 540 |
551 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler); | 541 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler); |
552 }; | 542 }; |
553 | 543 |
554 } // namespace dart | 544 } // namespace dart |
555 | 545 |
556 #endif // VM_FLOW_GRAPH_COMPILER_H_ | 546 #endif // VM_FLOW_GRAPH_COMPILER_H_ |
OLD | NEW |