diff options
Diffstat (limited to 'src/crankshaft/arm64/lithium-codegen-arm64.cc')
-rw-r--r-- | src/crankshaft/arm64/lithium-codegen-arm64.cc | 60 |
1 files changed, 29 insertions, 31 deletions
diff --git a/src/crankshaft/arm64/lithium-codegen-arm64.cc b/src/crankshaft/arm64/lithium-codegen-arm64.cc index 4d8e6615..81529244 100644 --- a/src/crankshaft/arm64/lithium-codegen-arm64.cc +++ b/src/crankshaft/arm64/lithium-codegen-arm64.cc @@ -6,6 +6,7 @@ #include "src/arm64/frames-arm64.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/arm64/lithium-gap-resolver-arm64.h" @@ -618,14 +619,17 @@ 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()); __ Mov(FastNewFunctionContextDescriptor::SlotsRegister(), 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(x1); + __ Push(Smi::FromInt(info()->scope()->scope_type())); __ CallRuntime(Runtime::kNewFunctionContext); } } @@ -720,7 +724,7 @@ bool LCodeGen::GenerateDeferredCode() { DCHECK(info()->IsStub()); frame_is_built_ = true; __ Push(lr, fp); - __ Mov(fp, Smi::FromInt(StackFrame::STUB)); + __ Mov(fp, StackFrame::TypeToMarker(StackFrame::STUB)); __ Push(fp); __ Add(fp, __ StackPointer(), TypedFrameConstants::kFixedFrameSizeFromFp); @@ -799,7 +803,7 @@ bool LCodeGen::GenerateJumpTable() { UseScratchRegisterScope temps(masm()); Register stub_marker = temps.AcquireX(); __ Bind(&needs_frame); - __ Mov(stub_marker, Smi::FromInt(StackFrame::STUB)); + __ Mov(stub_marker, StackFrame::TypeToMarker(StackFrame::STUB)); __ Push(cp, stub_marker); __ Add(fp, __ StackPointer(), 2 * kPointerSize); } @@ -1614,7 +1618,7 @@ void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); __ Ldr(result, MemOperand(previous_fp, CommonFrameConstants::kContextOrFrameTypeOffset)); - __ Cmp(result, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)); + __ Cmp(result, StackFrame::TypeToMarker(StackFrame::ARGUMENTS_ADAPTOR)); __ Csel(result, fp, previous_fp, ne); } else { __ Mov(result, fp); @@ -1861,12 +1865,6 @@ void LCodeGen::DoBranch(LBranch* instr) { __ B(eq, true_label); } - if (expected & ToBooleanHint::kSimdValue) { - // SIMD value -> true. - __ CompareInstanceType(map, scratch, SIMD128_VALUE_TYPE); - __ B(eq, true_label); - } - if (expected & ToBooleanHint::kHeapNumber) { Label not_heap_number; __ JumpIfNotRoot(map, Heap::kHeapNumberMapRootIndex, ¬_heap_number); @@ -2020,6 +2018,13 @@ void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) { void LCodeGen::DoDeferredInstanceMigration(LCheckMaps* instr, Register object) { Register temp = ToRegister(instr->temp()); + Label deopt, done; + // If the map is not deprecated the migration attempt does not make sense. + __ Ldr(temp, FieldMemOperand(object, HeapObject::kMapOffset)); + __ Ldr(temp, FieldMemOperand(temp, Map::kBitField3Offset)); + __ Tst(temp, Operand(Map::Deprecated::kMask)); + __ B(eq, &deopt); + { PushSafepointRegistersScope scope(this); __ Push(object); @@ -2029,7 +2034,13 @@ void LCodeGen::DoDeferredInstanceMigration(LCheckMaps* instr, Register object) { instr->pointer_map(), 1, Safepoint::kNoLazyDeopt); __ StoreToSafepointRegisterSlot(x0, temp); } - DeoptimizeIfSmi(temp, instr, DeoptimizeReason::kInstanceMigrationFailed); + __ Tst(temp, Operand(kSmiTagMask)); + __ B(ne, &done); + + __ bind(&deopt); + Deoptimize(instr, DeoptimizeReason::kInstanceMigrationFailed); + + __ bind(&done); } @@ -2829,7 +2840,8 @@ void LCodeGen::PrepareForTailCall(const ParameterCount& actual, __ Ldr(scratch2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); __ Ldr(scratch3, MemOperand(scratch2, StandardFrameConstants::kContextOffset)); - __ Cmp(scratch3, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); + __ Cmp(scratch3, + Operand(StackFrame::TypeToMarker(StackFrame::ARGUMENTS_ADAPTOR))); __ B(ne, &no_arguments_adaptor); // Drop current frame and load arguments count from arguments adaptor frame. @@ -3243,7 +3255,7 @@ void LCodeGen::DoLoadKeyedFixed(LLoadKeyedFixed* instr) { // protector cell contains (Smi) Isolate::kProtectorValid. Otherwise // it needs to bail out. __ LoadRoot(result, Heap::kArrayProtectorRootIndex); - __ Ldr(result, FieldMemOperand(result, Cell::kValueOffset)); + __ Ldr(result, FieldMemOperand(result, PropertyCell::kValueOffset)); __ Cmp(result, Operand(Smi::FromInt(Isolate::kProtectorValid))); DeoptimizeIf(ne, instr, DeoptimizeReason::kHole); } @@ -4595,7 +4607,7 @@ void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) { // TODO(all): if Mov could handle object in new space then it could be used // here. - __ LoadHeapObject(scratch1, instr->hydrogen()->pairs()); + __ LoadHeapObject(scratch1, instr->hydrogen()->declarations()); __ Mov(scratch2, Smi::FromInt(instr->hydrogen()->flags())); __ Push(scratch1, scratch2); __ LoadHeapObject(scratch1, instr->hydrogen()->feedback_vector()); @@ -5435,20 +5447,6 @@ void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) { EmitTestAndBranch(instr, eq, scratch, (1 << Map::kIsCallable) | (1 << Map::kIsUndetectable)); -// clang-format off -#define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ - } else if (String::Equals(type_name, factory->type##_string())) { \ - DCHECK((instr->temp1() != NULL) && (instr->temp2() != NULL)); \ - Register map = ToRegister(instr->temp1()); \ - \ - __ JumpIfSmi(value, false_label); \ - __ Ldr(map, FieldMemOperand(value, HeapObject::kMapOffset)); \ - __ CompareRoot(map, Heap::k##Type##MapRootIndex); \ - EmitBranch(instr, eq); - SIMD128_TYPES(SIMD128_TYPE) -#undef SIMD128_TYPE - // clang-format on - } else { __ B(false_label); } |