| OLD | NEW |
| 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 1380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1391 }; | 1391 }; |
| 1392 | 1392 |
| 1393 | 1393 |
| 1394 class LoadVMFieldComp : public TemplateComputation<1> { | 1394 class LoadVMFieldComp : public TemplateComputation<1> { |
| 1395 public: | 1395 public: |
| 1396 LoadVMFieldComp(Value* value, | 1396 LoadVMFieldComp(Value* value, |
| 1397 intptr_t offset_in_bytes, | 1397 intptr_t offset_in_bytes, |
| 1398 const AbstractType& type) | 1398 const AbstractType& type) |
| 1399 : offset_in_bytes_(offset_in_bytes), | 1399 : offset_in_bytes_(offset_in_bytes), |
| 1400 type_(type), | 1400 type_(type), |
| 1401 result_cid_(kDynamicCid), |
| 1401 original_(NULL) { | 1402 original_(NULL) { |
| 1402 ASSERT(value != NULL); | 1403 ASSERT(value != NULL); |
| 1403 ASSERT(type.IsZoneHandle()); // May be null if field is not an instance. | 1404 ASSERT(type.IsZoneHandle()); // May be null if field is not an instance. |
| 1404 inputs_[0] = value; | 1405 inputs_[0] = value; |
| 1405 } | 1406 } |
| 1406 | 1407 |
| 1407 DECLARE_COMPUTATION(LoadVMField) | 1408 DECLARE_COMPUTATION(LoadVMField) |
| 1408 | 1409 |
| 1409 Value* value() const { return inputs_[0]; } | 1410 Value* value() const { return inputs_[0]; } |
| 1410 intptr_t offset_in_bytes() const { return offset_in_bytes_; } | 1411 intptr_t offset_in_bytes() const { return offset_in_bytes_; } |
| 1411 const AbstractType& type() const { return type_; } | 1412 const AbstractType& type() const { return type_; } |
| 1412 const InstanceCallComp* original() const { return original_; } | 1413 const InstanceCallComp* original() const { return original_; } |
| 1413 void set_original(InstanceCallComp* value) { original_ = value; } | 1414 void set_original(InstanceCallComp* value) { original_ = value; } |
| 1415 void set_result_cid(intptr_t value) { result_cid_ = value; } |
| 1414 | 1416 |
| 1415 virtual void PrintOperandsTo(BufferFormatter* f) const; | 1417 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 1416 | 1418 |
| 1417 virtual bool CanDeoptimize() const { return true; } | 1419 virtual bool CanDeoptimize() const { return true; } |
| 1420 virtual intptr_t ResultCid() const { return result_cid_; } |
| 1418 | 1421 |
| 1419 private: | 1422 private: |
| 1420 const intptr_t offset_in_bytes_; | 1423 const intptr_t offset_in_bytes_; |
| 1421 const AbstractType& type_; | 1424 const AbstractType& type_; |
| 1425 intptr_t result_cid_; |
| 1422 const InstanceCallComp* original_; // For optimizations. | 1426 const InstanceCallComp* original_; // For optimizations. |
| 1423 // If non-NULL, the instruction is valid only for the class ids listed. | 1427 // If non-NULL, the instruction is valid only for the class ids listed. |
| 1424 | 1428 |
| 1425 DISALLOW_COPY_AND_ASSIGN(LoadVMFieldComp); | 1429 DISALLOW_COPY_AND_ASSIGN(LoadVMFieldComp); |
| 1426 }; | 1430 }; |
| 1427 | 1431 |
| 1428 | 1432 |
| 1429 class StoreVMFieldComp : public TemplateComputation<2> { | 1433 class StoreVMFieldComp : public TemplateComputation<2> { |
| 1430 public: | 1434 public: |
| 1431 StoreVMFieldComp(Value* dest, | 1435 StoreVMFieldComp(Value* dest, |
| (...skipping 1720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3152 ForwardInstructionIterator* current_iterator_; | 3156 ForwardInstructionIterator* current_iterator_; |
| 3153 | 3157 |
| 3154 private: | 3158 private: |
| 3155 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 3159 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 3156 }; | 3160 }; |
| 3157 | 3161 |
| 3158 | 3162 |
| 3159 } // namespace dart | 3163 } // namespace dart |
| 3160 | 3164 |
| 3161 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 3165 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |