| 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 1356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1367 }; | 1367 }; |
| 1368 | 1368 |
| 1369 | 1369 |
| 1370 class LoadVMFieldComp : public TemplateComputation<1> { | 1370 class LoadVMFieldComp : public TemplateComputation<1> { |
| 1371 public: | 1371 public: |
| 1372 LoadVMFieldComp(Value* value, | 1372 LoadVMFieldComp(Value* value, |
| 1373 intptr_t offset_in_bytes, | 1373 intptr_t offset_in_bytes, |
| 1374 const AbstractType& type) | 1374 const AbstractType& type) |
| 1375 : offset_in_bytes_(offset_in_bytes), | 1375 : offset_in_bytes_(offset_in_bytes), |
| 1376 type_(type), | 1376 type_(type), |
| 1377 result_cid_(kDynamicCid), | 1377 result_cid_(kDynamicCid) { |
| 1378 original_(NULL) { | |
| 1379 ASSERT(value != NULL); | 1378 ASSERT(value != NULL); |
| 1380 ASSERT(type.IsZoneHandle()); // May be null if field is not an instance. | 1379 ASSERT(type.IsZoneHandle()); // May be null if field is not an instance. |
| 1381 inputs_[0] = value; | 1380 inputs_[0] = value; |
| 1382 } | 1381 } |
| 1383 | 1382 |
| 1384 DECLARE_COMPUTATION(LoadVMField) | 1383 DECLARE_COMPUTATION(LoadVMField) |
| 1385 | 1384 |
| 1386 Value* value() const { return inputs_[0]; } | 1385 Value* value() const { return inputs_[0]; } |
| 1387 intptr_t offset_in_bytes() const { return offset_in_bytes_; } | 1386 intptr_t offset_in_bytes() const { return offset_in_bytes_; } |
| 1388 const AbstractType& type() const { return type_; } | 1387 const AbstractType& type() const { return type_; } |
| 1389 const InstanceCallComp* original() const { return original_; } | |
| 1390 void set_original(InstanceCallComp* value) { original_ = value; } | |
| 1391 void set_result_cid(intptr_t value) { result_cid_ = value; } | 1388 void set_result_cid(intptr_t value) { result_cid_ = value; } |
| 1392 | 1389 |
| 1393 virtual void PrintOperandsTo(BufferFormatter* f) const; | 1390 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 1394 | 1391 |
| 1395 virtual bool CanDeoptimize() const { return true; } | 1392 virtual bool CanDeoptimize() const { return false; } |
| 1396 virtual intptr_t ResultCid() const { return result_cid_; } | 1393 virtual intptr_t ResultCid() const { return result_cid_; } |
| 1397 | 1394 |
| 1398 private: | 1395 private: |
| 1399 const intptr_t offset_in_bytes_; | 1396 const intptr_t offset_in_bytes_; |
| 1400 const AbstractType& type_; | 1397 const AbstractType& type_; |
| 1401 intptr_t result_cid_; | 1398 intptr_t result_cid_; |
| 1402 const InstanceCallComp* original_; // For optimizations. | |
| 1403 // If non-NULL, the instruction is valid only for the class ids listed. | |
| 1404 | 1399 |
| 1405 DISALLOW_COPY_AND_ASSIGN(LoadVMFieldComp); | 1400 DISALLOW_COPY_AND_ASSIGN(LoadVMFieldComp); |
| 1406 }; | 1401 }; |
| 1407 | 1402 |
| 1408 | 1403 |
| 1409 class StoreVMFieldComp : public TemplateComputation<2> { | 1404 class StoreVMFieldComp : public TemplateComputation<2> { |
| 1410 public: | 1405 public: |
| 1411 StoreVMFieldComp(Value* dest, | 1406 StoreVMFieldComp(Value* dest, |
| 1412 intptr_t offset_in_bytes, | 1407 intptr_t offset_in_bytes, |
| 1413 Value* value, | 1408 Value* value, |
| (...skipping 1848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3262 ForwardInstructionIterator* current_iterator_; | 3257 ForwardInstructionIterator* current_iterator_; |
| 3263 | 3258 |
| 3264 private: | 3259 private: |
| 3265 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 3260 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 3266 }; | 3261 }; |
| 3267 | 3262 |
| 3268 | 3263 |
| 3269 } // namespace dart | 3264 } // namespace dart |
| 3270 | 3265 |
| 3271 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 3266 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |