OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 23 matching lines...) Expand all Loading... |
34 #include "platform/heap/Handle.h" | 34 #include "platform/heap/Handle.h" |
35 #include "platform/heap/Heap.h" | 35 #include "platform/heap/Heap.h" |
36 | 36 |
37 namespace blink { | 37 namespace blink { |
38 | 38 |
39 // gcInfoIndex should start from 1. | 39 // gcInfoIndex should start from 1. |
40 // Since atomicIncrement(&s_gcInfoIndex) (which is defined in | 40 // Since atomicIncrement(&s_gcInfoIndex) (which is defined in |
41 // RETURN_GCINFO_INDEX) returns an incremented value of s_gcInfoIndex, | 41 // RETURN_GCINFO_INDEX) returns an incremented value of s_gcInfoIndex, |
42 // the initial value of s_gcInfoIndex should be set to 0. | 42 // the initial value of s_gcInfoIndex should be set to 0. |
43 int s_gcInfoIndex = 0; | 43 int s_gcInfoIndex = 0; |
44 const GCInfo* s_gcInfoMap[gcInfoIndexMax] = { 0 }; | 44 GCInfo const** s_gcInfoTable = nullptr; |
45 | 45 |
46 int Visitor::m_traceDepth = 0; | 46 int Visitor::m_traceDepth = 0; |
47 | 47 |
48 #if ENABLE(ASSERT) | 48 #if ENABLE(ASSERT) |
49 void assertObjectHasGCInfo(const void* payload, size_t gcInfoIndex) | 49 void assertObjectHasGCInfo(const void* payload, size_t gcInfoIndex) |
50 { | 50 { |
51 HeapObjectHeader::fromPayload(payload)->checkHeader(); | 51 HeapObjectHeader::fromPayload(payload)->checkHeader(); |
52 #if !defined(COMPONENT_BUILD) | 52 #if !defined(COMPONENT_BUILD) |
53 // On component builds we cannot compare the gcInfos as they are statically | 53 // On component builds we cannot compare the gcInfos as they are statically |
54 // defined in each of the components and hence will not match. | 54 // defined in each of the components and hence will not match. |
55 BaseHeapPage* page = pageFromObject(payload); | 55 BaseHeapPage* page = pageFromObject(payload); |
56 ASSERT(page->orphaned() || HeapObjectHeader::fromPayload(payload)->gcInfoInd
ex() == gcInfoIndex); | 56 ASSERT(page->orphaned() || HeapObjectHeader::fromPayload(payload)->gcInfoInd
ex() == gcInfoIndex); |
57 #endif | 57 #endif |
58 } | 58 } |
59 #endif | 59 #endif |
60 | 60 |
61 } | 61 } |
OLD | NEW |