| 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_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 2294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2305 }; | 2305 }; |
| 2306 | 2306 |
| 2307 | 2307 |
| 2308 class BranchInstr : public InstructionWithInputs { | 2308 class BranchInstr : public InstructionWithInputs { |
| 2309 public: | 2309 public: |
| 2310 explicit BranchInstr(Value* value) | 2310 explicit BranchInstr(Value* value) |
| 2311 : InstructionWithInputs(), | 2311 : InstructionWithInputs(), |
| 2312 value_(value), | 2312 value_(value), |
| 2313 true_successor_(NULL), | 2313 true_successor_(NULL), |
| 2314 false_successor_(NULL), | 2314 false_successor_(NULL), |
| 2315 is_fused_with_comparison_(false) { } | 2315 is_fused_with_comparison_(false), |
| 2316 is_negated_(false) { } |
| 2316 | 2317 |
| 2317 DECLARE_INSTRUCTION(Branch) | 2318 DECLARE_INSTRUCTION(Branch) |
| 2318 | 2319 |
| 2319 Value* value() const { return value_; } | 2320 Value* value() const { return value_; } |
| 2320 TargetEntryInstr* true_successor() const { return true_successor_; } | 2321 TargetEntryInstr* true_successor() const { return true_successor_; } |
| 2321 TargetEntryInstr* false_successor() const { return false_successor_; } | 2322 TargetEntryInstr* false_successor() const { return false_successor_; } |
| 2322 | 2323 |
| 2323 TargetEntryInstr** true_successor_address() { return &true_successor_; } | 2324 TargetEntryInstr** true_successor_address() { return &true_successor_; } |
| 2324 TargetEntryInstr** false_successor_address() { return &false_successor_; } | 2325 TargetEntryInstr** false_successor_address() { return &false_successor_; } |
| 2325 | 2326 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 2342 virtual void EmitNativeCode(FlowGraphCompiler* compiler); | 2343 virtual void EmitNativeCode(FlowGraphCompiler* compiler); |
| 2343 | 2344 |
| 2344 void EmitBranchOnCondition(FlowGraphCompiler* compiler, | 2345 void EmitBranchOnCondition(FlowGraphCompiler* compiler, |
| 2345 Condition true_condition); | 2346 Condition true_condition); |
| 2346 | 2347 |
| 2347 void MarkFusedWithComparison() { | 2348 void MarkFusedWithComparison() { |
| 2348 is_fused_with_comparison_ = true; | 2349 is_fused_with_comparison_ = true; |
| 2349 } | 2350 } |
| 2350 | 2351 |
| 2351 bool is_fused_with_comparison() const { return is_fused_with_comparison_; } | 2352 bool is_fused_with_comparison() const { return is_fused_with_comparison_; } |
| 2353 bool is_negated() const { return is_negated_; } |
| 2354 void set_is_negated(bool value) { is_negated_ = value; } |
| 2352 | 2355 |
| 2353 private: | 2356 private: |
| 2354 Value* value_; | 2357 Value* value_; |
| 2355 TargetEntryInstr* true_successor_; | 2358 TargetEntryInstr* true_successor_; |
| 2356 TargetEntryInstr* false_successor_; | 2359 TargetEntryInstr* false_successor_; |
| 2357 bool is_fused_with_comparison_; | 2360 bool is_fused_with_comparison_; |
| 2361 bool is_negated_; |
| 2358 | 2362 |
| 2359 DISALLOW_COPY_AND_ASSIGN(BranchInstr); | 2363 DISALLOW_COPY_AND_ASSIGN(BranchInstr); |
| 2360 }; | 2364 }; |
| 2361 | 2365 |
| 2362 #undef DECLARE_INSTRUCTION | 2366 #undef DECLARE_INSTRUCTION |
| 2363 | 2367 |
| 2364 | 2368 |
| 2365 // Visitor base class to visit each instruction and computation in a flow | 2369 // Visitor base class to visit each instruction and computation in a flow |
| 2366 // graph as defined by a reversed list of basic blocks. | 2370 // graph as defined by a reversed list of basic blocks. |
| 2367 class FlowGraphVisitor : public ValueObject { | 2371 class FlowGraphVisitor : public ValueObject { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 2392 const GrowableArray<BlockEntryInstr*>& block_order_; | 2396 const GrowableArray<BlockEntryInstr*>& block_order_; |
| 2393 | 2397 |
| 2394 private: | 2398 private: |
| 2395 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 2399 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 2396 }; | 2400 }; |
| 2397 | 2401 |
| 2398 | 2402 |
| 2399 } // namespace dart | 2403 } // namespace dart |
| 2400 | 2404 |
| 2401 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 2405 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |