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

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

Issue 10942006: Fix bad optimization of instance-of with uninstantiated types (issue 5216). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language.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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 82
83 Value* Copy() { return new Value(definition_); } 83 Value* Copy() { return new Value(definition_); }
84 84
85 RawAbstractType* CompileType() const; 85 RawAbstractType* CompileType() const;
86 intptr_t ResultCid() const; 86 intptr_t ResultCid() const;
87 87
88 void PrintTo(BufferFormatter* f) const; 88 void PrintTo(BufferFormatter* f) const;
89 89
90 const char* DebugName() const { return "Value"; } 90 const char* DebugName() const { return "Value"; }
91 91
92 // Returns true if the value represents a constant. 92 // Return true if the value represents a constant.
93 bool BindsToConstant() const; 93 bool BindsToConstant() const;
94 94
95 // Returns true if the value represents the constant null. 95 // Return true if the value represents the constant null.
96 bool BindsToConstantNull() const; 96 bool BindsToConstantNull() const;
97 97
98 // Assert if BindsToConstant() is false, otherwise returns the constant value. 98 // Assert if BindsToConstant() is false, otherwise returns the constant value.
99 const Object& BoundConstant() const; 99 const Object& BoundConstant() const;
100 100
101 // Reminder: The type of the constant null is the bottom type, which is more 101 // Compute a run-time null test at compile-time and set result in is_null.
102 // specific than any type. 102 // Return false if the computation is not possible at compile time.
103 bool CompileTypeIsMoreSpecificThan(const AbstractType& dst_type) const; 103 bool CanComputeIsNull(bool* is_null) const;
104
105 // Compute a run-time type test at compile-time and set result in is_instance.
106 // Return false if the computation is not possible at compile time.
107 bool CanComputeIsInstanceOf(const AbstractType& type,
108 bool* is_instance) const;
104 109
105 // Compile time constants, Bool, Smi and Nulls do not need to update 110 // Compile time constants, Bool, Smi and Nulls do not need to update
106 // the store buffer. 111 // the store buffer.
107 bool NeedsStoreBuffer() const; 112 bool NeedsStoreBuffer() const;
108 113
109 bool Equals(Value* other) const; 114 bool Equals(Value* other) const;
110 115
111 void set_reaching_cid(intptr_t cid) { reaching_cid_ = cid; } 116 void set_reaching_cid(intptr_t cid) { reaching_cid_ = cid; }
112 intptr_t reaching_cid() const { return reaching_cid_; } 117 intptr_t reaching_cid() const { return reaching_cid_; }
113 118
(...skipping 3554 matching lines...) Expand 10 before | Expand all | Expand 10 after
3668 ForwardInstructionIterator* current_iterator_; 3673 ForwardInstructionIterator* current_iterator_;
3669 3674
3670 private: 3675 private:
3671 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 3676 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
3672 }; 3677 };
3673 3678
3674 3679
3675 } // namespace dart 3680 } // namespace dart
3676 3681
3677 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 3682 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698