Chromium Code Reviews| 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 1284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1295 return true; | 1295 return true; |
| 1296 } | 1296 } |
| 1297 | 1297 |
| 1298 static inline bool IsValidNotBuiltinContext(Object* ctx) { | 1298 static inline bool IsValidNotBuiltinContext(Object* ctx) { |
| 1299 return ctx->IsContext() && | 1299 return ctx->IsContext() && |
| 1300 !Context::cast(ctx)->global()->IsJSBuiltinsObject(); | 1300 !Context::cast(ctx)->global()->IsJSBuiltinsObject(); |
| 1301 } | 1301 } |
| 1302 | 1302 |
| 1303 | 1303 |
| 1304 static void VisitSharedFunctionInfoGeneric(Map* map, HeapObject* object) { | 1304 static void VisitSharedFunctionInfoGeneric(Map* map, HeapObject* object) { |
| 1305 SharedFunctionInfo* shared = reinterpret_cast<SharedFunctionInfo*>(object); | 1305 reinterpret_cast<SharedFunctionInfo*>(object)->BeforeVisitingPointers(); |
|
Michael Starzinger
2012/05/23 11:16:29
We should be able to use SharedFunctionInfo::cast(
fschneider
2012/06/14 11:08:23
Done.
| |
| 1306 | |
| 1307 if (shared->IsInobjectSlackTrackingInProgress()) shared->DetachInitialMap(); | |
| 1308 | 1306 |
| 1309 FixedBodyVisitor<StaticMarkingVisitor, | 1307 FixedBodyVisitor<StaticMarkingVisitor, |
| 1310 SharedFunctionInfo::BodyDescriptor, | 1308 SharedFunctionInfo::BodyDescriptor, |
| 1311 void>::Visit(map, object); | 1309 void>::Visit(map, object); |
| 1312 } | 1310 } |
| 1313 | 1311 |
| 1314 | 1312 |
| 1315 static void UpdateRegExpCodeAgeAndFlush(Heap* heap, | 1313 static void UpdateRegExpCodeAgeAndFlush(Heap* heap, |
| 1316 JSRegExp* re, | 1314 JSRegExp* re, |
| 1317 bool is_ascii) { | 1315 bool is_ascii) { |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1401 } | 1399 } |
| 1402 VisitSharedFunctionInfoAndFlushCodeGeneric(map, object, false); | 1400 VisitSharedFunctionInfoAndFlushCodeGeneric(map, object, false); |
| 1403 } | 1401 } |
| 1404 | 1402 |
| 1405 | 1403 |
| 1406 static void VisitSharedFunctionInfoAndFlushCodeGeneric( | 1404 static void VisitSharedFunctionInfoAndFlushCodeGeneric( |
| 1407 Map* map, HeapObject* object, bool known_flush_code_candidate) { | 1405 Map* map, HeapObject* object, bool known_flush_code_candidate) { |
| 1408 Heap* heap = map->GetHeap(); | 1406 Heap* heap = map->GetHeap(); |
| 1409 SharedFunctionInfo* shared = reinterpret_cast<SharedFunctionInfo*>(object); | 1407 SharedFunctionInfo* shared = reinterpret_cast<SharedFunctionInfo*>(object); |
| 1410 | 1408 |
| 1411 if (shared->IsInobjectSlackTrackingInProgress()) shared->DetachInitialMap(); | 1409 shared->BeforeVisitingPointers(); |
| 1412 | 1410 |
| 1413 if (!known_flush_code_candidate) { | 1411 if (!known_flush_code_candidate) { |
| 1414 known_flush_code_candidate = IsFlushable(heap, shared); | 1412 known_flush_code_candidate = IsFlushable(heap, shared); |
| 1415 if (known_flush_code_candidate) { | 1413 if (known_flush_code_candidate) { |
| 1416 heap->mark_compact_collector()->code_flusher()->AddCandidate(shared); | 1414 heap->mark_compact_collector()->code_flusher()->AddCandidate(shared); |
| 1417 } | 1415 } |
| 1418 } | 1416 } |
| 1419 | 1417 |
| 1420 VisitSharedFunctionInfoFields(heap, object, known_flush_code_candidate); | 1418 VisitSharedFunctionInfoFields(heap, object, known_flush_code_candidate); |
| 1421 } | 1419 } |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1538 static void VisitSharedFunctionInfoFields(Heap* heap, | 1536 static void VisitSharedFunctionInfoFields(Heap* heap, |
| 1539 HeapObject* object, | 1537 HeapObject* object, |
| 1540 bool flush_code_candidate) { | 1538 bool flush_code_candidate) { |
| 1541 VisitPointer(heap, SLOT_ADDR(object, SharedFunctionInfo::kNameOffset)); | 1539 VisitPointer(heap, SLOT_ADDR(object, SharedFunctionInfo::kNameOffset)); |
| 1542 | 1540 |
| 1543 if (!flush_code_candidate) { | 1541 if (!flush_code_candidate) { |
| 1544 VisitPointer(heap, SLOT_ADDR(object, SharedFunctionInfo::kCodeOffset)); | 1542 VisitPointer(heap, SLOT_ADDR(object, SharedFunctionInfo::kCodeOffset)); |
| 1545 } | 1543 } |
| 1546 | 1544 |
| 1547 VisitPointers(heap, | 1545 VisitPointers(heap, |
| 1548 SLOT_ADDR(object, SharedFunctionInfo::kScopeInfoOffset), | 1546 SLOT_ADDR(object, SharedFunctionInfo::kOptimizedCodeMapOffset), |
| 1549 SLOT_ADDR(object, SharedFunctionInfo::kSize)); | 1547 SLOT_ADDR(object, SharedFunctionInfo::kSize)); |
| 1550 } | 1548 } |
| 1551 | 1549 |
| 1552 #undef SLOT_ADDR | 1550 #undef SLOT_ADDR |
| 1553 | 1551 |
| 1554 typedef void (*Callback)(Map* map, HeapObject* object); | 1552 typedef void (*Callback)(Map* map, HeapObject* object); |
| 1555 | 1553 |
| 1556 static VisitorDispatchTable<Callback> table_; | 1554 static VisitorDispatchTable<Callback> table_; |
| 1557 }; | 1555 }; |
| 1558 | 1556 |
| 1559 | 1557 |
| (...skipping 2575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4135 while (buffer != NULL) { | 4133 while (buffer != NULL) { |
| 4136 SlotsBuffer* next_buffer = buffer->next(); | 4134 SlotsBuffer* next_buffer = buffer->next(); |
| 4137 DeallocateBuffer(buffer); | 4135 DeallocateBuffer(buffer); |
| 4138 buffer = next_buffer; | 4136 buffer = next_buffer; |
| 4139 } | 4137 } |
| 4140 *buffer_address = NULL; | 4138 *buffer_address = NULL; |
| 4141 } | 4139 } |
| 4142 | 4140 |
| 4143 | 4141 |
| 4144 } } // namespace v8::internal | 4142 } } // namespace v8::internal |
| OLD | NEW |