Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Side by Side Diff: src/write-buffer.h

Issue 5856002: Add support for compacting the write buffer. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 static inline void Mark(Address addr) { 49 static inline void Mark(Address addr) {
50 *top_++ = addr; 50 *top_++ = addr;
51 if ((reinterpret_cast<uintptr_t>(top_) & kWriteBufferOverflowBit) != 0) { 51 if ((reinterpret_cast<uintptr_t>(top_) & kWriteBufferOverflowBit) != 0) {
52 ASSERT(top_ == limit_); 52 ASSERT(top_ == limit_);
53 Compact(); 53 Compact();
54 } else { 54 } else {
55 ASSERT(top_ < limit_); 55 ASSERT(top_ < limit_);
56 } 56 }
57 } 57 }
58 58
59 static const int kWriteBufferOverflowBit = 1 << 15; 59 static const int kWriteBufferOverflowBit = 1 << 16;
60 static const int kWriteBufferSize = kWriteBufferOverflowBit; 60 static const int kWriteBufferSize = kWriteBufferOverflowBit;
61 static const int kHashMapLengthLog2 = 12;
62 static const int kHashMapLength = 1 << kHashMapLengthLog2;
61 63
62 private: 64 private:
63 static Address* top_; 65 static Address* top_;
64 static Address* start_; 66 static Address* start_;
65 static Address* limit_; 67 static Address* limit_;
66 static VirtualMemory* virtual_memory_; 68 static VirtualMemory* virtual_memory_;
69 static uintptr_t* hash_map_1_;
70 static uintptr_t* hash_map_2_;
67 71
68 static void Compact(); 72 static void Compact();
69 }; 73 };
70 74
71 } } // namespace v8::internal 75 } } // namespace v8::internal
72 76
73 #endif // V8_WRITE_BARRIER_H_ 77 #endif // V8_WRITE_BARRIER_H_
OLDNEW
« no previous file with comments | « src/v8-counters.h ('k') | src/write-buffer.cc » ('j') | src/write-buffer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698