Commit fbd106d9 authored by sgjesse@chromium.org's avatar sgjesse@chromium.org

MIPS: arch-independent changes to support mips.

This change supports all non-crankshaft features except serialization.

This must be built after the changes in http://codereview.chromium.org/6966031
are landed.

BUG=
TEST=

Review URL: http://codereview.chromium.org//7039058

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8023 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 9891a057
......@@ -348,6 +348,19 @@ class RelocInfo BASE_EMBEDDED {
byte* pc_;
Mode rmode_;
intptr_t data_;
#ifdef V8_TARGET_ARCH_MIPS
// Code and Embedded Object pointers in mips are stored split
// across two consecutive 32-bit instructions. Heap management
// routines expect to access these pointers indirectly. The following
// location provides a place for these pointers to exist natually
// when accessed via the Iterator.
Object *reconstructed_obj_ptr_;
// External-reference pointers are also split across instruction-pairs
// in mips, but are accessed via indirect pointers. This location
// provides a place for that pointer to exist naturally. Its address
// is returned by RelocInfo::target_reference_address().
Address reconstructed_adr_ptr_;
#endif // V8_TARGET_ARCH_MIPS
friend class RelocIterator;
};
......
......@@ -95,24 +95,8 @@ Address RelocInfo::target_address() {
Address RelocInfo::target_address_address() {
ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY
|| rmode_ == EMBEDDED_OBJECT
|| rmode_ == EXTERNAL_REFERENCE);
// Read the address of the word containing the target_address in an
// instruction stream.
// The only architecture-independent user of this function is the serializer.
// The serializer uses it to find out how many raw bytes of instruction to
// output before the next target.
// For an instructions like LUI/ORI where the target bits are mixed into the
// instruction bits, the size of the target will be zero, indicating that the
// serializer should not step forward in memory after a target is resolved
// and written. In this case the target_address_address function should
// return the end of the instructions to be patched, allowing the
// deserializer to deserialize the instructions as raw bytes and put them in
// place, ready to be patched with the target. In our case, that is the
// address of the instruction that follows LUI/ORI instruction pair.
return reinterpret_cast<Address>(
pc_ + Assembler::kInstructionsFor32BitConstant * Assembler::kInstrSize);
ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY);
return reinterpret_cast<Address>(pc_);
}
......@@ -144,12 +128,9 @@ Object** RelocInfo::target_object_address() {
// Provide a "natural pointer" to the embedded object,
// which can be de-referenced during heap iteration.
ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
// TODO(mips): Commenting out, to simplify arch-independent changes.
// GC won't work like this, but this commit is for asm/disasm/sim.
// reconstructed_obj_ptr_ =
// reinterpret_cast<Object*>(Assembler::target_address_at(pc_));
// return &reconstructed_obj_ptr_;
return NULL;
reconstructed_obj_ptr_ =
reinterpret_cast<Object*>(Assembler::target_address_at(pc_));
return &reconstructed_obj_ptr_;
}
......@@ -161,11 +142,8 @@ void RelocInfo::set_target_object(Object* target) {
Address* RelocInfo::target_reference_address() {
ASSERT(rmode_ == EXTERNAL_REFERENCE);
// TODO(mips): Commenting out, to simplify arch-independent changes.
// GC won't work like this, but this commit is for asm/disasm/sim.
// reconstructed_adr_ptr_ = Assembler::target_address_at(pc_);
// return &reconstructed_adr_ptr_;
return NULL;
reconstructed_adr_ptr_ = Assembler::target_address_at(pc_);
return &reconstructed_adr_ptr_;
}
......@@ -251,23 +229,18 @@ bool RelocInfo::IsPatchedDebugBreakSlotSequence() {
void RelocInfo::Visit(ObjectVisitor* visitor) {
RelocInfo::Mode mode = rmode();
if (mode == RelocInfo::EMBEDDED_OBJECT) {
// RelocInfo is needed when pointer must be updated/serialized, such as
// UpdatingVisitor in mark-compact.cc or Serializer in serialize.cc.
// It is ignored by visitors that do not need it.
// TODO(mips): Commenting out, to simplify arch-independent changes.
// GC won't work like this, but this commit is for asm/disasm/sim.
// visitor->VisitPointer(target_object_address(), this);
Object** p = target_object_address();
Object* orig = *p;
visitor->VisitPointer(p);
if (*p != orig) {
set_target_object(*p);
}
} else if (RelocInfo::IsCodeTarget(mode)) {
visitor->VisitCodeTarget(this);
} else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) {
visitor->VisitGlobalPropertyCell(this);
} else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
// RelocInfo is needed when external-references must be serialized by
// Serializer Visitor in serialize.cc. It is ignored by visitors that
// do not need it.
// TODO(mips): Commenting out, to simplify arch-independent changes.
// Serializer won't work like this, but this commit is for asm/disasm/sim.
// visitor->VisitExternalReference(target_reference_address(), this);
visitor->VisitExternalReference(target_reference_address());
#ifdef ENABLE_DEBUGGER_SUPPORT
// TODO(isolates): Get a cached isolate below.
} else if (((RelocInfo::IsJSReturn(mode) &&
......
......@@ -81,26 +81,5 @@ test-debug/DebugBreakLoop: SKIP
##############################################################################
[ $arch == mips ]
test-accessors: SKIP
test-alloc: SKIP
test-api: SKIP
test-compiler: SKIP
test-cpu-profiler: SKIP
test-debug: SKIP
test-decls: SKIP
test-deoptimization: SKIP
test-func-name-inference: SKIP
test-heap: SKIP
test-heap-profiler: SKIP
test-lockers: SKIP
test-log: SKIP
test-log-utils: SKIP
test-mark-compact: SKIP
test-parsing: SKIP
test-profile-generator: SKIP
test-regexp: SKIP
test-serialize: SKIP
test-sockets: SKIP
test-strings: SKIP
test-threads: SKIP
test-thread-termination: SKIP
......@@ -113,5 +113,29 @@ regress/regress-1132: SKIP
##############################################################################
[ $arch == mips ]
# Skip all tests on MIPS.
*: SKIP
# Skip long-running tests.
compiler/alloc-number: SKIP
compiler/array-length: SKIP
compiler/assignment-deopt: SKIP
compiler/deopt-args: SKIP
compiler/inline-compare: SKIP
compiler/inline-global-access: SKIP
compiler/optimized-function-calls: SKIP
compiler/pic: SKIP
compiler/property-calls: SKIP
compiler/recursive-deopt: SKIP
compiler/regress-4: SKIP
compiler/regress-funcaller: SKIP
compiler/regress-gvn: SKIP
compiler/regress-rep-change: SKIP
compiler/regress-arguments: SKIP
compiler/regress-funarguments: SKIP
compiler/regress-or: SKIP
compiler/regress-3249650: SKIP
compiler/simple-deopt: SKIP
regress/regress-490: SKIP
regress/regress-634: SKIP
regress/regress-create-exception: SKIP
regress/regress-3218915: SKIP
regress/regress-3247124: SKIP
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