Reviewers: ulan,
Message:
Part of the out-of-line constant pool change - PTAL.
Description:
Update serializer to be able to deal with ool constant pool.
This CL depends on CL https://codereview.chromium.org/179813005/ landing
first.
Please review this at https://codereview.chromium.org/190883002/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+24, -10 lines):
M src/flag-definitions.h
M src/globals.h
M src/objects-inl.h
M src/serialize.cc
Index: src/flag-definitions.h
diff --git a/src/flag-definitions.h b/src/flag-definitions.h
index
3bdcc5af08c3931cfb0c7bcf6763da0014a38709..ba72dcc1476aeb000fd6bc87f8b0b582569c5ed2
100644
--- a/src/flag-definitions.h
+++ b/src/flag-definitions.h
@@ -897,7 +897,7 @@ DEFINE_implication(print_all_code, trace_codegen)
#define FLAG FLAG_READONLY
// 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)")
// Cleanup...
Index: src/globals.h
diff --git a/src/globals.h b/src/globals.h
index
ac5b71067baba5d3913ae9a8cd35a57db571f849..ca9404307244ccea41ad42322fabd60dae397bab
100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -162,6 +162,9 @@ namespace internal {
#error Unknown target architecture endiannes
#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
// compiled with USE_MYBOOL defined. This catches some nasty type bugs.
// For instance, 'bool b = "false";' results in b == true! This is a hidden
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index
991c6c6f06d7f29d1be20d10f6734f4a137f9932..0fcc6db87a1a6533732ffca7335ef4582a3a4045
100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -5683,6 +5683,7 @@ void Code::WipeOutHeader() {
WRITE_FIELD(this, kRelocationInfoOffset, NULL);
WRITE_FIELD(this, kHandlerTableOffset, NULL);
WRITE_FIELD(this, kDeoptimizationDataOffset, NULL);
+ WRITE_FIELD(this, kConstantPoolOffset, NULL);
// Do not wipe out e.g. a minor key.
if (!READ_FIELD(this, kTypeFeedbackInfoOffset)->IsSmi()) {
WRITE_FIELD(this, kTypeFeedbackInfoOffset, NULL);
Index: src/serialize.cc
diff --git a/src/serialize.cc b/src/serialize.cc
index
5c76df83a8d8d40eade017b9158adf50fcd20527..a99cccc24c8d492243e1504682a72b2cd2b98363
100644
--- a/src/serialize.cc
+++ b/src/serialize.cc
@@ -1144,15 +1144,15 @@ void Deserializer::ReadChunk(Object** current,
// allocation point and write a pointer to it to the current object.
ALL_SPACES(kBackref, 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
- // a pointer to it to the current object. Required only for MIPS, and
- // omitted on the other architectures because it is fully unrolled
and
- // would cause bloat.
+ // a pointer to it to the current object. Required only for MIPS or
ARM
+ // with ool constant pool, and omitted on the other architectures
because
+ // it is fully unrolled and would cause bloat.
ALL_SPACES(kNewObject, kFromCode, kStartOfObject)
// Find a recently deserialized code object using its offset from the
// 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(kBackrefWithSkip, kFromCode, kStartOfObject)
#endif
@@ -1373,12 +1373,11 @@ int Serializer::RootIndex(HeapObject* heap_object,
HowToCode from) {
for (int i = 0; i < root_index_wave_front_; i++) {
Object* root = heap->roots_array_start()[i];
if (!root->IsSmi() && root == heap_object) {
-#if V8_TARGET_ARCH_MIPS
+#if defined(V8_TARGET_ARCH_MIPS) || V8_OOL_CONSTANT_POOL
if (from == kFromCode) {
// In order to avoid code bloat in the deserializer we don't have
// support for the encoding that specifies a particular root should
- // be written into the lui/ori instructions on MIPS. Therefore we
- // should not generate such serialization data for MIPS.
+ // be written from within code.
return kInvalidRootIndex;
}
#endif
@@ -1631,6 +1630,9 @@ void
Serializer::ObjectSerializer::VisitPointers(Object** start,
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(),
kCanReturnSkipInsteadOfSkipping);
HowToCode how_to_code = rinfo->IsCodedSpecially() ? kFromCode : kPlain;
@@ -1687,6 +1689,9 @@ void Serializer::ObjectSerializer::VisitCodeTarget(
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(),
kCanReturnSkipInsteadOfSkipping);
Code* object = Code::GetCodeFromTargetAddress(rinfo->target_address());
@@ -1704,6 +1709,9 @@ void
Serializer::ObjectSerializer::VisitCodeEntry(Address entry_address) {
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);
Cell* object = Cell::cast(rinfo->target_cell());
serializer_->SerializeObject(object, kPlain, kInnerPointer, skip);
@@ -1749,7 +1757,9 @@ static void WipeOutRelocations(Code* code) {
RelocInfo::ModeMask(RelocInfo::EXTERNAL_REFERENCE) |
RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY);
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();
+ }
}
}
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.