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

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

Issue 10698153: Change comparison-to-branch fusion to actually remove comparison from the graph. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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
OLDNEW
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 2261 matching lines...) Expand 10 before | Expand all | Expand 10 after
2272 }; 2272 };
2273 2273
2274 2274
2275 class BranchInstr : public InstructionWithInputs { 2275 class BranchInstr : public InstructionWithInputs {
2276 public: 2276 public:
2277 explicit BranchInstr(Value* value) 2277 explicit BranchInstr(Value* value)
2278 : InstructionWithInputs(), 2278 : InstructionWithInputs(),
2279 value_(value), 2279 value_(value),
2280 true_successor_(NULL), 2280 true_successor_(NULL),
2281 false_successor_(NULL), 2281 false_successor_(NULL),
2282 is_fused_with_comparison_(false), 2282 fused_with_comparison_(NULL),
2283 is_negated_(false) { } 2283 is_negated_(false) { }
2284 2284
2285 DECLARE_INSTRUCTION(Branch) 2285 DECLARE_INSTRUCTION(Branch)
2286 2286
2287 Value* value() const { return value_; } 2287 Value* value() const { return value_; }
2288 TargetEntryInstr* true_successor() const { return true_successor_; } 2288 TargetEntryInstr* true_successor() const { return true_successor_; }
2289 TargetEntryInstr* false_successor() const { return false_successor_; } 2289 TargetEntryInstr* false_successor() const { return false_successor_; }
2290 2290
2291 TargetEntryInstr** true_successor_address() { return &true_successor_; } 2291 TargetEntryInstr** true_successor_address() { return &true_successor_; }
2292 TargetEntryInstr** false_successor_address() { return &false_successor_; } 2292 TargetEntryInstr** false_successor_address() { return &false_successor_; }
2293 2293
2294 virtual intptr_t SuccessorCount() const; 2294 virtual intptr_t SuccessorCount() const;
2295 virtual BlockEntryInstr* SuccessorAt(intptr_t index) const; 2295 virtual BlockEntryInstr* SuccessorAt(intptr_t index) const;
2296 2296
2297 virtual void DiscoverBlocks( 2297 virtual void DiscoverBlocks(
2298 BlockEntryInstr* current_block, 2298 BlockEntryInstr* current_block,
2299 GrowableArray<BlockEntryInstr*>* preorder, 2299 GrowableArray<BlockEntryInstr*>* preorder,
2300 GrowableArray<BlockEntryInstr*>* postorder, 2300 GrowableArray<BlockEntryInstr*>* postorder,
2301 GrowableArray<intptr_t>* parent, 2301 GrowableArray<intptr_t>* parent,
2302 GrowableArray<BitVector*>* assigned_vars, 2302 GrowableArray<BitVector*>* assigned_vars,
2303 intptr_t variable_count); 2303 intptr_t variable_count);
2304 2304
2305 virtual LocationSummary* MakeLocationSummary() const; 2305 virtual LocationSummary* MakeLocationSummary() const;
2306 2306
2307 virtual void EmitNativeCode(FlowGraphCompiler* compiler); 2307 virtual void EmitNativeCode(FlowGraphCompiler* compiler);
2308 2308
2309 void EmitBranchOnCondition(FlowGraphCompiler* compiler, 2309 void EmitBranchOnCondition(FlowGraphCompiler* compiler,
2310 Condition true_condition); 2310 Condition true_condition);
2311 2311
2312 void MarkFusedWithComparison() { 2312 void MarkFusedWithComparison(ComparisonComp* comp) {
2313 is_fused_with_comparison_ = true; 2313 fused_with_comparison_ = comp;
2314 } 2314 }
2315 2315
2316 bool is_fused_with_comparison() const { return is_fused_with_comparison_; } 2316 bool is_fused_with_comparison() const {
2317 return fused_with_comparison_ != NULL;
2318 }
2317 bool is_negated() const { return is_negated_; } 2319 bool is_negated() const { return is_negated_; }
2318 void set_is_negated(bool value) { is_negated_ = value; } 2320 void set_is_negated(bool value) { is_negated_ = value; }
2319 2321
2320 private: 2322 private:
2321 Value* value_; 2323 Value* value_;
2322 TargetEntryInstr* true_successor_; 2324 TargetEntryInstr* true_successor_;
2323 TargetEntryInstr* false_successor_; 2325 TargetEntryInstr* false_successor_;
2324 bool is_fused_with_comparison_; 2326 ComparisonComp* fused_with_comparison_;
2325 bool is_negated_; 2327 bool is_negated_;
2326 2328
2327 DISALLOW_COPY_AND_ASSIGN(BranchInstr); 2329 DISALLOW_COPY_AND_ASSIGN(BranchInstr);
2328 }; 2330 };
2329 2331
2330 2332
2331 class MoveOperands : public ValueObject { 2333 class MoveOperands : public ValueObject {
2332 public: 2334 public:
2333 MoveOperands(Location dest, Location src) : dest_(dest), src_(src) { } 2335 MoveOperands(Location dest, Location src) : dest_(dest), src_(src) { }
2334 2336
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
2412 const GrowableArray<BlockEntryInstr*>& block_order_; 2414 const GrowableArray<BlockEntryInstr*>& block_order_;
2413 2415
2414 private: 2416 private:
2415 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 2417 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
2416 }; 2418 };
2417 2419
2418 2420
2419 } // namespace dart 2421 } // namespace dart
2420 2422
2421 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 2423 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698