// Restore lr with the value it had before the call to this stub (the value
// which must be pushed).
__ Mov(lr, saved_lr);
- if (save_doubles_ == kSaveFPRegs) {
- __ PushSafepointRegistersAndDoubles();
- } else {
- __ PushSafepointRegisters();
- }
+ __ PushSafepointRegisters();
__ Ret(return_address);
}
Register return_address = temps.AcquireX();
// Preserve the return address (lr will be clobbered by the pop).
__ Mov(return_address, lr);
- if (save_doubles_ == kSaveFPRegs) {
- __ PopSafepointRegistersAndDoubles();
- } else {
- __ PopSafepointRegisters();
- }
+ __ PopSafepointRegisters();
__ Ret(return_address);
}
void StoreRegistersStateStub::GenerateAheadOfTime(Isolate* isolate) {
- StoreRegistersStateStub stub1(isolate, kDontSaveFPRegs);
- stub1.GetCode();
- StoreRegistersStateStub stub2(isolate, kSaveFPRegs);
- stub2.GetCode();
+ StoreRegistersStateStub stub(isolate);
+ stub.GetCode();
}
void RestoreRegistersStateStub::GenerateAheadOfTime(Isolate* isolate) {
- RestoreRegistersStateStub stub1(isolate, kDontSaveFPRegs);
- stub1.GetCode();
- RestoreRegistersStateStub stub2(isolate, kSaveFPRegs);
- stub2.GetCode();
+ RestoreRegistersStateStub stub(isolate);
+ stub.GetCode();
}
class StoreRegistersStateStub: public PlatformCodeStub {
public:
- StoreRegistersStateStub(Isolate* isolate, SaveFPRegsMode with_fp)
- : PlatformCodeStub(isolate), save_doubles_(with_fp) {}
+ explicit StoreRegistersStateStub(Isolate* isolate)
+ : PlatformCodeStub(isolate) {}
static Register to_be_pushed_lr() { return ip0; }
static void GenerateAheadOfTime(Isolate* isolate);
private:
Major MajorKey() const { return StoreRegistersState; }
- int MinorKey() const { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; }
- SaveFPRegsMode save_doubles_;
+ int MinorKey() const { return 0; }
void Generate(MacroAssembler* masm);
};
class RestoreRegistersStateStub: public PlatformCodeStub {
public:
- RestoreRegistersStateStub(Isolate* isolate, SaveFPRegsMode with_fp)
- : PlatformCodeStub(isolate), save_doubles_(with_fp) {}
+ explicit RestoreRegistersStateStub(Isolate* isolate)
+ : PlatformCodeStub(isolate) {}
static void GenerateAheadOfTime(Isolate* isolate);
private:
Major MajorKey() const { return RestoreRegistersState; }
- int MinorKey() const { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; }
- SaveFPRegsMode save_doubles_;
+ int MinorKey() const { return 0; }
void Generate(MacroAssembler* masm);
};
}
-void LCodeGen::RecordSafepointWithRegistersAndDoubles(
- LPointerMap* pointers, int arguments, Safepoint::DeoptMode deopt_mode) {
- RecordSafepoint(
- pointers, Safepoint::kWithRegistersAndDoubles, arguments, deopt_mode);
-}
-
-
bool LCodeGen::GenerateCode() {
LPhase phase("Z_Code generation", chunk());
ASSERT(is_unused());
// contained in the register pointer map.
__ Mov(ToRegister(instr->result()), Smi::FromInt(0));
- PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters);
+ PushSafepointRegistersScope scope(this);
// We're in a SafepointRegistersScope so we can use any scratch registers.
Register size = x0;
if (instr->size()->IsConstantOperand()) {
void LCodeGen::DoDeferredInstanceMigration(LCheckMaps* instr, Register object) {
Register temp = ToRegister(instr->temp());
{
- PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters);
+ PushSafepointRegistersScope scope(this);
__ Push(object);
__ Mov(cp, 0);
__ CallRuntimeSaveDoubles(Runtime::kTryMigrateInstance);
flags = static_cast<InstanceofStub::Flags>(
flags | InstanceofStub::kCallSiteInlineCheck);
- PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters);
+ PushSafepointRegistersScope scope(this);
LoadContextFromDeferred(instr->context());
// Prepare InstanceofStub arguments.
__ Bind(&result_ok);
}
- { PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters);
+ { PushSafepointRegistersScope scope(this);
CallRuntimeFromDeferred(Runtime::kAllocateHeapNumber, 0, instr,
instr->context());
__ StoreToSafepointRegisterSlot(x0, result);
Register result = ToRegister(instr->result());
__ Mov(result, 0);
- PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters);
+ PushSafepointRegistersScope scope(this);
// NumberTagU and NumberTagD use the context from the frame, rather than
// the environment's HContext or HInlinedContext value.
// They only call Runtime::kAllocateHeapNumber.
__ Mov(dst, 0);
{
// Preserve the value of all registers.
- PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters);
+ PushSafepointRegistersScope scope(this);
// NumberTagU and NumberTagD use the context from the frame, rather than
// the environment's HContext or HInlinedContext value.
void LCodeGen::DoDeferredStackCheck(LStackCheck* instr) {
- PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters);
+ PushSafepointRegistersScope scope(this);
LoadContextFromDeferred(instr->context());
__ CallRuntimeSaveDoubles(Runtime::kStackGuard);
RecordSafepointWithLazyDeopt(
// contained in the register pointer map.
__ Mov(result, 0);
- PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters);
+ PushSafepointRegistersScope scope(this);
__ Push(string);
// Push the index as a smi. This is safe because of the checks in
// DoStringCharCodeAt above.
// contained in the register pointer map.
__ Mov(result, 0);
- PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters);
+ PushSafepointRegistersScope scope(this);
__ SmiTagAndPush(char_code);
CallRuntimeFromDeferred(Runtime::kCharFromCode, 1, instr, instr->context());
__ StoreToSafepointRegisterSlot(x0, result);
}
ASSERT(object.is(x0));
ASSERT(ToRegister(instr->context()).is(cp));
- PushSafepointRegistersScope scope(
- this, Safepoint::kWithRegistersAndDoubles);
+ PushSafepointRegistersScope scope(this);
__ Mov(x1, Operand(to_map));
bool is_js_array = from_map->instance_type() == JS_ARRAY_TYPE;
TransitionElementsKindStub stub(isolate(), from_kind, to_kind, is_js_array);
__ CallStub(&stub);
- RecordSafepointWithRegistersAndDoubles(
+ RecordSafepointWithRegisters(
instr->pointer_map(), 0, Safepoint::kLazyDeopt);
}
__ Bind(¬_applicable);
Register result,
Register object,
Register index) {
- PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters);
+ PushSafepointRegistersScope scope(this);
__ Push(object);
__ Push(index);
__ Mov(cp, 0);
void RecordSafepointWithRegisters(LPointerMap* pointers,
int arguments,
Safepoint::DeoptMode mode);
- void RecordSafepointWithRegistersAndDoubles(LPointerMap* pointers,
- int arguments,
- Safepoint::DeoptMode mode);
void RecordSafepointWithLazyDeopt(LInstruction* instr,
SafepointMode safepoint_mode);
class PushSafepointRegistersScope BASE_EMBEDDED {
public:
- PushSafepointRegistersScope(LCodeGen* codegen,
- Safepoint::Kind kind)
+ explicit PushSafepointRegistersScope(LCodeGen* codegen)
: codegen_(codegen) {
ASSERT(codegen_->info()->is_calling());
ASSERT(codegen_->expected_safepoint_kind_ == Safepoint::kSimple);
- codegen_->expected_safepoint_kind_ = kind;
+ codegen_->expected_safepoint_kind_ = Safepoint::kWithRegisters;
UseScratchRegisterScope temps(codegen_->masm_);
// Preserve the value of lr which must be saved on the stack (the call to
Register to_be_pushed_lr =
temps.UnsafeAcquire(StoreRegistersStateStub::to_be_pushed_lr());
codegen_->masm_->Mov(to_be_pushed_lr, lr);
- switch (codegen_->expected_safepoint_kind_) {
- case Safepoint::kWithRegisters: {
- StoreRegistersStateStub stub(codegen_->isolate(), kDontSaveFPRegs);
- codegen_->masm_->CallStub(&stub);
- break;
- }
- case Safepoint::kWithRegistersAndDoubles: {
- StoreRegistersStateStub stub(codegen_->isolate(), kSaveFPRegs);
- codegen_->masm_->CallStub(&stub);
- break;
- }
- default:
- UNREACHABLE();
- }
+ StoreRegistersStateStub stub(codegen_->isolate());
+ codegen_->masm_->CallStub(&stub);
}
~PushSafepointRegistersScope() {
- Safepoint::Kind kind = codegen_->expected_safepoint_kind_;
- ASSERT((kind & Safepoint::kWithRegisters) != 0);
- switch (kind) {
- case Safepoint::kWithRegisters: {
- RestoreRegistersStateStub stub(codegen_->isolate(), kDontSaveFPRegs);
- codegen_->masm_->CallStub(&stub);
- break;
- }
- case Safepoint::kWithRegistersAndDoubles: {
- RestoreRegistersStateStub stub(codegen_->isolate(), kSaveFPRegs);
- codegen_->masm_->CallStub(&stub);
- break;
- }
- default:
- UNREACHABLE();
- }
+ ASSERT(codegen_->expected_safepoint_kind_ == Safepoint::kWithRegisters);
+ RestoreRegistersStateStub stub(codegen_->isolate());
+ codegen_->masm_->CallStub(&stub);
codegen_->expected_safepoint_kind_ = Safepoint::kSimple;
}