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

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

Issue 11232063: Enable merging of comparisons into branches in checked mode. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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 1466 matching lines...) Expand 10 before | Expand all | Expand 10 after
1477 private: 1477 private:
1478 TargetEntryInstr* true_successor_; 1478 TargetEntryInstr* true_successor_;
1479 TargetEntryInstr* false_successor_; 1479 TargetEntryInstr* false_successor_;
1480 1480
1481 DISALLOW_COPY_AND_ASSIGN(ControlInstruction); 1481 DISALLOW_COPY_AND_ASSIGN(ControlInstruction);
1482 }; 1482 };
1483 1483
1484 1484
1485 class BranchInstr : public ControlInstruction { 1485 class BranchInstr : public ControlInstruction {
1486 public: 1486 public:
1487 explicit BranchInstr(ComparisonInstr* comparison) 1487 explicit BranchInstr(ComparisonInstr* comparison, bool is_checked = false)
1488 : comparison_(comparison) { } 1488 : comparison_(comparison), is_checked_(is_checked) { }
1489 1489
1490 DECLARE_INSTRUCTION(Branch) 1490 DECLARE_INSTRUCTION(Branch)
1491 1491
1492 virtual intptr_t ArgumentCount() const; 1492 virtual intptr_t ArgumentCount() const;
1493 intptr_t InputCount() const; 1493 intptr_t InputCount() const;
1494 Value* InputAt(intptr_t i) const; 1494 Value* InputAt(intptr_t i) const;
1495 void SetInputAt(intptr_t i, Value* value); 1495 void SetInputAt(intptr_t i, Value* value);
1496 virtual bool CanDeoptimize() const; 1496 virtual bool CanDeoptimize() const;
1497 1497
1498 virtual bool HasSideEffect() const; 1498 virtual bool HasSideEffect() const;
1499 1499
1500 ComparisonInstr* comparison() const { return comparison_; } 1500 ComparisonInstr* comparison() const { return comparison_; }
1501 void set_comparison(ComparisonInstr* value) { comparison_ = value; } 1501 void set_comparison(ComparisonInstr* value) { comparison_ = value; }
1502 1502
1503 bool is_checked() const { return is_checked_; }
1504
1503 virtual LocationSummary* locs(); 1505 virtual LocationSummary* locs();
1504 virtual intptr_t DeoptimizationTarget() const; 1506 virtual intptr_t DeoptimizationTarget() const;
1505 virtual Representation RequiredInputRepresentation(intptr_t i) const; 1507 virtual Representation RequiredInputRepresentation(intptr_t i) const;
1506 1508
1507 // Replace the comparison with another, leaving the branch intact. 1509 // Replace the comparison with another, leaving the branch intact.
1508 void ReplaceWith(ComparisonInstr* other, 1510 void ReplaceWith(ComparisonInstr* other,
1509 ForwardInstructionIterator* ignored) { 1511 ForwardInstructionIterator* ignored) {
1510 comparison_ = other; 1512 comparison_ = other;
1511 } 1513 }
1512 1514
1513 virtual void PrintTo(BufferFormatter* f) const; 1515 virtual void PrintTo(BufferFormatter* f) const;
1514 1516
1515 private: 1517 private:
1516 ComparisonInstr* comparison_; 1518 ComparisonInstr* comparison_;
1519 bool is_checked_;
srdjan 2012/10/23 18:06:06 const
Florian Schneider 2012/10/24 13:02:09 Done.
1517 1520
1518 DISALLOW_COPY_AND_ASSIGN(BranchInstr); 1521 DISALLOW_COPY_AND_ASSIGN(BranchInstr);
1519 }; 1522 };
1520 1523
1521 1524
1522 class StoreContextInstr : public TemplateInstruction<1> { 1525 class StoreContextInstr : public TemplateInstruction<1> {
1523 public: 1526 public:
1524 explicit StoreContextInstr(Value* value) { 1527 explicit StoreContextInstr(Value* value) {
1525 ASSERT(value != NULL); 1528 ASSERT(value != NULL);
1526 inputs_[0] = value; 1529 inputs_[0] = value;
(...skipping 2720 matching lines...) Expand 10 before | Expand all | Expand 10 after
4247 ForwardInstructionIterator* current_iterator_; 4250 ForwardInstructionIterator* current_iterator_;
4248 4251
4249 private: 4252 private:
4250 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 4253 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
4251 }; 4254 };
4252 4255
4253 4256
4254 } // namespace dart 4257 } // namespace dart
4255 4258
4256 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 4259 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698