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 #ifndef V8_HEAP_MARK_COMPACT_H_ | 5 #ifndef V8_HEAP_MARK_COMPACT_H_ |
6 #define V8_HEAP_MARK_COMPACT_H_ | 6 #define V8_HEAP_MARK_COMPACT_H_ |
7 | 7 |
8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
9 #include "src/heap/spaces.h" | 9 #include "src/heap/spaces.h" |
10 | 10 |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 HeapObject::RawField(candidate, JSFunction::kNextFunctionLinkOffset)); | 509 HeapObject::RawField(candidate, JSFunction::kNextFunctionLinkOffset)); |
510 } | 510 } |
511 | 511 |
512 static JSFunction* GetNextCandidate(JSFunction* candidate) { | 512 static JSFunction* GetNextCandidate(JSFunction* candidate) { |
513 Object* next_candidate = candidate->next_function_link(); | 513 Object* next_candidate = candidate->next_function_link(); |
514 return reinterpret_cast<JSFunction*>(next_candidate); | 514 return reinterpret_cast<JSFunction*>(next_candidate); |
515 } | 515 } |
516 | 516 |
517 static void SetNextCandidate(JSFunction* candidate, | 517 static void SetNextCandidate(JSFunction* candidate, |
518 JSFunction* next_candidate) { | 518 JSFunction* next_candidate) { |
519 candidate->set_next_function_link(next_candidate); | 519 candidate->set_next_function_link(next_candidate, |
| 520 UPDATE_WEAK_WRITE_BARRIER); |
520 } | 521 } |
521 | 522 |
522 static void ClearNextCandidate(JSFunction* candidate, Object* undefined) { | 523 static void ClearNextCandidate(JSFunction* candidate, Object* undefined) { |
523 DCHECK(undefined->IsUndefined()); | 524 DCHECK(undefined->IsUndefined()); |
524 candidate->set_next_function_link(undefined, SKIP_WRITE_BARRIER); | 525 candidate->set_next_function_link(undefined, SKIP_WRITE_BARRIER); |
525 } | 526 } |
526 | 527 |
527 static SharedFunctionInfo* GetNextCandidate(SharedFunctionInfo* candidate) { | 528 static SharedFunctionInfo* GetNextCandidate(SharedFunctionInfo* candidate) { |
528 Object* next_candidate = candidate->code()->gc_metadata(); | 529 Object* next_candidate = candidate->code()->gc_metadata(); |
529 return reinterpret_cast<SharedFunctionInfo*>(next_candidate); | 530 return reinterpret_cast<SharedFunctionInfo*>(next_candidate); |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1017 private: | 1018 private: |
1018 MarkCompactCollector* collector_; | 1019 MarkCompactCollector* collector_; |
1019 }; | 1020 }; |
1020 | 1021 |
1021 | 1022 |
1022 const char* AllocationSpaceName(AllocationSpace space); | 1023 const char* AllocationSpaceName(AllocationSpace space); |
1023 } | 1024 } |
1024 } // namespace v8::internal | 1025 } // namespace v8::internal |
1025 | 1026 |
1026 #endif // V8_HEAP_MARK_COMPACT_H_ | 1027 #endif // V8_HEAP_MARK_COMPACT_H_ |
OLD | NEW |