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

Unified Diff: src/objects.cc

Issue 1162993006: Add support for Embedded Constant Pools for PPC and Arm (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 months 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 side-by-side diff with in-line comments
Download patch
« src/objects.h ('K') | « src/objects.h ('k') | src/objects-debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 0ebbe2ce9995a03771b27278cf9a97f8c4d1fcc4..536534713035786f8fdf6bd283dd566261e09e52 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -1488,9 +1488,6 @@ void HeapObject::IterateBody(InstanceType type, int object_size,
case FIXED_ARRAY_TYPE:
FixedArray::BodyDescriptor::IterateBody(this, object_size, v);
break;
- case CONSTANT_POOL_ARRAY_TYPE:
- reinterpret_cast<ConstantPoolArray*>(this)->ConstantPoolIterateBody(v);
- break;
case FIXED_DOUBLE_ARRAY_TYPE:
break;
case JS_OBJECT_TYPE:
@@ -9504,49 +9501,6 @@ bool Map::EquivalentToForNormalization(Map* other,
}
-void ConstantPoolArray::ConstantPoolIterateBody(ObjectVisitor* v) {
- // Unfortunately the serializer relies on pointers within an object being
- // visited in-order, so we have to iterate both the code and heap pointers in
- // the small section before doing so in the extended section.
- for (int s = 0; s <= final_section(); ++s) {
- LayoutSection section = static_cast<LayoutSection>(s);
- ConstantPoolArray::Iterator code_iter(this, ConstantPoolArray::CODE_PTR,
- section);
- while (!code_iter.is_finished()) {
- v->VisitCodeEntry(reinterpret_cast<Address>(
- RawFieldOfElementAt(code_iter.next_index())));
- }
-
- ConstantPoolArray::Iterator heap_iter(this, ConstantPoolArray::HEAP_PTR,
- section);
- while (!heap_iter.is_finished()) {
- v->VisitPointer(RawFieldOfElementAt(heap_iter.next_index()));
- }
- }
-}
-
-
-void ConstantPoolArray::ClearPtrEntries(Isolate* isolate) {
- Type type[] = { CODE_PTR, HEAP_PTR };
- Address default_value[] = {
- isolate->builtins()->builtin(Builtins::kIllegal)->entry(),
- reinterpret_cast<Address>(isolate->heap()->undefined_value()) };
-
- for (int i = 0; i < 2; ++i) {
- for (int s = 0; s <= final_section(); ++s) {
- LayoutSection section = static_cast<LayoutSection>(s);
- if (number_of_entries(type[i], section) > 0) {
- int offset = OffsetOfElementAt(first_index(type[i], section));
- MemsetPointer(
- reinterpret_cast<Address*>(HeapObject::RawField(this, offset)),
- default_value[i],
- number_of_entries(type[i], section));
- }
- }
- }
-}
-
-
void JSFunction::JSFunctionIterateBody(int object_size, ObjectVisitor* v) {
// Iterate over all fields in the body but take care in dealing with
// the code entry.
@@ -11669,17 +11623,34 @@ void Code::Disassemble(const char* name, std::ostream& os) { // NOLINT
os << "Instructions (size = " << instruction_size() << ")\n";
{
Isolate* isolate = GetIsolate();
- int decode_size = is_crankshafted()
- ? static_cast<int>(safepoint_table_offset())
- : instruction_size();
- // If there might be a back edge table, stop before reaching it.
- if (kind() == Code::FUNCTION) {
- decode_size =
- Min(decode_size, static_cast<int>(back_edge_table_offset()));
- }
+ int size = instruction_size();
+ int safepoint_offset =
+ is_crankshafted() ? static_cast<int>(safepoint_table_offset()) : size;
+ int back_edge_offset = (kind() == Code::FUNCTION)
+ ? static_cast<int>(back_edge_table_offset())
+ : size;
+ int constant_pool_offset = FLAG_enable_embedded_constant_pool
+ ? this->constant_pool_offset()
+ : size;
+
+ // Stop before reaching any embedded tables
+ int code_size = Min(safepoint_offset, back_edge_offset);
+ code_size = Min(code_size, constant_pool_offset);
byte* begin = instruction_start();
- byte* end = begin + decode_size;
+ byte* end = begin + code_size;
Disassembler::Decode(isolate, &os, begin, end, this);
+
+ if (constant_pool_offset < size) {
+ int constant_pool_size = size - constant_pool_offset;
+ DCHECK((constant_pool_size & kPointerAlignmentMask) == 0);
+ os << "\nConstant Pool (size = " << constant_pool_size << ")\n";
+ Vector<char> buf = Vector<char>::New(50);
+ intptr_t* ptr = reinterpret_cast<intptr_t*>(begin + constant_pool_offset);
+ for (int i = 0; i < constant_pool_size; i += kPointerSize, ptr++) {
+ SNPrintF(buf, "%4d %08" V8PRIxPTR, i, *ptr);
+ os << static_cast<const void*>(ptr) << " " << buf.start() << "\n";
+ }
+ }
}
os << "\n";
@@ -11758,17 +11729,6 @@ void Code::Disassemble(const char* name, std::ostream& os) { // NOLINT
it.rinfo()->Print(GetIsolate(), os);
}
os << "\n";
-
-#ifdef OBJECT_PRINT
- if (FLAG_enable_ool_constant_pool) {
- ConstantPoolArray* pool = constant_pool();
- if (pool->length()) {
- os << "Constant Pool\n";
- pool->Print(os);
- os << "\n";
- }
- }
-#endif
}
#endif // ENABLE_DISASSEMBLER
« src/objects.h ('K') | « src/objects.h ('k') | src/objects-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698