danno, thanks for your review.
In this CL, I have used VirtualMemory to store the reserved address and size
from the code range to keep the existing interfaces. Before the memory
chunk is
initialized, I reset the VirtualMemory so the reserved address is managed
by the
code range only.
I will read more on ASSERT(size_== 0) by following your comments and try to
get
ASSERT(size_executable_ == 0) back also.
https://codereview.chromium.org/11566011/diff/11001/src/deoptimizer.cc
File src/deoptimizer.cc (right):
https://codereview.chromium.org/11566011/diff/11001/src/deoptimizer.cc#newcode50
src/deoptimizer.cc:50: eager_deoptimization_entry_start_ =
allocator->ReserveChunk(deopt_table_size,
In this CL, I am using eager_deoptimization_entry_code_ and
lazy_deoptimization_entry_code_ to store the reserved address and
reserved size. The allocator->ReserveChunk is equal to the reserved
address if reservation is successful.
https://codereview.chromium.org/11566011/diff/11001/src/deoptimizer.cc#newcode77
src/deoptimizer.cc:77: delete eager_deoptimization_entry_code_;
When a trunk is returned, the trunk will take control of
eager_deoptimization_entry_code_ and lazy_deoptimization_entry_code_.
The address in eager_deoptimization_entry_code_ and
lazy_deoptimization_entry_code_ will be NULL.
https://codereview.chromium.org/11566011/diff/11001/src/deoptimizer.cc#newcode1610
src/deoptimizer.cc:1610: if (*chunk == NULL) {
If I read the codes right, table_size is
Deoptimizer::GetMaxDeoptTableSize. So we need commit memory only once,
but we do need to do memcpy when the deopt table grows.
https://codereview.chromium.org/11566011/diff/11001/src/platform.h
File src/platform.h (right):
https://codereview.chromium.org/11566011/diff/11001/src/platform.h#newcode387
src/platform.h:387: void Set(void* address, size_t size) {
I am using this to get a virtual memory from code range. Otherwise I
need to create a struct to record the reserved address and size.
https://codereview.chromium.org/11566011/diff/11001/src/spaces.cc
File src/spaces.cc (right):
https://codereview.chromium.org/11566011/diff/11001/src/spaces.cc#newcode361
src/spaces.cc:361: reservation.Set(static_cast<void*>(base), reserved);
For the double-management, when the memory chunk is created, I reset the
virtual memory if it is in the code range. The
eager_deoptimization_entry_code_ and lazy_deoptimization_entry_code_ are
reset there.
https://codereview.chromium.org/11566011/
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev