OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // Review notes: | 5 // Review notes: |
6 // | 6 // |
7 // - The use of macros in these inline functions may seem superfluous | 7 // - The use of macros in these inline functions may seem superfluous |
8 // but it is absolutely needed to make sure gcc generates optimal | 8 // but it is absolutely needed to make sure gcc generates optimal |
9 // code. gcc is not happy when attempting to inline too deep. | 9 // code. gcc is not happy when attempting to inline too deep. |
10 // | 10 // |
(...skipping 1531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1542 // Only the former two contain raw values and no heap pointers (besides the | 1542 // Only the former two contain raw values and no heap pointers (besides the |
1543 // map-word). | 1543 // map-word). |
1544 return ((type & kIsIndirectStringMask) != kIsIndirectStringTag); | 1544 return ((type & kIsIndirectStringMask) != kIsIndirectStringTag); |
1545 } | 1545 } |
1546 // The ConstantPoolArray contains heap pointers, but also raw values. | 1546 // The ConstantPoolArray contains heap pointers, but also raw values. |
1547 if (type == CONSTANT_POOL_ARRAY_TYPE) return true; | 1547 if (type == CONSTANT_POOL_ARRAY_TYPE) return true; |
1548 return (type <= LAST_DATA_TYPE); | 1548 return (type <= LAST_DATA_TYPE); |
1549 } | 1549 } |
1550 | 1550 |
1551 | 1551 |
| 1552 bool HeapObject::MayContainMixedValues() { |
| 1553 InstanceType type = map()->instance_type(); |
| 1554 switch (type) { |
| 1555 case CONSTANT_POOL_ARRAY_TYPE: |
| 1556 case JS_FUNCTION_TYPE: |
| 1557 return true; |
| 1558 default: |
| 1559 if (type >= FIRST_FIXED_TYPED_ARRAY_TYPE && |
| 1560 type <= LAST_FIXED_TYPED_ARRAY_TYPE) { |
| 1561 return true; |
| 1562 } |
| 1563 return false; |
| 1564 } |
| 1565 } |
| 1566 |
| 1567 |
1552 void HeapObject::IteratePointers(ObjectVisitor* v, int start, int end) { | 1568 void HeapObject::IteratePointers(ObjectVisitor* v, int start, int end) { |
1553 v->VisitPointers(reinterpret_cast<Object**>(FIELD_ADDR(this, start)), | 1569 v->VisitPointers(reinterpret_cast<Object**>(FIELD_ADDR(this, start)), |
1554 reinterpret_cast<Object**>(FIELD_ADDR(this, end))); | 1570 reinterpret_cast<Object**>(FIELD_ADDR(this, end))); |
1555 } | 1571 } |
1556 | 1572 |
1557 | 1573 |
1558 void HeapObject::IteratePointer(ObjectVisitor* v, int offset) { | 1574 void HeapObject::IteratePointer(ObjectVisitor* v, int offset) { |
1559 v->VisitPointer(reinterpret_cast<Object**>(FIELD_ADDR(this, offset))); | 1575 v->VisitPointer(reinterpret_cast<Object**>(FIELD_ADDR(this, offset))); |
1560 } | 1576 } |
1561 | 1577 |
(...skipping 6055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7617 #undef READ_SHORT_FIELD | 7633 #undef READ_SHORT_FIELD |
7618 #undef WRITE_SHORT_FIELD | 7634 #undef WRITE_SHORT_FIELD |
7619 #undef READ_BYTE_FIELD | 7635 #undef READ_BYTE_FIELD |
7620 #undef WRITE_BYTE_FIELD | 7636 #undef WRITE_BYTE_FIELD |
7621 #undef NOBARRIER_READ_BYTE_FIELD | 7637 #undef NOBARRIER_READ_BYTE_FIELD |
7622 #undef NOBARRIER_WRITE_BYTE_FIELD | 7638 #undef NOBARRIER_WRITE_BYTE_FIELD |
7623 | 7639 |
7624 } } // namespace v8::internal | 7640 } } // namespace v8::internal |
7625 | 7641 |
7626 #endif // V8_OBJECTS_INL_H_ | 7642 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |