From 1231359944e3f5a9f25b979fdef713458ce078dd Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 12 Oct 2011 15:57:14 -0700 Subject: [PATCH] Fix ARM build. --- js/src/ion/IonMacroAssembler.cpp | 4 ++-- js/src/ion/arm/Assembler-arm.cpp | 15 ++++++++++++++- js/src/ion/arm/Assembler-arm.h | 15 ++++++++++++--- js/src/ion/arm/CodeGenerator-arm.cpp | 4 ++-- js/src/ion/arm/MacroAssembler-arm.h | 26 +++++++++++++++++++++++++- 5 files changed, 55 insertions(+), 9 deletions(-) diff --git a/js/src/ion/IonMacroAssembler.cpp b/js/src/ion/IonMacroAssembler.cpp index 4424f6fe736..4e20e6eac9a 100644 --- a/js/src/ion/IonMacroAssembler.cpp +++ b/js/src/ion/IonMacroAssembler.cpp @@ -167,7 +167,7 @@ MacroAssembler::guardTypeSet(const T &address, types::TypeSet *types, if (JSObject *object = types->getSingleObject(i)) branchPtr(Equal, obj, ImmGCPtr(object), &matched); } - jmp(mismatched); + jump(mismatched); bind(¬Singleton); loadPtr(Address(obj, JSObject::offsetOfType()), scratch); @@ -177,7 +177,7 @@ MacroAssembler::guardTypeSet(const T &address, types::TypeSet *types, } } - jmp(mismatched); + jump(mismatched); bind(&matched); } diff --git a/js/src/ion/arm/Assembler-arm.cpp b/js/src/ion/arm/Assembler-arm.cpp index 58252381e54..588fe249e5f 100644 --- a/js/src/ion/arm/Assembler-arm.cpp +++ b/js/src/ion/arm/Assembler-arm.cpp @@ -116,6 +116,12 @@ Assembler::TraceJumpRelocations(JSTracer *trc, IonCode *code, CompactBufferReade #endif } +void +Assembler::TraceDataRelocations(JSTracer *trc, IonCode *code, CompactBufferReader &reader) +{ + JS_NOT_REACHED("Feature NYI"); +} + void Assembler::copyJumpRelocationTable(uint8 *dest) { @@ -123,10 +129,17 @@ Assembler::copyJumpRelocationTable(uint8 *dest) memcpy(dest, jumpRelocations_.buffer(), jumpRelocations_.length()); } +void +Assembler::copyDataRelocationTable(uint8 *dest) +{ + if (dataRelocations_.length()) + memcpy(dest, dataRelocations_.buffer(), dataRelocations_.length()); +} + void Assembler::trace(JSTracer *trc) { - JS_NOT_REACHED("Feature NYI"); + JS_NOT_REACHED("Feature NYI - must trace jump and data"); #if 0 for (size_t i = 0; i < jumps_.length(); i++) { RelativePatch &rp = jumps_[i]; diff --git a/js/src/ion/arm/Assembler-arm.h b/js/src/ion/arm/Assembler-arm.h index f71f2ff52f5..d49090bef88 100644 --- a/js/src/ion/arm/Assembler-arm.h +++ b/js/src/ion/arm/Assembler-arm.h @@ -785,6 +785,7 @@ class Assembler js::Vector codeLabels_; js::Vector jumps_; CompactBufferWriter jumpRelocations_; + CompactBufferWriter dataRelocations_; size_t dataBytesNeeded_; bool enoughMemory_; @@ -849,6 +850,7 @@ class Assembler void processDeferredData(IonCode *code, uint8 *data); void processCodeLabels(IonCode *code); void copyJumpRelocationTable(uint8 *buffer); + void copyDataRelocationTable(uint8 *buffer); bool addDeferredData(DeferredData *data, size_t bytes) { data->setOffset(dataBytesNeeded_); @@ -867,15 +869,21 @@ class Assembler return m_buffer.uncheckedSize(); } // Size of the jump relocation table, in bytes. - size_t jumpRelocationTableSize() const { - return relocations_.length(); + size_t jumpRelocationTableBytes() const { + return jumpRelocations_.length(); + } + size_t dataRelocationTableBytes() const { + return dataRelocations_.length(); } // Size of the data table, in bytes. size_t dataSize() const { return dataBytesNeeded_; } size_t bytesNeeded() const { - return size() + dataSize() + jumpRelocationTableSize(); + return size() + + dataSize() + + jumpRelocationTableBytes() + + dataRelocationTableBytes(); } // write a blob of binary into the instruction stream void writeBlob(uint32 x) @@ -1395,6 +1403,7 @@ class Assembler #endif public: static void TraceJumpRelocations(JSTracer *trc, IonCode *code, CompactBufferReader &reader); + static void TraceDataRelocations(JSTracer *trc, IonCode *code, CompactBufferReader &reader); // The buffer is about to be linked, make sure any constant pools or excess // bookkeeping has been flushed to the instruction stream. diff --git a/js/src/ion/arm/CodeGenerator-arm.cpp b/js/src/ion/arm/CodeGenerator-arm.cpp index 85668f6e7df..b5621ee9651 100644 --- a/js/src/ion/arm/CodeGenerator-arm.cpp +++ b/js/src/ion/arm/CodeGenerator-arm.cpp @@ -636,7 +636,7 @@ CodeGeneratorARM::ToValue(LInstruction *ins, size_t pos) } bool - CodeGeneratorARM::visitValue(LValue *value) +CodeGeneratorARM::visitValue(LValue *value) { jsval_layout jv = JSVAL_TO_IMPL(value->value()); @@ -645,7 +645,7 @@ bool masm.ma_mov(Imm32(jv.s.tag), ToRegister(type)); if (value->value().isMarkable()) - masm.ma_mov(ImmGCPtr(jv.s.payload.ptr), ToRegister(payload)); + masm.ma_mov(ImmGCPtr((gc::Cell *)jv.s.payload.ptr), ToRegister(payload)); else masm.ma_mov(Imm32(jv.s.payload.u32), ToRegister(payload)); return true; diff --git a/js/src/ion/arm/MacroAssembler-arm.h b/js/src/ion/arm/MacroAssembler-arm.h index 30c78864cba..e1d55bc393a 100644 --- a/js/src/ion/arm/MacroAssembler-arm.h +++ b/js/src/ion/arm/MacroAssembler-arm.h @@ -614,6 +614,9 @@ public: framePushed_ -= amount; } + void branchTest32(Condition cond, const Address &address, Imm32 imm, Label *label) { + JS_NOT_REACHED("NYI"); + } void branchPtr(Condition cond, Register lhs, ImmGCPtr ptr, Label *label) { JS_NOT_REACHED("NYI"); } @@ -729,6 +732,24 @@ public: VFPRegister(dest), FloatToCore); } + // Extended unboxing API. If the payload is already in a register, returns + // that register. Otherwise, provides a move to the given scratch register, + // and returns that. + Register extractObject(const Address &address, Register scratch) { + JS_NOT_REACHED("NYI"); + return scratch; + } + Register extractObject(const ValueOperand &value, Register scratch) { + return value.payloadReg(); + } + Register extractTag(const Address &address, Register scratch) { + JS_NOT_REACHED("NYI"); + return scratch; + } + Register extractTag(const ValueOperand &value, Register scratch) { + return value.typeReg(); + } + void boolValueToDouble(const ValueOperand &operand, const FloatRegister &dest) { JS_NOT_REACHED("Codegen for boolValueToDouble NYI"); #if 0 @@ -843,7 +864,10 @@ public: void branchTestUndefined(Condition cond, const T & t, Label *label) { JS_NOT_REACHED("feature NYI"); } - + template + void branchTestNumber(Condition cond, const T &t, Label *label) { + JS_NOT_REACHED("feature NYI"); + } template void branchTestBooleanTruthy(bool b, const T & t, Label *label) {