| Index: src/arm64/code-stubs-arm64.cc
|
| diff --git a/src/arm64/code-stubs-arm64.cc b/src/arm64/code-stubs-arm64.cc
|
| index 086576931c334c5d900e8ebafe3393ba91ecc70f..77465bec69c0271fa3271040fb1f96dc44efa7c6 100644
|
| --- a/src/arm64/code-stubs-arm64.cc
|
| +++ b/src/arm64/code-stubs-arm64.cc
|
| @@ -2747,136 +2747,6 @@ static void GenerateRecordCallTarget(MacroAssembler* masm, Register argc,
|
| }
|
|
|
|
|
| -static void LoadCompilerHints(MacroAssembler* masm) {
|
| - // ----------- S t a t e -------------
|
| - // -- x1 : the function to call
|
| - // -----------------------------------
|
| - // Do not transform the receiver for strict mode functions.
|
| - __ Ldr(x3, FieldMemOperand(x1, JSFunction::kSharedFunctionInfoOffset));
|
| - __ Ldr(w4, FieldMemOperand(x3, SharedFunctionInfo::kCompilerHintsOffset));
|
| -}
|
| -
|
| -
|
| -static void EmitContinueIfStrictOrNative(MacroAssembler* masm, Label* cont) {
|
| - // ----------- S t a t e -------------
|
| - // -- a1 : the function to call
|
| - // -- x3 : the shared function info
|
| - // -- w4 : the compiler info hints from the shared function info
|
| - // -----------------------------------
|
| - __ Tbnz(w4, SharedFunctionInfo::kStrictModeFunction, cont);
|
| -
|
| - // Do not transform the receiver for native (Compilerhints already in x3).
|
| - __ Tbnz(w4, SharedFunctionInfo::kNative, cont);
|
| -}
|
| -
|
| -
|
| -static void EmitSlowCase(MacroAssembler* masm, int argc) {
|
| - __ Mov(x0, argc);
|
| - __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
|
| -}
|
| -
|
| -
|
| -static void EmitWrapCase(MacroAssembler* masm, int argc, Label* cont) {
|
| - // Wrap the receiver and patch it back onto the stack.
|
| - { FrameScope frame_scope(masm, StackFrame::INTERNAL);
|
| - __ Push(x1);
|
| - __ Mov(x0, x3);
|
| - ToObjectStub stub(masm->isolate());
|
| - __ CallStub(&stub);
|
| - __ Pop(x1);
|
| - }
|
| - __ Poke(x0, argc * kPointerSize);
|
| - __ B(cont);
|
| -}
|
| -
|
| -
|
| -static void EmitClassConstructorCallCheck(MacroAssembler* masm) {
|
| - // ----------- S t a t e -------------
|
| - // -- x1 : the function to call
|
| - // -- x3 : the shared function info
|
| - // -- w4 : the shared function's compiler hints
|
| - // -----------------------------------
|
| - // ClassConstructor Check: ES6 section 9.2.1 [[Call]]
|
| - Label non_class_constructor;
|
| - __ TestAndBranchIfAllClear(
|
| - w4, (1 << SharedFunctionInfo::kIsDefaultConstructor) |
|
| - (1 << SharedFunctionInfo::kIsSubclassConstructor) |
|
| - (1 << SharedFunctionInfo::kIsBaseConstructor),
|
| - &non_class_constructor);
|
| - // If we call a classConstructor Function throw a TypeError
|
| - // indirectly via the CallFunction builtin.
|
| - __ Jump(masm->isolate()->builtins()->CallFunction(), RelocInfo::CODE_TARGET);
|
| - __ bind(&non_class_constructor);
|
| -}
|
| -
|
| -
|
| -static void CallFunctionNoFeedback(MacroAssembler* masm,
|
| - int argc, bool needs_checks,
|
| - bool call_as_method) {
|
| - // x1 function the function to call
|
| - Register function = x1;
|
| - Register type = x4;
|
| - Label slow, wrap, cont;
|
| -
|
| - // TODO(jbramley): This function has a lot of unnamed registers. Name them,
|
| - // and tidy things up a bit.
|
| -
|
| - if (needs_checks) {
|
| - // Check that the function is really a JavaScript function.
|
| - __ JumpIfSmi(function, &slow);
|
| -
|
| - // Goto slow case if we do not have a function.
|
| - __ JumpIfNotObjectType(function, x10, type, JS_FUNCTION_TYPE, &slow);
|
| - }
|
| -
|
| - LoadCompilerHints(masm);
|
| - EmitClassConstructorCallCheck(masm);
|
| -
|
| - // Fast-case: Invoke the function now.
|
| - // x1 function pushed function
|
| - ParameterCount actual(argc);
|
| -
|
| - if (call_as_method) {
|
| - if (needs_checks) {
|
| - EmitContinueIfStrictOrNative(masm, &cont);
|
| - }
|
| -
|
| - // Compute the receiver in sloppy mode.
|
| - __ Peek(x3, argc * kPointerSize);
|
| -
|
| - if (needs_checks) {
|
| - __ JumpIfSmi(x3, &wrap);
|
| - __ JumpIfObjectType(x3, x10, type, FIRST_SPEC_OBJECT_TYPE, &wrap, lt);
|
| - } else {
|
| - __ B(&wrap);
|
| - }
|
| -
|
| - __ Bind(&cont);
|
| - }
|
| -
|
| - __ InvokeFunction(function,
|
| - actual,
|
| - JUMP_FUNCTION,
|
| - NullCallWrapper());
|
| - if (needs_checks) {
|
| - // Slow-case: Non-function called.
|
| - __ Bind(&slow);
|
| - EmitSlowCase(masm, argc);
|
| - }
|
| -
|
| - if (call_as_method) {
|
| - __ Bind(&wrap);
|
| - EmitWrapCase(masm, argc, &cont);
|
| - }
|
| -}
|
| -
|
| -
|
| -void CallFunctionStub::Generate(MacroAssembler* masm) {
|
| - ASM_LOCATION("CallFunctionStub::Generate");
|
| - CallFunctionNoFeedback(masm, argc(), NeedsChecks(), CallAsMethod());
|
| -}
|
| -
|
| -
|
| void CallConstructStub::Generate(MacroAssembler* masm) {
|
| ASM_LOCATION("CallConstructStub::Generate");
|
| // x0 : number of arguments
|
| @@ -2976,9 +2846,7 @@ void CallICStub::Generate(MacroAssembler* masm) {
|
| FixedArray::OffsetOfElementAt(TypeFeedbackVector::kWithTypesIndex);
|
| const int generic_offset =
|
| FixedArray::OffsetOfElementAt(TypeFeedbackVector::kGenericCountIndex);
|
| - Label extra_checks_or_miss, slow_start;
|
| - Label slow, wrap, cont;
|
| - Label have_js_function;
|
| + Label extra_checks_or_miss, call;
|
| int argc = arg_count();
|
| ParameterCount actual(argc);
|
|
|
| @@ -3023,40 +2891,14 @@ void CallICStub::Generate(MacroAssembler* masm) {
|
| __ Add(index, index, Operand(Smi::FromInt(CallICNexus::kCallCountIncrement)));
|
| __ Str(index, FieldMemOperand(feedback_vector, 0));
|
|
|
| - __ bind(&have_js_function);
|
| -
|
| - LoadCompilerHints(masm);
|
| - EmitClassConstructorCallCheck(masm);
|
| -
|
| - if (CallAsMethod()) {
|
| - EmitContinueIfStrictOrNative(masm, &cont);
|
| -
|
| - // Compute the receiver in sloppy mode.
|
| - __ Peek(x3, argc * kPointerSize);
|
| -
|
| - __ JumpIfSmi(x3, &wrap);
|
| - __ JumpIfObjectType(x3, x10, type, FIRST_SPEC_OBJECT_TYPE, &wrap, lt);
|
| -
|
| - __ Bind(&cont);
|
| - }
|
| -
|
| - __ InvokeFunction(function,
|
| - actual,
|
| - JUMP_FUNCTION,
|
| - NullCallWrapper());
|
| -
|
| - __ bind(&slow);
|
| - EmitSlowCase(masm, argc);
|
| -
|
| - if (CallAsMethod()) {
|
| - __ bind(&wrap);
|
| - EmitWrapCase(masm, argc, &cont);
|
| - }
|
| + __ bind(&call);
|
| + __ Mov(x0, argc);
|
| + __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
|
|
|
| __ bind(&extra_checks_or_miss);
|
| Label uninitialized, miss, not_allocation_site;
|
|
|
| - __ JumpIfRoot(x4, Heap::kmegamorphic_symbolRootIndex, &slow_start);
|
| + __ JumpIfRoot(x4, Heap::kmegamorphic_symbolRootIndex, &call);
|
|
|
| __ Ldr(x5, FieldMemOperand(x4, HeapObject::kMapOffset));
|
| __ JumpIfNotRoot(x5, Heap::kAllocationSiteMapRootIndex, ¬_allocation_site);
|
| @@ -3088,7 +2930,7 @@ void CallICStub::Generate(MacroAssembler* masm) {
|
| __ Ldr(x4, FieldMemOperand(feedback_vector, generic_offset));
|
| __ Adds(x4, x4, Operand(Smi::FromInt(1)));
|
| __ Str(x4, FieldMemOperand(feedback_vector, generic_offset));
|
| - __ B(&slow_start);
|
| + __ B(&call);
|
|
|
| __ bind(&uninitialized);
|
|
|
| @@ -3127,22 +2969,14 @@ void CallICStub::Generate(MacroAssembler* masm) {
|
| __ Pop(function);
|
| }
|
|
|
| - __ B(&have_js_function);
|
| + __ B(&call);
|
|
|
| // We are here because tracing is on or we encountered a MISS case we can't
|
| // handle here.
|
| __ bind(&miss);
|
| GenerateMiss(masm);
|
|
|
| - // the slow case
|
| - __ bind(&slow_start);
|
| -
|
| - // Check that the function is really a JavaScript function.
|
| - __ JumpIfSmi(function, &slow);
|
| -
|
| - // Goto slow case if we do not have a function.
|
| - __ JumpIfNotObjectType(function, x10, type, JS_FUNCTION_TYPE, &slow);
|
| - __ B(&have_js_function);
|
| + __ B(&call);
|
| }
|
|
|
|
|
|
|