MIPS[64]: Move TF parts of MacroAssembler into new TurboAssembler.
Port https://chromium-review.googlesource.com/559674. R=bmeurer@chromium.org Bug: v8:6048 Change-Id: Ia419f174a342d19a8cbd3581b9cad6d24e0fbe19 Reviewed-on: https://chromium-review.googlesource.com/566834 Reviewed-by: Michael Stanton <mvstanton@chromium.org> Commit-Queue: Georg Neis <neis@chromium.org> Cr-Commit-Position: refs/heads/master@{#46559}
This commit is contained in:
parent
ea535b90c4
commit
be35b22202
@ -267,13 +267,13 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
|
||||
Zone* zone_;
|
||||
};
|
||||
|
||||
#define CREATE_OOL_CLASS(ool_name, masm_ool_name, T) \
|
||||
#define CREATE_OOL_CLASS(ool_name, tasm_ool_name, T) \
|
||||
class ool_name final : public OutOfLineCode { \
|
||||
public: \
|
||||
ool_name(CodeGenerator* gen, T dst, T src1, T src2) \
|
||||
: OutOfLineCode(gen), dst_(dst), src1_(src1), src2_(src2) {} \
|
||||
\
|
||||
void Generate() final { __ masm_ool_name(dst_, src1_, src2_); } \
|
||||
void Generate() final { __ tasm_ool_name(dst_, src1_, src2_); } \
|
||||
\
|
||||
private: \
|
||||
T const dst_; \
|
||||
@ -573,7 +573,7 @@ void CodeGenerator::AssemblePopArgumentsAdaptorFrame(Register args_reg,
|
||||
|
||||
namespace {
|
||||
|
||||
void AdjustStackPointerForTailCall(MacroAssembler* masm,
|
||||
void AdjustStackPointerForTailCall(TurboAssembler* tasm,
|
||||
FrameAccessState* state,
|
||||
int new_slot_above_sp,
|
||||
bool allow_shrinkage = true) {
|
||||
@ -581,10 +581,10 @@ void AdjustStackPointerForTailCall(MacroAssembler* masm,
|
||||
StandardFrameConstants::kFixedSlotCountAboveFp;
|
||||
int stack_slot_delta = new_slot_above_sp - current_sp_offset;
|
||||
if (stack_slot_delta > 0) {
|
||||
masm->Subu(sp, sp, stack_slot_delta * kPointerSize);
|
||||
tasm->Subu(sp, sp, stack_slot_delta * kPointerSize);
|
||||
state->IncreaseSPDelta(stack_slot_delta);
|
||||
} else if (allow_shrinkage && stack_slot_delta < 0) {
|
||||
masm->Addu(sp, sp, -stack_slot_delta * kPointerSize);
|
||||
tasm->Addu(sp, sp, -stack_slot_delta * kPointerSize);
|
||||
state->IncreaseSPDelta(stack_slot_delta);
|
||||
}
|
||||
}
|
||||
@ -746,7 +746,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
}
|
||||
break;
|
||||
case kArchTruncateDoubleToI:
|
||||
__ TruncateDoubleToI(i.OutputRegister(), i.InputDoubleRegister(0));
|
||||
__ TruncateDoubleToIDelayed(zone(), i.OutputRegister(),
|
||||
i.InputDoubleRegister(0));
|
||||
break;
|
||||
case kArchStoreWithWriteBarrier: {
|
||||
RecordWriteMode mode =
|
||||
@ -2746,11 +2747,11 @@ static bool convertCondition(FlagsCondition condition, Condition& cc) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void AssembleBranchToLabels(CodeGenerator* gen, MacroAssembler* masm,
|
||||
void AssembleBranchToLabels(CodeGenerator* gen, TurboAssembler* tasm,
|
||||
Instruction* instr, FlagsCondition condition,
|
||||
Label* tlabel, Label* flabel, bool fallthru) {
|
||||
#undef __
|
||||
#define __ masm->
|
||||
#define __ tasm->
|
||||
|
||||
Condition cc = kNoCondition;
|
||||
// MIPS does not have condition code flags, so compare and branch are
|
||||
|
@ -267,13 +267,13 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
|
||||
Zone* zone_;
|
||||
};
|
||||
|
||||
#define CREATE_OOL_CLASS(ool_name, masm_ool_name, T) \
|
||||
#define CREATE_OOL_CLASS(ool_name, tasm_ool_name, T) \
|
||||
class ool_name final : public OutOfLineCode { \
|
||||
public: \
|
||||
ool_name(CodeGenerator* gen, T dst, T src1, T src2) \
|
||||
: OutOfLineCode(gen), dst_(dst), src1_(src1), src2_(src2) {} \
|
||||
\
|
||||
void Generate() final { __ masm_ool_name(dst_, src1_, src2_); } \
|
||||
void Generate() final { __ tasm_ool_name(dst_, src1_, src2_); } \
|
||||
\
|
||||
private: \
|
||||
T const dst_; \
|
||||
@ -611,7 +611,7 @@ void CodeGenerator::AssemblePopArgumentsAdaptorFrame(Register args_reg,
|
||||
|
||||
namespace {
|
||||
|
||||
void AdjustStackPointerForTailCall(MacroAssembler* masm,
|
||||
void AdjustStackPointerForTailCall(TurboAssembler* tasm,
|
||||
FrameAccessState* state,
|
||||
int new_slot_above_sp,
|
||||
bool allow_shrinkage = true) {
|
||||
@ -619,10 +619,10 @@ void AdjustStackPointerForTailCall(MacroAssembler* masm,
|
||||
StandardFrameConstants::kFixedSlotCountAboveFp;
|
||||
int stack_slot_delta = new_slot_above_sp - current_sp_offset;
|
||||
if (stack_slot_delta > 0) {
|
||||
masm->Dsubu(sp, sp, stack_slot_delta * kPointerSize);
|
||||
tasm->Dsubu(sp, sp, stack_slot_delta * kPointerSize);
|
||||
state->IncreaseSPDelta(stack_slot_delta);
|
||||
} else if (allow_shrinkage && stack_slot_delta < 0) {
|
||||
masm->Daddu(sp, sp, -stack_slot_delta * kPointerSize);
|
||||
tasm->Daddu(sp, sp, -stack_slot_delta * kPointerSize);
|
||||
state->IncreaseSPDelta(stack_slot_delta);
|
||||
}
|
||||
}
|
||||
@ -785,7 +785,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
}
|
||||
break;
|
||||
case kArchTruncateDoubleToI:
|
||||
__ TruncateDoubleToI(i.OutputRegister(), i.InputDoubleRegister(0));
|
||||
__ TruncateDoubleToIDelayed(zone(), i.OutputRegister(),
|
||||
i.InputDoubleRegister(0));
|
||||
break;
|
||||
case kArchStoreWithWriteBarrier: {
|
||||
RecordWriteMode mode =
|
||||
@ -3028,11 +3029,11 @@ static bool convertCondition(FlagsCondition condition, Condition& cc) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void AssembleBranchToLabels(CodeGenerator* gen, MacroAssembler* masm,
|
||||
void AssembleBranchToLabels(CodeGenerator* gen, TurboAssembler* tasm,
|
||||
Instruction* instr, FlagsCondition condition,
|
||||
Label* tlabel, Label* flabel, bool fallthru) {
|
||||
#undef __
|
||||
#define __ masm->
|
||||
#define __ tasm->
|
||||
MipsOperandConverter i(gen, instr);
|
||||
|
||||
Condition cc = kNoCondition;
|
||||
|
@ -471,7 +471,7 @@ class Operand BASE_EMBEDDED {
|
||||
RelocInfo::Mode rmode_;
|
||||
|
||||
friend class Assembler;
|
||||
friend class MacroAssembler;
|
||||
// friend class MacroAssembler;
|
||||
};
|
||||
|
||||
|
||||
@ -2263,7 +2263,11 @@ class Assembler : public AssemblerBase {
|
||||
// associated with each request). That is, for each request, it will patch the
|
||||
// dummy heap object handle that we emitted during code assembly with the
|
||||
// actual heap object handle.
|
||||
protected:
|
||||
// TODO(neis): Make private if its use can be moved out of TurboAssembler.
|
||||
void RequestHeapObject(HeapObjectRequest request);
|
||||
|
||||
private:
|
||||
void AllocateAndInstallRequestedHeapObjects(Isolate* isolate);
|
||||
|
||||
std::forward_list<HeapObjectRequest> heap_object_requests_;
|
||||
@ -2273,7 +2277,6 @@ class Assembler : public AssemblerBase {
|
||||
friend class CodePatcher;
|
||||
friend class BlockTrampolinePoolScope;
|
||||
friend class EnsureSpace;
|
||||
friend class MacroAssembler;
|
||||
};
|
||||
|
||||
|
||||
|
@ -2370,12 +2370,12 @@ void RecordWriteStub::CheckNeedsToInformIncrementalMarker(
|
||||
// Fall through when we need to inform the incremental marker.
|
||||
}
|
||||
|
||||
void ProfileEntryHookStub::MaybeCallEntryHookDelayed(MacroAssembler* masm,
|
||||
void ProfileEntryHookStub::MaybeCallEntryHookDelayed(TurboAssembler* tasm,
|
||||
Zone* zone) {
|
||||
if (masm->isolate()->function_entry_hook() != NULL) {
|
||||
__ push(ra);
|
||||
__ CallStubDelayed(new (zone) ProfileEntryHookStub(nullptr));
|
||||
__ pop(ra);
|
||||
if (tasm->isolate()->function_entry_hook() != NULL) {
|
||||
tasm->push(ra);
|
||||
tasm->CallStubDelayed(new (zone) ProfileEntryHookStub(nullptr));
|
||||
tasm->pop(ra);
|
||||
}
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -464,6 +464,8 @@ class Operand BASE_EMBEDDED {
|
||||
|
||||
Register rm() const { return rm_; }
|
||||
|
||||
RelocInfo::Mode rmode() const { return rmode_; }
|
||||
|
||||
private:
|
||||
Register rm_;
|
||||
union Value {
|
||||
@ -2314,7 +2316,11 @@ class Assembler : public AssemblerBase {
|
||||
// associated with each request). That is, for each request, it will patch the
|
||||
// dummy heap object handle that we emitted during code assembly with the
|
||||
// actual heap object handle.
|
||||
protected:
|
||||
// TODO(neis): Make private if its use can be moved out of TurboAssembler.
|
||||
void RequestHeapObject(HeapObjectRequest request);
|
||||
|
||||
private:
|
||||
void AllocateAndInstallRequestedHeapObjects(Isolate* isolate);
|
||||
|
||||
std::forward_list<HeapObjectRequest> heap_object_requests_;
|
||||
@ -2324,7 +2330,6 @@ class Assembler : public AssemblerBase {
|
||||
friend class CodePatcher;
|
||||
friend class BlockTrampolinePoolScope;
|
||||
friend class EnsureSpace;
|
||||
friend class MacroAssembler;
|
||||
};
|
||||
|
||||
|
||||
|
@ -2373,12 +2373,12 @@ void RecordWriteStub::CheckNeedsToInformIncrementalMarker(
|
||||
// Fall through when we need to inform the incremental marker.
|
||||
}
|
||||
|
||||
void ProfileEntryHookStub::MaybeCallEntryHookDelayed(MacroAssembler* masm,
|
||||
void ProfileEntryHookStub::MaybeCallEntryHookDelayed(TurboAssembler* tasm,
|
||||
Zone* zone) {
|
||||
if (masm->isolate()->function_entry_hook() != NULL) {
|
||||
__ push(ra);
|
||||
__ CallStubDelayed(new (zone) ProfileEntryHookStub(nullptr));
|
||||
__ pop(ra);
|
||||
if (tasm->isolate()->function_entry_hook() != NULL) {
|
||||
tasm->push(ra);
|
||||
tasm->CallStubDelayed(new (zone) ProfileEntryHookStub(nullptr));
|
||||
tasm->pop(ra);
|
||||
}
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user