Commit f9288fca authored by rmcilroy@chromium.org's avatar rmcilroy@chromium.org

Update serializer to be able to deal with ool constant pool.

This CL depends on CL https://codereview.chromium.org/179813005/ landing first.

R=ulan@chromium.org

Review URL: https://codereview.chromium.org/190883002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19826 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 38732785
...@@ -893,7 +893,7 @@ DEFINE_implication(print_all_code, trace_codegen) ...@@ -893,7 +893,7 @@ DEFINE_implication(print_all_code, trace_codegen)
#define FLAG FLAG_READONLY #define FLAG FLAG_READONLY
// assembler-arm.h // assembler-arm.h
DEFINE_bool(enable_ool_constant_pool, false, DEFINE_bool(enable_ool_constant_pool, V8_OOL_CONSTANT_POOL,
"enable use of out-of-line constant pools (ARM only)") "enable use of out-of-line constant pools (ARM only)")
// Cleanup... // Cleanup...
......
...@@ -162,6 +162,9 @@ namespace internal { ...@@ -162,6 +162,9 @@ namespace internal {
#error Unknown target architecture endiannes #error Unknown target architecture endiannes
#endif #endif
// Determine whether the architecture uses an out-of-line constant pool.
#define V8_OOL_CONSTANT_POOL 0
// Support for alternative bool type. This is only enabled if the code is // Support for alternative bool type. This is only enabled if the code is
// compiled with USE_MYBOOL defined. This catches some nasty type bugs. // compiled with USE_MYBOOL defined. This catches some nasty type bugs.
// For instance, 'bool b = "false";' results in b == true! This is a hidden // For instance, 'bool b = "false";' results in b == true! This is a hidden
......
...@@ -5691,6 +5691,7 @@ void Code::WipeOutHeader() { ...@@ -5691,6 +5691,7 @@ void Code::WipeOutHeader() {
WRITE_FIELD(this, kRelocationInfoOffset, NULL); WRITE_FIELD(this, kRelocationInfoOffset, NULL);
WRITE_FIELD(this, kHandlerTableOffset, NULL); WRITE_FIELD(this, kHandlerTableOffset, NULL);
WRITE_FIELD(this, kDeoptimizationDataOffset, NULL); WRITE_FIELD(this, kDeoptimizationDataOffset, NULL);
WRITE_FIELD(this, kConstantPoolOffset, NULL);
// Do not wipe out e.g. a minor key. // Do not wipe out e.g. a minor key.
if (!READ_FIELD(this, kTypeFeedbackInfoOffset)->IsSmi()) { if (!READ_FIELD(this, kTypeFeedbackInfoOffset)->IsSmi()) {
WRITE_FIELD(this, kTypeFeedbackInfoOffset, NULL); WRITE_FIELD(this, kTypeFeedbackInfoOffset, NULL);
......
...@@ -1145,15 +1145,15 @@ void Deserializer::ReadChunk(Object** current, ...@@ -1145,15 +1145,15 @@ void Deserializer::ReadChunk(Object** current,
// allocation point and write a pointer to it to the current object. // allocation point and write a pointer to it to the current object.
ALL_SPACES(kBackref, kPlain, kStartOfObject) ALL_SPACES(kBackref, kPlain, kStartOfObject)
ALL_SPACES(kBackrefWithSkip, kPlain, kStartOfObject) ALL_SPACES(kBackrefWithSkip, kPlain, kStartOfObject)
#if V8_TARGET_ARCH_MIPS #if defined(V8_TARGET_ARCH_MIPS) || V8_OOL_CONSTANT_POOL
// Deserialize a new object from pointer found in code and write // Deserialize a new object from pointer found in code and write
// a pointer to it to the current object. Required only for MIPS, and // a pointer to it to the current object. Required only for MIPS or ARM
// omitted on the other architectures because it is fully unrolled and // with ool constant pool, and omitted on the other architectures because
// would cause bloat. // it is fully unrolled and would cause bloat.
ALL_SPACES(kNewObject, kFromCode, kStartOfObject) ALL_SPACES(kNewObject, kFromCode, kStartOfObject)
// Find a recently deserialized code object using its offset from the // Find a recently deserialized code object using its offset from the
// current allocation point and write a pointer to it to the current // current allocation point and write a pointer to it to the current
// object. Required only for MIPS. // object. Required only for MIPS or ARM with ool constant pool.
ALL_SPACES(kBackref, kFromCode, kStartOfObject) ALL_SPACES(kBackref, kFromCode, kStartOfObject)
ALL_SPACES(kBackrefWithSkip, kFromCode, kStartOfObject) ALL_SPACES(kBackrefWithSkip, kFromCode, kStartOfObject)
#endif #endif
...@@ -1374,12 +1374,11 @@ int Serializer::RootIndex(HeapObject* heap_object, HowToCode from) { ...@@ -1374,12 +1374,11 @@ int Serializer::RootIndex(HeapObject* heap_object, HowToCode from) {
for (int i = 0; i < root_index_wave_front_; i++) { for (int i = 0; i < root_index_wave_front_; i++) {
Object* root = heap->roots_array_start()[i]; Object* root = heap->roots_array_start()[i];
if (!root->IsSmi() && root == heap_object) { if (!root->IsSmi() && root == heap_object) {
#if V8_TARGET_ARCH_MIPS #if defined(V8_TARGET_ARCH_MIPS) || V8_OOL_CONSTANT_POOL
if (from == kFromCode) { if (from == kFromCode) {
// In order to avoid code bloat in the deserializer we don't have // In order to avoid code bloat in the deserializer we don't have
// support for the encoding that specifies a particular root should // support for the encoding that specifies a particular root should
// be written into the lui/ori instructions on MIPS. Therefore we // be written from within code.
// should not generate such serialization data for MIPS.
return kInvalidRootIndex; return kInvalidRootIndex;
} }
#endif #endif
...@@ -1632,6 +1631,9 @@ void Serializer::ObjectSerializer::VisitPointers(Object** start, ...@@ -1632,6 +1631,9 @@ void Serializer::ObjectSerializer::VisitPointers(Object** start,
void Serializer::ObjectSerializer::VisitEmbeddedPointer(RelocInfo* rinfo) { void Serializer::ObjectSerializer::VisitEmbeddedPointer(RelocInfo* rinfo) {
// Out-of-line constant pool entries will be visited by the ConstantPoolArray.
if (FLAG_enable_ool_constant_pool && rinfo->IsInConstantPool()) return;
int skip = OutputRawData(rinfo->target_address_address(), int skip = OutputRawData(rinfo->target_address_address(),
kCanReturnSkipInsteadOfSkipping); kCanReturnSkipInsteadOfSkipping);
HowToCode how_to_code = rinfo->IsCodedSpecially() ? kFromCode : kPlain; HowToCode how_to_code = rinfo->IsCodedSpecially() ? kFromCode : kPlain;
...@@ -1677,6 +1679,9 @@ void Serializer::ObjectSerializer::VisitRuntimeEntry(RelocInfo* rinfo) { ...@@ -1677,6 +1679,9 @@ void Serializer::ObjectSerializer::VisitRuntimeEntry(RelocInfo* rinfo) {
void Serializer::ObjectSerializer::VisitCodeTarget(RelocInfo* rinfo) { void Serializer::ObjectSerializer::VisitCodeTarget(RelocInfo* rinfo) {
// Out-of-line constant pool entries will be visited by the ConstantPoolArray.
if (FLAG_enable_ool_constant_pool && rinfo->IsInConstantPool()) return;
int skip = OutputRawData(rinfo->target_address_address(), int skip = OutputRawData(rinfo->target_address_address(),
kCanReturnSkipInsteadOfSkipping); kCanReturnSkipInsteadOfSkipping);
Code* object = Code::GetCodeFromTargetAddress(rinfo->target_address()); Code* object = Code::GetCodeFromTargetAddress(rinfo->target_address());
...@@ -1694,6 +1699,9 @@ void Serializer::ObjectSerializer::VisitCodeEntry(Address entry_address) { ...@@ -1694,6 +1699,9 @@ void Serializer::ObjectSerializer::VisitCodeEntry(Address entry_address) {
void Serializer::ObjectSerializer::VisitCell(RelocInfo* rinfo) { void Serializer::ObjectSerializer::VisitCell(RelocInfo* rinfo) {
// Out-of-line constant pool entries will be visited by the ConstantPoolArray.
if (FLAG_enable_ool_constant_pool && rinfo->IsInConstantPool()) return;
int skip = OutputRawData(rinfo->pc(), kCanReturnSkipInsteadOfSkipping); int skip = OutputRawData(rinfo->pc(), kCanReturnSkipInsteadOfSkipping);
Cell* object = Cell::cast(rinfo->target_cell()); Cell* object = Cell::cast(rinfo->target_cell());
serializer_->SerializeObject(object, kPlain, kInnerPointer, skip); serializer_->SerializeObject(object, kPlain, kInnerPointer, skip);
...@@ -1739,7 +1747,9 @@ static void WipeOutRelocations(Code* code) { ...@@ -1739,7 +1747,9 @@ static void WipeOutRelocations(Code* code) {
RelocInfo::ModeMask(RelocInfo::EXTERNAL_REFERENCE) | RelocInfo::ModeMask(RelocInfo::EXTERNAL_REFERENCE) |
RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY); RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY);
for (RelocIterator it(code, mode_mask); !it.done(); it.next()) { for (RelocIterator it(code, mode_mask); !it.done(); it.next()) {
it.rinfo()->WipeOut(); if (!(FLAG_enable_ool_constant_pool && it.rinfo()->IsInConstantPool())) {
it.rinfo()->WipeOut();
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment