| Index: src/arm/lithium-codegen-arm.h
|
| ===================================================================
|
| --- src/arm/lithium-codegen-arm.h (revision 7542)
|
| +++ src/arm/lithium-codegen-arm.h (working copy)
|
| @@ -57,7 +57,8 @@
|
| status_(UNUSED),
|
| deferred_(8),
|
| osr_pc_offset_(-1),
|
| - resolver_(this) {
|
| + resolver_(this),
|
| + expected_safepoint_kind_(Safepoint::kSimple) {
|
| PopulateDeoptimizationLiteralsWithInlinedFunctions();
|
| }
|
|
|
| @@ -167,12 +168,24 @@
|
| bool GenerateDeferredCode();
|
| bool GenerateSafepointTable();
|
|
|
| + enum SafepointMode {
|
| + RECORD_SIMPLE_SAFEPOINT,
|
| + RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS
|
| + };
|
| +
|
| void CallCode(Handle<Code> code,
|
| RelocInfo::Mode mode,
|
| LInstruction* instr);
|
| +
|
| + void CallCodeGeneric(Handle<Code> code,
|
| + RelocInfo::Mode mode,
|
| + LInstruction* instr,
|
| + SafepointMode safepoint_mode);
|
| +
|
| void CallRuntime(Runtime::Function* function,
|
| int num_arguments,
|
| LInstruction* instr);
|
| +
|
| void CallRuntime(Runtime::FunctionId id,
|
| int num_arguments,
|
| LInstruction* instr) {
|
| @@ -180,6 +193,10 @@
|
| CallRuntime(function, num_arguments, instr);
|
| }
|
|
|
| + void CallRuntimeFromDeferred(Runtime::FunctionId id,
|
| + int argc,
|
| + LInstruction* instr);
|
| +
|
| // Generate a direct call to a known function. Expects the function
|
| // to be in edi.
|
| void CallKnownFunction(Handle<JSFunction> function,
|
| @@ -188,7 +205,9 @@
|
|
|
| void LoadHeapObject(Register result, Handle<HeapObject> object);
|
|
|
| - void RegisterLazyDeoptimization(LInstruction* instr);
|
| + void RegisterLazyDeoptimization(LInstruction* instr,
|
| + SafepointMode safepoint_mode);
|
| +
|
| void RegisterEnvironmentForDeoptimization(LEnvironment* environment);
|
| void DeoptimizeIf(Condition cc, LEnvironment* environment);
|
|
|
| @@ -275,6 +294,48 @@
|
| // Compiler from a set of parallel moves to a sequential list of moves.
|
| LGapResolver resolver_;
|
|
|
| + Safepoint::Kind expected_safepoint_kind_;
|
| +
|
| + class PushSafepointRegistersScope BASE_EMBEDDED {
|
| + public:
|
| + PushSafepointRegistersScope(LCodeGen* codegen,
|
| + Safepoint::Kind kind)
|
| + : codegen_(codegen) {
|
| + ASSERT(codegen_->expected_safepoint_kind_ == Safepoint::kSimple);
|
| + codegen_->expected_safepoint_kind_ = kind;
|
| +
|
| + switch (codegen_->expected_safepoint_kind_) {
|
| + case Safepoint::kWithRegisters:
|
| + codegen_->masm_->PushSafepointRegisters();
|
| + break;
|
| + case Safepoint::kWithRegistersAndDoubles:
|
| + codegen_->masm_->PushSafepointRegistersAndDoubles();
|
| + break;
|
| + default:
|
| + UNREACHABLE();
|
| + }
|
| + }
|
| +
|
| + ~PushSafepointRegistersScope() {
|
| + Safepoint::Kind kind = codegen_->expected_safepoint_kind_;
|
| + ASSERT((kind & Safepoint::kWithRegisters) != 0);
|
| + switch (kind) {
|
| + case Safepoint::kWithRegisters:
|
| + codegen_->masm_->PopSafepointRegisters();
|
| + break;
|
| + case Safepoint::kWithRegistersAndDoubles:
|
| + codegen_->masm_->PopSafepointRegistersAndDoubles();
|
| + break;
|
| + default:
|
| + UNREACHABLE();
|
| + }
|
| + codegen_->expected_safepoint_kind_ = Safepoint::kSimple;
|
| + }
|
| +
|
| + private:
|
| + LCodeGen* codegen_;
|
| + };
|
| +
|
| friend class LDeferredCode;
|
| friend class LEnvironment;
|
| friend class SafepointGenerator;
|
|
|