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

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

Issue 10832277: Eliminate condition type check when possible. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 DISALLOW_COPY_AND_ASSIGN(AssertAssignableComp); 447 DISALLOW_COPY_AND_ASSIGN(AssertAssignableComp);
448 }; 448 };
449 449
450 450
451 class AssertBooleanComp : public TemplateComputation<1> { 451 class AssertBooleanComp : public TemplateComputation<1> {
452 public: 452 public:
453 AssertBooleanComp(intptr_t token_pos, 453 AssertBooleanComp(intptr_t token_pos,
454 intptr_t try_index, 454 intptr_t try_index,
455 Value* value) 455 Value* value)
456 : token_pos_(token_pos), 456 : token_pos_(token_pos),
457 try_index_(try_index) { 457 try_index_(try_index),
458 eliminated_(false) {
458 ASSERT(value != NULL); 459 ASSERT(value != NULL);
459 inputs_[0] = value; 460 inputs_[0] = value;
460 } 461 }
461 462
462 DECLARE_COMPUTATION(AssertBoolean) 463 DECLARE_COMPUTATION(AssertBoolean)
463 464
464 intptr_t token_pos() const { return token_pos_; } 465 intptr_t token_pos() const { return token_pos_; }
465 intptr_t try_index() const { return try_index_; } 466 intptr_t try_index() const { return try_index_; }
466 Value* value() const { return inputs_[0]; } 467 Value* value() const { return inputs_[0]; }
467 468
469 bool IsEliminated() const {
srdjan 2012/08/13 22:14:18 s/IsEliminated/is_eliminated_.
regis 2012/08/13 22:23:49 Done.
470 return eliminated_;
471 }
472 void Eliminate() {
srdjan 2012/08/13 22:14:18 s/Eliminate/eliminate/
regis 2012/08/13 22:23:49 Done.
473 ASSERT(!eliminated_);
474 eliminated_ = true;
475 }
476
477 virtual void PrintOperandsTo(BufferFormatter* f) const;
478
468 virtual bool CanDeoptimize() const { return false; } 479 virtual bool CanDeoptimize() const { return false; }
469 480
470 private: 481 private:
471 const intptr_t token_pos_; 482 const intptr_t token_pos_;
472 const intptr_t try_index_; 483 const intptr_t try_index_;
484 bool eliminated_;
srdjan 2012/08/13 22:14:18 s/eliminated_/is_eleminated_/
regis 2012/08/13 22:23:49 Done.
473 485
474 DISALLOW_COPY_AND_ASSIGN(AssertBooleanComp); 486 DISALLOW_COPY_AND_ASSIGN(AssertBooleanComp);
475 }; 487 };
476 488
477 489
478 // Denotes the current context, normally held in a register. This is 490 // Denotes the current context, normally held in a register. This is
479 // a computation, not a value, because it's mutable. 491 // a computation, not a value, because it's mutable.
480 class CurrentContextComp : public TemplateComputation<0> { 492 class CurrentContextComp : public TemplateComputation<0> {
481 public: 493 public:
482 CurrentContextComp() { } 494 CurrentContextComp() { }
(...skipping 2410 matching lines...) Expand 10 before | Expand all | Expand 10 after
2893 const GrowableArray<BlockEntryInstr*>& block_order_; 2905 const GrowableArray<BlockEntryInstr*>& block_order_;
2894 2906
2895 private: 2907 private:
2896 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 2908 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
2897 }; 2909 };
2898 2910
2899 2911
2900 } // namespace dart 2912 } // namespace dart
2901 2913
2902 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 2914 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698