Index: src/mips/lithium-codegen-mips.cc |
diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc |
index fc4ff306c5a83b0d26c778f2aedfc0937533bc1a..194652562216c6bee905e3adce078794cfd591c8 100644 |
--- a/src/mips/lithium-codegen-mips.cc |
+++ b/src/mips/lithium-codegen-mips.cc |
@@ -65,7 +65,7 @@ bool LCodeGen::GenerateCode() { |
HPhase phase("Z_Code generation", chunk()); |
ASSERT(is_unused()); |
status_ = GENERATING; |
- CpuFeatures::Scope scope(FPU); |
+ CpuFeatureScope scope(masm(), FPU); |
// Open a frame scope to indicate that there is a frame on the stack. The |
// NONE indicates that the scope shouldn't actually generate code to set up |
@@ -194,7 +194,7 @@ bool LCodeGen::GeneratePrologue() { |
} |
if (info()->saves_caller_doubles() && CpuFeatures::IsSupported(FPU)) { |
- CpuFeatures::Scope scope(FPU); |
+ CpuFeatureScope scope(masm(), FPU); |
Comment(";;; Save clobbered callee double registers"); |
int count = 0; |
BitVector* doubles = chunk()->allocated_double_registers(); |
@@ -1474,7 +1474,7 @@ void LCodeGen::DoConstantI(LConstantI* instr) { |
void LCodeGen::DoConstantD(LConstantD* instr) { |
ASSERT(instr->result()->IsDoubleRegister()); |
DoubleRegister result = ToDoubleRegister(instr->result()); |
- CpuFeatures::Scope scope(FPU); |
+ CpuFeatureScope scope(masm(), FPU); |
double v = instr->value(); |
__ Move(result, v); |
} |
@@ -1672,7 +1672,7 @@ void LCodeGen::DoMathMinMax(LMathMinMax* instr) { |
__ bind(&done); |
} else { |
ASSERT(instr->hydrogen()->representation().IsDouble()); |
- CpuFeatures::Scope scope(FPU); |
+ CpuFeatureScope scope(masm(), FPU); |
FPURegister left_reg = ToDoubleRegister(left); |
FPURegister right_reg = ToDoubleRegister(right); |
FPURegister result_reg = ToDoubleRegister(instr->result()); |
@@ -1713,7 +1713,7 @@ void LCodeGen::DoMathMinMax(LMathMinMax* instr) { |
void LCodeGen::DoArithmeticD(LArithmeticD* instr) { |
- CpuFeatures::Scope scope(FPU); |
+ CpuFeatureScope scope(masm(), FPU); |
DoubleRegister left = ToDoubleRegister(instr->left()); |
DoubleRegister right = ToDoubleRegister(instr->right()); |
DoubleRegister result = ToDoubleRegister(instr->result()); |
@@ -1823,7 +1823,7 @@ void LCodeGen::DoBranch(LBranch* instr) { |
Register reg = ToRegister(instr->value()); |
EmitBranch(true_block, false_block, ne, reg, Operand(zero_reg)); |
} else if (r.IsDouble()) { |
- CpuFeatures::Scope scope(FPU); |
+ CpuFeatureScope scope(masm(), FPU); |
DoubleRegister reg = ToDoubleRegister(instr->value()); |
// Test the double value. Zero and NaN are false. |
EmitBranchF(true_block, false_block, ne, reg, kDoubleRegZero); |
@@ -1901,7 +1901,7 @@ void LCodeGen::DoBranch(LBranch* instr) { |
} |
if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { |
- CpuFeatures::Scope scope(FPU); |
+ CpuFeatureScope scope(masm(), FPU); |
// heap number -> false iff +0, -0, or NaN. |
DoubleRegister dbl_scratch = double_scratch0(); |
Label not_heap_number; |
@@ -1981,7 +1981,7 @@ void LCodeGen::DoCmpIDAndBranch(LCmpIDAndBranch* instr) { |
EmitGoto(next_block); |
} else { |
if (instr->is_double()) { |
- CpuFeatures::Scope scope(FPU); |
+ CpuFeatureScope scope(masm(), FPU); |
// Compare left and right as doubles and load the |
// resulting flags into the normal status register. |
FPURegister left_reg = ToDoubleRegister(left); |
@@ -2544,7 +2544,7 @@ void LCodeGen::DoReturn(LReturn* instr) { |
__ CallRuntime(Runtime::kTraceExit, 1); |
} |
if (info()->saves_caller_doubles() && CpuFeatures::IsSupported(FPU)) { |
- CpuFeatures::Scope scope(FPU); |
+ CpuFeatureScope scope(masm(), FPU); |
ASSERT(NeedsEagerFrame()); |
BitVector* doubles = chunk()->allocated_double_registers(); |
BitVector::Iterator save_iterator(doubles); |
@@ -2923,7 +2923,7 @@ void LCodeGen::DoLoadKeyedExternalArray(LLoadKeyed* instr) { |
__ Addu(scratch0(), scratch0(), external_pointer); |
} |
if (CpuFeatures::IsSupported(FPU)) { |
- CpuFeatures::Scope scope(FPU); |
+ CpuFeatureScope scope(masm(), FPU); |
if (elements_kind == EXTERNAL_FLOAT_ELEMENTS) { |
__ lwc1(result, MemOperand(scratch0(), additional_offset)); |
__ cvt_d_s(result, result); |
@@ -3052,7 +3052,7 @@ void LCodeGen::DoLoadKeyedFixedDoubleArray(LLoadKeyed* instr) { |
__ Addu(elements, elements, scratch); |
} |
if (CpuFeatures::IsSupported(FPU)) { |
- CpuFeatures::Scope scope(FPU); |
+ CpuFeatureScope scope(masm(), FPU); |
__ Addu(elements, elements, Operand(base_offset)); |
__ ldc1(result, MemOperand(elements)); |
if (instr->hydrogen()->RequiresHoleCheck()) { |
@@ -3515,7 +3515,7 @@ void LCodeGen::EmitIntegerMathAbs(LUnaryMathOperation* instr) { |
void LCodeGen::DoMathAbs(LUnaryMathOperation* instr) { |
- CpuFeatures::Scope scope(FPU); |
+ CpuFeatureScope scope(masm(), FPU); |
// Class for deferred case. |
class DeferredMathAbsTaggedHeapNumber: public LDeferredCode { |
public: |
@@ -3552,7 +3552,7 @@ void LCodeGen::DoMathAbs(LUnaryMathOperation* instr) { |
void LCodeGen::DoMathFloor(LUnaryMathOperation* instr) { |
- CpuFeatures::Scope scope(FPU); |
+ CpuFeatureScope scope(masm(), FPU); |
DoubleRegister input = ToDoubleRegister(instr->value()); |
Register result = ToRegister(instr->result()); |
Register scratch1 = scratch0(); |
@@ -3581,7 +3581,7 @@ void LCodeGen::DoMathFloor(LUnaryMathOperation* instr) { |
void LCodeGen::DoMathRound(LUnaryMathOperation* instr) { |
- CpuFeatures::Scope scope(FPU); |
+ CpuFeatureScope scope(masm(), FPU); |
DoubleRegister input = ToDoubleRegister(instr->value()); |
Register result = ToRegister(instr->result()); |
DoubleRegister double_scratch1 = ToDoubleRegister(instr->temp()); |
@@ -3658,7 +3658,7 @@ void LCodeGen::DoMathRound(LUnaryMathOperation* instr) { |
void LCodeGen::DoMathSqrt(LUnaryMathOperation* instr) { |
- CpuFeatures::Scope scope(FPU); |
+ CpuFeatureScope scope(masm(), FPU); |
DoubleRegister input = ToDoubleRegister(instr->value()); |
DoubleRegister result = ToDoubleRegister(instr->result()); |
__ sqrt_d(result, input); |
@@ -3666,7 +3666,7 @@ void LCodeGen::DoMathSqrt(LUnaryMathOperation* instr) { |
void LCodeGen::DoMathPowHalf(LUnaryMathOperation* instr) { |
- CpuFeatures::Scope scope(FPU); |
+ CpuFeatureScope scope(masm(), FPU); |
DoubleRegister input = ToDoubleRegister(instr->value()); |
DoubleRegister result = ToDoubleRegister(instr->result()); |
DoubleRegister temp = ToDoubleRegister(instr->temp()); |
@@ -3691,7 +3691,7 @@ void LCodeGen::DoMathPowHalf(LUnaryMathOperation* instr) { |
void LCodeGen::DoPower(LPower* instr) { |
- CpuFeatures::Scope scope(FPU); |
+ CpuFeatureScope scope(masm(), FPU); |
Representation exponent_type = instr->hydrogen()->right()->representation(); |
// Having marked this as a call, we can use any registers. |
// Just make sure that the input/output registers are the expected ones. |
@@ -3722,7 +3722,7 @@ void LCodeGen::DoPower(LPower* instr) { |
void LCodeGen::DoRandom(LRandom* instr) { |
- CpuFeatures::Scope scope(FPU); |
+ CpuFeatureScope scope(masm(), FPU); |
class DeferredDoRandom: public LDeferredCode { |
public: |
DeferredDoRandom(LCodeGen* codegen, LRandom* instr) |
@@ -3799,7 +3799,7 @@ void LCodeGen::DoDeferredRandom(LRandom* instr) { |
void LCodeGen::DoMathExp(LMathExp* instr) { |
- CpuFeatures::Scope scope(FPU); |
+ CpuFeatureScope scope(masm(), FPU); |
DoubleRegister input = ToDoubleRegister(instr->value()); |
DoubleRegister result = ToDoubleRegister(instr->result()); |
DoubleRegister double_scratch1 = ToDoubleRegister(instr->double_temp()); |
@@ -4075,7 +4075,7 @@ void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) { |
- CpuFeatures::Scope scope(FPU); |
+ CpuFeatureScope scope(masm(), FPU); |
Register external_pointer = ToRegister(instr->elements()); |
Register key = no_reg; |
ElementsKind elements_kind = instr->elements_kind(); |
@@ -4149,7 +4149,7 @@ void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) { |
void LCodeGen::DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr) { |
- CpuFeatures::Scope scope(FPU); |
+ CpuFeatureScope scope(masm(), FPU); |
DoubleRegister value = ToDoubleRegister(instr->value()); |
Register elements = ToRegister(instr->elements()); |
Register key = no_reg; |
@@ -4453,7 +4453,7 @@ void LCodeGen::DoStringLength(LStringLength* instr) { |
void LCodeGen::DoInteger32ToDouble(LInteger32ToDouble* instr) { |
- CpuFeatures::Scope scope(FPU); |
+ CpuFeatureScope scope(masm(), FPU); |
LOperand* input = instr->value(); |
ASSERT(input->IsRegister() || input->IsStackSlot()); |
LOperand* output = instr->result(); |
@@ -4471,7 +4471,7 @@ void LCodeGen::DoInteger32ToDouble(LInteger32ToDouble* instr) { |
void LCodeGen::DoUint32ToDouble(LUint32ToDouble* instr) { |
- CpuFeatures::Scope scope(FPU); |
+ CpuFeatureScope scope(masm(), FPU); |
LOperand* input = instr->value(); |
LOperand* output = instr->result(); |
@@ -4592,7 +4592,7 @@ void LCodeGen::DoDeferredNumberTagI(LInstruction* instr, |
__ Xor(src, src, Operand(0x80000000)); |
} |
if (CpuFeatures::IsSupported(FPU)) { |
- CpuFeatures::Scope scope(FPU); |
+ CpuFeatureScope scope(masm(), FPU); |
__ mtc1(src, dbl_scratch); |
__ cvt_d_w(dbl_scratch, dbl_scratch); |
} else { |
@@ -4604,7 +4604,7 @@ void LCodeGen::DoDeferredNumberTagI(LInstruction* instr, |
} |
} else { |
if (CpuFeatures::IsSupported(FPU)) { |
- CpuFeatures::Scope scope(FPU); |
+ CpuFeatureScope scope(masm(), FPU); |
__ mtc1(src, dbl_scratch); |
__ Cvt_d_uw(dbl_scratch, dbl_scratch, f22); |
} else { |
@@ -4644,7 +4644,7 @@ void LCodeGen::DoDeferredNumberTagI(LInstruction* instr, |
// number. |
__ bind(&done); |
if (CpuFeatures::IsSupported(FPU)) { |
- CpuFeatures::Scope scope(FPU); |
+ CpuFeatureScope scope(masm(), FPU); |
__ sdc1(dbl_scratch, MemOperand(dst, HeapNumber::kValueOffset)); |
} else { |
__ sw(sfpd_lo, MemOperand(dst, HeapNumber::kMantissaOffset)); |
@@ -4683,7 +4683,7 @@ void LCodeGen::DoNumberTagD(LNumberTagD* instr) { |
Label done; |
if (convert_hole) { |
if (CpuFeatures::IsSupported(FPU)) { |
- CpuFeatures::Scope scope(FPU); |
+ CpuFeatureScope scope(masm(), FPU); |
DoubleRegister input_reg = ToDoubleRegister(instr->value()); |
__ BranchF(&no_special_nan_handling, NULL, eq, input_reg, input_reg); |
__ Move(reg, scratch0(), input_reg); |
@@ -4729,7 +4729,7 @@ void LCodeGen::DoNumberTagD(LNumberTagD* instr) { |
} |
__ bind(deferred->exit()); |
if (CpuFeatures::IsSupported(FPU)) { |
- CpuFeatures::Scope scope(FPU); |
+ CpuFeatureScope scope(masm(), FPU); |
__ sdc1(input_reg, MemOperand(reg, HeapNumber::kValueOffset)); |
} else { |
__ sw(sfpd_lo, MemOperand(reg, HeapNumber::kValueOffset)); |
@@ -4784,7 +4784,7 @@ void LCodeGen::EmitNumberUntagD(Register input_reg, |
LEnvironment* env, |
NumberUntagDMode mode) { |
Register scratch = scratch0(); |
- CpuFeatures::Scope scope(FPU); |
+ CpuFeatureScope scope(masm(), FPU); |
Label load_smi, heap_number, done; |
@@ -4862,7 +4862,7 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) { |
// of the if. |
if (instr->truncating()) { |
- CpuFeatures::Scope scope(FPU); |
+ CpuFeatureScope scope(masm(), FPU); |
Register scratch3 = ToRegister(instr->temp2()); |
FPURegister single_scratch = double_scratch.low(); |
ASSERT(!scratch3.is(input_reg) && |
@@ -5117,7 +5117,7 @@ void LCodeGen::DoCheckMaps(LCheckMaps* instr) { |
void LCodeGen::DoClampDToUint8(LClampDToUint8* instr) { |
- CpuFeatures::Scope vfp_scope(FPU); |
+ CpuFeatureScope vfp_scope(masm(), FPU); |
DoubleRegister value_reg = ToDoubleRegister(instr->unclamped()); |
Register result_reg = ToRegister(instr->result()); |
DoubleRegister temp_reg = ToDoubleRegister(instr->temp()); |
@@ -5126,7 +5126,7 @@ void LCodeGen::DoClampDToUint8(LClampDToUint8* instr) { |
void LCodeGen::DoClampIToUint8(LClampIToUint8* instr) { |
- CpuFeatures::Scope vfp_scope(FPU); |
+ CpuFeatureScope vfp_scope(masm(), FPU); |
Register unclamped_reg = ToRegister(instr->unclamped()); |
Register result_reg = ToRegister(instr->result()); |
__ ClampUint8(result_reg, unclamped_reg); |
@@ -5134,7 +5134,7 @@ void LCodeGen::DoClampIToUint8(LClampIToUint8* instr) { |
void LCodeGen::DoClampTToUint8(LClampTToUint8* instr) { |
- CpuFeatures::Scope vfp_scope(FPU); |
+ CpuFeatureScope vfp_scope(masm(), FPU); |
Register scratch = scratch0(); |
Register input_reg = ToRegister(instr->unclamped()); |
Register result_reg = ToRegister(instr->result()); |