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

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

Issue 12298034: Copy propagated type info when inserting conversion. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 void Advance() { 217 void Advance() {
218 // Pre-fetch next on advance and cache it. 218 // Pre-fetch next on advance and cache it.
219 current_ = next_; 219 current_ = next_;
220 if (next_ != NULL) next_ = next_->next_use(); 220 if (next_ != NULL) next_ = next_->next_use();
221 } 221 }
222 private: 222 private:
223 Value* current_; 223 Value* current_;
224 Value* next_; 224 Value* next_;
225 }; 225 };
226 226
227 explicit Value(Definition* definition) 227 explicit Value(Definition* definition, CompileType* type = NULL)
228 : definition_(definition), 228 : definition_(definition),
229 previous_use_(NULL), 229 previous_use_(NULL),
230 next_use_(NULL), 230 next_use_(NULL),
231 instruction_(NULL), 231 instruction_(NULL),
232 use_index_(-1), 232 use_index_(-1),
233 reaching_type_(NULL) { } 233 reaching_type_(type) { }
234 234
235 Definition* definition() const { return definition_; } 235 Definition* definition() const { return definition_; }
236 void set_definition(Definition* definition) { definition_ = definition; } 236 void set_definition(Definition* definition) { definition_ = definition; }
237 237
238 Value* previous_use() const { return previous_use_; } 238 Value* previous_use() const { return previous_use_; }
239 void set_previous_use(Value* previous) { previous_use_ = previous; } 239 void set_previous_use(Value* previous) { previous_use_ = previous; }
240 240
241 Value* next_use() const { return next_use_; } 241 Value* next_use() const { return next_use_; }
242 void set_next_use(Value* next) { next_use_ = next; } 242 void set_next_use(Value* next) { next_use_ = next; }
243 243
244 Instruction* instruction() const { return instruction_; } 244 Instruction* instruction() const { return instruction_; }
245 void set_instruction(Instruction* instruction) { instruction_ = instruction; } 245 void set_instruction(Instruction* instruction) { instruction_ = instruction; }
246 246
247 intptr_t use_index() const { return use_index_; } 247 intptr_t use_index() const { return use_index_; }
248 void set_use_index(intptr_t index) { use_index_ = index; } 248 void set_use_index(intptr_t index) { use_index_ = index; }
249 249
250 static void AddToList(Value* value, Value** list); 250 static void AddToList(Value* value, Value** list);
251 void RemoveFromUseList(); 251 void RemoveFromUseList();
252 252
253 Value* Copy() { return new Value(definition_); } 253 Value* Copy() {return new Value(definition_); }
254
255 Value* CopyWithType() {return new Value(definition_, reaching_type_); }
Vyacheslav Egorov (Google) 2013/02/19 14:45:49 Please add a comment here that CopyWithType should
Florian Schneider 2013/02/19 15:02:06 Done.
254 256
255 CompileType* Type(); 257 CompileType* Type();
256 258
257 void SetReachingType(CompileType* type) { 259 void SetReachingType(CompileType* type) {
258 reaching_type_ = type; 260 reaching_type_ = type;
259 } 261 }
260 262
261 void PrintTo(BufferFormatter* f) const; 263 void PrintTo(BufferFormatter* f) const;
262 264
263 const char* DebugName() const { return "Value"; } 265 const char* DebugName() const { return "Value"; }
(...skipping 4200 matching lines...) Expand 10 before | Expand all | Expand 10 after
4464 ForwardInstructionIterator* current_iterator_; 4466 ForwardInstructionIterator* current_iterator_;
4465 4467
4466 private: 4468 private:
4467 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 4469 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
4468 }; 4470 };
4469 4471
4470 4472
4471 } // namespace dart 4473 } // namespace dart
4472 4474
4473 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 4475 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698