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

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

Issue 938783003: Don't constant fold operation if result is incompatible with it. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Work-around quasi-missing deopt environments Created 5 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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 285
286 explicit Value(Definition* definition) 286 explicit Value(Definition* definition)
287 : definition_(definition), 287 : definition_(definition),
288 previous_use_(NULL), 288 previous_use_(NULL),
289 next_use_(NULL), 289 next_use_(NULL),
290 instruction_(NULL), 290 instruction_(NULL),
291 use_index_(-1), 291 use_index_(-1),
292 reaching_type_(NULL) { } 292 reaching_type_(NULL) { }
293 293
294 Definition* definition() const { return definition_; } 294 Definition* definition() const { return definition_; }
295 void set_definition(Definition* definition) { definition_ = definition; } 295 void set_definition(Definition* definition) {
296 if ((definition_ != NULL) && (reaching_type_ != NULL)) {
297 UpdateReachingType(definition);
298 }
299 definition_ = definition;
300 }
296 301
297 Value* previous_use() const { return previous_use_; } 302 Value* previous_use() const { return previous_use_; }
298 void set_previous_use(Value* previous) { previous_use_ = previous; } 303 void set_previous_use(Value* previous) { previous_use_ = previous; }
299 304
300 Value* next_use() const { return next_use_; } 305 Value* next_use() const { return next_use_; }
301 void set_next_use(Value* next) { next_use_ = next; } 306 void set_next_use(Value* next) { next_use_ = next; }
302 307
303 bool IsSingleUse() const { 308 bool IsSingleUse() const {
304 return (next_use_ == NULL) && (previous_use_ == NULL); 309 return (next_use_ == NULL) && (previous_use_ == NULL);
305 } 310 }
(...skipping 16 matching lines...) Expand all
322 // This function must only be used when the new Value is dominated by 327 // This function must only be used when the new Value is dominated by
323 // the original Value. 328 // the original Value.
324 Value* CopyWithType() { 329 Value* CopyWithType() {
325 Value* copy = new Value(definition_); 330 Value* copy = new Value(definition_);
326 copy->reaching_type_ = reaching_type_; 331 copy->reaching_type_ = reaching_type_;
327 return copy; 332 return copy;
328 } 333 }
329 334
330 CompileType* Type(); 335 CompileType* Type();
331 336
337 void UpdateReachingType(Definition* new_definition);
338
332 void SetReachingType(CompileType* type) { 339 void SetReachingType(CompileType* type) {
333 reaching_type_ = type; 340 reaching_type_ = type;
334 } 341 }
335 342
336 void PrintTo(BufferFormatter* f) const; 343 void PrintTo(BufferFormatter* f) const;
337 344
338 const char* DebugName() const { return "Value"; } 345 const char* DebugName() const { return "Value"; }
339 346
340 bool IsSmiValue() { return Type()->ToCid() == kSmiCid; } 347 bool IsSmiValue() { return Type()->ToCid() == kSmiCid; }
341 348
(...skipping 7724 matching lines...) Expand 10 before | Expand all | Expand 10 after
8066 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \ 8073 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \
8067 UNIMPLEMENTED(); \ 8074 UNIMPLEMENTED(); \
8068 return NULL; \ 8075 return NULL; \
8069 } \ 8076 } \
8070 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } 8077 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); }
8071 8078
8072 8079
8073 } // namespace dart 8080 } // namespace dart
8074 8081
8075 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 8082 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698