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 RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_ | 5 #ifndef RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_ |
6 #define RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_ | 6 #define RUNTIME_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 7248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7259 | 7259 |
7260 private: | 7260 private: |
7261 const Token::Kind op_kind_; | 7261 const Token::Kind op_kind_; |
7262 | 7262 |
7263 DISALLOW_COPY_AND_ASSIGN(UnaryDoubleOpInstr); | 7263 DISALLOW_COPY_AND_ASSIGN(UnaryDoubleOpInstr); |
7264 }; | 7264 }; |
7265 | 7265 |
7266 | 7266 |
7267 class CheckStackOverflowInstr : public TemplateInstruction<0, NoThrow> { | 7267 class CheckStackOverflowInstr : public TemplateInstruction<0, NoThrow> { |
7268 public: | 7268 public: |
| 7269 enum Kind { |
| 7270 // Full stack overflow checks are emitted in both unoptimized and |
| 7271 // optimized versions of the code. |
| 7272 kFull, |
| 7273 |
| 7274 // OsrEntry stack overflow checks are only needed in the unoptimized code |
| 7275 // because we can't OSR optimized code. |
| 7276 kOsrEntry, |
| 7277 }; |
| 7278 |
7269 CheckStackOverflowInstr(TokenPosition token_pos, | 7279 CheckStackOverflowInstr(TokenPosition token_pos, |
7270 intptr_t loop_depth, | 7280 intptr_t loop_depth, |
7271 intptr_t deopt_id) | 7281 intptr_t deopt_id, |
| 7282 Kind kind = kFull) |
7272 : TemplateInstruction(deopt_id), | 7283 : TemplateInstruction(deopt_id), |
7273 token_pos_(token_pos), | 7284 token_pos_(token_pos), |
7274 loop_depth_(loop_depth) {} | 7285 loop_depth_(loop_depth), |
| 7286 kind_(kind) { |
| 7287 ASSERT(kind != kOsrEntry || loop_depth > 0); |
| 7288 } |
7275 | 7289 |
7276 virtual TokenPosition token_pos() const { return token_pos_; } | 7290 virtual TokenPosition token_pos() const { return token_pos_; } |
7277 bool in_loop() const { return loop_depth_ > 0; } | 7291 bool in_loop() const { return loop_depth_ > 0; } |
7278 intptr_t loop_depth() const { return loop_depth_; } | 7292 intptr_t loop_depth() const { return loop_depth_; } |
7279 | 7293 |
7280 DECLARE_INSTRUCTION(CheckStackOverflow) | 7294 DECLARE_INSTRUCTION(CheckStackOverflow) |
7281 | 7295 |
7282 virtual bool ComputeCanDeoptimize() const { return true; } | 7296 virtual bool ComputeCanDeoptimize() const { return true; } |
7283 | 7297 |
| 7298 virtual Instruction* Canonicalize(FlowGraph* flow_graph); |
| 7299 |
7284 virtual EffectSet Effects() const { return EffectSet::None(); } | 7300 virtual EffectSet Effects() const { return EffectSet::None(); } |
7285 | 7301 |
7286 PRINT_OPERANDS_TO_SUPPORT | 7302 PRINT_OPERANDS_TO_SUPPORT |
7287 | 7303 |
7288 private: | 7304 private: |
7289 const TokenPosition token_pos_; | 7305 const TokenPosition token_pos_; |
7290 const intptr_t loop_depth_; | 7306 const intptr_t loop_depth_; |
| 7307 const Kind kind_; |
7291 | 7308 |
7292 DISALLOW_COPY_AND_ASSIGN(CheckStackOverflowInstr); | 7309 DISALLOW_COPY_AND_ASSIGN(CheckStackOverflowInstr); |
7293 }; | 7310 }; |
7294 | 7311 |
7295 | 7312 |
7296 // TODO(vegorov): remove this instruction in favor of Int32ToDouble. | 7313 // TODO(vegorov): remove this instruction in favor of Int32ToDouble. |
7297 class SmiToDoubleInstr : public TemplateDefinition<1, NoThrow, Pure> { | 7314 class SmiToDoubleInstr : public TemplateDefinition<1, NoThrow, Pure> { |
7298 public: | 7315 public: |
7299 SmiToDoubleInstr(Value* value, TokenPosition token_pos) | 7316 SmiToDoubleInstr(Value* value, TokenPosition token_pos) |
7300 : token_pos_(token_pos) { | 7317 : token_pos_(token_pos) { |
(...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8235 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \ | 8252 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \ |
8236 UNIMPLEMENTED(); \ | 8253 UNIMPLEMENTED(); \ |
8237 return NULL; \ | 8254 return NULL; \ |
8238 } \ | 8255 } \ |
8239 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } | 8256 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } |
8240 | 8257 |
8241 | 8258 |
8242 } // namespace dart | 8259 } // namespace dart |
8243 | 8260 |
8244 #endif // RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_ | 8261 #endif // RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_ |
OLD | NEW |