diff options
Diffstat (limited to 'deps/v8/src/crankshaft/mips/lithium-codegen-mips.cc')
-rw-r--r-- | deps/v8/src/crankshaft/mips/lithium-codegen-mips.cc | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/deps/v8/src/crankshaft/mips/lithium-codegen-mips.cc b/deps/v8/src/crankshaft/mips/lithium-codegen-mips.cc index abbf2085c6..36019cc94d 100644 --- a/deps/v8/src/crankshaft/mips/lithium-codegen-mips.cc +++ b/deps/v8/src/crankshaft/mips/lithium-codegen-mips.cc @@ -28,6 +28,7 @@ #include "src/crankshaft/mips/lithium-codegen-mips.h" #include "src/base/bits.h" +#include "src/builtins/builtins-constructor.h" #include "src/code-factory.h" #include "src/code-stubs.h" #include "src/crankshaft/hydrogen-osr.h" @@ -202,15 +203,18 @@ void LCodeGen::DoPrologue(LPrologue* instr) { __ CallRuntime(Runtime::kNewScriptContext); deopt_mode = Safepoint::kLazyDeopt; } else { - if (slots <= FastNewFunctionContextStub::kMaximumSlots) { - FastNewFunctionContextStub stub(isolate()); + if (slots <= + ConstructorBuiltinsAssembler::MaximumFunctionContextSlots()) { + Callable callable = CodeFactory::FastNewFunctionContext( + isolate(), info()->scope()->scope_type()); __ li(FastNewFunctionContextDescriptor::SlotsRegister(), Operand(slots)); - __ CallStub(&stub); - // Result of FastNewFunctionContextStub is always in new space. + __ Call(callable.code(), RelocInfo::CODE_TARGET); + // Result of the FastNewFunctionContext builtin is always in new space. need_write_barrier = false; } else { __ push(a1); + __ Push(Smi::FromInt(info()->scope()->scope_type())); __ CallRuntime(Runtime::kNewFunctionContext); } } @@ -1764,18 +1768,18 @@ void LCodeGen::DoMathMinMax(LMathMinMax* instr) { FPURegister left_reg = ToDoubleRegister(left); FPURegister right_reg = ToDoubleRegister(right); FPURegister result_reg = ToDoubleRegister(instr->result()); + Label nan, done; if (operation == HMathMinMax::kMathMax) { - __ MaxNaNCheck_d(result_reg, left_reg, right_reg, &nan); + __ Float64Max(result_reg, left_reg, right_reg, &nan); } else { DCHECK(operation == HMathMinMax::kMathMin); - __ MinNaNCheck_d(result_reg, left_reg, right_reg, &nan); + __ Float64Min(result_reg, left_reg, right_reg, &nan); } __ Branch(&done); __ bind(&nan); - __ LoadRoot(scratch, Heap::kNanValueRootIndex); - __ ldc1(result_reg, FieldMemOperand(scratch, HeapNumber::kValueOffset)); + __ add_d(result_reg, left_reg, right_reg); __ bind(&done); } @@ -2799,7 +2803,7 @@ void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) { // protector cell contains (Smi) Isolate::kProtectorValid. Otherwise // it needs to bail out. __ LoadRoot(result, Heap::kArrayProtectorRootIndex); - __ lw(result, FieldMemOperand(result, Cell::kValueOffset)); + __ lw(result, FieldMemOperand(result, PropertyCell::kValueOffset)); DeoptimizeIf(ne, instr, DeoptimizeReason::kHole, result, Operand(Smi::FromInt(Isolate::kProtectorValid))); } @@ -3058,7 +3062,7 @@ void LCodeGen::DoContext(LContext* instr) { void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) { DCHECK(ToRegister(instr->context()).is(cp)); - __ li(scratch0(), instr->hydrogen()->pairs()); + __ li(scratch0(), instr->hydrogen()->declarations()); __ li(scratch1(), Operand(Smi::FromInt(instr->hydrogen()->flags()))); __ Push(scratch0(), scratch1()); __ li(scratch0(), instr->hydrogen()->feedback_vector()); @@ -4016,13 +4020,19 @@ void LCodeGen::DoDeferredMaybeGrowElements(LMaybeGrowElements* instr) { if (Smi::IsValid(int_key)) { __ li(a3, Operand(Smi::FromInt(int_key))); } else { - // We should never get here at runtime because there is a smi check on - // the key before this point. - __ stop("expected smi"); + Abort(kArrayIndexConstantValueTooBig); } } else { - __ mov(a3, ToRegister(key)); - __ SmiTag(a3); + Label is_smi; + __ SmiTagCheckOverflow(a3, ToRegister(key), at); + // Deopt if the key is outside Smi range. The stub expects Smi and would + // bump the elements into dictionary mode (and trigger a deopt) anyways. + __ BranchOnNoOverflow(&is_smi, at); + RestoreRegistersStateStub stub(isolate()); + __ push(ra); + __ CallStub(&stub); + DeoptimizeIf(al, instr, DeoptimizeReason::kOverflow); + __ bind(&is_smi); } GrowArrayElementsStub stub(isolate(), instr->hydrogen()->kind()); |