ARM: never record safepoint with doubles
R=bmeurer@chromium.org, ulan@chromium.org BUG= Review URL: https://codereview.chromium.org/408473002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22496 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
8023c9f564
commit
e4d4f1d5d2
@ -1055,15 +1055,6 @@ void LCodeGen::RecordSafepointWithRegisters(LPointerMap* pointers,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LCodeGen::RecordSafepointWithRegistersAndDoubles(
|
|
||||||
LPointerMap* pointers,
|
|
||||||
int arguments,
|
|
||||||
Safepoint::DeoptMode deopt_mode) {
|
|
||||||
RecordSafepoint(
|
|
||||||
pointers, Safepoint::kWithRegistersAndDoubles, arguments, deopt_mode);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void LCodeGen::RecordAndWritePosition(int position) {
|
void LCodeGen::RecordAndWritePosition(int position) {
|
||||||
if (position == RelocInfo::kNoPosition) return;
|
if (position == RelocInfo::kNoPosition) return;
|
||||||
masm()->positions_recorder()->RecordPosition(position);
|
masm()->positions_recorder()->RecordPosition(position);
|
||||||
@ -2883,7 +2874,7 @@ void LCodeGen::DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr,
|
|||||||
flags | InstanceofStub::kReturnTrueFalseObject);
|
flags | InstanceofStub::kReturnTrueFalseObject);
|
||||||
InstanceofStub stub(isolate(), flags);
|
InstanceofStub stub(isolate(), flags);
|
||||||
|
|
||||||
PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters);
|
PushSafepointRegistersScope scope(this);
|
||||||
LoadContextFromDeferred(instr->context());
|
LoadContextFromDeferred(instr->context());
|
||||||
|
|
||||||
__ Move(InstanceofStub::right(), instr->function());
|
__ Move(InstanceofStub::right(), instr->function());
|
||||||
@ -3696,7 +3687,7 @@ void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LMathAbs* instr) {
|
|||||||
// Input is negative. Reverse its sign.
|
// Input is negative. Reverse its sign.
|
||||||
// Preserve the value of all registers.
|
// Preserve the value of all registers.
|
||||||
{
|
{
|
||||||
PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters);
|
PushSafepointRegistersScope scope(this);
|
||||||
|
|
||||||
// Registers were saved at the safepoint, so we can use
|
// Registers were saved at the safepoint, so we can use
|
||||||
// many scratch registers.
|
// many scratch registers.
|
||||||
@ -4450,13 +4441,12 @@ void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) {
|
|||||||
} else {
|
} else {
|
||||||
ASSERT(ToRegister(instr->context()).is(cp));
|
ASSERT(ToRegister(instr->context()).is(cp));
|
||||||
ASSERT(object_reg.is(r0));
|
ASSERT(object_reg.is(r0));
|
||||||
PushSafepointRegistersScope scope(
|
PushSafepointRegistersScope scope(this);
|
||||||
this, Safepoint::kWithRegistersAndDoubles);
|
|
||||||
__ Move(r1, to_map);
|
__ Move(r1, to_map);
|
||||||
bool is_js_array = from_map->instance_type() == JS_ARRAY_TYPE;
|
bool is_js_array = from_map->instance_type() == JS_ARRAY_TYPE;
|
||||||
TransitionElementsKindStub stub(isolate(), from_kind, to_kind, is_js_array);
|
TransitionElementsKindStub stub(isolate(), from_kind, to_kind, is_js_array);
|
||||||
__ CallStub(&stub);
|
__ CallStub(&stub);
|
||||||
RecordSafepointWithRegistersAndDoubles(
|
RecordSafepointWithRegisters(
|
||||||
instr->pointer_map(), 0, Safepoint::kLazyDeopt);
|
instr->pointer_map(), 0, Safepoint::kLazyDeopt);
|
||||||
}
|
}
|
||||||
__ bind(¬_applicable);
|
__ bind(¬_applicable);
|
||||||
@ -4519,7 +4509,7 @@ void LCodeGen::DoDeferredStringCharCodeAt(LStringCharCodeAt* instr) {
|
|||||||
// contained in the register pointer map.
|
// contained in the register pointer map.
|
||||||
__ mov(result, Operand::Zero());
|
__ mov(result, Operand::Zero());
|
||||||
|
|
||||||
PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters);
|
PushSafepointRegistersScope scope(this);
|
||||||
__ push(string);
|
__ push(string);
|
||||||
// Push the index as a smi. This is safe because of the checks in
|
// Push the index as a smi. This is safe because of the checks in
|
||||||
// DoStringCharCodeAt above.
|
// DoStringCharCodeAt above.
|
||||||
@ -4582,7 +4572,7 @@ void LCodeGen::DoDeferredStringCharFromCode(LStringCharFromCode* instr) {
|
|||||||
// contained in the register pointer map.
|
// contained in the register pointer map.
|
||||||
__ mov(result, Operand::Zero());
|
__ mov(result, Operand::Zero());
|
||||||
|
|
||||||
PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters);
|
PushSafepointRegistersScope scope(this);
|
||||||
__ SmiTag(char_code);
|
__ SmiTag(char_code);
|
||||||
__ push(char_code);
|
__ push(char_code);
|
||||||
CallRuntimeFromDeferred(Runtime::kCharFromCode, 1, instr, instr->context());
|
CallRuntimeFromDeferred(Runtime::kCharFromCode, 1, instr, instr->context());
|
||||||
@ -4715,7 +4705,7 @@ void LCodeGen::DoDeferredNumberTagIU(LInstruction* instr,
|
|||||||
__ mov(dst, Operand::Zero());
|
__ mov(dst, Operand::Zero());
|
||||||
|
|
||||||
// Preserve the value of all registers.
|
// Preserve the value of all registers.
|
||||||
PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters);
|
PushSafepointRegistersScope scope(this);
|
||||||
|
|
||||||
// NumberTagI and NumberTagD use the context from the frame, rather than
|
// NumberTagI and NumberTagD use the context from the frame, rather than
|
||||||
// the environment's HContext or HInlinedContext value.
|
// the environment's HContext or HInlinedContext value.
|
||||||
@ -4780,7 +4770,7 @@ void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) {
|
|||||||
Register reg = ToRegister(instr->result());
|
Register reg = ToRegister(instr->result());
|
||||||
__ mov(reg, Operand::Zero());
|
__ mov(reg, Operand::Zero());
|
||||||
|
|
||||||
PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters);
|
PushSafepointRegistersScope scope(this);
|
||||||
// NumberTagI and NumberTagD use the context from the frame, rather than
|
// NumberTagI and NumberTagD use the context from the frame, rather than
|
||||||
// the environment's HContext or HInlinedContext value.
|
// the environment's HContext or HInlinedContext value.
|
||||||
// They only call Runtime::kAllocateHeapNumber.
|
// They only call Runtime::kAllocateHeapNumber.
|
||||||
@ -5144,7 +5134,7 @@ void LCodeGen::DoCheckValue(LCheckValue* instr) {
|
|||||||
|
|
||||||
void LCodeGen::DoDeferredInstanceMigration(LCheckMaps* instr, Register object) {
|
void LCodeGen::DoDeferredInstanceMigration(LCheckMaps* instr, Register object) {
|
||||||
{
|
{
|
||||||
PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters);
|
PushSafepointRegistersScope scope(this);
|
||||||
__ push(object);
|
__ push(object);
|
||||||
__ mov(cp, Operand::Zero());
|
__ mov(cp, Operand::Zero());
|
||||||
__ CallRuntimeSaveDoubles(Runtime::kTryMigrateInstance);
|
__ CallRuntimeSaveDoubles(Runtime::kTryMigrateInstance);
|
||||||
@ -5361,7 +5351,7 @@ void LCodeGen::DoDeferredAllocate(LAllocate* instr) {
|
|||||||
// contained in the register pointer map.
|
// contained in the register pointer map.
|
||||||
__ mov(result, Operand(Smi::FromInt(0)));
|
__ mov(result, Operand(Smi::FromInt(0)));
|
||||||
|
|
||||||
PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters);
|
PushSafepointRegistersScope scope(this);
|
||||||
if (instr->size()->IsRegister()) {
|
if (instr->size()->IsRegister()) {
|
||||||
Register size = ToRegister(instr->size());
|
Register size = ToRegister(instr->size());
|
||||||
ASSERT(!size.is(result));
|
ASSERT(!size.is(result));
|
||||||
@ -5650,7 +5640,7 @@ void LCodeGen::DoDummyUse(LDummyUse* instr) {
|
|||||||
|
|
||||||
|
|
||||||
void LCodeGen::DoDeferredStackCheck(LStackCheck* instr) {
|
void LCodeGen::DoDeferredStackCheck(LStackCheck* instr) {
|
||||||
PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters);
|
PushSafepointRegistersScope scope(this);
|
||||||
LoadContextFromDeferred(instr->context());
|
LoadContextFromDeferred(instr->context());
|
||||||
__ CallRuntimeSaveDoubles(Runtime::kStackGuard);
|
__ CallRuntimeSaveDoubles(Runtime::kStackGuard);
|
||||||
RecordSafepointWithLazyDeopt(
|
RecordSafepointWithLazyDeopt(
|
||||||
@ -5797,7 +5787,7 @@ void LCodeGen::DoDeferredLoadMutableDouble(LLoadFieldByIndex* instr,
|
|||||||
Register result,
|
Register result,
|
||||||
Register object,
|
Register object,
|
||||||
Register index) {
|
Register index) {
|
||||||
PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters);
|
PushSafepointRegistersScope scope(this);
|
||||||
__ Push(object);
|
__ Push(object);
|
||||||
__ Push(index);
|
__ Push(index);
|
||||||
__ mov(cp, Operand::Zero());
|
__ mov(cp, Operand::Zero());
|
||||||
|
@ -270,9 +270,6 @@ class LCodeGen: public LCodeGenBase {
|
|||||||
void RecordSafepointWithRegisters(LPointerMap* pointers,
|
void RecordSafepointWithRegisters(LPointerMap* pointers,
|
||||||
int arguments,
|
int arguments,
|
||||||
Safepoint::DeoptMode mode);
|
Safepoint::DeoptMode mode);
|
||||||
void RecordSafepointWithRegistersAndDoubles(LPointerMap* pointers,
|
|
||||||
int arguments,
|
|
||||||
Safepoint::DeoptMode mode);
|
|
||||||
|
|
||||||
void RecordAndWritePosition(int position) V8_OVERRIDE;
|
void RecordAndWritePosition(int position) V8_OVERRIDE;
|
||||||
|
|
||||||
@ -356,38 +353,17 @@ class LCodeGen: public LCodeGenBase {
|
|||||||
|
|
||||||
class PushSafepointRegistersScope V8_FINAL BASE_EMBEDDED {
|
class PushSafepointRegistersScope V8_FINAL BASE_EMBEDDED {
|
||||||
public:
|
public:
|
||||||
PushSafepointRegistersScope(LCodeGen* codegen,
|
explicit PushSafepointRegistersScope(LCodeGen* codegen)
|
||||||
Safepoint::Kind kind)
|
|
||||||
: codegen_(codegen) {
|
: codegen_(codegen) {
|
||||||
ASSERT(codegen_->info()->is_calling());
|
ASSERT(codegen_->info()->is_calling());
|
||||||
ASSERT(codegen_->expected_safepoint_kind_ == Safepoint::kSimple);
|
ASSERT(codegen_->expected_safepoint_kind_ == Safepoint::kSimple);
|
||||||
codegen_->expected_safepoint_kind_ = kind;
|
codegen_->expected_safepoint_kind_ = Safepoint::kWithRegisters;
|
||||||
|
codegen_->masm_->PushSafepointRegisters();
|
||||||
switch (codegen_->expected_safepoint_kind_) {
|
|
||||||
case Safepoint::kWithRegisters:
|
|
||||||
codegen_->masm_->PushSafepointRegisters();
|
|
||||||
break;
|
|
||||||
case Safepoint::kWithRegistersAndDoubles:
|
|
||||||
codegen_->masm_->PushSafepointRegistersAndDoubles();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
UNREACHABLE();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~PushSafepointRegistersScope() {
|
~PushSafepointRegistersScope() {
|
||||||
Safepoint::Kind kind = codegen_->expected_safepoint_kind_;
|
ASSERT(codegen_->expected_safepoint_kind_ == Safepoint::kWithRegisters);
|
||||||
ASSERT((kind & Safepoint::kWithRegisters) != 0);
|
codegen_->masm_->PopSafepointRegisters();
|
||||||
switch (kind) {
|
|
||||||
case Safepoint::kWithRegisters:
|
|
||||||
codegen_->masm_->PopSafepointRegisters();
|
|
||||||
break;
|
|
||||||
case Safepoint::kWithRegistersAndDoubles:
|
|
||||||
codegen_->masm_->PopSafepointRegistersAndDoubles();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
UNREACHABLE();
|
|
||||||
}
|
|
||||||
codegen_->expected_safepoint_kind_ = Safepoint::kSimple;
|
codegen_->expected_safepoint_kind_ = Safepoint::kSimple;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -727,39 +727,6 @@ void MacroAssembler::PopSafepointRegisters() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MacroAssembler::PushSafepointRegistersAndDoubles() {
|
|
||||||
// Number of d-regs not known at snapshot time.
|
|
||||||
ASSERT(!serializer_enabled());
|
|
||||||
PushSafepointRegisters();
|
|
||||||
// Only save allocatable registers.
|
|
||||||
ASSERT(kScratchDoubleReg.is(d15) && kDoubleRegZero.is(d14));
|
|
||||||
ASSERT(DwVfpRegister::NumReservedRegisters() == 2);
|
|
||||||
if (CpuFeatures::IsSupported(VFP32DREGS)) {
|
|
||||||
vstm(db_w, sp, d16, d31);
|
|
||||||
}
|
|
||||||
vstm(db_w, sp, d0, d13);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void MacroAssembler::PopSafepointRegistersAndDoubles() {
|
|
||||||
// Number of d-regs not known at snapshot time.
|
|
||||||
ASSERT(!serializer_enabled());
|
|
||||||
// Only save allocatable registers.
|
|
||||||
ASSERT(kScratchDoubleReg.is(d15) && kDoubleRegZero.is(d14));
|
|
||||||
ASSERT(DwVfpRegister::NumReservedRegisters() == 2);
|
|
||||||
vldm(ia_w, sp, d0, d13);
|
|
||||||
if (CpuFeatures::IsSupported(VFP32DREGS)) {
|
|
||||||
vldm(ia_w, sp, d16, d31);
|
|
||||||
}
|
|
||||||
PopSafepointRegisters();
|
|
||||||
}
|
|
||||||
|
|
||||||
void MacroAssembler::StoreToSafepointRegistersAndDoublesSlot(Register src,
|
|
||||||
Register dst) {
|
|
||||||
str(src, SafepointRegistersAndDoublesSlot(dst));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void MacroAssembler::StoreToSafepointRegisterSlot(Register src, Register dst) {
|
void MacroAssembler::StoreToSafepointRegisterSlot(Register src, Register dst) {
|
||||||
str(src, SafepointRegisterSlot(dst));
|
str(src, SafepointRegisterSlot(dst));
|
||||||
}
|
}
|
||||||
|
@ -443,12 +443,9 @@ class MacroAssembler: public Assembler {
|
|||||||
// RegList constant kSafepointSavedRegisters.
|
// RegList constant kSafepointSavedRegisters.
|
||||||
void PushSafepointRegisters();
|
void PushSafepointRegisters();
|
||||||
void PopSafepointRegisters();
|
void PopSafepointRegisters();
|
||||||
void PushSafepointRegistersAndDoubles();
|
|
||||||
void PopSafepointRegistersAndDoubles();
|
|
||||||
// Store value in register src in the safepoint stack slot for
|
// Store value in register src in the safepoint stack slot for
|
||||||
// register dst.
|
// register dst.
|
||||||
void StoreToSafepointRegisterSlot(Register src, Register dst);
|
void StoreToSafepointRegisterSlot(Register src, Register dst);
|
||||||
void StoreToSafepointRegistersAndDoublesSlot(Register src, Register dst);
|
|
||||||
// Load the value of the src register from its safepoint stack slot
|
// Load the value of the src register from its safepoint stack slot
|
||||||
// into register dst.
|
// into register dst.
|
||||||
void LoadFromSafepointRegisterSlot(Register dst, Register src);
|
void LoadFromSafepointRegisterSlot(Register dst, Register src);
|
||||||
|
Loading…
Reference in New Issue
Block a user