mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 837016 - IonMonkey: store CodeLabels by value (r=h4writer)
--HG-- extra : rebase_source : e03d276c80dcdf29b6b9bec4627a93528f423ff6
This commit is contained in:
parent
e1fcffa30b
commit
1a7b142652
@ -748,8 +748,8 @@ void
|
||||
Assembler::processCodeLabels(IonCode *code)
|
||||
{
|
||||
for (size_t i = 0; i < codeLabels_.length(); i++) {
|
||||
CodeLabel *label = codeLabels_[i];
|
||||
Bind(code, label->dest(), code->raw() + actualOffset(label->src()->offset()));
|
||||
CodeLabel label = codeLabels_[i];
|
||||
Bind(code, label.dest(), code->raw() + actualOffset(label.src()->offset()));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1144,7 +1144,7 @@ Assembler::oom() const
|
||||
}
|
||||
|
||||
bool
|
||||
Assembler::addCodeLabel(CodeLabel *label)
|
||||
Assembler::addCodeLabel(CodeLabel label)
|
||||
{
|
||||
return codeLabels_.append(label);
|
||||
}
|
||||
|
@ -1172,7 +1172,7 @@ class Assembler
|
||||
// TODO: this should actually be a pool-like object
|
||||
// It is currently a big hack, and probably shouldn't exist
|
||||
class JumpPool;
|
||||
js::Vector<CodeLabel *, 0, SystemAllocPolicy> codeLabels_;
|
||||
js::Vector<CodeLabel, 0, SystemAllocPolicy> codeLabels_;
|
||||
js::Vector<RelativePatch, 8, SystemAllocPolicy> jumps_;
|
||||
js::Vector<JumpPool *, 0, SystemAllocPolicy> jumpPools_;
|
||||
js::Vector<BufferOffset, 0, SystemAllocPolicy> tmpJumpRelocations_;
|
||||
@ -1290,7 +1290,7 @@ class Assembler
|
||||
void copyDataRelocationTable(uint8_t *dest);
|
||||
void copyPreBarrierTable(uint8_t *dest);
|
||||
|
||||
bool addCodeLabel(CodeLabel *label);
|
||||
bool addCodeLabel(CodeLabel label);
|
||||
|
||||
// Size of the instruction stream, in bytes.
|
||||
size_t size() const;
|
||||
|
@ -875,7 +875,7 @@ CodeGeneratorARM::visitMoveGroup(LMoveGroup *group)
|
||||
class js::ion::OutOfLineTableSwitch : public OutOfLineCodeBase<CodeGeneratorARM>
|
||||
{
|
||||
MTableSwitch *mir_;
|
||||
Vector<CodeLabel*, 8, IonAllocPolicy> codeLabels_;
|
||||
Vector<CodeLabel, 8, IonAllocPolicy> codeLabels_;
|
||||
|
||||
bool accept(CodeGeneratorARM *codegen) {
|
||||
return codegen->visitOutOfLineTableSwitch(this);
|
||||
@ -890,10 +890,10 @@ class js::ion::OutOfLineTableSwitch : public OutOfLineCodeBase<CodeGeneratorARM>
|
||||
return mir_;
|
||||
}
|
||||
|
||||
bool addCodeLabel(CodeLabel *label) {
|
||||
bool addCodeLabel(CodeLabel label) {
|
||||
return codeLabels_.append(label);
|
||||
}
|
||||
CodeLabel *codeLabel(unsigned i) {
|
||||
CodeLabel codeLabel(unsigned i) {
|
||||
return codeLabels_[i];
|
||||
}
|
||||
};
|
||||
@ -911,8 +911,8 @@ CodeGeneratorARM::visitOutOfLineTableSwitch(OutOfLineTableSwitch *ool)
|
||||
|
||||
// The entries of the jump table need to be absolute addresses and thus
|
||||
// must be patched after codegen is finished.
|
||||
CodeLabel *cl = ool->codeLabel(i);
|
||||
cl->src()->bind(caseoffset);
|
||||
CodeLabel cl = ool->codeLabel(i);
|
||||
cl.src()->bind(caseoffset);
|
||||
if (!masm.addCodeLabel(cl))
|
||||
return false;
|
||||
}
|
||||
@ -965,8 +965,8 @@ CodeGeneratorARM::emitTableSwitchDispatch(MTableSwitch *mir, const Register &ind
|
||||
// instruction stream).
|
||||
OutOfLineTableSwitch *ool = new OutOfLineTableSwitch(mir);
|
||||
for (int32_t i = 0; i < cases; i++) {
|
||||
CodeLabel *cl = new CodeLabel();
|
||||
masm.writeCodePointer(cl->dest());
|
||||
CodeLabel cl;
|
||||
masm.writeCodePointer(cl.dest());
|
||||
if (!ool->addCodeLabel(cl))
|
||||
return false;
|
||||
}
|
||||
|
@ -319,7 +319,7 @@ struct AbsoluteLabel : public LabelBase
|
||||
|
||||
// A code label contains an absolute reference to a point in the code
|
||||
// Thus, it cannot be patched until after linking
|
||||
class CodeLabel : public TempObject
|
||||
class CodeLabel
|
||||
{
|
||||
// The destination position, where the absolute reference should get patched into
|
||||
AbsoluteLabel dest_;
|
||||
|
@ -94,8 +94,8 @@ void
|
||||
AssemblerX86Shared::processCodeLabels(IonCode *code)
|
||||
{
|
||||
for (size_t i = 0; i < codeLabels_.length(); i++) {
|
||||
CodeLabel *label = codeLabels_[i];
|
||||
Bind(code, label->dest(), code->raw() + label->src()->offset());
|
||||
CodeLabel label = codeLabels_[i];
|
||||
Bind(code, label.dest(), code->raw() + label.src()->offset());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ class AssemblerX86Shared
|
||||
{ }
|
||||
};
|
||||
|
||||
js::Vector<CodeLabel *, 0, SystemAllocPolicy> codeLabels_;
|
||||
js::Vector<CodeLabel, 0, SystemAllocPolicy> codeLabels_;
|
||||
js::Vector<RelativePatch, 8, SystemAllocPolicy> jumps_;
|
||||
CompactBufferWriter jumpRelocations_;
|
||||
CompactBufferWriter dataRelocations_;
|
||||
@ -170,7 +170,7 @@ class AssemblerX86Shared
|
||||
void copyDataRelocationTable(uint8_t *dest);
|
||||
void copyPreBarrierTable(uint8_t *dest);
|
||||
|
||||
bool addCodeLabel(CodeLabel *label) {
|
||||
bool addCodeLabel(CodeLabel label) {
|
||||
return codeLabels_.append(label);
|
||||
}
|
||||
|
||||
|
@ -1005,7 +1005,7 @@ CodeGeneratorX86Shared::visitMoveGroup(LMoveGroup *group)
|
||||
class OutOfLineTableSwitch : public OutOfLineCodeBase<CodeGeneratorX86Shared>
|
||||
{
|
||||
MTableSwitch *mir_;
|
||||
CodeLabel *jumpLabel_;
|
||||
CodeLabel jumpLabel_;
|
||||
|
||||
bool accept(CodeGeneratorX86Shared *codegen) {
|
||||
return codegen->visitOutOfLineTableSwitch(this);
|
||||
@ -1013,15 +1013,15 @@ class OutOfLineTableSwitch : public OutOfLineCodeBase<CodeGeneratorX86Shared>
|
||||
|
||||
public:
|
||||
OutOfLineTableSwitch(MTableSwitch *mir)
|
||||
: mir_(mir), jumpLabel_(new CodeLabel)
|
||||
: mir_(mir)
|
||||
{}
|
||||
|
||||
MTableSwitch *mir() const {
|
||||
return mir_;
|
||||
}
|
||||
|
||||
CodeLabel *jumpLabel() const {
|
||||
return jumpLabel_;
|
||||
CodeLabel *jumpLabel() {
|
||||
return &jumpLabel_;
|
||||
}
|
||||
};
|
||||
|
||||
@ -1032,7 +1032,7 @@ CodeGeneratorX86Shared::visitOutOfLineTableSwitch(OutOfLineTableSwitch *ool)
|
||||
|
||||
masm.align(sizeof(void*));
|
||||
masm.bind(ool->jumpLabel()->src());
|
||||
if (!masm.addCodeLabel(ool->jumpLabel()))
|
||||
if (!masm.addCodeLabel(*ool->jumpLabel()))
|
||||
return false;
|
||||
|
||||
for (size_t i = 0; i < mir->numCases(); i++) {
|
||||
@ -1042,9 +1042,9 @@ CodeGeneratorX86Shared::visitOutOfLineTableSwitch(OutOfLineTableSwitch *ool)
|
||||
|
||||
// The entries of the jump table need to be absolute addresses and thus
|
||||
// must be patched after codegen is finished.
|
||||
CodeLabel *cl = new CodeLabel();
|
||||
masm.writeCodePointer(cl->dest());
|
||||
cl->src()->bind(caseoffset);
|
||||
CodeLabel cl;
|
||||
masm.writeCodePointer(cl.dest());
|
||||
cl.src()->bind(caseoffset);
|
||||
if (!masm.addCodeLabel(cl))
|
||||
return false;
|
||||
}
|
||||
|
@ -365,20 +365,18 @@ class MacroAssemblerX86Shared : public Assembler
|
||||
bool buildFakeExitFrame(const Register &scratch, uint32_t *offset) {
|
||||
mozilla::DebugOnly<uint32_t> initialDepth = framePushed();
|
||||
|
||||
CodeLabel *cl = new CodeLabel();
|
||||
if (!addCodeLabel(cl))
|
||||
return false;
|
||||
mov(cl->dest(), scratch);
|
||||
CodeLabel cl;
|
||||
mov(cl.dest(), scratch);
|
||||
|
||||
uint32_t descriptor = MakeFrameDescriptor(framePushed(), IonFrame_OptimizedJS);
|
||||
Push(Imm32(descriptor));
|
||||
Push(scratch);
|
||||
|
||||
bind(cl->src());
|
||||
bind(cl.src());
|
||||
*offset = currentOffset();
|
||||
|
||||
JS_ASSERT(framePushed() == initialDepth + IonExitFrameLayout::Size());
|
||||
return true;
|
||||
return addCodeLabel(cl);
|
||||
}
|
||||
|
||||
bool buildOOLFakeExitFrame(void *fakeReturnAddr) {
|
||||
|
Loading…
Reference in New Issue
Block a user