OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1423 } | 1423 } |
1424 | 1424 |
1425 | 1425 |
1426 static void VisitJSFunction(Map* map, HeapObject* object) { | 1426 static void VisitJSFunction(Map* map, HeapObject* object) { |
1427 VisitJSFunctionFields(map, | 1427 VisitJSFunctionFields(map, |
1428 reinterpret_cast<JSFunction*>(object), | 1428 reinterpret_cast<JSFunction*>(object), |
1429 false); | 1429 false); |
1430 } | 1430 } |
1431 | 1431 |
1432 | 1432 |
1433 #define SLOT_ADDR(obj, offset) \ | |
1434 reinterpret_cast<Object**>((obj)->address() + offset) | |
1435 | |
1436 | |
1437 static inline void VisitJSFunctionFields(Map* map, | 1433 static inline void VisitJSFunctionFields(Map* map, |
1438 JSFunction* object, | 1434 JSFunction* object, |
1439 bool flush_code_candidate) { | 1435 bool flush_code_candidate) { |
1440 Heap* heap = map->GetHeap(); | 1436 Heap* heap = map->GetHeap(); |
1441 | 1437 |
1442 VisitPointers(heap, | 1438 VisitPointers(heap, |
1443 HeapObject::RawField(object, JSFunction::kPropertiesOffset), | 1439 HeapObject::RawField(object, JSFunction::kPropertiesOffset), |
1444 HeapObject::RawField(object, JSFunction::kCodeEntryOffset)); | 1440 HeapObject::RawField(object, JSFunction::kCodeEntryOffset)); |
1445 | 1441 |
1446 if (!flush_code_candidate) { | 1442 if (!flush_code_candidate) { |
(...skipping 15 matching lines...) Expand all Loading... |
1462 VisitSharedFunctionInfoAndFlushCodeGeneric(shared_info_map, | 1458 VisitSharedFunctionInfoAndFlushCodeGeneric(shared_info_map, |
1463 shared_info, | 1459 shared_info, |
1464 true); | 1460 true); |
1465 } | 1461 } |
1466 } | 1462 } |
1467 | 1463 |
1468 VisitPointers( | 1464 VisitPointers( |
1469 heap, | 1465 heap, |
1470 HeapObject::RawField(object, | 1466 HeapObject::RawField(object, |
1471 JSFunction::kCodeEntryOffset + kPointerSize), | 1467 JSFunction::kCodeEntryOffset + kPointerSize), |
1472 HeapObject::RawField(object, | 1468 HeapObject::RawField(object, JSFunction::kNonWeakFieldsEndOffset)); |
1473 JSFunction::kNonWeakFieldsEndOffset)); | |
1474 } | 1469 } |
1475 | 1470 |
1476 | 1471 |
1477 static void VisitSharedFunctionInfoFields(Heap* heap, | 1472 static void VisitSharedFunctionInfoFields(Heap* heap, |
1478 HeapObject* object, | 1473 HeapObject* object, |
1479 bool flush_code_candidate) { | 1474 bool flush_code_candidate) { |
1480 VisitPointer(heap, SLOT_ADDR(object, SharedFunctionInfo::kNameOffset)); | 1475 VisitPointer(heap, |
| 1476 HeapObject::RawField(object, SharedFunctionInfo::kNameOffset)); |
1481 | 1477 |
1482 if (!flush_code_candidate) { | 1478 if (!flush_code_candidate) { |
1483 VisitPointer(heap, SLOT_ADDR(object, SharedFunctionInfo::kCodeOffset)); | 1479 VisitPointer(heap, |
| 1480 HeapObject::RawField(object, |
| 1481 SharedFunctionInfo::kCodeOffset)); |
1484 } | 1482 } |
1485 | 1483 |
1486 VisitPointers(heap, | 1484 VisitPointers( |
1487 SLOT_ADDR(object, SharedFunctionInfo::kOptimizedCodeMapOffset), | 1485 heap, |
1488 SLOT_ADDR(object, SharedFunctionInfo::kSize)); | 1486 HeapObject::RawField(object, |
| 1487 SharedFunctionInfo::kOptimizedCodeMapOffset), |
| 1488 HeapObject::RawField(object, SharedFunctionInfo::kSize)); |
1489 } | 1489 } |
1490 | 1490 |
1491 #undef SLOT_ADDR | |
1492 | |
1493 static VisitorDispatchTable<Callback> non_count_table_; | 1491 static VisitorDispatchTable<Callback> non_count_table_; |
1494 }; | 1492 }; |
1495 | 1493 |
1496 | 1494 |
1497 void MarkCompactMarkingVisitor::ObjectStatsCountFixedArray( | 1495 void MarkCompactMarkingVisitor::ObjectStatsCountFixedArray( |
1498 FixedArrayBase* fixed_array, | 1496 FixedArrayBase* fixed_array, |
1499 FixedArraySubInstanceType fast_type, | 1497 FixedArraySubInstanceType fast_type, |
1500 FixedArraySubInstanceType dictionary_type) { | 1498 FixedArraySubInstanceType dictionary_type) { |
1501 Heap* heap = fixed_array->map()->GetHeap(); | 1499 Heap* heap = fixed_array->map()->GetHeap(); |
1502 if (fixed_array->map() != heap->fixed_cow_array_map() && | 1500 if (fixed_array->map() != heap->fixed_cow_array_map() && |
(...skipping 2706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4209 while (buffer != NULL) { | 4207 while (buffer != NULL) { |
4210 SlotsBuffer* next_buffer = buffer->next(); | 4208 SlotsBuffer* next_buffer = buffer->next(); |
4211 DeallocateBuffer(buffer); | 4209 DeallocateBuffer(buffer); |
4212 buffer = next_buffer; | 4210 buffer = next_buffer; |
4213 } | 4211 } |
4214 *buffer_address = NULL; | 4212 *buffer_address = NULL; |
4215 } | 4213 } |
4216 | 4214 |
4217 | 4215 |
4218 } } // namespace v8::internal | 4216 } } // namespace v8::internal |
OLD | NEW |